Commit 42dd5278 authored by Beatrix Becker's avatar Beatrix Becker
Browse files

[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.
parent 50b9a631
......@@ -31,6 +31,14 @@
namespace Dumux
{
// forward declarations
template<class TypeTag>
class GridAdaptInitializationIndicatorDefault;
template<class TypeTag, bool>
class GridAdapt;
namespace Properties
{
//! Grid adaption type tag for all sequential models.
......@@ -39,6 +47,9 @@ NEW_TYPE_TAG(GridAdaptTypeTag);
//! Defines if the grid is h-adaptive
NEW_PROP_TAG( AdaptiveGrid);
//! The type of grid adaptation
NEW_PROP_TAG( GridAdaptModel );
//! Class defining the refinement/coarsening indicator
NEW_PROP_TAG(AdaptionIndicator);
......@@ -81,6 +92,12 @@ NEW_PROP_TAG(GridAdaptRefineAtSource);
//no adaptive grid
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
SET_INT_PROP(GridAdaptTypeTag, GridAdaptMinLevel, 0);
SET_INT_PROP(GridAdaptTypeTag, GridAdaptMaxLevel, 1);
......
......@@ -81,7 +81,7 @@ private:
typedef typename GridView::Traits::template Codim<0>::Entity Element;
typedef typename GridView::Intersection Intersection;
// 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 GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes;
......@@ -590,10 +590,6 @@ public:
*/
GridAdaptModel& gridAdapt()
{
if (!adaptiveGrid)
Dune::dgrave << "adaptivity module was called despite "
<< "adaptivity is disabled in property system \n;" << adaptiveGrid;
return *gridAdapt_;
}
......@@ -606,9 +602,6 @@ public:
*/
void preAdapt()
{
if (!adaptiveGrid)
Dune::dgrave << "adaptivity functionality was called despite "
<< "adaptivity is disabled in property system \n;" << adaptiveGrid;
}
/*!
......@@ -620,9 +613,6 @@ public:
*/
void postAdapt()
{
if (!adaptiveGrid)
Dune::dgrave << "adaptivity functionality was called despite "
<< "adaptivity is disabled in property system \n;" << adaptiveGrid;
// write out new grid
// Dune::VTKWriter<LeafGridView> vtkwriter(problem_.gridView());
// vtkwriter.write("latestgrid",Dune::VTK::appendedraw);
......
......@@ -78,9 +78,6 @@ NEW_PROP_TAG( MaxIntersections ); //!< Gives maximum number of intersections of
namespace Dumux
{
template<class TypeTag>
class GridAdaptInitializationIndicatorDefault;
template<class TypeTag>
class VariableClass;
......@@ -181,13 +178,7 @@ SET_PROP(SequentialModel, BoundaryTypes)
public:
typedef BoundaryTypes<numEq> type;
};
//Set default class for adaptation initialization indicator
SET_TYPE_PROP(GridAdaptTypeTag, AdaptionInitializationIndicator, GridAdaptInitializationIndicatorDefault<TypeTag>);
}
}
#include "gridadaptinitializationindicatordefault.hh"
#endif
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