BAMresearch / fenics-constitutive

Complex constitutive models beyond the FEniCS UFL.
https://bamresearch.github.io/fenics-constitutive
MIT License
13 stars 2 forks source link

Fenicsx rewrite -- Python code #31

Closed srosenbu closed 5 months ago

srosenbu commented 1 year ago

Fenicsx is now stable enough and well documented enough to be used. The Python code is written for legacy fenics and should be replaced. Also Fenicsx allows for the direct manipulation of entries in the Function array, whereas in legacy fenics we can only work on copies. In legacy Fenics v.vector().get_local() returns a copy of the vector. In Fenicsx v.vector.array returns a numpy vector that points to the data directly -> No copy

Exploiting this, could reduce the memory use of the library by up to 2/3

pdiercks commented 1 year ago

With regard to the python code, the only class to rewrite would be MechanicsProblem (unless I am overlooking something).

For the general design, I think that we could keep the existing structure, that is we have global arrays holding the strain, stress and stiffness (algorithmic) tangent values (for all integration points) which are then passed by reference (no copy) and used by IpLoop which manages which integration point should use what kind of constitutive law to compute stresses (and tangents) from strain.