-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmultipostsolver
executable file
·100 lines (85 loc) · 3.39 KB
/
multipostsolver
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
if [ $# -lt 4 ]
then
echo "Usage: $0 start_index end_index increment folder_name"
fi
echo "using command line options"
echo $5
echo $6
echo $7
echo $8
echo $9
sleep 3
if [ $# -ge 4 ]
then
# reduce the restarts for each time step requested
k=0
for ((i=$1 ;i<=$2; i+=$3));
do
echo "Multipostsolver is reducing timestep: $i"
let k++
/home/ca13/workspace/hg_simvascular/simvascular_systemic/bin/postsolver -sn $i -newsn $i -ph -td -bflux -wss $5 $6 $7 $8 $9 $10 $11
done
# now create the Paraview PHT file
echo '<?xml version="1.0" ?>' > view.pht
echo '<PhastaMetaFile number_of_pieces="1">' >> view.pht
echo ' <GeometryFileNamePattern pattern="geombc.dat.%d" has_piece_entry="1" has_time_entry="0"/>' >> view.pht
echo ' <FieldFileNamePattern pattern="restart.%d.0" has_piece_entry="0" has_time_entry="1"/>' >> view.pht
echo ' <TimeSteps number_of_steps="'$k'" auto_generate_indices="1"' >> view.pht
echo ' start_index="'$1'"' >> view.pht
echo ' increment_index_by="'$3'"' >> view.pht
echo ' start_value="0."' >> view.pht
echo ' increment_value_by="1">' >> view.pht
echo '</TimeSteps>' >> view.pht
if [ "$5" == "-disp" ]; then
echo '<Fields number_of_fields="5">' >> view.pht
else
echo '<Fields number_of_fields="4">' >> view.pht
fi
echo ' <Field paraview_field_tag="velocity"' >> view.pht
echo ' phasta_field_tag="solution"' >> view.pht
echo ' start_index_in_phasta_array="1"' >> view.pht
echo ' number_of_components="3"' >> view.pht
echo ' data_dependency="0"' >> view.pht
echo ' data_type="double"/>' >> view.pht
echo ' <Field paraview_field_tag="pressure"' >> view.pht
echo ' phasta_field_tag="solution"' >> view.pht
echo ' start_index_in_phasta_array="0"' >> view.pht
echo ' number_of_components="1"' >> view.pht
echo ' data_dependency="0"' >> view.pht
echo ' data_type="double"/>' >> view.pht
echo ' <Field paraview_field_tag="wall shear stresses"' >> view.pht
echo ' phasta_field_tag="wall shear stresses"' >> view.pht
echo ' start_index_in_phasta_array="0"' >> view.pht
echo ' number_of_components="3"' >> view.pht
echo ' data_dependency="0"' >> view.pht
echo ' data_type="double"/>' >> view.pht
echo ' <Field paraview_field_tag="boundary fluxes"' >> view.pht
echo ' phasta_field_tag="boundary fluxes"' >> view.pht
echo ' start_index_in_phasta_array="1"' >> view.pht
echo ' number_of_components="3"' >> view.pht
echo ' data_dependency="0"' >> view.pht
echo ' data_type="double"/>' >> view.pht
if [ "$5" == "-disp" ]; then
echo ' <Field paraview_field_tag="displacement"' >> view.pht
echo ' phasta_field_tag="displacement"' >> view.pht
echo ' start_index_in_phasta_array="0"' >> view.pht
echo ' number_of_components="3"' >> view.pht
echo ' data_dependency="0"' >> view.pht
echo ' data_type="double"/>' >> view.pht
fi
echo '</Fields>' >> view.pht
echo '</PhastaMetaFile>' >> view.pht
# now make a folder to store the reduced restarts and pht file
cd ..
newdir="restarts-"$4"-"$1"-"$2"-"$3
mkdir $newdir
cp geombc.dat.1 ./$newdir
cp solver.inp ./$newdir
cd -
cp *.dat ../$newdir
mv *.0 view.pht ../$newdir
echo ""
echo "Restarts copied to " $newdir
echo ""
fi