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
94905f94
Commit
94905f94
authored
5 years ago
by
Robert K
Browse files
Options
Downloads
Patches
Plain Diff
[bugfix][RungeKuttaSolver] Only use tpPtr_ when the pointer is set.
parent
b54d31ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#23010
failed
5 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/fem-dg/solver/rungekuttasolver.hh
+19
-12
19 additions, 12 deletions
dune/fem-dg/solver/rungekuttasolver.hh
with
19 additions
and
12 deletions
dune/fem-dg/solver/rungekuttasolver.hh
+
19
−
12
View file @
94905f94
...
...
@@ -332,7 +332,7 @@ namespace Fem
:
RungeKuttaSolver
(
*
(
new
TimeProviderType
(
op
.
space
().
gridPart
().
comm
(),
parameter
)),
op
,
advOp
,
diffOp
,
"PyRK"
,
parameter
)
{
tpPtr_
.
reset
(
dynam
ic_cast
<
TimeProviderType
*
>
(
&
timeProvider_
)
);
tpPtr_
.
reset
(
stat
ic_cast
<
TimeProviderType
*
>
(
&
timeProvider_
)
);
const
TimeSteppingParameters
param
(
"femdg.stepper."
,
parameter
);
const
double
maxTimeStep
=
param
.
maxTimeStep
();
// start first time step with prescribed fixed time step
...
...
@@ -351,13 +351,17 @@ namespace Fem
}
assert
(
odeSolver_
);
odeSolver_
->
initialize
(
U
);
// adjust fixed time step with timeprovider.factor()
fixedTimeStep_
/=
tpPtr_
->
factor
()
;
if
(
fixedTimeStep_
>
1e-20
)
tpPtr_
->
init
(
fixedTimeStep_
);
else
tpPtr_
->
init
();
std
::
cout
<<
"cfl = "
<<
double
(
tpPtr_
->
factor
())
<<
", T_0 = "
<<
tpPtr_
->
time
()
<<
" dtEst = "
<<
tpPtr_
->
timeStepEstimate
()
<<
std
::
endl
;
if
(
tpPtr_
)
{
// adjust fixed time step with timeprovider.factor()
fixedTimeStep_
/=
tpPtr_
->
factor
()
;
if
(
fixedTimeStep_
>
1e-20
)
tpPtr_
->
init
(
fixedTimeStep_
);
else
tpPtr_
->
init
();
std
::
cout
<<
"cfl = "
<<
double
(
tpPtr_
->
factor
())
<<
", T_0 = "
<<
tpPtr_
->
time
()
<<
" dtEst = "
<<
tpPtr_
->
timeStepEstimate
()
<<
std
::
endl
;
}
initialized_
=
true
;
}
}
...
...
@@ -385,12 +389,15 @@ namespace Fem
void
setTimeStepSize
(
const
double
dt
)
{
fixedTimeStep_
=
dt
;
fixedTimeStep_
/=
tpPtr_
->
factor
()
;
tpPtr_
->
provideTimeStepEstimate
(
dt
);
if
(
tpPtr_
)
{
fixedTimeStep_
/=
tpPtr_
->
factor
()
;
tpPtr_
->
provideTimeStepEstimate
(
dt
);
}
}
double
deltaT
()
const
{
return
t
pPtr_
->
deltaT
();
}
double
time
()
const
{
return
t
pPtr_
->
time
();
}
double
deltaT
()
const
{
return
t
imeProvider_
.
deltaT
();
}
double
time
()
const
{
return
t
imeProvider_
.
time
();
}
//! solver the ODE
void
solve
(
DestinationType
&
U
)
...
...
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