test request, multiple material

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: test request, multiple material

Post by PrzemoF »

Nice macro! Could you something like "this line":

Code: Select all

        output ='Error executing {}'.format(command)  <-- this line
        try:
            output = subprocess.check_output([command, '-1'], shell=True, stderr=subprocess.STDOUT,)
        except:
If gmsh crashes the macro crashes as well with error saying that output is not assigned:

Code: Select all

gmsh  /tmp/tmpPbCumz.step  -3 -format unv  -o /tmp/Box_Mesh -format unv   -algo netgen  -clmax 5.00  -order 2     -string "Geometry.OCCConnectFaces = 1;"
*** Error in `gmsh': malloc(): memory corruption: 0x0000000001c01eb0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x77a8d)[0x7f3e97f96a8d]
/lib64/libc.so.6(+0x8112e)[0x7f3e97fa012e]
/lib64/libc.so.6(__libc_malloc+0x6e)[0x7f3e97fa246e]
/lib64/libstdc++.so.6(_Znwm+0x18)[0x7f3e98584158]
/lib64/libstdc++.so.6(_Znam+0x9)[0x7f3e985841f9]
/lib64/libngmesh.so.0(_ZN6netgen10BASE_TABLEC1Ei+0x33)[0x7f3e95f02833]
/lib64/libngmesh.so.0(_ZN6netgen15IdentificationsC2ERNS_4MeshE+0x52)[0x7f3e95e961b2]
/lib64/libngmesh.so.0(_ZN6netgen4MeshC1Ev+0x46f)[0x7f3e95e54f5f]
/lib64/libGmsh.so.2.9(_ZN5nglib10Ng_NewMeshEv+0x33)[0x7f3e98fd3723]
/lib64/libGmsh.so.2.9(_Z20buildNetgenStructureP7GRegionbRSt6vectorIP7MVertexSaIS3_EE+0x44)[0x7f3e98e4f6f4]
/lib64/libGmsh.so.2.9(_ZN11meshGRegionclEP7GRegion+0x434)[0x7f3e98e50714]
/lib64/libGmsh.so.2.9(+0x56c1e3)[0x7f3e98de41e3]
/lib64/libGmsh.so.2.9(_Z12GenerateMeshP6GModeli+0x1143)[0x7f3e98de6c43]
/lib64/libGmsh.so.2.9(_ZN6GModel4meshEi+0x9)[0x7f3e98c81d59]
/lib64/libGmsh.so.2.9(_Z9GmshBatchv+0x2fa)[0x7f3e98ac51ea]
gmsh(main+0x92)[0x400f82]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7f3e97f3f700]
gmsh(_start+0x29)[0x4010b9]

Code: Select all

Error!!, sorry..Traceback (most recent call last):
  File "/home/przemo/.FreeCAD/FEM_GMSH_Mesh_bhb.FCMacro", line 230, in proceed
    FreeCAD.Console.PrintMessage(output)
UnboundLocalError: local variable 'output' referenced before assignment
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: test request, multiple material

Post by bernd »

Have you been successful?
PrzemoF wrote:Nice macro! Could you something like "this line": ...
Sure thanks for reporting. The macro is not finished yet. The connectfaces and sewfaces should be auto too. Ahh and I need to add this stuff viewtopic.php?f=18&t=10732&start=10 but all that mesh stuff is another part of the story ...
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: test request, multiple material

Post by PrzemoF »

Not really, but it's a gmsh problem - it keep crashing. I'll try again later on another computer.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: test request, multiple material

Post by bernd »

PrzemoF wrote:Not really, but it's a gmsh problem - it keep crashing. I'll try again later on another computer.
I could not resist ...
Attachments
wood-steel-fem1.fcstd
(104.38 KiB) Downloaded 42 times
Unbenannt.png
Unbenannt.png (245.65 KiB) Viewed 1797 times
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: test request, multiple material

Post by PrzemoF »

Thamks! :D
What version of gmsh do you use? I have 2.9.3
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: test request, multiple material

Post by bernd »

- In FreeCAD Make a coumpound of the two boxes
- export to step
- start gmsh gui
- in gmsh gui Tools --> Options --> Geometry --> Tab Genereral --> activate "Cut and merge faces"
- load step
- in tree --> click on mesh --> 3D
- File --> save as --> export to unv
- import into FreeCAD

2.10.0
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: test request, multiple material

Post by PrzemoF »

Thanks! I think we can get something similar (tha same?) with the gmsh macro and custom gmsh options set to:

Code: Select all

-string "Geometry.OCCConnectFaces=1;"
Pushing a piece of steel into ABS block:
FreeCAD_multi_mat.png
FreeCAD_multi_mat.png (162 KiB) Viewed 1788 times
Attachments
abs-steel-fem.fcstd
(131.28 KiB) Downloaded 45 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: test request, multiple material

Post by bernd »

PrzemoF wrote:Thanks! I think we can get something similar (tha same?) with the gmsh macro and custom gmsh options set to:

Code: Select all

-string "Geometry.OCCConnectFaces=1;"
The same. Thats exactly what it needs to connect the solids of compound and what is included in my version of the macro.
PrzemoF wrote:Pushing a piece of steel into ABS block:
FreeCAD_multi_mat.png
cool.

Have you been able to repeat the error you had during selection ? I do not get it !
User avatar
teobo
Posts: 410
Joined: Fri Feb 21, 2014 11:23 am

Re: test request, multiple material

Post by teobo »

Hi guys,
I see you've got fun playing. (:
@bernd maybe a short tutorial on the multiple material gui handling, or enhancing our tut.
-maybe a tooltip_ would be better than nothing_.
-maybe a gui tut for the frequency/state of usage of the frequency fem as well, guess it is time variant mechanical analysis, is not it?

Then some iges house from do not know where, compound it, material is already in hopefully, then you apply some sinus boundary forces and ready is your earthquake simulation?

...rumble, rumble ...


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

Re: test request, multiple material

Post by bernd »

@tebeo: see that post viewtopic.php?f=18&t=12995#p104189 and of course all other post in the thread.
If you have special problems feel free to ask or post the file you have problems with. Any testing of the multiple materials is highly appretiated.
Post Reply