Commit 8fb6750d authored by Timo Koch's avatar Timo Koch
Browse files

[io] Implement general gridcreator

Everything can be controlled by the input file: Changing

[Grid]
File = ./grid.dgf

into

[Grid]
File = ./grid.gmsh

or into

[Grid]
LowerLeft = 0 0 0
UpperRight = 1 1 1
Cells = 20 30 10

will construct a gmsh grid or a structured grid instead of the dgf grid.
The grid creator is the new standard grid creator.
To use all features dune 2.4 is required (e.g. structured grid factory)
but it dgf/gmsh works with dune 2.3. The structured grid factories can
be deprecated as soon as dune 2.4 is released.

additional feature:
- set inital refinement in Grid.Refinement  (oder options can be easily
  added, write me)
- grid specific parameter in input file, e.g.  UGGrid: Grid.ClosureType
  = None
turns off green refinement (triangles closure).
- new property GridParameterGroup sets the input file group the grid
  creator is looking in. Particularly useful for two grid simulations:

[DarcyGrid]
File = bla.dgf

[StokesGrid]
File = blub.dgf



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@15307 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 8d808e02
......@@ -30,7 +30,7 @@
#include <dumux/common/propertysystem.hh>
#include <dumux/common/parameters.hh>
#include <dumux/io/dgfgridcreator.hh>
#include <dumux/io/gridcreator.hh>
#include <dumux/io/vtkmultiwriter.hh>
namespace Dumux
......@@ -72,6 +72,9 @@ NEW_PROP_TAG(ParameterTree);
//! Property which defines the group that is queried for parameters by default
NEW_PROP_TAG(ModelParameterGroup);
//! Property which defines the group that is queried for grid (creator) parameters by default
NEW_PROP_TAG(GridParameterGroup);
//! Property which provides a GridCreator (manages grids)
NEW_PROP_TAG(GridCreator);
......@@ -151,8 +154,11 @@ SET_PROP(NumericModel, ParameterTree)
//! use the global group as default for the model's parameter group
SET_STRING_PROP(NumericModel, ModelParameterGroup, "");
//! use the Grid group as default for the grid parameter group
SET_STRING_PROP(NumericModel, GridParameterGroup, "Grid");
//! Use the DgfGridCreator by default
SET_TYPE_PROP(NumericModel, GridCreator, Dumux::DgfGridCreator<TypeTag>);
SET_TYPE_PROP(NumericModel, GridCreator, Dumux::GridCreator<TypeTag>);
//! Set default output level to 0 -> only primary variables are added to output
SET_INT_PROP(NumericModel, VtkOutputLevel, 0);
......
......@@ -109,6 +109,37 @@
#define GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, ParamType, GroupName, ParamName) \
::Dumux::Parameters::getRuntime<TypeTag, ParamType>(#GroupName, #ParamName)
/*!
* \ingroup Parameter
* \brief Retrieve a runtime parameter which _does not_ have a default value taken from
* the Dumux property system.
*
* The third argument is group name, which has to be a c-string
* This allows to use string variables as group name. The functionality of having varaibles as
* group name is no problem when directly using the Dune::ParameterTree. For consistency with the
* macro way of reading in the parameters this macro is necessary e.g. in the gridcreator to reach
* a satisfying level of generality.
*
* Example with a temporary c-string:
*
* \code
* // -> retrieves global integer value "NumberOfCellsX" which is
* // located in the parameter group "Grid"
* GET_RUNTIME_PARAM_FROM_GROUP_CSTRING(TypeTag, int, "Grid", NumberOfCellsX);
* \endcode
*
* Example with a string variable:
*
* \code
* // -> retrieves global integer value "NumberOfCellsX" which is
* // located in the parameter group "Grid"
* std::string groupName = "Grid";
* GET_RUNTIME_PARAM_FROM_GROUP_CSTRING(TypeTag, int, groupName.c_str(), NumberOfCellsX);
* \endcode
*/
#define GET_RUNTIME_PARAM_FROM_GROUP_CSTRING(TypeTag, ParamType, GroupName, ParamName) \
::Dumux::Parameters::getRuntime<TypeTag, ParamType>(GroupName, #ParamName)
namespace Dumux
{
namespace Properties
......
This diff is collapsed.
......@@ -26,6 +26,7 @@
#include <dune/grid/yaspgrid.hh>
#include <dumux/io/cubegridcreator.hh>
#include <dumux/io/gridcreator.hh>
#include <dumux/material/fluidsystems/liquidphase.hh>
#include <dumux/material/components/simpleh2o.hh>
......@@ -43,7 +44,7 @@
#include "test_impesspatialparams.hh"
#include<dumux/decoupled/2p/transport/fv/evalcflfluxcoats.hh>
#include <dumux/decoupled/2p/transport/fv/evalcflfluxcoats.hh>
#include <dumux/linear/amgbackend.hh>
......@@ -117,8 +118,8 @@ NEW_TYPE_TAG(IMPESTestProblemWithAMG, INHERITS_FROM(IMPESTestProblem));
SET_TYPE_PROP(IMPESTestProblemWithAMG, LinearSolver, Dumux::AMGBackend<TypeTag>);
// Set the grid type
SET_TYPE_PROP(IMPESTestProblemWithAMG, Grid, Dune::YaspGrid<2>);
// set the GridCreator property
SET_TYPE_PROP(IMPESTestProblemWithAMG, GridCreator, Dumux::DgfGridCreator<TypeTag>);
// Set the grid creator
SET_TYPE_PROP(IMPESTestProblemWithAMG, GridCreator, Dumux::GridCreator<TypeTag>);
}
/*!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment