simmetrix to omegah mesh conversion - SCOREC/pumi-pic Wiki

Original URL: https://github.com/SCOREC/pumi-pic/wiki/simmetrix-to-omegah-mesh-conversion

The following instructions apply to the SCOREC RedHat 7 blockade system.

Connect to blockade

ssh blockade

Create a development directory

mkdir ~/develop
cd !$

Setup the environment

Place the following commands into a script setup.sh:

export root=$PWD # This is the directory containing the omega_h repo as a subdir
module unuse /opt/scorec/spack/lmod/linux-rhel7-x86_64/Core
module use /opt/scorec/spack/v0154_2/lmod/linux-rhel7-x86_64/Core
module load gcc mpich cmake simmetrix-simmodsuite/16.0-210606dev
export oh=$root/omega_h-install  # This is where omega_h will be (or is) installed
export CMAKE_PREFIX_PATH=$oh:$CMAKE_PREFIX_PATH

source the setup.sh script to apply the enviroment changes to the current shell

source setup.sh

Run this command every time you create a new shell on blockade (i.e., you logged in) and will use that shell for compiling.

Omega_h

Clone the repo, run cmake, then build and install.

cd $root
git clone [email protected]:SCOREC/omega_h.git
bdir=$root/build-omegah-kokkosOff-cudaOff-simOn
mkdir -p $bdir 
cd $bdir
cmake ../omega_h \
  -DCMAKE_INSTALL_PREFIX=$oh \
  -DBUILD_SHARED_LIBS=ON \
  -DOmega_h_USE_CUDA=OFF \
  -DOmega_h_USE_MPI=on \
  -DBUILD_TESTING=on \
  -DOmega_h_USE_SimModSuite=on \
  -DSIM_MPI=mpich3.3.2
make -j8 install
ctest --output-on-failure

Simmetrix Conversion to Omega_h

Setup the environment

source ~/develop/setup.sh

Download test meshes

cd $root
git clone [email protected]:SCOREC/pumi-meshes.git

Convert from Simmetrix to Omega_h

We will convert a simmetrix .sms mesh file to an omega_h .osh file.

cd $root
mkdir runSimToOsh
cd !$
$root/omega_h-install/bin/meshsim2osh $root/pumi-meshes/upright/67k.sms $root/pumi-meshes/upright/upright.smd 67k.osh

If all goes well wrote mesh 67k.osh will be written to stdout (i.e., the shell).

Convert from Omega_h to VTU for reading in Paraview

To visualize the mesh we need to convert the omega_h .osh file to a format Paraview supports.

cd $root
mkdir runSimToOsh
cd !$
$root/omega_h-install/bin/osh2vtk 67k.osh 67k.vtk

Upon success, the directory 67k.vtk will be created.