Newer
Older
#!/bin/bash
dofSize=128
dimension=1;
proportions=1
analyticFunction="sin-wave"
timeFunction="cosinus"
amplitude=1.0
waveLength=1.0
waveLengthX=1.0
waveLengthY=1.0
waveLengthZ=1.0
wavesNumber=0.0
wavesNumberX=0.0
wavesNumberY=0.0
wavesNumberZ=0.0
phase=0.0
phaseX=0.0
phaseY=0.0
phaseZ=0.0
sigma=1.0
tnl-grid-setup --dimensions ${dimension} \
--proportions-x ${proportions} \
--proportions-y ${proportions} \
--proportions-z ${proportions} \
--origin-x 0 \
--origin-y 0 \
--origin-z 0 \
--size-x ${dofSize} \
--size-y ${dofSize} \
--size-z ${dofSize} \
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
--function ${analyticFunction} \
--output-file u-ini.tnl \
--amplitude ${amplitude} \
--wave-length ${waveLength} \
--wave-length-x ${waveLengthX} \
--wave-length-y ${waveLengthY} \
--wave-length-z ${waveLengthZ} \
--waves-number ${wavesNumber} \
--waves-number-x ${wavesNumberX} \
--waves-number-y ${wavesNumberY} \
--waves-number-z ${wavesNumberZ} \
--phase ${phase} \
--phase-x ${phaseX} \
--phase-y ${phaseY} \
--phase-z ${phaseZ} \
--sigma ${sigma} \
./heat-equation --dimensions ${dimension} \
--time-discretisation explicit \
--discrete-solver merson \
--time-function ${timeFunction}\
--analytic-space-function ${analyticFunction}\
--amplitude ${amplitude} \
--wave-length ${waveLength} \
--wave-length-x ${waveLengthX} \
--wave-length-y ${waveLengthY} \
--wave-length-z ${waveLengthZ} \
--waves-number ${wavesNumber} \
--waves-number-x ${wavesNumberX} \
--waves-number-y ${wavesNumberY} \
--waves-number-z ${wavesNumberZ} \
--phase ${phase} \
--phase-x ${phaseX} \
--phase-y ${phaseY} \
--phase-z ${phaseZ} \
--sigma ${sigma} \
--snapshot-period 0.001 \
--final-time 1.0 \
tnl-view --mesh mesh.tnl \
--input-files *.tnl \
seznam=`ls numericalSolution-*.gplt`
for fname in $seznam ; do
gnuplot << EOF
set terminal unknown
#set view 33,33 #3D
#unset xtics
#unset ytics
#unset ztics
unset border
set output '$fname.png'
plot 'numericalSolution-00000.gplt' with line
set yrange [-1.2:1.2]
set terminal png
set title "Numerical solution"
plot '$fname' with line
EOF
done
mencoder "mf://numericalSolution-*.png" -mf fps=22 -o DiffusionNumerical.avi -ovc lavc -lavcopts vcodec=mpeg4
seznam=`ls analyticSolution-*.gplt`
for fname in $seznam ; do
gnuplot << EOF
set terminal unknown
#set view 33,33 #3D
#unset xtics
#unset ytics
#unset ztics
unset border
set output '$fname.png'
plot 'analyticSolution-00000.gplt' with line
set yrange [-1.2:1.2]
set terminal png
set title "Analytic solution"
plot '$fname' with line
EOF
done
mencoder "mf://analyticSolution-*.png" -mf fps=22 -o DiffusionAnalytic.avi -ovc lavc -lavcopts vcodec=mpeg4
rm *.png
rm *.tnl
rm *.gplt