Fix cracks between triangular Gregory patches along inf-sharp dart edges:

- corrected regular vs irregular assignment of the quartic mid-edge point
This commit is contained in:
barry 2019-02-04 11:19:24 -08:00
parent 3ba6a1a11c
commit b83dd92757

View File

@ -857,8 +857,12 @@ GregoryTriConverter<REAL>::Convert(Matrix & matrix) const {
} }
for (int eIndex = 0; eIndex < 3; ++eIndex) { for (int eIndex = 0; eIndex < 3; ++eIndex) {
if ((_corners[eIndex].isRegular && _corners[(eIndex+1)%3].isRegular) || CornerTopology const & c0 = _corners[eIndex];
_corners[eIndex].epOnBoundary) { CornerTopology const & c1 = _corners[(eIndex + 1) % 3];
bool isBoundaryEdge = c0.epOnBoundary && c1.emOnBoundary;
bool isDartEdge = c0.epOnBoundary != c1.emOnBoundary;
if (isBoundaryEdge || (c0.isRegular && c1.isRegular && !isDartEdge)) {
assignRegularMidEdgePoint(eIndex, matrix); assignRegularMidEdgePoint(eIndex, matrix);
} else { } else {
computeIrregularMidEdgePoint(eIndex, matrix, weightBuffer, indexBuffer); computeIrregularMidEdgePoint(eIndex, matrix, weightBuffer, indexBuffer);
@ -981,15 +985,18 @@ GregoryTriConverter<REAL>::resizeMatrixUnisolated(Matrix & matrix) const {
numElements += rowSize[3] + rowSize[4]; numElements += rowSize[3] + rowSize[4];
// Third, the quartic mid-edge boundary point (edge following corner): // Third, the quartic mid-edge boundary point (edge following corner):
int cNext = (cIndex + 1) % 3;
CornerTopology const & cornerNext = _corners[cNext];
int & midEdgeSize = rowSizes[15 + cIndex]; int & midEdgeSize = rowSizes[15 + cIndex];
if (corner.epOnBoundary) { if (corner.epOnBoundary && cornerNext.emOnBoundary) {
midEdgeSize = 2; midEdgeSize = 2;
} else if (corner.isRegular && _corners[(cIndex+1) % 3].isRegular) { } else if (corner.isRegular && cornerNext.isRegular &&
(corner.epOnBoundary == cornerNext.emOnBoundary)) {
midEdgeSize = 4; midEdgeSize = 4;
} else { } else {
// Use face-point size here, which also combines edge-point sizes: midEdgeSize = getIrregularFacePointSize(cIndex, cNext);
midEdgeSize = rowSize[3];
} }
numElements += midEdgeSize; numElements += midEdgeSize;
} }