Phasta Meshing

From PHASTA Wiki
Jump to: navigation, search

Creating the Boundary Layer Attribute File

  • To begin, we need a geometry model. It can be created using commercial softwares such as SolidWorks or NX and saved as *.x_t
  • Create a new directory, which will contain the new geometric model and boundary layer attribute file (BLattr.inp). Make a link to the geometric model:
  ln -s "model_name.x_t" geom.xmt_txt

Now copy whichever BLattr.inp file you wish to start from to your working directory.

  • Each face of the geometric model needs specific mesh and boundary layer characteristics. This is the purpose of BLattr.inp. Open it by typing:
  vim BLattr.inp

A vim command cheat sheet can be found at http://www.tuxfiles.org/linuxhelp/vimcheat.html

  • To create attributes for each model entity, two lines in the following format are being used.
 <entity dimension> <entity tag> <size type> <attribute type> <extra> 
 <value or expression for mesh size on this entity>
  • Note that a blank line between these two lines is not allowed.
  • The parameters in the first line, respectively are:
- Entity dimension:          This will be 2 if the BL is being specified on a face
- Entity tag:                     You can find the entity tag using simapps
- Size type on entity:       1 for absolute mesh size and 2 for relative mesh size
- Attribute type on entity:  
                             0 just imposes the size on entity. <extra> field is NULL
                             1 for entity with boundary layers. <extra> field is explained below.
                             2 for periodic entity: In this case, <extra> field is followed with slave entity tag
                             3 for refinement source. Specify entity dimension as -1 in this case. <extra> field is explained below.

For Boundary layer:

   the <extra> field consists of (a) faceSide/useDir (BL orientation), (b) numEndEnts (==0, layers with fixed heigths), (c) firstLayerHeight, (d) totalHeight, 
  (e) nLayers, (f) blMixed, (g) blBlends, (h) blPropagate and (i) edgeBLFaceTag (only if 2D BL on edge)
  • You can insert text by hitting the "a" or "i" keys. Hit escape to go back to visual mode
  • You can comment out lines or parts of lines by placing a # symbol before the text you want to comment out. This is useful for suppressing BL's and

assigning names to the face numbers

  • To save and quit the changes you've made to BLattr.inp, get back to visual mode and type ":wq" and hit enter.

Creating an Initial Mesh

  • FIRST, MAKE SURE YOU ARE CONNECTED TO ONE OF THE VIZ NODES AND NOT PORTAL0!!
  • To do this, type:
  "vglconnect viz001" or "vglonnect viz002". You should also type "top" to see who is currently working and that enough memory is available
  • cd back to your working directory and type
  /users/mrasquin/develop/Meshing/BLMesher/bin/x86_64_linux/BLMesher geom.xmt_txt geom_ver63.sms 2 1.0 BLattr.inp BLMesher.log

or cp runBLMesher.sh (you can find it at /users/jema6380/runBLMesher.sh) into your working directory and type

  ./runBLMesher.sh geom.xmt_txt geom_ver63.sms 2 1.0 BLattr.inp BLMesher.log
  • This creates geom_ver63.sms. If it aborts immediately, look at BLMesher.log to get a sense of where in BLattr.inp it failed.
  • Note: if you plan on using phParAdapt later, then you are done creating an initial mesh. You should not trim and tetrahedronize the mesh before partitioning it with phParAdapt. See the page on using phParAdapt.
  • Next, you need to convert geom_ver63.sms into geom_ver2.sms so that the BL can be trimmed later. cp runConvertSMSVersion.sh (see /users/jema6380) to your working directory and type:
  ./runConvertSMSVersion.sh
  • Now you can trim the boundary layer:
  /users/mrasquin/develop/Meshing/BLTrim-2011-08-25/bin/x86_64_linux-icc/BLTrim-O geom.xmt_txt geom_ver2.sms 1 0 0 0 geom_test_bl.sms 2 1
  • Questions:
  Enter option [1/0] to write trimmed BL mesh: 1
  Enter output filename: geom-trimmed.sms
  Enter number of BL surfaces to be visualized: 0
  • Tetrahedronize the mesh:
  /users/chitak/develop/Meshing/tetrahedronizeBL-for-curve/bin/x86_64_linux-icc/tetrahedronizeBL-for-curve-O geom.xmt_txt geom-trimmed.sms geom-trimmed-tets.sms
  • Alternatively, to save time you can mesh, trim, and tetrahedronize all in one fell swoop. cp runBLMesher.sh, runConvertSMSVersion.sh, and runMeshAll.sh (see /users/jema6380) to your working directory. Run the command:
  ./runMeshAll.sh geom.xmt_txt BLattr.inp
  • The trim process is important so that the mesh can be adapted later, but it's not necessary in order to run your case.
  • You can now view the trimmed, tetrahedronized mesh (geom-trimmed-tets.sms) using ThreeDViewer.