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

NullOperator for TestFunction #117

Open
bmxam opened this issue Jul 5, 2024 · 1 comment
Open

NullOperator for TestFunction #117

bmxam opened this issue Jul 5, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@bmxam
Copy link
Member

bmxam commented Jul 5, 2024

This is not exactly what we talked about during the live session, but the idea is to introduce Bcube.NullOperator(v) and/or Bcube.NullOperator(v, n) to enable the following MWE:

using Bcube
using LinearAlgebra

mesh = rectangle_mesh(4, 4)
Γ = InteriorFaceDomain(mesh)
dΓ = Measure(Γ, 1)
nΓ = get_face_normals(Γ)

function f_sca(vi, vj, nij)
    # Today:
    return 0.0 * vi

    # Tomorrow (doesn't work yet)?
    return Bcube.NullOperator()
    return Bcube.NullOperator(vi)
    return Bcube.NullOperator(vi, nij)
end

function f_vec(vi, vj, nij)
    # Today:
    return 0.0 * vi[1] + 0.0 * vi[2]  nij

    # Tomorrow (doesn't work yet )?
    return Bcube.NullOperator()
    return Bcube.NullOperator(vi)
    return Bcube.NullOperator(vi, nij)
end

# Scalar
Usca = TrialFESpace(FunctionSpace(:Lagrange, 0), mesh)
Vsca = TestFESpace(Usca)

l(v) = (f_sca  (side_n(v), side_p(v), side_n(nΓ)))dΓ
assemble_linear(l, Vsca)

# Vector
Uvec = TrialFESpace(FunctionSpace(:Lagrange, 0), mesh; size = 2)
Vvec = TestFESpace(Uvec)
V = MultiFESpace(Vsca, Vvec)

l(v) = (f_vec  (side_n(v), side_p(v), side_n(nΓ)))dΓ
assemble_linear(l, V)
@bmxam bmxam added the enhancement New feature or request label Jul 5, 2024
@bmxam
Copy link
Member Author

bmxam commented Jul 5, 2024

the MWE is now correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants