diff --git a/FunctionSpace/ReferenceSpace.cpp b/FunctionSpace/ReferenceSpace.cpp index 419ec28a7935e13d67bf7bef84d062f6f55cea32..e40f04788b3a513f5e4f491424bdbd0d2259b95a 100644 --- a/FunctionSpace/ReferenceSpace.cpp +++ b/FunctionSpace/ReferenceSpace.cpp @@ -102,6 +102,30 @@ void ReferenceSpace::init(void){ // Get Edges & Faces // getEdge(); getFace(); + + for(unsigned int p = 0; p < nPerm; p++){ + cout << "Permutation " << p << ":" << endl; + + for(unsigned int e = 0; e < nEdge; e++){ + cout << " " << "Edge " << e << ": ["; + + for(unsigned int n = 0; n < 2 - 1; n++) + cout << permutedRefEdge[p][e][n] << ", "; + + cout << permutedRefEdge[p][e][2 - 1] << "]" + << endl; + } + + for(unsigned int f = 0; f < nFace; f++){ + cout << " " << "Face " << f << ": ["; + + for(unsigned int n = 0; n < nNodeInFace[f] - 1; n++) + cout << permutedRefFace[p][f][n] << ", "; + + cout << permutedRefFace[p][f][nNodeInFace[f] - 1] << "]" + << endl; + } + } } void ReferenceSpace::populate(node* pTreeRoot){ @@ -427,33 +451,33 @@ unsigned int ReferenceSpace::getPermutation(const MElement& elem) const{ } } -unsigned int ReferenceSpace::treeLookup(const node* root, +unsigned int ReferenceSpace::treeLookup(const node* node, vector<unsigned int>& vertexReducedId){ // Temp Data // unsigned int choice; unsigned int i; - // If Root is *not* a Leaf: Lookup // - if(root->number){ + // If Node is *not* a Leaf: Lookup // + if(node->number){ // Get This Choice - choice = vertexReducedId[root->depth]; + choice = vertexReducedId[node->depth]; // Look for next node corresponding to this Choice i = 0; - while(root->possible[i] != choice) + while(node->possible[i] != choice) i++; // Look if a this Choice has been found - if(i == root->number) + if(i == node->number) throw Exception(); // Go to next Node - return treeLookup(&root->next[i], vertexReducedId); + return treeLookup(&node->next[i], vertexReducedId); } // Else: Return Leaf ID // else - return root->leafId; + return node->leafId; } string ReferenceSpace::toString(void) const{ diff --git a/FunctionSpace/ReferenceSpace.h b/FunctionSpace/ReferenceSpace.h index d051686ff6309383b201d0f11bab70aafd5965e6..e4ce84e31383d49d7e2340ed4a5028b7f2d088b8 100644 --- a/FunctionSpace/ReferenceSpace.h +++ b/FunctionSpace/ReferenceSpace.h @@ -69,7 +69,7 @@ class ReferenceSpace{ getAllEdge(void) const; const std::vector<const std::vector<const std::vector<unsigned int>*>*>& - getAllFace(void) const ; + getAllFace(void) const; virtual std::string toString(void) const; @@ -116,7 +116,7 @@ class ReferenceSpace{ static bool sortPredicate(const std::pair<unsigned int, unsigned int>& a, const std::pair<unsigned int, unsigned int>& b); - static unsigned int treeLookup(const node* root, + static unsigned int treeLookup(const node* node, std::vector<unsigned int>& vertexReducedId); std::string toString(const node* node) const;