Hi
I have a 3D elasticity problem. I created my mesh in GMSH. Here is a the code:
from dolfin import *
mesh = Mesh("B.xml")
facets = MeshFunction("size_t", mesh, "B_facet_region.xml")
ds = Measure("ds", subdomain_data=facets)
n = FacetNormal(mesh)
V = VectorFunctionSpace(mesh, 'CG', degree=2)
E = 5e6
nu =0.3
F1 = 2000.
F2 = 2000.
mu = E/2/(1+nu)
lmbda = E*nu/(1+nu)/(1-2*nu)
def eps(v):
return sym(grad(v))
def sigma(v):
return lmbda * tr(eps(v)) * Identity(3) + 2.0 * mu * eps(v)
du = TrialFunction(V)
u_ = TestFunction(V)
a = inner(sigma(du), eps(u_)) * dx
# Defining Linear form
l = inner(-F1 * n, u_) * ds(7) + inner(-F2 * n, u_) * ds(6) + inner(-F2 * n, u_) * ds(5)
bc_1 = DirichletBC(V, Constant((0., 0.,0.)), facets, 1)
bc_2 = DirichletBC(V, Constant((0., 0.,0.)), facets, 2)
bc_all = [bc_1,bc_2]
u = Function(V, name="Displacement")
solve(a == l, u, bc_all,solver_parameters={'linear_solver':'mumps'})
I solved exactly the same problem with the same mesh and boundary conditions with another software (It took 30 s) while solving it with FEniCS takes almost 120s. Does anybody know what I can do to improve the performance of the code to make it faster?
Thanks!