stardis-spk

Scripts and datasets for running Stardis simulations
git clone git://git.meso-star.fr/stardis-spk.git
Log | Files | Refs | README | LICENSE

run_dump_path.sh (1735B)


      1 #!/bin/sh
      2 
      3 # Copyright (C) 2021, 2022, 2026 |Meso|Star> (contact@meso-star.com)
      4 #
      5 # This program is free software: you can redistribute it and/or modify
      6 # it under the terms of the GNU General Public License as published by
      7 # the Free Software Foundation, either version 3 of the License, or
      8 # (at your option) any later version.
      9 #
     10 # This program is distributed in the hope that it will be useful,
     11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     13 # GNU General Public License for more details.
     14 #
     15 # You should have received a copy of the GNU General Public License
     16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
     17 
     18 set -e
     19 
     20 ### USER PARAMETERS SECTION
     21 NPATH=10
     22 GEOM_FILE=geom.vtk
     23 PATH_FILE_PREFIX=path
     24 X=0.5
     25 Y=0.5
     26 Z=0.5
     27 TIME=inf
     28 ### END USER PARAMETERS SECTION
     29 
     30 #erase previous files if exist
     31 rm -f "${GEOM_FILE} ${PATH_FILE_PREFIX}*"
     32 
     33 #check stardis installation
     34 if ! command -v stardis > /dev/null ; then
     35   >&2 printf '>>> stardis command not found !\n'
     36   >&2 printf '>>> To register stardis in the current shell you must type :\n'
     37   >&2 printf '>>> . ~/Stardis-XXX-GNU-Linux64/etc/stardis.profile\n'
     38   >&2 printf '>>> where ~/Stardis-XXX-GNU-Linux64 is the stardis directory installation\n'
     39   exit 1
     40 fi
     41 
     42 #launch Stardis to dump geometry in vtk format
     43 stardis -V 3 -M model.txt -d "${GEOM_FILE%.vtk}"
     44 
     45 #launch Stardis to dump path for the probe X,Y,Z,TIME
     46 stardis -V 3 -M model.txt -p "${X},${Y},${Z},${TIME}"  -n "${NPATH}" -D all,"${PATH_FILE_PREFIX}"
     47 
     48 printf '\n'
     49 printf '>>> You can now visualize the paths in the geometry with opening %s and %sxxxxx.vtk files in paraview.\n' \
     50   "${GEOM_FILE}" "${PATH_FILE_PREFIX}"
     51 printf '\n'