basicproperties.hh
Go to the documentation of this file.
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 /*
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 2 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 
19  Consult the COPYING file in the top-level source directory of this
20  module for the precise wording of the license and the list of
21  copyright holders.
22 */
28 #ifndef EWOMS_BASIC_PROPERTIES_HH
29 #define EWOMS_BASIC_PROPERTIES_HH
30 
31 #include <dune/common/parametertree.hh>
32 
36 
37 #include <ewoms/aux/compatibility.hh>
38 
39 #if HAVE_DUNE_FEM
40 #include <dune/fem/gridpart/adaptiveleafgridpart.hh>
41 #endif
42 
43 #include <string>
44 
45 namespace Ewoms {
46 namespace Properties {
48 // Type tag definitions:
49 //
50 // NumericModel
51 // |
52 // +-> ImplicitModel
54 
56 NEW_TYPE_TAG(NumericModel, INHERITS_FROM(ParameterSystem));
57 
59 NEW_TYPE_TAG(ImplicitModel, INHERITS_FROM(NumericModel));
60 
62 // Property names which are always available:
63 //
64 // Scalar
66 
68 NEW_PROP_TAG(Scalar);
69 
71 NEW_PROP_TAG(ParameterTree);
72 
74 NEW_PROP_TAG(ModelParameterGroup);
75 
77 NEW_PROP_TAG(GridManager);
78 
79 NEW_PROP_TAG(GridView);
80 
81 #if HAVE_DUNE_FEM
82 NEW_PROP_TAG(GridPart);
83 #endif
84 
87 NEW_PROP_TAG(GridGlobalRefinements);
88 
91 NEW_PROP_TAG(ParameterFile);
92 
99 NEW_PROP_TAG(PrintProperties);
100 
107 NEW_PROP_TAG(PrintParameters);
108 
110 NEW_PROP_TAG(EndTime);
111 
113 NEW_PROP_TAG(InitialTimeStepSize);
114 
116 NEW_PROP_TAG(RestartTime);
117 
119 NEW_PROP_TAG(PredeterminedTimeStepsFile);
120 
122 // Values for the properties
124 
126 SET_TYPE_PROP(NumericModel, Scalar, double);
127 
129 SET_PROP(NumericModel, ParameterTree)
130 {
131  typedef Dune::ParameterTree type;
132 
133  static Dune::ParameterTree& tree()
134  {
135  static Dune::ParameterTree obj_;
136  return obj_;
137  }
138 };
139 
141 SET_STRING_PROP(NumericModel, ModelParameterGroup, "");
142 
144 SET_TYPE_PROP(NumericModel, GridManager, Ewoms::DgfGridManager<TypeTag>);
145 
147 SET_STRING_PROP(NumericModel, GridFile, "");
148 
149 #if HAVE_DUNE_FEM
150 SET_PROP(NumericModel, GridPart)
151 {
152  typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
153  typedef Dune::Fem::AdaptiveLeafGridPart<Grid> type;
154 };
155 
156 SET_TYPE_PROP(NumericModel, GridView, typename GET_PROP_TYPE(TypeTag, GridPart)::GridViewType);
157 #else
158 SET_TYPE_PROP(NumericModel, GridView, typename GET_PROP_TYPE(TypeTag, Grid)::LeafGridView);
163 #endif
164 
166 SET_STRING_PROP(NumericModel, ParameterFile, "");
167 
170 SET_INT_PROP(NumericModel, GridGlobalRefinements, 0);
171 
173 SET_INT_PROP(NumericModel, PrintProperties, 2);
174 
176 SET_INT_PROP(NumericModel, PrintParameters, 2);
177 
179 SET_SCALAR_PROP(NumericModel, EndTime, -1e35);
180 
182 SET_SCALAR_PROP(NumericModel, InitialTimeStepSize, -1e35);
183 
185 SET_SCALAR_PROP(NumericModel, RestartTime, -1e35);
186 
188 SET_STRING_PROP(NumericModel, PredeterminedTimeStepsFile, "");
189 
190 } // namespace Properties
191 } // namespace Ewoms
192 
193 #endif
Definition: baseauxiliarymodule.hh:37
#define NEW_TYPE_TAG(...)
Define a new type tag.
Definition: propertysystem.hh:169
#define GET_PROP_TYPE(TypeTag, PropTagName)
Access the type attribute of a property for a type tag.
Definition: propertysystem.hh:486
#define INHERITS_FROM(...)
Syntactic sugar for NEW_TYPE_TAG.
Definition: propertysystem.hh:230
#define SET_INT_PROP(EffTypeTagName, PropTagName,...)
Set a property to a simple constant integer value.
Definition: propertysystem.hh:345
This file provides the infrastructure to retrieve run-time parameters.
Provides a grid manager which reads Dune Grid Format (DGF) files.
Definition: dgfgridmanager.hh:56
#define SET_PROP(EffTypeTagName, PropTagName)
Set a property for a specific type tag.
Definition: propertysystem.hh:297
Provides the magic behind the eWoms property system.
#define NEW_PROP_TAG(PTagName)
Define a property tag.
Definition: propertysystem.hh:247
#define SET_TYPE_PROP(EffTypeTagName, PropTagName,...)
Set a property which defines a type.
Definition: propertysystem.hh:377
#define SET_STRING_PROP(EffTypeTagName, PropTagName,...)
Set a property to a simple constant string value.
Definition: propertysystem.hh:416
Provides a grid manager which reads Dune Grid Format (DGF) files.
#define SET_SCALAR_PROP(EffTypeTagName, PropTagName,...)
Set a property to a simple constant scalar value.
Definition: propertysystem.hh:394