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
c88f3148
Commit
c88f3148
authored
6 months ago
by
Robert K
Browse files
Options
Downloads
Patches
Plain Diff
[cleanup][rk] Use function instead of interpolate to create empty df.
parent
a6454baa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#72998
passed
6 months ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/dune/femdg/rk.py
+10
-10
10 additions, 10 deletions
python/dune/femdg/rk.py
with
10 additions
and
10 deletions
python/dune/femdg/rk.py
+
10
−
10
View file @
c88f3148
...
...
@@ -55,10 +55,10 @@ class HelmholtzButcher:
def
__init__
(
self
,
op
,
parameters
=
{},
useScipy
=
False
):
self
.
op
=
op
self
.
_alpha
=
None
self
.
arg
=
op
.
space
.
interpolate
(
op
.
space
.
dimRange
*
[
0
],
name
=
"
HelmholtzButcher::arg
"
)
self
.
arg
=
op
.
space
.
function
(
name
=
"
HelmholtzButcher::arg
"
)
self
.
_invOp
=
None
if
useScipy
:
self
.
res
=
op
.
space
.
interpolate
(
op
.
space
.
dimRange
*
[
0
],
name
=
"
HelmholtzButcher::res
"
)
self
.
res
=
op
.
space
.
function
(
name
=
"
HelmholtzButcher::res
"
)
def
f
(
x_coeff
):
"""
Implements: L[baru+a*k] - k = 0
...
...
@@ -122,7 +122,7 @@ class HelmholtzShuOsher:
self
.
op
=
op
self
.
_alpha
=
None
self
.
_nonlinsolve
=
None
self
.
res
=
op
.
space
.
interpolate
(
op
.
space
.
dimRange
*
[
0
],
name
=
"
HelmholtzShuOsher::res
"
)
self
.
res
=
op
.
space
.
function
(
name
=
"
HelmholtzShuOsher::res
"
)
self
.
_invOp
=
None
if
useScipy
:
def
f
(
x_coeff
):
...
...
@@ -194,8 +194,8 @@ class RungeKutta:
self
.
dt
=
None
self
.
k
=
self
.
stages
*
[
None
]
for
i
in
range
(
self
.
stages
):
self
.
k
[
i
]
=
op
.
space
.
interpolate
(
op
.
space
.
dimRange
*
[
0
],
name
=
"
k
"
)
self
.
tmp
=
op
.
space
.
interpolate
(
op
.
space
.
dimRange
*
[
0
],
name
=
"
tmp
"
)
self
.
k
[
i
]
=
op
.
space
.
function
(
name
=
"
k
"
)
self
.
tmp
=
op
.
space
.
function
(
name
=
"
tmp
"
)
self
.
explicit
=
all
([
abs
(
A
[
i
][
i
])
<
1e-15
for
i
in
range
(
self
.
stages
)])
self
.
computeStages
=
self
.
explicitStages
if
self
.
explicit
else
self
.
implicitStages
if
not
self
.
explicit
:
...
...
@@ -315,7 +315,7 @@ class ImplSSP2: # with stages=1 same as above - increasing stages does not impro
self
.
musps
=
1
/
(
2
*
stages
)
self
.
lamsps
=
1
self
.
q2
=
op
.
space
.
interpolate
(
op
.
space
.
dimRange
*
[
0
],
name
=
"
q2
"
)
self
.
q2
=
op
.
space
.
function
(
name
=
"
q2
"
)
self
.
tmp
=
self
.
q2
.
copy
()
self
.
cfl
=
0.45
if
cfl
is
None
else
cfl
self
.
dt
=
None
...
...
@@ -355,7 +355,7 @@ class ExplSSP2:
def
__init__
(
self
,
stages
,
op
,
cfl
=
None
,
*
args
,
**
kwargs
):
self
.
op
=
op
self
.
stages
=
stages
self
.
q2
=
op
.
space
.
interpolate
(
op
.
space
.
dimRange
*
[
0
],
name
=
"
q2
"
)
self
.
q2
=
op
.
space
.
function
(
name
=
"
q2
"
)
self
.
tmp
=
self
.
q2
.
copy
()
self
.
cfl
=
0.45
*
(
stages
-
1
)
self
.
dt
=
None
...
...
@@ -418,7 +418,7 @@ class ExplSSP3:
self
.
stages
=
self
.
n
*
self
.
n
assert
self
.
stages
==
stages
,
"
doesn
'
t work if sqrt(s) is not integer
"
self
.
r
=
self
.
stages
-
self
.
n
self
.
q2
=
op
.
space
.
interpolate
(
op
.
space
.
dimRange
*
[
0
],
name
=
"
q2
"
)
self
.
q2
=
op
.
space
.
function
(
name
=
"
q2
"
)
self
.
tmp
=
self
.
q2
.
copy
()
self
.
cfl
=
0.45
*
stages
*
(
1
-
1
/
self
.
n
)
if
cfl
is
None
else
cfl
self
.
dt
=
None
...
...
@@ -473,7 +473,7 @@ class ImplSSP3:
self
.
musps
=
(
stages
+
1
)
/
q
self
.
lamsps
=
(
stages
+
1
)
/
q
*
(
stages
-
1
+
sqrt
(
stages
*
stages
-
1
))
self
.
q2
=
op
.
space
.
interpolate
(
op
.
space
.
dimRange
*
[
0
],
name
=
"
q2
"
)
self
.
q2
=
op
.
space
.
function
(
name
=
"
q2
"
)
self
.
tmp
=
self
.
q2
.
copy
()
self
.
cfl
=
0.45
*
(
stages
-
1
+
sqrt
(
stages
*
stages
-
1
))
if
cfl
is
None
else
cfl
self
.
dt
=
None
...
...
@@ -531,7 +531,7 @@ class ExplSSP4_10:
def
__init__
(
self
,
op
,
cfl
=
None
,
*
args
,
**
kwargs
):
self
.
op
=
op
self
.
stages
=
10
self
.
q2
=
op
.
space
.
interpolate
(
op
.
space
.
dimRange
*
[
0
],
name
=
"
q2
"
)
self
.
q2
=
op
.
space
.
function
(
name
=
"
q2
"
)
self
.
tmp
=
self
.
q2
.
copy
()
self
.
cfl
=
0.45
*
self
.
stages
*
0.6
if
cfl
is
None
else
cfl
self
.
dt
=
None
...
...
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