Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux-course
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-course
Commits
c2964b52
Commit
c2964b52
authored
6 years ago
by
Dennis Gläser
Browse files
Options
Downloads
Patches
Plain Diff
[ex3] improve main file readability
parent
7d7f11bc
No related branches found
No related tags found
1 merge request
!4
Feature/improve fluidsystem ex
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exercises/exercise-fluidsystem/exercise3.cc
+5
-35
5 additions, 35 deletions
exercises/exercise-fluidsystem/exercise3.cc
with
5 additions
and
35 deletions
exercises/exercise-fluidsystem/exercise3.cc
+
5
−
35
View file @
c2964b52
...
@@ -18,8 +18,8 @@
...
@@ -18,8 +18,8 @@
*****************************************************************************/
*****************************************************************************/
/*!
/*!
* \file
* \file
*
*
\brief The main file for exercise 3. This solves an instationary problem
*
\brief DOC ME!
*
with an implicit time discretization.
*/
*/
#include
<config.h>
#include
<config.h>
...
@@ -52,35 +52,6 @@
...
@@ -52,35 +52,6 @@
#include
<dumux/io/vtkoutputmodule.hh>
#include
<dumux/io/vtkoutputmodule.hh>
#include
<dumux/io/grid/gridmanager.hh>
#include
<dumux/io/grid/gridmanager.hh>
/*!
* \brief Provides an interface for customizing error messages associated with
* reading in parameters.
*
* \param progName The name of the program, that was tried to be started.
* \param errorMsg The error message that was issued by the start function.
* Comprises the thing that went wrong and a general help message.
*/
void
usage
(
const
char
*
progName
,
const
std
::
string
&
errorMsg
)
//TODO check usage
{
if
(
errorMsg
.
size
()
>
0
)
{
std
::
string
errorMessageOut
=
"
\n
Usage: "
;
errorMessageOut
+=
progName
;
errorMessageOut
+=
" [options]
\n
"
;
errorMessageOut
+=
errorMsg
;
errorMessageOut
+=
"
\n\n
The list of mandatory options for this program is:
\n
"
"
\t
-TimeManager.TEnd End of the simulation [s]
\n
"
"
\t
-TimeManager.DtInitial Initial timestep size [s]
\n
"
"
\t
-Grid.File Name of the file containing the grid
\n
"
"
\t
definition in DGF format
\n
"
"
\t
-SpatialParams.LensLowerLeft coordinates of the lower left corner of the lens [m]
\n
"
"
\t
-SpatialParams.LensUpperRight coordinates of the upper right corner of the lens [m]
\n
"
"
\t
-Problem.Name String for naming of the output files
\n
"
"
\n
"
;
std
::
cout
<<
errorMessageOut
<<
"
\n
"
;
}
}
////////////////////////
////////////////////////
// the main function
// the main function
////////////////////////
////////////////////////
...
@@ -103,7 +74,7 @@ int main(int argc, char** argv) try
...
@@ -103,7 +74,7 @@ int main(int argc, char** argv) try
DumuxMessage
::
print
(
/*firstCall=*/
true
);
DumuxMessage
::
print
(
/*firstCall=*/
true
);
// parse command line arguments and input file
// parse command line arguments and input file
Parameters
::
init
(
argc
,
argv
,
usage
);
Parameters
::
init
(
argc
,
argv
);
// try to create a grid (from the given grid file or the input file)
// try to create a grid (from the given grid file or the input file)
GridManager
<
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
)
>
gridManager
;
GridManager
<
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
)
>
gridManager
;
...
@@ -157,7 +128,7 @@ int main(int argc, char** argv) try
...
@@ -157,7 +128,7 @@ int main(int argc, char** argv) try
timeLoop
->
setMaxTimeStepSize
(
maxDt
);
timeLoop
->
setMaxTimeStepSize
(
maxDt
);
// the assembler with time loop for instationary problem
// the assembler with time loop for instationary problem
using
Assembler
=
FVAssembler
<
TypeTag
,
DiffMethod
::
numeric
>
;
using
Assembler
=
FVAssembler
<
TypeTag
,
DiffMethod
::
numeric
,
/*implicit?*/
true
>
;
auto
assembler
=
std
::
make_shared
<
Assembler
>
(
problem
,
fvGridGeometry
,
gridVariables
,
timeLoop
);
auto
assembler
=
std
::
make_shared
<
Assembler
>
(
problem
,
fvGridGeometry
,
gridVariables
,
timeLoop
);
// the linear solver
// the linear solver
...
@@ -195,11 +166,10 @@ int main(int argc, char** argv) try
...
@@ -195,11 +166,10 @@ int main(int argc, char** argv) try
}
while
(
!
timeLoop
->
finished
());
}
while
(
!
timeLoop
->
finished
());
timeLoop
->
finalize
(
leafGridView
.
comm
());
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
// finalize, print dumux message to say goodbye
// finalize, print dumux message to say goodbye
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
timeLoop
->
finalize
(
leafGridView
.
comm
());
// print dumux end message
// print dumux end message
if
(
mpiHelper
.
rank
()
==
0
)
if
(
mpiHelper
.
rank
()
==
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