Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dune-fem-dg
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
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
dune-fem
dune-fem-dg
Commits
5b297b94
Commit
5b297b94
authored
6 years ago
by
Andreas Dedner
Browse files
Options
Downloads
Patches
Plain Diff
change euler example so that it can be used for profiling
parent
034d7de9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Latest features added to dune-fem-dg.
Pipeline
#11433
failed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pydemo/euler/shock_tube.py
+13
-13
13 additions, 13 deletions
pydemo/euler/shock_tube.py
with
13 additions
and
13 deletions
pydemo/euler/shock_tube.py
+
13
−
13
View file @
5b297b94
...
...
@@ -9,8 +9,8 @@ from ufl import *
gamma
=
1.4
dim
=
2
#
from euler import sod as problem
from
euler
import
radialSod3
as
problem
from
euler
import
sod
as
problem
#
from euler import radialSod3 as problem
Model
,
initial
,
x0
,
x1
,
N
,
endTime
,
name
=
problem
(
dim
,
gamma
)
...
...
@@ -57,8 +57,8 @@ def useGalerkinOp():
operator
.
model
.
dt
=
1e-5
start
=
time
.
time
()
grid
.
writeVTK
(
name
,
pointdata
=
[
u_h
],
number
=
count
)
start
=
time
.
time
()
while
t
<
endTime
:
u_h_n
.
assign
(
u_h
)
operator
.
solve
(
target
=
u_h
)
...
...
@@ -67,8 +67,8 @@ def useGalerkinOp():
count
+=
1
grid
.
writeVTK
(
name
,
pointdata
=
[
u_h
],
number
=
count
)
saveTime
+=
saveStep
grid
.
writeVTK
(
name
,
pointdata
=
[
u_h
],
number
=
count
)
print
(
"
time loop:
"
,
time
.
time
()
-
start
)
grid
.
writeVTK
(
name
,
pointdata
=
[
u_h
],
number
=
count
)
def
useODESolver
(
polOrder
=
2
,
limiter
=
'
default
'
):
global
count
,
t
,
dt
,
saveTime
...
...
@@ -83,15 +83,15 @@ def useODESolver(polOrder=2, limiter='default'):
operator
=
createFemDGSolver
(
Model
,
space
,
limiter
=
limiter
)
# operator.setTimeStepSize(dt)
start
=
time
.
time
()
# operator.applyLimiter( u_h );
print
(
grid
.
size
(
0
))
print
(
"
number of elements:
"
,
grid
.
size
(
0
)
,
flush
=
True
)
grid
.
writeVTK
(
name
,
pointdata
=
[
u_h
],
# celldata={"density":rho, "pressure":p}, # bug: density not shown correctly
celldata
=
{
"
pressure
"
:
p
,
"
maxLambda
"
:
Model
.
maxLambda
(
0
,
0
,
u_h
,
as_vector
([
1
,
0
]))},
cellvector
=
{
"
velocity
"
:
v
},
number
=
count
,
subsampling
=
2
)
start
=
time
.
time
()
tcount
=
0
while
t
<
endTime
:
operator
.
solve
(
target
=
u_h
)
...
...
@@ -99,8 +99,9 @@ def useODESolver(polOrder=2, limiter='default'):
dt
=
operator
.
deltaT
()
t
+=
dt
tcount
+=
1
if
t
>
saveTime
:
print
(
'
dt =
'
,
dt
,
'
time =
'
,
t
,
'
count =
'
,
count
,
flush
=
True
)
if
tcount
%
100
==
0
:
print
(
'
[
'
,
tcount
,
'
]
'
,
'
dt =
'
,
dt
,
'
time =
'
,
t
,
'
count =
'
,
count
,
flush
=
True
)
if
False
:
# t > saveTime:
count
+=
1
# rho, v, p = Model.toPrim(u_h) # is this needed - works for me # without and it should...
grid
.
writeVTK
(
name
,
...
...
@@ -109,18 +110,17 @@ def useODESolver(polOrder=2, limiter='default'):
cellvector
=
{
"
velocity
"
:
v
},
number
=
count
,
subsampling
=
2
)
saveTime
+=
saveStep
print
(
"
time loop:
"
,
time
.
time
()
-
start
)
print
(
"
number of time steps
"
,
tcount
)
grid
.
writeVTK
(
name
,
pointdata
=
[
u_h
],
celldata
=
{
"
pressure
"
:
p
,
"
maxLambda
"
:
Model
.
maxLambda
(
0
,
0
,
u_h
,
as_vector
([
1
,
0
]))},
cellvector
=
{
"
velocity
"
:
v
},
number
=
count
,
subsampling
=
2
)
print
(
"
time loop:
"
,
time
.
time
()
-
start
)
print
(
"
number of time steps
"
,
tcount
)
if
True
:
grid
=
structuredGrid
(
x0
,
x1
,
N
)
#
grid = create.grid("ALU
Simplex
", cartesianDomain(x0,x1,N))
#
grid = structuredGrid(x0,x1,N)
grid
=
create
.
grid
(
"
ALU
Cube
"
,
cartesianDomain
(
x0
,
x1
,
N
))
useODESolver
(
2
,
'
default
'
)
# third order with limiter
elif
False
:
N
=
[
n
*
10
for
n
in
N
]
...
...
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