From f29fedbb119524ad302aecfaeb15f15361b206a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Peters?= <soe.peters@tu-braunschweig.de> Date: Mon, 6 Nov 2023 11:42:38 +0000 Subject: [PATCH] Apply 3 suggestion(s) to 1 file(s) --- src/gpu/VirtualFluids_GPU/Output/WriterUtilities.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gpu/VirtualFluids_GPU/Output/WriterUtilities.cpp b/src/gpu/VirtualFluids_GPU/Output/WriterUtilities.cpp index 033f37c17..4db1b7efc 100644 --- a/src/gpu/VirtualFluids_GPU/Output/WriterUtilities.cpp +++ b/src/gpu/VirtualFluids_GPU/Output/WriterUtilities.cpp @@ -16,7 +16,7 @@ uint WriterUtilities::calculateNumberOfParts(const Parameter* parameter, uint le bool WriterUtilities::isPeriodicCell(const LBMSimulationParameter* parH, unsigned int baseNodeOfCell, unsigned int otherNodeInCell) { - real distance = sqrt( + const real distance = sqrt( pow(parH->coordinateX[otherNodeInCell] - parH->coordinateX[baseNodeOfCell], 2.) + pow(parH->coordinateY[otherNodeInCell] - parH->coordinateY[baseNodeOfCell], 2.) + pow(parH->coordinateZ[otherNodeInCell] - parH->coordinateZ[baseNodeOfCell], 2.)); @@ -56,10 +56,10 @@ void WriterUtilities::calculateRelativeNodeIndexInPart(std::array<uint, 8>& rela bool WriterUtilities::areAllNodesInOctValidForWriting(const std::array<uint, 8>& indicesOfOct, const LBMSimulationParameter* parH, uint endPositionOfPart) { - bool neighborsAreFluid = std::all_of(indicesOfOct.begin(), indicesOfOct.end(), + const bool neighborsAreFluid = std::all_of(indicesOfOct.begin(), indicesOfOct.end(), [&](uint index) { return parH->typeOfGridNode[index] == GEO_FLUID; }); - bool neighborIsOutOfPart = + const bool neighborIsOutOfPart = (std::any_of(indicesOfOct.begin(), indicesOfOct.end(), [&](uint index) { return index > endPositionOfPart; })); return neighborsAreFluid && !neighborIsOutOfPart; -- GitLab