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

Norm of H(curl)-conforming FemField #400

Open
alex-m-h opened this issue Apr 3, 2024 · 0 comments
Open

Norm of H(curl)-conforming FemField #400

alex-m-h opened this issue Apr 3, 2024 · 0 comments
Labels
codegen Automatic code generation FEM API Objects describing finite element concepts

Comments

@alex-m-h
Copy link

alex-m-h commented Apr 3, 2024

When one tries to compute the L2-norm of a H(curl)-conforming FemField, it has to be done by converting the symbolic field into a SymPy ImmutableDenseMatrix object, e.g.

domain = Cube(name='domain')
V = VectorFunctionSpace(name='V', domain=domain, kind='hcurl')

v = element_of(V, name='v')
l2_norm_sym = Norm(ImmutableDenseMatrix([v[0], v[1], v[2]]), domain=domain, kind='l2')

domain_h = discretize(domain, ncells=[5,5,5], periodic=[False, False, False])
V_h = discretize(V, domain_h, degree=[3,3,3])

l2_norm_discrete = discretize(l2_norm_sym, domain_h, V_h)

If instead the symbolic vector field is used directly to define the norm, i.e.

l2_norm_sym = Norm(v, domain=domain, kind='l2')

SymPy throws the exception
sympy.matrices.common.NonSquareMatrixError.

It would be more intuitive, if the symbolic vector field could be used directly to define the norm.

@alex-m-h alex-m-h added FEM API Objects describing finite element concepts codegen Automatic code generation labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen Automatic code generation FEM API Objects describing finite element concepts
Projects
None yet
Development

No branches or pull requests

1 participant