Skip to content

Commit 7c690bd

Browse files
authored
Merge pull request #59 from bleyerj/remove-dimension-assert
mgis.fenics - Remove dimension assert and fix missing time step
2 parents 2c6e921 + 2286c64 commit 7c690bd

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

bindings/python/mgis/fenics/gradient_flux.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ def __init__(self, variable, expression, name, symmetric=None):
7878
if symmetric is None:
7979
self.expression = expression
8080
elif symmetric:
81-
if self.variable.geometric_dimension() == 2:
81+
if ufl.shape(expression) == (2, 2):
8282
self.expression = as_vector([symmetric_tensor_to_vector(expression)[i] for i in range(4)])
8383
else:
8484
self.expression = symmetric_tensor_to_vector(expression)
8585
else:
86-
if self.variable.geometric_dimension() == 2:
86+
if ufl.shape(expression) == (2, 2):
8787
self.expression = as_vector([nonsymmetric_tensor_to_vector(expression)[i] for i in range(5)])
8888
else:
8989
self.expression = nonsymmetric_tensor_to_vector(expression)

bindings/python/mgis/fenics/nonlinear_problem.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ def __init__(self, u, material, quadrature_degree=2, bcs=None):
6666
self._dummy_function = Function(self.W0)
6767

6868
if self.material.hypothesis == mgis_bv.Hypothesis.Tridimensional:
69-
assert self.u.geometric_dimension()==3, "Conflicting geometric dimension and material hypothesis"
69+
if self.u.geometric_dimension()!=3:
70+
warning("Conflicting geometric dimension and material hypothesis")
7071
else:
71-
assert self.u.geometric_dimension()==2, "Conflicting geometric dimension and material hypothesis"
72+
if self.u.geometric_dimension()!=2:
73+
warning("Conflicting geometric dimension and material hypothesis")
7274

7375
if bcs is None:
7476
self.bcs = []
@@ -383,7 +385,7 @@ def update_constitutive_law(self):
383385
self.material.update_external_state_variables(self.state_variables["external"])
384386
# integrate the behaviour
385387
mgis_bv.integrate(self.material.data_manager, self.integration_type,
386-
0, 0, self.material.data_manager.n);
388+
self.dt, 0, self.material.data_manager.n);
387389
# getting the stress and consistent tangent operator back to
388390
# the FEniCS world.
389391
self.update_fluxes()

0 commit comments

Comments
 (0)