SCOREC / gmshToPumi

Demonstrates the use of a Gmsh model and mesh in PUMI via the gmodel API
4 stars 1 forks source link

Outdated Makefile #2

Open zhangchonglin opened 7 months ago

zhangchonglin commented 7 months ago

Not sure if this is related to issue #1, but I had trouble using the Makefile provided to generate .smb file in the example case.

mpicxx -std=c++11 notch2D.cpp -o notch2D -I/hdd1/dsmc/comet/install/gmodel/install/include -L/hdd1/dsmc/comet/install/gmodel/install/lib -lgmodel
./notch2D
/hdd1/dsmc/gmsh/gmsh-4.11.1-source/instal/bin/gmsh -2 notch2D.geo -o notch2D.msh    
Info    : Running '/hdd1/dsmc/gmsh/gmsh-4.11.1-source/instal/bin/gmsh -2 notch2D.geo -o notch2D.msh' [Gmsh 4.11.1, 1 node, max. 1 thread]
Info    : Started on Tue Jan 16 13:34:08 2024
Info    : Reading 'notch2D.geo'...
Info    : Done reading 'notch2D.geo'
Info    : Meshing 1D...
Info    : [  0%] Meshing curve 7 (Line)
Info    : [ 20%] Meshing curve 8 (Line)
Info    : [ 40%] Meshing curve 9 (Line)
Info    : [ 60%] Meshing curve 10 (Line)
Info    : [ 80%] Meshing curve 11 (Circle)
Info    : Done meshing 1D (Wall 0.000167408s, CPU 0.000165s)
Info    : Meshing 2D...
Info    : Meshing surface 13 (Plane, Frontal-Delaunay)
Info    : Done meshing 2D (Wall 0.00260766s, CPU 0.002604s)
Info    : 253 nodes 509 elements
Info    : Writing 'notch2D.msh'...
Info    : Done writing 'notch2D.msh'
Info    : Stopped on Tue Jan 16 13:34:08 2024 (From start: Wall 0.00354327s, CPU 0.004546s)
/hdd1/dsmc/comet/install/core/install/bin/from_gmsh notch2D.dmg notch2D.msh notch2D-serial.smb
Usage: /hdd1/dsmc/comet/install/core/install/bin/from_gmsh <in .dmg> <in .msh> <out .smb> <out .dmg>
The input .msh and output .smb file names are required. 
If 'none' is specified as the input model file name then 
a output model (.dmg) will be written to the specified filename. 
When a **gmsh v2** .msh is passed in, a minimal model will be created from the mesh.
When a **gmsh v4** .msh is passed in, a topological model will be created from the geometric model entities defined in the gmsh input file.
make: *** [Makefile:17: notch2D-serial.smb] Error 1

The argument for from_gmsh seems to changed requiring the following 4 arguments:

from_gmsh <in .dmg> <in .msh> <out .smb> <out .dmg>

However, using above 4 arguments for from_gmsh command, I still got crash error:

/hdd1/dsmc/comet/install/core/install/bin/from_gmsh notch2D.dmg notch2D.msh notch2D-serial.smb notch2D_new.dmg
version 4
[bird:650374] *** Process received signal ***
[bird:650374] Signal: Segmentation fault (11)
[bird:650374] Signal code: Address not mapped (1)
[bird:650374] Failing at address: (nil)
[bird:650374] [ 0] /lib64/libc.so.6(+0x54db0)[0x7fb69ca54db0]
[bird:650374] [ 1] /hdd1/dsmc/comet/install/core/install/bin/from_gmsh[0x408470]
[bird:650374] [ 2] /lib64/libc.so.6(+0x3feb0)[0x7fb69ca3feb0]
[bird:650374] [ 3] /lib64/libc.so.6(__libc_start_main+0x80)[0x7fb69ca3ff60]
[bird:650374] [ 4] /hdd1/dsmc/comet/install/core/install/bin/from_gmsh[0x4088a5]
[bird:650374] *** End of error message ***
make: *** [Makefile:17: notch2D-serial.smb] Segmentation fault (core dumped)

Finally, if I do the following, it seems to be working fine. But I am not sure if this is the recommended way:

/hdd1/dsmc/comet/install/core/install/bin/from_gmsh none notch2D.msh notch2D-serial.smb notch2D.dmg
version 4
mesh verified in 0.001011 seconds
mesh notch2D-serial.smb written in 0.000180 seconds

Basically, setting the <in .dmg> file to none.

@cwsmith: any comments or suggestions? Thanks!

cwsmith commented 7 months ago

Thanks for the details.

In short, my current understanding is that if you have a v4 gmsh input .msh file it will (can?) contain sufficient information for creating a .dmg model. So, for this example passing none as the first argument is correct.

I created an issue in scorec/core to add a test for passing a .dmg as the first argument. https://github.com/SCOREC/core/issues/415