diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.h b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.h index ec0055b484fbf2d7c03f312f4bb5016e2e41a73b..d2f56e1df4ee5658c61b8e8a3e94a820d1a4f2f1 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.h +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.h @@ -58,7 +58,7 @@ private: std::shared_ptr<GridBuilder> builder; std::unique_ptr<const IndexRearrangementForStreams> indexRearrangement; - std::unique_ptr<InterpolationCellGrouper> interpolationGrouper; + std::unique_ptr<const InterpolationCellGrouper> interpolationGrouper; const uint mpiProcessID; public: diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGeneratorTest.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGeneratorTest.cpp index 77718b9f359fac688d5101fcf51fc9efd474fd97..45f88077aa7dd667b280366f48f85a0ed5913df5 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGeneratorTest.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGeneratorTest.cpp @@ -16,7 +16,7 @@ namespace GridGeneratorTest class LevelGridBuilderStub : public LevelGridBuilder { private: - SPtr<Grid> grid; + const SPtr<Grid> grid; LevelGridBuilderStub() = default; public: @@ -72,9 +72,9 @@ public: vf::gpu::Communicator &communicator) : IndexRearrangementForStreams(para, builder, communicator){}; - void initCommunicationArraysForCommAfterFinetoCoarseX(uint level, int j, int direction) override {}; - void initCommunicationArraysForCommAfterFinetoCoarseY(uint level, int j, int direction) override {}; - void initCommunicationArraysForCommAfterFinetoCoarseZ(uint level, int j, int direction) override {}; + void initCommunicationArraysForCommAfterFinetoCoarseX(uint level, int indexOfProcessNeighbor, int direction) const override {}; + void initCommunicationArraysForCommAfterFinetoCoarseY(uint level, int indexOfProcessNeighbor, int direction) const override {}; + void initCommunicationArraysForCommAfterFinetoCoarseZ(uint level, int indexOfProcessNeighbor, int direction) const override {}; }; } // namespace GridGeneratorTest @@ -84,7 +84,7 @@ using namespace GridGeneratorTest; class GridGeneratorTests_initalValuesDomainDecompostion : public testing::Test { public: - void act() + void act() const { gridGenerator->initalValuesDomainDecompostion(); } @@ -93,8 +93,8 @@ protected: SPtr<Parameter> para; std::shared_ptr<LevelGridBuilderStub> builder; - uint level = 1; - uint direction = CommunicationDirections::MX; + const uint level = 1; + const uint direction = CommunicationDirections::MX; SPtr<GridGenerator> gridGenerator; diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.h b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.h index d38765dc94ea11e8540c904942560d74dae8dc10..e6753e21be43a4f004d812cca8b9adafa501ffe8 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.h +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/IndexRearrangementForStreams.h @@ -34,13 +34,13 @@ public: //! \details Only the nodes involved in the interpolation need to be exchanged. Therefore in this method all nodes, //! which are part of the interpolation as well as the communication, are identified. //!See [master thesis of Anna Wellmann (p. 59-62: "Reduzieren der auszutauschenden Knoten")] - void initCommunicationArraysForCommAfterFinetoCoarseX(uint level, int j, int direction) const; + virtual void initCommunicationArraysForCommAfterFinetoCoarseX(uint level, int j, int direction) const; //! \brief Initialize the arrays for the communication after the interpolation from fine to coarse in y direction //! \details --> see x direction - void initCommunicationArraysForCommAfterFinetoCoarseY(uint level, int j, int direction) const; + virtual void initCommunicationArraysForCommAfterFinetoCoarseY(uint level, int j, int direction) const; //! \brief Initialize the arrays for the communication after the interpolation from fine to coarse in z direction //! \details --> see x direction - void initCommunicationArraysForCommAfterFinetoCoarseZ(uint level, int j, int direction) const; + virtual void initCommunicationArraysForCommAfterFinetoCoarseZ(uint level, int j, int direction) const; protected: ////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/InterpolationCellGrouper.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/InterpolationCellGrouper.cpp index ce1d74f631794a7c7ae9df52b810ceb34b82ba2a..aaf07f4504fcecfa8a25edb206155735e2063bbf 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/InterpolationCellGrouper.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/InterpolationCellGrouper.cpp @@ -10,7 +10,7 @@ InterpolationCellGrouper::InterpolationCellGrouper(const LBMSimulationParameters { } -void InterpolationCellGrouper::splitFineToCoarseIntoBorderAndBulk(uint level) +void InterpolationCellGrouper::splitFineToCoarseIntoBorderAndBulk(uint level) const { this->reorderFineToCoarseIntoBorderAndBulk(level); @@ -25,7 +25,7 @@ void InterpolationCellGrouper::splitFineToCoarseIntoBorderAndBulk(uint level) parDs[level]->offFCBulk.zOffFC = parDs[level]->offFC.zOffFC + parDs[level]->intFCBorder.kFC; } -void InterpolationCellGrouper::reorderFineToCoarseIntoBorderAndBulk(int level) +void InterpolationCellGrouper::reorderFineToCoarseIntoBorderAndBulk(int level) const { // create some local variables for better readability uint *iCellFccAll = parHs[level]->intFC.ICellFCC; @@ -88,7 +88,7 @@ void InterpolationCellGrouper::reorderFineToCoarseIntoBorderAndBulk(int level) } } -void InterpolationCellGrouper::splitCoarseToFineIntoBorderAndBulk(uint level) +void InterpolationCellGrouper::splitCoarseToFineIntoBorderAndBulk(uint level) const { this->reorderCoarseToFineIntoBorderAndBulk(level); @@ -103,7 +103,7 @@ void InterpolationCellGrouper::splitCoarseToFineIntoBorderAndBulk(uint level) parDs[level]->offCFBulk.zOffCF = parDs[level]->offCF.zOffCF + parDs[level]->intCFBorder.kCF; } -void InterpolationCellGrouper::reorderCoarseToFineIntoBorderAndBulk(int level) +void InterpolationCellGrouper::reorderCoarseToFineIntoBorderAndBulk(int level) const { // create some local variables for better readability uint *iCellCfcAll = parHs[level]->intCF.ICellCFC; diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/InterpolationCellGrouper.h b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/InterpolationCellGrouper.h index 34ed9f0e6cbf991e7480aa3bfd1d78afc27d5940..6a5480e920e487cdfd864fd99622e9f96b32fa37 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/InterpolationCellGrouper.h +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/InterpolationCellGrouper.h @@ -35,7 +35,7 @@ public: //! - the other cells which are not directly related to the communication between the two gpus --> "bulk" //! //! see [master thesis of Anna Wellmann (p. 62-68: "Ãœberdeckung der reduzierten Kommunikation")] - void splitCoarseToFineIntoBorderAndBulk(uint level); + void splitCoarseToFineIntoBorderAndBulk(uint level) const; //! \brief Split the interpolation cells from fine to coarse into border an bulk //! \details For communication hiding, the interpolation cells from the fine to the coarse grid need to be split @@ -46,7 +46,7 @@ public: //! - the other cells which are not directly related to the communication between the two gpus --> "bulk" //! //! See [master thesis of Anna Wellmann (p. 62-68: "Ãœberdeckung der reduzierten Kommunikation")] - void splitFineToCoarseIntoBorderAndBulk(uint level); + void splitFineToCoarseIntoBorderAndBulk(uint level) const; protected: ////////////////////////////////////////////////////////////////////////// @@ -57,13 +57,13 @@ protected: //! subarrays: \details The coarse cells for interpolation from coarse to fine (iCellCFC) are divided into two //! subgroups: border and bulk. The fine cells (iCellCFF) are reordered accordingly. The offset cells (xOffCF, //! yOffCF, zOffCF) must be reordered in the same way. - void reorderCoarseToFineIntoBorderAndBulk(int level); + void reorderCoarseToFineIntoBorderAndBulk(int level) const; //! \brief This function reorders the arrays of FCC/FCF indices and return pointers and sizes of the new subarrays: //! \details The coarse cells for interpolation from fine to coarse (iCellFCC) are divided into two subgroups: //! border and bulk. The fine cells (iCellFCF) are reordered accordingly. The offset cells (xOffFC, //! yOffFC, zOffFC) must be reordered in the same way. - void reorderFineToCoarseIntoBorderAndBulk(int level); + void reorderFineToCoarseIntoBorderAndBulk(int level) const; private: SPtr<GridBuilder> builder;