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
25ae45a0
Commit
25ae45a0
authored
5 years ago
by
Robert K
Browse files
Options
Downloads
Patches
Plain Diff
Some minor changes.
parent
b5275523
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pydemo/adrsolver/scalar.py
+28
-20
28 additions, 20 deletions
pydemo/adrsolver/scalar.py
pydemo/euler/shock_tube_fast.py
+4
-4
4 additions, 4 deletions
pydemo/euler/shock_tube_fast.py
with
32 additions
and
24 deletions
pydemo/adrsolver/scalar.py
+
28
−
20
View file @
25ae45a0
...
...
@@ -108,29 +108,37 @@ def sinTransportProblem():
[
-
1
,
0
],
[
1
,
0.1
],
[
50
,
7
],
0.2
,
\
"
sin
"
,
lambda
t
:
u0
(
t
,
x
)
def
pulse
(
eps
=
None
):
center
=
as_vector
([
0.5
,
0.5
])
x0
=
x
[
0
]
-
center
[
0
]
x1
=
x
[
1
]
-
center
[
1
]
ux
=
-
4.0
*
x1
uy
=
4.0
*
x0
def
u0
(
t
,
x
):
sig2
=
0.004
if
eps
is
None
:
sig2PlusDt4
=
sig2
else
:
sig2PlusDt4
=
sig2
+
(
4.0
*
eps
*
t
)
xq
=
(
x0
*
cos
(
4.0
*
t
)
+
x1
*
sin
(
4.0
*
t
))
+
0.25
yq
=
(
-
x0
*
sin
(
4.0
*
t
)
+
x1
*
cos
(
4.0
*
t
))
return
as_vector
(
[(
sig2
/
(
sig2PlusDt4
)
)
*
exp
(
-
(
xq
*
xq
+
yq
*
yq
)
/
sig2PlusDt4
)]
)
return
LinearAdvectionDiffusion1DDirichlet
([
ux
,
uy
],
eps
,
u0
),
u0
(
0
,
x
),
\
[
0
,
0
],
[
1
,
1
],
[
16
,
16
],
1.0
,
\
"
pulse
"
+
str
(
eps
),
lambda
t
:
u0
(
t
,
x
)
def
pulse
(
velo
=
None
,
eps
=
None
):
if
velo
is
None
:
center
=
as_vector
([
0.5
,
0.5
])
x0
=
x
[
0
]
-
center
[
0
]
x1
=
x
[
1
]
-
center
[
1
]
ux
=
-
4.0
*
x1
uy
=
4.0
*
x0
def
u0
(
t
,
x
):
sig2
=
0.004
if
eps
is
None
:
sig2PlusDt4
=
sig2
else
:
sig2PlusDt4
=
sig2
+
(
4.0
*
eps
*
t
)
xq
=
(
x0
*
cos
(
4.0
*
t
)
+
x1
*
sin
(
4.0
*
t
))
+
0.25
yq
=
(
-
x0
*
sin
(
4.0
*
t
)
+
x1
*
cos
(
4.0
*
t
))
return
as_vector
(
[(
sig2
/
(
sig2PlusDt4
)
)
*
exp
(
-
(
xq
*
xq
+
yq
*
yq
)
/
sig2PlusDt4
)]
)
return
LinearAdvectionDiffusion1DDirichlet
([
ux
,
uy
],
eps
,
u0
),
u0
(
0
,
x
),
\
[
0
,
0
],
[
1
,
1
],
[
16
,
16
],
1.0
,
\
"
pulse
"
+
str
(
eps
),
lambda
t
:
u0
(
t
,
x
)
else
:
return
LinearAdvectionDiffusion1DDirichlet
(
velo
,
eps
,
u0
),
u0
(
0
,
x
),
\
[
0
,
0
],
[
1
,
1
],
[
16
,
16
],
1.0
,
\
"
pulse
"
+
str
(
eps
),
lambda
t
:
u0
(
t
,
x
)
def
diffusivePulse
():
return
pulse
(
0.001
)
def
veloDiffusivePulse
(
velo
):
return
pulse
(
velo
,
0.001
)
def
burgersShock
():
Model
=
Burgers1D
UL
=
1
...
...
This diff is collapsed.
Click to expand it.
pydemo/euler/shock_tube_fast.py
+
4
−
4
View file @
25ae45a0
...
...
@@ -33,7 +33,7 @@ def initialize(space):
return
space
.
interpolate
(
initial
,
name
=
'
u_h
'
)
else
:
lagOrder
=
1
# space.order
spacelag
=
create
.
space
(
"
lagrange
"
,
space
.
grid
,
order
=
lagOrder
,
dim
r
ange
=
space
.
dimRange
)
spacelag
=
create
.
space
(
"
lagrange
"
,
space
.
grid
,
order
=
lagOrder
,
dim
R
ange
=
space
.
dimRange
)
u_h
=
spacelag
.
interpolate
(
initial
,
name
=
'
tmp
'
)
return
space
.
interpolate
(
u_h
,
name
=
'
u_h
'
)
...
...
@@ -43,7 +43,7 @@ def useGalerkinOp():
# some sign error or something else leading to wrong results
# still needs fixing
spaceName
=
"
finitevolume
"
space
=
create
.
space
(
spaceName
,
grid
,
dim
r
ange
=
dimR
)
space
=
create
.
space
(
spaceName
,
grid
,
dim
R
ange
=
dimR
)
n
=
FacetNormal
(
space
.
cell
())
...
...
@@ -77,9 +77,9 @@ def useODESolver(polOrder=2, limiter='default'):
polOrder
=
polOrder
if
False
:
# needs change in dune/fem-dg/operator/dg/passtraits.hh
space
=
create
.
space
(
"
dglegendre
"
,
grid
,
order
=
polOrder
,
dim
r
ange
=
dimR
,
hierarchical
=
False
)
space
=
create
.
space
(
"
dglegendre
"
,
grid
,
order
=
polOrder
,
dim
R
ange
=
dimR
,
hierarchical
=
False
)
else
:
space
=
create
.
space
(
"
dgonb
"
,
grid
,
order
=
polOrder
,
dim
r
ange
=
dimR
)
space
=
create
.
space
(
"
dgonb
"
,
grid
,
order
=
polOrder
,
dim
R
ange
=
dimR
)
u_h
=
initialize
(
space
)
# rho, v, p = Model.toPrim(u_h)
operator
=
createFemDGSolver
(
Model
,
space
,
limiter
=
limiter
)
...
...
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