So i am trying to implement topology implementation in 3d (2d works fine) the problem is boundary condition idk if my conditions are acting correctly here is a small snippet
Boundary conditions and load
class LeftFace(SubDomain):
def inside(self, x, on_boundary):
return near(x[0], 0.0, DOLFIN_EPS)
class RightFace(SubDomain):
def inside(self, x, on_boundary):
return near(x[0], 6.0, DOLFIN_EPS)
class TopFace(SubDomain):
def inside(self, x, on_boundary):
return (on_boundary and near(x[1], 1.0, DOLFIN_EPS) and
(0.10 <= x[0] <= 5.90) and (0.1 <= x[2] <= 0.9))
facets = MeshFunction(“size_t”, mesh, mesh.topology().dim() - 1, 0)
TopFace().mark(facets, 3)
facets = MeshFunction(“size_t”, mesh, mesh.topology().dim() - 1, 0)
LeftFace().mark(facets, 1)
RightFace().mark(facets, 2)
TopFace().mark(facets, 3)
Apply boundary conditions
bc_left = DirichletBC(V_u, Constant((0.0, 0.0, 0.0)), facets, 1) # Fixed left face
bc_right_y = DirichletBC(V_u.sub(1), Constant(0.0), facets, 2) # Restrict y motion
bc_right_z = DirichletBC(V_u.sub(2), Constant(0.0), facets, 2) # Restrict z motion
bcs = [bc_left, bc_right_y, bc_right_z]
Load definition
ds = Measure(“ds”, domain=mesh, subdomain_data=facets)
load = Constant((0.0, -10.0 , 0.0)) # Load applied in negative y-direction
L = inner(load, v) * ds(3)