Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bindings/python/mgis/fenics/gradient_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ def __init__(self, variable, expression, name, symmetric=None):
if symmetric is None:
self.expression = expression
elif symmetric:
if self.variable.geometric_dimension() == 2:
if ufl.shape(expression) == (2, 2):
self.expression = as_vector([symmetric_tensor_to_vector(expression)[i] for i in range(4)])
else:
self.expression = symmetric_tensor_to_vector(expression)
else:
if self.variable.geometric_dimension() == 2:
if ufl.shape(expression) == (2, 2):
self.expression = as_vector([nonsymmetric_tensor_to_vector(expression)[i] for i in range(5)])
else:
self.expression = nonsymmetric_tensor_to_vector(expression)
Expand Down
8 changes: 5 additions & 3 deletions bindings/python/mgis/fenics/nonlinear_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ def __init__(self, u, material, quadrature_degree=2, bcs=None):
self._dummy_function = Function(self.W0)

if self.material.hypothesis == mgis_bv.Hypothesis.Tridimensional:
assert self.u.geometric_dimension()==3, "Conflicting geometric dimension and material hypothesis"
if self.u.geometric_dimension()!=3:
warning("Conflicting geometric dimension and material hypothesis")
else:
assert self.u.geometric_dimension()==2, "Conflicting geometric dimension and material hypothesis"
if self.u.geometric_dimension()!=2:
warning("Conflicting geometric dimension and material hypothesis")

if bcs is None:
self.bcs = []
Expand Down Expand Up @@ -383,7 +385,7 @@ def update_constitutive_law(self):
self.material.update_external_state_variables(self.state_variables["external"])
# integrate the behaviour
mgis_bv.integrate(self.material.data_manager, self.integration_type,
0, 0, self.material.data_manager.n);
self.dt, 0, self.material.data_manager.n);
# getting the stress and consistent tangent operator back to
# the FEniCS world.
self.update_fluxes()
Expand Down