Skip to content

Commit

Permalink
Only ref/serial backend gives correct convergence order
Browse files Browse the repository at this point in the history
  • Loading branch information
rezgarshakeri committed Dec 27, 2022
1 parent 99e379c commit 1bc679f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions examples/Hdiv-mass/conv_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ echo "Running convergence test in ${dim}D for Projection problem in H(div) space

declare -A run_flags
#run_flags[pc_type]=svd
run_flags[ceed]=/cpu/self/ref/serial
if [[ $dim -eq 2 ]];
then
run_flags[problem]=mass2d
Expand Down Expand Up @@ -68,3 +69,4 @@ for ((res=${test_flags[res_start]}; res<=${test_flags[res_end]}; res+=${test_fla
i=$((i+1))
done

python conv_rate.py -f conv_test_result.csv
3 changes: 1 addition & 2 deletions examples/Hdiv-mass/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ int main(int argc, char **argv) {
// ---------------------------------------------------------------------------
// -- Initialize backend
Ceed ceed;
CeedInit("/cpu/self/ref/serial", &ceed);
// CeedInit(app_ctx->ceed_resource, &ceed);
CeedInit(app_ctx->ceed_resource, &ceed);

// ---------------------------------------------------------------------------
// Choose the problem from the list of registered problems
Expand Down
4 changes: 3 additions & 1 deletion examples/Hdiv-mixed/conv_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ echo "Running convergence test in ${dim}D for Darcy problem";

declare -A run_flags
run_flags[pc_type]=svd
run_flags[ceed]=/cpu/self/ref/serial
if [[ $dim -eq 2 ]];
then
run_flags[problem]=darcy2d
Expand Down Expand Up @@ -68,7 +69,8 @@ for ((res=${test_flags[res_start]}; res<=${test_flags[res_end]}; res+=${test_fla
args="$args -$arg ${run_flags[$arg]}"
fi
done
./main -view_solution $args | grep "L2 error of u and p" | awk -v i="$i" -v res="$res" '{ printf "%d,%d,%.5f,%.5f\n", i, res, $8, $9}' >> $file_name
./main $args | grep "L2 error of u and p" | awk -v i="$i" -v res="$res" '{ printf "%d,%d,%.5f,%.5f\n", i, res, $8, $9}' >> $file_name
i=$((i+1))
done

python conv_plot.py -f conv_test_result.csv
3 changes: 1 addition & 2 deletions examples/Hdiv-mixed/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ int main(int argc, char **argv) {
// ---------------------------------------------------------------------------
// -- Initialize backend
Ceed ceed;
CeedInit("/cpu/self/ref/serial", &ceed);
// CeedInit(app_ctx->ceed_resource, &ceed);
CeedInit(app_ctx->ceed_resource, &ceed);

// -- Process general command line options
// ---------------------------------------------------------------------------
Expand Down

0 comments on commit 1bc679f

Please sign in to comment.