v0.10.0
field_split_hp_test.sh
Go to the documentation of this file.
1 #!/bin/sh
2 # " chmod -x FILE_NAME " before run the bach script
3 # DIR_NAME="error_mesh_file"
4 NB_PROC="8"
5 ERROR_TYPE="l2"
6 WAVE_NUMBER="5"
7 ODISP="1"
8 ORDER="1"
9 
10 FIELD_SPLIT="true"
11 
12 # for WAVE_NUMBER in {3,5,10}
13 # do
14 partition="false"
15 DUFFY="true"
16 LOBATTO="true"
17 
18 file1="impinging_cylinder_$ODISP.cub"
19 # file2="analytical_solution.h5m"
20 #ERROR_TYPE="h1"
21 
22 # BIN_PATH="@CMAKE_CURRENT_BINARY_DIR@"
23 # SRC_PATH="@CMAKE_CURRENT_SOURCE_DIR@"
24 # BIN_PATH="./"
25 # SRC_PATH="./src"
26 
27 MPIRUN="mpirun -np $NB_PROC"
28 
29 # cd $BIN_PATH
30 
31 # for WAVE_NUMBER in 3 5 10 15
32 # do
33 
34 
35 
36 
37 rm -rf error_hard_cylinder_field_split_true_h_*_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt | rm -rf hard_cylinder_field_split_true_h_*_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
38 rm -rf error_hard_cylinder_field_split_false_h_*_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt | rm -rf hard_cylinder_field_split_false_h_*_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 for ODISP in "1" "2" "3" "4" "5" "6" "7"
49 do
50 
51 
52 
53 # echo "Start P enrichment analytical, field split is $FIELD_SPLIT !!!!! best_approximation calculation with $BEST_NB_PRC processes, mesh h $ODISP and order 8 and wavenumber $WAVE_NUMBER, error type $ERROR_TYPE"
54 #
55 # #BEGIN analytical solution
56 # mpirun -np $BEST_NB_PRC ./best_approximation \
57 # -my_file impinging_cylinder_$ODISP.cub \
58 # -my_is_partitioned $partition \
59 # -wave_number $WAVE_NUMBER \
60 # -wave_direction 1,0,0 \
61 # -analytical_solution_type hard_cylinder_incident_wave \
62 # -save_postproc_mesh false \
63 # -ksp_type fgmres \
64 # -pc_type lu \
65 # -pc_factor_mat_solver_package superlu_dist \
66 # -ksp_monitor \
67 # -my_order 8 \
68 # -my_max_post_proc_ref_level 0 \
69 # -add_incident_wave false \
70 # -lobatto true
71 
72 
73 
74 FIELD_SPLIT="true"
75 
76 ~/build_moFEM1/usr/tools/mofem_part -my_file impinging_cylinder_$ODISP.cub -my_nparts 8
77 
78 
79 # echo LOG: sound hard cylinder P convergence test
80 echo | tee -a hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
81 # echo | tee -a error_hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
82 echo " nze DOFs memory unit time CPUtime "| tee -a hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
83 # echo "${ERROR_TYPE}relative error "| tee -a error_hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
84 
85 
86 
87 echo | tee -a hard_cylinder_field_split_false_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
88 # echo | tee -a error_hard_cylinder_field_split_false_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
89 echo " nze DOFs memory unit time CPUtime "| tee -a hard_cylinder_field_split_false_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
90 # echo "${ERROR_TYPE}relative error "| tee -a error_hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
91 echo "Start p convergence test for sound hard cylinder ..."
92 
93 
94 for ORDER in "1" "2" "3" "4" "5" "6" "7" "8"
95 do
96 
97 # if [ $partition = true ]; then mbpart -t -p PARTKWAY $NB_PROC impinging_cylinder.cub impinging_cylinder_parts$NB_PROC.h5m; fi
98 #
99 # if [ $partition = true ]
100 # then file1="impinging_cylinder_parts$NB_PROC.h5m" && file2="best_solution.h5m"
101 # fi
102 
103 # for ORDER in {1..7..1};
104 # for ORDER in `seq 1 8`;
105 # do
106  # let NB_PROC+=${ORDER}
107  # NB_PROC=`expr $ORDER + 1`
108 
109 NB_PROC=`expr $ORDER`
110  ###########################
111 # if [ "$ORDER" -gt "$ODISP" ]
112 # then NB_PROC=`expr $ORDER + 0`
113 # else NB_PROC=`expr $ODISP`
114 # fi
115 # #NB_PROC=$ORDER
116 # MPIRUN="mpirun -np $NB_PROC"
117 ################################
118 
119  #To use partitioned mesh, first mbpart -t -p PARTKWAY 4 cylinder4.cub cylinder4_4parts.h5m,
120 # let NB_PROC=${ORDER}+1
121 # #echo $NB_PROC
122  # #BEGIN analytical solution
123  # $MPIRUN $BIN_PATH/best_approximation \
124  # -my_file $file1 \
125  # -my_is_partitioned $partition \
126  # -wave_number $WAVE_NUMBER \
127  # -wave_direction 1,0,0 \
128  # -analytical_solution_type hard_cylinder_incident_wave \
129  # -save_postproc_mesh false \
130  # -ksp_type fgmres \
131  # -pc_type lu \
132  # -pc_factor_mat_solver_package mumps \
133  # -ksp_monitor \
134  # -my_order $ORDER \
135  # -my_max_post_proc_ref_level 0 \
136  # -add_incident_wave false \
137 
138 #
139 #BEGIN numerical solution
140 #echo " "| tee -a hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
141 #echo "${ERROR_TYPE}relative error "| tee -a error_hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
142 #echo " "| tee -a hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
143 #echo "Start numerical calculation with $NB_PROC processes, mesh h$ODISP and order $ORDER ..." | tee -a hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
144 
145 # if [ ${FIELD_SPLIT} = false ]
146 # then
147 
148 FIELD_SPLIT="true"
149 
150 
151 
152 
153 echo "Start numerical calculation field split is $FIELD_SPLIT !!! with $NB_PROC processes, mesh h $ODISP and order p $ORDER ..."
154 mpirun -np 8 ./fe_field_split \
155 -my_file out.h5m \
156 -my_is_partitioned true \
157 -wave_number $WAVE_NUMBER \
158 -wave_direction 1,0,0 \
159 -save_postproc_mesh false \
160 -my_order $ORDER \
161 -my_max_post_proc_ref_level 0 \
162 -amplitude_of_incident_wave 1 \
163 -duffy $DUFFY \
164 -lobatto $LOBATTO \
165 -fieldsplit_1_ksp_type fgmres \
166 -fieldsplit_1_pc_type lu \
167 -fieldsplit_1_pc_factor_mat_solver_package superlu_dist \
168 -fieldsplit_1_ksp_max_it 30 \
169 -fieldsplit_0_ksp_type fgmres \
170 -fieldsplit_0_pc_type lu \
171 -fieldsplit_0_pc_factor_mat_solver_package superlu_dist \
172 -fieldsplit_0_ksp_max_it 30 \
173 -pc_fieldsplit_type schur \
174 -ksp_type fgmres \
175 -ksp_atol 1e-8 \
176 -ksp_rtol 1e-8 \
177 -ksp_max_it 800 \
178 -ksp_monitor \
179 -add_incident_wave false 2>&1 |
180 # echo $(grep --line-buffered -i "Problem ACOUSTIC_PROBLEM Nb. rows\|max_value_order_p\|min_value_order_p\|avg_value_order_p\|nz_used\|info.memory\|Time =\|Memory usage =" | sort | uniq) | tee -a -i hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
181 # echo $(grep --line-buffered -i "Problem ACOUSTIC_PROBLEM Nb. rows\|max_value_order_p\|min_value_order_p\|avg_value_order_p\|nz_used\|info.memory\|Time =\|Memory usage =" | sort | uniq) | awk '{print $2,$4,$6,$8,$10,$15,$25,$32,$37}' | tee -a -i hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
182 # echo $(grep --line-buffered -i "Problem ACOUSTIC_PROBLEM Nb. rows\|nz_used\|Time =\|Memory usage =" | sort | uniq) | awk '{print $2,$15,$22,$23,$27,$28}' | tee -a -i hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
183 echo $(grep --line-buffered -i "Problem ACOUSTIC_PROBLEM Nb. rows\|max_value_order_p\|min_value_order_p\|avg_value_order_p\|nz_used\|Time =\|Memory usage =" | sort | uniq) | awk '{print $2,$5,$9,$16,$21}' | tee -a -i hard_cylinder_field_split_true_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
184 echo " "
185 
186 
187 
188 
189 
190 FIELD_SPLIT="false"
191 
192 
193 echo "Start numerical calculation field split is $FIELD_SPLIT !!! with $NB_PROC processes, mesh h $ODISP and order p $ORDER ..."
194 mpirun -np $NB_PROC ./fe_approximation \
195 -my_file impinging_cylinder_$ODISP.cub \
196 -my_is_partitioned $partition \
197 -wave_number $WAVE_NUMBER \
198 -wave_direction 1,0,0 \
199 -save_postproc_mesh false \
200 -ksp_type fgmres \
201 -pc_type lu \
202 -pc_factor_mat_solver_package superlu_dist \
203 -ksp_monitor \
204 -my_order $ORDER \
205 -my_max_post_proc_ref_level 0 \
206 -amplitude_of_incident_wave 1 \
207 -duffy $DUFFY \
208 -lobatto $LOBATTO \
209 -add_incident_wave false 2>&1 |
210 # echo $(grep --line-buffered -i "Problem ACOUSTIC_PROBLEM Nb. rows\|max_value_order_p\|min_value_order_p\|avg_value_order_p\|nz_used\|info.memory\|Time =\|Memory usage =" | sort | uniq) | tee -a -i hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
211 # echo $(grep --line-buffered -i "Problem ACOUSTIC_PROBLEM Nb. rows\|max_value_order_p\|min_value_order_p\|avg_value_order_p\|nz_used\|info.memory\|Time =\|Memory usage =" | sort | uniq) | awk '{print $2,$4,$6,$8,$10,$15,$25,$32,$37}' | tee -a -i hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
212 # echo $(grep --line-buffered -i "Problem ACOUSTIC_PROBLEM Nb. rows\|nz_used\|Time =\|Memory usage =" | sort | uniq) | awk '{print $2,$15,$22,$23,$27,$28}' | tee -a -i hard_cylinder_field_split_${FIELD_SPLIT}_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
213 echo $(grep --line-buffered -i "Problem ACOUSTIC_PROBLEM Nb. rows\|max_value_order_p\|min_value_order_p\|avg_value_order_p\|nz_used\|Time =\|Memory usage =" | sort | uniq) | awk '{print $2,$7,$17,$24,$29}' | tee -a -i hard_cylinder_field_split_false_h_${ODISP}_k${WAVE_NUMBER}_lobatto_${LOBATTO}.txt
214 echo " "
215 
216 
217 
218 
219 done
220 
221 done