The following is the definition of the periodic boundary condition:
EDITED BY FB
and also applied to the function space:
EDITED BY FB
But, I found that the results did not change before and after applying the periodic boundary condition
The following is the definition of the periodic boundary condition:
EDITED BY FB
and also applied to the function space:
EDITED BY FB
But, I found that the results did not change before and after applying the periodic boundary condition
Please post a complete (but minimal) example, and make sure that the code is wrapped with “```”.
See also Read before posting: How do I get my question answered? - #4 by nate .
I’m so sorry about it. The problem I’m currently working on is applying centrifugal loads to a sector model and taking into account rotationally symmetric boundary conditions. The version of the fenics I’m using is 2018. The following is part of my code.
class PeriodicBoundary(SubDomain):
def init(self, angle_deg):
super().init()
self.angle = np.deg2rad(angle_deg)
def inside(self, x, on_boundary):
return bool(near(x[0], 20.0 * np.cos(self.angle)) and near(x[1], 20.0 * np.sin(self.angle)) and on_boundary)
def map(self, x, y):
y[0] = np.cos(self.angle) * x[0] - np.sin(self.angle) * x[1]
y[1] = np.sin(self.angle) * x[0] + np.cos(self.angle) * x[1]
y[2] = x[2]
pbc = PeriodicBoundary(30)
V = VectorFunctionSpace(mesh, ‘CG’, 1, constrained_domain=pbc)
Q = FunctionSpace(mesh, “CG”, 1, constrained_domain=pbc)
However, I found that the results did not change before and after applying the periodic boundary condition.
Without the mesh there is no way one can Give any guidance.
Sorry about that I forgot to post the picture of my mesh. As shown in the picture, my grid area is a 30° sector model with an inner circle radius of 20mm and an outer circle radius of 50mm. And I want to apply periodic boundary conditions in the 0° and 30° regions of this sector region.
One would still need the mesh to reproduce the error.
Note that you need to be careful with ensuring that the mapping from one side to the other matches node to node exactly (as you are using legacy fenics).
With dolfinx (and dolfinx_mpc) you can use non-matching periodic interfaces, see
As you said, the new version does solve this problem. But I just want to try to implement the periodic boundary conditions on a 3D structures like this in the old version (FEniCS), yet I’m not sure if it is possible.
You would have to inspect the constrained dog map to see if the number of dogs has been appropriately reduced.
As you haven’t provided any way for anyone to reproduce your issue, you would have to do this yourself.