Skip to content
Snippets Groups Projects
Commit 94d7042e authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

Merge branch 'Feature/gridAdaptModels' into 'master'

[adaptivity sequential] make grid adapt model a property and clean-up properties

Grid adapt model can be chosen as a property now (e.g. for multidim-models). All adaptivity related properties were moved to gridadaptproperties.hh.

See merge request !299
parents 50b9a631 42dd5278
No related branches found
No related tags found
4 merge requests!600[WIP][components][plotproperties] Add a source file to plot properties of some components,!501Freeflow/turbulenceproperties,!492Resolve "Inconsistent `index()` method of the different `SubControlVolume` classes",!299[adaptivity sequential] make grid adapt model a property and clean-up properties
...@@ -31,6 +31,14 @@ ...@@ -31,6 +31,14 @@
namespace Dumux namespace Dumux
{ {
// forward declarations
template<class TypeTag>
class GridAdaptInitializationIndicatorDefault;
template<class TypeTag, bool>
class GridAdapt;
namespace Properties namespace Properties
{ {
//! Grid adaption type tag for all sequential models. //! Grid adaption type tag for all sequential models.
...@@ -39,6 +47,9 @@ NEW_TYPE_TAG(GridAdaptTypeTag); ...@@ -39,6 +47,9 @@ NEW_TYPE_TAG(GridAdaptTypeTag);
//! Defines if the grid is h-adaptive //! Defines if the grid is h-adaptive
NEW_PROP_TAG( AdaptiveGrid); NEW_PROP_TAG( AdaptiveGrid);
//! The type of grid adaptation
NEW_PROP_TAG( GridAdaptModel );
//! Class defining the refinement/coarsening indicator //! Class defining the refinement/coarsening indicator
NEW_PROP_TAG(AdaptionIndicator); NEW_PROP_TAG(AdaptionIndicator);
...@@ -81,6 +92,12 @@ NEW_PROP_TAG(GridAdaptRefineAtSource); ...@@ -81,6 +92,12 @@ NEW_PROP_TAG(GridAdaptRefineAtSource);
//no adaptive grid //no adaptive grid
SET_BOOL_PROP(GridAdaptTypeTag, AdaptiveGrid, false); SET_BOOL_PROP(GridAdaptTypeTag, AdaptiveGrid, false);
//Set default class for adaptation initialization indicator
SET_TYPE_PROP(GridAdaptTypeTag, AdaptionInitializationIndicator, GridAdaptInitializationIndicatorDefault<TypeTag>);
//Set default class for adaptation
SET_TYPE_PROP(GridAdaptTypeTag, GridAdaptModel, GridAdapt<TypeTag, false>);
//standard setting //standard setting
SET_INT_PROP(GridAdaptTypeTag, GridAdaptMinLevel, 0); SET_INT_PROP(GridAdaptTypeTag, GridAdaptMinLevel, 0);
SET_INT_PROP(GridAdaptTypeTag, GridAdaptMaxLevel, 1); SET_INT_PROP(GridAdaptTypeTag, GridAdaptMaxLevel, 1);
......
...@@ -81,7 +81,7 @@ private: ...@@ -81,7 +81,7 @@ private:
typedef typename GridView::Traits::template Codim<0>::Entity Element; typedef typename GridView::Traits::template Codim<0>::Entity Element;
typedef typename GridView::Intersection Intersection; typedef typename GridView::Intersection Intersection;
// The module to adapt grid. If adaptiveGrid is false, this model does nothing. // The module to adapt grid. If adaptiveGrid is false, this model does nothing.
typedef GridAdapt<TypeTag, adaptiveGrid> GridAdaptModel; typedef typename GET_PROP_TYPE(TypeTag, GridAdaptModel) GridAdaptModel;
typedef typename SolutionTypes::PrimaryVariables PrimaryVariables; typedef typename SolutionTypes::PrimaryVariables PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes; typedef typename GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes;
...@@ -590,10 +590,6 @@ public: ...@@ -590,10 +590,6 @@ public:
*/ */
GridAdaptModel& gridAdapt() GridAdaptModel& gridAdapt()
{ {
if (!adaptiveGrid)
Dune::dgrave << "adaptivity module was called despite "
<< "adaptivity is disabled in property system \n;" << adaptiveGrid;
return *gridAdapt_; return *gridAdapt_;
} }
...@@ -606,9 +602,6 @@ public: ...@@ -606,9 +602,6 @@ public:
*/ */
void preAdapt() void preAdapt()
{ {
if (!adaptiveGrid)
Dune::dgrave << "adaptivity functionality was called despite "
<< "adaptivity is disabled in property system \n;" << adaptiveGrid;
} }
/*! /*!
...@@ -620,9 +613,6 @@ public: ...@@ -620,9 +613,6 @@ public:
*/ */
void postAdapt() void postAdapt()
{ {
if (!adaptiveGrid)
Dune::dgrave << "adaptivity functionality was called despite "
<< "adaptivity is disabled in property system \n;" << adaptiveGrid;
// write out new grid // write out new grid
// Dune::VTKWriter<LeafGridView> vtkwriter(problem_.gridView()); // Dune::VTKWriter<LeafGridView> vtkwriter(problem_.gridView());
// vtkwriter.write("latestgrid",Dune::VTK::appendedraw); // vtkwriter.write("latestgrid",Dune::VTK::appendedraw);
......
...@@ -78,9 +78,6 @@ NEW_PROP_TAG( MaxIntersections ); //!< Gives maximum number of intersections of ...@@ -78,9 +78,6 @@ NEW_PROP_TAG( MaxIntersections ); //!< Gives maximum number of intersections of
namespace Dumux namespace Dumux
{ {
template<class TypeTag>
class GridAdaptInitializationIndicatorDefault;
template<class TypeTag> template<class TypeTag>
class VariableClass; class VariableClass;
...@@ -181,13 +178,7 @@ SET_PROP(SequentialModel, BoundaryTypes) ...@@ -181,13 +178,7 @@ SET_PROP(SequentialModel, BoundaryTypes)
public: public:
typedef BoundaryTypes<numEq> type; typedef BoundaryTypes<numEq> type;
}; };
//Set default class for adaptation initialization indicator
SET_TYPE_PROP(GridAdaptTypeTag, AdaptionInitializationIndicator, GridAdaptInitializationIndicatorDefault<TypeTag>);
} }
} }
#include "gridadaptinitializationindicatordefault.hh"
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment