Skip to content

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

Description

@YzzIzzY

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))

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions