#!/bin/bash
# 从命令行获取块名称
blocknames=$1
# 声明常量
execfile=./bin/Qdtree_icosa.ex
parafile=log.txt
# 正演参数块 名称为forward
if [[ $blocknames == "moho" ]]; then
# 声明程序参数文件内容并通过cat保存在parafile
cat <<- EOF > $parafile
	basic-depth=5
	max-depth=10
	orientation=NULL
	extra-points=NULL
	extra-lines=NULL
	extra-polys=NULL
	extra-circles=NULL
	outline-polys=NULL
	msh-save=d5-globe.msh
	sph-save=NULL
EOF
# 运行程序
$execfile $parafile

elif [[ $blocknames == "USA" ]]; then
# 声明程序参数文件内容并通过cat保存在parafile
cat <<- EOF > $parafile
	basic-depth=3
	max-depth=7
	orientation=NULL
	extra-points=NULL
	extra-lines=NULL
	extra-polys=doc/test/china-border.txt
	extra-circles=NULL
	outline-polys=NULL
	msh-save=china.msh
	sph-save=NULL
EOF
# 运行程序
$execfile $parafile

elif [[ $blocknames == "test" ]]; then
# 声明程序参数文件内容并通过cat保存在parafile
cat <<- EOF > $parafile
	basic-depth=6
	max-depth=10
	orientation=NULL
	extra-points=NULL
	extra-lines=NULL
	extra-polys=NULL
	extra-circles=NULL
	outline-polys=doc/test/test-outline.txt
	msh-save=test-d6.msh
	sph-save=NULL
EOF
# 运行程序
$execfile $parafile

fi