diff --git a/apps/cpu/CouetteFlow/CMakeLists.txt b/apps/cpu/CouetteFlow/CMakeLists.txt index 45293b4e29785937d8788d533ad14159fddab525..56931592d831ded425580f40af35e5f4c4a7c1c2 100644 --- a/apps/cpu/CouetteFlow/CMakeLists.txt +++ b/apps/cpu/CouetteFlow/CMakeLists.txt @@ -1,10 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) - ######################################################## ## C++ PROJECT ### ######################################################## PROJECT(CouetteFlow) -INCLUDE(${APPS_ROOT_CPU}/IncludsList.cmake) - -vf_add_library(BUILDTYPE binary DEPENDS VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES cflow.cpp ) \ No newline at end of file +vf_add_library(BUILDTYPE binary PRIVATE_LINK VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES cflow.cpp ) \ No newline at end of file diff --git a/apps/cpu/FlowAroundCylinder/CMakeLists.txt b/apps/cpu/FlowAroundCylinder/CMakeLists.txt index 54397d6b4896a0caa26ced1b8b11b918e11ef0e1..7bd09c7189fdf892e76816f8fba4ba95bf3f0867 100644 --- a/apps/cpu/FlowAroundCylinder/CMakeLists.txt +++ b/apps/cpu/FlowAroundCylinder/CMakeLists.txt @@ -1,10 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) - ######################################################## ## C++ PROJECT ### ######################################################## PROJECT(cylinder) -INCLUDE(${APPS_ROOT_CPU}/IncludsList.cmake) - -vf_add_library(BUILDTYPE binary DEPENDS VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES cylinder.cpp ) +vf_add_library(BUILDTYPE binary PRIVATE_LINK VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES cylinder.cpp ) diff --git a/apps/cpu/HerschelBulkleyModel/CMakeLists.txt b/apps/cpu/HerschelBulkleyModel/CMakeLists.txt index 323d1e24ab308f0090f2849dcc9f216b5658c567..fe04d5c61fdbf66fb1ab0966745301330ad0866e 100644 --- a/apps/cpu/HerschelBulkleyModel/CMakeLists.txt +++ b/apps/cpu/HerschelBulkleyModel/CMakeLists.txt @@ -1,10 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) - ######################################################## ## C++ PROJECT ### ######################################################## PROJECT(HerschelBulkleyModel) -INCLUDE(${APPS_ROOT_CPU}/IncludsList.cmake) - -vf_add_library(BUILDTYPE binary DEPENDS VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES hbflow.cpp ) \ No newline at end of file +vf_add_library(BUILDTYPE binary PRIVATE_LINK VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES hbflow.cpp ) \ No newline at end of file diff --git a/apps/cpu/HerschelBulkleySphere/CMakeLists.txt b/apps/cpu/HerschelBulkleySphere/CMakeLists.txt index 1f0641fa5992f811dd3f6f7ce5e0a827c46aaa24..6902b6c6cca28ff3dccd765d9e16dd5e92a772bd 100644 --- a/apps/cpu/HerschelBulkleySphere/CMakeLists.txt +++ b/apps/cpu/HerschelBulkleySphere/CMakeLists.txt @@ -1,10 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) - ######################################################## ## C++ PROJECT ### ######################################################## PROJECT(HerschelBulkleySphere) -INCLUDE(${APPS_ROOT_CPU}/IncludsList.cmake) - -vf_add_library(BUILDTYPE binary DEPENDS VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES hbsphere.cpp ) \ No newline at end of file +vf_add_library(BUILDTYPE binary PRIVATE_LINK VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES hbsphere.cpp ) \ No newline at end of file diff --git a/apps/cpu/rheometer/CMakeLists.txt b/apps/cpu/rheometer/CMakeLists.txt index 66f007ecc6a0c33aa9bf17bed0f6fd171ac1e045..d8a534096569e7c70ad4db41e0bb72decfcc5a8c 100644 --- a/apps/cpu/rheometer/CMakeLists.txt +++ b/apps/cpu/rheometer/CMakeLists.txt @@ -1,10 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) - ######################################################## ## C++ PROJECT ### ######################################################## PROJECT(rheometer) -INCLUDE(${APPS_ROOT_CPU}/IncludsList.cmake) - -vf_add_library(BUILDTYPE binary DEPENDS VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES rheometer.cpp ) \ No newline at end of file +vf_add_library(BUILDTYPE binary PRIVATE_LINK VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES rheometer.cpp ) \ No newline at end of file diff --git a/apps/cpu/sphere/CMakeLists.txt b/apps/cpu/sphere/CMakeLists.txt index 022df23ea789b9a5c62be699c9b3119ef33d8a4b..d80737cdd94aa0b912a62acd69dcd30372f6fd82 100644 --- a/apps/cpu/sphere/CMakeLists.txt +++ b/apps/cpu/sphere/CMakeLists.txt @@ -1,10 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) - ######################################################## ## C++ PROJECT ### ######################################################## PROJECT(sphere) -INCLUDE(${APPS_ROOT_CPU}/IncludsList.cmake) - -vf_add_library(BUILDTYPE binary DEPENDS VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES sphere.cpp ) \ No newline at end of file +vf_add_library(BUILDTYPE binary PRIVATE_LINK VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES sphere.cpp ) \ No newline at end of file diff --git a/src/cpu/VirtualFluids.h b/src/cpu/VirtualFluids.h index e033e94a95acec9cdf40495cb7d53b3e8e59f177..f90e05e07a78f1376caea529480e2e050de70c0c 100644 --- a/src/cpu/VirtualFluids.h +++ b/src/cpu/VirtualFluids.h @@ -175,6 +175,7 @@ #include <CoProcessors/WriteBoundaryConditionsCoProcessor.h> #include <CoProcessors/WriteMQFromSelectionCoProcessor.h> #include <CoProcessors/WriteMacroscopicQuantitiesCoProcessor.h> +#include <WriteBlocksCoProcessor.h> //#include <CoProcessors/PathLineCoProcessor.h> //#include <CoProcessors/PathLineCoProcessorMcpart.h> #include <CoProcessors/EmergencyExitCoProcessor.h> diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.h index 835e5b1c95454a9fbe8186d6942c3936a5e0e2cc..b9d08f7117d9dc41c008c9d92a5780aceedad21c 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCArray3D.h @@ -35,7 +35,7 @@ #define BCArray_H #include "BoundaryConditions.h" -#include "basics/container/CbArray3D.h" +#include "CbArray3D.h" #include <typeinfo> diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h index a2c495bc135b4001c9c910ceb943a307b12224af..9539139ed77841218695f0ae687e3a13ec7758f9 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h @@ -46,42 +46,28 @@ //! Difenition of baundary conditions in grid generation class BoundaryConditions { + // public: + // enum BcAlgorithm{VelocityBC, SlipBC, NoSlipBC, ThinWallNoSlipBC, HighViscosityNoSlipBC, EqDensityBC, + // NonEqDensityBC, NonReflectingVelocityBC, NonReflectingDensityBC}; public: - BoundaryConditions() - : noslipBoundaryFlags(0) - , slipBoundaryFlags(0) - , velocityBoundaryFlags(0) - , densityBoundaryFlags(0) - , wallModelBoundaryFlags(0) - , bcVelocityX1(0.0f) - , bcVelocityX2(0.0f) - , bcVelocityX3(0.0f) - , bcDensity(0.0f) - //, bcThixotropy(0.0f) - , bcLodiDensity(0.0f) - , bcLodiVelocityX1(0.0f) - , bcLodiVelocityX2(0.0f) - , bcLodiVelocityX3(0.0f) - , bcLodiLentgh(0.0f) - , nx1(0.0f) - , nx2(0.0f) - , nx3(0.0f) - , algorithmType(-1) - { - //wenn folgendes nicht geht, dann hat man weiter unten bei der bit-geschichte ein ernstes problem!!! - UB_STATIC_ASSERT( sizeof(long long) >= 8); - //UB_STATIC_ASSERT( sizeof(double) >= 16); - //UB_STATIC_ASSERT( sizeof(long long) == 32); - UB_STATIC_ASSERT( (sizeof(long long)*8) >= (D3Q27System::FENDDIR+1)*BoundaryConditions::optionDigits ); - + BoundaryConditions() + : noslipBoundaryFlags(0), slipBoundaryFlags(0), velocityBoundaryFlags(0), densityBoundaryFlags(0), + wallModelBoundaryFlags(0), bcVelocityX1(0.0f), bcVelocityX2(0.0f), bcVelocityX3(0.0f), bcDensity(0.0f) + //, bcThixotropy(0.0f) + , + bcLodiDensity(0.0f), bcLodiVelocityX1(0.0f), bcLodiVelocityX2(0.0f), bcLodiVelocityX3(0.0f), + bcLodiLentgh(0.0f), nx1(0.0f), nx2(0.0f), nx3(0.0f), algorithmType(-1) { + // wenn folgendes nicht geht, dann hat man weiter unten bei der bit-geschichte ein ernstes problem!!! UB_STATIC_ASSERT(sizeof(long long) >= 8); + // UB_STATIC_ASSERT( sizeof(double) >= 16); + // UB_STATIC_ASSERT( sizeof(long long) == 32); UB_STATIC_ASSERT((sizeof(long long) * 8) >= (D3Q27System::FENDDIR + 1) * BoundaryConditions::optionDigits); for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) q[fdir] = -999.; } - virtual ~BoundaryConditions() = default; + virtual ~BoundaryConditions() {} virtual bool isEmpty() { @@ -108,9 +94,9 @@ protected: if ((secOpt + 1) > maxOptionVal) throw UbException(UB_EXARGS, "error: option > " + UbSystem::toString(maxOptionVal - 1)); - // all digits at the respective positions to "0" + // alle digits an den betreffenden postionen auf "0" flag &= ~(maxOptionVal << (direction * optionDigits)); - // set all digits according to the flag at the respective positions + // alle digitsan den betreffenden postionen entsprechend der marke setzen flag |= ((long long)(secOpt + 1) << (direction * optionDigits)); } @@ -175,13 +161,13 @@ public: { return (short)(((slipBoundaryFlags >> (optionDigits * direction)) & maxOptionVal) - 1); } - void setNormalVector(const LBMReal &nx1, const LBMReal &nx2, const LBMReal &nx3) + void setNormalVector(const float &nx1, const float &nx2, const float &nx3) { this->nx1 = nx1; this->nx2 = nx2; this->nx3 = nx3; } - UbTupleDouble3 getNormalVector() { return makeUbTuple(nx1, nx2, nx3); } + UbTupleFloat3 getNormalVector() { return makeUbTuple(nx1, nx2, nx3); } /*============== Velocity Boundary ========================*/ void setVelocityBoundaryFlag(const int &direction, const short &secOpt = 0) @@ -206,72 +192,73 @@ public: void setBoundaryVelocity(const Vector3D &vx) { - setBoundaryVelocityX1((LBMReal)vx[0]); - setBoundaryVelocityX2((LBMReal)vx[1]); - setBoundaryVelocityX3((LBMReal)vx[2]); + setBoundaryVelocityX1((float)vx[0]); + setBoundaryVelocityX2((float)vx[1]); + setBoundaryVelocityX3((float)vx[2]); } - void setBoundaryVelocityX1(const LBMReal &vx1) { this->bcVelocityX1 = vx1; } - void setBoundaryVelocityX2(const LBMReal &vx2) { this->bcVelocityX2 = vx2; } - void setBoundaryVelocityX3(const LBMReal &vx3) { this->bcVelocityX3 = vx3; } - LBMReal getBoundaryVelocityX1() { return this->bcVelocityX1; } - LBMReal getBoundaryVelocityX2() { return this->bcVelocityX2; } - LBMReal getBoundaryVelocityX3() { return this->bcVelocityX3; } - LBMReal getBoundaryVelocity(const int &direction) + void setBoundaryVelocityX1(const float &vx1) { this->bcVelocityX1 = vx1; } + void setBoundaryVelocityX2(const float &vx2) { this->bcVelocityX2 = vx2; } + void setBoundaryVelocityX3(const float &vx3) { this->bcVelocityX3 = vx3; } + float getBoundaryVelocityX1() { return this->bcVelocityX1; } + float getBoundaryVelocityX2() { return this->bcVelocityX2; } + float getBoundaryVelocityX3() { return this->bcVelocityX3; } + float getBoundaryVelocity(const int &direction) { switch (direction) { case D3Q27System::E: - return (LBMReal)(UbMath::c4o9 * - (+bcVelocityX1)); //(2/cs^2)(=6)*rho_0(=1 for incompressible)*wi*u*ei with cs=1/sqrt(3) + return (float)(UbMath::c4o9 * + (+bcVelocityX1)); //(2/cs^2)(=6)*rho_0(=1 bei inkompr)*wi*u*ei mit cs=1/sqrt(3) case D3Q27System::W: - return (LBMReal)(UbMath::c4o9 * (-bcVelocityX1)); + return (float)(UbMath::c4o9 * + (-bcVelocityX1)); // z.B. aus paper manfred MRT LB models in three dimensions (2002) case D3Q27System::N: - return (LBMReal)(UbMath::c4o9 * (+bcVelocityX2)); + return (float)(UbMath::c4o9 * (+bcVelocityX2)); case D3Q27System::S: - return (LBMReal)(UbMath::c4o9 * (-bcVelocityX2)); + return (float)(UbMath::c4o9 * (-bcVelocityX2)); case D3Q27System::T: - return (LBMReal)(UbMath::c4o9 * (+bcVelocityX3)); + return (float)(UbMath::c4o9 * (+bcVelocityX3)); case D3Q27System::B: - return (LBMReal)(UbMath::c4o9 * (-bcVelocityX3)); + return (float)(UbMath::c4o9 * (-bcVelocityX3)); case D3Q27System::NE: - return (LBMReal)(UbMath::c1o9 * (+bcVelocityX1 + bcVelocityX2)); + return (float)(UbMath::c1o9 * (+bcVelocityX1 + bcVelocityX2)); case D3Q27System::SW: - return (LBMReal)(UbMath::c1o9 * (-bcVelocityX1 - bcVelocityX2)); + return (float)(UbMath::c1o9 * (-bcVelocityX1 - bcVelocityX2)); case D3Q27System::SE: - return (LBMReal)(UbMath::c1o9 * (+bcVelocityX1 - bcVelocityX2)); + return (float)(UbMath::c1o9 * (+bcVelocityX1 - bcVelocityX2)); case D3Q27System::NW: - return (LBMReal)(UbMath::c1o9 * (-bcVelocityX1 + bcVelocityX2)); + return (float)(UbMath::c1o9 * (-bcVelocityX1 + bcVelocityX2)); case D3Q27System::TE: - return (LBMReal)(UbMath::c1o9 * (+bcVelocityX1 + bcVelocityX3)); + return (float)(UbMath::c1o9 * (+bcVelocityX1 + bcVelocityX3)); case D3Q27System::BW: - return (LBMReal)(UbMath::c1o9 * (-bcVelocityX1 - bcVelocityX3)); + return (float)(UbMath::c1o9 * (-bcVelocityX1 - bcVelocityX3)); case D3Q27System::BE: - return (LBMReal)(UbMath::c1o9 * (+bcVelocityX1 - bcVelocityX3)); + return (float)(UbMath::c1o9 * (+bcVelocityX1 - bcVelocityX3)); case D3Q27System::TW: - return (LBMReal)(UbMath::c1o9 * (-bcVelocityX1 + bcVelocityX3)); + return (float)(UbMath::c1o9 * (-bcVelocityX1 + bcVelocityX3)); case D3Q27System::TN: - return (LBMReal)(UbMath::c1o9 * (+bcVelocityX2 + bcVelocityX3)); + return (float)(UbMath::c1o9 * (+bcVelocityX2 + bcVelocityX3)); case D3Q27System::BS: - return (LBMReal)(UbMath::c1o9 * (-bcVelocityX2 - bcVelocityX3)); + return (float)(UbMath::c1o9 * (-bcVelocityX2 - bcVelocityX3)); case D3Q27System::BN: - return (LBMReal)(UbMath::c1o9 * (+bcVelocityX2 - bcVelocityX3)); + return (float)(UbMath::c1o9 * (+bcVelocityX2 - bcVelocityX3)); case D3Q27System::TS: - return (LBMReal)(UbMath::c1o9 * (-bcVelocityX2 + bcVelocityX3)); + return (float)(UbMath::c1o9 * (-bcVelocityX2 + bcVelocityX3)); case D3Q27System::TNE: - return (LBMReal)(UbMath::c1o36 * (+bcVelocityX1 + bcVelocityX2 + bcVelocityX3)); + return (float)(UbMath::c1o36 * (+bcVelocityX1 + bcVelocityX2 + bcVelocityX3)); case D3Q27System::BSW: - return (LBMReal)(UbMath::c1o36 * (-bcVelocityX1 - bcVelocityX2 - bcVelocityX3)); + return (float)(UbMath::c1o36 * (-bcVelocityX1 - bcVelocityX2 - bcVelocityX3)); case D3Q27System::BNE: - return (LBMReal)(UbMath::c1o36 * (+bcVelocityX1 + bcVelocityX2 - bcVelocityX3)); + return (float)(UbMath::c1o36 * (+bcVelocityX1 + bcVelocityX2 - bcVelocityX3)); case D3Q27System::TSW: - return (LBMReal)(UbMath::c1o36 * (-bcVelocityX1 - bcVelocityX2 + bcVelocityX3)); + return (float)(UbMath::c1o36 * (-bcVelocityX1 - bcVelocityX2 + bcVelocityX3)); case D3Q27System::TSE: - return (LBMReal)(UbMath::c1o36 * (+bcVelocityX1 - bcVelocityX2 + bcVelocityX3)); + return (float)(UbMath::c1o36 * (+bcVelocityX1 - bcVelocityX2 + bcVelocityX3)); case D3Q27System::BNW: - return (LBMReal)(UbMath::c1o36 * (-bcVelocityX1 + bcVelocityX2 - bcVelocityX3)); + return (float)(UbMath::c1o36 * (-bcVelocityX1 + bcVelocityX2 - bcVelocityX3)); case D3Q27System::BSE: - return (LBMReal)(UbMath::c1o36 * (+bcVelocityX1 - bcVelocityX2 - bcVelocityX3)); + return (float)(UbMath::c1o36 * (+bcVelocityX1 - bcVelocityX2 - bcVelocityX3)); case D3Q27System::TNW: - return (LBMReal)(UbMath::c1o36 * (-bcVelocityX1 + bcVelocityX2 + bcVelocityX3)); + return (float)(UbMath::c1o36 * (-bcVelocityX1 + bcVelocityX2 + bcVelocityX3)); default: throw UbException(UB_EXARGS, "unknown error"); } @@ -298,47 +285,44 @@ public: return (short)(((densityBoundaryFlags >> (optionDigits * direction)) & maxOptionVal) - 1); } - void setBoundaryDensity(LBMReal density) { this->bcDensity = density; } - LBMReal getBoundaryDensity() { return this->bcDensity; } - - //void setBoundaryThixotropy(float thixotropy) { this->bcDensity = thixotropy; } - //float getBoundaryThixotropy() { return this->bcThixotropy; } - - ////Lodi extension - void setDensityLodiDensity(const float& bcLodiDensity) { this->bcLodiDensity = bcLodiDensity; } - void setDensityLodiVelocityX1(const float& bcLodiVelocityX1) { this->bcLodiVelocityX1 = bcLodiVelocityX1; } - void setDensityLodiVelocityX2(const float& bcLodiVelocityX2) { this->bcLodiVelocityX2 = bcLodiVelocityX2; } - void setDensityLodiVelocityX3(const float& bcLodiVelocityX3) { this->bcLodiVelocityX3 = bcLodiVelocityX3; } - void setDensityLodiLength(const float& bcLodiLentgh) { this->bcLodiLentgh = bcLodiLentgh; } - float getDensityLodiDensity() const { return this->bcLodiDensity; } - float getDensityLodiVelocityX1() const { return this->bcLodiVelocityX1; } - float getDensityLodiVelocityX2() const { return this->bcLodiVelocityX2; } - float getDensityLodiVelocityX3() const { return this->bcLodiVelocityX3; } - float getDensityLodiLength() const { return this->bcLodiLentgh; } - - LBMReal &densityLodiDensity() { return this->bcLodiDensity; } - LBMReal &densityLodiVelocityX1() { return this->bcLodiVelocityX1; } - LBMReal &densityLodiVelocityX2() { return this->bcLodiVelocityX2; } - LBMReal &densityLodiVelocityX3() { return this->bcLodiVelocityX3; } - LBMReal &densityLodiLentgh() { return this->bcLodiLentgh; } - - const LBMReal &densityLodiDensity() const { return this->bcLodiDensity; } - const LBMReal &densityLodiVelocityX1() const { return this->bcLodiVelocityX1; } - const LBMReal &densityLodiVelocityX2() const { return this->bcLodiVelocityX2; } - const LBMReal &densityLodiVelocityX3() const { return this->bcLodiVelocityX3; } - const LBMReal &densityLodiLentgh() const { return this->bcLodiLentgh; } + void setBoundaryDensity(float density) { this->bcDensity = density; } + float getBoundaryDensity() { return this->bcDensity; } + + ////Lodi extension + void setDensityLodiDensity(const float &bcLodiDensity) { this->bcLodiDensity = bcLodiDensity; } + void setDensityLodiVelocityX1(const float &bcLodiVelocityX1) { this->bcLodiVelocityX1 = bcLodiVelocityX1; } + void setDensityLodiVelocityX2(const float &bcLodiVelocityX2) { this->bcLodiVelocityX2 = bcLodiVelocityX2; } + void setDensityLodiVelocityX3(const float &bcLodiVelocityX3) { this->bcLodiVelocityX3 = bcLodiVelocityX3; } + void setDensityLodiLength(const float &bcLodiLentgh) { this->bcLodiLentgh = bcLodiLentgh; } + float getDensityLodiDensity() const { return this->bcLodiDensity; } + float getDensityLodiVelocityX1() const { return this->bcLodiVelocityX1; } + float getDensityLodiVelocityX2() const { return this->bcLodiVelocityX2; } + float getDensityLodiVelocityX3() const { return this->bcLodiVelocityX3; } + float getDensityLodiLength() const { return this->bcLodiLentgh; } + + float &densityLodiDensity() { return this->bcLodiDensity; } + float &densityLodiVelocityX1() { return this->bcLodiVelocityX1; } + float &densityLodiVelocityX2() { return this->bcLodiVelocityX2; } + float &densityLodiVelocityX3() { return this->bcLodiVelocityX3; } + float &densityLodiLentgh() { return this->bcLodiLentgh; } + + const float &densityLodiDensity() const { return this->bcLodiDensity; } + const float &densityLodiVelocityX1() const { return this->bcLodiVelocityX1; } + const float &densityLodiVelocityX2() const { return this->bcLodiVelocityX2; } + const float &densityLodiVelocityX3() const { return this->bcLodiVelocityX3; } + const float &densityLodiLentgh() const { return this->bcLodiLentgh; } /*======================= Qs =============================*/ - void setQ(const LBMReal &val, const int &direction) { q[direction] = val; } - LBMReal getQ(const int &direction) { return q[direction]; } + void setQ(const float &val, const int &direction) { q[direction] = val; } + float getQ(const int &direction) { return q[direction]; } virtual std::vector<std::string> getBCNames() { std::vector<std::string> tmp; - tmp.emplace_back("NoSlipBC"); - tmp.emplace_back("SlipBC"); - tmp.emplace_back("VelocityBC"); - tmp.emplace_back("DensityBC"); + tmp.push_back("NoSlipBC"); + tmp.push_back("SlipBC"); + tmp.push_back("VelocityBC"); + tmp.push_back("DensityBC"); return tmp; } virtual std::vector<long long> getBCFlags() @@ -360,32 +344,35 @@ public: char getBcAlgorithmType() { return algorithmType; } public: - static const int optionDigits = 2; //--> 2 bits for secondary Option --> maxOptionVal = 7 + static const int optionDigits = + 2; //--> 3 bits fr secondary Option --> maxOptionVal = 7, da man mit drei Digits max die 7 darstellen kann static const long long maxOptionVal; // = ( 1<<optionDigits ) - 1; //2^3-1 -> 7 protected: - LBMReal q[D3Q27System::FENDDIR + 1]; + float q[D3Q27System::FENDDIR + 1]; + // float q[D3Q27System::STARTF+1]; - long long noslipBoundaryFlags{ 0 }; - long long slipBoundaryFlags{ 0 }; - long long velocityBoundaryFlags{ 0 }; - long long densityBoundaryFlags{ 0 }; - long long wallModelBoundaryFlags{ 0 }; + long long noslipBoundaryFlags; + long long slipBoundaryFlags; + long long velocityBoundaryFlags; + long long densityBoundaryFlags; + long long wallModelBoundaryFlags; - LBMReal bcVelocityX1{ 0.0f }; - LBMReal bcVelocityX2{ 0.0f }; - LBMReal bcVelocityX3{ 0.0f }; - LBMReal bcDensity{ 0.0f }; + float bcVelocityX1; + float bcVelocityX2; + float bcVelocityX3; + float bcDensity; + // float bcThixotropy; - LBMReal bcLodiDensity{ 0.0f }; - LBMReal bcLodiVelocityX1{ 0.0f }; - LBMReal bcLodiVelocityX2{ 0.0f }; - LBMReal bcLodiVelocityX3{ 0.0f }; - LBMReal bcLodiLentgh{ 0.0f }; + float bcLodiDensity; + float bcLodiVelocityX1; + float bcLodiVelocityX2; + float bcLodiVelocityX3; + float bcLodiLentgh; - LBMReal nx1{ 0.0f }, nx2{ 0.0f }, nx3{ 0.0f }; + float nx1, nx2, nx3; - char algorithmType{ -1 }; + char algorithmType; private: friend class MPIIORestartCoProcessor; @@ -393,4 +380,5 @@ private: friend class MPIIOMigrationBECoProcessor; }; + #endif diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAlgorithm.cpp index 59931df14d6b8c47b7fb6feb93a39e2240b6661d..825d2bc0175acb5b2c10df3a89e87512dcc2e6e3 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAlgorithm.cpp @@ -27,7 +27,7 @@ void SlipBCAlgorithm::applyBC() calcMacrosFct(f, drho, vx1, vx2, vx3); calcFeqFct(feq, drho, vx1, vx2, vx3); - UbTupleDouble3 normale = bcPtr->getNormalVector(); + UbTupleFloat3 normale = bcPtr->getNormalVector(); LBMReal amp = vx1 * val<1>(normale) + vx2 * val<2>(normale) + vx3 * val<3>(normale); vx1 = vx1 - amp * val<1>(normale); // normale zeigt von struktur weg! diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityBCAlgorithm.cpp index ecafaa158b3e6a3b1c2ac21b3d435f2ed74c2ff2..96c4654394ca156a126bc0272ba92d087566f563 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/VelocityWithDensityBCAlgorithm.cpp @@ -35,10 +35,6 @@ void VelocityWithDensityBCAlgorithm::applyBC() for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) { - int nX1 = x1 + D3Q27System::DX1[fdir]; - int nX2 = x2 + D3Q27System::DX2[fdir]; - int nX3 = x3 + D3Q27System::DX3[fdir]; - int nX1 = x1 + D3Q27System::DX1[fdir]; int nX2 = x2 + D3Q27System::DX2[fdir]; int nX3 = x3 + D3Q27System::DX3[fdir]; diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp index b7b6246d9e7ceb99c5adb288cc4c01ead504777b..88b5b574be4d6beb619a4e56c0bd11281f1fcbf8 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteBoundaryConditionsCoProcessor.cpp @@ -141,20 +141,14 @@ void WriteBoundaryConditionsCoProcessor::addDataGeo(SPtr<Block3D> block) datanames.emplace_back("Boundary Conditions"); datanames.emplace_back("Geometry"); datanames.emplace_back("Level"); - // datanames.emplace_back("Interface CF"); data.resize(datanames.size()); SPtr<ILBMKernel> kernel = block->getKernel(); SPtr<BCArray3D> bcArray = kernel->getBCProcessor()->getBCArray(); -<<<<<<< HEAD // knotennummerierung faengt immer bei 0 an! - unsigned int SWB, SEB, NEB, NWB, SWT, SET, NET, NWT; -======= - //knotennummerierung faengt immer bei 0 an! - int SWB, SEB, NEB, NWB, SWT, SET, NET, NWT; ->>>>>>> add grid refinement for thixotropic fluid + int SWB = 0, SEB = 0, NEB = 0, NWB = 0, SWT = 0, SET = 0, NET = 0, NWT = 0; int minX1 = 0; int minX2 = 0; @@ -203,42 +197,28 @@ void WriteBoundaryConditionsCoProcessor::addDataGeo(SPtr<Block3D> block) } data[2].push_back(level); - - // if (bcArray->isInterfaceCF(ix1, ix2, ix3)) - //{ - // data[3].push_back(1.0); - //} - // else - //{ - // data[3].push_back(0.0); - //} } } - } - } - } - - maxX1 -= 1; - maxX2 -= 1; - maxX3 -= 1; - - //cell vector erstellen - for (int ix3 = minX3; ix3<=maxX3; ix3++) - { - for (int ix2 = minX2; ix2<=maxX2; ix2++) - { - for (int ix1 = minX1; ix1<=maxX1; ix1++) - { - if ((SWB = nodeNumbers(ix1, ix2, ix3))>=0 - &&(SEB = nodeNumbers(ix1+1, ix2, ix3))>=0 - &&(NEB = nodeNumbers(ix1+1, ix2+1, ix3))>=0 - &&(NWB = nodeNumbers(ix1, ix2+1, ix3))>=0 - &&(SWT = nodeNumbers(ix1, ix2, ix3+1))>=0 - &&(SET = nodeNumbers(ix1+1, ix2, ix3+1))>=0 - &&(NET = nodeNumbers(ix1+1, ix2+1, ix3+1))>=0 - &&(NWT = nodeNumbers(ix1, ix2+1, ix3+1))>=0) - { - cells.push_back(makeUbTuple((unsigned int)SWB, (unsigned int)SEB, (unsigned int)NEB, (unsigned int)NWB, (unsigned int)SWT, (unsigned int)SET, (unsigned int)NET, (unsigned int)NWT)); + } + } + + maxX1 -= 1; + maxX2 -= 1; + maxX3 -= 1; + + // cell vector erstellen + for (int ix3 = minX3; ix3 <= maxX3; ix3++) { + for (int ix2 = minX2; ix2 <= maxX2; ix2++) { + for (int ix1 = minX1; ix1 <= maxX1; ix1++) { + if ((SWB = nodeNumbers(ix1, ix2, ix3)) >= 0 && (SEB = nodeNumbers(ix1 + 1, ix2, ix3)) >= 0 && + (NEB = nodeNumbers(ix1 + 1, ix2 + 1, ix3)) >= 0 && (NWB = nodeNumbers(ix1, ix2 + 1, ix3)) >= 0 && + (SWT = nodeNumbers(ix1, ix2, ix3 + 1)) >= 0 && (SET = nodeNumbers(ix1 + 1, ix2, ix3 + 1)) >= 0 && + (NET = nodeNumbers(ix1 + 1, ix2 + 1, ix3 + 1)) >= 0 && + (NWT = nodeNumbers(ix1, ix2 + 1, ix3 + 1)) >= 0) { + cells.push_back(makeUbTuple((unsigned int)SWB, (unsigned int)SEB, (unsigned int)NEB, + (unsigned int)NWB, (unsigned int)SWT, (unsigned int)SET, + (unsigned int)NET, (unsigned int)NWT)); + } } } } diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp index e5976c68276572681ef7d3480fc8f0e2f1311ebf..43687af9c025aa66b9db0afc5222716054dd488f 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMacroscopicQuantitiesCoProcessor.cpp @@ -145,147 +145,144 @@ void WriteMacroscopicQuantitiesCoProcessor::clearData() ////////////////////////////////////////////////////////////////////////// void WriteMacroscopicQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) { - double level = (double)block->getLevel(); - double blockID = (double)block->getGlobalID(); - - //Diese Daten werden geschrieben: - datanames.resize(0); - datanames.push_back("Rho"); - datanames.push_back("Vx"); - datanames.push_back("Vy"); - datanames.push_back("Vz"); - //datanames.push_back("Press"); - datanames.push_back("Level"); - //datanames.push_back("BlockID"); - //datanames.push_back("gamma"); - //datanames.push_back("collFactor"); - - - data.resize(datanames.size()); - - SPtr<ILBMKernel> kernel = block->getKernel(); - SPtr<BCArray3D> bcArray = kernel->getBCProcessor()->getBCArray(); - SPtr<DistributionArray3D> distributions = kernel->getDataSet()->getFdistributions(); - LBMReal f[D3Q27System::ENDF+1]; - LBMReal vx1,vx2,vx3,rho; - - //knotennummerierung faengt immer bei 0 an! - int SWB,SEB,NEB,NWB,SWT,SET,NET,NWT; - - if(block->getKernel()->getCompressible()) - { - calcMacros = &D3Q27System::calcCompMacroscopicValues; - } - else - { - calcMacros = &D3Q27System::calcIncompMacroscopicValues; - } - - int minX1 = 0; - int minX2 = 0; - int minX3 = 0; - - int maxX1 = (int)(distributions->getNX1()); - int maxX2 = (int)(distributions->getNX2()); - int maxX3 = (int)(distributions->getNX3()); - - //int minX1 = 1; - //int minX2 = 1; - //int minX3 = 1; - - //int maxX1 = (int)(distributions->getNX1()); - //int maxX2 = (int)(distributions->getNX2()); - //int maxX3 = (int)(distributions->getNX3()); - - //nummern vergeben und node vector erstellen + daten sammeln - CbArray3D<int> nodeNumbers((int)maxX1, (int)maxX2, (int)maxX3, -1); - maxX1 -= 2; - maxX2 -= 2; - maxX3 -= 2; - - - - //D3Q27BoundaryConditionPtr bcPtr; - int nr = (int)nodes.size(); - - for(int ix3=minX3; ix3<=maxX3; ix3++) - { - for(int ix2=minX2; ix2<=maxX2; ix2++) - { - for(int ix1=minX1; ix1<=maxX1; ix1++) - { - if(!bcArray->isUndefined(ix1,ix2,ix3) && !bcArray->isSolid(ix1,ix2,ix3)) - { - int index = 0; - nodeNumbers(ix1,ix2,ix3) = nr++; - Vector3D worldCoordinates = grid->getNodeCoordinates(block, ix1, ix2, ix3); - nodes.push_back( UbTupleFloat3(float(worldCoordinates[0]), - float(worldCoordinates[1]), - float(worldCoordinates[2]) )); - - distributions->getDistribution(f, ix1, ix2, ix3); - calcMacros(f,rho,vx1,vx2,vx3); - double press = D3Q27System::getPressure(f); //D3Q27System::calcPress(f,rho,vx1,vx2,vx3); - - if (UbMath::isNaN(rho) || UbMath::isInfinity(rho)) - //UB_THROW( UbException(UB_EXARGS,"rho is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+", node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); - rho=999.0; - if (UbMath::isNaN(press) || UbMath::isInfinity(press)) - //UB_THROW( UbException(UB_EXARGS,"press is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+", node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); - press=999.0; - if (UbMath::isNaN(vx1) || UbMath::isInfinity(vx1)) - //UB_THROW( UbException(UB_EXARGS,"vx1 is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+", node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); - vx1=999.0; - if (UbMath::isNaN(vx2) || UbMath::isInfinity(vx2)) - //UB_THROW( UbException(UB_EXARGS,"vx2 is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+", node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); - vx2=999.0; - if (UbMath::isNaN(vx3) || UbMath::isInfinity(vx3)) - //UB_THROW( UbException(UB_EXARGS,"vx3 is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+", node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); - vx3 = 999.0; - - data[index++].push_back(rho); - data[index++].push_back(vx1); - data[index++].push_back(vx2); - data[index++].push_back(vx3); - - //shearRate = D3Q27System::getShearRate(f, collFactor); - - //LBMReal collFactorF = BinghamModelLBMKernel::getBinghamCollFactor(collFactor, yieldStress, shearRate, rho); - - //data[index++].push_back(shearRate); - //data[index++].push_back(collFactorF); - - //data[index++].push_back((rho+1.0) * conv->getFactorDensityLbToW() ); - //data[index++].push_back(vx1 * conv->getFactorVelocityLbToW()); - //data[index++].push_back(vx2 * conv->getFactorVelocityLbToW()); - //data[index++].push_back(vx3 * conv->getFactorVelocityLbToW()); - //data[index++].push_back((press * conv->getFactorPressureLbToW()) / ((rho+1.0) * conv->getFactorDensityLbToW())); - data[index++].push_back(level); - //data[index++].push_back(blockID); + double level = (double)block->getLevel(); + double blockID = (double)block->getGlobalID(); + + // Diese Daten werden geschrieben: + datanames.resize(0); + datanames.push_back("Rho"); + datanames.push_back("Vx"); + datanames.push_back("Vy"); + datanames.push_back("Vz"); + // datanames.push_back("Press"); + datanames.push_back("Level"); + // datanames.push_back("BlockID"); + // datanames.push_back("gamma"); + // datanames.push_back("collFactor"); + + data.resize(datanames.size()); + + SPtr<ILBMKernel> kernel = block->getKernel(); + SPtr<BCArray3D> bcArray = kernel->getBCProcessor()->getBCArray(); + SPtr<DistributionArray3D> distributions = kernel->getDataSet()->getFdistributions(); + LBMReal f[D3Q27System::ENDF + 1]; + LBMReal vx1, vx2, vx3, rho; + + // knotennummerierung faengt immer bei 0 an! + int SWB, SEB, NEB, NWB, SWT, SET, NET, NWT; + + if (block->getKernel()->getCompressible()) { + calcMacros = &D3Q27System::calcCompMacroscopicValues; + } else { + calcMacros = &D3Q27System::calcIncompMacroscopicValues; + } + + int minX1 = 0; + int minX2 = 0; + int minX3 = 0; + + int maxX1 = (int)(distributions->getNX1()); + int maxX2 = (int)(distributions->getNX2()); + int maxX3 = (int)(distributions->getNX3()); + + // int minX1 = 1; + // int minX2 = 1; + // int minX3 = 1; + + // int maxX1 = (int)(distributions->getNX1()); + // int maxX2 = (int)(distributions->getNX2()); + // int maxX3 = (int)(distributions->getNX3()); + + // nummern vergeben und node vector erstellen + daten sammeln + CbArray3D<int> nodeNumbers((int)maxX1, (int)maxX2, (int)maxX3, -1); + maxX1 -= 2; + maxX2 -= 2; + maxX3 -= 2; + + // D3Q27BoundaryConditionPtr bcPtr; + int nr = (int)nodes.size(); + + for (int ix3 = minX3; ix3 <= maxX3; ix3++) { + for (int ix2 = minX2; ix2 <= maxX2; ix2++) { + for (int ix1 = minX1; ix1 <= maxX1; ix1++) { + if (!bcArray->isUndefined(ix1, ix2, ix3) && !bcArray->isSolid(ix1, ix2, ix3)) { + int index = 0; + nodeNumbers(ix1, ix2, ix3) = nr++; + Vector3D worldCoordinates = grid->getNodeCoordinates(block, ix1, ix2, ix3); + nodes.push_back(UbTupleFloat3(float(worldCoordinates[0]), float(worldCoordinates[1]), + float(worldCoordinates[2]))); + + distributions->getDistribution(f, ix1, ix2, ix3); + calcMacros(f, rho, vx1, vx2, vx3); + double press = D3Q27System::getPressure(f); // D3Q27System::calcPress(f,rho,vx1,vx2,vx3); + + if (UbMath::isNaN(rho) || UbMath::isInfinity(rho)) + // UB_THROW( UbException(UB_EXARGS,"rho is not a number (nan or -1.#IND) or infinity number + // -1.#INF in block="+block->toString()+", + // node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); + rho = 999.0; + if (UbMath::isNaN(press) || UbMath::isInfinity(press)) + // UB_THROW( UbException(UB_EXARGS,"press is not a number (nan or -1.#IND) or infinity number + // -1.#INF in block="+block->toString()+", + // node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); + press = 999.0; + if (UbMath::isNaN(vx1) || UbMath::isInfinity(vx1)) + // UB_THROW( UbException(UB_EXARGS,"vx1 is not a number (nan or -1.#IND) or infinity number + // -1.#INF in block="+block->toString()+", + // node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); + vx1 = 999.0; + if (UbMath::isNaN(vx2) || UbMath::isInfinity(vx2)) + // UB_THROW( UbException(UB_EXARGS,"vx2 is not a number (nan or -1.#IND) or infinity number + // -1.#INF in block="+block->toString()+", + // node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); + vx2 = 999.0; + if (UbMath::isNaN(vx3) || UbMath::isInfinity(vx3)) + // UB_THROW( UbException(UB_EXARGS,"vx3 is not a number (nan or -1.#IND) or infinity number + // -1.#INF in block="+block->toString()+", + // node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); + vx3 = 999.0; + + data[index++].push_back(rho); + data[index++].push_back(vx1); + data[index++].push_back(vx2); + data[index++].push_back(vx3); + + // shearRate = D3Q27System::getShearRate(f, collFactor); + + // LBMReal collFactorF = BinghamModelLBMKernel::getBinghamCollFactor(collFactor, yieldStress, + // shearRate, rho); + + // data[index++].push_back(shearRate); + // data[index++].push_back(collFactorF); + + // data[index++].push_back((rho+1.0) * conv->getFactorDensityLbToW() ); + // data[index++].push_back(vx1 * conv->getFactorVelocityLbToW()); + // data[index++].push_back(vx2 * conv->getFactorVelocityLbToW()); + // data[index++].push_back(vx3 * conv->getFactorVelocityLbToW()); + // data[index++].push_back((press * conv->getFactorPressureLbToW()) / ((rho+1.0) * + // conv->getFactorDensityLbToW())); + data[index++].push_back(level); + // data[index++].push_back(blockID); + } } - } - } - } - maxX1 -= 1; - maxX2 -= 1; - maxX3 -= 1; - //cell vector erstellen - for(int ix3=minX3; ix3<=maxX3; ix3++) - { - for(int ix2=minX2; ix2<=maxX2; ix2++) - { - for(int ix1=minX1; ix1<=maxX1; ix1++) - { - if( (SWB=nodeNumbers( ix1 , ix2, ix3 )) >= 0 - && (SEB=nodeNumbers( ix1+1, ix2, ix3 )) >= 0 - && (NEB=nodeNumbers( ix1+1, ix2+1, ix3 )) >= 0 - && (NWB=nodeNumbers( ix1 , ix2+1, ix3 )) >= 0 - && (SWT=nodeNumbers( ix1 , ix2, ix3+1 )) >= 0 - && (SET=nodeNumbers( ix1+1, ix2, ix3+1 )) >= 0 - && (NET=nodeNumbers( ix1+1, ix2+1, ix3+1 )) >= 0 - && (NWT=nodeNumbers( ix1 , ix2+1, ix3+1 )) >= 0 ) - { - cells.push_back( makeUbTuple((unsigned int)SWB, (unsigned int)SEB, (unsigned int)NEB, (unsigned int)NWB, (unsigned int)SWT, (unsigned int)SET, (unsigned int)NET, (unsigned int)NWT) ); + } + } + maxX1 -= 1; + maxX2 -= 1; + maxX3 -= 1; + // cell vector erstellen + for (int ix3 = minX3; ix3 <= maxX3; ix3++) { + for (int ix2 = minX2; ix2 <= maxX2; ix2++) { + for (int ix1 = minX1; ix1 <= maxX1; ix1++) { + if ((SWB = nodeNumbers(ix1, ix2, ix3)) >= 0 && (SEB = nodeNumbers(ix1 + 1, ix2, ix3)) >= 0 && + (NEB = nodeNumbers(ix1 + 1, ix2 + 1, ix3)) >= 0 && (NWB = nodeNumbers(ix1, ix2 + 1, ix3)) >= 0 && + (SWT = nodeNumbers(ix1, ix2, ix3 + 1)) >= 0 && (SET = nodeNumbers(ix1 + 1, ix2, ix3 + 1)) >= 0 && + (NET = nodeNumbers(ix1 + 1, ix2 + 1, ix3 + 1)) >= 0 && + (NWT = nodeNumbers(ix1, ix2 + 1, ix3 + 1)) >= 0) { + cells.push_back(makeUbTuple((unsigned int)SWB, (unsigned int)SEB, (unsigned int)NEB, + (unsigned int)NWB, (unsigned int)SWT, (unsigned int)SET, + (unsigned int)NET, (unsigned int)NWT)); + } } } } diff --git a/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp b/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp index b94840931d22d475b10e52cf22d6949c152f68e7..e41e7372502dd7f96b387e4845ac27084321c48a 100644 --- a/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/BasicCalculator.cpp @@ -52,11 +52,6 @@ BasicCalculator::BasicCalculator(SPtr<Grid3D> grid, SPtr<UbScheduler> additional Calculator(grid, additionalGhostLayerUpdateScheduler, numberOfTimeSteps) { -} -////////////////////////////////////////////////////////////////////////// -BasicCalculator::~BasicCalculator() -{ - } ////////////////////////////////////////////////////////////////////////// void BasicCalculator::calculate() diff --git a/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp index 5b61b85659a62aa2b6e23a606d0f81f4e6382671..60e0b41cb666583e198bb692a189b734f4f11ab1 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp @@ -39,9 +39,11 @@ #include "D3Q27EsoTwist3DSplittedVector.h" #include "DataSet3D.h" #include "Grid3D.h" +#include "Grid3DSystem.h" #include "BCAdapter.h" #include "Block3D.h" #include "BCArray3D.h" +#include "ILBMKernel.h" #include "DensityAndThixotropyBCAlgorithm.h" #include "VelocityAndThixotropyBCAlgorithm.h" @@ -50,10 +52,6 @@ #include "VelocityWithDensityAndThixotropyBCAlgorithm.h" -BoundaryConditionsBlockVisitor::BoundaryConditionsBlockVisitor() : -Block3DVisitor(0, Grid3DSystem::MAXLEVEL) -{ - BoundaryConditionsBlockVisitor::BoundaryConditionsBlockVisitor() : Block3DVisitor(0, Grid3DSystem::MAXLEVEL) {} ////////////////////////////////////////////////////////////////////////// BoundaryConditionsBlockVisitor::~BoundaryConditionsBlockVisitor() = default; @@ -98,48 +96,36 @@ void BoundaryConditionsBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> bloc char alg = bcPtr->getBcAlgorithmType(); SPtr<BCAlgorithm> bca = bcMap[alg]; - for (int x3 = minX3; x3 < maxX3; x3++) - { - for (int x2 = minX2; x2 < maxX2; x2++) - { - for (int x1 = minX1; x1 < maxX1; x1++) - { - if (!bcArray->isSolid(x1, x2, x3) && !bcArray->isUndefined(x1, x2, x3)) - { - if ((bcPtr = bcArray->getBC(x1, x2, x3)) != NULL) - { - char alg = bcPtr->getBcAlgorithmType(); - SPtr<BCAlgorithm> bca = bcMap[alg]; - - if (bca) - { - bca = bca->clone(); - bca->setNodeIndex(x1, x2, x3); - bca->setBcPointer(bcPtr); - bca->addDistributions(distributions); - //if (bca->getThixotropy()) - //{ - // std::static_pointer_cast<DensityAndThixotropyBCAlgorithm>(bca)->addDistributionsH(kernel->getDataSet()->getHdistributions()); - // std::static_pointer_cast<DensityAndThixotropyBCAlgorithm>(bca)->addDistributionsH(kernel->getDataSet()->getHdistributions()); - //} - if(alg == BCAlgorithm::VelocityAndThixotropyBCAlgorithm) - std::static_pointer_cast<VelocityAndThixotropyBCAlgorithm>(bca)->addDistributionsH(kernel->getDataSet()->getHdistributions()); - if (alg == BCAlgorithm::DensityAndThixotropyBCAlgorithm) - std::static_pointer_cast<DensityAndThixotropyBCAlgorithm>(bca)->addDistributionsH(kernel->getDataSet()->getHdistributions()); - if (alg == BCAlgorithm::NoSlipAndThixotropyBCAlgorithm) - std::static_pointer_cast<NoSlipAndThixotropyBCAlgorithm>(bca)->addDistributionsH(kernel->getDataSet()->getHdistributions()); - if (alg == BCAlgorithm::NonReflectingOutflowAndThixotropyBCAlgorithm) - std::static_pointer_cast<NonReflectingOutflowAndThixotropyBCAlgorithm>(bca)->addDistributionsH(kernel->getDataSet()->getHdistributions()); - if (alg == BCAlgorithm::VelocityWithDensityAndThixotropyBCAlgorithm) - std::static_pointer_cast<VelocityWithDensityAndThixotropyBCAlgorithm>(bca)->addDistributionsH(kernel->getDataSet()->getHdistributions()); - - bca->setCollFactor(collFactor); - bca->setCompressible(compressible); - bca->setBcArray(bcArray); - bcProcessor->addBC(bca); - } - } - } + if (bca) { + bca = bca->clone(); + bca->setNodeIndex(x1, x2, x3); + bca->setBcPointer(bcPtr); + bca->addDistributions(distributions); + + if (alg == BCAlgorithm::VelocityAndThixotropyBCAlgorithm) + std::static_pointer_cast<VelocityAndThixotropyBCAlgorithm>(bca)->addDistributionsH( + kernel->getDataSet()->getHdistributions()); + if (alg == BCAlgorithm::DensityAndThixotropyBCAlgorithm) + std::static_pointer_cast<DensityAndThixotropyBCAlgorithm>(bca)->addDistributionsH( + kernel->getDataSet()->getHdistributions()); + if (alg == BCAlgorithm::NoSlipAndThixotropyBCAlgorithm) + std::static_pointer_cast<NoSlipAndThixotropyBCAlgorithm>(bca)->addDistributionsH( + kernel->getDataSet()->getHdistributions()); + if (alg == BCAlgorithm::NonReflectingOutflowAndThixotropyBCAlgorithm) + std::static_pointer_cast<NonReflectingOutflowAndThixotropyBCAlgorithm>(bca) + ->addDistributionsH(kernel->getDataSet()->getHdistributions()); + if (alg == BCAlgorithm::VelocityWithDensityAndThixotropyBCAlgorithm) + std::static_pointer_cast<VelocityWithDensityAndThixotropyBCAlgorithm>(bca) + ->addDistributionsH(kernel->getDataSet()->getHdistributions()); + + bca->setCollFactor(collFactor); + bca->setCompressible(compressible); + bca->setBcArray(bcArray); + bcProcessor->addBC(bca); + } + } + } + } } } } diff --git a/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.cpp index df20a2de7eb9327ad732211cfa9023e892d29e8c..af78f95185f3f24bd669bd75aad656fe205fbc5c 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SetConnectorsBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= + #include "ConnectorBlockVisitor.h" #include "Communicator.h" #include "ConnectorFactory.h" @@ -29,18 +62,11 @@ void ConnectorBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block) if (grid->getFinestInitializedLevel() > grid->getCoarsestInitializedLevel()) setInterpolationConnectors(grid, block); - if (block->getGlobalID() == 2234) { - UBLOG(logINFO, block->toString()); - } - UBLOG(logDEBUG5, "ConnectorBlockVisitor::visit() - end"); } ////////////////////////////////////////////////////////////////////////// void ConnectorBlockVisitor::setSameLevelConnectors(SPtr<Grid3D> grid, SPtr<Block3D> block) { - if (block->getGlobalID() == 2234) { - UBLOG(logINFO, block->toString()); - } UBLOG(logDEBUG5, "ConnectorBlockVisitor::setSameLevelConnectors() - start"); int blockRank = block->getRank(); if (gridRank == blockRank && block->isActive()) { @@ -67,9 +93,6 @@ void ConnectorBlockVisitor::setSameLevelConnectors(SPtr<Grid3D> grid, SPtr<Block } } UBLOG(logDEBUG5, "ConnectorBlockVisitor::setSameLevelConnectors() - end"); - if (block->getGlobalID() == 2234) { - UBLOG(logINFO, block->toString()); - } } ////////////////////////////////////////////////////////////////////////// void ConnectorBlockVisitor::setRemoteConnectors(SPtr<Block3D> sblock, SPtr<Block3D> tblock, int dir) @@ -88,9 +111,6 @@ void ConnectorBlockVisitor::setRemoteConnectors(SPtr<Block3D> sblock, SPtr<Block ////////////////////////////////////////////////////////////////////////// void ConnectorBlockVisitor::setInterpolationConnectors(SPtr<Grid3D> grid, SPtr<Block3D> block) { - if (block->getGlobalID() == 2234) { - UBLOG(logINFO, block->toString()); - } UBLOG(logDEBUG5, "ConnectorBlockVisitor::setInterpolationConnectors() - start"); // int blockRank = block->getRank(); diff --git a/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.h b/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.h index 97371655556b96917ee4dae1c80fac626c6aaba5..800b80604d7e7d67ab09441ad61c97ec28ca2ac8 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.h +++ b/src/cpu/VirtualFluidsCore/Visitors/ConnectorBlockVisitor.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SetConnectorsBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef ConnectorBlockVisitor_H #define ConnectorBlockVisitor_H diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp index 70d7874f2123d7f2e4b8c05cd6c1cc1e44d20230..e63ad0e74d3a0c8f1ab2adb55e73c054399131e9 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file InitThixotropyBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= + #include "InitThixotropyBlockVisitor.h" #include "LBMKernel.h" #include "BCProcessor.h" diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.h b/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.h index f7054340d76e91a3c1019e84aa8f71f079e811af..a026a227b972f49295b26dbbfb630bbf0c7d702e 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.h +++ b/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file InitThixotropyBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef InitThixotropyBlockVisitor_H #define InitThixotropyBlockVisitor_H @@ -6,7 +39,7 @@ #include "Block3DVisitor.h" #include "D3Q27System.h" -#include <MuParser/include/muParser.h> +#include <muParser.h> /*================================================================================*/ /* D3Q27ETInitThixotropyBlockVisitor */ diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.cpp index ddc252155882801b6eb4949836be4d68b4ac1b64..9ea340b1618bcc2ad31a21a958424d2b256cf357 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.cpp @@ -89,12 +89,6 @@ void SetConnectorsBlockVisitor::setSameLevelConnectors(SPtr<Grid3D> grid, SPtr<B int ix2 = block->getX2(); int ix3 = block->getX3(); int level = block->getLevel(); - //grid->getAllNeighbors(ix1, ix2, ix3, level, level, neighbors); - - //if (block->getGlobalID()==2512) - //{ - // int test = 0; - //} for( int dir = 0; dir < dirs; dir++) { @@ -124,11 +118,6 @@ void SetConnectorsBlockVisitor::setSameLevelConnectors(SPtr<Grid3D> grid, SPtr<B } } - //if (block->getGlobalID()==2794) - //{ - // UBLOG(logINFO, block->toString()); - //} - int weight = block->getNumberOfLocalConnectorsForSurfaces(); weight = 6 - weight; block->addWeightForAll(weight);