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

BUG: restricted mode in Lineareigenproblem for mixed problems. #3706

Open
karimnorouzi opened this issue Jul 25, 2024 · 0 comments
Open

BUG: restricted mode in Lineareigenproblem for mixed problems. #3706

karimnorouzi opened this issue Jul 25, 2024 · 0 comments
Labels

Comments

@karimnorouzi
Copy link

Restricted mode can not create restricted function space for mixed problems involving vectors

here is the code to reproduce the problem


from firedrake import *
mesh = UnitSquareMesh(32, 32)

left, right, bottom, top = 1, 2, 3, 4
V = VectorFunctionSpace(mesh, "CG", 2)
P = FunctionSpace(mesh, "CG", 1)
Z = V*P
z = TrialFunctions(Z)
u, p = z
dz = TestFunctions(Z)
du, dp = dz
mu = 1e1
eps = lambda u:0.5*(grad(u) + grad(u).T)

A = (2*mu*inner(eps(u), eps(du)) - dp*div(u) - p*div(du))*dx
M = (inner(u, du) + p*dp)*dx

bcs = [
       DirichletBC(Z.sub(0).sub(0), Constant(0), (left, right)),
       DirichletBC(Z.sub(0).sub(1), Constant(0), (bottom)),
       ]

opts = {"eps_gen_non_hermitian": None,
        "eps_largest_imaginary": None,
        "st_type": "shift",
        "eps_target": None,
        "st_pc_factor_shift_type": "NONZERO"}
n = 5
problem = LinearEigenproblem(A = A, M = M, bcs = bcs, restrict = True)
eigensolver = LinearEigensolver(problem, n_evals=5, solver_parameters= opts)
nconv = eigensolver.solve()

Error message
File ".../firedrake/src/firedrake/firedrake/functionspaceimpl.py", line 476, in init
raise ValueError("Can't create FunctionSpace for MixedElement")

ValueError: Can't create FunctionSpace for MixedElement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant