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

discretizing a zero linear form yields an error #98

Open
campospinto opened this issue May 12, 2021 · 0 comments
Open

discretizing a zero linear form yields an error #98

campospinto opened this issue May 12, 2021 · 0 comments

Comments

@campospinto
Copy link
Collaborator

The following code runs fine:

    domain = Line()
    V = ScalarFunctionSpace('V', domain, kind='H1')
    x = domain.coordinates
    v = element_of(V, name='F')
    f = x
    l  = LinearForm(v, integral(domain, f*v))
    domain_h = discretize(domain, ncells=(2,))
    Vh = discretize(V, domain_h, degree=(2,))
    lh = discretize(l, domain_h, Vh)

but with

    f = x-x

it gives an error

    lh = discretize(l, domain_h, Vh)
  File "/Users/campos/Work/codes/psydac/psydac/feec/multipatch/api.py", line 130, in discretize
    return discretize_single_patch(expr, *args, **kwargs)
  File "/Users/campos/Work/codes/psydac/psydac/api/discretization.py", line 528, in discretize
    return DiscreteLinearForm(a, kernel_expr, *args, **kwargs)
  File "/Users/campos/Work/codes/psydac/psydac/api/fem.py", line 466, in __init__
    BasicDiscrete.__init__(self, expr, kernel_expr, quad_order=quad_order, **kwargs)
  File "/Users/campos/Work/codes/psydac/psydac/api/basic.py", line 257, in __init__
    raise ValueError('> Expecting only one kernel')
ValueError: > Expecting only one kernel

Probably because the 0 expression is overly simplified (TerminalExpr gives ())

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

No branches or pull requests

1 participant