Commit aabd1965 authored by Martin Schneider's avatar Martin Schneider
Browse files

[adaptive]

The box method is not yet mass conservative. Therefore, an error is thrown by calling grid adaptation for the box method. 


Reviewed by Bernd

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@15489 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 8817201f
......@@ -66,6 +66,8 @@ class ImplicitGridAdapt
typedef typename GET_PROP_TYPE(TypeTag, AdaptationIndicator) AdaptationIndicator;
typedef typename GET_PROP_TYPE(TypeTag, AdaptationInitializationIndicator) AdaptationInitializationIndicator;
enum { isBox = GET_PROP_VALUE(TypeTag, ImplicitIsBox) };
public:
/*!
* Constructor for h-adaptive simulations (adaptive grids)
......@@ -78,13 +80,22 @@ public:
marked_(0),
coarsened_(0)
{
levelMin_ = GET_PARAM_FROM_GROUP(TypeTag, int, GridAdapt, MinLevel);
levelMax_ = GET_PARAM_FROM_GROUP(TypeTag, int, GridAdapt, MaxLevel);
adaptationInterval_ = GET_PARAM_FROM_GROUP(TypeTag, int, GridAdapt, AdaptationInterval);
if (levelMin_ < 0)
if(isBox)
{
DUNE_THROW(Dune::NotImplemented,
"Grid adaptation is not yet mass conservative for Box method! "
<< "Use cell-centered scheme instead!");
}
else
{
DUNE_THROW(Dune::InvalidStateException, "Coarsening the level 0 entities is not possible! Choose MinLevel >= 0");
levelMin_ = GET_PARAM_FROM_GROUP(TypeTag, int, GridAdapt, MinLevel);
levelMax_ = GET_PARAM_FROM_GROUP(TypeTag, int, GridAdapt, MaxLevel);
adaptationInterval_ = GET_PARAM_FROM_GROUP(TypeTag, int, GridAdapt, AdaptationInterval);
if (levelMin_ < 0)
{
DUNE_THROW(Dune::InvalidStateException, "Coarsening the level 0 entities is not possible! Choose MinLevel >= 0");
}
}
}
......
......@@ -8,13 +8,6 @@ add_dumux_test(test_box2p test_box2p test_box2p.cc
${CMAKE_CURRENT_BINARY_DIR}/lensbox-00009.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_box2p")
add_dumux_test(test_boxadaptive2p test_boxadaptive2p test_boxadaptive2p.cc
python ${CMAKE_SOURCE_DIR}/bin/runtest.py
--script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/lensboxadaptive-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/lensboxadaptive-00015.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_boxadaptive2p")
add_dumux_test(test_cc2p test_cc2p test_cc2p.cc
python ${CMAKE_SOURCE_DIR}/bin/runtest.py
--script fuzzy
......
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