Skip to content

Norm should accept VectorFunction objects #175

@alex-m-h

Description

@alex-m-h

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions