Commit 2d818b98 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

implicit branch: unify *propertydefaults.hh, fix includes in implicit/common

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/branches/implicit@9726 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 4ec30bbe
......@@ -19,11 +19,6 @@
#ifndef DUMUX_BOX_PROPERTIES_HH
#define DUMUX_BOX_PROPERTIES_HH
#include <dumux/common/propertysystem.hh>
#include <dumux/common/basicproperties.hh>
#include <dumux/linear/linearsolverproperties.hh>
#include <dumux/nonlinear/newtonmethod.hh>
#include <dumux/implicit/common/implicitproperties.hh>
/*!
......@@ -49,7 +44,7 @@ namespace Properties
//////////////////////////////////////////////////////////////////
//! The type tag for models based on the box-scheme
NEW_TYPE_TAG(BoxModel, INHERITS_FROM(NewtonMethod, LinearSolverTypeTag, ImplicitModel));
NEW_TYPE_TAG(BoxModel, INHERITS_FROM(ImplicitBase));
//////////////////////////////////////////////////////////////////
// Property tags
......
......@@ -27,9 +27,7 @@
#ifndef DUMUX_BOX_PROPERTY_DEFAULTS_HH
#define DUMUX_BOX_PROPERTY_DEFAULTS_HH
#include <dumux/nonlinear/newtonmethod.hh>
#include <dumux/nonlinear/newtoncontroller.hh>
#include <dumux/implicit/common/implicitpropertydefaults.hh>
#include "boxassembler.hh"
#include "boxmodel.hh"
#include "boxfvelementgeometry.hh"
......@@ -38,14 +36,8 @@
#include "boxlocalresidual.hh"
#include "boxelementvolumevariables.hh"
#include "boxvolumevariables.hh"
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/timemanager.hh>
#include "boxproperties.hh"
#include <limits>
namespace Dumux {
// forward declaration
......@@ -53,51 +45,17 @@ template<class TypeTag>
class BoxModel;
namespace Properties {
//////////////////////////////////////////////////////////////////
// Some defaults for very fundamental properties
//////////////////////////////////////////////////////////////////
//! Set the default type for the time manager
SET_TYPE_PROP(BoxModel, TimeManager, Dumux::TimeManager<TypeTag>);
//////////////////////////////////////////////////////////////////
// Properties
//////////////////////////////////////////////////////////////////
//! Use the leaf grid view if not defined otherwise
SET_TYPE_PROP(BoxModel,
GridView,
typename GET_PROP_TYPE(TypeTag, Grid)::LeafGridView);
//! Set the default for the FVElementGeometry
SET_TYPE_PROP(BoxModel, FVElementGeometry, Dumux::BoxFVElementGeometry<TypeTag>);
//! Disable evaluation of shape function gradients at the sub-control volume center by default
// The shape function gradients at the sub-control volume center are currently only
// needed for the stokes and the linear elastic models
// needed for the Stokes and the linear elastic models
SET_BOOL_PROP(BoxModel, EvalGradientsAtSCVCenter, false);
//! Set the default for the ElementBoundaryTypes
SET_TYPE_PROP(BoxModel, ElementBoundaryTypes, Dumux::BoxElementBoundaryTypes<TypeTag>);
//! use the plain newton method for the box scheme by default
SET_TYPE_PROP(BoxModel, NewtonMethod, Dumux::NewtonMethod<TypeTag>);
//! use the plain newton controller for the box scheme by default
SET_TYPE_PROP(BoxModel, NewtonController, Dumux::NewtonController<TypeTag>);
//! Mapper for the grid view's vertices.
SET_TYPE_PROP(BoxModel,
VertexMapper,
Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView),
Dune::MCMGVertexLayout>);
//! Mapper for the grid view's elements.
SET_TYPE_PROP(BoxModel,
ElementMapper,
Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView),
Dune::MCMGElementLayout>);
//! Mapper for the degrees of freedoms.
SET_TYPE_PROP(BoxModel, DofMapper, typename GET_PROP_TYPE(TypeTag, VertexMapper));
......@@ -110,97 +68,15 @@ SET_TYPE_PROP(BoxModel, BaseModel, Dumux::BoxModel<TypeTag>);
//! The local jacobian operator for the box scheme
SET_TYPE_PROP(BoxModel, LocalJacobian, Dumux::BoxLocalJacobian<TypeTag>);
/*!
* \brief The type of a solution for the whole grid at a fixed time.
*/
SET_TYPE_PROP(BoxModel,
SolutionVector,
Dune::BlockVector<typename GET_PROP_TYPE(TypeTag, PrimaryVariables)>);
/*!
* \brief The type of a solution for a whole element.
*/
SET_TYPE_PROP(BoxModel,
ElementSolutionVector,
Dune::BlockVector<typename GET_PROP_TYPE(TypeTag, PrimaryVariables)>);
/*!
* \brief A vector of primary variables.
*/
SET_TYPE_PROP(BoxModel,
PrimaryVariables,
Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar),
GET_PROP_VALUE(TypeTag, NumEq)>);
/*!
* \brief The volume variable class.
*
* This should almost certainly be overloaded by the model...
*/
SET_TYPE_PROP(BoxModel, VolumeVariables, Dumux::BoxVolumeVariables<TypeTag>);
/*!
* \brief An array of secondary variable containers.
*/
//! An array of secondary variable containers
SET_TYPE_PROP(BoxModel, ElementVolumeVariables, Dumux::BoxElementVolumeVariables<TypeTag>);
/*!
* \brief Boundary types at a single degree of freedom.
*/
SET_TYPE_PROP(BoxModel,
BoundaryTypes,
Dumux::BoundaryTypes<GET_PROP_VALUE(TypeTag, NumEq)>);
/*!
* \brief Assembler for the global jacobian matrix.
*/
//! Assembler for the global jacobian matrix
SET_TYPE_PROP(BoxModel, JacobianAssembler, Dumux::BoxAssembler<TypeTag>);
//! use an unlimited time step size by default
SET_SCALAR_PROP(BoxModel, TimeManagerMaxTimeStepSize, 1e100);
//! use forward differences to calculate the jacobian by default
SET_INT_PROP(BoxModel, ImplicitNumericDifferenceMethod, +1);
//! do not use hints by default
SET_BOOL_PROP(BoxModel, ImplicitEnableHints, false);
// disable jacobian matrix recycling by default
SET_BOOL_PROP(BoxModel, ImplicitEnableJacobianRecycling, false);
// disable partial reassembling by default
SET_BOOL_PROP(BoxModel, ImplicitEnablePartialReassemble, false);
// disable two-point-flux by default
//! disable two-point-flux by default
SET_BOOL_PROP(BoxModel, ImplicitUseTwoPointFlux, false);
//! Set the type of a global jacobian matrix from the solution types
SET_PROP(BoxModel, JacobianMatrix)
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
typedef typename Dune::FieldMatrix<Scalar, numEq, numEq> MatrixBlock;
public:
typedef typename Dune::BCRSMatrix<MatrixBlock> type;
};
// use the stabilized BiCG solver preconditioned by the ILU-0 by default
SET_TYPE_PROP(BoxModel, LinearSolver, Dumux::BoxBiCGStabILU0Solver<TypeTag> );
// if the deflection of the newton method is large, we do not
// need to solve the linear approximation accurately. Assuming
// that the initial value for the delta vector u is quite
// close to the final value, a reduction of 6 orders of
// magnitude in the defect should be sufficient...
SET_SCALAR_PROP(BoxModel, LinearSolverResidualReduction, 1e-6);
//! set the default number of maximum iterations for the linear solver
SET_INT_PROP(BoxModel, LinearSolverMaxIterations, 250);
//! set number of equations of the mathematical model as default
SET_INT_PROP(BoxModel, LinearSolverBlockSize, GET_PROP_VALUE(TypeTag, NumEq));
//! indicate that this is a box discretization
SET_BOOL_PROP(BoxModel, ImplicitIsBox, true);
......
......@@ -19,11 +19,6 @@
#ifndef DUMUX_CC_PROPERTIES_HH
#define DUMUX_CC_PROPERTIES_HH
#include <dumux/common/propertysystem.hh>
#include <dumux/common/basicproperties.hh>
#include <dumux/linear/linearsolverproperties.hh>
#include <dumux/nonlinear/newtonmethod.hh>
#include <dumux/implicit/common/implicitproperties.hh>
/*!
......@@ -49,7 +44,7 @@ namespace Properties
//////////////////////////////////////////////////////////////////
//! The type tag for models based on the box-scheme
NEW_TYPE_TAG(CCModel, INHERITS_FROM(NewtonMethod, LinearSolverTypeTag, ImplicitModel));
NEW_TYPE_TAG(CCModel, INHERITS_FROM(ImplicitBase));
}
}
......
......@@ -31,9 +31,7 @@
#ifndef DUMUX_CC_PROPERTY_DEFAULTS_HH
#define DUMUX_CC_PROPERTY_DEFAULTS_HH
#include <dumux/nonlinear/newtonmethod.hh>
#include <dumux/nonlinear/newtoncontroller.hh>
#include <dumux/implicit/common/implicitpropertydefaults.hh>
#include "ccassembler.hh"
#include "ccmodel.hh"
#include "ccfvelementgeometry.hh"
......@@ -41,15 +39,8 @@
#include "cclocaljacobian.hh"
#include "cclocalresidual.hh"
#include "ccelementvolumevariables.hh"
#include <dumux/implicit/box/boxvolumevariables.hh>
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/timemanager.hh>
#include "ccproperties.hh"
#include <limits>
namespace Dumux {
// forward declaration
......@@ -57,46 +48,12 @@ template<class TypeTag>
class CCModel;
namespace Properties {
//////////////////////////////////////////////////////////////////
// Some defaults for very fundamental properties
//////////////////////////////////////////////////////////////////
//! Set the default type for the time manager
SET_TYPE_PROP(CCModel, TimeManager, Dumux::TimeManager<TypeTag>);
//////////////////////////////////////////////////////////////////
// Properties
//////////////////////////////////////////////////////////////////
//! Use the leaf grid view if not defined otherwise
SET_TYPE_PROP(CCModel,
GridView,
typename GET_PROP_TYPE(TypeTag, Grid)::LeafGridView);
//! Set the default for the FVElementGeometry
SET_TYPE_PROP(CCModel, FVElementGeometry, Dumux::CCFVElementGeometry<TypeTag>);
//! Set the default for the ElementBoundaryTypes
SET_TYPE_PROP(CCModel, ElementBoundaryTypes, Dumux::CCElementBoundaryTypes<TypeTag>);
//! use the plain newton method for the box scheme by default
SET_TYPE_PROP(CCModel, NewtonMethod, Dumux::NewtonMethod<TypeTag>);
//! use the plain newton controller for the box scheme by default
SET_TYPE_PROP(CCModel, NewtonController, Dumux::NewtonController<TypeTag>);
//! Mapper for the grid view's vertices.
SET_TYPE_PROP(CCModel,
VertexMapper,
Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView),
Dune::MCMGVertexLayout>);
//! Mapper for the grid view's elements.
SET_TYPE_PROP(CCModel,
ElementMapper,
Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView),
Dune::MCMGElementLayout>);
//! Mapper for the degrees of freedoms.
SET_TYPE_PROP(CCModel, DofMapper, typename GET_PROP_TYPE(TypeTag, ElementMapper));
......@@ -109,102 +66,15 @@ SET_TYPE_PROP(CCModel, BaseModel, Dumux::CCModel<TypeTag>);
//! The local jacobian operator for the box scheme
SET_TYPE_PROP(CCModel, LocalJacobian, Dumux::CCLocalJacobian<TypeTag>);
/*!
* \brief The type of a solution for the whole grid at a fixed time.
*/
SET_TYPE_PROP(CCModel,
SolutionVector,
Dune::BlockVector<typename GET_PROP_TYPE(TypeTag, PrimaryVariables)>);
/*!
* \brief The type of a solution for a whole element.
*/
SET_TYPE_PROP(CCModel,
ElementSolutionVector,
Dune::BlockVector<typename GET_PROP_TYPE(TypeTag, PrimaryVariables)>);
/*!
* \brief A vector of primary variables.
*/
SET_TYPE_PROP(CCModel,
PrimaryVariables,
Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar),
GET_PROP_VALUE(TypeTag, NumEq)>);
/*!
* \brief The volume variable class.
*
* This should almost certainly be overloaded by the model...
*/
SET_TYPE_PROP(CCModel, VolumeVariables, Dumux::BoxVolumeVariables<TypeTag>);
/*!
* \brief An array of secondary variable containers.
*/
//! An array of secondary variable containers
SET_TYPE_PROP(CCModel, ElementVolumeVariables, Dumux::CCElementVolumeVariables<TypeTag>);
/*!
* \brief Boundary types at a single degree of freedom.
*/
SET_TYPE_PROP(CCModel,
BoundaryTypes,
Dumux::BoundaryTypes<GET_PROP_VALUE(TypeTag, NumEq)>);
/*!
* \brief Assembler for the global jacobian matrix.
*/
//! Assembler for the global jacobian matrix
SET_TYPE_PROP(CCModel, JacobianAssembler, Dumux::CCAssembler<TypeTag>);
//! use an unlimited time step size by default
#if 0
// requires GCC 4.6 and above to call the constexpr function of
// numeric_limits
SET_SCALAR_PROP(CCModel, TimeManagerMaxTimeStepSize, std::numeric_limits<Scalar>::infinity());
#else
SET_SCALAR_PROP(CCModel, TimeManagerMaxTimeStepSize, 1e100);
#endif
//! use forward differences to calculate the jacobian by default
SET_INT_PROP(CCModel, ImplicitNumericDifferenceMethod, +1);
//! do not use hints by default
SET_BOOL_PROP(CCModel, ImplicitEnableHints, false);
// disable jacobian matrix recycling by default
SET_BOOL_PROP(CCModel, ImplicitEnableJacobianRecycling, false);
// disable partial reassembling by default
SET_BOOL_PROP(CCModel, ImplicitEnablePartialReassemble, false);
//! Set the type of a global jacobian matrix from the solution types
SET_PROP(CCModel, JacobianMatrix)
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
typedef typename Dune::FieldMatrix<Scalar, numEq, numEq> MatrixBlock;
public:
typedef typename Dune::BCRSMatrix<MatrixBlock> type;
};
// use the stabilized BiCG solver preconditioned by the ILU-0 by default
SET_TYPE_PROP(CCModel, LinearSolver, Dumux::BoxBiCGStabILU0Solver<TypeTag> );
// if the deflection of the newton method is large, we do not
// need to solve the linear approximation accurately. Assuming
// that the initial value for the delta vector u is quite
// close to the final value, a reduction of 6 orders of
// magnitude in the defect should be sufficient...
SET_SCALAR_PROP(CCModel, LinearSolverResidualReduction, 1e-6);
//! set the default number of maximum iterations for the linear solver
SET_INT_PROP(CCModel, LinearSolverMaxIterations, 250);
//! set number of equations of the mathematical model as default
SET_INT_PROP(CCModel, LinearSolverBlockSize, GET_PROP_VALUE(TypeTag, NumEq));
//! indicate that this is no box discretization
SET_BOOL_PROP(CCModel, ImplicitIsBox, false);
} // namespace Properties
} // namespace Dumux
......
......@@ -23,7 +23,7 @@
* \file
* \brief Base class for all problems which use the two-phase box model
*/
#ifndef DUMUX_POROUS_MEDIA_CC_ROBLEM_HH
#ifndef DUMUX_POROUS_MEDIA_CC_PROBLEM_HH
#define DUMUX_POROUS_MEDIA_CC_PROBLEM_HH
#include <dumux/implicit/cellcentered/ccproblem.hh>
......
......@@ -24,7 +24,7 @@
#ifndef DUMUX_BOX_ELEMENT_BOUNDARY_TYPES_HH
#define DUMUX_BOX_ELEMENT_BOUNDARY_TYPES_HH
#include "boxproperties.hh"
#include "implicitproperties.hh"
#include <dumux/common/valgrind.hh>
......
......@@ -24,7 +24,7 @@
#ifndef DUMUX_BOX_ELEMENT_VOLUME_VARIABLES_HH
#define DUMUX_BOX_ELEMENT_VOLUME_VARIABLES_HH
#include "boxproperties.hh"
#include "implicitproperties.hh"
namespace Dumux
......
......@@ -32,7 +32,7 @@
#include <dumux/common/parameters.hh>
#include <dumux/common/propertysystem.hh>
#include "boxproperties.hh"
#include <dumux/implicit/box/boxproperties.hh>
namespace Dumux
{
......
......@@ -26,7 +26,7 @@
#include <dune/istl/matrix.hh>
#include <dumux/common/math.hh>
#include "boxelementboundarytypes.hh"
#include "implicitelementboundarytypes.hh"
namespace Dumux
{
......
......@@ -28,7 +28,7 @@
#include <dumux/common/valgrind.hh>
#include "boxproperties.hh"
#include "implicitproperties.hh"
namespace Dumux
{
......
......@@ -24,12 +24,12 @@
#ifndef DUMUX_BOX_MODEL_HH
#define DUMUX_BOX_MODEL_HH
#include "boxproperties.hh"
#include "boxpropertydefaults.hh"
#include "implicitproperties.hh"
#include "implicitpropertydefaults.hh"
#include "boxelementvolumevariables.hh"
#include "boxlocaljacobian.hh"
#include "boxlocalresidual.hh"
#include "implicitelementvolumevariables.hh"
#include "implicitlocaljacobian.hh"
#include "implicitlocalresidual.hh"
#include <dumux/parallel/vertexhandles.hh>
......
......@@ -23,7 +23,7 @@
#ifndef DUMUX_BOX_PROBLEM_HH
#define DUMUX_BOX_PROBLEM_HH
#include "boxproperties.hh"
#include "implicitproperties.hh"
#include <dumux/io/vtkmultiwriter.hh>
#include <dumux/io/restart.hh>
......
......@@ -21,6 +21,10 @@
#include <dumux/common/propertysystem.hh>
#include <dumux/common/basicproperties.hh>
#include <dumux/linear/linearsolverproperties.hh>
#include <dumux/nonlinear/newtonmethod.hh>
/*!
* \ingroup Properties
* \ingroup ImplicitProperties
......@@ -39,6 +43,13 @@ namespace Properties
*/
// \{
//////////////////////////////////////////////////////////////////
// Type tags
//////////////////////////////////////////////////////////////////
//! The type tag for models based on the box-scheme
NEW_TYPE_TAG(ImplicitBase, INHERITS_FROM(NewtonMethod, LinearSolverTypeTag, ImplicitModel));
//////////////////////////////////////////////////////////////////
// Property tags
//////////////////////////////////////////////////////////////////
......
......@@ -18,164 +18,111 @@
*****************************************************************************/
/*!
* \ingroup Properties
* \ingroup BoxProperties
* \ingroup BoxModel
* \ingroup ImplicitProperties
* \ingroup ImplicitModel
* \file
*
* \brief Default properties for box models
* \brief Default properties for implicit models
*/
#ifndef DUMUX_BOX_PROPERTY_DEFAULTS_HH
#define DUMUX_BOX_PROPERTY_DEFAULTS_HH
#ifndef DUMUX_IMPLICIT_PROPERTY_DEFAULTS_HH
#define DUMUX_IMPLICIT_PROPERTY_DEFAULTS_HH
#include <dumux/nonlinear/newtonmethod.hh>
#include <dumux/nonlinear/newtoncontroller.hh>
#include "boxassembler.hh"
#include "boxmodel.hh"
#include "boxfvelementgeometry.hh"
#include "boxelementboundarytypes.hh"
#include "boxlocaljacobian.hh"
#include "boxlocalresidual.hh"
#include "boxelementvolumevariables.hh"
#include "boxvolumevariables.hh"
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/timemanager.hh>
#include <dumux/implicit/box/boxvolumevariables.hh>
#include "boxproperties.hh"
#include "implicitproperties.hh"
#include <limits>
namespace Dumux {
// forward declaration
template<class TypeTag>
class BoxModel;
namespace Properties {
//////////////////////////////////////////////////////////////////
// Some defaults for very fundamental properties
//////////////////////////////////////////////////////////////////
//! Set the default type for the time manager
SET_TYPE_PROP(BoxModel, TimeManager, Dumux::TimeManager<TypeTag>);
SET_TYPE_PROP(ImplicitBase, TimeManager, Dumux::TimeManager<TypeTag>);
//////////////////////////////////////////////////////////////////
// Properties
//////////////////////////////////////////////////////////////////
//! Use the leaf grid view if not defined otherwise
SET_TYPE_PROP(BoxModel,
SET_TYPE_PROP(ImplicitBase,
GridView,
typename GET_PROP_TYPE(TypeTag, Grid)::LeafGridView);
//! Set the default for the FVElementGeometry
SET_TYPE_PROP(BoxModel, FVElementGeometry, Dumux::BoxFVElementGeometry<TypeTag>);
//! Disable evaluation of shape function gradients at the sub-control volume center by default
// The shape function gradients at the sub-control volume center are currently only
// needed for the stokes and the linear elastic models
SET_BOOL_PROP(BoxModel, EvalGradientsAtSCVCenter, false);
//! Set the default for the ElementBoundaryTypes
SET_TYPE_PROP(BoxModel, ElementBoundaryTypes, Dumux::BoxElementBoundaryTypes<TypeTag>);
//! use the plain newton method for the box scheme by default
SET_TYPE_PROP(BoxModel, NewtonMethod, Dumux::NewtonMethod<TypeTag>);
SET_TYPE_PROP(ImplicitBase, NewtonMethod, Dumux::NewtonMethod<TypeTag>);
//! use the plain newton controller for the box scheme by default
SET_TYPE_PROP(BoxModel, NewtonController, Dumux::NewtonController<TypeTag>);
SET_TYPE_PROP(ImplicitBase, NewtonController, Dumux::NewtonController<TypeTag>);
//! Mapper for the grid view's vertices.
SET_TYPE_PROP(BoxModel,
SET_TYPE_PROP(ImplicitBase,
VertexMapper,
Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView),
Dune::MCMGVertexLayout>);
//! Mapper for the grid view's elements.
SET_TYPE_PROP(BoxModel,
SET_TYPE_PROP(ImplicitBase,
ElementMapper,
Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView),
Dune::MCMGElementLayout>);