~ubuntu-branches/ubuntu/trusty/rheolef/trusty

« back to all changes in this revision

Viewing changes to nfem/ptst/curved_Pk.sh

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito
  • Date: 2012-04-06 09:12:21 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120406091221-m58me99p1nxqui49
Tags: 6.0-1
* New upstream release 6.0 (major changes):
  - massively distributed and parallel support
  - full FEM characteristic method (Lagrange-Gakerkin method) support
  - enhanced users documentation 
  - source code supports g++-4.7 (closes: #667356)
* debian/control: dependencies for MPI distributed solvers added
* debian/rules: build commands simplified
* debian/librheolef-dev.install: man1/* to man9/* added
* debian/changelog: package description rewritted (closes: #661689)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
:
 
2
if test $# -eq 0; then
 
3
  echo "$0: usage: $0 order a b"
 
4
  echo "example: $0 3 3 0"
 
5
  exit 1
 
6
fi
 
7
order=${1-"2"}
 
8
a=${2-"0"}
 
9
b=${3-"0"}
 
10
 
 
11
tmp="tmp.mac"
 
12
log="tmp.log"
 
13
 
 
14
cat > $tmp << EOF_1
 
15
a:$a;
 
16
b:$b;
 
17
k:${order};
 
18
/* P${order} piola triangle transformation here */
 
19
y_bas : if (k=1) then 0 else x*(1-x)**(k-1);
 
20
y_haut: y_bas + (1-x);
 
21
J_bas : integrate(y**b,y,0,y_bas);
 
22
J_haut: integrate(y**b,y,0,y_haut);
 
23
I_bas : integrate(x**a * J_bas, x,0,1);
 
24
I_haut: integrate(x**a * J_haut,x,0,1);
 
25
load(f90);
 
26
res;
 
27
f90 ('exact = I_haut-I_bas);
 
28
print ("value=", bfloat(I_haut-I_bas));
 
29
EOF_1
 
30
 
 
31
maxima < $tmp > $log
 
32
#cat $log
 
33
exact=`grep exact $log | sed -e 's/.*exact[ ]*=[ ]*//'`
 
34
value=`grep value $log | sed -e 's/.*value=[ ]*//' -e 's/b/e/'`
 
35
echo "integral(a=$a,b=$b) = $exact = $value"