Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
bd877ccc
There was an error fetching the commit references. Please try again later.
Commit
bd877ccc
authored
6 years ago
by
Ned Coltman
Browse files
Options
Downloads
Patches
Plain Diff
[freeflow] cleanup convergence script
parent
d784a766
No related branches found
No related tags found
1 merge request
!1326
Freeflow/convergencescript cleanup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/freeflow/navierstokes/convergence.sh
+33
-20
33 additions, 20 deletions
test/freeflow/navierstokes/convergence.sh
with
33 additions
and
20 deletions
test/freeflow/navierstokes/convergence.sh
+
33
−
20
View file @
bd877ccc
#! /bin/bash
if
[
$#
-ne
3
]
;
then
echo
"usage:
$0
EXECUTABLE_NAME DIMENSION NUM_REFINEMENT_STEPS"
if
[
$#
-ne
4
]
;
then
echo
"usage:
$0
EXECUTABLE_NAME
PARAMS
DIMENSION NUM_REFINEMENT_STEPS"
exit
fi
...
...
@@ -11,34 +11,47 @@ LOGFILE=logfile_$1.out
rm
$LOGFILE
L2ERRORFILE
=
l2error_
$1
.txt
if
[
$2
==
1
]
;
then
GRIDCELLS
=
"4"
elif
[
$2
==
2
]
;
then
GRIDCELLS
=
"4 4"
DIM
=
$3
INITIALCELLS
=
4
if
[
$DIM
==
1
]
;
then
GRIDCELLS
=
"
$INITIALCELLS
"
elif
[
$DIM
==
2
]
;
then
GRIDCELLS
=
"
$INITIALCELLS
$INITIALCELLS
"
else
GRIDCELLS
=
"
4 4 4
"
GRIDCELLS
=
"
$INITIALCELLS
$INITIALCELLS
$INITIALCELLS
"
fi
MAX
=
$3
MAX
=
$4
MAXCELLS
=
$INITIALCELLS
for
((
i
=
0
;
i <
=
$MAX
;
++i
))
;
do
printf
"refinement
$i
/
$MAX
"
./
$1
$1
.input
-Grid
.Cells
"
$GRIDCELLS
"
-Grid
.Refinement
$i
-Problem
.PrintL2Error
true
&>>
$LOGFILE
((
MAXCELLS
*
=
2
))
./
$1
params.input
-Grid
.Cells
"
$GRIDCELLS
"
-Grid
.Refinement
$i
-Problem
.PrintL2Error
true
&>>
$LOGFILE
echo
"done."
done
grep
"L2 error (abs/rel) for"
$LOGFILE
|
tee
$L2ERRORFILE
echo
"reset;
\
set log x;
\
set log y;
\
set arrow from graph 0,1 to graph 1,0 nohead lc rgb 'gray';
\
set arrow from graph 0,1 to graph 1,0.5 nohead lc rgb 'gray'"
>
$1
.gp
PLOT
=
"plot '
$L2ERRORFILE
' u 6:17 w lp t 'pressure', '
$L2ERRORFILE
' u 6:23 w lp t 'velocity'"
if
[
$2
==
2
]
;
then
PLOT
=
$PLOT
", '
$L2ERRORFILE
' u 6:29 w lp t 'velocity'"
elif
[
$2
==
3
]
;
then
PLOT
=
$PLOT
", '
$L2ERRORFILE
' u 6:35 w lp t 'velocity'"
echo
"reset
set terminal pngcairo size 1000,750
set output 'convergence.png'
set xrange [(
$INITIALCELLS
-1):
$MAXCELLS
]
set yrange [:1]
set xlabel 'number of cells per dimension'
set ylabel 'l2 error (abs)'
set log x
set log y"
>
$1
.gp
PLOT
=
"plot x**-1 w l lc rgb 'gray40' t 'O_1',
\
x**-2 w l lc rgb 'blue20' t 'O_2',
\
'
$L2ERRORFILE
' u (
\$
6**(1./
$DIM
.)):17 w lp t 'pressure',
\
'
$L2ERRORFILE
' u (
\$
6**(1./
$DIM
.)):23 w lp t 'velocity_x'"
if
[
$DIM
==
2
]
;
then
PLOT
=
$PLOT
", '
$L2ERRORFILE
' u (
\$
6**(1./
$DIM
.)):29 w lp t 'velocity_y'"
elif
[
$DIM
==
3
]
;
then
PLOT
=
$PLOT
", '
$L2ERRORFILE
' u (
\$
6**(1./
$DIM
.)):29 w lp t 'velocity_y', '
$L2ERRORFILE
' u (
\$
6**(1./
$DIM
.)):35 w lp t 'velocity_z'"
fi
echo
$PLOT
>>
$1
.gp
gnuplot
--persist
$1
.gp
eog convergence.png
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment