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

Stuck or very Slow check is_linear_expression in LinearForm and BilinearForm #121

Open
YzzIzzY opened this issue Dec 1, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@YzzIzzY
Copy link

YzzIzzY commented Dec 1, 2022

is_linear_expression checks whether the expression given in a LinearForm (or a BilinearForm resp.ly) instance is actually linear (bi-linear resp.ly). For some expressions, known to be linear, the check is really slow or even stuck in a loop. This might be due to the current version used of sympy in sympde.
As an example, you may import Laplacian from psydac.examples.poisson_2d_mapping and TargetMapping from sympde.topology.analytical_mapping and run

params   = dict(c1 = 0, c2 = 0, k = 0.3, D = 0.2)
mapping  = TargetMapping('F', **params)

lapl  = Laplacian(mapping)
s, t  = mapping.logical_coordinates
x, y  = mapping.expressions
k     = params['k']
D     = params['D']
kx    = 2 * pi / (1 - k + D)
ky    = 2 * pi / (1 + k)
phi = (1 - s**8) * sin(kx * (x - 0.5)) * cos(ky * y)
rho = - lapl(phi)

logical_domain = Square('Omega', bounds1 = (0, 1), bounds2 = (0, 2 * pi))
domain  = mapping(logical_domain)
V0 = ScalarFunctionSpace('V0', domain)

u0, v0 = elements_of(V0, names = 'u0, v0')
rhs = LinearForm(v0, integral(domain, rho * v0))
@yguclu yguclu added the bug Something isn't working label Dec 6, 2022
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