Path: blob/devel/elmerice/examples/Inverse_Methods/MassConservation/src/MakeMesh.sh
3206 views
#!/bin/bash1#########################################2# Bash script to generate the Elmer mesh3# from rectangle .geo4#5# INPUTS:6# - SRC_DIR: environment variable with the path to this directory7# - Arguments:8# - $1 : element size9# - $2 : output mesh name (.msh) (OPTIONAL)10#########################################11# check that there is one input argument12if [ -z "$1" ]13then14echo "No argument supplied"15echo "provide required mesh resolution as argument"16exit17fi1819# argument is the required mesh resolution20res=$12122# if a second argument is present it is the gmsh mesh file23# default is rectangle.msh24if [ -z "$2" ]25then26output=rectangle.msh27else28output=$229fi3031# make gmsh mesh32gmsh -format msh2 -2 -setnumber lc $res $SRC_DIR/rectangle.geo -o $output3334# convert to Elmer35ElmerGrid 14 2 $output -autoclean363738