diff --git a/core/src/mesh.cpp b/core/src/mesh.cpp index 92f9083dc..626414f8e 100644 --- a/core/src/mesh.cpp +++ b/core/src/mesh.cpp @@ -1704,10 +1704,10 @@ void Mesh::create2DGrid(const RVector & x, const RVector & y, int markerType, if (std::abs(boundary(i).norm()[0] + 1.0) < TOLERANCE) boundary(i).setMarker(1); // Right else if (std::abs(boundary(i).norm()[0] - 1.0) < TOLERANCE) boundary(i).setMarker(2); - // Top - else if (std::abs(boundary(i).norm()[1] - 1.0) < TOLERANCE) boundary(i).setMarker(3); // Bottom - else if (std::abs(boundary(i).norm()[1] + 1.0) < TOLERANCE) boundary(i).setMarker(4); + else if (std::abs(boundary(i).norm()[1] + 1.0) < TOLERANCE) boundary(i).setMarker(3); + // Top + else if (std::abs(boundary(i).norm()[1] - 1.0) < TOLERANCE) boundary(i).setMarker(4); } } } @@ -1782,31 +1782,42 @@ void Mesh::create3DGrid(const RVector & x, const RVector & y, const RVector & z, if (worldBoundaryMarker){ // Left if (std::abs(boundary(i).norm()[0] + 1.0) < TOLERANCE) - boundary(i).setMarker(MARKER_BOUND_HOMOGEN_NEUMANN); + boundary(i).setMarker(MARKER_BOUND_MIXED); // Right - else if (std::abs(boundary(i).norm()[0] - 1.0) < TOLERANCE) boundary(i).setMarker(MARKER_BOUND_MIXED); - // Top - else if (std::abs(boundary(i).norm()[2] - 1.0) < TOLERANCE) boundary(i).setMarker(MARKER_BOUND_MIXED); + else if (std::abs(boundary(i).norm()[0] - 1.0) < TOLERANCE) + boundary(i).setMarker(MARKER_BOUND_MIXED); // Bottom - else if (std::abs(boundary(i).norm()[2] + 1.0) < TOLERANCE) boundary(i).setMarker(MARKER_BOUND_MIXED); + else if (std::abs(boundary(i).norm()[2] + 1.0) < TOLERANCE) + boundary(i).setMarker(MARKER_BOUND_MIXED); + // Top + else if (std::abs(boundary(i).norm()[2] - 1.0) < TOLERANCE) + boundary(i).setMarker(MARKER_BOUND_HOMOGEN_NEUMANN); // Front - else if (std::abs(boundary(i).norm()[1] - 1.0) < TOLERANCE) boundary(i).setMarker(MARKER_BOUND_MIXED); + else if (std::abs(boundary(i).norm()[1] + 1.0) < TOLERANCE) + boundary(i).setMarker(MARKER_BOUND_MIXED); // Back - else if (std::abs(boundary(i).norm()[1] + 1.0) < TOLERANCE) boundary(i).setMarker(MARKER_BOUND_MIXED); + else if (std::abs(boundary(i).norm()[1] - 1.0) < TOLERANCE) + boundary(i).setMarker(MARKER_BOUND_MIXED); } else { // Left - if (std::abs(boundary(i).norm()[0] + 1.0) < TOLERANCE) boundary(i).setMarker(1); + if (std::abs(boundary(i).norm()[0] + 1.0) < TOLERANCE) + boundary(i).setMarker(1); // Right - else if (std::abs(boundary(i).norm()[0] - 1.0) < TOLERANCE) boundary(i).setMarker(2); - // Top - else if (std::abs(boundary(i).norm()[2] - 1.0) < TOLERANCE) boundary(i).setMarker(3); + else if (std::abs(boundary(i).norm()[0] - 1.0) < TOLERANCE) + boundary(i).setMarker(2); // Bottom - else if (std::abs(boundary(i).norm()[2] + 1.0) < TOLERANCE) boundary(i).setMarker(4); + else if (std::abs(boundary(i).norm()[2] + 1.0) < TOLERANCE) + boundary(i).setMarker(3); + // Top + else if (std::abs(boundary(i).norm()[2] - 1.0) < TOLERANCE) + boundary(i).setMarker(4); // Front - else if (std::abs(boundary(i).norm()[1] - 1.0) < TOLERANCE) boundary(i).setMarker(5); + else if (std::abs(boundary(i).norm()[1] + 1.0) < TOLERANCE) + boundary(i).setMarker(5); // Back - else if (std::abs(boundary(i).norm()[1] + 1.0) < TOLERANCE) boundary(i).setMarker(6); + else if (std::abs(boundary(i).norm()[1] - 1.0) < TOLERANCE) + boundary(i).setMarker(6); } } } diff --git a/core/src/mesh.h b/core/src/mesh.h index d6d22324a..259830a21 100644 --- a/core/src/mesh.h +++ b/core/src/mesh.h @@ -245,14 +245,15 @@ class DLLEXPORT Mesh { * marker: 1,2 for: left, right.*/ void createGrid(const RVector & x) { create1DGrid(x); } - /*! Create two dimensional grid. Boundary on the domain border will get the - * marker: 1,2,3,4 for: left, right, top, bottom*/ + /*! Create two dimensional grid. Boundaries on the domain border will + get the markers: 1,2,3,4 for: left, right, bottom, top.*/ void createGrid(const RVector & x, const RVector & y, int markerType=0, bool worldBoundaryMarker=false) { create2DGrid(x, y, markerType, worldBoundaryMarker); } - /*! Create three dimensional grid. Boundary on the domain border will get the - * marker: 1,2,3,4,5,6 for: left, right, top, bottom, front, back*/ + /*! Create three dimensional grid. + Boundaries on the domain border will get the markers: + 1,2,3,4,5,6 for: left, right, bottom, top, front, back*/ void createGrid(const RVector & x, const RVector & y, const RVector & z, int markerType=0, bool worldBoundaryMarker=false){ create3DGrid(x, y, z, markerType, worldBoundaryMarker);