Skip to content
Snippets Groups Projects
Commit 03d2ad4a authored by Robert Klöfkorn's avatar Robert Klöfkorn
Browse files

Enabled check for grid with entities of different element types.

[[Imported from SVN: r3563]]
parent b6b2066d
No related branches found
No related tags found
No related merge requests found
...@@ -64,10 +64,11 @@ namespace Dune { ...@@ -64,10 +64,11 @@ namespace Dune {
} }
for(int subEntity = 0; subEntity < refElem.size(0,0,codim); subEntity++) for(int subEntity = 0; subEntity < refElem.size(0,0,codim); subEntity++)
{ {
typedef std::pair < int , GeometryType > SubEntityKeyType;
{ {
int numSubEntities = refElem.size(subEntity,codim,dim); int numSubEntities = refElem.size(subEntity,codim,dim);
// every entity have at least one vertex // every entity have at least one vertex
assert( numSubEntities > 0 ); //assert( numSubEntities > 0 );
// create vectors of number of vertices on sub entity // create vectors of number of vertices on sub entity
std::vector<int> local (numSubEntities,-1); std::vector<int> local (numSubEntities,-1);
...@@ -88,9 +89,11 @@ namespace Dune { ...@@ -88,9 +89,11 @@ namespace Dune {
global[j] = lset.template subIndex<dim> ( en, local[j]); global[j] = lset.template subIndex<dim> ( en, local[j]);
} }
int globalSubEntity = lset.template subIndex<codim>(en,subEntity); SubEntityKeyType globalSubEntity =
assert( globalSubEntity >= 0 ); SubEntityKeyType ( lset.template subIndex<codim>(en,subEntity),
sout << "local subentity " << subEntity << " consider subentity with global index " << globalSubEntity << " on en = " << lset.index(en) << "\n"; (en.template entity<codim> (subEntity))->geometry().type());
assert( globalSubEntity.first >= 0 );
sout << "local subentity " << subEntity << " consider subentity with global key (" << globalSubEntity.first << "," << globalSubEntity.second << ") on en = " << lset.index(en) << "\n";
sout << "Found global numbers of entity [ "; sout << "Found global numbers of entity [ ";
for(int j=0 ; j<numSubEntities; j++ ) for(int j=0 ; j<numSubEntities; j++ )
...@@ -145,8 +148,7 @@ namespace Dune { ...@@ -145,8 +148,7 @@ namespace Dune {
} }
else else
{ {
int otherSubEntity = vertices[global]; SubEntityKeyType otherSubEntity = vertices[global];
// ??? WTF ???
assert( globalSubEntity == otherSubEntity ); assert( globalSubEntity == otherSubEntity );
} }
...@@ -160,7 +162,7 @@ namespace Dune { ...@@ -160,7 +162,7 @@ namespace Dune {
std::vector<int> globalcheck = subEntities[globalSubEntity]; std::vector<int> globalcheck = subEntities[globalSubEntity];
if(! (global == globalcheck )) if(! (global == globalcheck ))
{ {
std::cerr << "For subEntity " << globalSubEntity << "\n"; std::cerr << "For subEntity key (" << globalSubEntity.first << "," << globalSubEntity.second << ") \n";
std::cerr << "Got "; std::cerr << "Got ";
for(int j=0 ; j<numSubEntities; j++ ) for(int j=0 ; j<numSubEntities; j++ )
{ {
...@@ -253,9 +255,10 @@ namespace Dune { ...@@ -253,9 +255,10 @@ namespace Dune {
//****************************************************************** //******************************************************************
typedef std::pair < int , GeometryType > SubEntityKeyType;
typedef std::map < int , std::pair<int,int> > subEntitymapType; typedef std::map < int , std::pair<int,int> > subEntitymapType;
std::map < int , std::vector<int> > subEntities; std::map < SubEntityKeyType , std::vector<int> > subEntities;
std::map < std::vector<int> , int > vertices; std::map < std::vector<int> , SubEntityKeyType > vertices;
std::map < int , FieldVector<coordType,dim> > vertexCoordsMap; std::map < int , FieldVector<coordType,dim> > vertexCoordsMap;
// setup vertex map , store vertex coords for vertex number // setup vertex map , store vertex coords for vertex number
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment