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 {
}
for(int subEntity = 0; subEntity < refElem.size(0,0,codim); subEntity++)
{
typedef std::pair < int , GeometryType > SubEntityKeyType;
{
int numSubEntities = refElem.size(subEntity,codim,dim);
// every entity have at least one vertex
assert( numSubEntities > 0 );
//assert( numSubEntities > 0 );
// create vectors of number of vertices on sub entity
std::vector<int> local (numSubEntities,-1);
......@@ -88,9 +89,11 @@ namespace Dune {
global[j] = lset.template subIndex<dim> ( en, local[j]);
}
int globalSubEntity = lset.template subIndex<codim>(en,subEntity);
assert( globalSubEntity >= 0 );
sout << "local subentity " << subEntity << " consider subentity with global index " << globalSubEntity << " on en = " << lset.index(en) << "\n";
SubEntityKeyType globalSubEntity =
SubEntityKeyType ( lset.template subIndex<codim>(en,subEntity),
(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 [ ";
for(int j=0 ; j<numSubEntities; j++ )
......@@ -145,8 +148,7 @@ namespace Dune {
}
else
{
int otherSubEntity = vertices[global];
// ??? WTF ???
SubEntityKeyType otherSubEntity = vertices[global];
assert( globalSubEntity == otherSubEntity );
}
......@@ -160,7 +162,7 @@ namespace Dune {
std::vector<int> globalcheck = subEntities[globalSubEntity];
if(! (global == globalcheck ))
{
std::cerr << "For subEntity " << globalSubEntity << "\n";
std::cerr << "For subEntity key (" << globalSubEntity.first << "," << globalSubEntity.second << ") \n";
std::cerr << "Got ";
for(int j=0 ; j<numSubEntities; j++ )
{
......@@ -253,9 +255,10 @@ namespace Dune {
//******************************************************************
typedef std::pair < int , GeometryType > SubEntityKeyType;
typedef std::map < int , std::pair<int,int> > subEntitymapType;
std::map < int , std::vector<int> > subEntities;
std::map < std::vector<int> , int > vertices;
std::map < SubEntityKeyType , std::vector<int> > subEntities;
std::map < std::vector<int> , SubEntityKeyType > vertices;
std::map < int , FieldVector<coordType,dim> > vertexCoordsMap;
// 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