Skip to content

Commit 3cce320

Browse files
Implemented function for determining the two endpoints of a given midpoint for the 3D cases.
1 parent a819ddb commit 3cce320

File tree

3 files changed

+76
-2
lines changed

3 files changed

+76
-2
lines changed

src/axom/mir/CellGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void CellGenerator::generateVertexVolumeFractions(const mir::Shape shapeType,
110110
{
111111
int vID = itr->first;
112112

113-
for (int matID = 0; matID < vertexVF.size(); ++matID)
113+
for (unsigned long matID = 0; matID < vertexVF.size(); ++matID)
114114
{
115115
if ( vID < mir::utilities::numVerts(shapeType) )
116116
{

src/axom/mir/MIRUtilities.hpp

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,80 @@ namespace utilities
177177
if ( midpointVertexID == 7 && isFromVertex ) { return 3; }
178178
if ( midpointVertexID == 7 && !isFromVertex ) { return 0; }
179179
break;
180+
case mir::Shape::Tetrahedron:
181+
if ( midpointVertexID == 4 && isFromVertex ) { return 0; }
182+
if ( midpointVertexID == 4 && !isFromVertex ) { return 1; }
183+
if ( midpointVertexID == 5 && isFromVertex ) { return 0; }
184+
if ( midpointVertexID == 5 && !isFromVertex ) { return 2; }
185+
if ( midpointVertexID == 6 && isFromVertex ) { return 0; }
186+
if ( midpointVertexID == 6 && !isFromVertex ) { return 3; }
187+
if ( midpointVertexID == 7 && isFromVertex ) { return 1; }
188+
if ( midpointVertexID == 7 && !isFromVertex ) { return 2; }
189+
if ( midpointVertexID == 8 && isFromVertex ) { return 2; }
190+
if ( midpointVertexID == 8 && !isFromVertex ) { return 3; }
191+
if ( midpointVertexID == 9 && isFromVertex ) { return 3; }
192+
if ( midpointVertexID == 9 && !isFromVertex ) { return 1; }
193+
case mir::Shape::Pyramid:
194+
if ( midpointVertexID == 5 && isFromVertex ) { return 0; }
195+
if ( midpointVertexID == 5 && !isFromVertex ) { return 1; }
196+
if ( midpointVertexID == 6 && isFromVertex ) { return 0; }
197+
if ( midpointVertexID == 6 && !isFromVertex ) { return 2; }
198+
if ( midpointVertexID == 7 && isFromVertex ) { return 0; }
199+
if ( midpointVertexID == 7 && !isFromVertex ) { return 3; }
200+
if ( midpointVertexID == 8 && isFromVertex ) { return 0; }
201+
if ( midpointVertexID == 8 && !isFromVertex ) { return 4; }
202+
if ( midpointVertexID == 9 && isFromVertex ) { return 1; }
203+
if ( midpointVertexID == 9 && !isFromVertex ) { return 2; }
204+
if ( midpointVertexID == 10 && isFromVertex ) { return 2; }
205+
if ( midpointVertexID == 10 && !isFromVertex ) { return 3; }
206+
if ( midpointVertexID == 11 && isFromVertex ) { return 3; }
207+
if ( midpointVertexID == 11 && !isFromVertex ) { return 4; }
208+
if ( midpointVertexID == 12 && isFromVertex ) { return 4; }
209+
if ( midpointVertexID == 12 && !isFromVertex ) { return 1; }
210+
case mir::Shape::Triangular_Prism:
211+
if ( midpointVertexID == 6 && isFromVertex ) { return 0; }
212+
if ( midpointVertexID == 6 && !isFromVertex ) { return 1; }
213+
if ( midpointVertexID == 7 && isFromVertex ) { return 1; }
214+
if ( midpointVertexID == 7 && !isFromVertex ) { return 2; }
215+
if ( midpointVertexID == 8 && isFromVertex ) { return 2; }
216+
if ( midpointVertexID == 8 && !isFromVertex ) { return 0; }
217+
if ( midpointVertexID == 9 && isFromVertex ) { return 0; }
218+
if ( midpointVertexID == 9 && !isFromVertex ) { return 3; }
219+
if ( midpointVertexID == 10 && isFromVertex ) { return 1; }
220+
if ( midpointVertexID == 10 && !isFromVertex ) { return 4; }
221+
if ( midpointVertexID == 11 && isFromVertex ) { return 2; }
222+
if ( midpointVertexID == 11 && !isFromVertex ) { return 5; }
223+
if ( midpointVertexID == 12 && isFromVertex ) { return 3; }
224+
if ( midpointVertexID == 12 && !isFromVertex ) { return 4; }
225+
if ( midpointVertexID == 13 && isFromVertex ) { return 4; }
226+
if ( midpointVertexID == 13 && !isFromVertex ) { return 5; }
227+
if ( midpointVertexID == 14 && isFromVertex ) { return 5; }
228+
if ( midpointVertexID == 14 && !isFromVertex ) { return 3; }
229+
case mir::Shape::Hexahedron:
230+
if ( midpointVertexID == 8 && isFromVertex ) { return 0; }
231+
if ( midpointVertexID == 8 && !isFromVertex ) { return 1; }
232+
if ( midpointVertexID == 9 && isFromVertex ) { return 1; }
233+
if ( midpointVertexID == 9 && !isFromVertex ) { return 2; }
234+
if ( midpointVertexID == 10 && isFromVertex ) { return 2; }
235+
if ( midpointVertexID == 10 && !isFromVertex ) { return 3; }
236+
if ( midpointVertexID == 11 && isFromVertex ) { return 3; }
237+
if ( midpointVertexID == 11 && !isFromVertex ) { return 0; }
238+
if ( midpointVertexID == 12 && isFromVertex ) { return 0; }
239+
if ( midpointVertexID == 12 && !isFromVertex ) { return 4; }
240+
if ( midpointVertexID == 13 && isFromVertex ) { return 1; }
241+
if ( midpointVertexID == 13 && !isFromVertex ) { return 5; }
242+
if ( midpointVertexID == 14 && isFromVertex ) { return 2; }
243+
if ( midpointVertexID == 14 && !isFromVertex ) { return 6; }
244+
if ( midpointVertexID == 15 && isFromVertex ) { return 3; }
245+
if ( midpointVertexID == 15 && !isFromVertex ) { return 7; }
246+
if ( midpointVertexID == 16 && isFromVertex ) { return 4; }
247+
if ( midpointVertexID == 16 && !isFromVertex ) { return 5; }
248+
if ( midpointVertexID == 17 && isFromVertex ) { return 5; }
249+
if ( midpointVertexID == 17 && !isFromVertex ) { return 6; }
250+
if ( midpointVertexID == 18 && isFromVertex ) { return 6; }
251+
if ( midpointVertexID == 18 && !isFromVertex ) { return 7; }
252+
if ( midpointVertexID == 19 && isFromVertex ) { return 7; }
253+
if ( midpointVertexID == 19 && !isFromVertex ) { return 4; }
180254
default:
181255
printf("Edge endpoint case not implemented.\n");
182256
return -1;

src/axom/mir/examples/mir_tutorial_simple.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int main( int AXOM_NOT_USED(argc), char** AXOM_NOT_USED(argv) )
4848
std::cout << "Material interface reconstruction time: " << std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime).count() << " ms" << std::endl;
4949

5050
// Output results
51-
processedMesh.writeMeshToFile("/Users/sterbentz3/Desktop/testOutputNewMARKONEW4.vtk");
51+
processedMesh.writeMeshToFile("/Users/sterbentz3/Desktop/processedMesh.vtk");
5252

5353
std::vector<std::vector<axom::float64> > materialVolumeFractionsElement = processedMesh.computeOriginalElementVolumeFractions();
5454

0 commit comments

Comments
 (0)