Skip to content
Snippets Groups Projects
Commit 4ef15a45 authored by Elias Pipping's avatar Elias Pipping
Browse files

[Cleanup] Extend simplex manager capabilities

parent 90c8424a
No related branches found
No related tags found
No related merge requests found
...@@ -9,24 +9,33 @@ ...@@ -9,24 +9,33 @@
SimplexManager::SimplexManager(unsigned int shift) : shift_(shift) {} SimplexManager::SimplexManager(unsigned int shift) : shift_(shift) {}
#endif #endif
void SimplexManager::addFromVertices(unsigned int U, unsigned int V, // back-to-front, front-to-back, front-to-back
unsigned int W) { void SimplexManager::addFromVerticesFBB(unsigned int U, unsigned int V,
unsigned int W) {
#if MY_DIM == 3 #if MY_DIM == 3
unsigned int const U2 = U + shift_; unsigned int const U2 = U + shift_;
unsigned int const V2 = V + shift_; unsigned int const V2 = V + shift_;
unsigned int const W2 = W + shift_; unsigned int const W2 = W + shift_;
// back-to-front, back-to-front, back-to-front
simplices_.push_back({ U, V, W, U2 }); simplices_.push_back({ U, V, W, U2 });
simplices_.push_back({ V, V2, W2, U2 }); simplices_.push_back({ V, V2, W2, U2 });
simplices_.push_back({ W, W2, U2, V }); simplices_.push_back({ W, W2, U2, V });
#else
simplices_.push_back({ U, V, W });
#endif
}
// back-to-front, back-to-front, front-to-back
void SimplexManager::addFromVerticesFFB(unsigned int U, unsigned int V,
unsigned int W) {
#if MY_DIM == 3
unsigned int const U2 = U + shift_;
unsigned int const V2 = V + shift_;
unsigned int const W2 = W + shift_;
// back-to-front, front-to-back, back-to-front would be
/*
simplices_.push_back({ U, V, W, U2 }); simplices_.push_back({ U, V, W, U2 });
simplices_.push_back({ V, V2, W, U2 }); simplices_.push_back({ V, V2, W, U2 });
simplices_.push_back({ V2, W2, U2, W }); simplices_.push_back({ V2, W, U2, W2 });
*/
#else #else
simplices_.push_back({ U, V, W }); simplices_.push_back({ U, V, W });
#endif #endif
...@@ -108,16 +117,16 @@ template <class Grid> GridConstructor<Grid>::GridConstructor() { ...@@ -108,16 +117,16 @@ template <class Grid> GridConstructor<Grid>::GridConstructor() {
#else #else
SimplexManager sm; SimplexManager sm;
#endif #endif
sm.addFromVertices(1, 5, 0); sm.addFromVerticesFBB(1, 5, 0);
sm.addFromVertices(1, 6, 5); sm.addFromVerticesFBB(1, 6, 5);
sm.addFromVertices(2, 6, 1); sm.addFromVerticesFBB(2, 6, 1);
sm.addFromVertices(7, 6, 2); sm.addFromVerticesFBB(7, 6, 2);
sm.addFromVertices(7, 2, 3); sm.addFromVerticesFBB(7, 2, 3);
sm.addFromVertices(7, 3, 8); sm.addFromVerticesFBB(7, 3, 8);
sm.addFromVertices(7, 8, 10); sm.addFromVerticesFBB(7, 8, 10);
sm.addFromVertices(7, 10, 9); sm.addFromVerticesFBB(7, 10, 9);
sm.addFromVertices(7, 9, 6); sm.addFromVerticesFBB(7, 9, 6);
sm.addFromVertices(8, 3, 4); sm.addFromVerticesFBB(8, 3, 4);
auto const &simplices = sm.getSimplices(); auto const &simplices = sm.getSimplices();
// sanity-check choices of simplices // sanity-check choices of simplices
......
...@@ -49,7 +49,8 @@ class SimplexManager { ...@@ -49,7 +49,8 @@ class SimplexManager {
SimplexManager(unsigned int shift); SimplexManager(unsigned int shift);
#endif #endif
void addFromVertices(unsigned int U, unsigned int V, unsigned int W); void addFromVerticesFBB(unsigned int U, unsigned int V, unsigned int W);
void addFromVerticesFFB(unsigned int U, unsigned int V, unsigned int W);
SimplexList const &getSimplices(); SimplexList const &getSimplices();
......
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