Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
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
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
dumux-repositories
dumux
Commits
c8ba6590
Commit
c8ba6590
authored
1 year ago
by
Timo Koch
Committed by
Dennis Gläser
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[test][tracer][multiphase] Use experimental assembly/timestepping
parent
b55205b9
No related branches found
No related tags found
1 merge request
!3608
[experimental] Multistage assembler
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/porousmediumflow/tracer/multiphase/main.cc
+14
-22
14 additions, 22 deletions
test/porousmediumflow/tracer/multiphase/main.cc
with
14 additions
and
22 deletions
test/porousmediumflow/tracer/multiphase/main.cc
+
14
−
22
View file @
c8ba6590
...
@@ -21,16 +21,17 @@
...
@@ -21,16 +21,17 @@
#include
<dumux/common/initialize.hh>
#include
<dumux/common/initialize.hh>
#include
<dumux/common/properties.hh>
#include
<dumux/common/properties.hh>
#include
<dumux/common/parameters.hh>
#include
<dumux/common/parameters.hh>
#include
<dumux/common/dumuxmessage.hh>
#include
<dumux/common/defaultusagemessage.hh>
#include
<dumux/linear/seqsolverbackend.hh>
#include
<dumux/linear/seqsolverbackend.hh>
#include
<dumux/linear/pdesolver.hh>
#include
<dumux/linear/pdesolver.hh>
#include
<dumux/assembly/fvassembler.hh>
#include
<dumux/io/vtkoutputmodule.hh>
#include
<dumux/io/vtkoutputmodule.hh>
#include
<dumux/io/grid/gridmanager_yasp.hh>
#include
<dumux/io/grid/gridmanager_yasp.hh>
#include
<dumux/experimental/assembly/multistagefvassembler.hh>
#include
<dumux/experimental/timestepping/multistagemethods.hh>
#include
<dumux/experimental/timestepping/multistagetimestepper.hh>
#include
"properties.hh"
#include
"properties.hh"
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
...
@@ -42,11 +43,6 @@ int main(int argc, char** argv)
...
@@ -42,11 +43,6 @@ int main(int argc, char** argv)
// maybe initialize MPI and/or multithreading backend
// maybe initialize MPI and/or multithreading backend
Dumux
::
initialize
(
argc
,
argv
);
Dumux
::
initialize
(
argc
,
argv
);
const
auto
&
mpiHelper
=
Dune
::
MPIHelper
::
instance
();
//! print dumux start message
if
(
mpiHelper
.
rank
()
==
0
)
DumuxMessage
::
print
(
/*firstCall=*/
true
);
// parse the command line arguments and input file
// parse the command line arguments and input file
Parameters
::
init
(
argc
,
argv
);
Parameters
::
init
(
argc
,
argv
);
...
@@ -97,21 +93,22 @@ int main(int argc, char** argv)
...
@@ -97,21 +93,22 @@ int main(int argc, char** argv)
//! instantiate time loop
//! instantiate time loop
auto
timeLoop
=
std
::
make_shared
<
CheckPointTimeLoop
<
Scalar
>>
(
0
,
dt
,
tEnd
);
auto
timeLoop
=
std
::
make_shared
<
CheckPointTimeLoop
<
Scalar
>>
(
0
,
dt
,
tEnd
);
auto
timeSteppingMethod
=
std
::
make_shared
<
Experimental
::
MultiStage
::
ExplicitEuler
<
Scalar
>>
();
//! the assembler with time loop for instationary problem
//! the assembler with time loop for instationary problem
using
Assembler
=
FVAssembler
<
TypeTag
,
DiffMethod
::
numeric
,
/*implicit=*/
false
>
;
using
Assembler
=
Experimental
::
MultiStage
FVAssembler
<
TypeTag
,
DiffMethod
::
numeric
>
;
auto
assembler
=
std
::
make_shared
<
Assembler
>
(
problem
,
gridGeometry
,
gridVariables
,
time
Loop
,
xOld
);
auto
assembler
=
std
::
make_shared
<
Assembler
>
(
problem
,
gridGeometry
,
gridVariables
,
time
SteppingMethod
,
xOld
);
//! the linear solver
//! the linear solver
using
LinearSolver
=
ExplicitDiagonalSolver
;
using
LinearSolver
=
ExplicitDiagonalSolver
;
auto
linearSolver
=
std
::
make_shared
<
LinearSolver
>
();
auto
linearSolver
=
std
::
make_shared
<
LinearSolver
>
();
//! the system solver
//! the system solver
LinearPDESolver
<
Assembler
,
LinearSolver
>
solver
(
assembler
,
linearSolver
);
using
Solver
=
LinearPDESolver
<
Assembler
,
LinearSolver
>
;
auto
solver
=
std
::
make_shared
<
Solver
>
(
assembler
,
linearSolver
);
/////////////////////////////////////////////////////////////////////////////////////////////////
using
TimeStepper
=
Experimental
::
MultiStageTimeStepper
<
Solver
>
;
// run instationary non-linear simulation
TimeStepper
timeStepper
(
solver
,
timeSteppingMethod
);
/////////////////////////////////////////////////////////////////////////////////////////////////
//! set some check points for the time loop
//! set some check points for the time loop
timeLoop
->
setPeriodicCheckPoint
(
tEnd
/
10.0
);
timeLoop
->
setPeriodicCheckPoint
(
tEnd
/
10.0
);
...
@@ -120,8 +117,8 @@ int main(int argc, char** argv)
...
@@ -120,8 +117,8 @@ int main(int argc, char** argv)
timeLoop
->
start
();
timeLoop
->
start
();
while
(
!
timeLoop
->
finished
())
while
(
!
timeLoop
->
finished
())
{
{
//
assemble & solve
//
time integration
solver
.
solve
(
x
);
timeStepper
.
step
(
x
,
timeLoop
->
time
(),
timeLoop
->
timeStepSize
()
);
// make the new solution the old solution
// make the new solution the old solution
xOld
=
x
;
xOld
=
x
;
...
@@ -143,12 +140,7 @@ int main(int argc, char** argv)
...
@@ -143,12 +140,7 @@ int main(int argc, char** argv)
timeLoop
->
finalize
(
leafGridView
.
comm
());
timeLoop
->
finalize
(
leafGridView
.
comm
());
////////////////////////////////////////////////////////////
if
(
leafGridView
.
comm
().
rank
()
==
0
)
// finalize, print dumux message to say goodbye
////////////////////////////////////////////////////////////
//! print dumux end message
if
(
mpiHelper
.
rank
()
==
0
)
Parameters
::
print
();
Parameters
::
print
();
return
0
;
return
0
;
...
...
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