I am trying to solve an elasticity problem for a square domain. In my problem, the right-bottom and left-bottom corners are supported by the pin and roller supports, respectively. Also, I have fixed the displacement of the top boundary to a constant amount. After applying constant traction on the bottom boundary of the domain, I get the warning
Warning: Found no facets matching domain for boundary condition.
Can you please tell me why I am getting this error? I have attached my code as below:
import numpy as np from dolfin import * parameters["form_compiler"]["cpp_optimize"] = True parameters["form_compiler"]["representation"] = "uflacs" mesh = UnitSquareMesh(4, 4) V = VectorFunctionSpace(mesh, "CG", 1) def bottom(x, on_boundary): return x > DOLFIN_EPS and on_boundary def top(x, on_boundary): return x > 1 - DOLFIN_EPS and on_boundary boundary_subdomains = MeshFunction("size_t", mesh, mesh.topology().dim() - 1) boundary_subdomains.set_all(0) AutoSubDomain(bottom).mark(boundary_subdomains, 1) dss = ds(subdomain_data=boundary_subdomains) y_BC = Expression(("x", "1.2*x"), degree=1) BC1 = DirichletBC(V, y_BC, top) def pin(x): return x < DOLFIN_EPS and x < DOLFIN_EPS def roller(x): return x-1 < DOLFIN_EPS and x < DOLFIN_EPS BC_pin = DirichletBC(V, Constant((0, 0)), pin) BC_roller = DirichletBC(V.sub(1), Constant(0), roller) bcs = [BC1, BC_pin, BC_roller] # Define functions dy = TrialFunction(V) v = TestFunction(V) y = Function(V) y0 = Function(V) y_reference = Expression(("x","x"),degree=1) y.assign(project(y_reference, V)) #initial guess T = Constant((0, -1)) def W(y): F = grad(y) C = F.T*F J = det(F) energy = 0.5*tr(C) + (J-1)**2 return energy # Total potential energy Pi = W(y)*dx - dot(T, (y - y_reference))*dss(1) residual = derivative(Pi, y, v) jacobian = derivative(residual, y, dy) solve(residual == 0, y, bcs, J=jacobian)
Your help is much appreciated!