Skip to content

Commit

Permalink
Merge branch 'knepley/fix-hybrid-tet-refinement' into next
Browse files Browse the repository at this point in the history
* knepley/fix-hybrid-tet-refinement:
  DMPlex ex4: Fixed test output for hybrid tet refinement
  DMPlex: Fix for 3d hybrid simplicial refinement - Fixed the order in which hybrid faces are attached to the cell
  • Loading branch information
knepley committed Feb 2, 2014
2 parents 9e05ea1 + faae8ed commit d05d7b7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/dm/impls/plex/examples/tests/output/ex4_16.out
Original file line number Diff line number Diff line change
Expand Up @@ -445,24 +445,24 @@ base <-- cap:
[0]: 15 <---- 86 (-3)
[0]: 16 <---- 40 (0)
[0]: 16 <---- 68 (0)
[0]: 16 <---- 93 (0)
[0]: 16 <---- 88 (0)
[0]: 16 <---- 94 (0)
[0]: 16 <---- 93 (0)
[0]: 17 <---- 41 (0)
[0]: 17 <---- 69 (0)
[0]: 17 <---- 89 (0)
[0]: 17 <---- 90 (0)
[0]: 17 <---- 95 (0)
[0]: 18 <---- 42 (0)
[0]: 18 <---- 70 (0)
[0]: 18 <---- 96 (0)
[0]: 18 <---- 91 (0)
[0]: 18 <---- 92 (0)
[0]: 18 <---- 96 (0)
[0]: 19 <---- 43 (0)
[0]: 19 <---- 71 (0)
[0]: 19 <---- 94 (0)
[0]: 19 <---- 95 (0)
[0]: 19 <---- 96 (0)
[0]: 19 <---- 94 (0)
[0]: 40 <---- 97 (0)
[0]: 40 <---- 123 (-2)
[0]: 40 <---- 102 (0)
Expand Down
6 changes: 3 additions & 3 deletions src/dm/impls/plex/examples/tests/output/ex4_17.out
Original file line number Diff line number Diff line change
Expand Up @@ -817,24 +817,24 @@ base <-- cap:
[1]: 7 <---- 54 (-3)
[1]: 8 <---- 28 (0)
[1]: 8 <---- 44 (0)
[1]: 8 <---- 61 (0)
[1]: 8 <---- 56 (0)
[1]: 8 <---- 62 (0)
[1]: 8 <---- 61 (0)
[1]: 9 <---- 29 (0)
[1]: 9 <---- 45 (0)
[1]: 9 <---- 57 (0)
[1]: 9 <---- 58 (0)
[1]: 9 <---- 63 (0)
[1]: 10 <---- 30 (0)
[1]: 10 <---- 46 (0)
[1]: 10 <---- 64 (0)
[1]: 10 <---- 59 (0)
[1]: 10 <---- 60 (0)
[1]: 10 <---- 64 (0)
[1]: 11 <---- 31 (0)
[1]: 11 <---- 47 (0)
[1]: 11 <---- 62 (0)
[1]: 11 <---- 63 (0)
[1]: 11 <---- 64 (0)
[1]: 11 <---- 62 (0)
[1]: 28 <---- 65 (0)
[1]: 28 <---- 85 (-2)
[1]: 28 <---- 70 (0)
Expand Down
6 changes: 3 additions & 3 deletions src/dm/impls/plex/examples/tests/output/ex4_18.out
Original file line number Diff line number Diff line change
Expand Up @@ -1069,24 +1069,24 @@ base <-- cap:
[0]: 47 <---- 214 (-3)
[0]: 48 <---- 128 (0)
[0]: 48 <---- 164 (0)
[0]: 48 <---- 220 (0)
[0]: 48 <---- 219 (0)
[0]: 48 <---- 222 (0)
[0]: 48 <---- 220 (0)
[0]: 49 <---- 129 (0)
[0]: 49 <---- 165 (0)
[0]: 49 <---- 218 (0)
[0]: 49 <---- 216 (0)
[0]: 49 <---- 223 (0)
[0]: 50 <---- 130 (0)
[0]: 50 <---- 166 (0)
[0]: 50 <---- 224 (0)
[0]: 50 <---- 217 (0)
[0]: 50 <---- 221 (0)
[0]: 50 <---- 224 (0)
[0]: 51 <---- 131 (0)
[0]: 51 <---- 167 (0)
[0]: 51 <---- 222 (0)
[0]: 51 <---- 223 (0)
[0]: 51 <---- 224 (0)
[0]: 51 <---- 222 (0)
[0]: 88 <---- 225 (0)
[0]: 88 <---- 275 (-2)
[0]: 88 <---- 230 (0)
Expand Down
6 changes: 3 additions & 3 deletions src/dm/impls/plex/examples/tests/output/ex4_19.out
Original file line number Diff line number Diff line change
Expand Up @@ -1781,24 +1781,24 @@ base <-- cap:
[1]: 23 <---- 118 (-3)
[1]: 24 <---- 76 (0)
[1]: 24 <---- 92 (0)
[1]: 24 <---- 124 (0)
[1]: 24 <---- 123 (0)
[1]: 24 <---- 126 (0)
[1]: 24 <---- 124 (0)
[1]: 25 <---- 77 (0)
[1]: 25 <---- 93 (0)
[1]: 25 <---- 122 (0)
[1]: 25 <---- 120 (0)
[1]: 25 <---- 127 (0)
[1]: 26 <---- 78 (0)
[1]: 26 <---- 94 (0)
[1]: 26 <---- 128 (0)
[1]: 26 <---- 121 (0)
[1]: 26 <---- 125 (0)
[1]: 26 <---- 128 (0)
[1]: 27 <---- 79 (0)
[1]: 27 <---- 95 (0)
[1]: 27 <---- 126 (0)
[1]: 27 <---- 127 (0)
[1]: 27 <---- 128 (0)
[1]: 27 <---- 126 (0)
[1]: 52 <---- 129 (0)
[1]: 52 <---- 161 (-2)
[1]: 52 <---- 134 (0)
Expand Down
25 changes: 14 additions & 11 deletions src/dm/impls/plex/plexrefine.c
Original file line number Diff line number Diff line change
Expand Up @@ -2905,7 +2905,7 @@ static PetscErrorCode CellRefinerSetCones(CellRefiner refiner, DM dm, PetscInt d
for (c = cMax; c < cEnd; ++c) {
const PetscInt newp = cStartNew + (cMax - cStart)*8 + (c - cMax)*4;
const PetscInt *cone, *ornt, *fornt;
PetscInt coneNew[5], orntNew[5], o, of;
PetscInt coneNew[5], orntNew[5], o, of, i;

ierr = DMPlexGetCone(dm, c, &cone);CHKERRQ(ierr);
ierr = DMPlexGetConeOrientation(dm, c, &ornt);CHKERRQ(ierr);
Expand All @@ -2916,14 +2916,17 @@ static PetscErrorCode CellRefinerSetCones(CellRefiner refiner, DM dm, PetscInt d
orntNew[0] = ornt[0];
coneNew[1] = fStartNew + (cone[1] - fStart)*4 + GetTriSubface_Static(ornt[1], r);
orntNew[1] = ornt[1];
of = fornt[GetTriEdge_Static(ornt[0], (r+2)%3)] < 0 ? -1 : 1;
coneNew[2] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (cone[2+GetTriEdge_Static(ornt[0], (r+2)%3)] - fMax)*2 + (o*of < 0 ? 0 : 1);
orntNew[2] = 0;
of = fornt[GetTriEdge_Static(ornt[0], r)] < 0 ? -1 : 1;
coneNew[3] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (cone[2+GetTriEdge_Static(ornt[0], r)] - fMax)*2 + (o*of < 0 ? 1 : 0);
orntNew[3] = 0;
coneNew[4] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + GetTriSubface_Static(ornt[0], r);
orntNew[4] = 0;
i = GetTriEdgeInverse_Static(ornt[0], r) + 2;
coneNew[i] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (cone[2+GetTriEdge_Static(ornt[0], r)] - fMax)*2 + (o*of < 0 ? 1 : 0);
orntNew[i] = 0;
i = GetTriEdgeInverse_Static(ornt[0], (r+1)%3) + 2;
coneNew[i] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + GetTriSubface_Static(ornt[0], r);
orntNew[i] = 0;
of = fornt[GetTriEdge_Static(ornt[0], (r+2)%3)] < 0 ? -1 : 1;
i = GetTriEdgeInverse_Static(ornt[0], (r+2)%3) + 2;
coneNew[i] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (cone[2+GetTriEdge_Static(ornt[0], (r+2)%3)] - fMax)*2 + (o*of < 0 ? 0 : 1);
orntNew[i] = 0;
ierr = DMPlexSetCone(rdm, newp+r, coneNew);CHKERRQ(ierr);
ierr = DMPlexSetConeOrientation(rdm, newp+r, orntNew);CHKERRQ(ierr);
#if 1
Expand All @@ -2940,11 +2943,11 @@ static PetscErrorCode CellRefinerSetCones(CellRefiner refiner, DM dm, PetscInt d
orntNew[0] = 0;
coneNew[1] = fStartNew + (cone[1] - fStart)*4 + 3;
orntNew[1] = 0;
coneNew[2] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + 0;
coneNew[2] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + 1;
orntNew[2] = 0;
coneNew[3] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + 1;
coneNew[3] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + 2;
orntNew[3] = 0;
coneNew[4] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + 2;
coneNew[4] = fStartNew + (fMax - fStart)*4 + (cMax - cStart)*8 + (fEnd - fMax)*2 + (c - cMax)*3 + 0;
orntNew[4] = 0;
ierr = DMPlexSetCone(rdm, newp+3, coneNew);CHKERRQ(ierr);
ierr = DMPlexSetConeOrientation(rdm, newp+3, orntNew);CHKERRQ(ierr);
Expand Down

0 comments on commit d05d7b7

Please sign in to comment.