mgis-fenics-demos issueshttps://gitlab.enpc.fr/navier-fenics/mgis-fenics-demos/-/issues2021-09-27T08:00:28Zhttps://gitlab.enpc.fr/navier-fenics/mgis-fenics-demos/-/issues/1Correction to the computation of the norm of the damage correction in the pha...2021-09-27T08:00:28ZThomas HelferCorrection to the computation of the norm of the damage correction in the phase-field demoThe magnitude of the damage correction between two iterations is computed error as follows:
````python
# Solve damage d-problem
dval_old = d.vector().get_local()
problem_d.solve(d.vector())
# Residual on ...The magnitude of the damage correction between two iterations is computed error as follows:
````python
# Solve damage d-problem
dval_old = d.vector().get_local()
problem_d.solve(d.vector())
# Residual on damage increment
dval = d.vector().get_local()
res = np.max(dval - dval_old)
````
In my understanding, it should be:
````python
res = np.max(np.abs(dval - dval_old))
````https://gitlab.enpc.fr/navier-fenics/mgis-fenics-demos/-/issues/2Demos `finite_strain_elastoplasticity` and `phase_field` fail with FEniCS 2019.22023-07-18T08:35:44ZThomas HelferDemos `finite_strain_elastoplasticity` and `phase_field` fail with FEniCS 2019.2Here is the output of the `phase_field` demo:
```
$ python3 mgis_fenics_phase_field.py
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-...Here is the output of the `phase_field` demo:
```
$ python3 mgis_fenics_phase_field.py
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Traceback (most recent call last):
File "/home/tom/codes/mgis-fenics-demos/tests/phase_field/mgis_fenics_phase_field.py", line 316, in <module>
problem_u.register_external_state_variable("Damage", d)
File "/home/tom/codes/mgis/master/install-d4058ad4/lib/python3.10/site-packages/mgis/fenics/nonlinear_problem.py", line 256, in register_external_state_variable
{name: Var(self.u, expression, name, self.material.hypothesis)})
File "/home/tom/codes/mgis/master/install-d4058ad4/lib/python3.10/site-packages/mgis/fenics/gradient_flux.py", line 161, in __init__
Gradient.__init__(self, variable, expression, name, hypothesis)
File "/home/tom/codes/mgis/master/install-d4058ad4/lib/python3.10/site-packages/mgis/fenics/gradient_flux.py", line 118, in __init__
shape = ufl.shape(self.expression)
File "/usr/lib/python3/dist-packages/ufl/operators.py", line 52, in shape
f = as_ufl(f)
File "/usr/lib/python3/dist-packages/ufl/constantvalue.py", line 438, in as_ufl
raise UFLValueError("Invalid type conversion: %s can not be converted"
ufl.log.UFLValueError: Invalid type conversion: Damage can not be converted to any UFL type.
```