From dc920d90309d600a94e25190262898a3522c3266 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Fri, 3 Feb 2012 17:37:27 +0100 Subject: [PATCH] Improve the startup and parameter routines. --- examples/tutorial_coupled.cc | 21 +-------------------- examples/tutorial_coupled.input | 12 ++++++------ examples/tutorial_decoupled.input | 12 ++++++------ examples/tutorialproblem_coupled.hh | 14 +++++++++++--- examples/tutorialproblem_decoupled.hh | 13 +++++++++++-- 5 files changed, 35 insertions(+), 37 deletions(-) diff --git a/examples/tutorial_coupled.cc b/examples/tutorial_coupled.cc index cadd3ece0..15e307092 100644 --- a/examples/tutorial_coupled.cc +++ b/examples/tutorial_coupled.cc @@ -30,27 +30,8 @@ #include "tutorialproblem_coupled.hh" /*@\label{tutorial-coupled:include-problem-header}@*/ #include /*@\label{tutorial-coupled:include-end}@*/ -//! Prints a usage/help message if something goes wrong or the user asks for help -void usage(const char *progName, const std::string &errorMsg) /*@\label{tutorial-coupled:usage-function}@*/ -{ - std::cout - << "\nUsage: " << progName << " [options]\n"; - if (errorMsg.size() > 0) - std::cout << errorMsg << "\n"; - std::cout - << "\n" - << "The List of Mandatory arguments for this program is:\n" - << "\t-tEnd The end of the simulation [s]\n" - << "\t-dtInitial The initial timestep size [s]\n" - << "\t-Grid.upperRightX The x-coordinate of the grid's upper-right corner [m]\n" - << "\t-Grid.upperRightY The y-coordinate of the grid's upper-right corner [m]\n" - << "\t-Grid.numberOfCellsX The grid's x-resolution\n" - << "\t-Grid.numberOfCellsY The grid's y-resolution\n" - << "\n"; -} - int main(int argc, char** argv) { typedef TTAG(TutorialProblemCoupled) TypeTag; /*@\label{tutorial-coupled:set-type-tag}@*/ - return Dumux::start(argc, argv, usage); /*@\label{tutorial-coupled:call-start}@*/ + return Dumux::start(argc, argv); /*@\label{tutorial-coupled:call-start}@*/ } diff --git a/examples/tutorial_coupled.input b/examples/tutorial_coupled.input index 326a545fc..0591efbc2 100644 --- a/examples/tutorial_coupled.input +++ b/examples/tutorial_coupled.input @@ -1,7 +1,7 @@ -tEnd = 500000 # duration of the simulation [s] -dtInitial = 10 # initial time step size [s] +TEnd = 500e3 # duration of the simulation [s] +DtInitial = 10 # initial time step size [s] [Grid] -upperRightX = 300 # x-coordinate of the upper-right corner of the grid [m] -upperRightY = 60 # y-coordinate of the upper-right corner of the grid [m] -numberOfCellsX = 100 # x-resolution of the grid -numberOfCellsY = 1 # y-resolution of the grid +SizeX = 300 # x-coordinate of the upper-right corner of the grid [m] +SizeY = 60 # y-coordinate of the upper-right corner of the grid [m] +CellsX = 100 # x-resolution of the grid +CellsY = 1 # y-resolution of the grid diff --git a/examples/tutorial_decoupled.input b/examples/tutorial_decoupled.input index 65972f1a1..ee3f0a733 100644 --- a/examples/tutorial_decoupled.input +++ b/examples/tutorial_decoupled.input @@ -1,7 +1,7 @@ -tEnd = 100000 # duration of the simulation [s] -dtInitial = 10 # initial time step size [s] +TEnd = 100000 # duration of the simulation [s] +DtInitial = 10 # initial time step size [s] [Grid] -upperRightX = 300 # x-coordinate of the upper-right corner of the grid [m] -upperRightY = 60 # y-coordinate of the upper-right corner of the grid [m] -numberOfCellsX = 100 # x-resolution of the grid -numberOfCellsY = 1 # y-resolution of the grid \ No newline at end of file +SizeX = 300 # x-coordinate of the upper-right corner of the grid [m] +SizeY = 60 # y-coordinate of the upper-right corner of the grid [m] +CellsX = 100 # x-resolution of the grid +CellsY = 1 # y-resolution of the grid diff --git a/examples/tutorialproblem_coupled.hh b/examples/tutorialproblem_coupled.hh index 57c575cd0..42e352c64 100644 --- a/examples/tutorialproblem_coupled.hh +++ b/examples/tutorialproblem_coupled.hh @@ -76,6 +76,15 @@ public: typedef Dumux::LiquidPhase > type; /*@\label{ SET_TYPE_PROP(TutorialProblemCoupled, FluidSystem, Dumux::TwoPImmiscibleFluidSystem); // Disable gravity SET_BOOL_PROP(TutorialProblemCoupled, EnableGravity, false); /*@\label{tutorial-coupled:gravity}@*/ + +// define the properties required by the cube grid creator +SET_SCALAR_PROP(TutorialProblemCoupled, GridSizeX, 300.0); +SET_SCALAR_PROP(TutorialProblemCoupled, GridSizeY, 60.0); +SET_SCALAR_PROP(TutorialProblemCoupled, GridSizeZ, 0.0); + +SET_INT_PROP(TutorialProblemCoupled, GridCellsX, 100); +SET_INT_PROP(TutorialProblemCoupled, GridCellsY, 1); +SET_INT_PROP(TutorialProblemCoupled, GridCellsZ, 0); } /*! @@ -107,9 +116,8 @@ class TutorialProblemCoupled : public TwoPProblem /*@\label{tutorial-co typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry; public: - TutorialProblemCoupled(TimeManager &timeManager, - const GridView &gridView) - : ParentType(timeManager, gridView) + TutorialProblemCoupled(TimeManager &timeManager) + : ParentType(timeManager, GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView()) , eps_(3e-6) { } diff --git a/examples/tutorialproblem_decoupled.hh b/examples/tutorialproblem_decoupled.hh index f88465f7b..bf1b52100 100644 --- a/examples/tutorialproblem_decoupled.hh +++ b/examples/tutorialproblem_decoupled.hh @@ -98,6 +98,15 @@ SET_SCALAR_PROP(TutorialProblemDecoupled, CFLFactor, 0.95); /*@\label{tutorial-d // Disable gravity SET_BOOL_PROP(TutorialProblemDecoupled, EnableGravity, false); /*@\label{tutorial-decoupled:gravity}@*/ + +// define the properties required by the cube grid creator +SET_SCALAR_PROP(TutorialProblemDecoupled, GridSizeX, 300.0); +SET_SCALAR_PROP(TutorialProblemDecoupled, GridSizeY, 60.0); +SET_SCALAR_PROP(TutorialProblemDecoupled, GridSizeZ, 0.0); + +SET_INT_PROP(TutorialProblemDecoupled, GridCellsX, 100); +SET_INT_PROP(TutorialProblemDecoupled, GridCellsY, 1); +SET_INT_PROP(TutorialProblemDecoupled, GridCellsZ, 0); } /*@\label{tutorial-decoupled:propertysystem-end}@*/ /*! \ingroup DecoupledProblems @@ -140,8 +149,8 @@ class TutorialProblemDecoupled: public IMPESProblem2P /*@\label{tutoria typedef Dune::FieldVector GlobalPosition; public: - TutorialProblemDecoupled(TimeManager &timeManager, const GridView &gridView) - : ParentType(timeManager, gridView), eps_(1e-6)/*@\label{tutorial-decoupled:constructor-problem}@*/ + TutorialProblemDecoupled(TimeManager &timeManager) + : ParentType(timeManager, GET_PROP_TYPE(TypeTag, GridCreator)::grid().leafView()), eps_(1e-6)/*@\label{tutorial-decoupled:constructor-problem}@*/ { //write only every 10th time step to output file this->setOutputInterval(1);/*@\label{tutorial-decoupled:outputinterval}@*/