Dear colleagues,
Hi! I am using Dolfin 2019.2.0.dev0 with FSM for plasticity analysis in python. I have noticed that after certain number of load steps (for loop iterations) the program crashes with following notification:
Traceback (most recent call last):
File "code.py", line 174, in <module>
eps_p_eq_list.append( fsm_constitutive_update_1.eps_p_eq() )
File "/usr/local/lib/python3.6/dist-packages/fsm-0.0.2-py3.6.egg/fsm/update.py", line 74, in eps_p_eq
return BuildHistoryWrapper(self._cpp_object.eps_p_eq(), self.Function)
File "/usr/local/lib/python3.6/dist-packages/fsm-0.0.2-py3.6.egg/fsm/update.py", line 40, in BuildHistoryWrapper
space = dolfin.FunctionSpace(mesh, element)
File "/usr/local/lib/python3.6/dist-packages/dolfin/function/functionspace.py", line 31, in __init__
self._init_from_ufl(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/dolfin/function/functionspace.py", line 50, in _init_from_ufl
dolfin_dofmap = cpp.fem.DofMap(ufc_dofmap, mesh)
RuntimeError: *** Error: Duplication of MPI communicator failed (MPI_Comm_dup
My question is that did anyone else also face similar issue in framework of FSM? Your sharing of experience would be value-able for me to continue my development in FSM. Thank you!
minimal example based upon one of the python demo of fsm to represent the error is following:
from dolfin import *
import fsm
class DirichletBoundaryY(SubDomain):
def inside(self, x, on_boundary):
return (x[1] < DOLFIN_EPS)
mesh = UnitCubeMesh(7, 7, 7)
scheme = "default"
degree = 3
dx = Measure("dx")
dx = dx(degree=degree, scheme=scheme)
V = VectorFunctionSpace(mesh, "Lagrange", 2)
element_t = VectorElement("Quadrature", mesh.ufl_cell(), degree=3, dim=36, quad_scheme=scheme)
Vt = FunctionSpace(mesh, element_t)
element_s = VectorElement("Quadrature", mesh.ufl_cell(), degree=3, dim=6, quad_scheme=scheme)
Vs = FunctionSpace(mesh, element_s)
zero = Constant(0.0)
bc0 = DirichletBC(V.sub(0), zero, DirichletBoundaryY(), method="pointwise")
bc1 = DirichletBC(V.sub(1), zero, DirichletBoundaryY(), method="pointwise")
bc2 = DirichletBC(V.sub(2), zero, DirichletBoundaryY(), method="pointwise")
bcs = [bc0, bc1, bc2]
u = Function(V, name="u")
def eps(u):
return as_vector([u[i].dx(i) for i in range(3)] + [u[i].dx(j) + u[j].dx(i) for i, j in [(0, 1), (0, 2), (1, 2)]])
Qdef = fsm.UFLQuadratureFunction(eps(u), element_s, mesh) # representation?
# lists
fsm_constitutive_update_list = []
eps_p_eq_list = []
for cell in cells(mesh):
nu = 0.3
yield_stress = 9e6
E = 5e11
E_t = 0.3*E
hardening_parameter = E_t/(1.0 - E_t/E)
J2_1 = fsm.python.cpp.plasticity_model.VonMises(E, nu, yield_stress, hardening_parameter) # .self ?
fsm_constitutive_update_1 = fsm.ConstitutiveUpdate(Qdef, J2_1)
fsm_constitutive_update_list.append(fsm_constitutive_update_1)
print("appending eps_p_eq():", cell, mesh.num_cells())
eps_p_eq_list.append( fsm_constitutive_update_1.eps_p_eq() )