106 int face0NodeCount=0;
107 bool reverseFace0Nodes =
false;
111 const int f = cellFaces(c,nf);
112 if ((
unsigned int)faceNodes.
getCount(f) == CellTrait::faceNodeCount[0])
115 face0NodeCount = faceNodes.
getCount(f);
116 if (faceCells(f,0) != c)
118 if (faceCells(f,1) != c)
119 cerr <<
"malformed grid " << endl;
120 reverseFace0Nodes =
true;
126 map<int, unsigned int> thisNodesFirstFaceNodesSig;
128 for(
unsigned int nn=0; nn<(
unsigned int)face0NodeCount; nn++)
130 int node = faceNodes(face0,nn);
131 if (reverseFace0Nodes) node = faceNodes(face0,face0NodeCount-nn-1);
132 thisNodesFirstFaceNodesSig[node] = 1<<nn;
139 unsigned int thisFaceFirstFaceNodesSig = 0;
140 const int f = cellFaces(c,nf);
142 for(
int nn=0; nn<faceNodes.
getCount(f); nn++)
144 const int n = faceNodes(f,nn);
146 if (thisNodesFirstFaceNodesSig.find(n) !=
147 thisNodesFirstFaceNodesSig.end())
148 thisFaceFirstFaceNodesSig |= thisNodesFirstFaceNodesSig[n];
152 orderedFaces[faceOrder] = f;
156 cellFaces(c,nf) = orderedFaces[nf];
159 map<int, unsigned int> thisNodesAllFaceNodesSig;
164 const int f = cellFaces(c,nf);
168 const int faceNodeCount = faceNodes.
getCount(f);
169 for(
int nn=0; nn<faceNodeCount; nn++)
171 int n = faceNodes(f,nn);
172 if (reverseFace0Nodes) n = faceNodes(f,faceNodeCount-nn-1);
174 if (thisNodesAllFaceNodesSig.find(n) ==
175 thisNodesAllFaceNodesSig.end())
177 thisNodesAllFaceNodesSig[n] =
182 thisNodesAllFaceNodesSig[n] &=
188 for( map<int,unsigned int>::const_iterator pos =
189 thisNodesAllFaceNodesSig.begin();
190 pos != thisNodesAllFaceNodesSig.end();
193 const int node = pos->first;
195 const int index = (int) log2(pos->second);
197 cellNodes(c,index) = node;
int getCount(const int i) const
map< unsigned int, unsigned int > _faceFirstFaceNodesSigMap
unsigned int _faceAllNodesSig[numFaces]