Commit 90d117b9 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[properties] Add new folder, containing basic, grid and numericmodel properties

* Decrease dependencies
* move propertysystem.hh to new folder
* adapt some files
parent f6028f80
......@@ -37,7 +37,7 @@
#include <dune/common/parametertreeparser.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <dumux/common/propertysystem.hh>
#include <dumux/common/properties/propertysystem.hh>
#include <dumux/common/exceptions.hh>
#include <dumux/common/defaultusagemessage.hh>
#include <dumux/common/loggingparametertree.hh>
......
......@@ -28,7 +28,7 @@
#define DUMUX_PROPERTIES_HH
#ifndef DUMUX_PROPERTY_SYSTEM_HH
#include <dumux/common/propertysystem.hh>
#include <dumux/common/properties/propertysystem.hh>
#endif
namespace Dumux
......@@ -66,6 +66,7 @@ NEW_PROP_TAG(LocalResidual);
//! TODO: Remove this property as soon as the decoupled models are integrated
NEW_PROP_TAG(LinearSolver);
NEW_PROP_TAG(LinearSolverPreconditionerBlockLevel); //! Block level depth for the preconditioner
////////////////////////////////////////////////
// Basic properties regarding balance equations
......
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \ingroup Properties
* \file
*
* \brief Defines a type tags and some fundamental properties for
* all models
*/
#ifndef DUMUX_BASIC_PROPERTIES_HH
#define DUMUX_BASIC_PROPERTIES_HH
#include <dumux/common/balanceequationopts.hh>
#include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh>
#include <dumux/io/defaultvtkoutputfields.hh>
namespace Dumux
{
namespace Properties
{
//! Type tag for numeric models.
NEW_TYPE_TAG(BasicProperties);
//! Set the default type of scalar values to double
SET_TYPE_PROP(BasicProperties, Scalar, double);
//! Set the default number of equations to one
SET_INT_PROP(BasicProperties, NumEq, 1);
//! use the global group as default for the model's parameter group
SET_STRING_PROP(BasicProperties, ModelParameterGroup, "");
//! do not specific any model-specific default parameters here
SET_PROP(BasicProperties, ModelDefaultParameters)
{
static void defaultParams(Dune::ParameterTree& tree, const std::string& group = "") { }
};
//! Set the default to a function throwing a NotImplemented error
SET_TYPE_PROP(BasicProperties, VtkOutputFields, DefaultVtkOutputFields);
//! Set the default class for the balance equation options
SET_TYPE_PROP(BasicProperties, BalanceEqOpts, BalanceEquationOptions<TypeTag>);
} // namespace Properties
} // namespace Dumux
#endif
......@@ -20,28 +20,19 @@
* \ingroup Properties
* \file
*
* \brief Defines a type tags and some fundamental properties for
* fully coupled and decoupled models
* \brief Defines a type tags and some fundamental grid-related properties
*/
#ifndef DUMUX_BASIC_PROPERTIES_HH
#define DUMUX_BASIC_PROPERTIES_HH
#ifndef DUMUX_GRID_PROPERTIES_HH
#define DUMUX_GRID_PROPERTIES_HH
#include <dumux/common/properties.hh>
#include <dune/common/parametertree.hh>
#include <dune/common/fvector.hh>
#include <dune/grid/common/mcmgmapper.hh>
#include <dune/istl/bvector.hh>
#include <dune/istl/bcrsmatrix.hh>
#include <dumux/common/balanceequationopts.hh>
#include <dumux/common/propertysystem.hh>
#include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/pointsource.hh>
#include <dumux/common/boundarytypes.hh>
#include <dumux/io/defaultvtkoutputfields.hh>
#include <dumux/io/gridcreator.hh>
#include <dune/common/version.hh>
......@@ -51,48 +42,27 @@ namespace Dumux
namespace Properties
{
//! Type tag for numeric models.
NEW_TYPE_TAG(NumericModel);
//! Set the default type of scalar values to double
SET_TYPE_PROP(NumericModel, Scalar, double);
NEW_TYPE_TAG(GridProperties);
//! Use the leaf grid view if not defined otherwise
SET_TYPE_PROP(NumericModel, GridView, typename GET_PROP_TYPE(TypeTag, Grid)::LeafGridView);
//! Set the default vector with size number of equations to a field vector
SET_TYPE_PROP(NumericModel, NumEqVector, Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Scalar), GET_PROP_VALUE(TypeTag, NumEq)>);
//! Set the default primary variable vector to a vector of size of number of equations
SET_TYPE_PROP(NumericModel, PrimaryVariables, typename GET_PROP_TYPE(TypeTag, NumEqVector));
//! use the global group as default for the model's parameter group
SET_STRING_PROP(NumericModel, ModelParameterGroup, "");
//! do not specific any model-specific default parameters here
SET_PROP(NumericModel, ModelDefaultParameters)
{
static void defaultParams(Dune::ParameterTree& tree, const std::string& group = "") { }
};
SET_TYPE_PROP(GridProperties, GridView, typename GET_PROP_TYPE(TypeTag, Grid)::LeafGridView);
//! Use the DgfGridCreator by default
SET_TYPE_PROP(NumericModel, GridCreator, GridCreator<TypeTag>);
SET_TYPE_PROP(GridProperties, GridCreator, GridCreator<TypeTag>);
//! Use the minimal point source implementation as default
SET_TYPE_PROP(NumericModel, PointSource, PointSource<TypeTag>);
SET_TYPE_PROP(GridProperties, PointSource, PointSource<TypeTag>);
//! Use the point source helper using the bounding box tree as a default
SET_TYPE_PROP(NumericModel, PointSourceHelper, BoundingBoxTreePointSourceHelper<TypeTag>);
//! Set the default to a function throwing a NotImplemented error
SET_TYPE_PROP(NumericModel, VtkOutputFields, DefaultVtkOutputFields);
SET_TYPE_PROP(GridProperties, PointSourceHelper, BoundingBoxTreePointSourceHelper<TypeTag>);
//! Mapper for the grid view's vertices.
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
SET_TYPE_PROP(NumericModel,
SET_TYPE_PROP(GridProperties,
VertexMapper,
Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView)>);
#else
SET_TYPE_PROP(NumericModel,
SET_TYPE_PROP(GridProperties,
VertexMapper,
Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView),
Dune::MCMGVertexLayout>);
......@@ -100,35 +70,17 @@ SET_TYPE_PROP(NumericModel,
//! Mapper for the grid view's elements.
#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6)
SET_TYPE_PROP(NumericModel,
SET_TYPE_PROP(GridProperties,
ElementMapper,
Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView)>);
#else
SET_TYPE_PROP(NumericModel,
SET_TYPE_PROP(GridProperties,
ElementMapper,
Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView),
Dune::MCMGElementLayout>);
#endif
//! The type of a solution for the whole grid at a fixed time
SET_TYPE_PROP(NumericModel, SolutionVector, Dune::BlockVector<typename GET_PROP_TYPE(TypeTag, PrimaryVariables)>);
//! Set the type of a global jacobian matrix from the solution types
SET_PROP(NumericModel, JacobianMatrix)
{
private:
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
using MatrixBlock = typename Dune::FieldMatrix<Scalar, numEq, numEq>;
public:
using type = typename Dune::BCRSMatrix<MatrixBlock>;
};
//! Boundary types at a single degree of freedom
SET_TYPE_PROP(NumericModel, BoundaryTypes, BoundaryTypes<GET_PROP_VALUE(TypeTag, NumEq)>);
//! Set the default class for the balance equation options
SET_TYPE_PROP(NumericModel, BalanceEqOpts, BalanceEquationOptions<TypeTag>);
} // namespace Properties
} // namespace Dumux
......
......@@ -30,7 +30,7 @@
#include <dune/common/timer.hh>
#include <dune/common/parallel/mpihelper.hh>
#include "propertysystem.hh"
#include "properties.hh"
#include "parameters.hh"
namespace Dumux
......
......@@ -28,7 +28,6 @@
#include <dune/istl/bvector.hh>
#include <dumux/common/propertysystem.hh>
#include <dumux/common/properties.hh>
#include <dumux/implicit/gridvariables.hh>
......
......@@ -39,7 +39,7 @@
#include <dumux/material/components/tabulatedcomponent.hh>
#ifdef DUMUX_PROPERTIES_HH
#include <dumux/common/basicproperties.hh>
#include <dumux/common/properties.hh>
#include <dumux/material/fluidsystems/defaultcomponents.hh>
#endif
......
......@@ -27,7 +27,8 @@
#warning "DefaultComponents is deprecated. Specify fluid system via template parameters and not using the property system!"
#include <dumux/common/basicproperties.hh>
#include <dumux/common/properties/numericmodel.hh>
#include <dumux/common/properties.hh>
#include <dumux/material/components/h2o.hh>
#include <dumux/material/components/n2.hh>
......
......@@ -25,8 +25,7 @@
#ifndef DUMUX_NEWTON_CONTROLLER_HH
#define DUMUX_NEWTON_CONTROLLER_HH
#include <dumux/common/basicproperties.hh>
#include <dumux/common/propertysystem.hh>
#include <dumux/common/properties.hh>
#include <dumux/common/exceptions.hh>
#include <dumux/common/math.hh>
#include <dumux/common/timeloop.hh>
......
......@@ -27,7 +27,7 @@
#define DUMUX_NEWTONMETHOD_HH
#include <dumux/common/exceptions.hh>
#include <dumux/common/propertysystem.hh>
#include <dumux/common/properties.hh>
#include <dune/common/timer.hh>
#include <dune/istl/istlexception.hh>
......
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