OOFem

About the development of the FEM module/workbench.

Moderator: bernd

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

Re: OOFem

Post by bernd »

I will have a look.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: OOFem

Post by bernd »

They will be assigned if needed ...

For example for the CalculiX mesh they are not needed. Thus for calculix they are only needed for constraints like force or pressure, thus they are assigned inside each constraint writer. For example on calculix frequency analysis without constraints they are not needed at all. Z88 needs them for mesh writing too. Means they are needed for any input file writing. Thus they are assigned just at start of writing. They are assigned here: https://github.com/HarryvL/FreeCAD/blob ... py#L66-L69

Means for oofem your would copy the lines from above to https://github.com/HarryvL/FreeCAD/blob ... ter.py#L75 if you need them in any file write (which will be true if you need them for mesh writing).

hope that helps bernd
User avatar
HarryvL
Veteran
Posts: 1275
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: OOFem

Post by HarryvL »

Thanks. I will give it a try.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: OOFem

Post by bernd »

BTW: Does oofem has its own mesh format like Z88? If it would support any of the known standard mesh format FreeCAD supports already you would not need to write a mesh exporter for oofem in FreeCAD like I had to do it for Z88.

Bernd
User avatar
HarryvL
Veteran
Posts: 1275
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: OOFem

Post by HarryvL »

AFAIK the mesh information is typed in the input file in a connectivity format (global node numbers by element) unique to OOFEM. The developers make available a converter script (unv2oofem) that turns UNV files into OOFEM format, but going via UNV would be a roundabout way to get to the required result. Not sure this answers your question.
User avatar
HarryvL
Veteran
Posts: 1275
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: OOFem

Post by HarryvL »

PS: what standard mesh format does CCX use and how is this written to the input file?
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: OOFem

Post by bernd »

HarryvL wrote: Thu Nov 01, 2018 10:19 pm PS: what standard mesh format does CCX use and how is this written to the input file?
ccx uses Abaqus inp file format. It is written here: https://github.com/berndhahnebach/FreeC ... ter.py#L82 The writer ist done in C++ see https://github.com/berndhahnebach/FreeC ... .cpp#L1185

Some Formats are done in C++ See https://github.com/berndhahnebach/FreeC ... .cpp#L1575

to write a mesh in various formats just load the 3D example from Start WB

Code: Select all

expath = '/home/hugo/Desktop/'
mesh = App.ActiveDocument.Box_Mesh.FemMesh

mesh.write(expath + 'mesh.inp')
mesh.write(expath + 'mesh.vtk')
mesh.write(expath + 'mesh.stl')
mesh.write(expath + 'mesh.unv')
for Z88 you would need to import the Python module first ...

Code: Select all

expath = '/home/hugo/Desktop/'
from feminout.importZ88Mesh import export as z88export
z88export([App.ActiveDocument.Box_Mesh], expath + 'mesh.txt')
The z88 one should be improved to be as easy as the c++ ones. But this is of low priority for me. Ahh element table and nodes are retrieved in the export def see: https://github.com/berndhahnebach/FreeC ... py#L73-L75
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: OOFem

Post by bernd »

HarryvL wrote: Thu Nov 01, 2018 9:57 pm AFAIK the mesh information is typed in the input file in a connectivity format (global node numbers by element) unique to OOFEM. The developers make available a converter script (unv2oofem) that turns UNV files into OOFEM format, but going via UNV would be a roundabout way to get to the required result. Not sure this answers your question.
similar to z88. They have a converter too. My first idea was use the converter, but than I realised to write an exporter just for nodes and tet10 elements is not difficult and just some lines of code. With this one can export lots of analysis already. All other element types where added step by step later on.

cheers bernd
User avatar
HarryvL
Veteran
Posts: 1275
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: OOFem

Post by HarryvL »

bernd wrote: Fri Nov 02, 2018 6:23 am similar to z88. They have a converter too. My first idea was use the converter, but than I realised to write an exporter just for nodes and tet10 elements is not difficult and just some lines of code. With this one can export lots of analysis already. All other element types where added step by step later on.

cheers bernd
That's exactly the thought process I went through for OOFEM :D
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: OOFem

Post by bernd »

8-)
Post Reply