File: bubble.sh

package info (click to toggle)
gerris 20131206%2Bdfsg-21
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,252 kB
  • sloc: ansic: 66,595; sh: 15,922; f90: 1,513; makefile: 1,150; fortran: 696; python: 493; awk: 104; lisp: 89; xml: 27
file content (32 lines) | stat: -rw-r--r-- 679 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

set -e

disable_hypre() {
	## comment out hypre
	perl -wpl -i -e 's/^(\s*)(GModule hypre)/$1#$2/' $1
}

enable_hypre() {
	## uncomment hypre (if commented)
	perl -wpl -i -e 's/#(GModule hypre)/$1/' $1
}

NP=4
CASEFILE=${1}

[ -f "${CASEFILE}" ] || {
	echo "${CASEFILE} does not exist"
	exit 1
}

## if the hypre module is unavailable
## is there a way to automatically check whether hypre is available?
#disable_hypre ${CASEFILE}
## otherwise
enable_hypre ${CASEFILE}

SPLITFILE="${CASEFILE%.gfs}-split.gfs"
gerris2D --split=3 -m ${CASEFILE} | gerris2D --partition=2 - > ${SPLITFILE}
mpirun -np $NP gerris2D ${SPLITFILE} | gfsview-batch2D bubble.gfv
rm ${SPLITFILE}