Is it possible to impose more than a Periodic Boundary condition?
13 days ago by
I'm try to solve a problem of nonlinear elasticity. It is an hollow cylinder to which I impose a finite torsion on the top basis. To solve it I use two periodic boundary conditions:
1) I use a BoxMesh and so I have to impose its closure, hence the face x has to be periodic.
2) the displacement u_r and u_z on the top and on the bottom feces has to be periodic.
So, I find an example on internet, such as https://fenicsproject.org/qa/3203/periodic-bcs/index.html
However, I have some questions:
1) Why do you need to map also the side of the x and x and not only the corresponding faces?
2) I try to implement the vectorial poisson problem in 2D. the code is this one
from fenics import * class PeriodicBoundary(SubDomain): def inside(self,x,on_boundary): return bool((x < DOLFIN_EPS and x > -DOLFIN_EPS) or (x < DOLFIN_EPS and x > -DOLFIN_EPS) and on_boundary) def map(self, x, y): TOL = 0.001 if near(x,0,TOL): y = x - 1.0 y = x - 1.0 elif near(x,0,TOL): y = x - 1.0 y = x - 1.0 else: y = x y = x #Construction of the space mesh = UnitSquareMesh(10,10) Velem = VectorElement("Lagrange", mesh.ufl_cell(), 1) Relem = VectorElement("R", mesh.ufl_cell(), 0, 2) VPRelem = MixedElement([Velem, Relem]) V = FunctionSpace(mesh, VPRelem, constrained_domain=PeriodicBoundary()) #Function of the problem ul = Function(V) u, l = split(ul) #Variational problem u, l = TrialFunctions(V) v, s = TestFunctions(V) f = Expression(("20*c*c*cos(2*c*x)*cos(4*c*x)","1.0"), c = DOLFIN_PI, degree = 2) #Define variational problem a = inner(grad(u),grad(v))*dx + inner(s,u)*dx + inner(l,v)*dx L = inner(f,v)*dx #Compute the solution solve(a == L, ul) #Save the solution file = File("periodic.pvd") file << ul.sub(0)
where I impose that the displacement is periodic in all the directions. But, depending on the source term, the result in preview does not respect the periodic boundary condition.
Is that possible that there is a competition among periodic boundary condition, source term and function with mean-value equal to zero.
For instance, if the source term is a sinus, instead of a cosines, the PBC are not respected.
Why this happen? Maybe the PBC act only in the perpendicular direction?
Thank for the help
Community: FEniCS Project
Please login to add an answer/comment or follow this question.