3
# This file is part of Rheolef.
5
# Copyright (C) 2000-2009 Pierre Saramito
7
# Rheolef is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 2 of the License, or
10
# (at your option) any later version.
12
# Rheolef is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with Rheolef; if not, write to the Free Software
19
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
# -------------------------------------------------------------------------
23
TOP_SRCDIR=${TOP_SRCDIR-"../.."}
25
NPROC_MAX=${NPROC_MAX-"3"}
29
. "${TOP_SRCDIR}/config/loop_mpirun.sh"
33
epsilon="1e-12"; # tolrerance to machine precision
35
# ===================================================
37
# ===================================================
38
# ---------------------------------------------------
39
# 1.1) test on a side of a square
40
# ---------------------------------------------------
41
u="'cos(y)' 'sin(y)+1'"; # note: expressions containing * may be quotted
45
# geo err_P1 err_P2 err_P3
47
carre-bamg-v2.right 4e-3 2e-6 6e-8
48
carre-100-dom-v2.right 4e-5 2e-10 2e-11
50
while test "$L" != ""; do
51
geo=`echo $L | awk '{print $1}'`
52
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
53
for Pk in P1 P2 P3; do
54
err=`echo $L | awk '{print $1}'`
55
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
56
loop_mpirun "./form_2Ds_Ds_tst $DATADIR/${geo} $Pk $qorder $err $u $v $n 2>/dev/null >/dev/null"
57
if test $? -ne 0; then status=1; fi
60
# ---------------------------------------------------
61
# 1.2) test on a circle
62
# ---------------------------------------------------
63
u="x^3 'x^2*y'"; # note: expressions containing * may be quotted
69
circle_s-40-fix 6e-3 3e-5
71
while test "$L" != ""; do
72
geo=`echo $L | awk '{print $1}'`
73
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
75
err=`echo $L | awk '{print $1}'`
76
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
77
loop_mpirun "./form_2Ds_Ds_tst $DATADIR/${geo}-${Pk} $Pk $qorder $err $u $v $n 2>/dev/null >/dev/null"
78
if test $? -ne 0; then status=1; fi
81
# ------------------------------------------------------
82
# 1.3) banded level set: test on the circle
83
# ------------------------------------------------------
84
run "$SBINDIR/mkgeo_grid_2d -v4 -t 40 -a -2 -b 2 -c -2 -d 2 2>/dev/null | $BINDIR/geo -upgrade - > mesh-2d-40.geo 2>/dev/null"
90
while test "$L" != ""; do
91
geo=`echo $L | awk '{print $1}'`
92
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
94
err=`echo $L | awk '{print $1}'`
95
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
96
loop_mpirun "./form_2Ds_Ds_tst $DATADIR/${geo} $Pk $qorder $err $u $v $n 2>/dev/null >/dev/null"
97
if test $? -ne 0; then status=1; fi
100
run "rm -f mesh-2d-40.geo"
101
# ===================================================
103
# ===================================================
104
# ---------------------------------------------------
105
# 2.1) test on the right face of a cube
106
# ---------------------------------------------------
107
u="'cos(1+x+z)' 'sin(2*x+z)^2' 'cos(x-z)^3'" ; # note: expressions may be quotted
108
v="'sin(x)^3' 'cos(x)^2' 'z^3'"
111
# geo err_P1 err_P2 err_P3 err_P4
113
cube-10-dom-v2.right 2e-2 7e-3 5e-7 2e-9
114
cube-P-5-dom-v2.right 6e-2 6e-5 3e-5 4e-8
115
my_cube_TPH-5-v2.right 9e-2 1e-4 8e-5 8e-8
117
while test "$L" != ""; do
118
geo=`echo $L | awk '{print $1}'`
119
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
120
for Pk in P1 P2 P3 P4; do
121
err=`echo $L | awk '{print $1}'`
122
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
123
loop_mpirun "./form_2Ds_Ds_tst $DATADIR/${geo} $Pk $qorder $err $u $v $n 2>/dev/null >/dev/null"
124
if test $? -ne 0; then status=1; fi
127
# ---------------------------------------------------
128
# 2.2) test on the surface of a sphere
129
# ---------------------------------------------------
130
u=" z x^2 'x*y'"; # note: expressions containing * may be quotted
136
sphere_s-10-fix 0.0008 0.0004
137
sphere_s_q-10-fix 0.0300 0.0003
139
while test "$L" != ""; do
140
geo=`echo $L | awk '{print $1}'`
141
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
143
err=`echo $L | awk '{print $1}'`
144
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
145
loop_mpirun "./form_2Ds_Ds_tst $DATADIR/${geo}-${Pk} $Pk $qorder $err $u $v $n 2>/dev/null >/dev/null"
146
if test $? -ne 0; then status=1; fi
149
# ------------------------------------------------------
150
# 2.3) banded level set: test on the sphere
151
# ------------------------------------------------------
152
run "$SBINDIR/mkgeo_grid_3d -v4 -T 20 -a -2 -b 2 -c -2 -d 2 -f -2 -g 2 2>/dev/null| $BINDIR/geo -upgrade - > mesh-3d-20.geo 2>/dev/null"
158
while test "$L" != ""; do
159
geo=`echo $L | awk '{print $1}'`
160
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
162
err=`echo $L | awk '{print $1}'`
163
L=`echo $L | awk '{for (i=2; i <= NF; i++) print $i}'`
164
loop_mpirun "./form_2Ds_Ds_tst $DATADIR/${geo} $Pk $qorder $err $u $v $n 2>/dev/null >/dev/null"
165
if test $? -ne 0; then status=1; fi
168
run "rm -f mesh-3d-20.geo"