I’m trying to model plasticity in FEniCSX and I can’t find any simple examples of it anywhere. All I’m trying to achieve is a simple uniaxial tension test by simply changing the DBCs on one side, under linear hardening. The only example of plasticity in FEniCSX I can find here and run is @tianjuxue 's immense program for thermo-elasto-plasticity, which is hard to prune down to the basics of what I’m looking for.
I am using DOLFINx version: 0.5.2, I think upgrading it to 0.6.0 might solve the issue. Can you please tell me how do I upgrade it ? Assuming that v0.6.0 is compatible with the already installed DOLFINy.
Thanks.
Go to the repository that you cloned on your computer.
Write git checkout 43610f4d6cc265adf926d82b898d20c894e69559. Then reinstall the software with python3 -m pip install . —upgrade
How did you download dolfiny?
As it is a git repository, the most natural way of downloading it would be git clone https://github.com/michalhabera/dolfiny
which would give you the possibility to use the git features of the repo.
Thanks again @dokken for solving the issue. Code is working smoothly now, just one last question, can I get mathematical reference which are used to build this demo ? I have messaged @michalhabera to provide the same if it is possible.
Thanks @dokken and @violetus, I think I’ve got parts of the demo working now, but the solver does not seem to converge. I’m using dolfinx 0.6.0.0 and dolfiny 0.1, I changed a couple of lines of solid_plasticity_monolithic.py:
I = ufl.Identity(u.geometric_dimension()) # noqa: E741
to
I = ufl.Identity(len(u)) # noqa: E741
As neither of the old functions seem to exist. This then runs, assembles the mesh and begins solving, but as soon as the loading bc is greater than zero, the snes solver doesn’t converge.
+++ Processing load factor μ = 0.0000
### SNES iteration 0
# sub 0 |x|=0.000e+00 |dx|=0.000e+00 |r|=0.000e+00 (u)
# sub 1 |x|=0.000e+00 |dx|=0.000e+00 |r|=0.000e+00 (P)
# sub 2 |x|=0.000e+00 |dx|=0.000e+00 |r|=0.000e+00 (h)
# sub 3 |x|=0.000e+00 |dx|=0.000e+00 |r|=0.000e+00 (B)
# all |x|=0.000e+00 |dx|=0.000e+00 |r|=0.000e+00
+++ Processing load factor μ = 0.0400
### SNES iteration 0
# sub 0 |x|=0.000e+00 |dx|=0.000e+00 |r|=1.263e-03 (u)
# sub 1 |x|=0.000e+00 |dx|=0.000e+00 |r|=0.000e+00 (P)
# sub 2 |x|=0.000e+00 |dx|=0.000e+00 |r|=0.000e+00 (h)
# sub 3 |x|=0.000e+00 |dx|=0.000e+00 |r|=0.000e+00 (B)
# all |x|=0.000e+00 |dx|=0.000e+00 |r|=1.263e-03
Traceback (most recent call last):
File "/root/dolfiny/demo/plasticity/solid_plasticity_monolithic1.py", line 216, in <module>
assert problem.snes.getConvergedReason() > 0, "Nonlinear solver did not converge!"
AssertionError: Nonlinear solver did not converge!