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

Fix bug regarding the norm of a cross-product of two functions #351

Open
jowezarek opened this issue Oct 26, 2023 · 0 comments
Open

Fix bug regarding the norm of a cross-product of two functions #351

jowezarek opened this issue Oct 26, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jowezarek
Copy link
Contributor

When trying to compute the L2-norm of the cross product J x H on the unit cube, with J, H both being three-dimensional vectors fields belonging to V1 = Hcurl, an Assertion error is raised.

Example code looks like this:

J, H = elements_of(derham.V1, names='J, H')

expr = Cross_3d(J, H)
# or alternatively
# expr = cross(J, H)

l2_norm_JxH = Norm(expr, domain, kind='l2')
l2_norm_JxH_h = discretize(l2_norm_JxH, domain_h, derham_h.V1, backend=backend)

The error message reads:

Traceback (most recent call last):
  File "/home/jubuntu/Dokumente/psydac_gitlab/psydac/psydac/api/beltrami/norm_test.py", line 65, in <module>
    l2_norm_JxH_h = discretize(l2_norm_JxH, domain_h, derham_h.V1, backend=backend)
  File "/home/jubuntu/Dokumente/psydac_gitlab/psydac/psydac/api/discretization.py", line 473, in discretize
    return DiscreteFunctional(a, kernel_expr, *args, **kwargs)
  File "/home/jubuntu/Dokumente/psydac_gitlab/psydac/psydac/api/fem.py", line 1426, in __init__
    BasicDiscrete.__init__(self, expr, kernel_expr, comm=comm, root=0, discrete_space=discrete_space,
  File "/home/jubuntu/Dokumente/psydac_gitlab/psydac/psydac/api/basic.py", line 297, in __init__
    BasicCodeGen.__init__(self, expr, folder=folder, comm=comm, root=root, discrete_space=discrete_space,
  File "/home/jubuntu/Dokumente/psydac_gitlab/psydac/psydac/api/basic.py", line 108, in __init__
    ast = self._create_ast( expr=expr, tag=tag, discrete_space=discrete_space,
  File "/home/jubuntu/Dokumente/psydac_gitlab/psydac/psydac/api/basic.py", line 338, in _create_ast
    return AST(expr, kernel_expr, discrete_space, mapping_space=mapping_space,
  File "/home/jubuntu/Dokumente/psydac_gitlab/psydac/psydac/api/ast/fem.py", line 335, in __init__
    fields_degrees      = get_degrees(fields, spaces)
  File "/home/jubuntu/Dokumente/psydac_gitlab/psydac/psydac/api/ast/fem.py", line 227, in get_degrees
    assert len(funcs) == len(degrees)
AssertionError

More information about funcs and degrees:
len(funcs): 6, (H[0], H[1], H[2], J[0], J[1], J[2]), len(degrees): 3

@jowezarek jowezarek added the bug Something isn't working label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants