Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dune-mmdg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Hörl, Maximilian
dune-mmdg
Commits
c202e4e2
Commit
c202e4e2
authored
5 years ago
by
Hörl, Maximilian
Browse files
Options
Downloads
Patches
Plain Diff
add plotDG.py and plotMMDG.py
parent
7b2ff735
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/CMakeLists.txt
+1
-1
1 addition, 1 deletion
src/CMakeLists.txt
src/plotDG.py
+30
-0
30 additions, 0 deletions
src/plotDG.py
src/plotMMDG.py
+68
-0
68 additions, 0 deletions
src/plotMMDG.py
with
99 additions
and
1 deletion
src/CMakeLists.txt
+
1
−
1
View file @
c202e4e2
...
...
@@ -19,4 +19,4 @@ target_compile_definitions("mmdg-3d" PRIVATE GRIDDIM=3)
target_link_dune_default_libraries
(
"mmdg-3d"
)
dune_symlink_to_source_files
(
FILES grids parameterMMDG.ini parameterDG.ini
dgAnalysis.py mmdgAnalysis.py
)
dgAnalysis.py mmdgAnalysis.py
plotDG.py plotMMDG.py
)
This diff is collapsed.
Click to expand it.
src/plotDG.py
0 → 100644
+
30
−
0
View file @
c202e4e2
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
mpltools.annotation
import
slope_marker
import
matplotlib.pylab
as
pylab
params
=
{
'
legend.fontsize
'
:
'
x-large
'
,
'
axes.labelsize
'
:
'
x-large
'
,
'
axes.titlesize
'
:
'
x-large
'
,
'
xtick.labelsize
'
:
'
x-large
'
,
'
ytick.labelsize
'
:
'
x-large
'
}
pylab
.
rcParams
.
update
(
params
)
data_1d
=
np
.
loadtxt
(
"
plots/dgAnalysis_1d
"
)
data_2d
=
np
.
loadtxt
(
"
plots/dgAnalysis_2d
"
)
data_3d
=
np
.
loadtxt
(
"
plots/dgAnalysis_3d
"
)
plt
.
loglog
(
np
.
reciprocal
(
data_1d
[:,
2
]),
data_1d
[:,
0
],
'
g^-
'
,
label
=
'
$n=1$
'
)
plt
.
loglog
(
np
.
reciprocal
(
data_2d
[:,
2
]),
data_2d
[:,
0
],
'
bo-
'
,
label
=
'
$n=2$
'
)
plt
.
loglog
(
np
.
reciprocal
(
data_3d
[:,
2
]),
data_3d
[:,
0
],
'
rs-
'
,
label
=
'
$n=3$
'
)
x
=
1.0
/
data_3d
[
3
,
2
]
y
=
10
**
(
0.2
*
np
.
log10
(
data_3d
[
3
,
0
])
+
0.8
*
np
.
log10
(
data_3d
[
4
,
0
]))
slope_marker
((
x
,
y
),
-
2
,
size_frac
=
0.15
,
invert
=
True
,
pad_frac
=
0.12
,
\
poly_kwargs
=
{
'
ec
'
:
'
black
'
,
'
fill
'
:
False
},
\
text_kwargs
=
{
'
size
'
:
'
x-large
'
,
'
text
'
:
'
2
'
,
'
usetex
'
:
True
})
plt
.
xlabel
(
'
$h^{-1}$
'
)
plt
.
ylabel
(
'
$\Vert p - p_h \Vert_{L^2 ( \Omega )}$
'
)
plt
.
legend
()
plt
.
tight_layout
()
plt
.
savefig
(
'
plots/dg.pdf
'
,
format
=
'
pdf
'
)
This diff is collapsed.
Click to expand it.
src/plotMMDG.py
0 → 100644
+
68
−
0
View file @
c202e4e2
import
numpy
as
np
import
matplotlib.pyplot
as
plt
from
mpltools.annotation
import
slope_marker
import
matplotlib.pylab
as
pylab
params
=
{
'
legend.fontsize
'
:
'
x-large
'
,
'
axes.labelsize
'
:
'
x-large
'
,
'
axes.titlesize
'
:
'
x-large
'
,
'
xtick.labelsize
'
:
'
x-large
'
,
'
ytick.labelsize
'
:
'
x-large
'
}
pylab
.
rcParams
.
update
(
params
)
data_2d
=
np
.
loadtxt
(
"
plots/mmdgAnalysis_2d
"
)
data_3d
=
np
.
loadtxt
(
"
plots/mmdgAnalysis_3d
"
)
# plot total error
plt
.
figure
()
plt
.
loglog
(
np
.
reciprocal
(
np
.
maximum
(
data_2d
[:,
3
],
data_2d
[:,
4
])),
data_2d
[:,
2
],
\
'
bo-
'
,
label
=
'
$n=2$
'
)
plt
.
loglog
(
np
.
reciprocal
(
np
.
maximum
(
data_3d
[:,
3
],
data_3d
[:,
4
])),
data_3d
[:,
2
],
\
'
rs-
'
,
label
=
'
$n=3$
'
)
if
data_3d
[
0
,
2
]
>
data_3d
[
-
1
,
2
]:
x
=
1.0
/
np
.
maximum
(
data_3d
[
3
,
3
],
data_3d
[
3
,
4
])
y
=
10
**
(
0.2
*
np
.
log10
(
data_3d
[
3
,
2
])
+
0.8
*
np
.
log10
(
data_3d
[
4
,
2
]))
slope_marker
((
x
,
y
),
-
2
,
size_frac
=
0.15
,
invert
=
True
,
pad_frac
=
0.12
,
\
poly_kwargs
=
{
'
ec
'
:
'
black
'
,
'
fill
'
:
False
},
\
text_kwargs
=
{
'
size
'
:
'
x-large
'
,
'
text
'
:
'
2
'
,
'
usetex
'
:
True
})
plt
.
xlabel
(
'
$h^{-1}$
'
)
plt
.
ylabel
(
r
'
$\Vert (p,p^\Gamma) - (p_h , p_h^\Gamma) \Vert_{L^2 ( \Omega )
'
\
+
r
'
\times L^2 ( \Gamma )}$
'
)
plt
.
legend
()
plt
.
tight_layout
()
plt
.
savefig
(
'
plots/mmdg_total.pdf
'
,
format
=
'
pdf
'
)
# plot bulk error
plt
.
figure
()
plt
.
loglog
(
np
.
reciprocal
(
data_2d
[:,
3
]),
data_2d
[:,
0
],
'
bo-
'
,
label
=
'
$n=2$
'
)
plt
.
loglog
(
np
.
reciprocal
(
data_3d
[:,
3
]),
data_3d
[:,
0
],
'
rs-
'
,
label
=
'
$n=3$
'
)
if
data_3d
[
0
,
0
]
>
data_3d
[
-
1
,
0
]:
x
=
1.0
/
data_3d
[
3
,
3
]
y
=
10
**
(
0.2
*
np
.
log10
(
data_3d
[
3
,
0
])
+
0.8
*
np
.
log10
(
data_3d
[
4
,
0
]))
slope_marker
((
x
,
y
),
-
2
,
size_frac
=
0.15
,
invert
=
True
,
pad_frac
=
0.12
,
\
poly_kwargs
=
{
'
ec
'
:
'
black
'
,
'
fill
'
:
False
},
\
text_kwargs
=
{
'
size
'
:
'
x-large
'
,
'
text
'
:
'
2
'
,
'
usetex
'
:
True
})
plt
.
xlabel
(
'
$h^{-1}$
'
)
plt
.
ylabel
(
r
'
$\Vert p - p_h \Vert_{L^2 ( \Omega )}$
'
)
plt
.
legend
()
plt
.
tight_layout
()
plt
.
savefig
(
'
plots/mmdg_bulk.pdf
'
,
format
=
'
pdf
'
)
# plot interface error
plt
.
figure
()
plt
.
loglog
(
np
.
reciprocal
(
data_2d
[:,
4
]),
data_2d
[:,
1
],
'
bo-
'
,
label
=
'
$n=2$
'
)
plt
.
loglog
(
np
.
reciprocal
(
data_3d
[:,
4
]),
data_3d
[:,
1
],
'
rs-
'
,
label
=
'
$n=3$
'
)
if
data_3d
[
0
,
1
]
>
data_3d
[
-
1
,
1
]:
x
=
1.0
/
data_3d
[
3
,
4
]
y
=
10
**
(
0.1
*
np
.
log10
(
data_3d
[
3
,
1
])
+
0.9
*
np
.
log10
(
data_3d
[
4
,
1
]))
slope_marker
((
x
,
y
),
-
2
,
size_frac
=
0.15
,
invert
=
True
,
pad_frac
=
0.12
,
\
poly_kwargs
=
{
'
ec
'
:
'
black
'
,
'
fill
'
:
False
},
\
text_kwargs
=
{
'
size
'
:
'
x-large
'
,
'
text
'
:
'
2
'
,
'
usetex
'
:
True
})
plt
.
xlabel
(
'
$h^{-1}$
'
)
plt
.
ylabel
(
r
'
$\Vert p^\Gamma - p_h^\Gamma \Vert_{L^2 ( \Gamma )}$
'
)
plt
.
legend
()
plt
.
tight_layout
()
plt
.
savefig
(
'
plots/mmdg_interface.pdf
'
,
format
=
'
pdf
'
)
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