Documentation for FEM_MaterialMechanicalNonlinear

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Documentation for FEM_MaterialMechanicalNonlinear

Post by bernd »

User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Documentation for FEM_MaterialMechanicalNonlinear

Post by bernd »

Ahh and do not forget the unit test ... run the code from the link in FreeCAD python console ...

https://github.com/FreeCAD/FreeCAD/blob ... #L441-L444

the example is code ...
https://github.com/FreeCAD/FreeCAD/blob ... le.py#L149
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Documentation for FEM_MaterialMechanicalNonlinear

Post by jnxd »

bernd wrote: Sun Sep 12, 2021 1:29 pm BTW have you read https://github.com/FreeCAD/FreeCAD/blob ... entions.md ?
Not really, but I will read them before the next commit. Anything ticked you off?

EDIT: On a cursory look it seems it was because of using yp instead of a more verbose yield_point or breaking up the text before 100 lines (I'd say the break improves readability, but it can be changed).
Last edited by jnxd on Mon Sep 13, 2021 4:40 am, edited 1 time in total.
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Documentation for FEM_MaterialMechanicalNonlinear

Post by jnxd »

bernd wrote: Sun Sep 12, 2021 2:21 pm Ahh and do not forget the unit test ... run the code from the link in FreeCAD python console ...

https://github.com/FreeCAD/FreeCAD/blob ... #L441-L444

the example is code ...
https://github.com/FreeCAD/FreeCAD/blob ... le.py#L149
I did run the test, which eventually caught some bugs I had missed. However, I had to change the file (https://github.com/FreeCAD/FreeCAD/pull ... 1f27a2d16b) in that test, such that YieldPoint{1,2,3} in that file are replaced with YieldPoints.
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Documentation for FEM_MaterialMechanicalNonlinear

Post by jnxd »

bernd wrote: Sun Sep 12, 2021 1:28 pm ... https://github.com/FreeCAD/FreeCAD/blob ... msh.py#L81

this method needs to be implemented here too
Did a little monkey-see-monkey-do commit in the PR. Tested with a file saved from master (with old yield points).

Side notes:
  1. I noticed some lines to refresh some lists.

    Code: Select all

        def onDocumentRestored(self, obj):
            ...
            # Algorithm3D
            # refresh the list of known 3D algorithms for existing meshes
            # since some algos are meanwhile deprecated and new algos are available
            obj.Algorithm3D = MeshGmsh.known_mesh_algorithm_3D
     
    Something similar may eventually be needed for MaterialModelNonlinearity which for now only supports simple hardening. When that time comes, we might also need to add more properties instead of/in addition to yield point(s).
  2. This particular style of description of simple hardening may be specific to Calculix. Other solvers like Z88 or Elmer might use separate descriptions. If it is possible to store the numbers as a table instead of a list of strings with pairs, that could make life easier.
  3. IIRC there are also some restrictions that should be imposed, like plastic strain at first point is always zero, and the stresses should be in ascending order. Currently, I believe we can write arbitrary text instead of yield points and FC will make something out of it.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Documentation for FEM_MaterialMechanicalNonlinear

Post by bernd »

Totally true it will be difficault to implement a solverindependent nonlinear material. There are many different nonlinear material laws. Just calculix supports a wide range. The different material laws are treated differently on different solvers.

We will need some smart system for this. But step by step ...
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Documentation for FEM_MaterialMechanicalNonlinear

Post by bernd »

https://github.com/FreeCAD/FreeCAD/pull ... a2d16bR152

data structure ...
[ stress yield point 1, strain yield point 12, stress yield point 2, strain yield point 2, stress yield point 3, strain yield point 3, ... ]

I am not 100 % convinced if we should go for such a data structure?

This is even more important since we do not have a task panel to edit the data.
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Documentation for FEM_MaterialMechanicalNonlinear

Post by jnxd »

bernd wrote: Tue Sep 14, 2021 8:03 am https://github.com/FreeCAD/FreeCAD/pull ... a2d16bR152

data structure ...
[ stress yield point 1, strain yield point 12, stress yield point 2, strain yield point 2, stress yield point 3, strain yield point 3, ... ]

I am not 100 % convinced if we should go for such a data structure?

This is even more important since we do not have a task panel to edit the data.
I'm 100% sure we should NOT be going for this. It does add some machine readability (without having to use eval), but it'll also make the user more confused. What we need is something like std::list<std::pair<..> >.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Documentation for FEM_MaterialMechanicalNonlinear

Post by bernd »

jnxd wrote: Tue Sep 14, 2021 11:39 am
bernd wrote: Tue Sep 14, 2021 8:03 am https://github.com/FreeCAD/FreeCAD/pull ... a2d16bR152

data structure ...
[ stress yield point 1, strain yield point 12, stress yield point 2, strain yield point 2, stress yield point 3, strain yield point 3, ... ]

I am not 100 % convinced if we should go for such a data structure?

This is even more important since we do not have a task panel to edit the data.
I'm 100% sure we should NOT be going for this.
but it is used in your PR ... https://github.com/FreeCAD/FreeCAD/pull ... a2d16bR152
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Documentation for FEM_MaterialMechanicalNonlinear

Post by bernd »

jnxd wrote: Tue Sep 14, 2021 11:39 am
bernd wrote: Tue Sep 14, 2021 8:03 am data structure ...
[ stress yield point 1, strain yield point 12, stress yield point 2, strain yield point 2, stress yield point 3, strain yield point 3, ... ]
What we need is something like std::list<std::pair<..> >.
sounds good to me too. But there is no FreeCAD Property for this. AFAIK

What else freecad property types do we have? a dictionary. This could work too.

Two lists, one for the stress and one for the strain, but this is easy to make errors too.
Post Reply