Hi. I’m trying to use Multimesh to solve an eigenvalue problem with two overlapping domains. This domain is a square, with two subsquares that have an overlap.
The MWE is:
from dolfin import *
from mshr import Rectangle, generate_mesh
# Geometrical Data #
L = 1.5 # Side of the Rectangle
h = 1.0 # Height of the Rectangle
o = 0.2 # Total overlapping Area
b = L*(1-o)/2 # Non Overlapping Side of the Rectangle
# MESHES
omega = MultiMesh()
domain = Rectangle(Point(0., 0), Point(L, h))
domain_left = domain and Rectangle(Point(0., 0), Point(b+L*o, h))
omega_left = generate_mesh(domain_left, 15)
omega.add(omega_left)
domain_right = domain and Rectangle(Point(b, 0), Point(L, h))
omega_right = generate_mesh(domain_right, 15)
omega.add(omega_right)
omega.build()
# Boundaries
class DirichletBoundary(SubDomain):
def inside(self, x, on_boundary):
return on_boundary
# FUNCTION SPACES #
V = MultiMeshFunctionSpace(omega, "Lagrange", 1)
u = TrialFunction(V)
v = TestFunction(V)
# Bilinear Forms
k = inner(grad(u), grad(v))*dX
m = u*v*dX
# Assembly
K = PETScMatrix()
K = assemble_multimesh(form=k, tensor=K)
boundary = DirichletBoundary()
bc = MultiMeshDirichletBC(V, Constant(0,), boundary)
bc.apply(K)
M = PETScMatrix()
M = assemble_multimesh(form=m, tensor=M)
# EigenSolver
solver0 = SLEPcEigenSolver(K,M)
solver0.parameters['spectrum'] = 'smallest magnitude'
solver0.parameters['tolerance'] = 1e-6
solver0.parameters['problem_type'] = 'pos_gen_non_hermitian'
solver0.solve(0)
r, c, rx, cx = solver0.get_eigenpair(0)
print("Target Frequency: ", sqrt(r))`
I get the following error:
Traceback (most recent call last):
File "/mnt/c/repos/Doutorado/FEniCS Scripts/SCHWARZ_MultiMesh.py", line 61, in <module>
r, c, rx, cx = solver0.get_eigenpair(0)
RuntimeError:
*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to extract eigenpair from SLEPc eigenvalue solver.
*** Reason: Requested eigenpair (0) has not been computed.
*** Where: This error was encountered inside SLEPcEigenSolver.cpp.
*** Process: 0
***
*** DOLFIN version: 2019.2.0.dev0
*** Git changeset: unknown
*** -------------------------------------------------------------------------