Commit c4df8b3f authored by Tomáš Jakubec's avatar Tomáš Jakubec
Browse files

fix order in computeCellsCenterDifference

parent 1827d267
Pipeline #2862 failed with stage
in 3 seconds
......@@ -16,35 +16,28 @@ MeshDataContainer<Vector<Dimension, Real>, Dimension - 1> computeCellsCenterDiff
if (mesh.getBoundaryCells().empty()) {
for (auto &face : mesh.getFaces()) {
if (!isInvalidIndex(face.getCellLeftIndex())
&& !isInvalidIndex(face.getCellRightIndex())) {
connectingLines.at(face) = mesh.getCells().at(face.getCellLeftIndex()).getCenter()
- mesh.getCells().at(face.getCellRightIndex()).getCenter();
} else if (!isInvalidIndex(face.getCellLeftIndex())
&& isInvalidIndex(face.getCellRightIndex())) {
connectingLines.at(face) = mesh.getCells().at(face.getCellLeftIndex()).getCenter()
- face.getCenter();
} else if (isInvalidIndex(face.getCellLeftIndex())
&& !isInvalidIndex(face.getCellRightIndex())) {
if (!isInvalidIndex(face.getCellLeftIndex()) && !isInvalidIndex(face.getCellRightIndex())) {
connectingLines.at(face) = mesh.getCells().at(face.getCellRightIndex()).getCenter()
- face.getCenter();
- mesh.getCells().at(face.getCellLeftIndex()).getCenter();
} else if (!isInvalidIndex(face.getCellLeftIndex()) && isInvalidIndex(face.getCellRightIndex())) {
connectingLines.at(face) = face.getCenter() - mesh.getCells().at(face.getCellLeftIndex()).getCenter();
} else if (isInvalidIndex(face.getCellLeftIndex()) && !isInvalidIndex(face.getCellRightIndex())) {
connectingLines.at(face) = face.getCenter() - mesh.getCells().at(face.getCellRightIndex()).getCenter();
}
}
} else {
for (auto &face : mesh.getFaces()) {
auto &cellLeft = isBoundaryIndex(face.getCellLeftIndex())
? mesh.getBoundaryCells().at(
extractBoundaryIndex(face.getCellLeftIndex()))
? mesh.getBoundaryCells().at(extractBoundaryIndex(face.getCellLeftIndex()))
: mesh.getCells().at(face.getCellLeftIndex());
auto &cellRight = isBoundaryIndex(face.getCellRightIndex())
? mesh.getBoundaryCells().at(
extractBoundaryIndex(face.getCellRightIndex()))
? mesh.getBoundaryCells().at(extractBoundaryIndex(face.getCellRightIndex()))
: mesh.getCells().at(face.getCellRightIndex());
connectingLines.at(face) = cellLeft.getCenter() - cellRight.getCenter();
connectingLines.at(face) = cellRight.getCenter() - cellLeft.getCenter();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment