Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composition vs no-compo #130

Closed
bmxam opened this issue Aug 28, 2024 · 0 comments · Fixed by #131
Closed

Composition vs no-compo #130

bmxam opened this issue Aug 28, 2024 · 0 comments · Fixed by #131

Comments

@bmxam
Copy link
Member

bmxam commented Aug 28, 2024

module NoParticle
using Bcube
using LinearAlgebra
using StaticArrays


function run()
    # Settings
    Zin = 4
    Zout = 8
    nr = 3
    nz = 3
    degree = 1
    qdeg = 2 * degree + 1 # quad degree


    # Mesh and measures
    mesh = rectangle_mesh(nr, nz; ymin=Zin, ymax=Zout, bnd_names=("AXIS", "WALL", "INLET", "OUTLET"))
    Ω = CellDomain(mesh)
    dΩ = Measure(Ω, qdeg)


    # FESpace
    fs = FunctionSpace(:Lagrange, degree)
    U_up = TrialFESpace(fs, mesh)
    U_ur = TrialFESpace(fs, mesh)
    U_uz = TrialFESpace(fs, mesh)

    V_up = TestFESpace(U_up)
    V_ur = TestFESpace(U_ur)
    V_uz = TestFESpace(U_uz)

    U = MultiFESpace(U_up, U_ur, U_uz)
    V = MultiFESpace(V_up, V_ur, V_uz)

    # Bilinear forms


    function test(u, ∇u, v, ∇v)
        up, ur, uz = u
        vp, vr, vz = v
        ∇up, ∇ur, ∇uz = ∇u

        ∂u∂r = ∇ur[1]
        return ∂u∂r * vp
    end

    a((up, ur, uz), (vp, vr, vz)) = ((ur)  SA[1, 0] * vp)dΩ # OK
    assemble_bilinear(a, U, V)
    println("success for a")

    b(u, v) = (test  (u, map(∇, u), v, map(∇, v)))dΩ # KO
    assemble_bilinear(b, U, V) # error
    println("success for b")
end

run()

end
@ghislainb ghislainb linked a pull request Aug 28, 2024 that will close this issue
ghislainb added a commit that referenced this issue Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant