Translate from v 0.7.3 to v 0.8.0 a mixed space code
I have a porous media code which works in dolfinx v 0.7.3 and computes in approximately 4 minutes.
Based on previous posts, I understood that the changes were in the element / mixed_element now from basix.ufl and FunctionSpace replaced by functionspace.
Therefore I changed:
# Updated mesh space
updated_mesh_space = FunctionSpace(mesh, mesh.ufl_domain().ufl_coordinate_element())
# Parameter space
DG0_space = FunctionSpace(mesh, ("DG", 0))
# Mixed Space (R2,R) -> (u,p)
CG1_v = VectorElement("CG", mesh.ufl_cell(), 1)
CG2 = VectorElement("CG", mesh.ufl_cell(), 2)
CG1 = FiniteElement("CG", mesh.ufl_cell(), 1)
#
CG1v_space = FunctionSpace(mesh, CG1_v)
CG2_space = FunctionSpace(mesh, CG2)
CG1_space = FunctionSpace(mesh, CG1)
MS = FunctionSpace(mesh, MixedElement([CG2,CG1,CG1]))
#
tensor_elem = TensorElement("CG", mesh.ufl_cell(), degree=1, shape=(3,3))
tensor_space = FunctionSpace(mesh, tensor_elem)
to
# Updated mesh space
updated_mesh_space = functionspace(mesh, mesh.ufl_domain().ufl_coordinate_element())
# Parameter space
DG0_space = functionspace(mesh, ("DG", 0))
# Mixed Space (R2,R) -> (u,p)
P1_v = element("P", mesh.topology.cell_name(), degree=1, shape=(mesh.topology.dim,))
P2 = element("P", mesh.topology.cell_name(), degree=2, shape=(mesh.topology.dim,))
P1 = element("P", mesh.topology.cell_name(), degree=1)
#
P1v_space = functionspace(mesh, P1_v)
P2_space = functionspace(mesh, P2)
P1_space = functionspace(mesh, P1)
MS = functionspace(mesh=mesh, element=mixed_element([P2,P1,P1]))
#
tensor_elem = element("P", mesh.topology.cell_name(), degree=1, shape=(3,3))
tensor_space = functionspace(mesh, tensor_elem)
This changed performed, the solver is not converging anymore and leads to ‘nan’ values. Please note that the code does work in 0.7.3 with the changes.
The codes / log_outputs and the mesh can be downloaded here.
Thank you for the help.