diff --git a/src/basics/basics/utilities/UbKeys.h b/src/basics/basics/utilities/UbKeys.h index 60dfbf56bffcf0569a85ded55a276e489deba322..56fb8839d0aa715a30972dfe15b17e7340de0a14 100644 --- a/src/basics/basics/utilities/UbKeys.h +++ b/src/basics/basics/utilities/UbKeys.h @@ -135,6 +135,8 @@ public: T1 getT1() const { return t1; } T2 getT2() const { return t2; } T3 getT3() const { return t3; } + + Key3(const Key3& other) : t1(other.t1), t2(other.t2), t3(other.t3) {} /*==========================================================*/ Key3 &operator=(const Key3 &srcKey) { diff --git a/src/gpu/GridGenerator/StreetPointFinder/JunctionReader.h b/src/gpu/GridGenerator/StreetPointFinder/JunctionReader.h index 7f17697625f7ef0b5e136ef073ea91840d0b10ec..dea2a6a91028bbde0aab876e871e12dbbdac40d9 100644 --- a/src/gpu/GridGenerator/StreetPointFinder/JunctionReader.h +++ b/src/gpu/GridGenerator/StreetPointFinder/JunctionReader.h @@ -1,4 +1,4 @@ -#ifndef JUNCTIOREADER_H +#ifndef JUNCTIONREADER_H #define JUNCTIONREADER_H #include <vector> diff --git a/src/gpu/GridGenerator/grid/BoundaryConditions/BoundaryCondition.h b/src/gpu/GridGenerator/grid/BoundaryConditions/BoundaryCondition.h index 95bc331d805351ec5d7f6ccd21651370ae5f3c72..dd3837e4d12b4064b4499c5d9cdca4d7ad84c643 100644 --- a/src/gpu/GridGenerator/grid/BoundaryConditions/BoundaryCondition.h +++ b/src/gpu/GridGenerator/grid/BoundaryConditions/BoundaryCondition.h @@ -16,6 +16,8 @@ enum class SideType; class BoundaryCondition { public: + virtual ~BoundaryCondition() = default; + std::vector<uint> indices; SPtr<Side> side; std::vector<std::vector<real> > qs; diff --git a/src/gpu/GridGenerator/grid/BoundaryConditions/Side.h b/src/gpu/GridGenerator/grid/BoundaryConditions/Side.h index 7e05d26a5e94d72c7087874bf029a041b0ae55fb..13522cf2e9802f8bb4ad5f02ef0ca87fa1a56336 100644 --- a/src/gpu/GridGenerator/grid/BoundaryConditions/Side.h +++ b/src/gpu/GridGenerator/grid/BoundaryConditions/Side.h @@ -28,6 +28,8 @@ enum class SideType class Side { public: + virtual ~Side() = default; + virtual void addIndices(std::vector<SPtr<Grid> > grid, uint level, SPtr<BoundaryCondition> boundaryCondition) = 0; virtual int getCoordinate() const = 0; diff --git a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp index aa9c219a8a25e6bab85369b3b25602452e6c165b..700ff5c137b00c3ad114e3b148f6ea7b0e9b8038 100644 --- a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp +++ b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp @@ -146,7 +146,7 @@ GRIDGENERATOR_EXPORT uint LevelGridBuilder::getCommunicationProcess(int directio void LevelGridBuilder::copyDataFromGpu() { - for (const auto grid : grids) + for (const auto& grid : grids) { auto gridGpuStrategy = std::dynamic_pointer_cast<GridGpuStrategy>(grid->getGridStrategy()); if(gridGpuStrategy) @@ -157,7 +157,7 @@ void LevelGridBuilder::copyDataFromGpu() LevelGridBuilder::~LevelGridBuilder() { - for (const auto grid : grids) + for (const auto& grid : grids) grid->freeMemory(); } @@ -171,7 +171,7 @@ void LevelGridBuilder::getGridInformations(std::vector<int>& gridX, std::vector< std::vector<int>& gridZ, std::vector<int>& distX, std::vector<int>& distY, std::vector<int>& distZ) { - for (const auto grid : grids) + for (const auto& grid : grids) { gridX.push_back(int(grid->getNumberOfNodesX())); gridY.push_back(int(grid->getNumberOfNodesY())); diff --git a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h index 252debf9b55b83a643b6eed5898ee6d8243d1d53..8bfb201c54689411a1c4ea56617f7f009dfb4b4f 100644 --- a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h +++ b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h @@ -56,30 +56,30 @@ public: GRIDGENERATOR_EXPORT virtual std::shared_ptr<Grid> getGrid(int level, int box); - GRIDGENERATOR_EXPORT virtual unsigned int getNumberOfNodes(unsigned int level) const; + GRIDGENERATOR_EXPORT virtual unsigned int getNumberOfNodes(unsigned int level) const override; GRIDGENERATOR_EXPORT virtual void getNodeValues(real *xCoords, real *yCoords, real *zCoords, uint *neighborX, uint *neighborY, uint *neighborZ, uint *neighborNegative, uint *geo, const int level) const override; - GRIDGENERATOR_EXPORT virtual void getDimensions(int &nx, int &ny, int &nz, const int level) const; + GRIDGENERATOR_EXPORT virtual void getDimensions(int &nx, int &ny, int &nz, const int level) const override; - GRIDGENERATOR_EXPORT uint getVelocitySize(int level) const; - GRIDGENERATOR_EXPORT virtual void getVelocityValues(real* vx, real* vy, real* vz, int* indices, int level) const; - GRIDGENERATOR_EXPORT virtual void getVelocityQs(real* qs[27], int level) const; + GRIDGENERATOR_EXPORT uint getVelocitySize(int level) const override; + GRIDGENERATOR_EXPORT virtual void getVelocityValues(real* vx, real* vy, real* vz, int* indices, int level) const override; + GRIDGENERATOR_EXPORT virtual void getVelocityQs(real* qs[27], int level) const override; GRIDGENERATOR_EXPORT uint getPressureSize(int level) const override; GRIDGENERATOR_EXPORT void getPressureValues(real* rho, int* indices, int* neighborIndices, int level) const override; - GRIDGENERATOR_EXPORT virtual void getPressureQs(real* qs[27], int level) const; + GRIDGENERATOR_EXPORT virtual void getPressureQs(real* qs[27], int level) const override; - GRIDGENERATOR_EXPORT virtual void getGeometryQs(real* qs[27], int level) const; - GRIDGENERATOR_EXPORT virtual uint getGeometrySize(int level) const; - GRIDGENERATOR_EXPORT virtual void getGeometryIndices(int* indices, int level) const; - GRIDGENERATOR_EXPORT virtual bool hasGeometryValues() const; - GRIDGENERATOR_EXPORT virtual void getGeometryValues(real* vx, real* vy, real* vz, int level) const; + GRIDGENERATOR_EXPORT virtual void getGeometryQs(real* qs[27], int level) const override; + GRIDGENERATOR_EXPORT virtual uint getGeometrySize(int level) const override; + GRIDGENERATOR_EXPORT virtual void getGeometryIndices(int* indices, int level) const override; + GRIDGENERATOR_EXPORT virtual bool hasGeometryValues() const override; + GRIDGENERATOR_EXPORT virtual void getGeometryValues(real* vx, real* vy, real* vz, int level) const override; - GRIDGENERATOR_EXPORT void writeArrows(std::string fileName) const; + GRIDGENERATOR_EXPORT void writeArrows(std::string fileName) const override; GRIDGENERATOR_EXPORT SPtr<BoundaryCondition> getBoundaryCondition( SideType side, uint level ) const override; GRIDGENERATOR_EXPORT SPtr<GeometryBoundaryCondition> getGeometryBoundaryCondition(uint level) const override; diff --git a/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.cpp b/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.cpp index c31d3090489a75a96451ca38f3ea6c15b8bed373..86d3c2b7142afd144c89a5b0f9247eac47125461 100644 --- a/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.cpp +++ b/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.cpp @@ -461,7 +461,7 @@ void MultipleGridBuilder::buildGrids( LbmOrGks lbmOrGks, bool enableThinWalls ) // Figure 5.2 in the Dissertation of Stephan Lenz: // https://publikationsserver.tu-braunschweig.de/receive/dbbs_mods_00068716 // - for( int level = grids.size()-1; level >= 0; level-- ){ + for( int level = grids.size()-1; level >= 0; level-- ) { *logging::out << logging::Logger::INFO_INTERMEDIATE << "Start initializing level " << level << "\n"; @@ -561,12 +561,12 @@ void MultipleGridBuilder::buildGrids( LbmOrGks lbmOrGks, bool enableThinWalls ) // => computes the sparse indices // => generates neighbor connectivity taking into account periodic boundaries // => undates the interface connectivity to sparse indices (overwrites matrix indices!) - if (lbmOrGks == LBM) { - for (size_t i = 0; i < grids.size() - 1; i++) - grids[i]->findSparseIndices(grids[i + 1]); + if (lbmOrGks == LBM) { + for (size_t i = 0; i < grids.size() - 1; i++) + grids[i]->findSparseIndices(grids[i + 1]); - grids[grids.size() - 1]->findSparseIndices(nullptr); - } + grids[grids.size() - 1]->findSparseIndices(nullptr); + } ////////////////////////////////////////////////////////////////////////// } diff --git a/src/gpu/GridGenerator/grid/GridImp.h b/src/gpu/GridGenerator/grid/GridImp.h index a708c2c3bcab14fd388bd5cca7cf452708dda8a4..6cb640682d3670e8b87e6db4e7f0535d8fc24e2f 100644 --- a/src/gpu/GridGenerator/grid/GridImp.h +++ b/src/gpu/GridGenerator/grid/GridImp.h @@ -21,11 +21,21 @@ class Object; class BoundingBox; class TriangularMeshDiscretizationStrategy; -#pragma push -#pragma diag_suppress = 3156 +#ifdef __GNUC__ + #ifndef __clang__ + #pragma push + #pragma diag_suppress = 3156 + #endif +#endif + // warning #3156-D: extern declaration of the entity DIRECTIONS is treated as a static definition extern CONSTANT int DIRECTIONS[DIR_END_MAX][DIMENSION]; -#pragma pop + +#ifdef __GNUC__ + #ifndef __clang__ + #pragma pop + #endif +#endif class GRIDGENERATOR_EXPORT GridImp : public enableSharedFromThis<GridImp>, public Grid { @@ -188,8 +198,8 @@ public: CUDA_HOST int getStartDirection() const override; CUDA_HOST int getEndDirection() const override; - HOSTDEVICE Vertex getMinimumOnNode(Vertex exact) const; - HOSTDEVICE Vertex getMaximumOnNode(Vertex exact) const; + HOSTDEVICE Vertex getMinimumOnNode(Vertex exact) const override; + HOSTDEVICE Vertex getMaximumOnNode(Vertex exact) const override; HOSTDEVICE real getStartX() const override; HOSTDEVICE real getStartY() const override; @@ -228,12 +238,12 @@ public: public: - CUDA_HOST virtual void findSparseIndices(SPtr<Grid> fineGrid); + CUDA_HOST virtual void findSparseIndices(SPtr<Grid> fineGrid) override; CUDA_HOST void updateSparseIndices(); HOSTDEVICE void setNeighborIndices(uint index); - HOSTDEVICE real getFirstFluidNode(real coords[3], int direction, real startCoord) const; - HOSTDEVICE real getLastFluidNode(real coords[3], int direction, real startCoord) const; + HOSTDEVICE real getFirstFluidNode(real coords[3], int direction, real startCoord) const override; + HOSTDEVICE real getLastFluidNode(real coords[3], int direction, real startCoord) const override; private: HOSTDEVICE void setStopperNeighborCoords(uint index); HOSTDEVICE void getNeighborCoords(real &neighborX, real &neighborY, real &neighborZ, real x, real y, real z) const; @@ -274,8 +284,8 @@ private: } qComputationStage; public: - CUDA_HOST void enableFindSolidBoundaryNodes(){ qComputationStage = qComputationStageType::FindSolidBoundaryNodes; } - CUDA_HOST void enableComputeQs(){ qComputationStage = qComputationStageType::ComputeQs; } + CUDA_HOST void enableFindSolidBoundaryNodes() override{ qComputationStage = qComputationStageType::FindSolidBoundaryNodes; } + CUDA_HOST void enableComputeQs() override{ qComputationStage = qComputationStageType::ComputeQs; } private: HOSTDEVICE void setDebugPoint(uint index, int pointValue); diff --git a/src/gpu/GridGenerator/utilities/transformator/TransformatorImp.h b/src/gpu/GridGenerator/utilities/transformator/TransformatorImp.h index 89e06699f9656aa300f8346a550a0ee673c99331..626abacaf1c75c406c7f8fbe830f86fa0d679adf 100644 --- a/src/gpu/GridGenerator/utilities/transformator/TransformatorImp.h +++ b/src/gpu/GridGenerator/utilities/transformator/TransformatorImp.h @@ -17,11 +17,17 @@ struct Vertex; class invalidDelta : public std::exception { - const char* what() const throw() { - std::ostringstream getNr; - getNr << "Delta cant be < Null. To enable no changes change delta to 1.0."; - return getNr.str().c_str(); + public: + invalidDelta() : error_message ("Delta cant be < Null. To enable no changes change delta to 1.0.") + {} + + const char* what() const noexcept + { + return error_message.c_str(); } + + private: + std::string error_message; }; class TransformatorImp @@ -34,12 +40,12 @@ public: GRIDGENERATOR_EXPORT TransformatorImp(real delta, real dx, real dy, real dz); GRIDGENERATOR_EXPORT virtual ~TransformatorImp(); - GRIDGENERATOR_EXPORT void transformWorldToGrid(Triangle &value) const; - GRIDGENERATOR_EXPORT void transformWorldToGrid(TriangularMesh &geom) const; - GRIDGENERATOR_EXPORT void transformWorldToGrid(Vertex &value) const; + GRIDGENERATOR_EXPORT void transformWorldToGrid(Triangle &value) const override; + GRIDGENERATOR_EXPORT void transformWorldToGrid(TriangularMesh &geom) const override; + GRIDGENERATOR_EXPORT void transformWorldToGrid(Vertex &value) const override; - GRIDGENERATOR_EXPORT void transformGridToWorld(Triangle &t) const; - GRIDGENERATOR_EXPORT void transformGridToWorld(Vertex &value) const; + GRIDGENERATOR_EXPORT void transformGridToWorld(Triangle &t) const override; + GRIDGENERATOR_EXPORT void transformGridToWorld(Vertex &value) const override; GRIDGENERATOR_EXPORT void transformGridToWorld(BoundingBox &box) const override; GRIDGENERATOR_EXPORT void transformWorldToGrid(BoundingBox &box) const override; diff --git a/src/gpu/VirtualFluids_GPU/Calculation/Cp.cpp b/src/gpu/VirtualFluids_GPU/Calculation/Cp.cpp index 5c9d40c96735b8b7e4ac159ac0bdb221e0e6c304..29887e025c2cff9f7faaf53b8984bc6990cfdfd4 100644 --- a/src/gpu/VirtualFluids_GPU/Calculation/Cp.cpp +++ b/src/gpu/VirtualFluids_GPU/Calculation/Cp.cpp @@ -390,168 +390,154 @@ extern "C" void printGeoFile(Parameter* para, bool fileFormat) } ////////////////////////////////////////////////////////////////////////// - switch (fileFormat) - { - case 0: //ASCII - { - ////////////////////////////////////////////////////////////////////////// - //set ofstream - ofstream ostr; - std::ostringstream temp1; - std::ostringstream temp2; - std::ostringstream temp3; - ////////////////////////////////////////////////////////////////////////// - //open file - ostr.open(fname); - ////////////////////////////////////////////////////////////////////////// - ostr << "This geometry File was written by VirtualFluidsGPU\n"; - ostr << "#### Casefile written by VirtualFluidsGPU\n"; - ////////////////////////////////////////////////////////////////////////// - ostr << "node id assign \n"; - ostr << "element id assign \n"; - ////////////////////////////////////////////////////////////////////////// - ostr << "part \n \t 1 \n"; - ostr << fnameGeo << "\n"; - ostr << "coordinates \n \t" << non << "\n"; - ////////////////////////////////////////////////////////////////////////// - // X - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) - { - if (para->getParH(lev)->isOutsideInterface[i]) - { - ostr << (para->getParH(lev)->coordX_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(0) + para->getTranslateLBMtoSI().at(0)) << std::endl; - } - } - } - ////////////////////////////////////////////////////////////////////////// - // Y - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) - { - if (para->getParH(lev)->isOutsideInterface[i]) - { - ostr << (para->getParH(lev)->coordY_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(1) + para->getTranslateLBMtoSI().at(1)) << std::endl; - } - } - } - ////////////////////////////////////////////////////////////////////////// - // Z - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) - { - if (para->getParH(lev)->isOutsideInterface[i]) - { - ostr << (para->getParH(lev)->coordZ_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(2) + para->getTranslateLBMtoSI().at(2)) << std::endl; - } - } - } - ////////////////////////////////////////////////////////////////////////// - ostr << "point \n \t" << non << "\n"; - ////////////////////////////////////////////////////////////////////////// - unsigned int j = 0; - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - for (size_t i = 0; i < para->getParH(lev)->numberOfPointsPressWindow; i++) - { - j++; - ostr << j << "\n"; - } - } - ////////////////////////////////////////////////////////////////////////// - //close file - ostr.close(); - ////////////////////////////////////////////////////////////////////////// - break; - ////////////////////////////////////////////////////////////////////////// - } - - case 1: //Binary: - { - int tempX = 0; - ////////////////////////////////////////////////////////////////////////// - std::ofstream ostr; - ostr.open(fname, std::ios::out | std::ios::binary); - assert(ostr.is_open()); - ////////////////////////////////////////////////////////////////////////// - float tempCoord = 0.0f; - ////////////////////////////////////////////////////////////////////////// - writeStringToFile("C Binary", ostr); - writeStringToFile("This geometry File was written by VirtualFluidsGPU", ostr); - writeStringToFile("#### Casefile written by VirtualFluidsGPU", ostr); - writeStringToFile("node id assign", ostr); - writeStringToFile("element id assign", ostr); - writeStringToFile("part", ostr); - writeIntToFile(1, ostr); - writeStringToFile(fnameGeo, ostr); - writeStringToFile("coordinates", ostr); - writeIntToFile(non, ostr); - ////////////////////////////////////////////////////////////////////////// - // X - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) - { - if (para->getParH(lev)->isOutsideInterface[i]) - { - tempCoord = (para->getParH(lev)->coordX_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(0) + para->getTranslateLBMtoSI().at(0)); - writeFloatToFile(tempCoord, ostr); - tempX++; - } - } - //std::cout << "tempX in geo: " << tempX << endl; - } - ////////////////////////////////////////////////////////////////////////// - // Y - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) - { - if (para->getParH(lev)->isOutsideInterface[i]) - { - tempCoord = (para->getParH(lev)->coordY_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(1) + para->getTranslateLBMtoSI().at(1)); - writeFloatToFile(tempCoord, ostr); - } - } - } - ////////////////////////////////////////////////////////////////////////// - // Z - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) - { - if (para->getParH(lev)->isOutsideInterface[i]) - { - tempCoord = (para->getParH(lev)->coordZ_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(2) + para->getTranslateLBMtoSI().at(2)); - writeFloatToFile(tempCoord, ostr); - } - } - } - ////////////////////////////////////////////////////////////////////////// - writeStringToFile("point", ostr); - writeIntToFile(non, ostr); - ////////////////////////////////////////////////////////////////////////// - unsigned int j = 0; - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - for (size_t i = 0; i < para->getParH(lev)->numberOfPointsPressWindow; i++) - { - j++; - writeIntToFile(j, ostr); - } - //std::cout << "level: " << lev << ", numberOfPointsPressWindow:" << para->getParH(lev)->numberOfPointsPressWindow << endl; - } - ////////////////////////////////////////////////////////////////////////// - //close file - ostr.close(); - ////////////////////////////////////////////////////////////////////////// - break; - ////////////////////////////////////////////////////////////////////////// - } - } + if (!fileFormat) //ASCII + { + ////////////////////////////////////////////////////////////////////////// + //set ofstream + ofstream ostr; + std::ostringstream temp1; + std::ostringstream temp2; + std::ostringstream temp3; + ////////////////////////////////////////////////////////////////////////// + //open file + ostr.open(fname); + ////////////////////////////////////////////////////////////////////////// + ostr << "This geometry File was written by VirtualFluidsGPU\n"; + ostr << "#### Casefile written by VirtualFluidsGPU\n"; + ////////////////////////////////////////////////////////////////////////// + ostr << "node id assign \n"; + ostr << "element id assign \n"; + ////////////////////////////////////////////////////////////////////////// + ostr << "part \n \t 1 \n"; + ostr << fnameGeo << "\n"; + ostr << "coordinates \n \t" << non << "\n"; + ////////////////////////////////////////////////////////////////////////// + // X + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) + { + if (para->getParH(lev)->isOutsideInterface[i]) + { + ostr << (para->getParH(lev)->coordX_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(0) + para->getTranslateLBMtoSI().at(0)) << std::endl; + } + } + } + ////////////////////////////////////////////////////////////////////////// + // Y + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) + { + if (para->getParH(lev)->isOutsideInterface[i]) + { + ostr << (para->getParH(lev)->coordY_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(1) + para->getTranslateLBMtoSI().at(1)) << std::endl; + } + } + } + ////////////////////////////////////////////////////////////////////////// + // Z + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) + { + if (para->getParH(lev)->isOutsideInterface[i]) + { + ostr << (para->getParH(lev)->coordZ_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(2) + para->getTranslateLBMtoSI().at(2)) << std::endl; + } + } + } + ////////////////////////////////////////////////////////////////////////// + ostr << "point \n \t" << non << "\n"; + ////////////////////////////////////////////////////////////////////////// + unsigned int j = 0; + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + for (size_t i = 0; i < para->getParH(lev)->numberOfPointsPressWindow; i++) + { + j++; + ostr << j << "\n"; + } + } + ostr.close(); + } + else //Binary: + { + int tempX = 0; + ////////////////////////////////////////////////////////////////////////// + std::ofstream ostr; + ostr.open(fname, std::ios::out | std::ios::binary); + assert(ostr.is_open()); + ////////////////////////////////////////////////////////////////////////// + float tempCoord = 0.0f; + ////////////////////////////////////////////////////////////////////////// + writeStringToFile("C Binary", ostr); + writeStringToFile("This geometry File was written by VirtualFluidsGPU", ostr); + writeStringToFile("#### Casefile written by VirtualFluidsGPU", ostr); + writeStringToFile("node id assign", ostr); + writeStringToFile("element id assign", ostr); + writeStringToFile("part", ostr); + writeIntToFile(1, ostr); + writeStringToFile(fnameGeo, ostr); + writeStringToFile("coordinates", ostr); + writeIntToFile(non, ostr); + ////////////////////////////////////////////////////////////////////////// + // X + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) + { + if (para->getParH(lev)->isOutsideInterface[i]) + { + tempCoord = (para->getParH(lev)->coordX_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(0) + para->getTranslateLBMtoSI().at(0)); + writeFloatToFile(tempCoord, ostr); + tempX++; + } + } + //std::cout << "tempX in geo: " << tempX << endl; + } + ////////////////////////////////////////////////////////////////////////// + // Y + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) + { + if (para->getParH(lev)->isOutsideInterface[i]) + { + tempCoord = (para->getParH(lev)->coordY_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(1) + para->getTranslateLBMtoSI().at(1)); + writeFloatToFile(tempCoord, ostr); + } + } + } + ////////////////////////////////////////////////////////////////////////// + // Z + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + for (unsigned int i = 0; i < para->getParH(lev)->numberOfPointsCpTop; i++) + { + if (para->getParH(lev)->isOutsideInterface[i]) + { + tempCoord = (para->getParH(lev)->coordZ_SP[para->getParH(lev)->cpTopIndex[i]] * para->getScaleLBMtoSI().at(2) + para->getTranslateLBMtoSI().at(2)); + writeFloatToFile(tempCoord, ostr); + } + } + } + ////////////////////////////////////////////////////////////////////////// + writeStringToFile("point", ostr); + writeIntToFile(non, ostr); + ////////////////////////////////////////////////////////////////////////// + unsigned int j = 0; + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + for (size_t i = 0; i < para->getParH(lev)->numberOfPointsPressWindow; i++) + { + j++; + writeIntToFile(j, ostr); + } + //std::cout << "level: " << lev << ", numberOfPointsPressWindow:" << para->getParH(lev)->numberOfPointsPressWindow << endl; + } + ostr.close(); + } } @@ -574,76 +560,56 @@ extern "C" void printScalars(Parameter* para, bool fileFormat) size_t endlevel = para->getMaxLevel(); ////////////////////////////////////////////////////////////////////////// - - switch (fileFormat) + if (!fileFormat) //ASCII { - case 0: //ASCII - { - ////////////////////////////////////////////////////////////////////////// - //set ofstream - ofstream ostr; - ////////////////////////////////////////////////////////////////////////// - //open file - ostr.open(fname); - ////////////////////////////////////////////////////////////////////////// - ostr << fnameScalar << " \n"; - ostr << "part \n\t 1 \n"; - ostr << "point\n"; - ////////////////////////////////////////////////////////////////////////// - //fill file with data - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - for (vector<double>::const_iterator i = para->getParH(lev)->pressMirror.begin(); i != para->getParH(lev)->pressMirror.end(); ++i) - { - ostr << *i << "\n"; - } - } - ////////////////////////////////////////////////////////////////////////// - //close file - ostr.close(); - ////////////////////////////////////////////////////////////////////////// - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - para->getParH(lev)->pressMirror.clear(); - } - ////////////////////////////////////////////////////////////////////////// - break; - ////////////////////////////////////////////////////////////////////////// - } - - case 1: //Binary: - { - ////////////////////////////////////////////////////////////////////////// - std::ofstream ostr; - ostr.open(fname, std::ios::out | std::ios::binary); - assert(ostr.is_open()); - ////////////////////////////////////////////////////////////////////////// - writeStringToFile(fnameScalar, ostr); - writeStringToFile("part", ostr); - writeIntToFile(1, ostr); - writeStringToFile("point", ostr); - ////////////////////////////////////////////////////////////////////////// - //fill file with data - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - for (vector<double>::const_iterator i = para->getParH(lev)->pressMirror.begin(); i != para->getParH(lev)->pressMirror.end(); ++i) - { - writeFloatToFile(*i, ostr); - } - } - ////////////////////////////////////////////////////////////////////////// - //close file - ostr.close(); - ////////////////////////////////////////////////////////////////////////// - for (size_t lev = startlevel; lev <= endlevel; lev++) - { - para->getParH(lev)->pressMirror.clear(); - } - ////////////////////////////////////////////////////////////////////////// - break; - ////////////////////////////////////////////////////////////////////////// - } - } + ofstream ostr; + ostr.open(fname); + ////////////////////////////////////////////////////////////////////////// + ostr << fnameScalar << " \n"; + ostr << "part \n\t 1 \n"; + ostr << "point\n"; + ////////////////////////////////////////////////////////////////////////// + //fill file with data + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + for (vector<double>::const_iterator i = para->getParH(lev)->pressMirror.begin(); i != para->getParH(lev)->pressMirror.end(); ++i) + { + ostr << *i << "\n"; + } + } + ostr.close(); + ////////////////////////////////////////////////////////////////////////// + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + para->getParH(lev)->pressMirror.clear(); + } + } + else //Binary: + { + std::ofstream ostr; + ostr.open(fname, std::ios::out | std::ios::binary); + assert(ostr.is_open()); + ////////////////////////////////////////////////////////////////////////// + writeStringToFile(fnameScalar, ostr); + writeStringToFile("part", ostr); + writeIntToFile(1, ostr); + writeStringToFile("point", ostr); + ////////////////////////////////////////////////////////////////////////// + //fill file with data + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + for (vector<double>::const_iterator i = para->getParH(lev)->pressMirror.begin(); i != para->getParH(lev)->pressMirror.end(); ++i) + { + writeFloatToFile(*i, ostr); + } + } + ostr.close(); + ////////////////////////////////////////////////////////////////////////// + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + para->getParH(lev)->pressMirror.clear(); + } + } } diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.h b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.h index 1a6eed430539e222302ef3921a2ebcc40ff3cb60..aafe0d1cb732af656fe861e7cab93af4e0ae078b 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.h +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.h @@ -29,19 +29,19 @@ private: public: GridReader(FILEFORMAT format, std::shared_ptr<Parameter> para, std::shared_ptr<CudaMemoryManager> cudaManager); ~GridReader(); - void allocArrays_CoordNeighborGeo()override; - void allocArrays_BoundaryValues()override; + void allocArrays_CoordNeighborGeo() override; + void allocArrays_BoundaryValues() override; void allocArrays_OffsetScale() override; void initalValuesDomainDecompostion(int level); void setChannelBoundaryCondition(); - void allocArrays_BoundaryQs()override; + void allocArrays_BoundaryQs() override; bool getBinaer(); - void setDimensions(); - void setBoundingBox(); - void initPeriodicNeigh(std::vector<std::vector<std::vector<unsigned int> > > periodV, std::vector<std::vector<unsigned int> > periodIndex, std::string way); + void setDimensions() override; + void setBoundingBox() override; + void initPeriodicNeigh(std::vector<std::vector<std::vector<unsigned int> > > periodV, std::vector<std::vector<unsigned int> > periodIndex, std::string way) override; private: void makeReader(std::shared_ptr<Parameter> para); diff --git a/src/gpu/VirtualFluids_GPU/FindInterface/FindInterface.cpp b/src/gpu/VirtualFluids_GPU/FindInterface/FindInterface.cpp index 460e46fddf10807a0bdb1018200633a1b3940a3f..ec435f0647ba973dbb405aefad069b285e09d6b5 100644 --- a/src/gpu/VirtualFluids_GPU/FindInterface/FindInterface.cpp +++ b/src/gpu/VirtualFluids_GPU/FindInterface/FindInterface.cpp @@ -1647,17 +1647,17 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, jC = CF_Coarse[ INTERFACE_N]; jF = CF_Fine[ INTERFACE_N]; hC = CF_Coarse[ INTERFACE_T]; hF = CF_Fine[ INTERFACE_T]; - if ((needInterface[INTERFACE_E]==false)) + if (needInterface[INTERFACE_E]==false) { iC = CF_NCoarse[INTERFACE_E]; iF = CF_NFine[INTERFACE_E]; xOff = (real)0.5f; } - if ((needInterface[INTERFACE_N]==false)) + if (needInterface[INTERFACE_N]==false) { jC = CF_NCoarse[INTERFACE_N]; jF = CF_NFine[INTERFACE_N]; yOff = (real)0.5f; } - if ((needInterface[INTERFACE_T]==false)) + if (needInterface[INTERFACE_T]==false) { hC = CF_NCoarse[INTERFACE_T]; hF = CF_NFine[INTERFACE_T]; zOff = (real)0.5f; @@ -1698,7 +1698,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; - if ((needInterface[INTERFACE_E]==false)) + if (needInterface[INTERFACE_E]==false) { iC = FC_NCoarse[INTERFACE_E]; iF = FC_NFine[INTERFACE_E]; jC = FC_Coarse[ INTERFACE_N]; jF = FC_Fine[ INTERFACE_N]; @@ -1713,7 +1713,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_N]==false)) + if (needInterface[INTERFACE_N]==false) { iC = FC_Coarse[ INTERFACE_E]; iF = FC_Fine[ INTERFACE_E]; jC = FC_NCoarse[INTERFACE_N]; jF = FC_NFine[INTERFACE_N]; @@ -1728,7 +1728,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_T]==false)) + if (needInterface[INTERFACE_T]==false) { iC = FC_Coarse[ INTERFACE_E]; iF = FC_Fine[ INTERFACE_E]; jC = FC_Coarse[ INTERFACE_N]; jF = FC_Fine[ INTERFACE_N]; @@ -1804,17 +1804,17 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, jC = CF_Coarse[ INTERFACE_N]; jF = CF_Fine[ INTERFACE_N]; hC = CF_Coarse[ INTERFACE_B]; hF = CF_Fine[ INTERFACE_B]; - if ((needInterface[INTERFACE_E]==false)) + if (needInterface[INTERFACE_E]==false) { iC = CF_NCoarse[INTERFACE_E]; iF = CF_NFine[INTERFACE_E]; xOff = (real)0.5f; } - if ((needInterface[INTERFACE_N]==false)) + if (needInterface[INTERFACE_N]==false) { jC = CF_NCoarse[INTERFACE_N]; jF = CF_NFine[INTERFACE_N]; yOff = (real)0.5f; } - if ((needInterface[INTERFACE_B]==false)) + if (needInterface[INTERFACE_B]==false) { hC = CF_NCoarse[INTERFACE_B]; hF = CF_NFine[INTERFACE_B]; zOff = (real)-0.5f; @@ -1855,7 +1855,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; - if ((needInterface[INTERFACE_E]==false)) + if (needInterface[INTERFACE_E]==false) { iC = FC_NCoarse[INTERFACE_E]; iF = FC_NFine[INTERFACE_E]; jC = FC_Coarse[ INTERFACE_N]; jF = FC_Fine[ INTERFACE_N]; @@ -1870,7 +1870,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_N]==false)) + if (needInterface[INTERFACE_N]==false) { iC = FC_Coarse[ INTERFACE_E]; iF = FC_Fine[ INTERFACE_E]; jC = FC_NCoarse[INTERFACE_N]; jF = FC_NFine[INTERFACE_N]; @@ -1885,7 +1885,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_B]==false)) + if (needInterface[INTERFACE_B]==false) { iC = FC_Coarse[ INTERFACE_E]; iF = FC_Fine[ INTERFACE_E]; jC = FC_Coarse[ INTERFACE_N]; jF = FC_Fine[ INTERFACE_N]; @@ -1961,17 +1961,17 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, jC = CF_Coarse[ INTERFACE_S]; jF = CF_Fine[ INTERFACE_S]; hC = CF_Coarse[ INTERFACE_T]; hF = CF_Fine[ INTERFACE_T]; - if ((needInterface[INTERFACE_E]==false)) + if (needInterface[INTERFACE_E]==false) { iC = CF_NCoarse[INTERFACE_E]; iF = CF_NFine[INTERFACE_E]; xOff = (real)0.5f; } - if ((needInterface[INTERFACE_S]==false)) + if (needInterface[INTERFACE_S]==false) { jC = CF_NCoarse[INTERFACE_S]; jF = CF_NFine[INTERFACE_S]; yOff = (real)-0.5f; } - if ((needInterface[INTERFACE_T]==false)) + if (needInterface[INTERFACE_T]==false) { hC = CF_NCoarse[INTERFACE_T]; hF = CF_NFine[INTERFACE_T]; zOff = (real)0.5f; @@ -2012,7 +2012,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; - if ((needInterface[INTERFACE_E]==false)) + if (needInterface[INTERFACE_E]==false) { iC = FC_NCoarse[INTERFACE_E]; iF = FC_NFine[INTERFACE_E]; jC = FC_Coarse[ INTERFACE_S]; jF = FC_Fine[ INTERFACE_S]; @@ -2027,7 +2027,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_S]==false)) + if (needInterface[INTERFACE_S]==false) { iC = FC_Coarse[ INTERFACE_E]; iF = FC_Fine[ INTERFACE_E]; jC = FC_NCoarse[INTERFACE_S]; jF = FC_NFine[INTERFACE_S]; @@ -2042,7 +2042,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_T]==false)) + if (needInterface[INTERFACE_T]==false) { iC = FC_Coarse[ INTERFACE_E]; iF = FC_Fine[ INTERFACE_E]; jC = FC_Coarse[ INTERFACE_S]; jF = FC_Fine[ INTERFACE_S]; @@ -2118,17 +2118,17 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, jC = CF_Coarse[ INTERFACE_S]; jF = CF_Fine[ INTERFACE_S]; hC = CF_Coarse[ INTERFACE_B]; hF = CF_Fine[ INTERFACE_B]; - if ((needInterface[INTERFACE_E]==false)) + if (needInterface[INTERFACE_E]==false) { iC = CF_NCoarse[INTERFACE_E]; iF = CF_NFine[INTERFACE_E]; xOff = (real)0.5f; } - if ((needInterface[INTERFACE_S]==false)) + if (needInterface[INTERFACE_S]==false) { jC = CF_NCoarse[INTERFACE_S]; jF = CF_NFine[INTERFACE_S]; yOff = (real)-0.5f; } - if ((needInterface[INTERFACE_B]==false)) + if (needInterface[INTERFACE_B]==false) { hC = CF_NCoarse[INTERFACE_B]; hF = CF_NFine[INTERFACE_B]; zOff = (real)-0.5f; @@ -2169,7 +2169,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; - if ((needInterface[INTERFACE_E]==false)) + if (needInterface[INTERFACE_E]==false) { iC = FC_NCoarse[INTERFACE_E]; iF = FC_NFine[INTERFACE_E]; jC = FC_Coarse[ INTERFACE_S]; jF = FC_Fine[ INTERFACE_S]; @@ -2184,7 +2184,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_S]==false)) + if (needInterface[INTERFACE_S]==false) { iC = FC_Coarse[ INTERFACE_E]; iF = FC_Fine[ INTERFACE_E]; jC = FC_NCoarse[INTERFACE_S]; jF = FC_NFine[INTERFACE_S]; @@ -2199,7 +2199,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_B]==false)) + if (needInterface[INTERFACE_B]==false) { iC = FC_Coarse[ INTERFACE_E]; iF = FC_Fine[ INTERFACE_E]; jC = FC_Coarse[ INTERFACE_S]; jF = FC_Fine[ INTERFACE_S]; @@ -2275,17 +2275,17 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, jC = CF_Coarse[ INTERFACE_N]; jF = CF_Fine[ INTERFACE_N]; hC = CF_Coarse[ INTERFACE_T]; hF = CF_Fine[ INTERFACE_T]; - if ((needInterface[INTERFACE_W]==false)) + if (needInterface[INTERFACE_W]==false) { iC = CF_NCoarse[INTERFACE_W]; iF = CF_NFine[INTERFACE_W]; xOff = (real)-0.5f; } - if ((needInterface[INTERFACE_N]==false)) + if (needInterface[INTERFACE_N]==false) { jC = CF_NCoarse[INTERFACE_N]; jF = CF_NFine[INTERFACE_N]; yOff = (real)0.5f; } - if ((needInterface[INTERFACE_T]==false)) + if (needInterface[INTERFACE_T]==false) { hC = CF_NCoarse[INTERFACE_T]; hF = CF_NFine[INTERFACE_T]; zOff = (real)0.5f; @@ -2326,7 +2326,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; - if ((needInterface[INTERFACE_W]==false)) + if (needInterface[INTERFACE_W]==false) { iC = FC_NCoarse[INTERFACE_W]; iF = FC_NFine[INTERFACE_W]; jC = FC_Coarse[ INTERFACE_N]; jF = FC_Fine[ INTERFACE_N]; @@ -2341,7 +2341,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_N]==false)) + if (needInterface[INTERFACE_N]==false) { iC = FC_Coarse[ INTERFACE_W]; iF = FC_Fine[ INTERFACE_W]; jC = FC_NCoarse[INTERFACE_N]; jF = FC_NFine[INTERFACE_N]; @@ -2356,7 +2356,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_T]==false)) + if (needInterface[INTERFACE_T]==false) { iC = FC_Coarse[ INTERFACE_W]; iF = FC_Fine[ INTERFACE_W]; jC = FC_Coarse[ INTERFACE_N]; jF = FC_Fine[ INTERFACE_N]; @@ -2432,17 +2432,17 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, jC = CF_Coarse[ INTERFACE_N]; jF = CF_Fine[ INTERFACE_N]; hC = CF_Coarse[ INTERFACE_B]; hF = CF_Fine[ INTERFACE_B]; - if ((needInterface[INTERFACE_W]==false)) + if (needInterface[INTERFACE_W]==false) { iC = CF_NCoarse[INTERFACE_W]; iF = CF_NFine[INTERFACE_W]; xOff = (real)-0.5f; } - if ((needInterface[INTERFACE_N]==false)) + if (needInterface[INTERFACE_N]==false) { jC = CF_NCoarse[INTERFACE_N]; jF = CF_NFine[INTERFACE_N]; yOff = (real)0.5f; } - if ((needInterface[INTERFACE_B]==false)) + if (needInterface[INTERFACE_B]==false) { hC = CF_NCoarse[INTERFACE_B]; hF = CF_NFine[INTERFACE_B]; zOff = (real)-0.5f; @@ -2483,7 +2483,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; - if ((needInterface[INTERFACE_W]==false)) + if (needInterface[INTERFACE_W]==false) { iC = FC_NCoarse[INTERFACE_W]; iF = FC_NFine[INTERFACE_W]; jC = FC_Coarse[ INTERFACE_N]; jF = FC_Fine[ INTERFACE_N]; @@ -2498,7 +2498,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_N]==false)) + if (needInterface[INTERFACE_N]==false) { iC = FC_Coarse[ INTERFACE_W]; iF = FC_Fine[ INTERFACE_W]; jC = FC_NCoarse[INTERFACE_N]; jF = FC_NFine[INTERFACE_N]; @@ -2513,7 +2513,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_B]==false)) + if (needInterface[INTERFACE_B]==false) { iC = FC_Coarse[ INTERFACE_W]; iF = FC_Fine[ INTERFACE_W]; jC = FC_Coarse[ INTERFACE_N]; jF = FC_Fine[ INTERFACE_N]; @@ -2640,7 +2640,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; - if ((needInterface[INTERFACE_W]==false)) + if (needInterface[INTERFACE_W]==false) { iC = FC_NCoarse[INTERFACE_W]; iF = FC_NFine[INTERFACE_W]; jC = FC_Coarse[ INTERFACE_S]; jF = FC_Fine[ INTERFACE_S]; @@ -2655,7 +2655,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; } - if ((needInterface[INTERFACE_S]==false)) + if (needInterface[INTERFACE_S]==false) { iC = FC_Coarse[ INTERFACE_W]; iF = FC_Fine[ INTERFACE_W]; jC = FC_NCoarse[INTERFACE_S]; jF = FC_NFine[INTERFACE_S]; @@ -2746,17 +2746,17 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, jC = CF_Coarse[ INTERFACE_S]; jF = CF_Fine[ INTERFACE_S]; hC = CF_Coarse[ INTERFACE_B]; hF = CF_Fine[ INTERFACE_B]; - if ((needInterface[INTERFACE_W]==false)) + if (needInterface[INTERFACE_W]==false) { iC = CF_NCoarse[INTERFACE_W]; iF = CF_NFine[INTERFACE_W]; xOff = (real)-0.5f; } - if ((needInterface[INTERFACE_S]==false)) + if (needInterface[INTERFACE_S]==false) { jC = CF_NCoarse[INTERFACE_S]; jF = CF_NFine[INTERFACE_S]; yOff = (real)-0.5f; } - if ((needInterface[INTERFACE_B]==false)) + if (needInterface[INTERFACE_B]==false) { hC = CF_NCoarse[INTERFACE_B]; hF = CF_NFine[INTERFACE_B]; zOff = (real)-0.5f; @@ -2797,7 +2797,7 @@ void interpolation(InterpolationCellCF &intCF, InterpolationCellFC &intFC, offFC.zOffFC[intFC.kFC] = zOff; intFC.kFC++; - if ((needInterface[INTERFACE_W]==false)) + if (needInterface[INTERFACE_W]==false) { iC = FC_NCoarse[INTERFACE_W]; iF = FC_NFine[INTERFACE_W]; jC = FC_Coarse[ INTERFACE_S]; jF = FC_Fine[ INTERFACE_S]; diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/ADKernelMapper.h b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/ADKernelMapper.h index 814736fc4137fb6a74d56d905d723ca8b64d44d3..14c1b6ceac9edcfd1164763023be08b0db0220e0 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/ADKernelMapper.h +++ b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/ADKernelMapper.h @@ -1,4 +1,4 @@ -#ifndef AD_KERNEL_MAPPPER_H +#ifndef AD_KERNEL_MAPPER_H #define AD_KERNEL_MAPPER_H #include "Utilities/EnumMapper/EnumMapperImp.h"