Commit 03352cd9 authored by Christoph Grueninger's avatar Christoph Grueninger
Browse files

Rename leafView() / levelView() view for Dune 2.3.

Dune 2.3 deprecated the old names and introduced
leafGridView() / levelGridView().
(reviewed by fetzer)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@12445 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 43307396
......@@ -529,7 +529,11 @@ int start_(int argc,
// instantiate and run the concrete problem
TimeManager timeManager;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
Problem problem(timeManager, GridCreator::grid().leafGridView());
#else
Problem problem(timeManager, GridCreator::grid().leafView());
#endif
timeManager.init(problem, restartTime, dt, tEnd, restart);
timeManager.run();
// print dumux end message
......
......@@ -99,7 +99,11 @@ public:
for (int level = grid_.maxLevel(); level >= 0; level--)
{
//get grid view on level grid
#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 3)
LevelGridView levelView = grid_.levelGridView(level);
#else
LevelGridView levelView = grid_.levelView(level);
#endif
for (LevelIterator eIt = levelView.template begin<0>(); eIt != levelView.template end<0>(); ++eIt)
{
//get your map entry
......@@ -153,7 +157,11 @@ public:
for (int level = 0; level <= grid_.maxLevel(); level++)
{
#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 3)
LevelGridView levelView = grid_.levelGridView(level);
#else
LevelGridView levelView = grid_.levelView(level);
#endif
for (LevelIterator eIt = levelView.template begin<0>(); eIt != levelView.template end<0>(); ++eIt)
{
// only treat non-ghosts, ghost data is communicated afterwards
......
#ifndef DUMUX_INTERFACEMESHCREATOR_HH
#define DUMUX_INTERFACEMESHCREATOR_HH
#include<dune/grid/common/gridfactory.hh>
#include <dune/common/version.hh>
#include <dune/grid/common/gridfactory.hh>
#include <dune/grid/io/file/dgfparser/dgfs.hh>
namespace Dumux
......@@ -28,7 +29,11 @@ public:
typedef typename HelperGridView::Traits::template Codim<0>::Entity HelperElement;
typedef typename HelperElement::Geometry HelperGeometry;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
HelperElementIterator helperElementIterator = helperGrid.leafGridView().template begin<0>();
#else
HelperElementIterator helperElementIterator = helperGrid.leafView().template begin<0>();
#endif
const HelperElement& helperElement = *helperElementIterator;
const HelperGeometry& helperGeometry = helperElement.geometry();
......
......@@ -17,8 +17,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
#include <dumux/decoupled/common/onemodelproblem.hh>
/*!
* \file
*
......@@ -28,6 +26,9 @@
#ifndef DUMUX_BENCHMARKRESULT_HH
#define DUMUX_BENCHMARKRESULT_HH
#include <dune/common/version.hh>
#include <dumux/decoupled/common/onemodelproblem.hh>
namespace Dumux
{
......@@ -106,15 +107,20 @@ public:
#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 3)
typedef typename Geometry::JacobianInverseTransposed JacobianInverseTransposed;
typedef typename Dune::ReferenceElements<ct, dim> ReferenceElements;
const GV& gridview(grid.levelGridView(grid.maxLevel()));
const IS& indexset(gridview.indexSet());
EM elementmapper(gridview);
FM facemapper(gridview);
SolutionType& exactSol(grid.levelGridView(grid.maxLevel()));
#else
typedef typename Geometry::Jacobian JacobianInverseTransposed;
typedef typename Dune::GenericReferenceElements<ct, dim> ReferenceElements;
#endif
const GV& gridview(grid.levelView(grid.maxLevel()));
const IS& indexset(gridview.indexSet());
EM elementmapper(gridview);
FM facemapper(gridview);
SolutionType& exactSol(grid.levelView(grid.maxLevel()));
#endif
uMean = 0;
double domainVolume = 0;
......
......@@ -91,7 +91,11 @@ int main(int argc, char** argv)
bool consecutiveNumbering = true;
typedef GET_PROP_TYPE(TTAG(FVVelocity2PTestProblem), Problem) FVProblem;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
FVProblem fvProblem(grid->leafGridView(), delta);
#else
FVProblem fvProblem(grid->leafView(), delta);
#endif
fvProblem.setName("fvdiffusion");
timer.reset();
fvProblem.init();
......@@ -99,27 +103,45 @@ int main(int argc, char** argv)
double fvTime = timer.elapsed();
fvProblem.writeOutput();
Dumux::ResultEvaluation fvResult;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
fvResult.evaluate(grid->leafGridView(), fvProblem, consecutiveNumbering);
typedef GET_PROP_TYPE(TTAG(FVMPFAOVelocity2PTestProblem), Problem) MPFAOProblem;
MPFAOProblem mpfaProblem(grid->leafGridView(), delta);
#else
fvResult.evaluate(grid->leafView(), fvProblem, consecutiveNumbering);
typedef GET_PROP_TYPE(TTAG(FVMPFAOVelocity2PTestProblem), Problem) MPFAOProblem;
MPFAOProblem mpfaProblem(grid->leafView(), delta);
#endif
mpfaProblem.setName("fvmpfaodiffusion");
timer.reset();
mpfaProblem.init();
double mpfaTime = timer.elapsed();
mpfaProblem.writeOutput();
Dumux::ResultEvaluation mpfaResult;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
mpfaResult.evaluate(grid->leafGridView(), mpfaProblem, consecutiveNumbering);
typedef GET_PROP_TYPE(TTAG(MimeticPressure2PTestProblem), Problem) MimeticProblem;
MimeticProblem mimeticProblem(grid->leafGridView(), delta);
#else
mpfaResult.evaluate(grid->leafView(), mpfaProblem, consecutiveNumbering);
typedef GET_PROP_TYPE(TTAG(MimeticPressure2PTestProblem), Problem) MimeticProblem;
MimeticProblem mimeticProblem(grid->leafView(), delta);
#endif
mimeticProblem.setName("mimeticdiffusion");
timer.reset();
mimeticProblem.init();
double mimeticTime = timer.elapsed();
mimeticProblem.writeOutput();
Dumux::ResultEvaluation mimeticResult;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
mimeticResult.evaluate(grid->leafGridView(), mimeticProblem, consecutiveNumbering);
#else
mimeticResult.evaluate(grid->leafView(), mimeticProblem, consecutiveNumbering);
#endif
std::cout.setf(std::ios_base::scientific, std::ios_base::floatfield);
std::cout.precision(2);
......
......@@ -132,7 +132,11 @@ int main(int argc, char** argv)
typedef GET_PROP_TYPE(FVTypeTag, Problem) FVProblem;
typedef GET_PROP(FVTypeTag, ParameterTree) FVParameterTree;
Dune::ParameterTreeParser::readINITree(parameterFileName, FVParameterTree::tree());
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
FVProblem *fvProblem = new FVProblem(grid->leafGridView());
#else
FVProblem *fvProblem = new FVProblem(grid->leafView());
#endif
std::string fvOutput("test_diffusion3d_fv");
fvOutput += outputName;
if (numRefine > 0)
......@@ -148,7 +152,11 @@ int main(int argc, char** argv)
double fvTime = timer.elapsed();
fvProblem->writeOutput();
Dumux::ResultEvaluation fvResult;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
fvResult.evaluate(grid->leafGridView(), *fvProblem, consecutiveNumbering);
#else
fvResult.evaluate(grid->leafView(), *fvProblem, consecutiveNumbering);
#endif
delete fvProblem;
......@@ -157,7 +165,12 @@ int main(int argc, char** argv)
typedef GET_PROP_TYPE(MPFALTypeTag, Problem) MPFALProblem;
typedef GET_PROP(MPFALTypeTag, ParameterTree) MPFALParameterTree;
Dune::ParameterTreeParser::readINITree(parameterFileName, MPFALParameterTree::tree());
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
MPFALProblem *mpfaProblem = new MPFALProblem(grid->leafGridView());
#else
MPFALProblem *mpfaProblem = new MPFALProblem(grid->leafView());
#endif
std::string fvmpfaOutput("test_diffusion3d_fvmpfal");
fvmpfaOutput += outputName;
if (numRefine > 0)
......@@ -172,7 +185,11 @@ int main(int argc, char** argv)
double mpfaTime = timer.elapsed();
mpfaProblem->writeOutput();
Dumux::ResultEvaluation mpfaResult;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
mpfaResult.evaluate(grid->leafGridView(), *mpfaProblem, consecutiveNumbering);
#else
mpfaResult.evaluate(grid->leafView(), *mpfaProblem, consecutiveNumbering);
#endif
delete mpfaProblem;
......@@ -181,7 +198,12 @@ int main(int argc, char** argv)
typedef GET_PROP_TYPE(MimeticTypeTag, Problem) MimeticProblem;
typedef GET_PROP(MimeticTypeTag, ParameterTree) MimeticParameterTree;
Dune::ParameterTreeParser::readINITree(parameterFileName, MimeticParameterTree::tree());
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
MimeticProblem *mimeticProblem = new MimeticProblem(grid->leafGridView());
#else
MimeticProblem *mimeticProblem = new MimeticProblem(grid->leafView());
#endif
std::string mimeticOutput("test_diffusion3d_mimetic");
mimeticOutput += outputName;
if (numRefine > 0)
......@@ -196,7 +218,11 @@ int main(int argc, char** argv)
double mimeticTime = timer.elapsed();
mimeticProblem->writeOutput();
Dumux::ResultEvaluation mimeticResult;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
mimeticResult.evaluate(grid->leafGridView(), *mimeticProblem, consecutiveNumbering);
#else
mimeticResult.evaluate(grid->leafView(), *mimeticProblem, consecutiveNumbering);
#endif
delete mimeticProblem;
......
......@@ -104,7 +104,11 @@ int main(int argc, char** argv)
// instantiate and run the concrete problem
////////////////////////////////////////////////////////////
TimeManager timeManager;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
Problem problem(timeManager, grid.leafGridView(), L, H);
#else
Problem problem(timeManager, grid.leafView(), L, H);
#endif
// initialize the simulation
timeManager.init(problem, startTime, firstDt, tEnd, restart);
......
......@@ -28,9 +28,10 @@
// Check if DUNE-PDELab has been patched for our needs.
#ifdef DUNE_PDELAB_IS_PATCHED_FOR_DUMUX
#include "el2pproblem.hh"
#include <dune/common/precision.hh>
#include <dune/common/version.hh>
#include <dumux/common/start.hh>
#include "el2pproblem.hh"
int main(int argc, char** argv) {
try {
......@@ -68,7 +69,11 @@ int main(int argc, char** argv) {
TimeManager timeManager;
// instantiate problem
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
Problem problem(timeManager, gridPtr->leafGridView(), tInitEnd);
#else
Problem problem(timeManager, gridPtr->leafView(),tInitEnd);
#endif
// set the initial approximated hydrostatic pressure distribution
// based on an averaged brine density
......
......@@ -24,6 +24,7 @@
#ifndef DUMUX_INJECTION_PROBLEM_HH
#define DUMUX_INJECTION_PROBLEM_HH
#include <dune/common/version.hh>
#include <dune/grid/io/file/dgfparser/dgfs.hh>
#include <dumux/implicit/2p2c/2p2cmodel.hh>
......@@ -157,7 +158,11 @@ public:
*/
InjectionProblem(TimeManager &timeManager,
const GridView &gridView)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager, GridCreator::grid().leafGridView())
#else
: ParentType(timeManager, GridCreator::grid().leafView())
#endif
{
try
{
......
......@@ -24,6 +24,7 @@
#ifndef DUMUX_HETEROGENEOUS_PROBLEM_HH
#define DUMUX_HETEROGENEOUS_PROBLEM_HH
#include <dune/common/version.hh>
#if HAVE_ALUGRID
#include <dune/grid/alugrid/2d/alugrid.hh>
......@@ -193,7 +194,11 @@ public:
*/
HeterogeneousProblem(TimeManager &timeManager,
const GridView &gridView)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager, GridCreator::grid().leafGridView()),
#else
: ParentType(timeManager, GridCreator::grid().leafView()),
#endif
//Boundary Id Setup:
injectionTop_(1),
injectionBottom_(2),
......
......@@ -26,6 +26,8 @@
#ifndef DUMUX_HETEROGENEOUS_SPATIAL_PARAMS_HH
#define DUMUX_HETEROGENEOUS_SPATIAL_PARAMS_HH
#include <dune/common/version.hh>
#include <dumux/material/spatialparams/implicitspatialparams.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
......@@ -143,6 +145,19 @@ public:
void setParams(GridPointer *gridPtr)
{
gridPtr_ = gridPtr;
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
int numElements = (*gridPtr_)->leafGridView().size(0);
paramIdx_.resize(numElements);
ElementIterator eIt = (*gridPtr_)->leafGridView().template begin<0>();
const ElementIterator eEndIt = (*gridPtr_)->leafGridView().template end<0>();
for (; eIt != eEndIt; ++eIt)
{
int eIdx = (*gridPtr_)->leafGridView().indexSet().index(*eIt);
int param = (*gridPtr_).parameters(*eIt)[0];
paramIdx_[eIdx] = param;
}
#else
int numElements = (*gridPtr_)->leafView().size(0);
paramIdx_.resize(numElements);
......@@ -154,6 +169,7 @@ public:
int param = (*gridPtr_).parameters(*eIt)[0];
paramIdx_[eIdx] = param;
}
#endif
}
......@@ -169,7 +185,13 @@ public:
const FVElementGeometry &fvGeometry,
int scvIdx) const
{
int eIdx = (*gridPtr_)->leafView().indexSet().index(element); //Get the global index of the element
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
//Get the global index of the element
int eIdx = (*gridPtr_)->leafGridView().indexSet().index(element);
#else
//Get the global index of the element
int eIdx = (*gridPtr_)->leafView().indexSet().index(element);
#endif
if (paramIdx_[eIdx] == barrierTop_)
return barrierTopK_;
......@@ -191,7 +213,13 @@ public:
const FVElementGeometry &fvGeometry,
int scvIdx) const
{
int eIdx = (*gridPtr_)->leafView().indexSet().index(element); //Get the global index of the element
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
//Get the global index of the element
int eIdx = (*gridPtr_)->leafGridView().indexSet().index(element);
#else
//Get the global index of the element
int eIdx = (*gridPtr_)->leafView().indexSet().index(element);
#endif
if (paramIdx_[eIdx] == barrierTop_)
return barrierTopPorosity_;
......
......@@ -24,6 +24,8 @@
#ifndef DUMUX_HETEROGENEOUS_NI_PROBLEM_NI_HH
#define DUMUX_HETEROGENEOUS_NI_PROBLEM_NI_HH
#include <dune/common/version.hh>
#if HAVE_ALUGRID
#include <dune/grid/alugrid/2d/alugrid.hh>
#else
......@@ -183,7 +185,11 @@ public:
*/
HeterogeneousNIProblem(TimeManager &timeManager,
const GridView &gridView)
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
: ParentType(timeManager, GridCreator::grid().leafGridView()),
#else
: ParentType(timeManager, GridCreator::grid().leafView()),
#endif
//Boundary Id Setup:
injectionTop_ (1),
injectionBottom_(2),
......
......@@ -18,12 +18,11 @@
*****************************************************************************/
#include "config.h"
#include "evaporationatmosphereproblem.hh"
#include <dune/common/version.hh>
#include <dumux/common/start.hh>
#include <dumux/io/interfacemeshcreator.hh>
#include "evaporationatmosphereproblem.hh"
/*!
* \brief Print a usage string for simulations.
......@@ -283,8 +282,12 @@ int start_(int argc,
TimeManager timeManager;
// instantiate coupled problem
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)
Problem problem(timeManager, gridPtr->leafGridView());
#else
Problem problem(timeManager,
gridPtr->leafView());
#endif
Dumux::Parameters::print<TypeTag>();
......
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