Commit 9ceb8b2f authored by Alexander Kissinger's avatar Alexander Kissinger
Browse files

- Changed the call for entity maps from mapper.map() to mapper.index() or...

- Changed the call for entity maps from mapper.map() to mapper.index() or mapper.subIndex() if dune >= 2.4 is used
- included <dune/common/version.hh> in the files

Reviewed by Christoph

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@13927 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 90009a8e
......@@ -27,6 +27,8 @@
#ifndef DUMUX_ONEP_TWOC_MODEL_HH
#define DUMUX_ONEP_TWOC_MODEL_HH
#include <dune/common/version.hh>
#include <dumux/implicit/common/implicitvelocityoutput.hh>
#include "1p2cproperties.hh"
......@@ -137,7 +139,11 @@ public:
{
if(eIt->partitionType() == Dune::InteriorEntity)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int eIdx = this->problem_().model().elementMapper().index(*eIt);
#else
int eIdx = this->problem_().model().elementMapper().map(*eIt);
#endif
rank[eIdx] = this->gridView_().comm().rank();
FVElementGeometry fvGeometry;
......@@ -151,8 +157,11 @@ public:
for (int scvIdx = 0; scvIdx < fvGeometry.numScv; ++scvIdx)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int dofIdxGlobal = this->dofMapper().subIndex(*eIt, scvIdx, dofCodim);
#else
int dofIdxGlobal = this->dofMapper().map(*eIt, scvIdx, dofCodim);
#endif
pressure[dofIdxGlobal] = elemVolVars[scvIdx].pressure();
delp[dofIdxGlobal] = elemVolVars[scvIdx].pressure() - 1e5;
moleFraction0[dofIdxGlobal] = elemVolVars[scvIdx].moleFraction(0);
......
......@@ -23,6 +23,8 @@
#ifndef DUMUX_INTERSECTIONTOVERTEXBC_HH
#define DUMUX_INTERSECTIONTOVERTEXBC_HH
#include <dune/common/version.hh>
#include <dumux/implicit/box/boxproperties.hh>
namespace Dumux
......@@ -83,8 +85,11 @@ public:
for (int faceVertexIdx = 0; faceVertexIdx < numFaceVerts; ++faceVertexIdx)
{
int vIdx = refElement.subEntity(fIdx, 1, faceVertexIdx, dim);
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int vIdxGlobal = problem.vertexMapper().subIndex(*eIt, vIdx, dim);
#else
int vIdxGlobal = problem.vertexMapper().map(*eIt, vIdx, dim);
#endif
for (int eqIdx = 0; eqIdx < numEq; eqIdx++)
if (bcTypes.isDirichlet(eqIdx))
vertexBC[vIdxGlobal].setDirichlet(eqIdx);
......@@ -96,9 +101,12 @@ public:
void boundaryTypes(BoundaryTypes& values, const Vertex& vertex) const
{
values.setAllNeumann();
int vIdx = problem_.vertexMapper().map(vertex);
const BoundaryTypes& bcTypes = vertexBC[vIdx];
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int vIdxGlobal = problem_.vertexMapper().index(vertex);
#else
int vIdxGlobal = problem_.vertexMapper().map(vertex);
#endif
const BoundaryTypes& bcTypes = vertexBC[vIdxGlobal];
for (int eqIdx = 0; eqIdx < numEq; eqIdx++)
if (bcTypes.isDirichlet(eqIdx))
......
......@@ -25,6 +25,8 @@
#ifndef DUMUX_AMGPARALLELHELPERS_HH
#define DUMUX_AMGPARALLELHELPERS_HH
#include <dune/common/version.hh>
#include <dumux/implicit/box/boxproperties.hh>
#include <dumux/implicit/cellcentered/ccproperties.hh>
#include <dumux/decoupled/common/pressureproperties.hh>
......@@ -57,7 +59,11 @@ class ParallelISTLHelper
template<class EntityType>
int map(const EntityType& e) const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
return problem_.model().dofMapper().index(e);
#else
return problem_.model().dofMapper().map(e);
#endif
}
private:
......@@ -520,7 +526,11 @@ public:
{
if (entityIt->partitionType() == Dune::BorderEntity)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int localIdx = problem_.model().dofMapper().index(*entityIt);
#else
int localIdx = problem_.model().dofMapper().map(*entityIt);
#endif
IdType dofIdxGlobal = gridView.grid().globalIdSet().id(*entityIt);
std::pair<IdType,int> g2iPair(dofIdxGlobal, localIdx);
......@@ -581,7 +591,11 @@ public:
template<class EntityType>
size_t size (EntityType& e) const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int i = problem_.model().dofMapper().index(e);
#else
int i = problem_.model().dofMapper().map(e);
#endif
int n = 0;
for (ColIterator j = A_[i].begin(); j != A_[i].end(); ++j)
{
......@@ -598,7 +612,11 @@ public:
template<class MessageBuffer, class EntityType>
void gather (MessageBuffer& buff, const EntityType& e) const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int i = problem_.model().dofMapper().index(e);
#else
int i = problem_.model().dofMapper().map(e);
#endif
for (ColIterator j = A_[i].begin(); j != A_[i].end(); ++j)
{
typename std::map<int,IdType>::const_iterator it=index2GID_.find(j.index());
......@@ -613,7 +631,11 @@ public:
template<class MessageBuffer, class EntityType>
void scatter (MessageBuffer& buff, const EntityType& e, size_t n)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int i = problem_.model().dofMapper().index(e);
#else
int i = problem_.model().dofMapper().map(e);
#endif
for (size_t k = 0; k < n; k++)
{
IdType id;
......@@ -697,7 +719,11 @@ public:
template<class EntityType>
size_t size (EntityType& e) const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int i = problem_.model().dofMapper().index(e);
#else
int i = problem_.model().dofMapper().map(e);
#endif
int n = 0;
for (ColIterator j = A_[i].begin(); j != A_[i].end(); ++j)
{
......@@ -714,7 +740,11 @@ public:
template<class MessageBuffer, class EntityType>
void gather (MessageBuffer& buff, const EntityType& e) const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int i = problem_.model().dofMapper().index(e);
#else
int i = problem_.model().dofMapper().map(e);
#endif
for (ColIterator j = A_[i].begin(); j != A_[i].end(); ++j)
{
typename std::map<int,IdType>::const_iterator it=index2GID_.find(j.index());
......@@ -729,7 +759,11 @@ public:
template<class MessageBuffer, class EntityType>
void scatter (MessageBuffer& buff, const EntityType& e, size_t n)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int i = problem_.model().dofMapper().index(e);
#else
int i = problem_.model().dofMapper().map(e);
#endif
for (size_t k = 0; k < n; k++)
{
MatEntry m;
......
......@@ -25,8 +25,10 @@
#ifndef DUMUX_VERTEX_HANDLES_HH
#define DUMUX_VERTEX_HANDLES_HH
#include <dune/common/version.hh>
#include <dune/grid/common/datahandleif.hh>
namespace Dumux
{
/*!
......@@ -68,14 +70,22 @@ public:
template<class MessageBufferImp, class EntityType>
void gather(MessageBufferImp &buff, const EntityType &e) const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int vIdx = mapper_.index(e);
#else
int vIdx = mapper_.map(e);
#endif
buff.write(container_[vIdx]);
}
template<class MessageBufferImp, class EntityType>
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int vIdx = mapper_.index(e);
#else
int vIdx = mapper_.map(e);
#endif
FieldType tmp;
buff.read(tmp);
......@@ -126,14 +136,22 @@ public:
template<class MessageBufferImp, class EntityType>
void gather(MessageBufferImp &buff, const EntityType &e) const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int vIdx = mapper_.index(e);
#else
int vIdx = mapper_.map(e);
#endif
buff.write(container_[vIdx]);
}
template<class MessageBufferImp, class EntityType>
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int vIdx = mapper_.index(e);
#else
int vIdx = mapper_.map(e);
#endif
FieldType tmp;
buff.read(tmp);
......@@ -185,14 +203,22 @@ public:
template<class MessageBufferImp, class EntityType>
void gather(MessageBufferImp &buff, const EntityType &e) const
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int vIdx = mapper_.index(e);
#else
int vIdx = mapper_.map(e);
#endif
buff.write(container_[vIdx]);
}
template<class MessageBufferImp, class EntityType>
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
{
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int vIdx = mapper_.index(e);
#else
int vIdx = mapper_.map(e);
#endif
FieldType tmp;
buff.read(tmp);
......
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