PeriodicBC problem
Hello
I am getting an error in implementing periodic bc. I must be making a silly mistake but cannot find it. Here is the code
from dolfin import *
degree = 1
# Height of channel = 2 h
h = 0.1
# Length of channel = 2 L
L = 1.0
class PeriodicBoundar
# Left side x = -L
def inside(self, x, on_boundary):
return x[0]+L < DOLFIN_EPS and on_boundary
# Map right side x=+L to left side
def map(self, x, y):
y[0] = x[0] - 2*L
y[1] = x[1]
mesh = Rectangle(-L, -h, L, h, 25, 26)
V = FunctionSpace(mesh, "CG", degree)
perbc = PeriodicBC(V, PeriodicBoundary())
The error I get is
Building mapping between periodic degrees of freedom.
At coordinate: x = -2.92 -0.1
Traceback (most recent call last):
File "test.py", line 23, in <module>
perbc = PeriodicBC(V, pp)
File "/Applications/
_cpp.
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
***
*** https:/
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------
*** Error: Unable to apply periodic boundary condition.
*** Reason: Could not find a pair of matching degrees of freedom.
*** Where: This error was encountered inside PeriodicBC.cpp.
*** -------
But the point x = -2.92 -0.1 is on the top boundary.
praveen
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Praveen C for more information if necessary.