2021-07-18 09:00:14 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# tet-file needs both .node and .ele files generated by Tetgen. No file extension is needed
|
2021-07-28 17:41:18 +08:00
|
|
|
# mag-file: magnetization vectors.
|
|
|
|
# mag-file format:
|
|
|
|
# 1. <filename>. Line format: <magz-x> <magz-y> <magz-z>
|
|
|
|
# 2: (<magz-x>,<magz-y>,<magz-z>)
|
|
|
|
# site-file: observation positions.
|
|
|
|
# site-file format:
|
|
|
|
# 1. <filename>. Line format: <x> <y> <z>
|
|
|
|
# 2. <xmin>/<xmax>/<ymin>/<ymax>/<z>/<xnum>/<ynum>
|
|
|
|
# 3. (<x1>,<y1>,<z1>)/(<x2>,<y2>,<z2>)/<num>
|
2021-07-18 09:00:14 +08:00
|
|
|
# obs-file needs only the output file's name with no file extension
|
|
|
|
# available calculating types: potential, gradient and tensor
|
|
|
|
|
|
|
|
logfile=log.txt
|
|
|
|
execu=./build/bin/magtet
|
|
|
|
job=${1}
|
|
|
|
|
|
|
|
if [[ ${job} == "prism" ]]; then
|
|
|
|
echo "Executing the job \""${job}"\" by "${execu}
|
|
|
|
echo "Logging file:" ${logfile}
|
|
|
|
echo "======================"
|
|
|
|
cat <<- EOF > ${logfile}
|
|
|
|
tet-file = data/prism/prism.1
|
2021-07-21 20:25:30 +08:00
|
|
|
mag-file = (0,0,200)
|
2021-07-29 07:45:12 +08:00
|
|
|
site-file = -30/30/-30/30/10/81/81
|
|
|
|
#site-file = (-30,-30,10)/(30,30,10)/51
|
2021-07-18 09:00:14 +08:00
|
|
|
obs-file = data/prism/prism
|
|
|
|
cal-type = potential gradient tensor
|
|
|
|
EOF
|
|
|
|
${execu} ${logfile}
|
|
|
|
|
|
|
|
elif [[ ${job} == "pipeline" ]]; then
|
|
|
|
echo "Executing the job \""${job}"\" by "${execu}
|
|
|
|
echo "Logging file:" ${logfile}
|
|
|
|
echo "======================"
|
|
|
|
cat <<- EOF > ${logfile}
|
|
|
|
tet-file = data/pipeline/pipeline
|
|
|
|
mag-file = data/pipeline/magz.txt
|
|
|
|
site-file = data/pipeline/site.txt
|
|
|
|
obs-file = data/pipeline/pipeline
|
|
|
|
cal-type = potential gradient tensor
|
|
|
|
EOF
|
|
|
|
${execu} ${logfile}
|
|
|
|
fi
|