Commit ff914487 authored by Christoph Grueninger's avatar Christoph Grueninger
Browse files

Use right type Index for Mappers.

This is better as in regard to Dune 2.4. Sadly it
does not fix the problem with incompatible types
with YaspGrid.
(reviewed by bernd)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@13462 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 68a3c82c
......@@ -51,7 +51,7 @@ class IntersectionMapper
typedef typename GridView::IntersectionIterator IntersectionIterator;
typedef typename GridView::Intersection Intersection;
typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView,ElementLayout> ElementMapper;
typedef typename ElementMapper::Index ElementMapperIndex;
public:
......@@ -79,48 +79,48 @@ public:
return elementMapper_;
}
int map(const Element& element) const
ElementMapperIndex map(const Element& element) const
{
return elementMapper_.map(element);
}
int map(int elemIdx, int faceIdx)
ElementMapperIndex map(int elemIdx, int faceIdx)
{
return intersectionMapGlobal_[elemIdx][faceIdx];
}
int map(int elemIdx, int faceIdx) const
ElementMapperIndex map(int elemIdx, int faceIdx) const
{
return (intersectionMapGlobal_[elemIdx].find(faceIdx))->second;//use find() for const function!
}
int map(const Element& element, int faceIdx)
ElementMapperIndex map(const Element& element, int faceIdx)
{
return intersectionMapGlobal_[map(element)][faceIdx];
}
int map(const Element& element, int faceIdx) const
ElementMapperIndex map(const Element& element, int faceIdx) const
{
return intersectionMapGlobal_[map(element)].find(faceIdx)->second;//use find() for const function!
}
int maplocal(int elemIdx, int faceIdx)
ElementMapperIndex maplocal(int elemIdx, int faceIdx)
{
return intersectionMapLocal_[elemIdx][faceIdx];
}
int maplocal(int elemIdx, int faceIdx) const
ElementMapperIndex maplocal(int elemIdx, int faceIdx) const
{
return (intersectionMapLocal_[elemIdx].find(faceIdx))->second;//use find() for const function!
}
int maplocal(const Element& element, int faceIdx)
ElementMapperIndex maplocal(const Element& element, int faceIdx)
{
return intersectionMapLocal_[map(element)][faceIdx];
}
int maplocal(const Element& element, int faceIdx) const
ElementMapperIndex maplocal(const Element& element, int faceIdx) const
{
return (intersectionMapLocal_[map(element)].find(faceIdx))->second;//use find() for const function!
}
......
......@@ -38,6 +38,8 @@ class VertexHandleSum
: public Dune::CommDataHandleIF< VertexHandleSum<FieldType, Container, VertexMapper>,
FieldType >
{
typedef typename VertexMapper::Index VertexMapperIndex;
public:
VertexHandleSum(Container &container,
const VertexMapper &mapper)
......@@ -68,14 +70,14 @@ public:
template<class MessageBufferImp, class EntityType>
void gather(MessageBufferImp &buff, const EntityType &e) const
{
int vIdx = mapper_.map(e);
VertexMapperIndex vIdx = mapper_.map(e);
buff.write(container_[vIdx]);
}
template<class MessageBufferImp, class EntityType>
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
{
int vIdx = mapper_.map(e);
VertexMapperIndex vIdx = mapper_.map(e);
FieldType tmp;
buff.read(tmp);
......@@ -96,6 +98,8 @@ class VertexHandleMax
: public Dune::CommDataHandleIF< VertexHandleMax<FieldType, Container, VertexMapper>,
FieldType >
{
typedef typename VertexMapper::Index VertexMapperIndex;
public:
VertexHandleMax(Container &container,
const VertexMapper &mapper)
......@@ -126,14 +130,14 @@ public:
template<class MessageBufferImp, class EntityType>
void gather(MessageBufferImp &buff, const EntityType &e) const
{
int vIdx = mapper_.map(e);
VertexMapperIndex vIdx = mapper_.map(e);
buff.write(container_[vIdx]);
}
template<class MessageBufferImp, class EntityType>
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
{
int vIdx = mapper_.map(e);
VertexMapperIndex vIdx = mapper_.map(e);
FieldType tmp;
buff.read(tmp);
......@@ -155,6 +159,8 @@ class VertexHandleMin
: public Dune::CommDataHandleIF< VertexHandleMin<FieldType, Container, VertexMapper>,
FieldType >
{
typedef typename VertexMapper::Index VertexMapperIndex;
public:
VertexHandleMin(Container &container,
const VertexMapper &mapper)
......@@ -185,14 +191,14 @@ public:
template<class MessageBufferImp, class EntityType>
void gather(MessageBufferImp &buff, const EntityType &e) const
{
int vIdx = mapper_.map(e);
VertexMapperIndex vIdx = mapper_.map(e);
buff.write(container_[vIdx]);
}
template<class MessageBufferImp, class EntityType>
void scatter(MessageBufferImp &buff, const EntityType &e, size_t n)
{
int vIdx = mapper_.map(e);
VertexMapperIndex vIdx = mapper_.map(e);
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