~ubuntu-branches/ubuntu/wily/rheolef/wily

« back to all changes in this revision

Viewing changes to doc/pexamples/dirichlet_dg_cvge_loop.sh

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito, Pierre Saramito, Sylvestre Ledru
  • Date: 2013-04-30 11:29:51 UTC
  • mfrom: (1.2.1) (11.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130430112951-g69nuqin77t75dek
Tags: 6.4-1
[ Pierre Saramito ]
* New upstream release 6.4 (major changes):
  - new powerful c++ expressions for FEM specifications
  - configure script improved (portability increased)
  - minor bug fixes
* control:
  - all architectures are considered (armel & armhf are back)
  - no more circular-dependency librheolef-dev <--> rheolef
* rules: add security compiler flags (hardening and -W,-l,relro)
* watch: include an updated version, thanks to B. Martens <bartm@debian.org>
* copyright: various file format fixes

[ Sylvestre Ledru ]
*  Standards-Version updated to 3.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
:
 
2
uniform=true
 
3
Pkd=${1-"P1d"}
 
4
L="10 20 40 80 160"
 
5
 
 
6
prog="dirichlet_dg"
 
7
prog_error="cosinusprod_error_dg"
 
8
 
 
9
name="$prog-cv-$Pkd"
 
10
if $uniform; then
 
11
  mkgeo="mkgeo_grid -t";  # uniform grid
 
12
  name="$name-grid"
 
13
else
 
14
  mkgeo="mkgeo_ugrid -q"; # unstructured grid
 
15
  name="$name-gmsh"
 
16
fi
 
17
gdat="$name.gdat"
 
18
plot="$name.plot"
 
19
tmp="tmp.log"
 
20
echo "# $prog $Pkd"
 
21
echo "# n err_l2 err_linf err_h1" | tee $gdat
 
22
for n in $L; do
 
23
  command="$mkgeo $n > square-$n.geo 2>/dev/null"
 
24
  #echo $command
 
25
  eval $command
 
26
  command="./$prog square-$n $Pkd 2>/dev/null | ./${prog_error} 2> $tmp"
 
27
  #echo $command
 
28
  eval $command
 
29
  err_l2=`grep err_l2 $tmp | awk '{print $3}'`
 
30
  err_linf=`grep err_linf $tmp | awk '{print $3}'`
 
31
  err_h1=`grep err_h1 $tmp | awk '{print $3}'`
 
32
  echo "$n $err_l2 $err_linf $err_h1" | tee -a $gdat
 
33
done
 
34
echo "! file $gdat created" 1>&2
 
35
 
 
36
k=`echo $Pkd | sed -e 's/P//' -e 's/d//'`
 
37
cat > $plot << EOF
 
38
set log
 
39
plot \
 
40
"$gdat" u (1./\$1):2 w lp, \
 
41
"$gdat" u (1./\$1):3 w lp, \
 
42
"$gdat" u (1./\$1):4 w lp, \
 
43
0.2*x**($k+1), \\
 
44
2*x**($k)
 
45
pause -1 "<retour>"
 
46
EOF
 
47
echo "! file $plot created" 1>&2
 
48
 
 
49
gnuplot $plot