Prescribed displacement on one point
I'am trying to prescribed a Dirichlet boundary condition on only one point located on the boundary of a body.
I use the following script (I report only the part of the script in which I try to prescribe the boundary condition, the rest of the script is classical and works well).
def P0(x, on_boundary):
bc_P0 = DirichletBC(V, Constant((0, 0, 0)) , P0)
And I obtained the following error:
*** Warning: Found no facets matching domain for boundary condition.
It seems that the definition of a boundary does not work for only one point.
If someone can help me, it would be great.
Thank you in avance
Something like this worked for me:
P0 = 'near(x, 0.0) && near(x, 0.0) && near(x, 0.0)' bc_P0 = DirichletBC(V, Constant(0.0, 0.0, 0.0), P0, 'pointwise')
class Pinpoint(SubDomain): def __init__(self, coords): self.coords = np.array(coords) SubDomain.__init__(self) def move(self, coords): self.coords[:] = np.array(coords) def inside(self, x, on_boundary): return np.linalg.norm(x-self.coords) < DOLFIN_EPS