diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 74c428da9b9baa1b652282f50f4db55693c10830..f274d315a8fc17e0b6dfc923b9c4c24980e5de21 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,6 +45,7 @@ stages: - cd $CI_PROJECT_DIR/$BUILD_FOLDER - cmake .. --preset=all_make + -DBUILD_WARNINGS_AS_ERRORS=ON -DCMAKE_CUDA_ARCHITECTURES=60 - cmake . -LAH - make -j4 @@ -87,6 +88,7 @@ gcc_9_rebuild: - rm -r -f ./* - cmake .. --preset=all_make_ccache + -DBUILD_WARNINGS_AS_ERRORS=ON -DCMAKE_CUDA_ARCHITECTURES=60 - make -j4 2>&1 | tee gcc_warnings.txt - ccache -s @@ -100,37 +102,6 @@ gcc_9_rebuild: paths: - $CI_PROJECT_DIR/cache - -############################################################################### -gcc_9_cpu_warning_like_errors: - stage: build - - image: irmb/virtualfluids-deps-ubuntu20.04 - - tags: - - gpu - - linux - - before_script: - - export CCACHE_BASEDIR=$CI_PROJECT_DIR - - export CCACHE_DIR=$CI_PROJECT_DIR/cache - - ccache -s - - script: - - mkdir -p $CI_PROJECT_DIR/build - - cd $CI_PROJECT_DIR/build - - rm -r -f ./* - - cmake .. - --preset=cpu_make_ccache - -DBUILD_WARNINGS_AS_ERRORS=ON - - make -j4 - - ccache -s - - cache: - key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" - paths: - - $CI_PROJECT_DIR/cache - ############################################################################### msvc_16: stage: build @@ -156,7 +127,7 @@ msvc_16: - cd $CI_PROJECT_DIR - md -force $env:BUILD_FOLDER - cd $env:BUILD_FOLDER - - cmake .. --preset=all_msvc + - cmake .. --preset=all_msvc -DBUILD_WARNINGS_AS_ERRORS=ON - MSBuild.exe VirtualFluids.sln /property:Configuration=$env:BUILD_CONFIGURATION /verbosity:minimal /maxcpucount:4 cache: diff --git a/CMake/3rd/boost.cmake b/CMake/3rd/boost.cmake index 74f6f165cda1ef93f64dd326c961b2663bc6ea67..89d4bfd8757e9b914ae8dbc2a1aea672efa0ba29 100644 --- a/CMake/3rd/boost.cmake +++ b/CMake/3rd/boost.cmake @@ -30,10 +30,8 @@ function(linkBoost) if(DEFINED ARG_COMPONENTS) find_package( Boost REQUIRED COMPONENTS ${ARG_COMPONENTS}) target_link_libraries(${library_name} PRIVATE ${Boost_LIBRARIES}) - message("here") else() find_package( Boost REQUIRED) - message("or here") endif() diff --git a/CMake/CMakeSetCompilerFlags.cmake b/CMake/CMakeSetCompilerFlags.cmake index 784f3f24a7cde518e113363aa92ce90fec0e9c2d..2ea8c0b2faf0a398681e32232aa7d247b511c72c 100644 --- a/CMake/CMakeSetCompilerFlags.cmake +++ b/CMake/CMakeSetCompilerFlags.cmake @@ -68,6 +68,9 @@ function(addAdditionalFlags project_name) # compile options foreach(flag IN LISTS CS_COMPILER_FLAGS_CXX) target_compile_options(${project_name} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${flag}>") + if(MSVC) + target_compile_options(${project_name} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=${flag}>") + endif() endforeach() foreach(flag IN LISTS CS_COMPILER_FLAGS_CXX_DEBUG) diff --git a/CMake/compilerflags/MSVC.cmake b/CMake/compilerflags/MSVC.cmake index 2af38d98e63cf04c4da476fb02754ce47510e4f6..3cde5bee9e17668fe24e57f84a39308f9a0ada18 100644 --- a/CMake/compilerflags/MSVC.cmake +++ b/CMake/compilerflags/MSVC.cmake @@ -8,7 +8,7 @@ list(APPEND CS_COMPILER_FLAGS_CXX "-MP") # enable multi-threaded compiling ############################################################################################################# # warnings ############################################################################################################# -list(APPEND CS_COMPILER_FLAGS_CXX "/W4") # highest warning level +list(APPEND CS_COMPILER_FLAGS_CXX "/W3") # highest warning level # With W4 the following warnings appear many times. As long they are not eliminated they are suppressed: list(APPEND CS_COMPILER_FLAGS_CXX "/wd4458") # C4458: declaration of 'XXX' hides class member @@ -25,6 +25,18 @@ list(APPEND CS_COMPILER_FLAGS_CXX "/wd4701") # C4701: potentially uninitialized list(APPEND CS_COMPILER_FLAGS_CXX "/wd4251") # disable needs to have dll interface list(APPEND CS_COMPILER_FLAGS_CXX "/wd4005") # disable macro redefinition (triggered by metis.h) + +list(APPEND CS_COMPILER_FLAGS_CXX "/wd26812") # disable the enum type is unscoped +list(APPEND CS_COMPILER_FLAGS_CXX "/wd4100") # unreferenced formal parameter +list(APPEND CS_COMPILER_FLAGS_CXX "/wd4324") # structure was padded +list(APPEND CS_COMPILER_FLAGS_CXX "/wd4201") # nonstandard extension used : nameless struct/union + + +if(BUILD_WARNINGS_AS_ERRORS) + list(APPEND CS_COMPILER_FLAGS_CXX "/WX") +endif() + + ############################################################################################################# # preprocessor definitions ############################################################################################################# diff --git a/CMakeLists.txt b/CMakeLists.txt index efce16caaf8d40ae3f5a9ca9bcedd5c5a6767bf5..5c67ec6b6359adfc7deb938d272309c6cdd783be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,9 +103,18 @@ if(BUILD_VF_GPU) message(FATAL_ERROR "CUDA Compiler was requested but is not found on the system.") endif() - set(CMAKE_CUDA_STANDARD 11) + if(MSVC) + # With the MSVC compiler we got this warning: nvcc : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored. + # But we build the c++ code with C++14. Until we have not a solution here, we set the standard to 11 here. + set(CMAKE_CUDA_STANDARD 11) + else() + set(CMAKE_CUDA_STANDARD 14) + endif() + set(CMAKE_CUDA_STANDARD_REQUIRED TRUE) + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcudafe --display_error_number") + if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) message(WARNING "CMAKE_CUDA_ARCHITECTURES was not defined and is set to 30 (CUDA support until 10.1 only).") set(CMAKE_CUDA_ARCHITECTURES 30) diff --git a/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp b/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp index da53c05db9eeed857e8b6cfed4002aa99e398994..72942b001e6d839b6f86c452a0f9db562f43562d 100644 --- a/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp +++ b/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp @@ -93,7 +93,7 @@ const real Re = 500.0;// 1000.0; const real velocity = 1.0; -const real dt = 1.0e-3; //0.5e-3; +const real dt = (real)1.0e-3; //0.5e-3; const uint nx = 64; @@ -162,8 +162,8 @@ void multipleLevel(const std::string& configPath) const real velocityLB = velocity * dt / dx; // LB units - const real vx = velocityLB / sqrt(2.0); // LB units - const real vy = velocityLB / sqrt(2.0); // LB units + const real vx = velocityLB / (real)sqrt(2.0); // LB units + const real vy = velocityLB / (real)sqrt(2.0); // LB units const real viscosityLB = nx * velocityLB / Re; // LB units @@ -364,16 +364,14 @@ int main( int argc, char* argv[]) ////////////////////////////////////////////////////////////////////////// } + catch (const std::bad_alloc& e) + { + *logging::out << logging::Logger::LOGGER_ERROR << "Bad Alloc:" << e.what() << "\n"; + } catch (const std::exception& e) - { - + { *logging::out << logging::Logger::LOGGER_ERROR << e.what() << "\n"; } - catch (const std::bad_alloc e) - { - - *logging::out << logging::Logger::LOGGER_ERROR << "Bad Alloc:" << e.what() << "\n"; - } catch (...) { *logging::out << logging::Logger::LOGGER_ERROR << "Unknown exception!\n"; diff --git a/src/basics/Core/VectorTypes.h b/src/basics/Core/VectorTypes.h index 0256a960ddf53a6d4fb8efee8b54e5d4679987f1..3109112b299e5ac169d9f536a4d4e66b7970cff2 100644 --- a/src/basics/Core/VectorTypes.h +++ b/src/basics/Core/VectorTypes.h @@ -4,9 +4,13 @@ #ifdef __CUDACC__ #include <cuda_runtime.h> #else +#ifndef __host__ #define __host__ +#endif +#ifndef __device__ #define __device__ #endif +#endif #include <cmath> @@ -19,7 +23,7 @@ struct BASICS_EXPORT Vec3 { real x{ c0o1 }, y{ c0o1 }, z{ c0o1 }; __host__ __device__ Vec3(real x, real y, real z) : x(x), y(y), z(z) {} - __host__ __device__ Vec3() = default; + Vec3() = default; __host__ __device__ real length() { return std::sqrt(x * x + y * y + z * z); } 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/basics/geometry3d/GbTriFaceMesh3D.cpp b/src/basics/geometry3d/GbTriFaceMesh3D.cpp index 3615cff63bba077b72f02280854531b9be34df2d..0c13ce378b3a3459aaa21949d5b1b778a43a59a3 100644 --- a/src/basics/geometry3d/GbTriFaceMesh3D.cpp +++ b/src/basics/geometry3d/GbTriFaceMesh3D.cpp @@ -497,6 +497,12 @@ void GbTriFaceMesh3D::setCenterCoordinates(const double &x1, const double &x2, c this->translate(x1 - getX1Centroid(), x2 - getX2Centroid(), x3 - getX3Centroid()); } +/*======================================================================*/ +void GbTriFaceMesh3D::setCenterCoordinates(const UbTupleDouble3 & /*position*/) +{ + throw UbException(UB_EXARGS, "not implemented for " + (std::string) typeid(*this).name()); +} + /*======================================================================*/ void GbTriFaceMesh3D::scale(const double &sx1, const double &sx2, const double &sx3) { diff --git a/src/basics/geometry3d/GbTriFaceMesh3D.h b/src/basics/geometry3d/GbTriFaceMesh3D.h index eb7fc1a9f2119493287052d6a593e39a4e967e9d..7a3654cb1b939f21ebada4400698b69378b032f0 100644 --- a/src/basics/geometry3d/GbTriFaceMesh3D.h +++ b/src/basics/geometry3d/GbTriFaceMesh3D.h @@ -339,6 +339,8 @@ public: void setCenterCoordinates(const double &x1, const double &x2, const double &x3) override; + void setCenterCoordinates(const UbTupleDouble3 & /*position*/) override; + void scale(const double &sx1, const double &sx2, const double &sx3) override; void rotate(const double &alpha, const double &beta, const double &gamma) override; void rotateAroundPoint(const double &px1, const double &px2, const double &px3, const double &alpha, diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseNoSlipBCAlgorithm.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseNoSlipBCAlgorithm.h index a1b9642f0908fbc107e95bd59153e13828c8d3e4..dc6e5bc6a558b18e2b70bfea8ab1ed4bf1853a82 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseNoSlipBCAlgorithm.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseNoSlipBCAlgorithm.h @@ -45,6 +45,6 @@ public: SPtr<BCAlgorithm> clone() override; void addDistributions(SPtr<DistributionArray3D> distributions) override; void addDistributionsH(SPtr<DistributionArray3D> distributionsH) override; - void applyBC(); + void applyBC() override; }; #endif // MultiphaseNoSlipBCAlgorithm_h__ diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp index 76895f1be4c36a43f5955e82aa0d39dcb2e6ddf4..81f7dfc418f3ea13a706fef2820b355131e56a71 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp @@ -131,9 +131,9 @@ void IntegrateValuesHelper::calculateAV() double Avzz = (*averagedValues)(val<1>(node), val<2>(node), val<3>(node), AvVzz); double Avxz = (*averagedValues)(val<1>(node), val<2>(node), val<3>(node), AvVxz); - sAvVx1 += abs(Avx); - sAvVx2 += abs(Avy); - sAvVx3 += abs(Avz); + sAvVx1 += std::abs(Avx); + sAvVx2 += std::abs(Avy); + sAvVx3 += std::abs(Avz); sTSx1 += sqrt(Avxx); sTSx2 += sqrt(Avyy); diff --git a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.cpp index 508442c867797c460490a41ef46e6f4d87599c2a..2d1babf8182b60a53032001d844ebfaef5f9faeb 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.cpp @@ -51,8 +51,11 @@ MultiphaseInitDistributionsBlockVisitor::MultiphaseInitDistributionsBlockVisitor } ////////////////////////////////////////////////////////////////////////// MultiphaseInitDistributionsBlockVisitor::MultiphaseInitDistributionsBlockVisitor( LBMReal densityRatio, LBMReal intThickness, LBMReal radius, LBMReal vx1, LBMReal vx2, LBMReal vx3) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), densityRatio(densityRatio), intThickness(intThickness), radius(radius) + : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), densityRatio(densityRatio) /*, intThickness(intThickness), radius(radius) */ { + (void) intThickness; + (void) radius; + this->setVx1(vx1); this->setVx2(vx2); this->setVx3(vx3); diff --git a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.h b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.h index e6ebadfe85cf7ecb56f49a30eec3ce0c0bd10b86..f94167040ad2f1f8b3cdb1f1e1d4f970d80c8877 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.h +++ b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.h @@ -95,8 +95,8 @@ private: LBMReal nu; LBMReal densityRatio; - LBMReal intThickness; - LBMReal radius; + //LBMReal intThickness; + //LBMReal radius; }; #endif //D3Q27INITDISTRIBUTIONSPATCHVISITOR_H diff --git a/src/gpu/GridGenerator/CMakeLists.txt b/src/gpu/GridGenerator/CMakeLists.txt index 1ce294bf420f657f35397c427929f9f310d04556..516e560470464c748f8fb605a7733f54661fa768 100644 --- a/src/gpu/GridGenerator/CMakeLists.txt +++ b/src/gpu/GridGenerator/CMakeLists.txt @@ -10,4 +10,21 @@ set_target_properties(${library_name} PROPERTIES CUDA_SEPARABLE_COMPILATION ON) # https://stackoverflow.com/questions/50033435/cmake-cuda-separate-compilation-static-lib-link-error-on-windows-but-not-on-ubun if (NOT BUILD_SHARED_LIBRARY) set_target_properties(${library_name} PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON) -endif() \ No newline at end of file +endif() + +# suppress warning 3123, 3126: calling a __host__ function from __host__ __device__ is not allowed +# suppress warning 3152: __host__ function redeclared with __host__ __device__, hence treated as a __host__ __device__ function +# suppress warning 3125, 3127: calling a constexpr __host__ function from a __host__ __device__ function +set(cuda_warnings_suppressions "--diag_suppress=3123 --diag_suppress=3126 --diag_suppress=3152 --diag_suppress=3125 --diag_suppress=3127") + +# suppress warning 3311: unrecognized #pragma in device code +if(NOT MSVC) + set(cuda_warnings_suppressions "${cuda_warnings_suppressions} --diag_suppress=3311") +endif() + +# suppress warning 2979: calling a __host__ function from __host__ __device__ is not allowed +if(MSVC) + set(cuda_warnings_suppressions "${cuda_warnings_suppressions} --diag_suppress=2979 --diag_suppress=2976 --diag_suppress=3005 --diag_suppress=2978 --diag_suppress=3009") +endif() + +target_compile_options(${library_name} PUBLIC $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe ${cuda_warnings_suppressions} >) diff --git a/src/gpu/GridGenerator/StreetPointFinder/JunctionReader.cpp b/src/gpu/GridGenerator/StreetPointFinder/JunctionReader.cpp index 06df9f7788b45b91ede0cdbe7de9b8e60d5b8059..065d4ae646674992889d528a347b8172df98aec6 100644 --- a/src/gpu/GridGenerator/StreetPointFinder/JunctionReader.cpp +++ b/src/gpu/GridGenerator/StreetPointFinder/JunctionReader.cpp @@ -84,7 +84,13 @@ void JunctionReader::readJunctions(std::string filename, StreetPointFinder* stre onlyNeighbors = false; } - else std::cerr << "can't add curve" << std::endl; continue; + else + { + // TODO: this could be a bug, as before this change "continue" was not guarded by the "else" + // https://git.rz.tu-bs.de/irmb/VirtualFluids_dev/-/issues/11 + std::cerr << "can't add curve" << std::endl; + continue; + } } else junctions.push_back(JunctionReaderData(inCells, outCells, carCanNotEnterThisOutCell, trafficLightTime)); 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/StreetPointFinder/StreetPointFinder.cpp b/src/gpu/GridGenerator/StreetPointFinder/StreetPointFinder.cpp index cea0ada4f0eaf4020b794021ce2227a9f3f37b32..23d7c92ab826a7b560c248c4ca51cca831e5ca1f 100644 --- a/src/gpu/GridGenerator/StreetPointFinder/StreetPointFinder.cpp +++ b/src/gpu/GridGenerator/StreetPointFinder/StreetPointFinder.cpp @@ -112,7 +112,7 @@ void StreetPointFinder::prepareSimulationFileData() ////////////////////////////////////////////////////////////////////////// // prepare vectors - uint numberOfCells = this->sparseIndicesLB.size(); + uint numberOfCells = (uint)this->sparseIndicesLB.size(); mapNashToConc.resize(numberOfCells); @@ -518,7 +518,8 @@ void StreetPointFinder::writeStreetVectorFile(std::string gridPath, real concent { for (auto& sparseIndexLB : street.sparseIndicesLB) { - // + 1 for numbering shift between GridGenerator and VF_GPU + (void) sparseIndexLB; + // + 1 for numbering shift between GridGenerator and VF_GPU file << street.getVectorX() << " " << street.getVectorY() << "\n"; } } diff --git a/src/gpu/GridGenerator/geometries/Sphere/Sphere.cu b/src/gpu/GridGenerator/geometries/Sphere/Sphere.cu index 85d353d393d082e9a6196b4ee3a59804b2b5c223..1b316ae74384b4e2f67decd6ab319e0f0d1db2cf 100644 --- a/src/gpu/GridGenerator/geometries/Sphere/Sphere.cu +++ b/src/gpu/GridGenerator/geometries/Sphere/Sphere.cu @@ -1,6 +1,7 @@ #include "Sphere.h" #include <algorithm> // std::min +#include <float.h> #include "geometries/Vertex/Vertex.h" @@ -109,7 +110,7 @@ CUDA_HOST int Sphere::getIntersection(const Vertex & point, const Vertex & direc real q = ( relativePoint.x * relativePoint.x + relativePoint.y * relativePoint.y + relativePoint.z * relativePoint.z - - this->radius * this->radius ) + - (real)this->radius * (real)this->radius ) / directionSquare; real discriminant = 0.25 * p * p - q; @@ -122,8 +123,10 @@ CUDA_HOST int Sphere::getIntersection(const Vertex & point, const Vertex & direc if( result1 < 0.0 && result2 < 0.0 ) return 1; - if( result1 < 0.0 ) result1 = 1e99; - if( result2 < 0.0 ) result2 = 1e99; + if (result1 < 0.0) + result1 = (real)FLT_MAX; + if (result2 < 0.0) + result2 = (real)FLT_MAX; real t = std::min( result1, result2 ); diff --git a/src/gpu/GridGenerator/geometries/Triangle/Triangle.cu b/src/gpu/GridGenerator/geometries/Triangle/Triangle.cu index 0b6aaa080e43f17323cb414e7cb1879446c29bb9..f38eff75ad156daac4d44ce869485319ce305d17 100644 --- a/src/gpu/GridGenerator/geometries/Triangle/Triangle.cu +++ b/src/gpu/GridGenerator/geometries/Triangle/Triangle.cu @@ -36,7 +36,7 @@ HOSTDEVICE Vertex Triangle::get(int index) if (index == 2) return v3; else - return Vertex(-999999999999999, -99999999999999, -9999999999999); + return Vertex((real)-999999999999999, (real)-99999999999999, (real)-9999999999999); } HOSTDEVICE void Triangle::calcNormal() diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cu b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cu index a856613875da5bd8179b9bb67fc707f84fec08cd..4fcf93ef44912ce36aafd026992f77f088774f4e 100644 --- a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cu +++ b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cu @@ -60,7 +60,7 @@ Object* TriangularMesh::clone() const uint TriangularMesh::getNumberOfTriangles() const { - return triangleVec.size(); + return (uint)triangleVec.size(); } @@ -94,7 +94,7 @@ void TriangularMesh::initalizeDataFromTriangles() this->triangles = triangleVec.data(); this->size = long(triangleVec.size()); - for (uint i = 0; i < this->size; i++) { + for (std::size_t i = 0; i < this->size; i++) { this->minmax.setMinMax(this->triangleVec[i]); } } @@ -167,7 +167,7 @@ void TriangularMesh::scale(double offset) auto averrageNormals = getAverrageNormalsPerVertex(trianglesPerVertex); - for (int vertexID = 0; vertexID < this->getNumberOfTriangles() * 3; vertexID++) + for (std::size_t vertexID = 0; vertexID < this->getNumberOfTriangles() * 3; vertexID++) { int coordinatedID = finder.sortedToTriangles[vertexID][IDS::coordinateID]; Vertex averrageNormal = averrageNormals[coordinatedID]; @@ -205,13 +205,13 @@ void TriangularMesh::scale(double offset) //printf("\n\n"); averrageNormal.normalize(); - const int triangleID = vertexID / 3; - const int vertexTriangleID = vertexID % 3; + const int triangleID = (int)vertexID / 3; + const int vertexTriangleID = (int)vertexID % 3; Vertex intersection; Vertex p = this->triangleVec[triangleID].v1 + this->triangleVec[triangleID].normal * offset; Vertex lineOrigin = this->triangleVec[triangleID].get(vertexTriangleID); - bool b = intersectPlane(this->triangleVec[triangleID].normal, p, lineOrigin, averrageNormal, intersection); + //bool b = intersectPlane(this->triangleVec[triangleID].normal, p, lineOrigin, averrageNormal, intersection); triangles[triangleID].set(vertexTriangleID, intersection); triangles[triangleID].calcNormal(); diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp index f4d5d64c1b2c82a7855747343bcc2c04a7b192cb..e3b5a7c4f0c92cb3f31df4fd0cd4697a7000a34d 100644 --- a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp +++ b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp @@ -13,7 +13,7 @@ void TriangularMeshDiscretizationStrategy::removeOddBoundaryCellNodes(GridImp* grid) { #pragma omp parallel for - for (int index = 0; index < grid->getSize(); index++) + for (int index = 0; index < (int)grid->getSize(); index++) grid->fixOddCell(index); } @@ -32,7 +32,7 @@ void PointInObjectDiscretizationStrategy::doDiscretize(TriangularMesh* triangula real outputTime = 60.0; #pragma omp parallel for - for (int index = 0; index < grid->getSize(); index++) + for (int index = 0; index < (int)grid->getSize(); index++) { if( grid->getFieldEntry(index) == InnerType ) continue; @@ -214,7 +214,7 @@ void PointUnderTriangleStrategy::doDiscretize(TriangularMesh* triangularMesh, Gr this->findInsideNodes(grid, innerType); #pragma omp parallel for - for (int i = 0; i < grid->getSize(); i++) + for (int i = 0; i < (int)grid->getSize(); i++) this->setNegativeDirBorderTo(grid, i, innerType); } diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.cpp b/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.cpp index 08fa49fccaecfbc0c2ee6e5ddfd0ee21456a3d6a..4fc0e6dedc287ced661bbea5d1a1f6c30734c70b 100644 --- a/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.cpp +++ b/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.cpp @@ -237,12 +237,11 @@ void TriangleNeighborFinder::fillWithNeighborIndices(IntegerPtr2D *neighborIndic void TriangleNeighborFinder::fillWithNeighborAngles(TriangularMesh *geom) const { - int j, row, index, indexNeighbor; + int j, index, indexNeighbor; //#pragma omp parallel for private(j, row, index, indexNeighbor) shared(neighborAngles->ptr) - for (int i = 0; i < indicesOfTriangleNeighbors.size(); i++){ - row = i * 3; + for (int i = 0; i < (int)indicesOfTriangleNeighbors.size(); i++){ geom->triangles[i].alphaAngles[0] = geom->triangles[i].alphaAngles[1] = geom->triangles[i].alphaAngles[2] = 90.0f; - for (j = 0; j < indicesOfTriangleNeighbors[i].size(); j++){ + for (j = 0; j < (int)indicesOfTriangleNeighbors[i].size(); j++){ indexNeighbor = indicesOfTriangleNeighbors[i][j]; index = geom->triangles[i].getCommonEdge(geom->triangles[indexNeighbor]); geom->triangles[i].alphaAngles[index] = geom->triangles[i].getHalfAngleBetweenToAdjacentTriangle(geom->triangles[indexNeighbor]); diff --git a/src/gpu/GridGenerator/geometries/Vertex/Vertex.cu b/src/gpu/GridGenerator/geometries/Vertex/Vertex.cu index 48a30faad77cd174718a9bb65a6685d6af92f216..875bd4c1d03013f3e33fb9c30f583b82feb6bcf6 100644 --- a/src/gpu/GridGenerator/geometries/Vertex/Vertex.cu +++ b/src/gpu/GridGenerator/geometries/Vertex/Vertex.cu @@ -12,7 +12,15 @@ HOSTDEVICE Vertex::Vertex(const Vertex& v) this->z = v.z; } -HOSTDEVICE real Vertex::getEuclideanDistanceTo(const Vertex &w) const +HOSTDEVICE Vertex& Vertex::operator=(const Vertex& v) +{ + this->x = v.x; + this->y = v.y; + this->z = v.z; + return *this; +} + +HOSTDEVICE real Vertex::getEuclideanDistanceTo(const Vertex &w) const { return vf::Math::sqrtReal((x - w.x)*(x - w.x) + (y - w.y)*(y - w.y) + (z - w.z)*(z - w.z)); } diff --git a/src/gpu/GridGenerator/geometries/Vertex/Vertex.h b/src/gpu/GridGenerator/geometries/Vertex/Vertex.h index 65710b870e5e1f20cf088992fb6f35448722f3f9..cabbc21c92113b490d31b6e6ae9ad834b41fd44b 100644 --- a/src/gpu/GridGenerator/geometries/Vertex/Vertex.h +++ b/src/gpu/GridGenerator/geometries/Vertex/Vertex.h @@ -18,6 +18,7 @@ public: HOSTDEVICE Vertex(real x, real y, real z); HOSTDEVICE Vertex(); HOSTDEVICE Vertex(const Vertex& v); + HOSTDEVICE Vertex& operator=(const Vertex&); HOSTDEVICE ~Vertex() {} HOSTDEVICE real getEuclideanDistanceTo(const Vertex &w) const; diff --git a/src/gpu/GridGenerator/grid/BoundaryConditions/BoundaryCondition.h b/src/gpu/GridGenerator/grid/BoundaryConditions/BoundaryCondition.h index 3b58b14bf714fa184f2c6b2d9e5a78f8386c302e..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; @@ -81,7 +83,8 @@ public: void fillVelocityLists() { - for( uint index : this->indices ){ + for( uint index : this->indices ) { + (void) index; this->vxList.push_back(vx); this->vyList.push_back(vy); this->vzList.push_back(vz); diff --git a/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp b/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp index aee2154ccc9c22d752e9e9a94fe1585c73116b4c..00ac6b3ddf7ac4d63dbdbf299d56f8126d6abdc6 100644 --- a/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp +++ b/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp @@ -75,16 +75,22 @@ void Side::setQs(SPtr<Grid> grid, SPtr<BoundaryCondition> boundaryCondition, uin // correct neighbor coordinates in case of periodic boundaries if( grid->getPeriodicityX() && grid->getFieldEntry( grid->transCoordToIndex( neighborX, y, z ) ) == STOPPER_OUT_OF_GRID_BOUNDARY ) + { if( neighborX > x ) neighborX = grid->getFirstFluidNode( coords, 0, grid->getStartX() ); else neighborX = grid->getLastFluidNode ( coords, 0, grid->getEndX() ); + } if( grid->getPeriodicityY() && grid->getFieldEntry( grid->transCoordToIndex( x, neighborY, z ) ) == STOPPER_OUT_OF_GRID_BOUNDARY ) + { if( neighborY > y ) neighborY = grid->getFirstFluidNode( coords, 1, grid->getStartY() ); else neighborY = grid->getLastFluidNode ( coords, 1, grid->getEndY() ); + } if( grid->getPeriodicityZ() && grid->getFieldEntry( grid->transCoordToIndex( x, y, neighborZ ) ) == STOPPER_OUT_OF_GRID_BOUNDARY ) + { if( neighborZ > z ) neighborZ = grid->getFirstFluidNode( coords, 2, grid->getStartZ() ); else neighborZ = grid->getLastFluidNode ( coords, 2, grid->getEndZ() ); + } uint neighborIndex = grid->transCoordToIndex( neighborX, neighborY, neighborZ ); @@ -116,7 +122,6 @@ void Geometry::addIndices(std::vector<SPtr<Grid> > grids, uint level, SPtr<Bound auto geometryBoundaryCondition = std::dynamic_pointer_cast<GeometryBoundaryCondition>(boundaryCondition); std::vector<real> qNode(grids[level]->getEndDirection() + 1); - bool qFound = false; for (uint index = 0; index < grids[level]->getSize(); index++) { @@ -148,8 +153,6 @@ void Geometry::addIndices(std::vector<SPtr<Grid> > grids, uint level, SPtr<Bound geometryBoundaryCondition->indices.push_back(index); geometryBoundaryCondition->qs.push_back(qNode); geometryBoundaryCondition->patches.push_back( grids[level]->getQPatch(index) ); - - qFound = false; } } diff --git a/src/gpu/GridGenerator/grid/BoundaryConditions/Side.h b/src/gpu/GridGenerator/grid/BoundaryConditions/Side.h index 717b965d04e8922f8f34f6ade54bde274368906e..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; @@ -218,6 +220,8 @@ public: return SPtr<Side>(new PZ()); case SideType::GEOMETRY: return SPtr<Side>(new Geometry()); + default: + throw std::runtime_error("SideFactory::make() - SideType not valid."); } } }; diff --git a/src/gpu/GridGenerator/grid/Grid.h b/src/gpu/GridGenerator/grid/Grid.h index e4bbfdecb3decf414efb42d5b13f2faa710bde69..f6c17551e170a78376b5e0d4075895c710651ead 100644 --- a/src/gpu/GridGenerator/grid/Grid.h +++ b/src/gpu/GridGenerator/grid/Grid.h @@ -82,7 +82,7 @@ public: CUDA_HOST virtual void findGridInterface(SPtr<Grid> grid, LbmOrGks lbmOrGks) = 0; - CUDA_HOST virtual void repairGridInterfaceOnMultiGPU(SPtr<Grid> fineGrid) = 0; + HOSTDEVICE virtual void repairGridInterfaceOnMultiGPU(SPtr<Grid> fineGrid) = 0; CUDA_HOST virtual void limitToSubDomain(SPtr<BoundingBox> subDomainBox, LbmOrGks lbmOrGks) = 0; diff --git a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp index 8d2025d4f305e268b645dd651a5d736a0d3b1c47..f245472984c46a4a7419dd1c50cf70fb8729e907 100644 --- a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp +++ b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp @@ -51,7 +51,7 @@ void LevelGridBuilder::setVelocityBoundaryCondition(SideType sideType, real vx, setVelocityGeometryBoundaryCondition(vx, vy, vz); else { - for (int level = 0; level < getNumberOfGridLevels(); level++) + for (uint level = 0; level < getNumberOfGridLevels(); level++) { SPtr<VelocityBoundaryCondition> velocityBoundaryCondition = VelocityBoundaryCondition::make(vx, vy, vz); @@ -73,7 +73,7 @@ void LevelGridBuilder::setVelocityGeometryBoundaryCondition(real vx, real vy, re { geometryHasValues = true; - for (int level = 0; level < getNumberOfGridLevels(); level++) + for (uint level = 0; level < getNumberOfGridLevels(); level++) { if (boundaryConditions[level]->geometryBoundaryCondition != nullptr) { @@ -91,7 +91,7 @@ void LevelGridBuilder::setVelocityGeometryBoundaryCondition(real vx, real vy, re void LevelGridBuilder::setPressureBoundaryCondition(SideType sideType, real rho) { - for (int level = 0; level < getNumberOfGridLevels(); level++) + for (uint level = 0; level < getNumberOfGridLevels(); level++) { SPtr<PressureBoundaryCondition> pressureBoundaryCondition = PressureBoundaryCondition::make(rho); @@ -113,7 +113,7 @@ void LevelGridBuilder::setPeriodicBoundaryCondition(bool periodic_X, bool period void LevelGridBuilder::setNoSlipBoundaryCondition(SideType sideType) { - for (int level = 0; level < getNumberOfGridLevels(); level++) + for (uint level = 0; level < getNumberOfGridLevels(); level++) { SPtr<VelocityBoundaryCondition> noSlipBoundaryCondition = VelocityBoundaryCondition::make(0.0, 0.0, 0.0); @@ -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())); @@ -269,7 +269,7 @@ std::shared_ptr<Grid> LevelGridBuilder::getGrid(int level, int box) void LevelGridBuilder::checkLevel(int level) { - if (level >= grids.size()) + if (level >= (int)grids.size()) { std::cout << "wrong level input... return to caller\n"; return; @@ -311,13 +311,13 @@ void LevelGridBuilder::getVelocityValues(real* vx, real* vy, real* vz, int* indi int allIndicesCounter = 0; for (auto boundaryCondition : boundaryConditions[level]->velocityBoundaryConditions) { - for(int i = 0; i < boundaryCondition->indices.size(); i++) + for(std::size_t i = 0; i < boundaryCondition->indices.size(); i++) { indices[allIndicesCounter] = grids[level]->getSparseIndex(boundaryCondition->indices[i]) +1; - vx[allIndicesCounter] = boundaryCondition->getVx(i); - vy[allIndicesCounter] = boundaryCondition->getVy(i); - vz[allIndicesCounter] = boundaryCondition->getVz(i); + vx[allIndicesCounter] = (uint)boundaryCondition->getVx((uint)i); + vy[allIndicesCounter] = (uint)boundaryCondition->getVy((uint)i); + vz[allIndicesCounter] = (uint)boundaryCondition->getVz((uint)i); allIndicesCounter++; } } @@ -338,7 +338,7 @@ void LevelGridBuilder::getPressureValues(real* rho, int* indices, int* neighborI int allIndicesCounter = 0; for (auto boundaryCondition : boundaryConditions[level]->pressureBoundaryConditions) { - for (int i = 0; i < boundaryCondition->indices.size(); i++) + for (std::size_t i = 0; i < boundaryCondition->indices.size(); i++) { indices[allIndicesCounter] = grids[level]->getSparseIndex(boundaryCondition->indices[i]) + 1; @@ -419,7 +419,7 @@ void LevelGridBuilder::getPressureQs(real* qs[27], int level) const uint LevelGridBuilder::getGeometrySize(int level) const { if (boundaryConditions[level]->geometryBoundaryCondition) - return boundaryConditions[level]->geometryBoundaryCondition->indices.size(); + return (uint)boundaryConditions[level]->geometryBoundaryCondition->indices.size(); return 0; } @@ -451,7 +451,7 @@ void LevelGridBuilder::getGeometryValues(real* vx, real* vy, real* vz, int level void LevelGridBuilder::getGeometryQs(real* qs[27], int level) const { - for (int i = 0; i < boundaryConditions[level]->geometryBoundaryCondition->indices.size(); i++) + for (std::size_t i = 0; i < boundaryConditions[level]->geometryBoundaryCondition->indices.size(); i++) { for (int dir = 0; dir <= grids[level]->getEndDirection(); dir++) { 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 1fa4d3ccb08dc5e0d3d31f68e4c3e28d6af798e5..bd8bcbd4d0a059acede4e95fa8f06d102904351f 100644 --- a/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.cpp +++ b/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.cpp @@ -214,8 +214,8 @@ std::array<real, 6> MultipleGridBuilder::getStaggeredCoordinates(Object* gridSha // This method computes the start and end coordinates with respect to the coarse grid // The following sketch visualizes this procedure for level 2: // - // /----------------------- domain --------------------------------\ - // | /----------------- refinement region ------------------------\ + // /----------------------- domain --------------------------------/ + // | /----------------- refinement region ------------------------/ // | | | | // | | | | // Level 2: | 2 2| 2 2 2 2 2 2 2 2 2 2 | 2 (2) (2) (2) | @@ -461,16 +461,16 @@ 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 = (int)grids.size()-1; level >= 0; level-- ) { *logging::out << logging::Logger::INFO_INTERMEDIATE << "Start initializing level " << level << "\n"; // On the coarse grid every thing is Fluid (w.r.t. the refinement) // On the finest grid the Fluid region is defined by the Object // On the intermediate levels the Fluid region is defined by the fluid region of the finer level - if ( level == 0 ) + if(level == 0) grids[level]->inital( nullptr, 0 ); - else if( level == grids.size()-1 ) + else if(level == (int)grids.size() - 1) grids[level]->inital( nullptr, this->numberOfLayersFine ); else grids[level]->inital( grids[level+1], this->numberOfLayersBetweenLevels ); @@ -500,7 +500,7 @@ void MultipleGridBuilder::buildGrids( LbmOrGks lbmOrGks, bool enableThinWalls ) // change the following two lines. This is not tested though! //for( uint level = 0; level < grids.size(); level++ ) - uint level = grids.size() - 1; + uint level = (uint)grids.size() - 1; { // the Grid::mesh(...) method distinguishes inside and ouside regions // of the solid domain.: @@ -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.cu b/src/gpu/GridGenerator/grid/GridImp.cu index 16deb16fd7bd6f14a115615afa25545057beb454..cd835ee1c512d23969aa2d448a3c18b5a5179ed8 100644 --- a/src/gpu/GridGenerator/grid/GridImp.cu +++ b/src/gpu/GridGenerator/grid/GridImp.cu @@ -180,7 +180,7 @@ HOSTDEVICE void GridImp::findInnerNode(uint index) HOSTDEVICE void GridImp::discretize(Object* solidObject, char innerType, char outerType) { #pragma omp parallel for - for (int index = 0; index < this->size; index++) + for (int index = 0; index < (int)this->size; index++) { this->sparseIndices[index] = index; @@ -465,7 +465,10 @@ HOSTDEVICE void GridImp::setNodeTo(uint index, char type) HOSTDEVICE bool GridImp::isNode(uint index, char type) const { if( index != INVALID_INDEX ) - return field.is(index, type); + return field.is(index, type); + + return false; + // TODO: cannot throw on gpu: throw std::runtime_error("GridImp::isNode() -> index == INVALID_INDEX not supported."); } HOSTDEVICE bool GridImp::isValidEndOfGridStopper(uint index) const @@ -797,7 +800,7 @@ CUDA_HOST uint GridImp::getNumberOfSolidBoundaryNodes() const CUDA_HOST void GridImp::setNumberOfSolidBoundaryNodes(uint numberOfSolidBoundaryNodes) { - if (numberOfSolidBoundaryNodes >= 0 && numberOfSolidBoundaryNodes < INVALID_INDEX) + if (numberOfSolidBoundaryNodes < INVALID_INDEX) this->numberOfSolidBoundaryNodes = numberOfSolidBoundaryNodes; } @@ -1296,7 +1299,7 @@ CUDA_HOST void GridImp::findQsPrimitive(Object * object) } - for( int index = 0; index < this->size; index++ ) + for( int index = 0; index < (int)this->size; index++ ) { if( this->qIndices[index] == INVALID_INDEX ) continue; @@ -1551,12 +1554,12 @@ void GridImp::findCommunicationIndex( uint index, real coordinate, real limit, i uint GridImp::getNumberOfSendNodes(int direction) { - return this->communicationIndices[direction].sendIndices.size(); + return (uint)this->communicationIndices[direction].sendIndices.size(); } uint GridImp::getNumberOfReceiveNodes(int direction) { - return this->communicationIndices[direction].receiveIndices.size(); + return (uint)this->communicationIndices[direction].receiveIndices.size(); } uint GridImp::getSendIndex(int direction, uint index) diff --git a/src/gpu/GridGenerator/grid/GridImp.h b/src/gpu/GridGenerator/grid/GridImp.h index be9bc9e17e4f91ddeb7dd743380039c0811a822f..314020d0e6a271d0761d6935f8e55c5c7ea6bade 100644 --- a/src/gpu/GridGenerator/grid/GridImp.h +++ b/src/gpu/GridGenerator/grid/GridImp.h @@ -21,8 +21,22 @@ class Object; class BoundingBox; class TriangularMeshDiscretizationStrategy; +#ifdef __GNUC__ + #ifndef __clang__ + #pragma push + #pragma diag_suppress = 3156 + #endif +#endif + +//GCC: warning #3156-D: extern declaration of the entity DIRECTIONS is treated as a static definition extern CONSTANT int DIRECTIONS[DIR_END_MAX][DIMENSION]; +#ifdef __GNUC__ + #ifndef __clang__ + #pragma pop + #endif +#endif + class GRIDGENERATOR_EXPORT GridImp : public enableSharedFromThis<GridImp>, public Grid { private: @@ -111,7 +125,7 @@ public: CUDA_HOST virtual void findGridInterface(SPtr<Grid> grid, LbmOrGks lbmOrGks) override; - CUDA_HOST void repairGridInterfaceOnMultiGPU(SPtr<Grid> fineGrid) override; + HOSTDEVICE void repairGridInterfaceOnMultiGPU(SPtr<Grid> fineGrid) override; CUDA_HOST virtual void limitToSubDomain(SPtr<BoundingBox> subDomainBox, LbmOrGks lbmOrGks) override; @@ -184,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; @@ -224,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; @@ -270,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/grid/GridInterface.cu b/src/gpu/GridGenerator/grid/GridInterface.cu index 00ce04f098f7f24332167d310f9dc30259907987..ec88c3b4afed654999cc6f6be16005a020cd0cd7 100644 --- a/src/gpu/GridGenerator/grid/GridInterface.cu +++ b/src/gpu/GridGenerator/grid/GridInterface.cu @@ -278,7 +278,7 @@ CUDA_HOST void GRIDGENERATOR_EXPORT GridInterface::repairGridInterfaceOnMultiGPU delete[] cf.fine; delete[] cf.offset; - cf.numberOfEntries = tmpCFC.size(); + cf.numberOfEntries = (uint)tmpCFC.size(); cf.coarse = new uint[cf.numberOfEntries]; cf.fine = new uint[cf.numberOfEntries]; @@ -311,7 +311,7 @@ CUDA_HOST void GRIDGENERATOR_EXPORT GridInterface::repairGridInterfaceOnMultiGPU delete[] fc.coarse; delete[] fc.offset; - fc.numberOfEntries = tmpFCC.size(); + fc.numberOfEntries = (uint)tmpFCC.size(); fc.fine = new uint[fc.numberOfEntries]; fc.coarse = new uint[fc.numberOfEntries]; diff --git a/src/gpu/GridGenerator/grid/GridStrategy/GridCpuStrategy/GridCpuStrategy.cpp b/src/gpu/GridGenerator/grid/GridStrategy/GridCpuStrategy/GridCpuStrategy.cpp index d6aae77272559e78e5eef14711bb35495c518a31..34fbe03eb121c33fa01069d9498e833c6435510d 100644 --- a/src/gpu/GridGenerator/grid/GridStrategy/GridCpuStrategy/GridCpuStrategy.cpp +++ b/src/gpu/GridGenerator/grid/GridStrategy/GridCpuStrategy/GridCpuStrategy.cpp @@ -40,20 +40,20 @@ void GridCpuStrategy::allocateQs(SPtr<GridImp> grid) grid->qPatches = new uint[grid->getNumberOfSolidBoundaryNodes()]; //grid->qPatches.resize( grid->getNumberOfSolidBoundaryNodes() ); - for( int i = 0; i < grid->getNumberOfSolidBoundaryNodes(); i++ ) + for( uint i = 0; i < grid->getNumberOfSolidBoundaryNodes(); i++ ) grid->qPatches[i] = INVALID_INDEX; - const uint numberOfQs = grid->getNumberOfSolidBoundaryNodes() * (grid->distribution.dir_end + 1); - grid->qValues = new real[numberOfQs]; + const uint numberOfQs = grid->getNumberOfSolidBoundaryNodes() * (grid->distribution.dir_end + 1); + grid->qValues = new real[numberOfQs]; #pragma omp parallel for - for (int i = 0; i < numberOfQs; i++) + for (int i = 0; i < (int)numberOfQs; i++) grid->qValues[i] = -1.0; } void GridCpuStrategy::initalNodesToOutOfGrid(SPtr<GridImp> grid) { #pragma omp parallel for - for (int index = 0; index < grid->size; index++) + for (int index = 0; index < (int)grid->size; index++) grid->initalNodeToOutOfGrid(index); } @@ -66,7 +66,7 @@ void GridCpuStrategy::allocateFieldMemory(Field* field) void GridCpuStrategy::findInnerNodes(SPtr<GridImp> grid) { #pragma omp parallel for - for (int index = 0; index < grid->size; index++) + for (int index = 0; index < (int)grid->size; index++) grid->findInnerNode(index); } @@ -74,11 +74,11 @@ void GridCpuStrategy::addOverlap(SPtr<GridImp> grid) { #pragma omp parallel for - for( int index = 0; index < grid->size; index++ ) + for( int index = 0; index < (int)grid->size; index++ ) grid->setOverlapTmp( index ); #pragma omp parallel for - for( int index = 0; index < grid->size; index++ ) + for( int index = 0; index < (int)grid->size; index++ ) grid->setOverlapFluid( index ); } @@ -86,31 +86,31 @@ void GridCpuStrategy::addOverlap(SPtr<GridImp> grid) void GridCpuStrategy::fixOddCells(SPtr<GridImp> grid) { #pragma omp parallel for - for (int index = 0; index < grid->size; index++) + for (int index = 0; index < (int)grid->size; index++) grid->fixOddCell(index); } void GridCpuStrategy::fixRefinementIntoWall(SPtr<GridImp> grid) { #pragma omp parallel for - for (int xIdx = 0; xIdx < grid->nx; xIdx++){ - for (int yIdx = 0; yIdx < grid->ny; yIdx++){ + for (int xIdx = 0; xIdx < (int)grid->nx; xIdx++){ + for (uint yIdx = 0; yIdx < grid->ny; yIdx++){ grid->fixRefinementIntoWall( xIdx, yIdx, 0 , 3 ); grid->fixRefinementIntoWall( xIdx, yIdx, grid->nz-1, -3 ); } } #pragma omp parallel for - for (int xIdx = 0; xIdx < grid->nx; xIdx++){ - for (int zIdx = 0; zIdx < grid->nz; zIdx++){ + for (int xIdx = 0; xIdx < (int)grid->nx; xIdx++){ + for (uint zIdx = 0; zIdx < grid->nz; zIdx++){ grid->fixRefinementIntoWall( xIdx, 0, zIdx, 2 ); grid->fixRefinementIntoWall( xIdx, grid->ny-1, zIdx, -2 ); } } #pragma omp parallel for - for (int yIdx = 0; yIdx < grid->ny; yIdx++){ - for (int zIdx = 0; zIdx < grid->nz; zIdx++){ + for (int yIdx = 0; yIdx < (int)grid->ny; yIdx++){ + for (uint zIdx = 0; zIdx < grid->nz; zIdx++){ grid->fixRefinementIntoWall( 0, yIdx, zIdx, 1 ); grid->fixRefinementIntoWall( grid->nx-1, yIdx, zIdx, -1 ); } @@ -121,28 +121,28 @@ void GridCpuStrategy::fixRefinementIntoWall(SPtr<GridImp> grid) void GridCpuStrategy::findStopperNodes(SPtr<GridImp> grid) { #pragma omp parallel for - for (int index = 0; index < grid->size; index++) + for (int index = 0; index < (int)grid->size; index++) grid->findStopperNode(index); } void GridCpuStrategy::findEndOfGridStopperNodes(SPtr<GridImp> grid) { #pragma omp parallel for - for (int index = 0; index < grid->size; index++) + for (int index = 0; index < (int)grid->size; index++) grid->findEndOfGridStopperNode(index); } void GridCpuStrategy::findSolidStopperNodes(SPtr<GridImp> grid) { #pragma omp parallel for - for (int index = 0; index < grid->size; index++) + for (int index = 0; index < (int)grid->size; index++) grid->findSolidStopperNode(index); } void GridCpuStrategy::findBoundarySolidNodes(SPtr<GridImp> grid) { //#pragma omp parallel for - for (int index = 0; index < grid->size; index++) + for (int index = 0; index < (int)grid->size; index++) { grid->findBoundarySolidNode(index); } @@ -160,7 +160,7 @@ uint GridCpuStrategy::closeNeedleCells(SPtr<GridImp> grid) uint numberOfClosedNeedleCells = 0; #pragma omp parallel for reduction(+:numberOfClosedNeedleCells) - for (int index = 0; index < grid->size; index++) + for (int index = 0; index < (int)grid->size; index++) { if( grid->closeCellIfNeedle(index) ) numberOfClosedNeedleCells++; @@ -174,7 +174,7 @@ uint GridCpuStrategy::closeNeedleCellsThinWall(SPtr<GridImp> grid) uint numberOfClosedNeedleCells = 0; #pragma omp parallel for reduction(+:numberOfClosedNeedleCells) - for (int index = 0; index < grid->size; index++) + for (int index = 0; index < (int)grid->size; index++) { if( grid->closeCellIfNeedleThinWall(index) ) numberOfClosedNeedleCells++; @@ -197,8 +197,6 @@ void GridCpuStrategy::findGridInterface(SPtr<GridImp> grid, SPtr<GridImp> fineGr const auto fineLevel = fineGrid->getLevel(); *logging::out << logging::Logger::INFO_INTERMEDIATE << "find interface level " << coarseLevel << " -> " << fineLevel; - const uint oldGridSize = grid->getSparseSize(); - grid->gridInterface = new GridInterface(); // TODO: this is stupid! concave refinements can easily have many more interface cells @@ -210,22 +208,21 @@ void GridCpuStrategy::findGridInterface(SPtr<GridImp> grid, SPtr<GridImp> fineGr grid->gridInterface->fc.fine = new uint[sizeCF]; grid->gridInterface->fc.offset = new uint[sizeCF]; - for (int index = 0; index < grid->getSize(); index++) + for (uint index = 0; index < grid->getSize(); index++) grid->findGridInterfaceCF(index, *fineGrid, lbmOrGks); - for (int index = 0; index < grid->getSize(); index++) + for (uint index = 0; index < grid->getSize(); index++) grid->findGridInterfaceFC(index, *fineGrid); - for (int index = 0; index < grid->getSize(); index++) + for (uint index = 0; index < grid->getSize(); index++) grid->findOverlapStopper(index, *fineGrid); if( lbmOrGks == GKS ) { - for (int index = 0; index < grid->getSize(); index++) + for (uint index = 0; index < grid->getSize(); index++) grid->findInvalidBoundaryNodes(index); } - const uint newGridSize = grid->getSparseSize(); *logging::out << logging::Logger::INFO_INTERMEDIATE << " ... done. \n"; } @@ -249,18 +246,18 @@ void GridCpuStrategy::findSparseIndices(SPtr<GridImp> coarseGrid, SPtr<GridImp> void GridCpuStrategy::findForNeighborsNewIndices(SPtr<GridImp> grid) { #pragma omp parallel for - for (int index = 0; index < grid->getSize(); index++) + for (int index = 0; index < (int)grid->getSize(); index++) grid->setNeighborIndices(index); } void GridCpuStrategy::findForGridInterfaceNewIndices(SPtr<GridImp> grid, SPtr<GridImp> fineGrid) { #pragma omp parallel for - for (int index = 0; index < grid->getNumberOfNodesCF(); index++) + for (int index = 0; index < (int)grid->getNumberOfNodesCF(); index++) grid->gridInterface->findForGridInterfaceSparseIndexCF(grid.get(), fineGrid.get(), index); #pragma omp parallel for - for (int index = 0; index < grid->getNumberOfNodesFC(); index++) + for (int index = 0; index < (int)grid->getNumberOfNodesFC(); index++) grid->gridInterface->findForGridInterfaceSparseIndexFC(grid.get(), fineGrid.get(), index); } diff --git a/src/gpu/GridGenerator/grid/GridStrategy/GridGpuStrategy/GridGpuStrategy.cpp b/src/gpu/GridGenerator/grid/GridStrategy/GridGpuStrategy/GridGpuStrategy.cpp index 1f872414c00dd90acb4d7f2e0556444900f59a92..a19daf22aba77480763c7c91f6bf29bb6ebacdd3 100644 --- a/src/gpu/GridGenerator/grid/GridStrategy/GridGpuStrategy/GridGpuStrategy.cpp +++ b/src/gpu/GridGenerator/grid/GridStrategy/GridGpuStrategy/GridGpuStrategy.cpp @@ -41,7 +41,7 @@ void GridGpuStrategy::fixOddCells(SPtr<GridImp> grid) void GridGpuStrategy::findInnerNodes(SPtr<GridImp> grid) { - float time = runKernelInitalUniformGrid3d(LaunchParameter::make_2D1D_launchParameter(grid->size, 256), *grid.get()); + //float time = runKernelInitalUniformGrid3d(LaunchParameter::make_2D1D_launchParameter(grid->size, 256), *grid.get()); } void GridGpuStrategy::addOverlap(SPtr<GridImp> grid) diff --git a/src/gpu/GridGenerator/grid/distributions/Distribution.cpp b/src/gpu/GridGenerator/grid/distributions/Distribution.cpp index 3373db7ce872def6869eb3fd93484c62d269d766..f23c545cd6cb88892724fec5afb29d2f454e96a2 100644 --- a/src/gpu/GridGenerator/grid/distributions/Distribution.cpp +++ b/src/gpu/GridGenerator/grid/distributions/Distribution.cpp @@ -406,8 +406,8 @@ std::vector<std::vector<real> > DistributionHelper::getVectorWithoutRowsWithOnly { std::vector<std::vector<real> > qs_ausgeduennt; bool hasQs = false; - for (int node = 0; node < qs.size(); node++) { - for (int dir = 0; dir < qs[node].size() - 1; dir++) { + for (std::size_t node = 0; node < qs.size(); node++) { + for (std::size_t dir = 0; dir < qs[node].size() - 1; dir++) { if (qs[node][dir + 1] != 0) hasQs = true; } @@ -422,9 +422,9 @@ std::vector<std::vector<real> > DistributionHelper::getVectorWithoutRowsWithOnly void DistributionHelper::printQs(std::vector<std::vector<real> > qs, int decimalPlaces) { - for (int node = 0; node < qs.size(); node++) { - printf("index %d: ", node); - for (int dir = 1; dir < qs[node].size(); dir++) { + for (std::size_t node = 0; node < qs.size(); node++) { + printf("index %zu: ", node); + for (std::size_t dir = 1; dir < qs[node].size(); dir++) { printf("%d ", (int)qs[node][0]); printf("%.*f ", decimalPlaces, qs[node][dir]); } diff --git a/src/gpu/GridGenerator/grid/kernel/runGridKernelGPU.cu b/src/gpu/GridGenerator/grid/kernel/runGridKernelGPU.cu index 7aa6d4ebb091a5592423cc5afed224597ba700a4..ff137357b5bd7904253db372b37ca5d9e47bd102 100644 --- a/src/gpu/GridGenerator/grid/kernel/runGridKernelGPU.cu +++ b/src/gpu/GridGenerator/grid/kernel/runGridKernelGPU.cu @@ -24,9 +24,10 @@ float runKernelInitalUniformGrid3d(const LaunchParameter& para, GridImp &grid) GLOBAL void initalField(GridImp grid) { - uint index = LaunchParameter::getGlobalIdx_2D_1D(); - if (index < grid.getSize()) - grid.findInnerNode(index); + //TODO: outcomment because of nvlink warning caused by the new allocation in Cell(). + //uint index = LaunchParameter::getGlobalIdx_2D_1D(); + //if (index < grid.getSize()) + // grid.findInnerNode(index); } ////////////////////////////////////////////////////////////////////////// @@ -38,9 +39,10 @@ float runKernelToMesh(const LaunchParameter& para, GridImp &grid, const Triangul GLOBAL void runMeshing(GridImp grid, const TriangularMesh geom) { - unsigned int i = LaunchParameter::getGlobalIdx_1D_1D(); - if (i < geom.size) - grid.mesh(geom.triangles[i]); + // TODO: outcomment because of nvlink warning caused by the new allocation in Cell(). + //unsigned int i = LaunchParameter::getGlobalIdx_1D_1D(); + //if (i < geom.size) + // grid.mesh(geom.triangles[i]); } ////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/GridGenerator/io/GridVTKWriter/GridVTKWriter.cpp b/src/gpu/GridGenerator/io/GridVTKWriter/GridVTKWriter.cpp index a0a15e2e580842d77b94fed0455368b6916dc77c..19e3cef186781a7f0a411307afb976072078f07b 100644 --- a/src/gpu/GridGenerator/io/GridVTKWriter/GridVTKWriter.cpp +++ b/src/gpu/GridGenerator/io/GridVTKWriter/GridVTKWriter.cpp @@ -40,7 +40,7 @@ void GridVTKWriter::writeGridToVTKXML(SPtr<Grid> grid, const std::string& name, int endZ = endZ_Loop; int startZ = startZ_Loop - 1; - if( endZ >= grid->getNumberOfNodesZ() ) + if(endZ >= (int)grid->getNumberOfNodesZ()) endZ = grid->getNumberOfNodesZ(); if( startZ < 0 ) @@ -66,7 +66,7 @@ void GridVTKWriter::writeGridToVTKXML(SPtr<Grid> grid, const std::string& name, { for (uint yIndex = 0; yIndex < grid->getNumberOfNodesY(); yIndex++) { - for (uint zIndex = startZ; zIndex < endZ; zIndex++) + for (int zIndex = startZ; zIndex < endZ; zIndex++) { real x, y, z; uint index = @@ -92,7 +92,7 @@ void GridVTKWriter::writeGridToVTKXML(SPtr<Grid> grid, const std::string& name, { for (uint yIndex = 0; yIndex < grid->getNumberOfNodesY() - 1; yIndex++) { - for (uint zIndex = startZ; zIndex < endZ - 1; zIndex++) + for (int zIndex = startZ; zIndex < endZ - 1; zIndex++) { real x, y, z; uint index = grid->getNumberOfNodesX() * grid->getNumberOfNodesY() * zIndex @@ -141,7 +141,7 @@ void GridVTKWriter::writeInterpolationCellsToVTKXML(SPtr<Grid> grid, SPtr<Grid> matrixIndices[ sparseIndex ] = matrixIndex; } - for( int index = 0; index < grid->getNumberOfNodesCF(); index++ ){ + for( uint index = 0; index < grid->getNumberOfNodesCF(); index++ ){ nodeInterpolationCellType[ matrixIndices[ grid->getCF_coarse()[index] ] ] = grid->getFieldEntry( matrixIndices[ grid->getCF_coarse()[index] ] ); nodeOffset [ matrixIndices[ grid->getCF_coarse()[index] ] ] = grid->getCF_offset()[index]; @@ -153,11 +153,11 @@ void GridVTKWriter::writeInterpolationCellsToVTKXML(SPtr<Grid> grid, SPtr<Grid> if( gridCoarse ){ - for( int index = 0; index < gridCoarse->getNumberOfNodesCF(); index++ ){ + for( uint index = 0; index < gridCoarse->getNumberOfNodesCF(); index++ ){ nodeInterpolationCellType[ matrixIndices[ gridCoarse->getCF_fine()[index] ] ] = grid->getFieldEntry( matrixIndices[ gridCoarse->getCF_fine()[index] ] ); } - for( int index = 0; index < gridCoarse->getNumberOfNodesFC(); index++ ){ + for( uint index = 0; index < gridCoarse->getNumberOfNodesFC(); index++ ){ nodeInterpolationCellType[ matrixIndices[ gridCoarse->getFC_fine()[index] ] ] = grid->getFieldEntry( matrixIndices[ gridCoarse->getFC_fine()[index] ] ); nodeOffset [ matrixIndices[ gridCoarse->getFC_fine()[index] ] ] = gridCoarse->getFC_offset()[index]; @@ -437,7 +437,7 @@ void GridVTKWriter::writeTypes(SPtr<Grid> grid) void GridVTKWriter::end_line() { char str2[8] = "\n"; - fprintf(file, str2); + fprintf(file, "%s", str2); } void GridVTKWriter::write_int(int val) diff --git a/src/gpu/GridGenerator/io/QLineWriter.cpp b/src/gpu/GridGenerator/io/QLineWriter.cpp index 79a54a9983c5fc8cfa1af238dbf5d2551d621eea..6df995b2d5ef73c7797234a61f78810666f675f0 100644 --- a/src/gpu/GridGenerator/io/QLineWriter.cpp +++ b/src/gpu/GridGenerator/io/QLineWriter.cpp @@ -25,7 +25,7 @@ void QLineWriter::writeArrows(std::string fileName, SPtr<GeometryBoundaryConditi std::vector<UbTupleInt2> cells; int actualNodeNumber = 0; - for (int index = 0; index < geometryBoundaryCondition->indices.size(); index++) + for (std::size_t index = 0; index < geometryBoundaryCondition->indices.size(); index++) { Vertex startNode = getVertex(geometryBoundaryCondition->indices[index], grid); for (int qi = 0; qi <= 26; qi++) diff --git a/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp b/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp index 69cd8396135a255b1dfbc6fe95106030d15575eb..3f41f66ae70ae669d406deb3bc110f0f2047ab82 100644 --- a/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp +++ b/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp @@ -295,7 +295,7 @@ std::vector<Triangle> STLReader::readBinarySTL(const BoundingBox &box, const std if (box.isInside(t) || box.intersect(t)) triangles.push_back(t); } - int size = triangles.size(); + int size = (int)triangles.size(); *logging::out << logging::Logger::INFO_INTERMEDIATE << "Number of Triangles in process: " << size << "\n"; *logging::out << logging::Logger::INFO_INTERMEDIATE << "Complete reading STL file. \n"; diff --git a/src/gpu/GridGenerator/io/STLReaderWriter/STLWriter.cpp b/src/gpu/GridGenerator/io/STLReaderWriter/STLWriter.cpp index 724ae89b098997f1a3e3a961eafbbdafd1a21846..36e099c61d495f7402c68e581e4c68e194dad6b4 100644 --- a/src/gpu/GridGenerator/io/STLReaderWriter/STLWriter.cpp +++ b/src/gpu/GridGenerator/io/STLReaderWriter/STLWriter.cpp @@ -9,7 +9,7 @@ void STLWriter::writeSTL(std::vector<Triangle> &vec, const std::string &name, bool writeBinary) { - const int size = vec.size(); + const int size = (int)vec.size(); *logging::out << logging::Logger::INFO_INTERMEDIATE << "Write " << size << " Triangles to STL : " + name + "\n"; std::ios_base::openmode mode = std::ios::out; diff --git a/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.cpp b/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.cpp index 9256610717ea6862efd448d7f9096bf31fe6ee54..f3a66f69a06463ad528d6c00a7a36f5a234db19c 100644 --- a/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.cpp +++ b/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.cpp @@ -548,7 +548,7 @@ void SimulationFileWriter::writeBoundary(std::vector<real> boundary, int rb) *qStreams[rb] << (index + 1); - for (int i = 1; i < boundary.size(); i++) { + for (std::size_t i = 1; i < boundary.size(); i++) { *qStreams[rb] << " " << std::fixed << std::setprecision(16) << boundary[i]; } *valueStreams[rb] << (index+1) << " 0 0 0"; @@ -564,7 +564,7 @@ void SimulationFileWriter::writeBoundaryShort(std::vector<real> boundary, int rb *qStreams[rb] << (index + 1) << " " << key; - for (int i = 0; i < boundary.size() - 2; i++) { + for (std::size_t i = 0; i < boundary.size() - 2; i++) { *qStreams[rb] << " " << std::fixed << std::setprecision(16) << boundary[i]; } *valueStreams[rb] << (index + 1) << " 0 0 0"; @@ -575,7 +575,7 @@ void SimulationFileWriter::writeBoundaryShort(std::vector<real> boundary, int rb void SimulationFileWriter::writeBoundaryShort(SPtr<Grid> grid, SPtr<BoundaryCondition> boundaryCondition, uint side) { - uint numberOfBoundaryNodes = boundaryCondition->indices.size(); + uint numberOfBoundaryNodes = (uint)boundaryCondition->indices.size(); *valueStreams[side] << numberOfBoundaryNodes << "\n"; *qStreams[side] << numberOfBoundaryNodes << "\n"; diff --git a/src/gpu/GridGenerator/utilities/cuda/cudaDefines.h b/src/gpu/GridGenerator/utilities/cuda/cudaDefines.h index bc00947394452b7a4647faf82765180733bb8212..b20401ef493c16d413f41db91c42c102e63d7d2f 100644 --- a/src/gpu/GridGenerator/utilities/cuda/cudaDefines.h +++ b/src/gpu/GridGenerator/utilities/cuda/cudaDefines.h @@ -30,13 +30,13 @@ static void printCudaInformation(int i) { else printf("Disabled\n"); printf(" --- Memory Information for device %d ---\n", i); - printf("Total global mem: %llu\n", prop.totalGlobalMem); - printf("Total constant Mem: %zd\n", prop.totalConstMem); - printf("Max mem pitch: %zd\n", prop.memPitch); - printf("Texture Alignment: %zd\n", prop.textureAlignment); - printf("max Texture 1D: %ld\n", prop.maxTexture1D); - printf("max Texture 2D: %ld, %ld\n", prop.maxTexture2D[0], prop.maxTexture2D[1]); - printf("max Texture 3D: %ld, %ld, %ld\n", prop.maxTexture3D[0], prop.maxTexture3D[1], prop.maxTexture3D[2]); + printf("Total global mem: %zu\n", prop.totalGlobalMem); + printf("Total constant Mem: %zu\n", prop.totalConstMem); + printf("Max mem pitch: %zu\n", prop.memPitch); + printf("Texture Alignment: %zu\n", prop.textureAlignment); + printf("max Texture 1D: %d\n", prop.maxTexture1D); + printf("max Texture 2D: %d, %d\n", prop.maxTexture2D[0], prop.maxTexture2D[1]); + printf("max Texture 3D: %d, %d, %d\n", prop.maxTexture3D[0], prop.maxTexture3D[1], prop.maxTexture3D[2]); printf(" --- MP Information for device %d ---\n", i); printf("Multiprocessor count: %d\n", prop.multiProcessorCount); @@ -58,8 +58,8 @@ static void printCudaInformation(int i) { size_t free; size_t total; cudaMemGetInfo(&free, &total); - printf("Free: %llu Bytes, Total: %llu Bytes\n", free, total); - printf("Free: %llu MB, Total: %llu MB\n", free / 1000 / 1000, total / 1000 / 1000); + printf("Free: %zu Bytes, Total: %zu Bytes\n", free, total); + printf("Free: %zu MB, Total: %zu MB\n", free / 1000 / 1000, total / 1000 / 1000); //cudaDeviceSetLimit(cudaLimitMallocHeapSize, free); } diff --git a/src/gpu/GridGenerator/utilities/transformator/TransformatorImp.h b/src/gpu/GridGenerator/utilities/transformator/TransformatorImp.h index f2e68bc131d7e80e4777ab0ac3ac003e203633a8..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,15 +40,15 @@ 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; - GRIDGENERATOR_EXPORT void transformWorldToGrid(BoundingBox &box) const; + GRIDGENERATOR_EXPORT void transformGridToWorld(BoundingBox &box) const override; + GRIDGENERATOR_EXPORT void transformWorldToGrid(BoundingBox &box) const override; GRIDGENERATOR_EXPORT bool operator==(const TransformatorImp& trafo) const; diff --git a/src/gpu/VirtualFluids_GPU/Calculation/Cp.cpp b/src/gpu/VirtualFluids_GPU/Calculation/Cp.cpp index 7ecaa362cfa4253017b021cacb549ef018683a2b..112a29fcf57799df6f7baf0e79d4973fea26549d 100644 --- a/src/gpu/VirtualFluids_GPU/Calculation/Cp.cpp +++ b/src/gpu/VirtualFluids_GPU/Calculation/Cp.cpp @@ -35,31 +35,31 @@ void calcCp(Parameter* para, CudaMemoryManager* cudaManager, int lev) std::vector< double > cpBottom2Row; ////////////////////////////////////////////////////////////////////////// //calc cp top - for (unsigned int it = 0; it < para->getParH(lev)->numberOfPointsCpTop; it++) + for (unsigned int it = 0; it < para->getParH((int)lev)->numberOfPointsCpTop; it++) { - pressSI = (double)(para->getParH(lev)->cpPressTop[it] / (double)3.0 * (double)para->getDensityRatio() * (double)para->getVelocityRatio() * (double)para->getVelocityRatio()); + pressSI = (double)(para->getParH((int)lev)->cpPressTop[it] / (double)3.0 * (double)para->getDensityRatio() * (double)para->getVelocityRatio() * (double)para->getVelocityRatio()); cp = (double) (pressSI / (0.5 * rhoSI * veloSI * veloSI)); cpTopRow.push_back(cp); } - para->getParH(lev)->cpTop.push_back(cpTopRow); + para->getParH((int)lev)->cpTop.push_back(cpTopRow); ////////////////////////////////////////////////////////////////////////// //calc cp bottom - for (int it = 0; it < para->getParH(lev)->numberOfPointsCpBottom; it++) + for (uint it = 0; it < para->getParH((int)lev)->numberOfPointsCpBottom; it++) { - pressSI = (double)(para->getParH(lev)->cpPressBottom[it] / (double)3.0 * (double)para->getDensityRatio() * (double)para->getVelocityRatio() * (double)para->getVelocityRatio()); + pressSI = (double)(para->getParH((int)lev)->cpPressBottom[it] / (double)3.0 * (double)para->getDensityRatio() * (double)para->getVelocityRatio() * (double)para->getVelocityRatio()); cp = (double) (pressSI / (0.5 * rhoSI * veloSI * veloSI)); cpBottomRow.push_back(cp); } - para->getParH(lev)->cpBottom.push_back(cpBottomRow); + para->getParH((int)lev)->cpBottom.push_back(cpBottomRow); ////////////////////////////////////////////////////////////////////////// //calc cp bottom 2 - for (int it = 0; it < para->getParH(lev)->numberOfPointsCpBottom2; it++) + for (uint it = 0; it < para->getParH((int)lev)->numberOfPointsCpBottom2; it++) { - pressSI = (double)(para->getParH(lev)->cpPressBottom2[it] / (double)3.0 * (double)para->getDensityRatio() * (double)para->getVelocityRatio() * (double)para->getVelocityRatio()); + pressSI = (double)(para->getParH((int)lev)->cpPressBottom2[it] / (double)3.0 * (double)para->getDensityRatio() * (double)para->getVelocityRatio() * (double)para->getVelocityRatio()); cp = (double) (pressSI / (0.5 * rhoSI * veloSI * veloSI)); cpBottom2Row.push_back(cp); } - para->getParH(lev)->cpBottom2.push_back(cpBottom2Row); + para->getParH((int)lev)->cpBottom2.push_back(cpBottom2Row); ////////////////////////////////////////////////////////////////////////// } @@ -79,7 +79,7 @@ void printCpTopIntermediateStep(Parameter* para, unsigned int t, int lev) ostr.open(fname); ////////////////////////////////////////////////////////////////////////// //fill file with data - for (vector< vector<double> >::const_iterator i = para->getParH(lev)->cpTop.begin(); i != para->getParH(lev)->cpTop.end(); ++i) + for (vector< vector<double> >::const_iterator i = para->getParH((int)lev)->cpTop.begin(); i != para->getParH((int)lev)->cpTop.end(); ++i) { for (vector<double>::const_iterator j = i->begin(); j != i->end(); ++j) { @@ -91,7 +91,7 @@ void printCpTopIntermediateStep(Parameter* para, unsigned int t, int lev) //close file ostr.close(); ////////////////////////////////////////////////////////////////////////// - para->getParH(lev)->cpTop.clear(); + para->getParH((int)lev)->cpTop.clear(); ////////////////////////////////////////////////////////////////////////// } @@ -111,7 +111,7 @@ void printCpTop(Parameter* para, CudaMemoryManager* cudaManager, int lev) ostr.open(fname); ////////////////////////////////////////////////////////////////////////// //fill file with data - for (vector< vector<double> >::const_iterator i = para->getParH(lev)->cpTop.begin() ; i != para->getParH(lev)->cpTop.end(); ++i) + for (vector< vector<double> >::const_iterator i = para->getParH((int)lev)->cpTop.begin() ; i != para->getParH((int)lev)->cpTop.end(); ++i) { for (vector<double>::const_iterator j=i->begin(); j!=i->end(); ++j) { @@ -123,7 +123,7 @@ void printCpTop(Parameter* para, CudaMemoryManager* cudaManager, int lev) //close file ostr.close(); ////////////////////////////////////////////////////////////////////////// - para->getParH(lev)->cpTop.clear(); + para->getParH((int)lev)->cpTop.clear(); cudaManager->cudaFreeCpTop(lev); ////////////////////////////////////////////////////////////////////////// } @@ -147,7 +147,7 @@ void printCpBottom(Parameter* para, CudaMemoryManager* cudaManager) ostr.open(fname); ////////////////////////////////////////////////////////////////////////// //fill file with data - for (vector< vector<double> >::const_iterator i = para->getParH(lev)->cpBottom.begin() ; i != para->getParH(lev)->cpBottom.end(); ++i) + for (vector< vector<double> >::const_iterator i = para->getParH((int)lev)->cpBottom.begin() ; i != para->getParH((int)lev)->cpBottom.end(); ++i) { for (vector<double>::const_iterator j=i->begin(); j!=i->end(); ++j) { @@ -159,7 +159,7 @@ void printCpBottom(Parameter* para, CudaMemoryManager* cudaManager) //close file ostr.close(); ////////////////////////////////////////////////////////////////////////// - para->getParH(lev)->cpBottom.clear(); + para->getParH((int)lev)->cpBottom.clear(); cudaManager->cudaFreeCpBottom(lev); ////////////////////////////////////////////////////////////////////////// } @@ -183,7 +183,7 @@ void printCpBottom2(Parameter* para, CudaMemoryManager* cudaManager) ostr.open(fname); ////////////////////////////////////////////////////////////////////////// //fill file with data - for (vector< vector<double> >::const_iterator i = para->getParH(lev)->cpBottom2.begin() ; i != para->getParH(lev)->cpBottom2.end(); ++i) + for (vector< vector<double> >::const_iterator i = para->getParH((int)lev)->cpBottom2.begin() ; i != para->getParH((int)lev)->cpBottom2.end(); ++i) { for (vector<double>::const_iterator j=i->begin(); j!=i->end(); ++j) { @@ -195,7 +195,7 @@ void printCpBottom2(Parameter* para, CudaMemoryManager* cudaManager) //close file ostr.close(); ////////////////////////////////////////////////////////////////////////// - para->getParH(lev)->cpBottom2.clear(); + para->getParH((int)lev)->cpBottom2.clear(); cudaManager->cudaFreeCpBottom2(lev); ////////////////////////////////////////////////////////////////////////// } @@ -224,22 +224,22 @@ void printCpBottom2(Parameter* para, CudaMemoryManager* cudaManager) void excludeGridInterfaceNodesForMirror(Parameter* para, int lev) { bool tempBool = true; - para->getParH(lev)->numberOfPointsPressWindow = 0; + para->getParH((int)lev)->numberOfPointsPressWindow = 0; para->getParH(lev + 1)->numberOfPointsPressWindow = 0; ////////////////////////////////////////////////////////////////////////// //define bool vector for nodes outside the interface for (unsigned int it = 0; it < para->getParH(lev + 1)->numberOfPointsCpTop; it++) { - for (unsigned int ifit = 0; ifit < para->getParH(lev)->K_CF; ifit++) + for (unsigned int ifit = 0; ifit < para->getParH((int)lev)->K_CF; ifit++) { - if ((para->getParH(lev + 1)->cpTopIndex[it] == para->getParH(lev)->intCF.ICellCFF[ifit]) || - (para->getParH(lev + 1)->cpTopIndex[it] == para->getParH(lev + 1)->neighborX_SP[para->getParH(lev)->intCF.ICellCFF[ifit]]) || - (para->getParH(lev + 1)->cpTopIndex[it] == para->getParH(lev + 1)->neighborY_SP[para->getParH(lev)->intCF.ICellCFF[ifit]]) || - (para->getParH(lev + 1)->cpTopIndex[it] == para->getParH(lev + 1)->neighborZ_SP[para->getParH(lev)->intCF.ICellCFF[ifit]]) || - (para->getParH(lev + 1)->cpTopIndex[it] == para->getParH(lev + 1)->neighborY_SP[para->getParH(lev + 1)->neighborX_SP[para->getParH(lev)->intCF.ICellCFF[ifit]]]) || - (para->getParH(lev + 1)->cpTopIndex[it] == para->getParH(lev + 1)->neighborZ_SP[para->getParH(lev + 1)->neighborX_SP[para->getParH(lev)->intCF.ICellCFF[ifit]]]) || - (para->getParH(lev + 1)->cpTopIndex[it] == para->getParH(lev + 1)->neighborZ_SP[para->getParH(lev + 1)->neighborY_SP[para->getParH(lev)->intCF.ICellCFF[ifit]]]) || - (para->getParH(lev + 1)->cpTopIndex[it] == para->getParH(lev + 1)->neighborZ_SP[para->getParH(lev + 1)->neighborY_SP[para->getParH(lev + 1)->neighborX_SP[para->getParH(lev)->intCF.ICellCFF[ifit]]]])) + if ((para->getParH(lev + 1)->cpTopIndex[it] == (int)para->getParH((int)lev)->intCF.ICellCFF[ifit]) || + (para->getParH(lev + 1)->cpTopIndex[it] == (int)para->getParH(lev + 1)->neighborX_SP[para->getParH((int)lev)->intCF.ICellCFF[ifit]]) || + (para->getParH(lev + 1)->cpTopIndex[it] == (int)para->getParH(lev + 1)->neighborY_SP[para->getParH((int)lev)->intCF.ICellCFF[ifit]]) || + (para->getParH(lev + 1)->cpTopIndex[it] == (int)para->getParH(lev + 1)->neighborZ_SP[para->getParH((int)lev)->intCF.ICellCFF[ifit]]) || + (para->getParH(lev + 1)->cpTopIndex[it] == (int)para->getParH(lev + 1)->neighborY_SP[para->getParH(lev + 1)->neighborX_SP[para->getParH((int)lev)->intCF.ICellCFF[ifit]]]) || + (para->getParH(lev + 1)->cpTopIndex[it] == (int)para->getParH(lev + 1)->neighborZ_SP[para->getParH(lev + 1)->neighborX_SP[para->getParH((int)lev)->intCF.ICellCFF[ifit]]]) || + (para->getParH(lev + 1)->cpTopIndex[it] == (int)para->getParH(lev + 1)->neighborZ_SP[para->getParH(lev + 1)->neighborY_SP[para->getParH((int)lev)->intCF.ICellCFF[ifit]]]) || + (para->getParH(lev + 1)->cpTopIndex[it] == (int)para->getParH(lev + 1)->neighborZ_SP[para->getParH(lev + 1)->neighborY_SP[para->getParH(lev + 1)->neighborX_SP[para->getParH((int)lev)->intCF.ICellCFF[ifit]]]])) { para->getParH(lev + 1)->isOutsideInterface.push_back(false); tempBool = false; @@ -254,28 +254,28 @@ void excludeGridInterfaceNodesForMirror(Parameter* para, int lev) tempBool = true; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - for (unsigned int it = 0; it < para->getParH(lev)->numberOfPointsCpTop; it++) + for (unsigned int it = 0; it < para->getParH((int)lev)->numberOfPointsCpTop; it++) { - for (unsigned int ifit = 0; ifit < para->getParH(lev)->K_FC; ifit++) + for (unsigned int ifit = 0; ifit < para->getParH((int)lev)->K_FC; ifit++) { - if (para->getParH(lev)->cpTopIndex[it] == para->getParH(lev)->intFC.ICellFCC[ifit]) + if (para->getParH((int)lev)->cpTopIndex[it] == (int)para->getParH((int)lev)->intFC.ICellFCC[ifit]) { - para->getParH(lev)->isOutsideInterface.push_back(false); + para->getParH((int)lev)->isOutsideInterface.push_back(false); tempBool = false; break; } } if (tempBool == true) { - para->getParH(lev)->isOutsideInterface.push_back(true); - para->getParH(lev)->numberOfPointsPressWindow++; + para->getParH((int)lev)->isOutsideInterface.push_back(true); + para->getParH((int)lev)->numberOfPointsPressWindow++; } tempBool = true; } //////////////////////////////////////////////////////////////////////////// - std::cout << "number of nodes cp top level 7:" << para->getParH(lev)->numberOfPointsCpTop << endl; - std::cout << "number of nodes bool level 7:" << para->getParH(lev)->isOutsideInterface.size() << endl; - std::cout << "number of nodes press window level 7:" << para->getParH(lev)->numberOfPointsPressWindow << endl; + std::cout << "number of nodes cp top level 7:" << para->getParH((int)lev)->numberOfPointsCpTop << endl; + std::cout << "number of nodes bool level 7:" << para->getParH((int)lev)->isOutsideInterface.size() << endl; + std::cout << "number of nodes press window level 7:" << para->getParH((int)lev)->numberOfPointsPressWindow << endl; std::cout << "number of nodes cp top level 8:" << para->getParH(lev + 1)->numberOfPointsCpTop << endl; std::cout << "number of nodes bool level 8:" << para->getParH(lev + 1)->isOutsideInterface.size() << endl; std::cout << "number of nodes press window level 8:" << para->getParH(lev + 1)->numberOfPointsPressWindow << endl; @@ -293,16 +293,16 @@ void calcPressForMirror(Parameter* para, CudaMemoryManager* cudaManager, int lev double pressSI; ////////////////////////////////////////////////////////////////////////// //calc press - for (unsigned int it = 0; it < para->getParH(lev)->numberOfPointsCpTop; it++) + for (unsigned int it = 0; it < para->getParH((int)lev)->numberOfPointsCpTop; it++) { - if (para->getParH(lev)->isOutsideInterface[it]) + if (para->getParH((int)lev)->isOutsideInterface[it]) { - pressSI = (double)(para->getParH(lev)->cpPressTop[it] / (double)3.0 * (double)para->getDensityRatio() * (double)para->getVelocityRatio() * (double)para->getVelocityRatio()); - para->getParH(lev)->pressMirror.push_back(pressSI); + pressSI = (double)(para->getParH((int)lev)->cpPressTop[it] / (double)3.0 * (double)para->getDensityRatio() * (double)para->getVelocityRatio() * (double)para->getVelocityRatio()); + para->getParH((int)lev)->pressMirror.push_back(pressSI); } } //////////////////////////////////////////////////////////////////////////// - //std::cout << "number of nodes press mirror:" << para->getParH(lev)->pressMirror.size() << ", at level: " << lev << endl; + //std::cout << "number of nodes press mirror:" << para->getParH((int)lev)->pressMirror.size() << ", at level: " << lev << endl; } @@ -386,172 +386,158 @@ extern "C" void printGeoFile(Parameter* para, bool fileFormat) unsigned int non = 0; for (size_t lev = startlevel; lev <= endlevel; lev++) { - non += para->getParH(lev)->numberOfPointsPressWindow; + non += para->getParH((int)lev)->numberOfPointsPressWindow; } ////////////////////////////////////////////////////////////////////////// - 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((int)lev)->numberOfPointsCpTop; i++) + { + if (para->getParH((int)lev)->isOutsideInterface[i]) + { + ostr << (para->getParH((int)lev)->coordX_SP[para->getParH((int)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((int)lev)->numberOfPointsCpTop; i++) + { + if (para->getParH((int)lev)->isOutsideInterface[i]) + { + ostr << (para->getParH((int)lev)->coordY_SP[para->getParH((int)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((int)lev)->numberOfPointsCpTop; i++) + { + if (para->getParH((int)lev)->isOutsideInterface[i]) + { + ostr << (para->getParH((int)lev)->coordZ_SP[para->getParH((int)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((int)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((int)lev)->numberOfPointsCpTop; i++) + { + if (para->getParH((int)lev)->isOutsideInterface[i]) + { + tempCoord = (para->getParH((int)lev)->coordX_SP[para->getParH((int)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((int)lev)->numberOfPointsCpTop; i++) + { + if (para->getParH((int)lev)->isOutsideInterface[i]) + { + tempCoord = (para->getParH((int)lev)->coordY_SP[para->getParH((int)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((int)lev)->numberOfPointsCpTop; i++) + { + if (para->getParH((int)lev)->isOutsideInterface[i]) + { + tempCoord = (para->getParH((int)lev)->coordZ_SP[para->getParH((int)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((int)lev)->numberOfPointsPressWindow; i++) + { + j++; + writeIntToFile(j, ostr); + } + //std::cout << "level: " << lev << ", numberOfPointsPressWindow:" << para->getParH((int)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((int)lev)->pressMirror.begin(); i != para->getParH((int)lev)->pressMirror.end(); ++i) + { + ostr << *i << "\n"; + } + } + ostr.close(); + ////////////////////////////////////////////////////////////////////////// + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + para->getParH((int)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((int)lev)->pressMirror.begin(); i != para->getParH((int)lev)->pressMirror.end(); ++i) + { + writeFloatToFile(*i, ostr); + } + } + ostr.close(); + ////////////////////////////////////////////////////////////////////////// + for (size_t lev = startlevel; lev <= endlevel; lev++) + { + para->getParH((int)lev)->pressMirror.clear(); + } + } } diff --git a/src/gpu/VirtualFluids_GPU/Calculation/DragLift.cpp b/src/gpu/VirtualFluids_GPU/Calculation/DragLift.cpp index df153312b489ebbe6d1cb7057797a1a3663b583f..1ebbfb6861458550a0442e927d138fb450baa2ba 100644 --- a/src/gpu/VirtualFluids_GPU/Calculation/DragLift.cpp +++ b/src/gpu/VirtualFluids_GPU/Calculation/DragLift.cpp @@ -122,7 +122,7 @@ void printDragLift(Parameter* para, CudaMemoryManager* cudaManager, int timestep //close file ostr.close(); ////////////////////////////////////////////////////////////////////////// - if (timestep == para->getTEnd()) + if (timestep == (int)para->getTEnd()) { cudaManager->cudaFreeDragLift(lev); } diff --git a/src/gpu/VirtualFluids_GPU/Calculation/ForceCalculations.cpp b/src/gpu/VirtualFluids_GPU/Calculation/ForceCalculations.cpp index d6b7ca332fbd51293471a8a54e90ce44cef130d0..42d6a3cf4845ed52648e6f65e91250bae0344cc8 100644 --- a/src/gpu/VirtualFluids_GPU/Calculation/ForceCalculations.cpp +++ b/src/gpu/VirtualFluids_GPU/Calculation/ForceCalculations.cpp @@ -45,7 +45,7 @@ void ForceCalculations::calcPIDControllerForForce(Parameter* para, CudaMemoryMan { ////////////////////////////////////////////////////////////////////////// double tempVeloX = 0.0, tempVeloY = 0.0, tempVeloZ = 0.0; - double veloAverageX = 0.0, veloAverageY = 0.0, veloAverageZ = 0.0; + double veloAverageX = 0.0; //, veloAverageY = 0.0, veloAverageZ = 0.0; double levelVeloAverageX = 0.0, levelVeloAverageY = 0.0, levelVeloAverageZ = 0.0; int counter = 0; ////////////////////////////////////////////////////////////////////////// @@ -94,8 +94,8 @@ void ForceCalculations::calcPIDControllerForForce(Parameter* para, CudaMemoryMan } ////////////////////////////////////////////////////////////////////////// veloAverageX = levelVeloAverageX / (double)counter; - veloAverageY = levelVeloAverageY / (double)counter; - veloAverageZ = levelVeloAverageZ / (double)counter; + //veloAverageY = levelVeloAverageY / (double)counter; + //veloAverageZ = levelVeloAverageZ / (double)counter; ////////////////////////////////////////////////////////////////////////// if (isPID) { diff --git a/src/gpu/VirtualFluids_GPU/Calculation/PlaneCalculations.cpp b/src/gpu/VirtualFluids_GPU/Calculation/PlaneCalculations.cpp index e8d1cee6017c43a1447b0ba671ae9c247f75b16d..bca6574bf74671eb998b037e90d23214874683e8 100644 --- a/src/gpu/VirtualFluids_GPU/Calculation/PlaneCalculations.cpp +++ b/src/gpu/VirtualFluids_GPU/Calculation/PlaneCalculations.cpp @@ -56,10 +56,8 @@ void calcPressure(Parameter* para, std::string inorout, int lev) { unsigned int m = para->getParH(lev)->startP; unsigned int anz = 0; - real rho = 0.0f; double sumrho = 0.0, mrho = 0.0; double PressIn, PressOut; - real dummyux = 0.0f, dummyuy = 0.0f, dummyuz = 0.0f; for (unsigned int i = 0; i < para->getParH(lev)->sizePlanePress; i++) { @@ -97,9 +95,7 @@ void calcFlowRate(Parameter* para, int lev) unsigned int anz = 0; double FlowRate = 0.0; - real rho = 0.0f; double sumvelo = 0.0, mvelo = 0.0; - real dummyux = 0.0f, dummyuy = 0.0f, dummyuz = 0.0f; for (unsigned int i = 0; i < sizePlane; i++) { @@ -357,10 +353,10 @@ void printRE(Parameter* para, CudaMemoryManager* cudaManager, int timestep) ////////////////////////////////////////////////////////////////////////// //fill file with data bool doNothing = false; - for (size_t i = 0; i < para->getParH(lev)->QPress.kQ; i++) + for (int i = 0; i < para->getParH(lev)->QPress.kQ; i++) { doNothing = false; - for (size_t j = 0; j < 27; j++) + for (std::size_t j = 0; j < 27; j++) { if (para->getParH(lev)->kDistTestRE.f[0][j*para->getParH(lev)->QPress.kQ + i]==0) { @@ -379,7 +375,7 @@ void printRE(Parameter* para, CudaMemoryManager* cudaManager, int timestep) //close file ostr.close(); ////////////////////////////////////////////////////////////////////////// - if (timestep == para->getTEnd()) + if (timestep == (int)para->getTEnd()) { cudaManager->cudaFreeTestRE(lev); } diff --git a/src/gpu/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp b/src/gpu/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp index b40d67517f6c72c6fefe64249ab956e8bda739a8..45323203a1d540ddd630c9e7751a4340329e0da9 100644 --- a/src/gpu/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp +++ b/src/gpu/VirtualFluids_GPU/Calculation/UpdateGrid27.cpp @@ -78,7 +78,7 @@ void collision(Parameter* para, std::vector<std::shared_ptr<PorousMedia>>& pm, i void collisionPorousMedia(Parameter* para, std::vector<std::shared_ptr<PorousMedia>>& pm, int level) { - for( int i = 0; i < pm.size(); i++ ) + for( std::size_t i = 0; i < pm.size(); i++ ) { KernelPMCumOneCompSP27(para->getParD(level)->numberofthreads, para->getParD(level)->omega, diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.cpp index 4aade86affb031d3dbb7b9336ce051b8f348b395..a0539073347f999e680a9d96ac3d02fee65d7bec 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryQs.cpp @@ -168,14 +168,14 @@ unsigned int BoundaryQs::getLevel() void BoundaryQs::setValues(real** q27, unsigned int level) const { - for (int column = 0; column < values[level].size(); column++) - for (int index = 0; index < values[level][column].size(); index++) + for (std::size_t column = 0; column < values[level].size(); column++) + for (std::size_t index = 0; index < values[level][column].size(); index++) q27[column][index] = values[level][column][index]; } void BoundaryQs::setIndex(int *data, unsigned int level) const { - for (int index = 0; index < indices[level].size(); index++) + for (std::size_t index = 0; index < indices[level].size(); index++) data[index] = indices[level][index]; } @@ -197,8 +197,8 @@ void BoundaryQs::getQs(std::vector<std::vector<std::vector<real> > > &qs) { } void BoundaryQs::getIndices(std::vector<std::vector<uint> > &indices) { - for (int level = 0; level < this->indices.size(); level++) - for (int index = 0; index < this->indices[level].size(); index++) + for (std::size_t level = 0; level < this->indices.size(); level++) + for (std::size_t index = 0; index < this->indices[level].size(); index++) indices[level].push_back(this->indices[level][index]); } diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryValues.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryValues.cpp index 434500d6f5591a27dbc2eb56ae54f658ae063d87..e987e74be46c881da98fea35cfad6606395f0aca 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryValues.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/BoundaryValues.cpp @@ -193,13 +193,13 @@ void BoundaryValues::setBoundarys(std::vector<std::vector<std::vector<real> > > void BoundaryValues::setValues(real* velo, unsigned int level, unsigned int column) const { - for (int index = 0; index < values[level][column].size(); index++) + for (std::size_t index = 0; index < values[level][column].size(); index++) velo[index] = values[level][column][index]; } void BoundaryValues::initIndex(/*unsigned*/ int *ptr, unsigned int level) { - for (int i = 0; i < indices[level].size(); i++) + for (std::size_t i = 0; i < indices[level].size(); i++) ptr[i] = indices[level][i]; } @@ -232,8 +232,8 @@ bool BoundaryValues::getProcNeighbor() void BoundaryValues::setPressValues(real *RhoBC, int* kN, int level) const { - for (int column = 0; column < values[level].size(); column++) { - for (int index = 0; index < values[level][column].size(); index++) { + for (std::size_t column = 0; column < values[level].size(); column++) { + for (std::size_t index = 0; index < values[level][column].size(); index++) { if (column == 0) RhoBC[index] = values[level][column][index]; if (column == 1) kN[index] = (int)values[level][column][index]; } @@ -242,8 +242,8 @@ void BoundaryValues::setPressValues(real *RhoBC, int* kN, int level) const void BoundaryValues::setVelocityValues(real *vx, real *vy, real *vz, int level) const { - for (int column = 0; column < values[level].size(); column++) { - for (int index = 0; index < values[level][column].size(); index++) { + for (std::size_t column = 0; column < values[level].size(); column++) { + for (std::size_t index = 0; index < values[level][column].size(); index++) { if (column == 0) vx[index] = values[level][column][index]; if (column == 1) vy[index] = values[level][column][index]; if (column == 2) vz[index] = values[level][column][index]; @@ -253,8 +253,8 @@ void BoundaryValues::setVelocityValues(real *vx, real *vy, real *vz, int level) void BoundaryValues::setOutflowValues(real *RhoBC, int* kN, int level) const { - for (int column = 0; column < values[level].size(); column++) { - for (int index = 0; index < values[level][column].size(); index++) { + for (std::size_t column = 0; column < values[level].size(); column++) { + for (std::size_t index = 0; index < values[level][column].size(); index++) { if (column == 0) RhoBC[index] = values[level][column][index]; if (column == 1) kN[index] = (int)values[level][column][index]; } @@ -263,8 +263,8 @@ void BoundaryValues::setOutflowValues(real *RhoBC, int* kN, int level) const void BoundaryValues::setStreetVelocityFractions(real *vxf, real *vyf, int level) const { - for (int column = 0; column < values[level].size(); column++) { - for (int index = 0; index < values[level][column].size(); index++) { + for (std::size_t column = 0; column < values[level].size(); column++) { + for (std::size_t index = 0; index < values[level][column].size(); index++) { if (column == 0) vxf[index] = values[level][column][index]; if (column == 1) vyf[index] = values[level][column][index]; } diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/CoordNeighborGeoV.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/CoordNeighborGeoV.cpp index 48c5199e8a27fc309c6c775a4c5ec4ad95e91fc8..4b857e0d4f7d8bcab407eb8954235d23c9325395 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/CoordNeighborGeoV.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/CoordNeighborGeoV.cpp @@ -146,13 +146,13 @@ void CoordNeighborGeoV::setVec(unsigned int level, std::vector<unsigned int> vec void CoordNeighborGeoV::initalCoords(real *data, unsigned int level) const { - for (int index = 0; index < coordinates[level].size(); index++) + for (std::size_t index = 0; index < coordinates[level].size(); index++) data[index] = coordinates[level][index]; } void CoordNeighborGeoV::initalNeighbors(unsigned int *data, unsigned int level) const { - for (int index = 0; index < neighbors[level].size(); index++) + for (std::size_t index = 0; index < neighbors[level].size(); index++) data[index] = neighbors[level][index]; } diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.cpp index 42614467ca3bfc4f7e5016c1c6ef29a025f76585..49de1d53a3bc0e64907906e2c87409c34cb8ba85 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/GridReader.cpp @@ -340,7 +340,7 @@ void GridReader::initalValuesDomainDecompostion(int level) // X if ((para->getNumprocs() > 1) && (procNeighborsSendX.size() == procNeighborsRecvX.size())) { - for (int j = 0; j < procNeighborsSendX.size(); j++) + for (std::size_t j = 0; j < procNeighborsSendX.size(); j++) { for (int i = 0; i <= level; i++) { int tempSend = procNeighborsSendX[j]->getSize(i); @@ -379,13 +379,13 @@ void GridReader::initalValuesDomainDecompostion(int level) para->getParD(i)->recvProcessNeighborX[j].memsizeFs = sizeof(real) *tempRecv; //////////////////////////////////////////////////////////////////////////////////////// //malloc on host and device - cudaMemoryManager->cudaAllocProcessNeighborX(i, j); + cudaMemoryManager->cudaAllocProcessNeighborX(i, (uint)j); //////////////////////////////////////////////////////////////////////////////////////// //init index arrays procNeighborsSendX[j]->initIndex(para->getParH(i)->sendProcessNeighborX[j].index, i); procNeighborsRecvX[j]->initIndex(para->getParH(i)->recvProcessNeighborX[j].index, i); //////////////////////////////////////////////////////////////////////////////////////// - cudaMemoryManager->cudaCopyProcessNeighborXIndex(i, j); + cudaMemoryManager->cudaCopyProcessNeighborXIndex(i, (uint)j); //////////////////////////////////////////////////////////////////////////////////////// } } @@ -396,7 +396,7 @@ void GridReader::initalValuesDomainDecompostion(int level) // Y if ((para->getNumprocs() > 1) && (procNeighborsSendY.size() == procNeighborsRecvY.size())) { - for (int j = 0; j < procNeighborsSendY.size(); j++) + for (std::size_t j = 0; j < procNeighborsSendY.size(); j++) { for (int i = 0; i <= level; i++) { int tempSend = procNeighborsSendY[j]->getSize(i); @@ -435,13 +435,13 @@ void GridReader::initalValuesDomainDecompostion(int level) para->getParD(i)->recvProcessNeighborY[j].memsizeFs = sizeof(real) *tempRecv; //////////////////////////////////////////////////////////////////////////////////////// //malloc on host and device - cudaMemoryManager->cudaAllocProcessNeighborY(i, j); + cudaMemoryManager->cudaAllocProcessNeighborY(i, (uint)j); //////////////////////////////////////////////////////////////////////////////////////// //init index arrays procNeighborsSendY[j]->initIndex(para->getParH(i)->sendProcessNeighborY[j].index, i); procNeighborsRecvY[j]->initIndex(para->getParH(i)->recvProcessNeighborY[j].index, i); //////////////////////////////////////////////////////////////////////////////////////// - cudaMemoryManager->cudaCopyProcessNeighborYIndex(i, j); + cudaMemoryManager->cudaCopyProcessNeighborYIndex(i, (uint)j); //////////////////////////////////////////////////////////////////////////////////////// } } @@ -452,7 +452,7 @@ void GridReader::initalValuesDomainDecompostion(int level) // Z if ((para->getNumprocs() > 1) && (procNeighborsSendZ.size() == procNeighborsRecvZ.size())) { - for (int j = 0; j < procNeighborsSendZ.size(); j++) + for (std::size_t j = 0; j < procNeighborsSendZ.size(); j++) { for (int i = 0; i <= level; i++) { int tempSend = procNeighborsSendZ[j]->getSize(i); @@ -491,13 +491,13 @@ void GridReader::initalValuesDomainDecompostion(int level) para->getParD(i)->recvProcessNeighborZ[j].memsizeFs = sizeof(real) *tempRecv; //////////////////////////////////////////////////////////////////////////////////////// //malloc on host and device - cudaMemoryManager->cudaAllocProcessNeighborZ(i, j); + cudaMemoryManager->cudaAllocProcessNeighborZ(i, (uint)j); //////////////////////////////////////////////////////////////////////////////////////// //init index arrays procNeighborsSendZ[j]->initIndex(para->getParH(i)->sendProcessNeighborZ[j].index, i); procNeighborsRecvZ[j]->initIndex(para->getParH(i)->recvProcessNeighborZ[j].index, i); //////////////////////////////////////////////////////////////////////////////////////// - cudaMemoryManager->cudaCopyProcessNeighborZIndex(i, j); + cudaMemoryManager->cudaCopyProcessNeighborZIndex(i, (uint)j); //////////////////////////////////////////////////////////////////////////////////////// } } @@ -512,7 +512,7 @@ void GridReader::allocArrays_BoundaryQs() std::vector<std::shared_ptr<BoundaryQs> > BC_Qs(channelDirections.size()); this->makeReader(BC_Qs, para); - for (int i = 0; i < channelBoundaryConditions.size(); i++) + for (std::size_t i = 0; i < channelBoundaryConditions.size(); i++) { if (this->channelBoundaryConditions[i] == "noSlip") { setNoSlipQs(BC_Qs[i]); } else if (this->channelBoundaryConditions[i] == "velocity") { setVelocityQs(BC_Qs[i]); } @@ -793,7 +793,7 @@ void GridReader::initPeriodicNeigh(std::vector<std::vector<std::vector<unsigned void GridReader::makeReader(std::shared_ptr<Parameter> para) { - for (int i = 0; i < BC_Values.size(); i++) + for (std::size_t i = 0; i < BC_Values.size(); i++) { if (channelDirections[i].compare("inlet") == 0){ BC_Values[i] = std::shared_ptr<BoundaryValues>(new BoundaryValues(para->getinletBcValues())); } if (channelDirections[i].compare("outlet") == 0){ BC_Values[i] = std::shared_ptr<BoundaryValues>(new BoundaryValues(para->getoutletBcValues())); } @@ -806,7 +806,7 @@ void GridReader::makeReader(std::shared_ptr<Parameter> para) void GridReader::makeReader(std::vector<std::shared_ptr<BoundaryQs> > &BC_Qs, std::shared_ptr<Parameter> para) { - for (int i = 0; i < BC_Qs.size(); i++) + for (std::size_t i = 0; i < BC_Qs.size(); i++) { if (channelDirections[i].compare("inlet") == 0){ BC_Qs[i] = std::shared_ptr<BoundaryQs>(new BoundaryQs(para->getinletBcQs(), false)); } if (channelDirections[i].compare("outlet") == 0){ BC_Qs[i] = std::shared_ptr<BoundaryQs>(new BoundaryQs(para->getoutletBcQs(), false)); } @@ -819,7 +819,7 @@ void GridReader::makeReader(std::vector<std::shared_ptr<BoundaryQs> > &BC_Qs, st void GridReader::setChannelBoundaryCondition() { - for (int i = 0; i < channelDirections.size(); i++) + for (std::size_t i = 0; i < channelDirections.size(); i++) { this->channelBoundaryConditions[i] = BC_Values[i]->getBoundaryCondition(); std::cout << this->channelDirections[i] << " Boundary: " << channelBoundaryConditions[i] << std::endl; 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/DataStructureInitializer/GridReaderFiles/MeasuredPoints.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/MeasuredPoints.cpp index 1916986d790e62849a951860c4498fb3b489b889..7ec0f3d3705cb6408ee6045f3442e5ea0f6b8f97 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/MeasuredPoints.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/MeasuredPoints.cpp @@ -38,7 +38,7 @@ void MeasuredPoints::init() { this->levelSizes.resize(maxLevel); this->points.resize(maxLevel); - for (int i=0; i<maxLevel;i++) { + for (uint i=0; i<maxLevel; i++) { getline(file,bufferString); bufferInt = atoi(bufferString.c_str()); @@ -46,7 +46,7 @@ void MeasuredPoints::init() { this->points[i].resize(levelSizes[i]); if(levelSizes[i] != 0) { - for ( int j=0; j<levelSizes[i]; j++) { + for ( uint j = 0; j < levelSizes[i]; j++) { getline(file,bufferString); bufferInt = atoi(bufferString.c_str()); this->points[i][j]=bufferInt; diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/OffsetScale.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/OffsetScale.cpp index 54ee53d79065210a9aca830f42e2fdcd8bc48955..1c2363d3edd5ddba10e50d2998552b929144623d 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/OffsetScale.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/OffsetScale.cpp @@ -123,7 +123,7 @@ void OffsetScale::initOffset() void OffsetScale::initArrayOffset(real *x_ptr,real *y_ptr,real *z_ptr, uint level) { int coordIndex = 0; - for (int index = 0; index < offset[level].size(); index+=3) + for (std::size_t index = 0; index < offset[level].size(); index+=3) { x_ptr[coordIndex] = offset[level][index]; y_ptr[coordIndex] = offset[level][index + 1]; @@ -134,7 +134,7 @@ void OffsetScale::initArrayOffset(real *x_ptr,real *y_ptr,real *z_ptr, uint leve void OffsetScale::initScale(unsigned int* data, unsigned int level) { - for (int index = 0; index < scale[level].size(); index++) + for (std::size_t index = 0; index < scale[level].size(); index++) data[index] = scale[level][index]; } diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.cpp b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.cpp index 5cdf7ecd8bdfe3b7a81ca427a7c05565b533a85c..2582e6918bd105d81964aba56dcdb661b59025bf 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.cpp +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.cpp @@ -249,11 +249,11 @@ void GridGenerator::allocArrays_BoundaryValues() { if( builder->getCommunicationProcess(direction) == INVALID_INDEX ) continue; - for (int level = 0; level < builder->getNumberOfGridLevels(); level++) + for (uint level = 0; level < builder->getNumberOfGridLevels(); level++) { if( direction == CommunicationDirections::MX || direction == CommunicationDirections::PX ) { - int j = para->getParH(level)->sendProcessNeighborX.size(); + int j = (int)para->getParH(level)->sendProcessNeighborX.size(); para->getParH(level)->sendProcessNeighborX.emplace_back(); para->getParD(level)->sendProcessNeighborX.emplace_back(); @@ -313,7 +313,7 @@ void GridGenerator::allocArrays_BoundaryValues() if( direction == CommunicationDirections::MY || direction == CommunicationDirections::PY ) { - int j = para->getParH(level)->sendProcessNeighborY.size(); + int j = (int)para->getParH(level)->sendProcessNeighborY.size(); para->getParH(level)->sendProcessNeighborY.emplace_back(); para->getParD(level)->sendProcessNeighborY.emplace_back(); @@ -373,7 +373,7 @@ void GridGenerator::allocArrays_BoundaryValues() if( direction == CommunicationDirections::MZ || direction == CommunicationDirections::PZ ) { - int j = para->getParH(level)->sendProcessNeighborZ.size(); + int j = (int)para->getParH(level)->sendProcessNeighborZ.size(); para->getParH(level)->sendProcessNeighborZ.emplace_back(); para->getParD(level)->sendProcessNeighborZ.emplace_back(); @@ -443,11 +443,11 @@ void GridGenerator::allocArrays_BoundaryValues() { if (builder->getCommunicationProcess(direction) == INVALID_INDEX) continue; - for (int level = 0; level < builder->getNumberOfGridLevels(); level++) + for (uint level = 0; level < builder->getNumberOfGridLevels(); level++) { if (direction == CommunicationDirections::MX || direction == CommunicationDirections::PX) { - int j = para->getParH(level)->sendProcessNeighborF3X.size(); + int j = (int)para->getParH(level)->sendProcessNeighborF3X.size(); para->getParH(level)->sendProcessNeighborF3X.emplace_back(); para->getParD(level)->sendProcessNeighborF3X.emplace_back(); @@ -501,7 +501,7 @@ void GridGenerator::allocArrays_BoundaryValues() if (direction == CommunicationDirections::MY || direction == CommunicationDirections::PY) { - int j = para->getParH(level)->sendProcessNeighborF3Y.size(); + int j = (int)para->getParH(level)->sendProcessNeighborF3Y.size(); para->getParH(level)->sendProcessNeighborF3Y.emplace_back(); para->getParD(level)->sendProcessNeighborF3Y.emplace_back(); @@ -555,7 +555,7 @@ void GridGenerator::allocArrays_BoundaryValues() if (direction == CommunicationDirections::MZ || direction == CommunicationDirections::PZ) { - int j = para->getParH(level)->sendProcessNeighborF3Z.size(); + int j = (int)para->getParH(level)->sendProcessNeighborF3Z.size(); para->getParH(level)->sendProcessNeighborF3Z.emplace_back(); para->getParD(level)->sendProcessNeighborF3Z.emplace_back(); @@ -820,9 +820,9 @@ void GridGenerator::allocArrays_BoundaryQs() builder->getGeometryQs(Q.q27, i); //QDebugWriter::writeQValues(Q, para->getParH(i)->QGeom.k, para->getParH(i)->QGeom.kQ, "M:/TestGridGeneration/results/GeomGPU.dat"); ////////////////////////////////////////////////////////////////// - for (int i = 0; i < numberOfGeometryNodes; i++) + for (int node_i = 0; node_i < numberOfGeometryNodes; node_i++) { - Q.q27[dirZERO][i] = 0.0f; + Q.q27[dirZERO][node_i] = 0.0f; } //for(int test = 0; test < 3; test++) //{ diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.h b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.h index 66b07deda5d8e21874fd6e1993eed66d91a2884c..79f7f2b6a1d1fc45217cf5e28df4f5b599f5c0e4 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.h +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/GridGenerator.h @@ -30,10 +30,10 @@ public: void allocArrays_BoundaryQs() override; void allocArrays_OffsetScale() override; - virtual void setDimensions(); - virtual void setBoundingBox(); + virtual void setDimensions() override; + virtual void setBoundingBox() override; - virtual void initPeriodicNeigh(std::vector<std::vector<std::vector<unsigned int> > > periodV, std::vector<std::vector<unsigned int> > periodIndex, std::string way); + virtual void initPeriodicNeigh(std::vector<std::vector<std::vector<unsigned int> > > periodV, std::vector<std::vector<unsigned int> > periodIndex, std::string way) override; private: void setPressureValues(int channelSide) const; diff --git a/src/gpu/VirtualFluids_GPU/FindInterface/FindInterface.cpp b/src/gpu/VirtualFluids_GPU/FindInterface/FindInterface.cpp index 7287c7687605f116ba0af19c41a4e25d448ca07c..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]; @@ -2589,17 +2589,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_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_T]==false)) + if (needInterface[INTERFACE_T]==false) { hC = CF_NCoarse[INTERFACE_T]; hF = CF_NFine[INTERFACE_T]; zOff = (real)0.5f; @@ -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]; @@ -2670,7 +2670,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_S]; jF = FC_Fine[ 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]; @@ -2812,7 +2812,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]; @@ -2827,7 +2827,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_S]; jF = FC_Fine[ INTERFACE_S]; diff --git a/src/gpu/VirtualFluids_GPU/FindQ/FindQ.cpp b/src/gpu/VirtualFluids_GPU/FindQ/FindQ.cpp index e85c3680a12c167385c1641c1c5e48e2dee8da2b..ee52a7a85550c686a7ab9565812d137ee64ab3e1 100644 --- a/src/gpu/VirtualFluids_GPU/FindQ/FindQ.cpp +++ b/src/gpu/VirtualFluids_GPU/FindQ/FindQ.cpp @@ -72,7 +72,7 @@ void findQ(Parameter* para, int lev) for(l=0;l<=26;l++){ mm = nx*(ny*(k+ez[l]) + (j+ey[l])) + (i+ex[l]); if((geo_mat[mm] == GEO_SOLID) || (geo_mat[mm] == GEO_VOID)){ - //ON[l] = -(((real)ex[l]*(real)relx + (real)ey[l]*(real)rely + (real)ez[l]*(real)relz +/*+/- Achtung, innen und außen nicht verwechseln!!*/ + //ON[l] = -(((real)ex[l]*(real)relx + (real)ey[l]*(real)rely + (real)ez[l]*(real)relz +/*+/- Achtung, innen und aussen nicht verwechseln!!*/ // sqrt(pow((real)ex[l]*(real)relx + (real)ey[l]*(real)rely + (real)ez[l]*(real)relz,2) + // (pow((real)ex[l],2) + pow((real)ey[l],2) + pow((real)ez[l],2))* (pow(radius,2) - // pow((real)relx,2) - pow((real)rely,2) - pow((real)relz,2)))) @@ -389,9 +389,9 @@ void findQInflow(Parameter* para) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////// E W N S T B NE SW SE NW TE BW BE TW TN BS BN TS ZERO TNE BNE TSE BSE TNW BNW TSW BSW //////////////////////// - int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; - int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; - int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; + //int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; + //int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; + //int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; //real ON[27]; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// unsigned int i, j, k, m;//, mm, l; @@ -410,7 +410,7 @@ void findQInflow(Parameter* para) int* geo_mat = para->getParH(para->getCoarse())->geo; unsigned int* kk = para->getParH(para->getCoarse())->k; unsigned int sizeQ = para->getParH(para->getCoarse())->kInflowQ; - real* rhoBC = para->getParH(para->getCoarse())->Qinflow.RhoBC; + //real* rhoBC = para->getParH(para->getCoarse())->Qinflow.RhoBC; real u0 = para->getVelocity(); real* vx = para->getParH(para->getCoarse())->Qinflow.Vx; real* vy = para->getParH(para->getCoarse())->Qinflow.Vy; @@ -418,7 +418,7 @@ void findQInflow(Parameter* para) real*deltaVz = para->getParH(para->getCoarse())->Qinflow.deltaVz; real* QQ = para->getParH(para->getCoarse())->Qinflow.q27[0]; QforBoundaryConditions &QIN = para->getParH(para->getCoarse())->Qinflow; - unsigned int nxny = nx*ny; + //unsigned int nxny = nx*ny; QIN.kQ = 0; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// QforBoundaryConditions Q; @@ -450,8 +450,8 @@ void findQInflow(Parameter* para) Q.q27[dirBSE ] = &QQ[dirBSE *sizeQ]; Q.q27[dirBNW ] = &QQ[dirBNW *sizeQ]; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - unsigned int li = ((nnx+STARTOFFX-2)-(STARTOFFX+1)-1); - unsigned int lj = ((nny+STARTOFFY-2)-(STARTOFFY+1)-1); + //unsigned int li = ((nnx+STARTOFFX-2)-(STARTOFFX+1)-1); + //unsigned int lj = ((nny+STARTOFFY-2)-(STARTOFFY+1)-1); //k = STARTOFFZ + 1; k = nnz+STARTOFFZ - 1/*3*/; @@ -656,12 +656,13 @@ void findKforQInflow(Parameter* para) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////// E W N S T B NE SW SE NW TE BW BE TW TN BS BN TS ZERO TNE BNE TSE BSE TNW BNW TSW BSW //////////////////////// - int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; - int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; + //int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; + //int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; real ON[27]; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - unsigned int i, j, k, m, mm, l; + //unsigned int mm; + unsigned int i, j, k, m, l; real test = 0.f; //int nx = para->getParH(para->getFine())->nx; //int ny = para->getParH(para->getFine())->ny; @@ -688,7 +689,7 @@ void findKforQInflow(Parameter* para) if(geo_mat[m]==GEO_FLUID){ test = (real)0.f; for(l=0;l<=26;l++){ - mm = nx*(ny*(k+ez[l]) + (j+ey[l])) + (i+ex[l]); + //mm = nx*(ny*(k+ez[l]) + (j+ey[l])) + (i+ex[l]); if(ez[l]==1/*-1*/){ ON[l] = (real) 1.f; } @@ -738,9 +739,9 @@ void findQOutflow(Parameter* para) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////// E W N S T B NE SW SE NW TE BW BE TW TN BS BN TS ZERO TNE BNE TSE BSE TNW BNW TSW BSW //////////////////////// - int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; - int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; - int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; + //int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; + //int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; + //int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; //real ON[27]; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// unsigned int i, j, k, m;//, mm, l; @@ -800,8 +801,8 @@ void findQOutflow(Parameter* para) Q.q27[dirBNW ] = &QQ[dirBNW *sizeQ]; - unsigned int li = ((nnx+STARTOFFX-2)-(STARTOFFX+1)-1); - unsigned int lj = ((nny+STARTOFFY-2)-(STARTOFFY+1)-1); + //unsigned int li = ((nnx+STARTOFFX-2)-(STARTOFFX+1)-1); + //unsigned int lj = ((nny+STARTOFFY-2)-(STARTOFFY+1)-1); k = nnz + STARTOFFZ - 3; @@ -865,12 +866,13 @@ void findKforQOutflow(Parameter* para) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////// E W N S T B NE SW SE NW TE BW BE TW TN BS BN TS ZERO TNE BNE TSE BSE TNW BNW TSW BSW //////////////////////// - int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; - int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; + //int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; + //int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; real ON[27]; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - unsigned int i, j, k, m, mm, l; + //unsigned int mm; + unsigned int i, j, k, m, l; real test = (real) 0.f; //int nx = para->getParH(para->getFine())->nx; //int ny = para->getParH(para->getFine())->ny; @@ -896,7 +898,7 @@ void findKforQOutflow(Parameter* para) if(geo_mat[m]==GEO_FLUID){ test = (real)0.f; for(l=0;l<=26;l++){ - mm = nx*(ny*(k+ez[l]) + (j+ey[l])) + (i+ex[l]); + //mm = nx*(ny*(k+ez[l]) + (j+ey[l])) + (i+ex[l]); if(ez[l]==1){ ON[l] = (real) 1.f; } @@ -1016,9 +1018,9 @@ void findQPressX0(Parameter* para, int lev) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////// E W N S T B NE SW SE NW TE BW BE TW TN BS BN TS ZERO TNE BNE TSE BSE TNW BNW TSW BSW //////////////////////// - int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; - int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; - int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; + //int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; + //int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; + //int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// unsigned int i, j, k, m; int nx = para->getParH(lev)->nx; @@ -1038,7 +1040,7 @@ void findQPressX0(Parameter* para, int lev) real*deltaVz = para->getParH(lev)->QpressX0.deltaVz; real* QQ = para->getParH(lev)->QpressX0.q27[0]; QforBoundaryConditions &QIN = para->getParH(lev)->QpressX0; - unsigned int nxny = nx*ny; + //unsigned int nxny = nx*ny; QIN.kQ = 0; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// QforBoundaryConditions Q; @@ -1071,8 +1073,8 @@ void findQPressX0(Parameter* para, int lev) Q.q27[dirBNW ] = &QQ[dirBNW *sizeQ]; - unsigned int li = ((nnx+STARTOFFX-2)-(STARTOFFX+1)-1); - unsigned int lj = ((nny+STARTOFFY-2)-(STARTOFFY+1)-1); + //unsigned int li = ((nnx+STARTOFFX-2)-(STARTOFFX+1)-1); + //unsigned int lj = ((nny+STARTOFFY-2)-(STARTOFFY+1)-1); i=STARTOFFX+1; //k=nnz+STARTOFFZ-3; @@ -1129,16 +1131,17 @@ void findKforQPressX0(Parameter* para, int lev) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////// E W N S T B NE SW SE NW TE BW BE TW TN BS BN TS ZERO TNE BNE TSE BSE TNW BNW TSW BSW //////////////////////// - int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; - int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; + //int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; + //int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; real ON[27]; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - unsigned int i, j, k, m, mm, l; + //unsigned int mm; + unsigned int i, j, k, m, l; real test = (real) 0.f; int nx = para->getParH(lev)->nx; int ny = para->getParH(lev)->ny; - unsigned int nnx = para->getParH(lev)->gridNX; + //unsigned int nnx = para->getParH(lev)->gridNX; unsigned int nny = para->getParH(lev)->gridNY; unsigned int nnz = para->getParH(lev)->gridNZ; int* geo_mat = para->getParH(lev)->geo; @@ -1156,7 +1159,7 @@ void findKforQPressX0(Parameter* para, int lev) if(geo_mat[m]==GEO_FLUID){ test = (real)0.f; for(l=0;l<=26;l++){ - mm = nx*(ny*(k+ez[l]) + (j+ey[l])) + (i+ex[l]); + //mm = nx*(ny*(k+ez[l]) + (j+ey[l])) + (i+ex[l]); if(ez[l]==1){ ON[l] = (real) 1.f; } @@ -1181,9 +1184,9 @@ void findQPressX1(Parameter* para, int lev) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////// E W N S T B NE SW SE NW TE BW BE TW TN BS BN TS ZERO TNE BNE TSE BSE TNW BNW TSW BSW //////////////////////// - int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; - int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; - int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; + //int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; + //int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; + //int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// unsigned int i, j, k, m; int nx = para->getParH(lev)->nx; @@ -1203,7 +1206,7 @@ void findQPressX1(Parameter* para, int lev) real*deltaVz = para->getParH(lev)->QpressX1.deltaVz; real* QQ = para->getParH(lev)->QpressX1.q27[0]; QforBoundaryConditions &QIN = para->getParH(lev)->QpressX1; - unsigned int nxny = nx*ny; + //unsigned int nxny = nx*ny; QIN.kQ = 0; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// QforBoundaryConditions Q; @@ -1236,8 +1239,8 @@ void findQPressX1(Parameter* para, int lev) Q.q27[dirBNW ] = &QQ[dirBNW *sizeQ]; - unsigned int li = ((nnx+STARTOFFX-2)-(STARTOFFX+1)-1); - unsigned int lj = ((nny+STARTOFFY-2)-(STARTOFFY+1)-1); + //unsigned int li = ((nnx+STARTOFFX-2)-(STARTOFFX+1)-1); + //unsigned int lj = ((nny+STARTOFFY-2)-(STARTOFFY+1)-1); i=nnx+STARTOFFX-3; //k=nnz+STARTOFFZ-3; @@ -1294,12 +1297,13 @@ void findKforQPressX1(Parameter* para, int lev) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////// E W N S T B NE SW SE NW TE BW BE TW TN BS BN TS ZERO TNE BNE TSE BSE TNW BNW TSW BSW //////////////////////// - int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; - int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; + //int ex[27]={ 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, -1, -1, -1, -1}; + //int ey[27]={ 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0, 1, 1, -1, -1, 1, 1, -1, -1}; int ez[27]={ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0, 1, -1, 1, -1, 1, -1, 1, -1}; real ON[27]; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - unsigned int i, j, k, m, mm, l; + //unsigned int mm; + unsigned int i, j, k, m, l; real test = (real) 0.f; int nx = para->getParH(lev)->nx; int ny = para->getParH(lev)->ny; @@ -1321,7 +1325,7 @@ void findKforQPressX1(Parameter* para, int lev) if(geo_mat[m]==GEO_FLUID){ test = (real)0.f; for(l=0;l<=26;l++){ - mm = nx*(ny*(k+ez[l]) + (j+ey[l])) + (i+ex[l]); + //mm = nx*(ny*(k+ez[l]) + (j+ey[l])) + (i+ex[l]); if(ez[l]==1){ ON[l] = (real) 1.f; } diff --git a/src/gpu/VirtualFluids_GPU/GPU/AdvecDiffBCs27.cu b/src/gpu/VirtualFluids_GPU/GPU/AdvecDiffBCs27.cu index bdb6c8c28d427b0e48c055cd73f5db0c37ccee04..6e67ecda71969b19061d92cff8f6d0eb241f4138 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/AdvecDiffBCs27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/AdvecDiffBCs27.cu @@ -2130,67 +2130,67 @@ extern "C" __global__ void QADVel27(int inx, vx2 = OORho*((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); vx3 = OORho*((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); //////////////////////////////////////////////////////////////////////////////// - real f27_W = (D27.f[dirE ])[ke ]; - real f27_E = (D27.f[dirW ])[kw ]; - real f27_S = (D27.f[dirN ])[kn ]; - real f27_N = (D27.f[dirS ])[ks ]; - real f27_B = (D27.f[dirT ])[kt ]; - real f27_T = (D27.f[dirB ])[kb ]; - real f27_SW = (D27.f[dirNE ])[kne ]; - real f27_NE = (D27.f[dirSW ])[ksw ]; - real f27_NW = (D27.f[dirSE ])[kse ]; - real f27_SE = (D27.f[dirNW ])[knw ]; - real f27_BW = (D27.f[dirTE ])[kte ]; - real f27_TE = (D27.f[dirBW ])[kbw ]; - real f27_TW = (D27.f[dirBE ])[kbe ]; - real f27_BE = (D27.f[dirTW ])[ktw ]; - real f27_BS = (D27.f[dirTN ])[ktn ]; - real f27_TN = (D27.f[dirBS ])[kbs ]; - real f27_TS = (D27.f[dirBN ])[kbn ]; - real f27_BN = (D27.f[dirTS ])[kts ]; - real f27_ZERO = (D27.f[dirZERO])[kzero]; - real f27_BSW = (D27.f[dirTNE ])[ktne ]; - real f27_BNE = (D27.f[dirTSW ])[ktsw ]; - real f27_BNW = (D27.f[dirTSE ])[ktse ]; - real f27_BSE = (D27.f[dirTNW ])[ktnw ]; - real f27_TSW = (D27.f[dirBNE ])[kbne ]; - real f27_TNE = (D27.f[dirBSW ])[kbsw ]; - real f27_TNW = (D27.f[dirBSE ])[kbse ]; - real f27_TSE = (D27.f[dirBNW ])[kbnw ]; + //real f27_W = (D27.f[dirE ])[ke ]; + //real f27_E = (D27.f[dirW ])[kw ]; + //real f27_S = (D27.f[dirN ])[kn ]; + //real f27_N = (D27.f[dirS ])[ks ]; + //real f27_B = (D27.f[dirT ])[kt ]; + //real f27_T = (D27.f[dirB ])[kb ]; + //real f27_SW = (D27.f[dirNE ])[kne ]; + //real f27_NE = (D27.f[dirSW ])[ksw ]; + //real f27_NW = (D27.f[dirSE ])[kse ]; + //real f27_SE = (D27.f[dirNW ])[knw ]; + //real f27_BW = (D27.f[dirTE ])[kte ]; + //real f27_TE = (D27.f[dirBW ])[kbw ]; + //real f27_TW = (D27.f[dirBE ])[kbe ]; + //real f27_BE = (D27.f[dirTW ])[ktw ]; + //real f27_BS = (D27.f[dirTN ])[ktn ]; + //real f27_TN = (D27.f[dirBS ])[kbs ]; + //real f27_TS = (D27.f[dirBN ])[kbn ]; + //real f27_BN = (D27.f[dirTS ])[kts ]; + //real f27_ZERO = (D27.f[dirZERO])[kzero]; + //real f27_BSW = (D27.f[dirTNE ])[ktne ]; + //real f27_BNE = (D27.f[dirTSW ])[ktsw ]; + //real f27_BNW = (D27.f[dirTSE ])[ktse ]; + //real f27_BSE = (D27.f[dirTNW ])[ktnw ]; + //real f27_TSW = (D27.f[dirBNE ])[kbne ]; + //real f27_TNE = (D27.f[dirBSW ])[kbsw ]; + //real f27_TNW = (D27.f[dirBSE ])[kbse ]; + //real f27_TSE = (D27.f[dirBNW ])[kbnw ]; //////////////////////////////////////////////////////////////////////////////// real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3); //////////////////////////////////////////////////////////////////////////////// - real ConcD = f27_TSE + f27_TNW + f27_TNE + f27_TSW + f27_BSE + f27_BNW + f27_BNE + f27_BSW + - f27_BN + f27_TS + f27_TN + f27_BS + f27_BE + f27_TW + f27_TE + f27_BW + f27_SE + f27_NW + f27_NE + f27_SW + - f27_T + f27_B + f27_N + f27_S + f27_E + f27_W + f27_ZERO; + //real ConcD = f27_TSE + f27_TNW + f27_TNE + f27_TSW + f27_BSE + f27_BNW + f27_BNE + f27_BSW + + // f27_BN + f27_TS + f27_TN + f27_BS + f27_BE + f27_TW + f27_TE + f27_BW + f27_SE + f27_NW + f27_NE + f27_SW + + // f27_T + f27_B + f27_N + f27_S + f27_E + f27_W + f27_ZERO; //real feq27_ZERO = c8over27* ConcD*(one-cu_sq); - real feq27_E = c2o27* ConcD*(c1o1+c3o1*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); - real feq27_W = c2o27* ConcD*(c1o1+c3o1*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); - real feq27_N = c2o27* ConcD*(c1o1+c3o1*( vx2 )+c9o2*( vx2 )*( vx2 )-cu_sq); - real feq27_S = c2o27* ConcD*(c1o1+c3o1*( -vx2 )+c9o2*( -vx2 )*( -vx2 )-cu_sq); - real feq27_T = c2o27* ConcD*(c1o1+c3o1*( vx3)+c9o2*( vx3)*( vx3)-cu_sq); - real feq27_B = c2o27* ConcD*(c1o1+c3o1*( -vx3)+c9o2*( -vx3)*( -vx3)-cu_sq); - real feq27_NE = c1o54* ConcD*(c1o1+c3o1*( vx1+vx2 )+c9o2*( vx1+vx2 )*( vx1+vx2 )-cu_sq); - real feq27_SW = c1o54* ConcD*(c1o1+c3o1*(-vx1-vx2 )+c9o2*(-vx1-vx2 )*(-vx1-vx2 )-cu_sq); - real feq27_SE = c1o54* ConcD*(c1o1+c3o1*( vx1-vx2 )+c9o2*( vx1-vx2 )*( vx1-vx2 )-cu_sq); - real feq27_NW = c1o54* ConcD*(c1o1+c3o1*(-vx1+vx2 )+c9o2*(-vx1+vx2 )*(-vx1+vx2 )-cu_sq); - real feq27_TE = c1o54* ConcD*(c1o1+c3o1*( vx1 +vx3)+c9o2*( vx1 +vx3)*( vx1 +vx3)-cu_sq); - real feq27_BW = c1o54* ConcD*(c1o1+c3o1*(-vx1 -vx3)+c9o2*(-vx1 -vx3)*(-vx1 -vx3)-cu_sq); - real feq27_BE = c1o54* ConcD*(c1o1+c3o1*( vx1 -vx3)+c9o2*( vx1 -vx3)*( vx1 -vx3)-cu_sq); - real feq27_TW = c1o54* ConcD*(c1o1+c3o1*(-vx1 +vx3)+c9o2*(-vx1 +vx3)*(-vx1 +vx3)-cu_sq); - real feq27_TN = c1o54* ConcD*(c1o1+c3o1*( vx2+vx3)+c9o2*( vx2+vx3)*( vx2+vx3)-cu_sq); - real feq27_BS = c1o54* ConcD*(c1o1+c3o1*( -vx2-vx3)+c9o2*( -vx2-vx3)*( -vx2-vx3)-cu_sq); - real feq27_BN = c1o54* ConcD*(c1o1+c3o1*( vx2-vx3)+c9o2*( vx2-vx3)*( vx2-vx3)-cu_sq); - real feq27_TS = c1o54* ConcD*(c1o1+c3o1*( -vx2+vx3)+c9o2*( -vx2+vx3)*( -vx2+vx3)-cu_sq); - real feq27_TNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2+vx3)+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); - real feq27_BSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); - real feq27_BNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2-vx3)+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); - real feq27_TSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); - real feq27_TSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); - real feq27_BNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); - real feq27_BSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); - real feq27_TNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); + //real feq27_E = c2o27* ConcD*(c1o1+c3o1*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); + //real feq27_W = c2o27* ConcD*(c1o1+c3o1*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); + //real feq27_N = c2o27* ConcD*(c1o1+c3o1*( vx2 )+c9o2*( vx2 )*( vx2 )-cu_sq); + //real feq27_S = c2o27* ConcD*(c1o1+c3o1*( -vx2 )+c9o2*( -vx2 )*( -vx2 )-cu_sq); + //real feq27_T = c2o27* ConcD*(c1o1+c3o1*( vx3)+c9o2*( vx3)*( vx3)-cu_sq); + //real feq27_B = c2o27* ConcD*(c1o1+c3o1*( -vx3)+c9o2*( -vx3)*( -vx3)-cu_sq); + //real feq27_NE = c1o54* ConcD*(c1o1+c3o1*( vx1+vx2 )+c9o2*( vx1+vx2 )*( vx1+vx2 )-cu_sq); + //real feq27_SW = c1o54* ConcD*(c1o1+c3o1*(-vx1-vx2 )+c9o2*(-vx1-vx2 )*(-vx1-vx2 )-cu_sq); + //real feq27_SE = c1o54* ConcD*(c1o1+c3o1*( vx1-vx2 )+c9o2*( vx1-vx2 )*( vx1-vx2 )-cu_sq); + //real feq27_NW = c1o54* ConcD*(c1o1+c3o1*(-vx1+vx2 )+c9o2*(-vx1+vx2 )*(-vx1+vx2 )-cu_sq); + //real feq27_TE = c1o54* ConcD*(c1o1+c3o1*( vx1 +vx3)+c9o2*( vx1 +vx3)*( vx1 +vx3)-cu_sq); + //real feq27_BW = c1o54* ConcD*(c1o1+c3o1*(-vx1 -vx3)+c9o2*(-vx1 -vx3)*(-vx1 -vx3)-cu_sq); + //real feq27_BE = c1o54* ConcD*(c1o1+c3o1*( vx1 -vx3)+c9o2*( vx1 -vx3)*( vx1 -vx3)-cu_sq); + //real feq27_TW = c1o54* ConcD*(c1o1+c3o1*(-vx1 +vx3)+c9o2*(-vx1 +vx3)*(-vx1 +vx3)-cu_sq); + //real feq27_TN = c1o54* ConcD*(c1o1+c3o1*( vx2+vx3)+c9o2*( vx2+vx3)*( vx2+vx3)-cu_sq); + //real feq27_BS = c1o54* ConcD*(c1o1+c3o1*( -vx2-vx3)+c9o2*( -vx2-vx3)*( -vx2-vx3)-cu_sq); + //real feq27_BN = c1o54* ConcD*(c1o1+c3o1*( vx2-vx3)+c9o2*( vx2-vx3)*( vx2-vx3)-cu_sq); + //real feq27_TS = c1o54* ConcD*(c1o1+c3o1*( -vx2+vx3)+c9o2*( -vx2+vx3)*( -vx2+vx3)-cu_sq); + //real feq27_TNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2+vx3)+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); + //real feq27_BSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); + //real feq27_BNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2-vx3)+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); + //real feq27_TSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); + //real feq27_TSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); + //real feq27_BNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); + //real feq27_BSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); + //real feq27_TNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real TempD = temp[k]; //real TempD = four; @@ -3432,67 +3432,67 @@ extern "C" __global__ void QADBB27(int inx, unsigned int size_Mat, bool evenOrOdd) { - Distributions27 D; - if (evenOrOdd==true) - { - D.f[dirE ] = &DD[dirE *size_Mat]; - D.f[dirW ] = &DD[dirW *size_Mat]; - D.f[dirN ] = &DD[dirN *size_Mat]; - D.f[dirS ] = &DD[dirS *size_Mat]; - D.f[dirT ] = &DD[dirT *size_Mat]; - D.f[dirB ] = &DD[dirB *size_Mat]; - D.f[dirNE ] = &DD[dirNE *size_Mat]; - D.f[dirSW ] = &DD[dirSW *size_Mat]; - D.f[dirSE ] = &DD[dirSE *size_Mat]; - D.f[dirNW ] = &DD[dirNW *size_Mat]; - D.f[dirTE ] = &DD[dirTE *size_Mat]; - D.f[dirBW ] = &DD[dirBW *size_Mat]; - D.f[dirBE ] = &DD[dirBE *size_Mat]; - D.f[dirTW ] = &DD[dirTW *size_Mat]; - D.f[dirTN ] = &DD[dirTN *size_Mat]; - D.f[dirBS ] = &DD[dirBS *size_Mat]; - D.f[dirBN ] = &DD[dirBN *size_Mat]; - D.f[dirTS ] = &DD[dirTS *size_Mat]; - D.f[dirZERO] = &DD[dirZERO*size_Mat]; - D.f[dirTNE ] = &DD[dirTNE *size_Mat]; - D.f[dirTSW ] = &DD[dirTSW *size_Mat]; - D.f[dirTSE ] = &DD[dirTSE *size_Mat]; - D.f[dirTNW ] = &DD[dirTNW *size_Mat]; - D.f[dirBNE ] = &DD[dirBNE *size_Mat]; - D.f[dirBSW ] = &DD[dirBSW *size_Mat]; - D.f[dirBSE ] = &DD[dirBSE *size_Mat]; - D.f[dirBNW ] = &DD[dirBNW *size_Mat]; - } - else - { - D.f[dirW ] = &DD[dirE *size_Mat]; - D.f[dirE ] = &DD[dirW *size_Mat]; - D.f[dirS ] = &DD[dirN *size_Mat]; - D.f[dirN ] = &DD[dirS *size_Mat]; - D.f[dirB ] = &DD[dirT *size_Mat]; - D.f[dirT ] = &DD[dirB *size_Mat]; - D.f[dirSW ] = &DD[dirNE *size_Mat]; - D.f[dirNE ] = &DD[dirSW *size_Mat]; - D.f[dirNW ] = &DD[dirSE *size_Mat]; - D.f[dirSE ] = &DD[dirNW *size_Mat]; - D.f[dirBW ] = &DD[dirTE *size_Mat]; - D.f[dirTE ] = &DD[dirBW *size_Mat]; - D.f[dirTW ] = &DD[dirBE *size_Mat]; - D.f[dirBE ] = &DD[dirTW *size_Mat]; - D.f[dirBS ] = &DD[dirTN *size_Mat]; - D.f[dirTN ] = &DD[dirBS *size_Mat]; - D.f[dirTS ] = &DD[dirBN *size_Mat]; - D.f[dirBN ] = &DD[dirTS *size_Mat]; - D.f[dirZERO] = &DD[dirZERO*size_Mat]; - D.f[dirTNE ] = &DD[dirBSW *size_Mat]; - D.f[dirTSW ] = &DD[dirBNE *size_Mat]; - D.f[dirTSE ] = &DD[dirBNW *size_Mat]; - D.f[dirTNW ] = &DD[dirBSE *size_Mat]; - D.f[dirBNE ] = &DD[dirTSW *size_Mat]; - D.f[dirBSW ] = &DD[dirTNE *size_Mat]; - D.f[dirBSE ] = &DD[dirTNW *size_Mat]; - D.f[dirBNW ] = &DD[dirTSE *size_Mat]; - } + //Distributions27 D; + //if (evenOrOdd==true) + //{ + // D.f[dirE ] = &DD[dirE *size_Mat]; + // D.f[dirW ] = &DD[dirW *size_Mat]; + // D.f[dirN ] = &DD[dirN *size_Mat]; + // D.f[dirS ] = &DD[dirS *size_Mat]; + // D.f[dirT ] = &DD[dirT *size_Mat]; + // D.f[dirB ] = &DD[dirB *size_Mat]; + // D.f[dirNE ] = &DD[dirNE *size_Mat]; + // D.f[dirSW ] = &DD[dirSW *size_Mat]; + // D.f[dirSE ] = &DD[dirSE *size_Mat]; + // D.f[dirNW ] = &DD[dirNW *size_Mat]; + // D.f[dirTE ] = &DD[dirTE *size_Mat]; + // D.f[dirBW ] = &DD[dirBW *size_Mat]; + // D.f[dirBE ] = &DD[dirBE *size_Mat]; + // D.f[dirTW ] = &DD[dirTW *size_Mat]; + // D.f[dirTN ] = &DD[dirTN *size_Mat]; + // D.f[dirBS ] = &DD[dirBS *size_Mat]; + // D.f[dirBN ] = &DD[dirBN *size_Mat]; + // D.f[dirTS ] = &DD[dirTS *size_Mat]; + // D.f[dirZERO] = &DD[dirZERO*size_Mat]; + // D.f[dirTNE ] = &DD[dirTNE *size_Mat]; + // D.f[dirTSW ] = &DD[dirTSW *size_Mat]; + // D.f[dirTSE ] = &DD[dirTSE *size_Mat]; + // D.f[dirTNW ] = &DD[dirTNW *size_Mat]; + // D.f[dirBNE ] = &DD[dirBNE *size_Mat]; + // D.f[dirBSW ] = &DD[dirBSW *size_Mat]; + // D.f[dirBSE ] = &DD[dirBSE *size_Mat]; + // D.f[dirBNW ] = &DD[dirBNW *size_Mat]; + //} + //else + //{ + // D.f[dirW ] = &DD[dirE *size_Mat]; + // D.f[dirE ] = &DD[dirW *size_Mat]; + // D.f[dirS ] = &DD[dirN *size_Mat]; + // D.f[dirN ] = &DD[dirS *size_Mat]; + // D.f[dirB ] = &DD[dirT *size_Mat]; + // D.f[dirT ] = &DD[dirB *size_Mat]; + // D.f[dirSW ] = &DD[dirNE *size_Mat]; + // D.f[dirNE ] = &DD[dirSW *size_Mat]; + // D.f[dirNW ] = &DD[dirSE *size_Mat]; + // D.f[dirSE ] = &DD[dirNW *size_Mat]; + // D.f[dirBW ] = &DD[dirTE *size_Mat]; + // D.f[dirTE ] = &DD[dirBW *size_Mat]; + // D.f[dirTW ] = &DD[dirBE *size_Mat]; + // D.f[dirBE ] = &DD[dirTW *size_Mat]; + // D.f[dirBS ] = &DD[dirTN *size_Mat]; + // D.f[dirTN ] = &DD[dirBS *size_Mat]; + // D.f[dirTS ] = &DD[dirBN *size_Mat]; + // D.f[dirBN ] = &DD[dirTS *size_Mat]; + // D.f[dirZERO] = &DD[dirZERO*size_Mat]; + // D.f[dirTNE ] = &DD[dirBSW *size_Mat]; + // D.f[dirTSW ] = &DD[dirBNE *size_Mat]; + // D.f[dirTSE ] = &DD[dirBNW *size_Mat]; + // D.f[dirTNW ] = &DD[dirBSE *size_Mat]; + // D.f[dirBNE ] = &DD[dirTSW *size_Mat]; + // D.f[dirBSW ] = &DD[dirTNE *size_Mat]; + // D.f[dirBSE ] = &DD[dirTNW *size_Mat]; + // D.f[dirBNW ] = &DD[dirTSE *size_Mat]; + //} Distributions27 D27; if (evenOrOdd==true) @@ -3603,7 +3603,7 @@ extern "C" __global__ void QADBB27(int inx, //////////////////////////////////////////////////////////////////////////////// //index unsigned int KQK = k_Q[k]; - unsigned int kzero= KQK; + //unsigned int kzero= KQK; unsigned int ke = KQK; unsigned int kw = neighborX[KQK]; unsigned int kn = KQK; @@ -3631,35 +3631,36 @@ extern "C" __global__ void QADBB27(int inx, unsigned int ktne = KQK; unsigned int kbsw = neighborZ[ksw]; //////////////////////////////////////////////////////////////////////////////// - real f_W = (D.f[dirE ])[ke ]; - real f_E = (D.f[dirW ])[kw ]; - real f_S = (D.f[dirN ])[kn ]; - real f_N = (D.f[dirS ])[ks ]; - real f_B = (D.f[dirT ])[kt ]; - real f_T = (D.f[dirB ])[kb ]; - real f_SW = (D.f[dirNE ])[kne ]; - real f_NE = (D.f[dirSW ])[ksw ]; - real f_NW = (D.f[dirSE ])[kse ]; - real f_SE = (D.f[dirNW ])[knw ]; - real f_BW = (D.f[dirTE ])[kte ]; - real f_TE = (D.f[dirBW ])[kbw ]; - real f_TW = (D.f[dirBE ])[kbe ]; - real f_BE = (D.f[dirTW ])[ktw ]; - real f_BS = (D.f[dirTN ])[ktn ]; - real f_TN = (D.f[dirBS ])[kbs ]; - real f_TS = (D.f[dirBN ])[kbn ]; - real f_BN = (D.f[dirTS ])[kts ]; - real f_ZERO = (D.f[dirZERO])[kzero]; - real f_BSW = (D.f[dirTNE ])[ktne ]; - real f_BNE = (D.f[dirTSW ])[ktsw ]; - real f_BNW = (D.f[dirTSE ])[ktse ]; - real f_BSE = (D.f[dirTNW ])[ktnw ]; - real f_TSW = (D.f[dirBNE ])[kbne ]; - real f_TNE = (D.f[dirBSW ])[kbsw ]; - real f_TNW = (D.f[dirBSE ])[kbse ]; - real f_TSE = (D.f[dirBNW ])[kbnw ]; + //real f_W = (D.f[dirE ])[ke ]; + //real f_E = (D.f[dirW ])[kw ]; + //real f_S = (D.f[dirN ])[kn ]; + //real f_N = (D.f[dirS ])[ks ]; + //real f_B = (D.f[dirT ])[kt ]; + //real f_T = (D.f[dirB ])[kb ]; + //real f_SW = (D.f[dirNE ])[kne ]; + //real f_NE = (D.f[dirSW ])[ksw ]; + //real f_NW = (D.f[dirSE ])[kse ]; + //real f_SE = (D.f[dirNW ])[knw ]; + //real f_BW = (D.f[dirTE ])[kte ]; + //real f_TE = (D.f[dirBW ])[kbw ]; + //real f_TW = (D.f[dirBE ])[kbe ]; + //real f_BE = (D.f[dirTW ])[ktw ]; + //real f_BS = (D.f[dirTN ])[ktn ]; + //real f_TN = (D.f[dirBS ])[kbs ]; + //real f_TS = (D.f[dirBN ])[kbn ]; + //real f_BN = (D.f[dirTS ])[kts ]; + //real f_ZERO = (D.f[dirZERO])[kzero]; + //real f_BSW = (D.f[dirTNE ])[ktne ]; + //real f_BNE = (D.f[dirTSW ])[ktsw ]; + //real f_BNW = (D.f[dirTSE ])[ktse ]; + //real f_BSE = (D.f[dirTNW ])[ktnw ]; + //real f_TSW = (D.f[dirBNE ])[kbne ]; + //real f_TNE = (D.f[dirBSW ])[kbsw ]; + //real f_TNW = (D.f[dirBSE ])[kbse ]; + //real f_TSE = (D.f[dirBNW ])[kbnw ]; //////////////////////////////////////////////////////////////////////////////// - real vx1, vx2, vx3, /*drho, feq,*/ q; + //real vx1, vx2, vx3, /*drho, feq,*/ q; + real q; ////drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + //// f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + //// f_T + f_B + f_N + f_S + f_E + f_W + f_ZERO; @@ -3676,12 +3677,12 @@ extern "C" __global__ void QADBB27(int inx, //vx3 = ((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + // (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + // (f_T - f_B); - real rho0 = (f_TNE+f_BSW)+(f_TSW+f_BNE)+(f_TSE+f_BNW)+(f_TNW+f_BSE)+(f_NE+f_SW)+(f_NW+f_SE)+(f_TE+f_BW)+(f_BE+f_TW)+(f_TN+f_BS)+(f_BN+f_TS)+(f_E+f_W)+(f_N+f_S)+(f_T+f_B)+f_ZERO; - real rho = rho0 + c1o1; - real OORho = c1o1/rho; - vx1 = OORho*((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)+(f_BSE-f_TNW) +(f_NE-f_SW)+(f_SE-f_NW)+(f_TE-f_BW)+(f_BE-f_TW)+(f_E-f_W)); - vx2 = OORho*((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); - vx3 = OORho*((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); + //real rho0 = (f_TNE+f_BSW)+(f_TSW+f_BNE)+(f_TSE+f_BNW)+(f_TNW+f_BSE)+(f_NE+f_SW)+(f_NW+f_SE)+(f_TE+f_BW)+(f_BE+f_TW)+(f_TN+f_BS)+(f_BN+f_TS)+(f_E+f_W)+(f_N+f_S)+(f_T+f_B)+f_ZERO; + //real rho = rho0 + c1o1; + //real OORho = c1o1/rho; + //vx1 = OORho*((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)+(f_BSE-f_TNW) +(f_NE-f_SW)+(f_SE-f_NW)+(f_TE-f_BW)+(f_BE-f_TW)+(f_E-f_W)); + //vx2 = OORho*((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); + //vx3 = OORho*((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); //////////////////////////////////////////////////////////////////////////////// real f27_W = (D27.f[dirE ])[ke ]; real f27_E = (D27.f[dirW ])[kw ]; @@ -3701,7 +3702,7 @@ extern "C" __global__ void QADBB27(int inx, real f27_TN = (D27.f[dirBS ])[kbs ]; real f27_TS = (D27.f[dirBN ])[kbn ]; real f27_BN = (D27.f[dirTS ])[kts ]; - real f27_ZERO = (D27.f[dirZERO])[kzero]; + //real f27_ZERO = (D27.f[dirZERO])[kzero]; real f27_BSW = (D27.f[dirTNE ])[ktne ]; real f27_BNE = (D27.f[dirTSW ])[ktsw ]; real f27_BNW = (D27.f[dirTSE ])[ktse ]; @@ -3711,69 +3712,69 @@ extern "C" __global__ void QADBB27(int inx, real f27_TNW = (D27.f[dirBSE ])[kbse ]; real f27_TSE = (D27.f[dirBNW ])[kbnw ]; //////////////////////////////////////////////////////////////////////////////// - real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3); + //real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3); //////////////////////////////////////////////////////////////////////////////// - real ConcD = f27_TSE + f27_TNW + f27_TNE + f27_TSW + f27_BSE + f27_BNW + f27_BNE + f27_BSW + - f27_BN + f27_TS + f27_TN + f27_BS + f27_BE + f27_TW + f27_TE + f27_BW + f27_SE + f27_NW + f27_NE + f27_SW + - f27_T + f27_B + f27_N + f27_S + f27_E + f27_W + f27_ZERO; + //real ConcD = f27_TSE + f27_TNW + f27_TNE + f27_TSW + f27_BSE + f27_BNW + f27_BNE + f27_BSW + + // f27_BN + f27_TS + f27_TN + f27_BS + f27_BE + f27_TW + f27_TE + f27_BW + f27_SE + f27_NW + f27_NE + f27_SW + + // f27_T + f27_B + f27_N + f27_S + f27_E + f27_W + f27_ZERO; //real feq27_ZERO = c8over27* ConcD*(one-cu_sq); - real feq27_E = c2o27* ConcD*(c1o1+c3o1*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); - real feq27_W = c2o27* ConcD*(c1o1+c3o1*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); - real feq27_N = c2o27* ConcD*(c1o1+c3o1*( vx2 )+c9o2*( vx2 )*( vx2 )-cu_sq); - real feq27_S = c2o27* ConcD*(c1o1+c3o1*( -vx2 )+c9o2*( -vx2 )*( -vx2 )-cu_sq); - real feq27_T = c2o27* ConcD*(c1o1+c3o1*( vx3)+c9o2*( vx3)*( vx3)-cu_sq); - real feq27_B = c2o27* ConcD*(c1o1+c3o1*( -vx3)+c9o2*( -vx3)*( -vx3)-cu_sq); - real feq27_NE = c1o54* ConcD*(c1o1+c3o1*( vx1+vx2 )+c9o2*( vx1+vx2 )*( vx1+vx2 )-cu_sq); - real feq27_SW = c1o54* ConcD*(c1o1+c3o1*(-vx1-vx2 )+c9o2*(-vx1-vx2 )*(-vx1-vx2 )-cu_sq); - real feq27_SE = c1o54* ConcD*(c1o1+c3o1*( vx1-vx2 )+c9o2*( vx1-vx2 )*( vx1-vx2 )-cu_sq); - real feq27_NW = c1o54* ConcD*(c1o1+c3o1*(-vx1+vx2 )+c9o2*(-vx1+vx2 )*(-vx1+vx2 )-cu_sq); - real feq27_TE = c1o54* ConcD*(c1o1+c3o1*( vx1 +vx3)+c9o2*( vx1 +vx3)*( vx1 +vx3)-cu_sq); - real feq27_BW = c1o54* ConcD*(c1o1+c3o1*(-vx1 -vx3)+c9o2*(-vx1 -vx3)*(-vx1 -vx3)-cu_sq); - real feq27_BE = c1o54* ConcD*(c1o1+c3o1*( vx1 -vx3)+c9o2*( vx1 -vx3)*( vx1 -vx3)-cu_sq); - real feq27_TW = c1o54* ConcD*(c1o1+c3o1*(-vx1 +vx3)+c9o2*(-vx1 +vx3)*(-vx1 +vx3)-cu_sq); - real feq27_TN = c1o54* ConcD*(c1o1+c3o1*( vx2+vx3)+c9o2*( vx2+vx3)*( vx2+vx3)-cu_sq); - real feq27_BS = c1o54* ConcD*(c1o1+c3o1*( -vx2-vx3)+c9o2*( -vx2-vx3)*( -vx2-vx3)-cu_sq); - real feq27_BN = c1o54* ConcD*(c1o1+c3o1*( vx2-vx3)+c9o2*( vx2-vx3)*( vx2-vx3)-cu_sq); - real feq27_TS = c1o54* ConcD*(c1o1+c3o1*( -vx2+vx3)+c9o2*( -vx2+vx3)*( -vx2+vx3)-cu_sq); - real feq27_TNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2+vx3)+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); - real feq27_BSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); - real feq27_BNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2-vx3)+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); - real feq27_TSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); - real feq27_TSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); - real feq27_BNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); - real feq27_BSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); - real feq27_TNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); + //real feq27_E = c2o27* ConcD*(c1o1+c3o1*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); + //real feq27_W = c2o27* ConcD*(c1o1+c3o1*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); + //real feq27_N = c2o27* ConcD*(c1o1+c3o1*( vx2 )+c9o2*( vx2 )*( vx2 )-cu_sq); + //real feq27_S = c2o27* ConcD*(c1o1+c3o1*( -vx2 )+c9o2*( -vx2 )*( -vx2 )-cu_sq); + //real feq27_T = c2o27* ConcD*(c1o1+c3o1*( vx3)+c9o2*( vx3)*( vx3)-cu_sq); + //real feq27_B = c2o27* ConcD*(c1o1+c3o1*( -vx3)+c9o2*( -vx3)*( -vx3)-cu_sq); + //real feq27_NE = c1o54* ConcD*(c1o1+c3o1*( vx1+vx2 )+c9o2*( vx1+vx2 )*( vx1+vx2 )-cu_sq); + //real feq27_SW = c1o54* ConcD*(c1o1+c3o1*(-vx1-vx2 )+c9o2*(-vx1-vx2 )*(-vx1-vx2 )-cu_sq); + //real feq27_SE = c1o54* ConcD*(c1o1+c3o1*( vx1-vx2 )+c9o2*( vx1-vx2 )*( vx1-vx2 )-cu_sq); + //real feq27_NW = c1o54* ConcD*(c1o1+c3o1*(-vx1+vx2 )+c9o2*(-vx1+vx2 )*(-vx1+vx2 )-cu_sq); + //real feq27_TE = c1o54* ConcD*(c1o1+c3o1*( vx1 +vx3)+c9o2*( vx1 +vx3)*( vx1 +vx3)-cu_sq); + //real feq27_BW = c1o54* ConcD*(c1o1+c3o1*(-vx1 -vx3)+c9o2*(-vx1 -vx3)*(-vx1 -vx3)-cu_sq); + //real feq27_BE = c1o54* ConcD*(c1o1+c3o1*( vx1 -vx3)+c9o2*( vx1 -vx3)*( vx1 -vx3)-cu_sq); + //real feq27_TW = c1o54* ConcD*(c1o1+c3o1*(-vx1 +vx3)+c9o2*(-vx1 +vx3)*(-vx1 +vx3)-cu_sq); + //real feq27_TN = c1o54* ConcD*(c1o1+c3o1*( vx2+vx3)+c9o2*( vx2+vx3)*( vx2+vx3)-cu_sq); + //real feq27_BS = c1o54* ConcD*(c1o1+c3o1*( -vx2-vx3)+c9o2*( -vx2-vx3)*( -vx2-vx3)-cu_sq); + //real feq27_BN = c1o54* ConcD*(c1o1+c3o1*( vx2-vx3)+c9o2*( vx2-vx3)*( vx2-vx3)-cu_sq); + //real feq27_TS = c1o54* ConcD*(c1o1+c3o1*( -vx2+vx3)+c9o2*( -vx2+vx3)*( -vx2+vx3)-cu_sq); + //real feq27_TNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2+vx3)+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); + //real feq27_BSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); + //real feq27_BNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2-vx3)+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); + //real feq27_TSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); + //real feq27_TSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); + //real feq27_BNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); + //real feq27_BSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); + //real feq27_TNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real TempD = temp[k]; + //real TempD = temp[k]; //real feqW27_ZERO = c8over27* TempD*(one-cu_sq); - real feqW27_E = c2o27* TempD*(c1o1+c3o1*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); - real feqW27_W = c2o27* TempD*(c1o1+c3o1*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); - real feqW27_N = c2o27* TempD*(c1o1+c3o1*( vx2 )+c9o2*( vx2 )*( vx2 )-cu_sq); - real feqW27_S = c2o27* TempD*(c1o1+c3o1*( -vx2 )+c9o2*( -vx2 )*( -vx2 )-cu_sq); - real feqW27_T = c2o27* TempD*(c1o1+c3o1*( vx3)+c9o2*( vx3)*( vx3)-cu_sq); - real feqW27_B = c2o27* TempD*(c1o1+c3o1*( -vx3)+c9o2*( -vx3)*( -vx3)-cu_sq); - real feqW27_NE = c1o54* TempD*(c1o1+c3o1*( vx1+vx2 )+c9o2*( vx1+vx2 )*( vx1+vx2 )-cu_sq); - real feqW27_SW = c1o54* TempD*(c1o1+c3o1*(-vx1-vx2 )+c9o2*(-vx1-vx2 )*(-vx1-vx2 )-cu_sq); - real feqW27_SE = c1o54* TempD*(c1o1+c3o1*( vx1-vx2 )+c9o2*( vx1-vx2 )*( vx1-vx2 )-cu_sq); - real feqW27_NW = c1o54* TempD*(c1o1+c3o1*(-vx1+vx2 )+c9o2*(-vx1+vx2 )*(-vx1+vx2 )-cu_sq); - real feqW27_TE = c1o54* TempD*(c1o1+c3o1*( vx1 +vx3)+c9o2*( vx1 +vx3)*( vx1 +vx3)-cu_sq); - real feqW27_BW = c1o54* TempD*(c1o1+c3o1*(-vx1 -vx3)+c9o2*(-vx1 -vx3)*(-vx1 -vx3)-cu_sq); - real feqW27_BE = c1o54* TempD*(c1o1+c3o1*( vx1 -vx3)+c9o2*( vx1 -vx3)*( vx1 -vx3)-cu_sq); - real feqW27_TW = c1o54* TempD*(c1o1+c3o1*(-vx1 +vx3)+c9o2*(-vx1 +vx3)*(-vx1 +vx3)-cu_sq); - real feqW27_TN = c1o54* TempD*(c1o1+c3o1*( vx2+vx3)+c9o2*( vx2+vx3)*( vx2+vx3)-cu_sq); - real feqW27_BS = c1o54* TempD*(c1o1+c3o1*( -vx2-vx3)+c9o2*( -vx2-vx3)*( -vx2-vx3)-cu_sq); - real feqW27_BN = c1o54* TempD*(c1o1+c3o1*( vx2-vx3)+c9o2*( vx2-vx3)*( vx2-vx3)-cu_sq); - real feqW27_TS = c1o54* TempD*(c1o1+c3o1*( -vx2+vx3)+c9o2*( -vx2+vx3)*( -vx2+vx3)-cu_sq); - real feqW27_TNE = c1o216*TempD*(c1o1+c3o1*( vx1+vx2+vx3)+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); - real feqW27_BSW = c1o216*TempD*(c1o1+c3o1*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); - real feqW27_BNE = c1o216*TempD*(c1o1+c3o1*( vx1+vx2-vx3)+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); - real feqW27_TSW = c1o216*TempD*(c1o1+c3o1*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); - real feqW27_TSE = c1o216*TempD*(c1o1+c3o1*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); - real feqW27_BNW = c1o216*TempD*(c1o1+c3o1*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); - real feqW27_BSE = c1o216*TempD*(c1o1+c3o1*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); - real feqW27_TNW = c1o216*TempD*(c1o1+c3o1*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); + //real feqW27_E = c2o27* TempD*(c1o1+c3o1*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); + //real feqW27_W = c2o27* TempD*(c1o1+c3o1*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); + //real feqW27_N = c2o27* TempD*(c1o1+c3o1*( vx2 )+c9o2*( vx2 )*( vx2 )-cu_sq); + //real feqW27_S = c2o27* TempD*(c1o1+c3o1*( -vx2 )+c9o2*( -vx2 )*( -vx2 )-cu_sq); + //real feqW27_T = c2o27* TempD*(c1o1+c3o1*( vx3)+c9o2*( vx3)*( vx3)-cu_sq); + //real feqW27_B = c2o27* TempD*(c1o1+c3o1*( -vx3)+c9o2*( -vx3)*( -vx3)-cu_sq); + //real feqW27_NE = c1o54* TempD*(c1o1+c3o1*( vx1+vx2 )+c9o2*( vx1+vx2 )*( vx1+vx2 )-cu_sq); + //real feqW27_SW = c1o54* TempD*(c1o1+c3o1*(-vx1-vx2 )+c9o2*(-vx1-vx2 )*(-vx1-vx2 )-cu_sq); + //real feqW27_SE = c1o54* TempD*(c1o1+c3o1*( vx1-vx2 )+c9o2*( vx1-vx2 )*( vx1-vx2 )-cu_sq); + //real feqW27_NW = c1o54* TempD*(c1o1+c3o1*(-vx1+vx2 )+c9o2*(-vx1+vx2 )*(-vx1+vx2 )-cu_sq); + //real feqW27_TE = c1o54* TempD*(c1o1+c3o1*( vx1 +vx3)+c9o2*( vx1 +vx3)*( vx1 +vx3)-cu_sq); + //real feqW27_BW = c1o54* TempD*(c1o1+c3o1*(-vx1 -vx3)+c9o2*(-vx1 -vx3)*(-vx1 -vx3)-cu_sq); + //real feqW27_BE = c1o54* TempD*(c1o1+c3o1*( vx1 -vx3)+c9o2*( vx1 -vx3)*( vx1 -vx3)-cu_sq); + //real feqW27_TW = c1o54* TempD*(c1o1+c3o1*(-vx1 +vx3)+c9o2*(-vx1 +vx3)*(-vx1 +vx3)-cu_sq); + //real feqW27_TN = c1o54* TempD*(c1o1+c3o1*( vx2+vx3)+c9o2*( vx2+vx3)*( vx2+vx3)-cu_sq); + //real feqW27_BS = c1o54* TempD*(c1o1+c3o1*( -vx2-vx3)+c9o2*( -vx2-vx3)*( -vx2-vx3)-cu_sq); + //real feqW27_BN = c1o54* TempD*(c1o1+c3o1*( vx2-vx3)+c9o2*( vx2-vx3)*( vx2-vx3)-cu_sq); + //real feqW27_TS = c1o54* TempD*(c1o1+c3o1*( -vx2+vx3)+c9o2*( -vx2+vx3)*( -vx2+vx3)-cu_sq); + //real feqW27_TNE = c1o216*TempD*(c1o1+c3o1*( vx1+vx2+vx3)+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); + //real feqW27_BSW = c1o216*TempD*(c1o1+c3o1*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); + //real feqW27_BNE = c1o216*TempD*(c1o1+c3o1*( vx1+vx2-vx3)+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); + //real feqW27_TSW = c1o216*TempD*(c1o1+c3o1*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); + //real feqW27_TSE = c1o216*TempD*(c1o1+c3o1*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); + //real feqW27_BNW = c1o216*TempD*(c1o1+c3o1*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); + //real feqW27_BSE = c1o216*TempD*(c1o1+c3o1*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); + //real feqW27_TNW = c1o216*TempD*(c1o1+c3o1*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real omegaD = c3o1 - sqrt(c3o1); //real Lam = -(c1o2-one/omegaD); @@ -3949,67 +3950,67 @@ extern "C" __global__ void QNoSlipADincomp7( int inx, unsigned int size_Mat, bool evenOrOdd) { - Distributions27 D; - if (evenOrOdd==true) - { - D.f[dirE ] = &DD[dirE *size_Mat]; - D.f[dirW ] = &DD[dirW *size_Mat]; - D.f[dirN ] = &DD[dirN *size_Mat]; - D.f[dirS ] = &DD[dirS *size_Mat]; - D.f[dirT ] = &DD[dirT *size_Mat]; - D.f[dirB ] = &DD[dirB *size_Mat]; - D.f[dirNE ] = &DD[dirNE *size_Mat]; - D.f[dirSW ] = &DD[dirSW *size_Mat]; - D.f[dirSE ] = &DD[dirSE *size_Mat]; - D.f[dirNW ] = &DD[dirNW *size_Mat]; - D.f[dirTE ] = &DD[dirTE *size_Mat]; - D.f[dirBW ] = &DD[dirBW *size_Mat]; - D.f[dirBE ] = &DD[dirBE *size_Mat]; - D.f[dirTW ] = &DD[dirTW *size_Mat]; - D.f[dirTN ] = &DD[dirTN *size_Mat]; - D.f[dirBS ] = &DD[dirBS *size_Mat]; - D.f[dirBN ] = &DD[dirBN *size_Mat]; - D.f[dirTS ] = &DD[dirTS *size_Mat]; - D.f[dirZERO] = &DD[dirZERO*size_Mat]; - D.f[dirTNE ] = &DD[dirTNE *size_Mat]; - D.f[dirTSW ] = &DD[dirTSW *size_Mat]; - D.f[dirTSE ] = &DD[dirTSE *size_Mat]; - D.f[dirTNW ] = &DD[dirTNW *size_Mat]; - D.f[dirBNE ] = &DD[dirBNE *size_Mat]; - D.f[dirBSW ] = &DD[dirBSW *size_Mat]; - D.f[dirBSE ] = &DD[dirBSE *size_Mat]; - D.f[dirBNW ] = &DD[dirBNW *size_Mat]; - } - else - { - D.f[dirW ] = &DD[dirE *size_Mat]; - D.f[dirE ] = &DD[dirW *size_Mat]; - D.f[dirS ] = &DD[dirN *size_Mat]; - D.f[dirN ] = &DD[dirS *size_Mat]; - D.f[dirB ] = &DD[dirT *size_Mat]; - D.f[dirT ] = &DD[dirB *size_Mat]; - D.f[dirSW ] = &DD[dirNE *size_Mat]; - D.f[dirNE ] = &DD[dirSW *size_Mat]; - D.f[dirNW ] = &DD[dirSE *size_Mat]; - D.f[dirSE ] = &DD[dirNW *size_Mat]; - D.f[dirBW ] = &DD[dirTE *size_Mat]; - D.f[dirTE ] = &DD[dirBW *size_Mat]; - D.f[dirTW ] = &DD[dirBE *size_Mat]; - D.f[dirBE ] = &DD[dirTW *size_Mat]; - D.f[dirBS ] = &DD[dirTN *size_Mat]; - D.f[dirTN ] = &DD[dirBS *size_Mat]; - D.f[dirTS ] = &DD[dirBN *size_Mat]; - D.f[dirBN ] = &DD[dirTS *size_Mat]; - D.f[dirZERO] = &DD[dirZERO*size_Mat]; - D.f[dirTNE ] = &DD[dirBSW *size_Mat]; - D.f[dirTSW ] = &DD[dirBNE *size_Mat]; - D.f[dirTSE ] = &DD[dirBNW *size_Mat]; - D.f[dirTNW ] = &DD[dirBSE *size_Mat]; - D.f[dirBNE ] = &DD[dirTSW *size_Mat]; - D.f[dirBSW ] = &DD[dirTNE *size_Mat]; - D.f[dirBSE ] = &DD[dirTNW *size_Mat]; - D.f[dirBNW ] = &DD[dirTSE *size_Mat]; - } + //Distributions27 D; + //if (evenOrOdd==true) + //{ + // D.f[dirE ] = &DD[dirE *size_Mat]; + // D.f[dirW ] = &DD[dirW *size_Mat]; + // D.f[dirN ] = &DD[dirN *size_Mat]; + // D.f[dirS ] = &DD[dirS *size_Mat]; + // D.f[dirT ] = &DD[dirT *size_Mat]; + // D.f[dirB ] = &DD[dirB *size_Mat]; + // D.f[dirNE ] = &DD[dirNE *size_Mat]; + // D.f[dirSW ] = &DD[dirSW *size_Mat]; + // D.f[dirSE ] = &DD[dirSE *size_Mat]; + // D.f[dirNW ] = &DD[dirNW *size_Mat]; + // D.f[dirTE ] = &DD[dirTE *size_Mat]; + // D.f[dirBW ] = &DD[dirBW *size_Mat]; + // D.f[dirBE ] = &DD[dirBE *size_Mat]; + // D.f[dirTW ] = &DD[dirTW *size_Mat]; + // D.f[dirTN ] = &DD[dirTN *size_Mat]; + // D.f[dirBS ] = &DD[dirBS *size_Mat]; + // D.f[dirBN ] = &DD[dirBN *size_Mat]; + // D.f[dirTS ] = &DD[dirTS *size_Mat]; + // D.f[dirZERO] = &DD[dirZERO*size_Mat]; + // D.f[dirTNE ] = &DD[dirTNE *size_Mat]; + // D.f[dirTSW ] = &DD[dirTSW *size_Mat]; + // D.f[dirTSE ] = &DD[dirTSE *size_Mat]; + // D.f[dirTNW ] = &DD[dirTNW *size_Mat]; + // D.f[dirBNE ] = &DD[dirBNE *size_Mat]; + // D.f[dirBSW ] = &DD[dirBSW *size_Mat]; + // D.f[dirBSE ] = &DD[dirBSE *size_Mat]; + // D.f[dirBNW ] = &DD[dirBNW *size_Mat]; + //} + //else + //{ + // D.f[dirW ] = &DD[dirE *size_Mat]; + // D.f[dirE ] = &DD[dirW *size_Mat]; + // D.f[dirS ] = &DD[dirN *size_Mat]; + // D.f[dirN ] = &DD[dirS *size_Mat]; + // D.f[dirB ] = &DD[dirT *size_Mat]; + // D.f[dirT ] = &DD[dirB *size_Mat]; + // D.f[dirSW ] = &DD[dirNE *size_Mat]; + // D.f[dirNE ] = &DD[dirSW *size_Mat]; + // D.f[dirNW ] = &DD[dirSE *size_Mat]; + // D.f[dirSE ] = &DD[dirNW *size_Mat]; + // D.f[dirBW ] = &DD[dirTE *size_Mat]; + // D.f[dirTE ] = &DD[dirBW *size_Mat]; + // D.f[dirTW ] = &DD[dirBE *size_Mat]; + // D.f[dirBE ] = &DD[dirTW *size_Mat]; + // D.f[dirBS ] = &DD[dirTN *size_Mat]; + // D.f[dirTN ] = &DD[dirBS *size_Mat]; + // D.f[dirTS ] = &DD[dirBN *size_Mat]; + // D.f[dirBN ] = &DD[dirTS *size_Mat]; + // D.f[dirZERO] = &DD[dirZERO*size_Mat]; + // D.f[dirTNE ] = &DD[dirBSW *size_Mat]; + // D.f[dirTSW ] = &DD[dirBNE *size_Mat]; + // D.f[dirTSE ] = &DD[dirBNW *size_Mat]; + // D.f[dirTNW ] = &DD[dirBSE *size_Mat]; + // D.f[dirBNE ] = &DD[dirTSW *size_Mat]; + // D.f[dirBSW ] = &DD[dirTNE *size_Mat]; + // D.f[dirBSE ] = &DD[dirTNW *size_Mat]; + // D.f[dirBNW ] = &DD[dirTSE *size_Mat]; + //} Distributions7 D7; if (evenOrOdd==true) @@ -4059,73 +4060,73 @@ extern "C" __global__ void QNoSlipADincomp7( int inx, ////////////////////////////////////////////////////////////////////////////////// //index unsigned int KQK = k_Q[k]; - unsigned int kzero= KQK; + //unsigned int kzero= KQK; unsigned int ke = KQK; unsigned int kw = neighborX[KQK]; unsigned int kn = KQK; unsigned int ks = neighborY[KQK]; unsigned int kt = KQK; unsigned int kb = neighborZ[KQK]; - unsigned int ksw = neighborY[kw]; - unsigned int kne = KQK; - unsigned int kse = ks; - unsigned int knw = kw; - unsigned int kbw = neighborZ[kw]; - unsigned int kte = KQK; - unsigned int kbe = kb; - unsigned int ktw = kw; - unsigned int kbs = neighborZ[ks]; - unsigned int ktn = KQK; - unsigned int kbn = kb; - unsigned int kts = ks; - unsigned int ktse = ks; - unsigned int kbnw = kbw; - unsigned int ktnw = kw; - unsigned int kbse = kbs; - unsigned int ktsw = ksw; - unsigned int kbne = kb; - unsigned int ktne = KQK; - unsigned int kbsw = neighborZ[ksw]; + //unsigned int ksw = neighborY[kw]; + //unsigned int kne = KQK; + //unsigned int kse = ks; + //unsigned int knw = kw; + //unsigned int kbw = neighborZ[kw]; + //unsigned int kte = KQK; + //unsigned int kbe = kb; + //unsigned int ktw = kw; + //unsigned int kbs = neighborZ[ks]; + //unsigned int ktn = KQK; + //unsigned int kbn = kb; + //unsigned int kts = ks; + //unsigned int ktse = ks; + //unsigned int kbnw = kbw; + //unsigned int ktnw = kw; + //unsigned int kbse = kbs; + //unsigned int ktsw = ksw; + //unsigned int kbne = kb; + //unsigned int ktne = KQK; + //unsigned int kbsw = neighborZ[ksw]; //////////////////////////////////////////////////////////////////////////////// - real f_W = (D.f[dirE ])[ke ]; - real f_E = (D.f[dirW ])[kw ]; - real f_S = (D.f[dirN ])[kn ]; - real f_N = (D.f[dirS ])[ks ]; - real f_B = (D.f[dirT ])[kt ]; - real f_T = (D.f[dirB ])[kb ]; - real f_SW = (D.f[dirNE ])[kne ]; - real f_NE = (D.f[dirSW ])[ksw ]; - real f_NW = (D.f[dirSE ])[kse ]; - real f_SE = (D.f[dirNW ])[knw ]; - real f_BW = (D.f[dirTE ])[kte ]; - real f_TE = (D.f[dirBW ])[kbw ]; - real f_TW = (D.f[dirBE ])[kbe ]; - real f_BE = (D.f[dirTW ])[ktw ]; - real f_BS = (D.f[dirTN ])[ktn ]; - real f_TN = (D.f[dirBS ])[kbs ]; - real f_TS = (D.f[dirBN ])[kbn ]; - real f_BN = (D.f[dirTS ])[kts ]; - real f_BSW = (D.f[dirTNE ])[ktne ]; - real f_BNE = (D.f[dirTSW ])[ktsw ]; - real f_BNW = (D.f[dirTSE ])[ktse ]; - real f_BSE = (D.f[dirTNW ])[ktnw ]; - real f_TSW = (D.f[dirBNE ])[kbne ]; - real f_TNE = (D.f[dirBSW ])[kbsw ]; - real f_TNW = (D.f[dirBSE ])[kbse ]; - real f_TSE = (D.f[dirBNW ])[kbnw ]; + //real f_W = (D.f[dirE ])[ke ]; + //real f_E = (D.f[dirW ])[kw ]; + //real f_S = (D.f[dirN ])[kn ]; + //real f_N = (D.f[dirS ])[ks ]; + //real f_B = (D.f[dirT ])[kt ]; + //real f_T = (D.f[dirB ])[kb ]; + //real f_SW = (D.f[dirNE ])[kne ]; + //real f_NE = (D.f[dirSW ])[ksw ]; + //real f_NW = (D.f[dirSE ])[kse ]; + //real f_SE = (D.f[dirNW ])[knw ]; + //real f_BW = (D.f[dirTE ])[kte ]; + //real f_TE = (D.f[dirBW ])[kbw ]; + //real f_TW = (D.f[dirBE ])[kbe ]; + //real f_BE = (D.f[dirTW ])[ktw ]; + //real f_BS = (D.f[dirTN ])[ktn ]; + //real f_TN = (D.f[dirBS ])[kbs ]; + //real f_TS = (D.f[dirBN ])[kbn ]; + //real f_BN = (D.f[dirTS ])[kts ]; + //real f_BSW = (D.f[dirTNE ])[ktne ]; + //real f_BNE = (D.f[dirTSW ])[ktsw ]; + //real f_BNW = (D.f[dirTSE ])[ktse ]; + //real f_BSE = (D.f[dirTNW ])[ktnw ]; + //real f_TSW = (D.f[dirBNE ])[kbne ]; + //real f_TNE = (D.f[dirBSW ])[kbsw ]; + //real f_TNW = (D.f[dirBSE ])[kbse ]; + //real f_TSE = (D.f[dirBNW ])[kbnw ]; //////////////////////////////////////////////////////////////////////////////// - real vx1 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)+(f_BSE-f_TNW) +(f_NE-f_SW)+(f_SE-f_NW)+(f_TE-f_BW)+(f_BE-f_TW)+(f_E-f_W)); - real vx2 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); - real vx3 = ((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); - ////dörrrrrty !!!!!!!!!!!!! + //real vx1 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)+(f_BSE-f_TNW) +(f_NE-f_SW)+(f_SE-f_NW)+(f_TE-f_BW)+(f_BE-f_TW)+(f_E-f_W)); + //real vx2 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); + //real vx3 = ((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); + ////d�rrrrrty !!!!!!!!!!!!! // real vx1 = ten * ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)+(f_BSE-f_TNW) +(f_NE-f_SW)+(f_SE-f_NW)+(f_TE-f_BW)+(f_BE-f_TW)+(f_E-f_W)); // real vx2 = ten * ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); // real vx3 = ten * ((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); //real cu_sq =c3o2*(vx1*vx1+vx2*vx2+vx3*vx3); - real ux_sq = vx1 * vx1; - real uy_sq = vx2 * vx2; - real uz_sq = vx3 * vx3; + //real ux_sq = vx1 * vx1; + //real uy_sq = vx2 * vx2; + //real uz_sq = vx3 * vx3; //////////////////////////////////////////////////////////////////////////////// //BGK //real omegaD = three - sqrt(three); @@ -4133,13 +4134,13 @@ extern "C" __global__ void QNoSlipADincomp7( int inx, //real nue_d = Lam/three; //real ae = diffusivity/nue_d - one; //zero; - real f7_ZERO,f7_E,f7_W,f7_N,f7_S,f7_T,f7_B; - real /*feq7_ZERO,*/feq7_E,feq7_W,feq7_N,feq7_S,feq7_T,feq7_B; - real /*feqW7_ZERO,*/feqW7_E,feqW7_W,feqW7_N,feqW7_S,feqW7_T,feqW7_B; + real f7_E,f7_W,f7_N,f7_S,f7_T,f7_B; + //real /*feq7_ZERO,*/feq7_E,feq7_W,feq7_N,feq7_S,feq7_T,feq7_B; + //real /*feqW7_ZERO,*/feqW7_E,feqW7_W,feqW7_N,feqW7_S,feqW7_T,feqW7_B; real TempD = temp[k]; - f7_ZERO = (D7.f[0])[kzero]; + //f7_ZERO = (D7.f[0])[kzero]; f7_W = (D7.f[1])[ke ]; f7_E = (D7.f[2])[kw ]; f7_S = (D7.f[3])[kn ]; @@ -4147,7 +4148,7 @@ extern "C" __global__ void QNoSlipADincomp7( int inx, f7_B = (D7.f[5])[kt ]; f7_T = (D7.f[6])[kb ]; - real ConcD = f7_ZERO + f7_E + f7_W + f7_N + f7_S + f7_T + f7_B; + //real ConcD = f7_ZERO + f7_E + f7_W + f7_N + f7_S + f7_T + f7_B; ////feq7_ZERO = ConcD*(c1o3*(ae*(-three))-(ux_sq+uy_sq+uz_sq)); //feq7_E = ConcD*(c1o6*(ae+one)+c1o2*(ux_sq)+vx1*c1o2); @@ -4592,7 +4593,7 @@ extern "C" __global__ void QNoSlipADincomp27(int inx, real f_TN = (D.f[dirBS ])[kbs ]; real f_TS = (D.f[dirBN ])[kbn ]; real f_BN = (D.f[dirTS ])[kts ]; - real f_ZERO = (D.f[dirZERO])[kzero]; + //real f_ZERO = (D.f[dirZERO])[kzero]; real f_BSW = (D.f[dirTNE ])[ktne ]; real f_BNE = (D.f[dirTSW ])[ktsw ]; real f_BNW = (D.f[dirTSE ])[ktse ]; @@ -4859,67 +4860,67 @@ extern "C" __global__ void QADVeloIncomp7( int inx, unsigned int size_Mat, bool evenOrOdd) { - Distributions27 D; - if (evenOrOdd==true) - { - D.f[dirE ] = &DD[dirE *size_Mat]; - D.f[dirW ] = &DD[dirW *size_Mat]; - D.f[dirN ] = &DD[dirN *size_Mat]; - D.f[dirS ] = &DD[dirS *size_Mat]; - D.f[dirT ] = &DD[dirT *size_Mat]; - D.f[dirB ] = &DD[dirB *size_Mat]; - D.f[dirNE ] = &DD[dirNE *size_Mat]; - D.f[dirSW ] = &DD[dirSW *size_Mat]; - D.f[dirSE ] = &DD[dirSE *size_Mat]; - D.f[dirNW ] = &DD[dirNW *size_Mat]; - D.f[dirTE ] = &DD[dirTE *size_Mat]; - D.f[dirBW ] = &DD[dirBW *size_Mat]; - D.f[dirBE ] = &DD[dirBE *size_Mat]; - D.f[dirTW ] = &DD[dirTW *size_Mat]; - D.f[dirTN ] = &DD[dirTN *size_Mat]; - D.f[dirBS ] = &DD[dirBS *size_Mat]; - D.f[dirBN ] = &DD[dirBN *size_Mat]; - D.f[dirTS ] = &DD[dirTS *size_Mat]; - D.f[dirZERO] = &DD[dirZERO*size_Mat]; - D.f[dirTNE ] = &DD[dirTNE *size_Mat]; - D.f[dirTSW ] = &DD[dirTSW *size_Mat]; - D.f[dirTSE ] = &DD[dirTSE *size_Mat]; - D.f[dirTNW ] = &DD[dirTNW *size_Mat]; - D.f[dirBNE ] = &DD[dirBNE *size_Mat]; - D.f[dirBSW ] = &DD[dirBSW *size_Mat]; - D.f[dirBSE ] = &DD[dirBSE *size_Mat]; - D.f[dirBNW ] = &DD[dirBNW *size_Mat]; - } - else - { - D.f[dirW ] = &DD[dirE *size_Mat]; - D.f[dirE ] = &DD[dirW *size_Mat]; - D.f[dirS ] = &DD[dirN *size_Mat]; - D.f[dirN ] = &DD[dirS *size_Mat]; - D.f[dirB ] = &DD[dirT *size_Mat]; - D.f[dirT ] = &DD[dirB *size_Mat]; - D.f[dirSW ] = &DD[dirNE *size_Mat]; - D.f[dirNE ] = &DD[dirSW *size_Mat]; - D.f[dirNW ] = &DD[dirSE *size_Mat]; - D.f[dirSE ] = &DD[dirNW *size_Mat]; - D.f[dirBW ] = &DD[dirTE *size_Mat]; - D.f[dirTE ] = &DD[dirBW *size_Mat]; - D.f[dirTW ] = &DD[dirBE *size_Mat]; - D.f[dirBE ] = &DD[dirTW *size_Mat]; - D.f[dirBS ] = &DD[dirTN *size_Mat]; - D.f[dirTN ] = &DD[dirBS *size_Mat]; - D.f[dirTS ] = &DD[dirBN *size_Mat]; - D.f[dirBN ] = &DD[dirTS *size_Mat]; - D.f[dirZERO] = &DD[dirZERO*size_Mat]; - D.f[dirTNE ] = &DD[dirBSW *size_Mat]; - D.f[dirTSW ] = &DD[dirBNE *size_Mat]; - D.f[dirTSE ] = &DD[dirBNW *size_Mat]; - D.f[dirTNW ] = &DD[dirBSE *size_Mat]; - D.f[dirBNE ] = &DD[dirTSW *size_Mat]; - D.f[dirBSW ] = &DD[dirTNE *size_Mat]; - D.f[dirBSE ] = &DD[dirTNW *size_Mat]; - D.f[dirBNW ] = &DD[dirTSE *size_Mat]; - } + //Distributions27 D; + //if (evenOrOdd==true) + //{ + // D.f[dirE ] = &DD[dirE *size_Mat]; + // D.f[dirW ] = &DD[dirW *size_Mat]; + // D.f[dirN ] = &DD[dirN *size_Mat]; + // D.f[dirS ] = &DD[dirS *size_Mat]; + // D.f[dirT ] = &DD[dirT *size_Mat]; + // D.f[dirB ] = &DD[dirB *size_Mat]; + // D.f[dirNE ] = &DD[dirNE *size_Mat]; + // D.f[dirSW ] = &DD[dirSW *size_Mat]; + // D.f[dirSE ] = &DD[dirSE *size_Mat]; + // D.f[dirNW ] = &DD[dirNW *size_Mat]; + // D.f[dirTE ] = &DD[dirTE *size_Mat]; + // D.f[dirBW ] = &DD[dirBW *size_Mat]; + // D.f[dirBE ] = &DD[dirBE *size_Mat]; + // D.f[dirTW ] = &DD[dirTW *size_Mat]; + // D.f[dirTN ] = &DD[dirTN *size_Mat]; + // D.f[dirBS ] = &DD[dirBS *size_Mat]; + // D.f[dirBN ] = &DD[dirBN *size_Mat]; + // D.f[dirTS ] = &DD[dirTS *size_Mat]; + // D.f[dirZERO] = &DD[dirZERO*size_Mat]; + // D.f[dirTNE ] = &DD[dirTNE *size_Mat]; + // D.f[dirTSW ] = &DD[dirTSW *size_Mat]; + // D.f[dirTSE ] = &DD[dirTSE *size_Mat]; + // D.f[dirTNW ] = &DD[dirTNW *size_Mat]; + // D.f[dirBNE ] = &DD[dirBNE *size_Mat]; + // D.f[dirBSW ] = &DD[dirBSW *size_Mat]; + // D.f[dirBSE ] = &DD[dirBSE *size_Mat]; + // D.f[dirBNW ] = &DD[dirBNW *size_Mat]; + //} + //else + //{ + // D.f[dirW ] = &DD[dirE *size_Mat]; + // D.f[dirE ] = &DD[dirW *size_Mat]; + // D.f[dirS ] = &DD[dirN *size_Mat]; + // D.f[dirN ] = &DD[dirS *size_Mat]; + // D.f[dirB ] = &DD[dirT *size_Mat]; + // D.f[dirT ] = &DD[dirB *size_Mat]; + // D.f[dirSW ] = &DD[dirNE *size_Mat]; + // D.f[dirNE ] = &DD[dirSW *size_Mat]; + // D.f[dirNW ] = &DD[dirSE *size_Mat]; + // D.f[dirSE ] = &DD[dirNW *size_Mat]; + // D.f[dirBW ] = &DD[dirTE *size_Mat]; + // D.f[dirTE ] = &DD[dirBW *size_Mat]; + // D.f[dirTW ] = &DD[dirBE *size_Mat]; + // D.f[dirBE ] = &DD[dirTW *size_Mat]; + // D.f[dirBS ] = &DD[dirTN *size_Mat]; + // D.f[dirTN ] = &DD[dirBS *size_Mat]; + // D.f[dirTS ] = &DD[dirBN *size_Mat]; + // D.f[dirBN ] = &DD[dirTS *size_Mat]; + // D.f[dirZERO] = &DD[dirZERO*size_Mat]; + // D.f[dirTNE ] = &DD[dirBSW *size_Mat]; + // D.f[dirTSW ] = &DD[dirBNE *size_Mat]; + // D.f[dirTSE ] = &DD[dirBNW *size_Mat]; + // D.f[dirTNW ] = &DD[dirBSE *size_Mat]; + // D.f[dirBNE ] = &DD[dirTSW *size_Mat]; + // D.f[dirBSW ] = &DD[dirTNE *size_Mat]; + // D.f[dirBSE ] = &DD[dirTNW *size_Mat]; + // D.f[dirBNW ] = &DD[dirTSE *size_Mat]; + //} Distributions7 D7; if (evenOrOdd==true) @@ -4969,87 +4970,87 @@ extern "C" __global__ void QADVeloIncomp7( int inx, ////////////////////////////////////////////////////////////////////////////////// //index unsigned int KQK = k_Q[k]; - unsigned int kzero= KQK; + //unsigned int kzero= KQK; unsigned int ke = KQK; unsigned int kw = neighborX[KQK]; unsigned int kn = KQK; unsigned int ks = neighborY[KQK]; unsigned int kt = KQK; unsigned int kb = neighborZ[KQK]; - unsigned int ksw = neighborY[kw]; - unsigned int kne = KQK; - unsigned int kse = ks; - unsigned int knw = kw; - unsigned int kbw = neighborZ[kw]; - unsigned int kte = KQK; - unsigned int kbe = kb; - unsigned int ktw = kw; - unsigned int kbs = neighborZ[ks]; - unsigned int ktn = KQK; - unsigned int kbn = kb; - unsigned int kts = ks; - unsigned int ktse = ks; - unsigned int kbnw = kbw; - unsigned int ktnw = kw; - unsigned int kbse = kbs; - unsigned int ktsw = ksw; - unsigned int kbne = kb; - unsigned int ktne = KQK; - unsigned int kbsw = neighborZ[ksw]; + //unsigned int ksw = neighborY[kw]; + //unsigned int kne = KQK; + //unsigned int kse = ks; + //unsigned int knw = kw; + //unsigned int kbw = neighborZ[kw]; + //unsigned int kte = KQK; + //unsigned int kbe = kb; + //unsigned int ktw = kw; + //unsigned int kbs = neighborZ[ks]; + //unsigned int ktn = KQK; + //unsigned int kbn = kb; + //unsigned int kts = ks; + //unsigned int ktse = ks; + //unsigned int kbnw = kbw; + //unsigned int ktnw = kw; + //unsigned int kbse = kbs; + //unsigned int ktsw = ksw; + //unsigned int kbne = kb; + //unsigned int ktne = KQK; + //unsigned int kbsw = neighborZ[ksw]; //////////////////////////////////////////////////////////////////////////////// - real f_W = (D.f[dirE ])[ke ]; - real f_E = (D.f[dirW ])[kw ]; - real f_S = (D.f[dirN ])[kn ]; - real f_N = (D.f[dirS ])[ks ]; - real f_B = (D.f[dirT ])[kt ]; - real f_T = (D.f[dirB ])[kb ]; - real f_SW = (D.f[dirNE ])[kne ]; - real f_NE = (D.f[dirSW ])[ksw ]; - real f_NW = (D.f[dirSE ])[kse ]; - real f_SE = (D.f[dirNW ])[knw ]; - real f_BW = (D.f[dirTE ])[kte ]; - real f_TE = (D.f[dirBW ])[kbw ]; - real f_TW = (D.f[dirBE ])[kbe ]; - real f_BE = (D.f[dirTW ])[ktw ]; - real f_BS = (D.f[dirTN ])[ktn ]; - real f_TN = (D.f[dirBS ])[kbs ]; - real f_TS = (D.f[dirBN ])[kbn ]; - real f_BN = (D.f[dirTS ])[kts ]; - real f_BSW = (D.f[dirTNE ])[ktne ]; - real f_BNE = (D.f[dirTSW ])[ktsw ]; - real f_BNW = (D.f[dirTSE ])[ktse ]; - real f_BSE = (D.f[dirTNW ])[ktnw ]; - real f_TSW = (D.f[dirBNE ])[kbne ]; - real f_TNE = (D.f[dirBSW ])[kbsw ]; - real f_TNW = (D.f[dirBSE ])[kbse ]; - real f_TSE = (D.f[dirBNW ])[kbnw ]; + //real f_W = (D.f[dirE ])[ke ]; + //real f_E = (D.f[dirW ])[kw ]; + //real f_S = (D.f[dirN ])[kn ]; + //real f_N = (D.f[dirS ])[ks ]; + //real f_B = (D.f[dirT ])[kt ]; + //real f_T = (D.f[dirB ])[kb ]; + //real f_SW = (D.f[dirNE ])[kne ]; + //real f_NE = (D.f[dirSW ])[ksw ]; + //real f_NW = (D.f[dirSE ])[kse ]; + //real f_SE = (D.f[dirNW ])[knw ]; + //real f_BW = (D.f[dirTE ])[kte ]; + //real f_TE = (D.f[dirBW ])[kbw ]; + //real f_TW = (D.f[dirBE ])[kbe ]; + //real f_BE = (D.f[dirTW ])[ktw ]; + //real f_BS = (D.f[dirTN ])[ktn ]; + //real f_TN = (D.f[dirBS ])[kbs ]; + //real f_TS = (D.f[dirBN ])[kbn ]; + //real f_BN = (D.f[dirTS ])[kts ]; + //real f_BSW = (D.f[dirTNE ])[ktne ]; + //real f_BNE = (D.f[dirTSW ])[ktsw ]; + //real f_BNW = (D.f[dirTSE ])[ktse ]; + //real f_BSE = (D.f[dirTNW ])[ktnw ]; + //real f_TSW = (D.f[dirBNE ])[kbne ]; + //real f_TNE = (D.f[dirBSW ])[kbsw ]; + //real f_TNW = (D.f[dirBSE ])[kbse ]; + //real f_TSE = (D.f[dirBNW ])[kbnw ]; //////////////////////////////////////////////////////////////////////////////// - real vx1_Inflow = c0o1; - real vx2_Inflow = velo[k]; - real vx3_Inflow = c0o1; - real ux_sq_Inflow = vx1_Inflow * vx1_Inflow; - real uy_sq_Inflow = vx2_Inflow * vx2_Inflow; - real uz_sq_Inflow = vx3_Inflow * vx3_Inflow; + //real vx1_Inflow = c0o1; + //real vx2_Inflow = velo[k]; + //real vx3_Inflow = c0o1; + //real ux_sq_Inflow = vx1_Inflow * vx1_Inflow; + //real uy_sq_Inflow = vx2_Inflow * vx2_Inflow; + //real uz_sq_Inflow = vx3_Inflow * vx3_Inflow; //////////////////////////////////////////////////////////////////////////////// - real vx1 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)+(f_BSE-f_TNW) +(f_NE-f_SW)+(f_SE-f_NW)+(f_TE-f_BW)+(f_BE-f_TW)+(f_E-f_W)); - real vx2 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); - real vx3 = ((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); - ////dörrrrrty !!!!!!!!!!!!! + //real vx1 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)+(f_BSE-f_TNW) +(f_NE-f_SW)+(f_SE-f_NW)+(f_TE-f_BW)+(f_BE-f_TW)+(f_E-f_W)); + //real vx2 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); + //real vx3 = ((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); + ////d�rrrrrty !!!!!!!!!!!!! // real vx1 = ten * ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)+(f_BSE-f_TNW) +(f_NE-f_SW)+(f_SE-f_NW)+(f_TE-f_BW)+(f_BE-f_TW)+(f_E-f_W)); // real vx2 = ten * ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); // real vx3 = ten * ((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); //////////////////////////////////////////////////////////////////////////////// //real cu_sq =1.5f*(vx1*vx1+vx2*vx2+vx3*vx3); - real ux_sq = vx1 * vx1; - real uy_sq = vx2 * vx2; - real uz_sq = vx3 * vx3; + //real ux_sq = vx1 * vx1; + //real uy_sq = vx2 * vx2; + //real uz_sq = vx3 * vx3; - real f7_ZERO,f7_E,f7_W,f7_N,f7_S,f7_T,f7_B; - real /*feq7_ZERO,*/feq7_E,feq7_W,feq7_N,feq7_S,feq7_T,feq7_B; - real /*feqW7_ZERO,*/feqW7_E,feqW7_W,feqW7_N,feqW7_S,feqW7_T,feqW7_B; + real f7_E,f7_W,f7_N,f7_S,f7_T,f7_B; + //real /*feq7_ZERO,*/feq7_E,feq7_W,feq7_N,feq7_S,feq7_T,feq7_B; + //real /*feqW7_ZERO,*/feqW7_E,feqW7_W,feqW7_N,feqW7_S,feqW7_T,feqW7_B; real TempD = temp[k]; - f7_ZERO = (D7.f[0])[kzero]; + //f7_ZERO = (D7.f[0])[kzero]; f7_W = (D7.f[1])[ke ]; f7_E = (D7.f[2])[kw ]; f7_S = (D7.f[3])[kn ]; @@ -5057,7 +5058,7 @@ extern "C" __global__ void QADVeloIncomp7( int inx, f7_B = (D7.f[5])[kt ]; f7_T = (D7.f[6])[kb ]; - real ConcD = f7_ZERO + f7_E + f7_W + f7_N + f7_S + f7_T + f7_B; + //real ConcD = f7_ZERO + f7_E + f7_W + f7_N + f7_S + f7_T + f7_B; //////////////////////////////////////////////////////////////////////////////// //BGK @@ -5510,7 +5511,7 @@ extern "C" __global__ void QADVeloIncomp27( int inx, //////////////////////////////////////////////////////////////////////////////// //index unsigned int KQK = k_Q[k]; - unsigned int kzero= KQK; + //unsigned int kzero= KQK; unsigned int ke = KQK; unsigned int kw = neighborX[KQK]; unsigned int kn = KQK; @@ -5556,7 +5557,7 @@ extern "C" __global__ void QADVeloIncomp27( int inx, real f_TN = (D.f[dirBS ])[kbs ]; real f_TS = (D.f[dirBN ])[kbn ]; real f_BN = (D.f[dirTS ])[kts ]; - real f_ZERO = (D.f[dirZERO])[kzero]; + //real f_ZERO = (D.f[dirZERO])[kzero]; real f_BSW = (D.f[dirTNE ])[ktne ]; real f_BNE = (D.f[dirTSW ])[ktsw ]; real f_BNW = (D.f[dirTSE ])[ktse ]; @@ -5570,67 +5571,67 @@ extern "C" __global__ void QADVeloIncomp27( int inx, real vx2 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); real vx3 = ((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); //////////////////////////////////////////////////////////////////////////////// - real f27_W = (D27.f[dirE ])[ke ]; - real f27_E = (D27.f[dirW ])[kw ]; - real f27_S = (D27.f[dirN ])[kn ]; - real f27_N = (D27.f[dirS ])[ks ]; - real f27_B = (D27.f[dirT ])[kt ]; - real f27_T = (D27.f[dirB ])[kb ]; - real f27_SW = (D27.f[dirNE ])[kne ]; - real f27_NE = (D27.f[dirSW ])[ksw ]; - real f27_NW = (D27.f[dirSE ])[kse ]; - real f27_SE = (D27.f[dirNW ])[knw ]; - real f27_BW = (D27.f[dirTE ])[kte ]; - real f27_TE = (D27.f[dirBW ])[kbw ]; - real f27_TW = (D27.f[dirBE ])[kbe ]; - real f27_BE = (D27.f[dirTW ])[ktw ]; - real f27_BS = (D27.f[dirTN ])[ktn ]; - real f27_TN = (D27.f[dirBS ])[kbs ]; - real f27_TS = (D27.f[dirBN ])[kbn ]; - real f27_BN = (D27.f[dirTS ])[kts ]; - real f27_ZERO = (D27.f[dirZERO])[kzero]; - real f27_BSW = (D27.f[dirTNE ])[ktne ]; - real f27_BNE = (D27.f[dirTSW ])[ktsw ]; - real f27_BNW = (D27.f[dirTSE ])[ktse ]; - real f27_BSE = (D27.f[dirTNW ])[ktnw ]; - real f27_TSW = (D27.f[dirBNE ])[kbne ]; - real f27_TNE = (D27.f[dirBSW ])[kbsw ]; - real f27_TNW = (D27.f[dirBSE ])[kbse ]; - real f27_TSE = (D27.f[dirBNW ])[kbnw ]; + //real f27_W = (D27.f[dirE ])[ke ]; + //real f27_E = (D27.f[dirW ])[kw ]; + //real f27_S = (D27.f[dirN ])[kn ]; + //real f27_N = (D27.f[dirS ])[ks ]; + //real f27_B = (D27.f[dirT ])[kt ]; + //real f27_T = (D27.f[dirB ])[kb ]; + //real f27_SW = (D27.f[dirNE ])[kne ]; + //real f27_NE = (D27.f[dirSW ])[ksw ]; + //real f27_NW = (D27.f[dirSE ])[kse ]; + //real f27_SE = (D27.f[dirNW ])[knw ]; + //real f27_BW = (D27.f[dirTE ])[kte ]; + //real f27_TE = (D27.f[dirBW ])[kbw ]; + //real f27_TW = (D27.f[dirBE ])[kbe ]; + //real f27_BE = (D27.f[dirTW ])[ktw ]; + //real f27_BS = (D27.f[dirTN ])[ktn ]; + //real f27_TN = (D27.f[dirBS ])[kbs ]; + //real f27_TS = (D27.f[dirBN ])[kbn ]; + //real f27_BN = (D27.f[dirTS ])[kts ]; + //real f27_ZERO = (D27.f[dirZERO])[kzero]; + //real f27_BSW = (D27.f[dirTNE ])[ktne ]; + //real f27_BNE = (D27.f[dirTSW ])[ktsw ]; + //real f27_BNW = (D27.f[dirTSE ])[ktse ]; + //real f27_BSE = (D27.f[dirTNW ])[ktnw ]; + //real f27_TSW = (D27.f[dirBNE ])[kbne ]; + //real f27_TNE = (D27.f[dirBSW ])[kbsw ]; + //real f27_TNW = (D27.f[dirBSE ])[kbse ]; + //real f27_TSE = (D27.f[dirBNW ])[kbnw ]; //////////////////////////////////////////////////////////////////////////////// real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3); //////////////////////////////////////////////////////////////////////////////// - real ConcD = f27_TSE + f27_TNW + f27_TNE + f27_TSW + f27_BSE + f27_BNW + f27_BNE + f27_BSW + - f27_BN + f27_TS + f27_TN + f27_BS + f27_BE + f27_TW + f27_TE + f27_BW + f27_SE + f27_NW + f27_NE + f27_SW + - f27_T + f27_B + f27_N + f27_S + f27_E + f27_W + f27_ZERO; + //real ConcD = f27_TSE + f27_TNW + f27_TNE + f27_TSW + f27_BSE + f27_BNW + f27_BNE + f27_BSW + + // f27_BN + f27_TS + f27_TN + f27_BS + f27_BE + f27_TW + f27_TE + f27_BW + f27_SE + f27_NW + f27_NE + f27_SW + + // f27_T + f27_B + f27_N + f27_S + f27_E + f27_W + f27_ZERO; //real feq27_ZERO = c8over27* ConcD*(one-cu_sq); - real feq27_E = c2o27* ConcD*(c1o1+c3o1*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); - real feq27_W = c2o27* ConcD*(c1o1+c3o1*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); - real feq27_N = c2o27* ConcD*(c1o1+c3o1*( vx2 )+c9o2*( vx2 )*( vx2 )-cu_sq); - real feq27_S = c2o27* ConcD*(c1o1+c3o1*( -vx2 )+c9o2*( -vx2 )*( -vx2 )-cu_sq); - real feq27_T = c2o27* ConcD*(c1o1+c3o1*( vx3)+c9o2*( vx3)*( vx3)-cu_sq); - real feq27_B = c2o27* ConcD*(c1o1+c3o1*( -vx3)+c9o2*( -vx3)*( -vx3)-cu_sq); - real feq27_NE = c1o54* ConcD*(c1o1+c3o1*( vx1+vx2 )+c9o2*( vx1+vx2 )*( vx1+vx2 )-cu_sq); - real feq27_SW = c1o54* ConcD*(c1o1+c3o1*(-vx1-vx2 )+c9o2*(-vx1-vx2 )*(-vx1-vx2 )-cu_sq); - real feq27_SE = c1o54* ConcD*(c1o1+c3o1*( vx1-vx2 )+c9o2*( vx1-vx2 )*( vx1-vx2 )-cu_sq); - real feq27_NW = c1o54* ConcD*(c1o1+c3o1*(-vx1+vx2 )+c9o2*(-vx1+vx2 )*(-vx1+vx2 )-cu_sq); - real feq27_TE = c1o54* ConcD*(c1o1+c3o1*( vx1 +vx3)+c9o2*( vx1 +vx3)*( vx1 +vx3)-cu_sq); - real feq27_BW = c1o54* ConcD*(c1o1+c3o1*(-vx1 -vx3)+c9o2*(-vx1 -vx3)*(-vx1 -vx3)-cu_sq); - real feq27_BE = c1o54* ConcD*(c1o1+c3o1*( vx1 -vx3)+c9o2*( vx1 -vx3)*( vx1 -vx3)-cu_sq); - real feq27_TW = c1o54* ConcD*(c1o1+c3o1*(-vx1 +vx3)+c9o2*(-vx1 +vx3)*(-vx1 +vx3)-cu_sq); - real feq27_TN = c1o54* ConcD*(c1o1+c3o1*( vx2+vx3)+c9o2*( vx2+vx3)*( vx2+vx3)-cu_sq); - real feq27_BS = c1o54* ConcD*(c1o1+c3o1*( -vx2-vx3)+c9o2*( -vx2-vx3)*( -vx2-vx3)-cu_sq); - real feq27_BN = c1o54* ConcD*(c1o1+c3o1*( vx2-vx3)+c9o2*( vx2-vx3)*( vx2-vx3)-cu_sq); - real feq27_TS = c1o54* ConcD*(c1o1+c3o1*( -vx2+vx3)+c9o2*( -vx2+vx3)*( -vx2+vx3)-cu_sq); - real feq27_TNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2+vx3)+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); - real feq27_BSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); - real feq27_BNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2-vx3)+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); - real feq27_TSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); - real feq27_TSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); - real feq27_BNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); - real feq27_BSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); - real feq27_TNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); + //real feq27_E = c2o27* ConcD*(c1o1+c3o1*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); + //real feq27_W = c2o27* ConcD*(c1o1+c3o1*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); + //real feq27_N = c2o27* ConcD*(c1o1+c3o1*( vx2 )+c9o2*( vx2 )*( vx2 )-cu_sq); + //real feq27_S = c2o27* ConcD*(c1o1+c3o1*( -vx2 )+c9o2*( -vx2 )*( -vx2 )-cu_sq); + //real feq27_T = c2o27* ConcD*(c1o1+c3o1*( vx3)+c9o2*( vx3)*( vx3)-cu_sq); + //real feq27_B = c2o27* ConcD*(c1o1+c3o1*( -vx3)+c9o2*( -vx3)*( -vx3)-cu_sq); + //real feq27_NE = c1o54* ConcD*(c1o1+c3o1*( vx1+vx2 )+c9o2*( vx1+vx2 )*( vx1+vx2 )-cu_sq); + //real feq27_SW = c1o54* ConcD*(c1o1+c3o1*(-vx1-vx2 )+c9o2*(-vx1-vx2 )*(-vx1-vx2 )-cu_sq); + //real feq27_SE = c1o54* ConcD*(c1o1+c3o1*( vx1-vx2 )+c9o2*( vx1-vx2 )*( vx1-vx2 )-cu_sq); + //real feq27_NW = c1o54* ConcD*(c1o1+c3o1*(-vx1+vx2 )+c9o2*(-vx1+vx2 )*(-vx1+vx2 )-cu_sq); + //real feq27_TE = c1o54* ConcD*(c1o1+c3o1*( vx1 +vx3)+c9o2*( vx1 +vx3)*( vx1 +vx3)-cu_sq); + //real feq27_BW = c1o54* ConcD*(c1o1+c3o1*(-vx1 -vx3)+c9o2*(-vx1 -vx3)*(-vx1 -vx3)-cu_sq); + //real feq27_BE = c1o54* ConcD*(c1o1+c3o1*( vx1 -vx3)+c9o2*( vx1 -vx3)*( vx1 -vx3)-cu_sq); + //real feq27_TW = c1o54* ConcD*(c1o1+c3o1*(-vx1 +vx3)+c9o2*(-vx1 +vx3)*(-vx1 +vx3)-cu_sq); + //real feq27_TN = c1o54* ConcD*(c1o1+c3o1*( vx2+vx3)+c9o2*( vx2+vx3)*( vx2+vx3)-cu_sq); + //real feq27_BS = c1o54* ConcD*(c1o1+c3o1*( -vx2-vx3)+c9o2*( -vx2-vx3)*( -vx2-vx3)-cu_sq); + //real feq27_BN = c1o54* ConcD*(c1o1+c3o1*( vx2-vx3)+c9o2*( vx2-vx3)*( vx2-vx3)-cu_sq); + //real feq27_TS = c1o54* ConcD*(c1o1+c3o1*( -vx2+vx3)+c9o2*( -vx2+vx3)*( -vx2+vx3)-cu_sq); + //real feq27_TNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2+vx3)+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); + //real feq27_BSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); + //real feq27_BNE = c1o216*ConcD*(c1o1+c3o1*( vx1+vx2-vx3)+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); + //real feq27_TSW = c1o216*ConcD*(c1o1+c3o1*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); + //real feq27_TSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); + //real feq27_BNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); + //real feq27_BSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); + //real feq27_TNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real TempD = temp[k]; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -5854,7 +5855,7 @@ extern "C" __global__ void QADPressIncomp7(int inx, unsigned int size_Mat, bool evenOrOdd) { - Distributions27 D; + /* Distributions27 D; if (evenOrOdd==true) { D.f[dirE ] = &DD[dirE *size_Mat]; @@ -5914,7 +5915,7 @@ extern "C" __global__ void QADPressIncomp7(int inx, D.f[dirBSW ] = &DD[dirTNE *size_Mat]; D.f[dirBSE ] = &DD[dirTNW *size_Mat]; D.f[dirBNW ] = &DD[dirTSE *size_Mat]; - } + }*/ Distributions7 D7; if (evenOrOdd==true) @@ -5971,28 +5972,28 @@ extern "C" __global__ void QADPressIncomp7(int inx, unsigned int ks = neighborY[KQK]; unsigned int kt = KQK; unsigned int kb = neighborZ[KQK]; - unsigned int ksw = neighborY[kw]; - unsigned int kne = KQK; - unsigned int kse = ks; - unsigned int knw = kw; - unsigned int kbw = neighborZ[kw]; - unsigned int kte = KQK; - unsigned int kbe = kb; - unsigned int ktw = kw; - unsigned int kbs = neighborZ[ks]; - unsigned int ktn = KQK; - unsigned int kbn = kb; - unsigned int kts = ks; - unsigned int ktse = ks; - unsigned int kbnw = kbw; - unsigned int ktnw = kw; - unsigned int kbse = kbs; - unsigned int ktsw = ksw; - unsigned int kbne = kb; - unsigned int ktne = KQK; - unsigned int kbsw = neighborZ[ksw]; + //unsigned int ksw = neighborY[kw]; + //unsigned int kne = KQK; + //unsigned int kse = ks; + //unsigned int knw = kw; + //unsigned int kbw = neighborZ[kw]; + //unsigned int kte = KQK; + //unsigned int kbe = kb; + //unsigned int ktw = kw; + //unsigned int kbs = neighborZ[ks]; + //unsigned int ktn = KQK; + //unsigned int kbn = kb; + //unsigned int kts = ks; + //unsigned int ktse = ks; + //unsigned int kbnw = kbw; + //unsigned int ktnw = kw; + //unsigned int kbse = kbs; + //unsigned int ktsw = ksw; + //unsigned int kbne = kb; + //unsigned int ktne = KQK; + //unsigned int kbsw = neighborZ[ksw]; //////////////////////////////////////////////////////////////////////////////// - real f_E, f_W, f_N, f_S, f_T, f_B, f_NE, f_SW, f_SE, f_NW, f_TE, f_BW, f_BE, + /* real f_E, f_W, f_N, f_S, f_T, f_B, f_NE, f_SW, f_SE, f_NW, f_TE, f_BW, f_BE, f_TW, f_TN, f_BS, f_BN, f_TS, f_TNE, f_TSW, f_TSE, f_TNW, f_BNE, f_BSW, f_BSE, f_BNW; f_W = (D.f[dirE ])[ke ]; @@ -6020,20 +6021,20 @@ extern "C" __global__ void QADPressIncomp7(int inx, f_TSW = (D.f[dirBNE ])[kbne ]; f_TNE = (D.f[dirBSW ])[kbsw ]; f_TNW = (D.f[dirBSE ])[kbse ]; - f_TSE = (D.f[dirBNW ])[kbnw ]; + f_TSE = (D.f[dirBNW ])[kbnw ];*/ //////////////////////////////////////////////////////////////////////////////// - real vx1 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)+(f_BSE-f_TNW) +(f_NE-f_SW)+(f_SE-f_NW)+(f_TE-f_BW)+(f_BE-f_TW)+(f_E-f_W)); - real vx2 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); - real vx3 = ((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); - ////dörrrrrty !!!!!!!!!!!!! + //real vx1 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)+(f_BSE-f_TNW) +(f_NE-f_SW)+(f_SE-f_NW)+(f_TE-f_BW)+(f_BE-f_TW)+(f_E-f_W)); + //real vx2 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); + //real vx3 = ((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); + ////d�rrrrrty !!!!!!!!!!!!! // real vx1 = ten * ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)+(f_BSE-f_TNW) +(f_NE-f_SW)+(f_SE-f_NW)+(f_TE-f_BW)+(f_BE-f_TW)+(f_E-f_W)); // real vx2 = ten * ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); // real vx3 = ten * ((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); //real cu_sq =1.5*(vx1*vx1+vx2*vx2+vx3*vx3); - real ux_sq = vx1 * vx1; - real uy_sq = vx2 * vx2; - real uz_sq = vx3 * vx3; + //real ux_sq = vx1 * vx1; + //real uy_sq = vx2 * vx2; + //real uz_sq = vx3 * vx3; ////////////////////////////////////////////////////////////////////////// //BGK //real omegaD = three - sqrt(three); @@ -6043,8 +6044,8 @@ extern "C" __global__ void QADPressIncomp7(int inx, //real ae = diffusivity/nue_d - one; real f7_ZERO,f7_E,f7_W,f7_N,f7_S,f7_T,f7_B; - real /*feq7_ZERO,*/feq7_E,feq7_W,feq7_N,feq7_S,feq7_T,feq7_B; - real /*feqW7_ZERO,*/feqW7_E,feqW7_W,feqW7_N,feqW7_S,feqW7_T,feqW7_B; + //real /*feq7_ZERO,*/feq7_E,feq7_W,feq7_N,feq7_S,feq7_T,feq7_B; + //real /*feqW7_ZERO,*/feqW7_E,feqW7_W,feqW7_N,feqW7_S,feqW7_T,feqW7_B; //real TempD = temp[k]; @@ -6078,7 +6079,7 @@ extern "C" __global__ void QADPressIncomp7(int inx, //TRT Yoshida Kernel - based on Ying real cs2 = c1o4; real Lam = diffusivity/(c1o1)/cs2; - real omegaD = - c1o1 / (Lam + c1o2); + //real omegaD = - c1o1 / (Lam + c1o2); real nue_d = Lam/c3o1; ////////////////////////////////////////////////////////////////////////// @@ -6466,7 +6467,7 @@ extern "C" __global__ void QADPressIncomp27( int inx, //////////////////////////////////////////////////////////////////////////////// //index unsigned int KQK = k_Q[k]; - unsigned int kzero= KQK; + //unsigned int kzero= KQK; unsigned int ke = KQK; unsigned int kw = neighborX[KQK]; unsigned int kn = KQK; @@ -6512,7 +6513,7 @@ extern "C" __global__ void QADPressIncomp27( int inx, real f_TN = (D.f[dirBS ])[kbs ]; real f_TS = (D.f[dirBN ])[kbn ]; real f_BN = (D.f[dirTS ])[kts ]; - real f_ZERO = (D.f[dirZERO])[kzero]; + //real f_ZERO = (D.f[dirZERO])[kzero]; real f_BSW = (D.f[dirTNE ])[ktne ]; real f_BNE = (D.f[dirTSW ])[ktsw ]; real f_BNW = (D.f[dirTSE ])[ktse ]; @@ -6526,42 +6527,42 @@ extern "C" __global__ void QADPressIncomp27( int inx, real vx2 = ((f_TNE-f_BSW)+(f_BNE-f_TSW)+(f_BNW-f_TSE)+(f_TNW-f_BSE) +(f_NE-f_SW)+(f_NW-f_SE)+(f_TN-f_BS)+(f_BN-f_TS)+(f_N-f_S)); real vx3 = ((f_TNE-f_BSW)+(f_TSW-f_BNE)+(f_TSE-f_BNW)+(f_TNW-f_BSE) +(f_TE-f_BW)+(f_TW-f_BE)+(f_TN-f_BS)+(f_TS-f_BN)+(f_T-f_B)); //////////////////////////////////////////////////////////////////////////////// - real f27_W = (D27.f[dirE ])[ke ]; - real f27_E = (D27.f[dirW ])[kw ]; - real f27_S = (D27.f[dirN ])[kn ]; - real f27_N = (D27.f[dirS ])[ks ]; - real f27_B = (D27.f[dirT ])[kt ]; - real f27_T = (D27.f[dirB ])[kb ]; - real f27_SW = (D27.f[dirNE ])[kne ]; - real f27_NE = (D27.f[dirSW ])[ksw ]; - real f27_NW = (D27.f[dirSE ])[kse ]; - real f27_SE = (D27.f[dirNW ])[knw ]; - real f27_BW = (D27.f[dirTE ])[kte ]; - real f27_TE = (D27.f[dirBW ])[kbw ]; - real f27_TW = (D27.f[dirBE ])[kbe ]; - real f27_BE = (D27.f[dirTW ])[ktw ]; - real f27_BS = (D27.f[dirTN ])[ktn ]; - real f27_TN = (D27.f[dirBS ])[kbs ]; - real f27_TS = (D27.f[dirBN ])[kbn ]; - real f27_BN = (D27.f[dirTS ])[kts ]; - real f27_ZERO = (D27.f[dirZERO])[kzero]; - real f27_BSW = (D27.f[dirTNE ])[ktne ]; - real f27_BNE = (D27.f[dirTSW ])[ktsw ]; - real f27_BNW = (D27.f[dirTSE ])[ktse ]; - real f27_BSE = (D27.f[dirTNW ])[ktnw ]; - real f27_TSW = (D27.f[dirBNE ])[kbne ]; - real f27_TNE = (D27.f[dirBSW ])[kbsw ]; - real f27_TNW = (D27.f[dirBSE ])[kbse ]; - real f27_TSE = (D27.f[dirBNW ])[kbnw ]; + //real f27_W = (D27.f[dirE ])[ke ]; + //real f27_E = (D27.f[dirW ])[kw ]; + //real f27_S = (D27.f[dirN ])[kn ]; + //real f27_N = (D27.f[dirS ])[ks ]; + //real f27_B = (D27.f[dirT ])[kt ]; + //real f27_T = (D27.f[dirB ])[kb ]; + //real f27_SW = (D27.f[dirNE ])[kne ]; + //real f27_NE = (D27.f[dirSW ])[ksw ]; + //real f27_NW = (D27.f[dirSE ])[kse ]; + //real f27_SE = (D27.f[dirNW ])[knw ]; + //real f27_BW = (D27.f[dirTE ])[kte ]; + //real f27_TE = (D27.f[dirBW ])[kbw ]; + //real f27_TW = (D27.f[dirBE ])[kbe ]; + //real f27_BE = (D27.f[dirTW ])[ktw ]; + //real f27_BS = (D27.f[dirTN ])[ktn ]; + //real f27_TN = (D27.f[dirBS ])[kbs ]; + //real f27_TS = (D27.f[dirBN ])[kbn ]; + //real f27_BN = (D27.f[dirTS ])[kts ]; + //real f27_ZERO = (D27.f[dirZERO])[kzero]; + //real f27_BSW = (D27.f[dirTNE ])[ktne ]; + //real f27_BNE = (D27.f[dirTSW ])[ktsw ]; + //real f27_BNW = (D27.f[dirTSE ])[ktse ]; + //real f27_BSE = (D27.f[dirTNW ])[ktnw ]; + //real f27_TSW = (D27.f[dirBNE ])[kbne ]; + //real f27_TNE = (D27.f[dirBSW ])[kbsw ]; + //real f27_TNW = (D27.f[dirBSE ])[kbse ]; + //real f27_TSE = (D27.f[dirBNW ])[kbnw ]; //////////////////////////////////////////////////////////////////////////////// real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3); //////////////////////////////////////////////////////////////////////////////// - real ConcD = f27_TSE + f27_TNW + f27_TNE + f27_TSW + f27_BSE + f27_BNW + f27_BNE + f27_BSW + - f27_BN + f27_TS + f27_TN + f27_BS + f27_BE + f27_TW + f27_TE + f27_BW + f27_SE + f27_NW + f27_NE + f27_SW + - f27_T + f27_B + f27_N + f27_S + f27_E + f27_W + f27_ZERO; + //real ConcD = f27_TSE + f27_TNW + f27_TNE + f27_TSW + f27_BSE + f27_BNW + f27_BNE + f27_BSW + + //f27_BN + f27_TS + f27_TN + f27_BS + f27_BE + f27_TW + f27_TE + f27_BW + f27_SE + f27_NW + f27_NE + f27_SW + + //f27_T + f27_B + f27_N + f27_S + f27_E + f27_W + f27_ZERO; //real feq27_ZERO = c8over27* ConcD*(one-cu_sq); - real feq27_E = c2o27* ConcD*(c1o1+c3o1*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); + /*real feq27_E = c2o27* ConcD*(c1o1+c3o1*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); real feq27_W = c2o27* ConcD*(c1o1+c3o1*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); real feq27_N = c2o27* ConcD*(c1o1+c3o1*( vx2 )+c9o2*( vx2 )*( vx2 )-cu_sq); real feq27_S = c2o27* ConcD*(c1o1+c3o1*( -vx2 )+c9o2*( -vx2 )*( -vx2 )-cu_sq); @@ -6586,7 +6587,7 @@ extern "C" __global__ void QADPressIncomp27( int inx, real feq27_TSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); real feq27_BNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); real feq27_BSE = c1o216*ConcD*(c1o1+c3o1*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); - real feq27_TNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); + real feq27_TNW = c1o216*ConcD*(c1o1+c3o1*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq);*/ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real TempD = temp[k]; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/VirtualFluids_GPU/GPU/Calc2ndMoments27.cu b/src/gpu/VirtualFluids_GPU/GPU/Calc2ndMoments27.cu index 9484629bad04ad3af73056ccb9cc7a4f3fd16b04..2e0a0e4892f554ed9201483c3c7c73034795e6f2 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/Calc2ndMoments27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/Calc2ndMoments27.cu @@ -321,7 +321,8 @@ extern "C" __global__ void LBCalc2ndMomentsCompSP27(real* kxyFromfcNEQ, unsigned int ktne = k; unsigned int kbsw = neighborZ[ksw]; ////////////////////////////////////////////////////////////////////////// - real f_E,f_W,f_N,f_S,f_T,f_B,f_NE,f_SW,f_SE,f_NW,f_TE,f_BW,f_BE,f_TW,f_TN,f_BS,f_BN,f_TS,f_ZERO,f_TNE, f_TSW, f_TSE, f_TNW, f_BNE, f_BSW, f_BSE, f_BNW; + real f_ZERO; + real f_E,f_W,f_N,f_S,f_T,f_B,f_NE,f_SW,f_SE,f_NW,f_TE,f_BW,f_BE,f_TW,f_TN,f_BS,f_BN,f_TS,f_TNE, f_TSW, f_TSE, f_TNW, f_BNE, f_BSW, f_BSE, f_BNW; f_E = (D.f[dirE ])[ke ]; f_W = (D.f[dirW ])[kw ]; f_N = (D.f[dirN ])[kn ]; @@ -350,7 +351,8 @@ extern "C" __global__ void LBCalc2ndMomentsCompSP27(real* kxyFromfcNEQ, f_BSE = (D.f[dirBSE ])[kbse ]; f_BNW = (D.f[dirBNW ])[kbnw ]; ////////////////////////////////////////////////////////////////////////// - real vx1, vx2, vx3, drho, rho; + real drho; + real vx1, vx2, vx3, rho; kxyFromfcNEQ[k] = c0o1; kyzFromfcNEQ[k] = c0o1; kxzFromfcNEQ[k] = c0o1; @@ -359,10 +361,10 @@ extern "C" __global__ void LBCalc2ndMomentsCompSP27(real* kxyFromfcNEQ, if(geoD[k] == GEO_FLUID) { - drho = ((f_TNE+f_BSW)+(f_BSE+f_TNW)+(f_BNE+f_TSW)+(f_TSE+f_BNW)) + - ((f_NE+f_SW)+(f_TE+f_BW)+(f_SE+f_NW)+(f_BE+f_TW)+(f_BN+f_TS)+(f_TN+f_BS)) + - ((f_E-f_W) + (f_N-f_S) + (f_T-f_B)) + f_ZERO; - rho = rho + c1o1; + drho = ((f_TNE+f_BSW)+(f_BSE+f_TNW)+(f_BNE+f_TSW)+(f_TSE+f_BNW)) + + ((f_NE+f_SW)+(f_TE+f_BW)+(f_SE+f_NW)+(f_BE+f_TW)+(f_BN+f_TS)+(f_TN+f_BS)) + + ((f_E-f_W) + (f_N-f_S) + (f_T-f_B)) + f_ZERO; + rho = drho + c1o1; vx1 = ((f_TNE-f_BSW)+(f_BSE-f_TNW)+(f_BNE-f_TSW)+(f_TSE-f_BNW)) + (((f_NE-f_SW)+(f_TE-f_BW))+((f_SE-f_NW)+(f_BE-f_TW))) + (f_E-f_W) / rho; vx2 = ((f_TNE-f_BSW)+(f_TNW-f_BSE)+(f_BNE-f_TSW)+(f_BNW-f_TSE)) + (((f_NE-f_SW)+(f_TN-f_BS))+((f_BN-f_TS)+(f_NW-f_SE))) + (f_N-f_S) / rho; vx3 = ((f_TNE-f_BSW)+(f_TNW-f_BSE)+(f_TSW-f_BNE)+(f_TSE-f_BNW)) + (((f_TE-f_BW)+(f_TN-f_BS))+((f_TW-f_BE)+(f_TS-f_BN))) + (f_T-f_B) / rho; diff --git a/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu b/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu index b626a1b847d13f888562b69065b151818c2bb86e..69c0b88596f185812c5cb30fac47daca8d820ddf 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/CalcMac27.cu @@ -1494,7 +1494,7 @@ extern "C" __global__ void LBCalcMedCompSP27( real* vxD, { ////////////////////////////////////////////////////////////////////////// //index - unsigned int kzero= k; + //unsigned int kzero= k; unsigned int ke = k; unsigned int kw = neighborX[k]; unsigned int kn = k; @@ -1836,7 +1836,7 @@ extern "C" __global__ void LBCalcMedCompAD27( { ////////////////////////////////////////////////////////////////////////// //index - unsigned int kzero = k; + //unsigned int kzero = k; unsigned int ke = k; unsigned int kw = neighborX[k]; unsigned int kn = k; diff --git a/src/gpu/VirtualFluids_GPU/GPU/Cumulant27.cu b/src/gpu/VirtualFluids_GPU/GPU/Cumulant27.cu index bc86f1a90fb7a61c8679b261eae5176572d059c6..0da46c500c13a0ef8f3d48bf74a3eee272c530b6 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/Cumulant27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/Cumulant27.cu @@ -3531,8 +3531,8 @@ extern "C" __global__ void LB_Kernel_Kum_New_SP_27( real omega, vy2=vvy*vvy; vz2=vvz*vvz; //////////////////////////////////////////////////////////////////////////////////// - real wadjust; - real qudricLimit = 0.01f; + //real wadjust; + //real qudricLimit = 0.01f; //real s9 = minusomega; //test //s9 = 0.; @@ -4023,7 +4023,7 @@ extern "C" __global__ void LB_Kernel_Kum_New_SP_27( real omega, real mxxMzz = mfcaa - mfaac; ////////////////////////////////////////////////////////////////////////// - real magicBulk=(CUMacc+CUMcac+CUMcca)*(c1o1/OxxPyyPzz-c1o2)*c3o2*8.; + //real magicBulk=(CUMacc+CUMcac+CUMcca)*(c1o1/OxxPyyPzz-c1o2)*c3o2*8.; ////////////////////////////////////////////////////////////////////////// //limiter-Scheise Teil 1 @@ -5630,10 +5630,10 @@ extern "C" __global__ void LB_Kernel_Kum_New_Comp_SRT_SP_27( vy2 = vvy*vvy; vz2 = vvz*vvz; ////////////////////////////////////////////////////////////////////////////////////// - real wadjust; - real qudricLimitP = c1o100;// * 0.0001f; - real qudricLimitM = c1o100;// * 0.0001f; - real qudricLimitD = c1o100;// * 0.001f; + //real wadjust; + //real qudricLimitP = c1o100;// * 0.0001f; + //real qudricLimitM = c1o100;// * 0.0001f; + //real qudricLimitD = c1o100;// * 0.001f; //////////////////////////////////////////////////////////////////////////////////// //Hin //////////////////////////////////////////////////////////////////////////////////// @@ -5875,7 +5875,7 @@ extern "C" __global__ void LB_Kernel_Kum_New_Comp_SRT_SP_27( ////////////////////////////// real OxyyPxzz = omega; real OxyyMxzz = omega; - real Oxyz = omega; + //real Oxyz = omega; //////////////////////////////////////////////////////////// //4. ////////////////////////////// diff --git a/src/gpu/VirtualFluids_GPU/GPU/Cumulant27chim.cu b/src/gpu/VirtualFluids_GPU/GPU/Cumulant27chim.cu index 8bfdfb3b9421baa4290cd305542520b28aa5fd17..b6d77f648e81c73b6ee472b62e18f7b98c83676e 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/Cumulant27chim.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/Cumulant27chim.cu @@ -265,8 +265,8 @@ extern "C" __global__ void Cumulant_One_preconditioned_errorDiffusion_chim_Comp_ //real omega = omega_in; //////////////////////////////////////////////////////////////////////////////////// //fast - real oMdrho = c1o1; // comp special - real m0, m1, m2; + //real oMdrho = c1o1; // comp special + //real m0, m1, m2; real vx2; real vy2; real vz2; @@ -274,10 +274,10 @@ extern "C" __global__ void Cumulant_One_preconditioned_errorDiffusion_chim_Comp_ vy2 = vvy*vvy; vz2 = vvz*vvz; //////////////////////////////////////////////////////////////////////////////////// - real wadjust; - real qudricLimitP = c1o100;// * 0.0001f; - real qudricLimitM = c1o100;// * 0.0001f; - real qudricLimitD = c1o100;// * 0.001f; + //real wadjust; + //real qudricLimitP = c1o100;// * 0.0001f; + //real qudricLimitM = c1o100;// * 0.0001f; + //real qudricLimitD = c1o100;// * 0.001f; //real s9 = minusomega; //test //s9 = 0.; @@ -486,7 +486,7 @@ extern "C" __global__ void Cumulant_One_preconditioned_errorDiffusion_chim_Comp_ ////////////////////////////// real OxyyPxzz = c1o1; real OxyyMxzz = c1o1; - real Oxyz = c1o1; + //real Oxyz = c1o1; //////////////////////////////////////////////////////////// //4. ////////////////////////////// @@ -1180,8 +1180,8 @@ extern "C" __global__ void Cumulant_One_preconditioned_chim_Comp_SP_27( //real omega = omega_in; //////////////////////////////////////////////////////////////////////////////////// //fast - real oMdrho = c1o1; // comp special - real m0, m1, m2; + //real oMdrho = c1o1; // comp special + //real m0, m1, m2; real vx2; real vy2; real vz2; @@ -1189,10 +1189,10 @@ extern "C" __global__ void Cumulant_One_preconditioned_chim_Comp_SP_27( vy2 = vvy*vvy; vz2 = vvz*vvz; //////////////////////////////////////////////////////////////////////////////////// - real wadjust; - real qudricLimitP = c1o100;// * 0.0001f; - real qudricLimitM = c1o100;// * 0.0001f; - real qudricLimitD = c1o100;// * 0.001f; + //real wadjust; + //real qudricLimitP = c1o100;// * 0.0001f; + //real qudricLimitM = c1o100;// * 0.0001f; + //real qudricLimitD = c1o100;// * 0.001f; //real s9 = minusomega; //test //s9 = 0.; @@ -1401,7 +1401,7 @@ extern "C" __global__ void Cumulant_One_preconditioned_chim_Comp_SP_27( ////////////////////////////// real OxyyPxzz = c1o1; real OxyyMxzz = c1o1; - real Oxyz = c1o1; + //real Oxyz = c1o1; //////////////////////////////////////////////////////////// //4. ////////////////////////////// @@ -1953,8 +1953,8 @@ extern "C" __global__ void Cumulant_One_chim_Comp_SP_27( //real omega = omega_in; //////////////////////////////////////////////////////////////////////////////////// //fast - real oMdrho = c1o1; // comp special - real m0, m1, m2; + //real oMdrho = c1o1; // comp special + //real m0, m1, m2; real vx2; real vy2; real vz2; @@ -1962,10 +1962,10 @@ extern "C" __global__ void Cumulant_One_chim_Comp_SP_27( vy2 = vvy*vvy; vz2 = vvz*vvz; //////////////////////////////////////////////////////////////////////////////////// - real wadjust; - real qudricLimitP = c1o100;// * 0.0001f; - real qudricLimitM = c1o100;// * 0.0001f; - real qudricLimitD = c1o100;// * 0.001f; + //real wadjust; + //real qudricLimitP = c1o100;// * 0.0001f; + //real qudricLimitM = c1o100;// * 0.0001f; + //real qudricLimitD = c1o100;// * 0.001f; //////////////////////////////////////////////////////////////////////////////////// //Hin //////////////////////////////////////////////////////////////////////////////////// @@ -2019,7 +2019,7 @@ extern "C" __global__ void Cumulant_One_chim_Comp_SP_27( ////////////////////////////// real OxyyPxzz = c1o1; real OxyyMxzz = c1o1; - real Oxyz = c1o1; + //real Oxyz = c1o1; //////////////////////////////////////////////////////////// //4. ////////////////////////////// diff --git a/src/gpu/VirtualFluids_GPU/GPU/Cumulant_F3_27.cu b/src/gpu/VirtualFluids_GPU/GPU/Cumulant_F3_27.cu index 71d839609ec400fac4addb22224f18a69a5a9035..6b23233363be8f7b74f27ccafcfa9c7404713da2 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/Cumulant_F3_27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/Cumulant_F3_27.cu @@ -230,10 +230,10 @@ extern "C" __global__ void LB_PostProcessor_F3_2018_Fehlberg(real omega, vy2 = vvy*vvy; vz2 = vvz*vvz; //////////////////////////////////////////////////////////////////////////////////// - real wadjust; - real qudricLimitP = 0.01f;// * 0.0001f; - real qudricLimitM = 0.01f;// * 0.0001f; - real qudricLimitD = 0.01f;// * 0.001f; + //real wadjust; + //real qudricLimitP = 0.01f;// * 0.0001f; + //real qudricLimitM = 0.01f;// * 0.0001f; + //real qudricLimitD = 0.01f;// * 0.001f; //////////////////////////////////////////////////////////////////////////////////// //Hin //////////////////////////////////////////////////////////////////////////////////// @@ -472,55 +472,39 @@ extern "C" __global__ void LB_PostProcessor_F3_2018_Fehlberg(real omega, //////////////////////////////////////////////////////////// //3. ////////////////////////////// - real OxyyPxzz = c8o1*(-c2o1 + omega)*(c1o1 + c2o1*omega) / (-c8o1 - c14o1*omega + c7o1*omega*omega);//one; - real OxyyMxzz = c8o1*(-c2o1 + omega)*(-c7o1 + c4o1*omega) / (c56o1 - c50o1*omega + c9o1*omega*omega);//one; - real Oxyz = c24o1*(-c2o1 + omega)*(-c2o1 - c7o1*omega + c3o1*omega*omega) / (c48o1 + c152o1*omega - c130o1*omega*omega + c29o1*omega*omega*omega);//one; + //real OxyyPxzz = c8o1*(-c2o1 + omega)*(c1o1 + c2o1*omega) / (-c8o1 - c14o1*omega + c7o1*omega*omega);//one; + //real OxyyMxzz = c8o1*(-c2o1 + omega)*(-c7o1 + c4o1*omega) / (c56o1 - c50o1*omega + c9o1*omega*omega);//one; + //real Oxyz = c24o1*(-c2o1 + omega)*(-c2o1 - c7o1*omega + c3o1*omega*omega) / (c48o1 + c152o1*omega - c130o1*omega*omega + c29o1*omega*omega*omega);//one; //////////////////////////////////////////////////////////// - //4. - ////////////////////////////// - real O4 = c1o1; - ////////////////////////////// - //real O4 = omega;//TRT - //////////////////////////////////////////////////////////// - //5. - ////////////////////////////// - real O5 = c1o1; - //////////////////////////////////////////////////////////// - //6. - ////////////////////////////// - real O6 = c1o1; - //////////////////////////////////////////////////////////// - - //central moments to cumulants //4. - real CUMcbb = mfcbb - ((mfcaa + c1o3) * mfabb + c2o1 * mfbba * mfbab) / rho; - real CUMbcb = mfbcb - ((mfaca + c1o3) * mfbab + c2o1 * mfbba * mfabb) / rho; - real CUMbbc = mfbbc - ((mfaac + c1o3) * mfbba + c2o1 * mfbab * mfabb) / rho; + //real CUMcbb = mfcbb - ((mfcaa + c1o3) * mfabb + c2o1 * mfbba * mfbab) / rho; + //real CUMbcb = mfbcb - ((mfaca + c1o3) * mfbab + c2o1 * mfbba * mfabb) / rho; + //real CUMbbc = mfbbc - ((mfaac + c1o3) * mfbba + c2o1 * mfbab * mfabb) / rho; - real CUMcca = mfcca - (((mfcaa * mfaca + c2o1 * mfbba * mfbba) + c1o3 * (mfcaa + mfaca)) / rho - c1o9*(drho / rho)); - real CUMcac = mfcac - (((mfcaa * mfaac + c2o1 * mfbab * mfbab) + c1o3 * (mfcaa + mfaac)) / rho - c1o9*(drho / rho)); - real CUMacc = mfacc - (((mfaac * mfaca + c2o1 * mfabb * mfabb) + c1o3 * (mfaac + mfaca)) / rho - c1o9*(drho / rho)); + //real CUMcca = mfcca - (((mfcaa * mfaca + c2o1 * mfbba * mfbba) + c1o3 * (mfcaa + mfaca)) / rho - c1o9*(drho / rho)); + //real CUMcac = mfcac - (((mfcaa * mfaac + c2o1 * mfbab * mfbab) + c1o3 * (mfcaa + mfaac)) / rho - c1o9*(drho / rho)); + //real CUMacc = mfacc - (((mfaac * mfaca + c2o1 * mfabb * mfabb) + c1o3 * (mfaac + mfaca)) / rho - c1o9*(drho / rho)); //5. - real CUMbcc = mfbcc - ((mfaac * mfbca + mfaca * mfbac + c4o1 * mfabb * mfbbb + c2o1 * (mfbab * mfacb + mfbba * mfabc)) + c1o3 * (mfbca + mfbac)) / rho; - real CUMcbc = mfcbc - ((mfaac * mfcba + mfcaa * mfabc + c4o1 * mfbab * mfbbb + c2o1 * (mfabb * mfcab + mfbba * mfbac)) + c1o3 * (mfcba + mfabc)) / rho; - real CUMccb = mfccb - ((mfcaa * mfacb + mfaca * mfcab + c4o1 * mfbba * mfbbb + c2o1 * (mfbab * mfbca + mfabb * mfcba)) + c1o3 * (mfacb + mfcab)) / rho; + //real CUMbcc = mfbcc - ((mfaac * mfbca + mfaca * mfbac + c4o1 * mfabb * mfbbb + c2o1 * (mfbab * mfacb + mfbba * mfabc)) + c1o3 * (mfbca + mfbac)) / rho; + //real CUMcbc = mfcbc - ((mfaac * mfcba + mfcaa * mfabc + c4o1 * mfbab * mfbbb + c2o1 * (mfabb * mfcab + mfbba * mfbac)) + c1o3 * (mfcba + mfabc)) / rho; + //real CUMccb = mfccb - ((mfcaa * mfacb + mfaca * mfcab + c4o1 * mfbba * mfbbb + c2o1 * (mfbab * mfbca + mfabb * mfcba)) + c1o3 * (mfacb + mfcab)) / rho; //6. - real CUMccc = mfccc + ((-c4o1 * mfbbb * mfbbb - - (mfcaa * mfacc + mfaca * mfcac + mfaac * mfcca) - - c4o1 * (mfabb * mfcbb + mfbab * mfbcb + mfbba * mfbbc) - - c2o1 * (mfbca * mfbac + mfcba * mfabc + mfcab * mfacb)) / rho - + (c4o1 * (mfbab * mfbab * mfaca + mfabb * mfabb * mfcaa + mfbba * mfbba * mfaac) - + c2o1 * (mfcaa * mfaca * mfaac) - + c16o1 * mfbba * mfbab * mfabb) / (rho * rho) - - c1o3 * (mfacc + mfcac + mfcca) / rho - - c1o9 * (mfcaa + mfaca + mfaac) / rho - + (c2o1 * (mfbab * mfbab + mfabb * mfabb + mfbba * mfbba) - + (mfaac * mfaca + mfaac * mfcaa + mfaca * mfcaa) + c1o3 *(mfaac + mfaca + mfcaa)) / (rho * rho) * c2o3 - + c1o27*((drho * drho - drho) / (rho*rho))); + //real CUMccc = mfccc + ((-c4o1 * mfbbb * mfbbb + // - (mfcaa * mfacc + mfaca * mfcac + mfaac * mfcca) + // - c4o1 * (mfabb * mfcbb + mfbab * mfbcb + mfbba * mfbbc) + // - c2o1 * (mfbca * mfbac + mfcba * mfabc + mfcab * mfacb)) / rho + // + (c4o1 * (mfbab * mfbab * mfaca + mfabb * mfabb * mfcaa + mfbba * mfbba * mfaac) + // + c2o1 * (mfcaa * mfaca * mfaac) + // + c16o1 * mfbba * mfbab * mfabb) / (rho * rho) + // - c1o3 * (mfacc + mfcac + mfcca) / rho + // - c1o9 * (mfcaa + mfaca + mfaac) / rho + // + (c2o1 * (mfbab * mfbab + mfabb * mfabb + mfbba * mfbba) + // + (mfaac * mfaca + mfaac * mfcaa + mfaca * mfcaa) + c1o3 *(mfaac + mfaca + mfcaa)) / (rho * rho) * c2o3 + // + c1o27*((drho * drho - drho) / (rho*rho))); //2. // linear combinations @@ -529,9 +513,9 @@ extern "C" __global__ void LB_PostProcessor_F3_2018_Fehlberg(real omega, real mxxMzz = mfcaa - mfaac; //////////////////////////////////////////////////////////////////////////// - real Dxy = -c3o1*omega*mfbba; - real Dxz = -c3o1*omega*mfbab; - real Dyz = -c3o1*omega*mfabb; + //real Dxy = -c3o1*omega*mfbba; + //real Dxz = -c3o1*omega*mfbab; + //real Dyz = -c3o1*omega*mfabb; //3. // linear combinations @@ -2239,7 +2223,7 @@ extern "C" __global__ void LB_PostProcessor_F3_2018_Fehlberg(real omega, // // mfbbc-mfbba; // //////////////////////////////////////////////////////////////////////////////////// // // oMdrho assembler style -------> faaaaaastaaaa -// // or much sloooowaaaa ... it depändssssss on sadaku +// // or much sloooowaaaa ... it dep�ndssssss on sadaku // real m0, m1, m2; // //real oMdrho; // //{ diff --git a/src/gpu/VirtualFluids_GPU/GPU/EnstrophyAnalyzer.cu b/src/gpu/VirtualFluids_GPU/GPU/EnstrophyAnalyzer.cu index 9724f9b1859f57151b5d831859117c99f3f7f658..5380ce071a1f1e101d9ae97aeca3373de73cb3de 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/EnstrophyAnalyzer.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/EnstrophyAnalyzer.cu @@ -88,6 +88,9 @@ bool EnstrophyAnalyzer::run(uint iter) //std::cout << "Enstrophy " << EnstrophyTmp << " " << numberOfFluidNodes << std::endl; this->enstrophyTimeSeries.push_back( EnstrophyTmp / real(numberOfFluidNodes) ); + + //TODO: Should this function probably return nothing? + return true; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -165,8 +168,8 @@ __host__ __device__ void enstrophyFunction(real* veloX, real* veloY, real* veloZ uint kMz4 = neighborY[neighborX[kMz3WSB]]; if( geo[ kMz4 ] != GEO_FLUID && maxOrderZ > 6 ) maxOrderZ = 6; ////////////////////////////////////////////////////////////////////////// //getVeloX// - real veloXNeighborPx = veloX[kPx]; - real veloXNeighborMx = veloX[kMx]; + //real veloXNeighborPx = veloX[kPx]; + //real veloXNeighborMx = veloX[kMx]; real veloXNeighborPy = veloX[kPy]; real veloXNeighborMy = veloX[kMy]; real veloXNeighborPz = veloX[kPz]; @@ -174,8 +177,8 @@ __host__ __device__ void enstrophyFunction(real* veloX, real* veloY, real* veloZ //getVeloY// real veloYNeighborPx = veloY[kPx]; real veloYNeighborMx = veloY[kMx]; - real veloYNeighborPy = veloY[kPy]; - real veloYNeighborMy = veloY[kMy]; + //real veloYNeighborPy = veloY[kPy]; + //real veloYNeighborMy = veloY[kMy]; real veloYNeighborPz = veloY[kPz]; real veloYNeighborMz = veloY[kMz]; //getVeloZ// @@ -183,12 +186,12 @@ __host__ __device__ void enstrophyFunction(real* veloX, real* veloY, real* veloZ real veloZNeighborMx = veloZ[kMx]; real veloZNeighborPy = veloZ[kPy]; real veloZNeighborMy = veloZ[kMy]; - real veloZNeighborPz = veloZ[kPz]; - real veloZNeighborMz = veloZ[kMz]; + //real veloZNeighborPz = veloZ[kPz]; + //real veloZNeighborMz = veloZ[kMz]; ////////////////////////////////////////////////////////////////////////////// //getVeloX// - real veloXNeighborPx2 = veloX[kPx2]; - real veloXNeighborMx2 = veloX[kMx2]; + //real veloXNeighborPx2 = veloX[kPx2]; + //real veloXNeighborMx2 = veloX[kMx2]; real veloXNeighborPy2 = veloX[kPy2]; real veloXNeighborMy2 = veloX[kMy2]; real veloXNeighborPz2 = veloX[kPz2]; @@ -196,8 +199,8 @@ __host__ __device__ void enstrophyFunction(real* veloX, real* veloY, real* veloZ //getVeloY// real veloYNeighborPx2 = veloY[kPx2]; real veloYNeighborMx2 = veloY[kMx2]; - real veloYNeighborPy2 = veloY[kPy2]; - real veloYNeighborMy2 = veloY[kMy2]; + //real veloYNeighborPy2 = veloY[kPy2]; + //real veloYNeighborMy2 = veloY[kMy2]; real veloYNeighborPz2 = veloY[kPz2]; real veloYNeighborMz2 = veloY[kMz2]; //getVeloZ// @@ -205,12 +208,12 @@ __host__ __device__ void enstrophyFunction(real* veloX, real* veloY, real* veloZ real veloZNeighborMx2 = veloZ[kMx2]; real veloZNeighborPy2 = veloZ[kPy2]; real veloZNeighborMy2 = veloZ[kMy2]; - real veloZNeighborPz2 = veloZ[kPz2]; - real veloZNeighborMz2 = veloZ[kMz2]; + //real veloZNeighborPz2 = veloZ[kPz2]; + //real veloZNeighborMz2 = veloZ[kMz2]; ////////////////////////////////////////////////////////////////////////////// //getVeloX// - real veloXNeighborPx3 = veloX[kPx3]; - real veloXNeighborMx3 = veloX[kMx3]; + //real veloXNeighborPx3 = veloX[kPx3]; + //real veloXNeighborMx3 = veloX[kMx3]; real veloXNeighborPy3 = veloX[kPy3]; real veloXNeighborMy3 = veloX[kMy3]; real veloXNeighborPz3 = veloX[kPz3]; @@ -218,8 +221,8 @@ __host__ __device__ void enstrophyFunction(real* veloX, real* veloY, real* veloZ //getVeloY// real veloYNeighborPx3 = veloY[kPx3]; real veloYNeighborMx3 = veloY[kMx3]; - real veloYNeighborPy3 = veloY[kPy3]; - real veloYNeighborMy3 = veloY[kMy3]; + //real veloYNeighborPy3 = veloY[kPy3]; + //real veloYNeighborMy3 = veloY[kMy3]; real veloYNeighborPz3 = veloY[kPz3]; real veloYNeighborMz3 = veloY[kMz3]; //getVeloZ// @@ -227,12 +230,12 @@ __host__ __device__ void enstrophyFunction(real* veloX, real* veloY, real* veloZ real veloZNeighborMx3 = veloZ[kMx3]; real veloZNeighborPy3 = veloZ[kPy3]; real veloZNeighborMy3 = veloZ[kMy3]; - real veloZNeighborPz3 = veloZ[kPz3]; - real veloZNeighborMz3 = veloZ[kMz3]; + //real veloZNeighborPz3 = veloZ[kPz3]; + //real veloZNeighborMz3 = veloZ[kMz3]; ////////////////////////////////////////////////////////////////////////////// //getVeloX// - real veloXNeighborPx4 = veloX[kPx4]; - real veloXNeighborMx4 = veloX[kMx4]; + //real veloXNeighborPx4 = veloX[kPx4]; + //real veloXNeighborMx4 = veloX[kMx4]; real veloXNeighborPy4 = veloX[kPy4]; real veloXNeighborMy4 = veloX[kMy4]; real veloXNeighborPz4 = veloX[kPz4]; @@ -240,8 +243,8 @@ __host__ __device__ void enstrophyFunction(real* veloX, real* veloY, real* veloZ //getVeloY// real veloYNeighborPx4 = veloY[kPx4]; real veloYNeighborMx4 = veloY[kMx4]; - real veloYNeighborPy4 = veloY[kPy4]; - real veloYNeighborMy4 = veloY[kMy4]; + //real veloYNeighborPy4 = veloY[kPy4]; + //real veloYNeighborMy4 = veloY[kMy4]; real veloYNeighborPz4 = veloY[kPz4]; real veloYNeighborMz4 = veloY[kMz4]; //getVeloZ// @@ -249,18 +252,18 @@ __host__ __device__ void enstrophyFunction(real* veloX, real* veloY, real* veloZ real veloZNeighborMx4 = veloZ[kMx4]; real veloZNeighborPy4 = veloZ[kPy4]; real veloZNeighborMy4 = veloZ[kMy4]; - real veloZNeighborPz4 = veloZ[kPz4]; - real veloZNeighborMz4 = veloZ[kMz4]; + //real veloZNeighborPz4 = veloZ[kPz4]; + //real veloZNeighborMz4 = veloZ[kMz4]; ////////////////////////////////////////////////////////////////////////////// - real dxvx = c0o1; + //real dxvx = c0o1; real dyvx = c0o1; real dzvx = c0o1; real dxvy = c0o1; - real dyvy = c0o1; + //real dyvy = c0o1; real dzvy = c0o1; real dxvz = c0o1; real dyvz = c0o1; - real dzvz = c0o1; + //real dzvz = c0o1; ////////////////////////////////////////////////////////////////////////// //maxOrderX = 2; diff --git a/src/gpu/VirtualFluids_GPU/GPU/KineticEnergyAnalyzer.cu b/src/gpu/VirtualFluids_GPU/GPU/KineticEnergyAnalyzer.cu index ea22c0295b61efcf362999009050a7bf382f3950..e6e5c9b11447028b3f9b79e9ce551cb7d3d7e841 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/KineticEnergyAnalyzer.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/KineticEnergyAnalyzer.cu @@ -89,6 +89,9 @@ bool KineticEnergyAnalyzer::run(uint iter) //std::cout << "EKin " << EKin << " " << numberOfFluidNodes << std::endl; this->kineticEnergyTimeSeries.push_back( EKin / real(numberOfFluidNodes) ); + + //TODO: Should this function probably return nothing? + return true; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/VirtualFluids_GPU/GPU/Particles.cu b/src/gpu/VirtualFluids_GPU/GPU/Particles.cu index 39c63e152c7a5ab88d8d416591a737d56a5d23b3..f81d3f4e813a0753627e1ddf2808e799fbbe0738 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/Particles.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/Particles.cu @@ -195,7 +195,8 @@ extern "C" __global__ void MoveParticles( real* coordX, const unsigned k = nx*(ny*iz + iy) + ix; ////////////////////////////////////////////////////////////////////////// - real press,vx1,vx2,vx3; + //real press; + real vx1,vx2,vx3; real drho_SWT,vx1_SWT,vx2_SWT,vx3_SWT; real drho_NWT,vx1_NWT,vx2_NWT,vx3_NWT; real drho_NET,vx1_NET,vx2_NET,vx3_NET; @@ -215,7 +216,7 @@ extern "C" __global__ void MoveParticles( real* coordX, real kxyFromfcNEQ_NEB, kyzFromfcNEQ_NEB, kxzFromfcNEQ_NEB, kxxMyyFromfcNEQ_NEB, kxxMzzFromfcNEQ_NEB; real kxyFromfcNEQ_SEB, kyzFromfcNEQ_SEB, kxzFromfcNEQ_SEB, kxxMyyFromfcNEQ_SEB, kxxMzzFromfcNEQ_SEB; real a0, ax, ay, az, axx, ayy, azz, axy, axz, ayz, b0, bx, by, bz, bxx, byy, bzz, bxy, bxz, byz, c0, cx, cy, cz, cxx, cyy, czz, cxy, cxz, cyz, axyz, bxyz, cxyz; - real d0, dx, dy, dz, dxy, dxz, dyz, dxyz; + //real d0, dx, dy, dz, dxy, dxz, dyz, dxyz; real x,y,z; @@ -862,14 +863,14 @@ extern "C" __global__ void MoveParticles( real* coordX, ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //drho - d0 = ( drho_NEB + drho_NET + drho_NWB + drho_NWT + drho_SEB + drho_SET + drho_SWB + drho_SWT) * c1o8; - dx = ( drho_NEB + drho_NET - drho_NWB - drho_NWT + drho_SEB + drho_SET - drho_SWB - drho_SWT) * c1o4; - dy = ( drho_NEB + drho_NET + drho_NWB + drho_NWT - drho_SEB - drho_SET - drho_SWB - drho_SWT) * c1o4; - dz = (-drho_NEB + drho_NET - drho_NWB + drho_NWT - drho_SEB + drho_SET - drho_SWB + drho_SWT) * c1o4; - dxy = ( drho_NEB + drho_NET - drho_NWB - drho_NWT - drho_SEB - drho_SET + drho_SWB + drho_SWT) * c1o2; - dxz = (-drho_NEB + drho_NET + drho_NWB - drho_NWT - drho_SEB + drho_SET + drho_SWB - drho_SWT) * c1o2; - dyz = (-drho_NEB + drho_NET - drho_NWB + drho_NWT + drho_SEB - drho_SET + drho_SWB - drho_SWT) * c1o2; - dxyz = -drho_NEB + drho_NET + drho_NWB - drho_NWT + drho_SEB - drho_SET - drho_SWB + drho_SWT; + // d0 = ( drho_NEB + drho_NET + drho_NWB + drho_NWT + drho_SEB + drho_SET + drho_SWB + drho_SWT) * c1o8; + // dx = ( drho_NEB + drho_NET - drho_NWB - drho_NWT + drho_SEB + drho_SET - drho_SWB - drho_SWT) * c1o4; + // dy = ( drho_NEB + drho_NET + drho_NWB + drho_NWT - drho_SEB - drho_SET - drho_SWB - drho_SWT) * c1o4; + // dz = (-drho_NEB + drho_NET - drho_NWB + drho_NWT - drho_SEB + drho_SET - drho_SWB + drho_SWT) * c1o4; + // dxy = ( drho_NEB + drho_NET - drho_NWB - drho_NWT - drho_SEB - drho_SET + drho_SWB + drho_SWT) * c1o2; + // dxz = (-drho_NEB + drho_NET + drho_NWB - drho_NWT - drho_SEB + drho_SET + drho_SWB - drho_SWT) * c1o2; + // dyz = (-drho_NEB + drho_NET - drho_NWB + drho_NWT + drho_SEB - drho_SET + drho_SWB - drho_SWT) * c1o2; + // dxyz = -drho_NEB + drho_NET + drho_NWB - drho_NWT + drho_SEB - drho_SET - drho_SWB + drho_SWT; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -882,7 +883,7 @@ extern "C" __global__ void MoveParticles( real* coordX, y = (localY * (real)(pow((double)c2o1, (double)level))) - c1o2; //-c1o4; z = (localZ * (real)(pow((double)c2o1, (double)level))) - c1o2; //-c1o4; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - press = d0 + x*dx + y*dy + z*dz + x*y*dxy + x*z*dxz + y*z*dyz + x*y*z*dxyz; + //press = d0 + x*dx + y*dy + z*dz + x*y*dxy + x*z*dxz + y*z*dyz + x*y*z*dxyz; vx1 = (a0 + x*ax + y*ay + z*az + x*x*axx + y*y*ayy + z*z*azz + x*y*axy + x*z*axz + y*z*ayz + x*y*z*axyz); vx2 = (b0 + x*bx + y*by + z*bz + x*x*bxx + y*y*byy + z*z*bzz + x*y*bxy + x*z*bxz + y*z*byz + x*y*z*bxyz); vx3 = (c0 + x*cx + y*cy + z*cz + x*x*cxx + y*y*cyy + z*z*czz + x*y*cxy + x*z*cxz + y*z*cyz + x*y*z*cxyz); @@ -1066,7 +1067,8 @@ extern "C" __global__ void MoveParticlesWithoutBCs( real* coordX, const unsigned k = nx*(ny*iz + iy) + ix; ////////////////////////////////////////////////////////////////////////// - real press,vx1,vx2,vx3; + //real press; + real vx1,vx2,vx3; real drho_SWT,vx1_SWT,vx2_SWT,vx3_SWT; real drho_NWT,vx1_NWT,vx2_NWT,vx3_NWT; real drho_NET,vx1_NET,vx2_NET,vx3_NET; @@ -1086,7 +1088,7 @@ extern "C" __global__ void MoveParticlesWithoutBCs( real* coordX, real kxyFromfcNEQ_NEB, kyzFromfcNEQ_NEB, kxzFromfcNEQ_NEB, kxxMyyFromfcNEQ_NEB, kxxMzzFromfcNEQ_NEB; real kxyFromfcNEQ_SEB, kyzFromfcNEQ_SEB, kxzFromfcNEQ_SEB, kxxMyyFromfcNEQ_SEB, kxxMzzFromfcNEQ_SEB; real a0, ax, ay, az, axx, ayy, azz, axy, axz, ayz, b0, bx, by, bz, bxx, byy, bzz, bxy, bxz, byz, c0, cx, cy, cz, cxx, cyy, czz, cxy, cxz, cyz, axyz, bxyz, cxyz; - real d0, dx, dy, dz, dxy, dxz, dyz, dxyz; + //real d0, dx, dy, dz, dxy, dxz, dyz, dxyz; real x,y,z; @@ -1727,14 +1729,14 @@ extern "C" __global__ void MoveParticlesWithoutBCs( real* coordX, ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //drho - d0 = ( drho_NEB + drho_NET + drho_NWB + drho_NWT + drho_SEB + drho_SET + drho_SWB + drho_SWT) * c1o8; - dx = ( drho_NEB + drho_NET - drho_NWB - drho_NWT + drho_SEB + drho_SET - drho_SWB - drho_SWT) * c1o4; - dy = ( drho_NEB + drho_NET + drho_NWB + drho_NWT - drho_SEB - drho_SET - drho_SWB - drho_SWT) * c1o4; - dz = (-drho_NEB + drho_NET - drho_NWB + drho_NWT - drho_SEB + drho_SET - drho_SWB + drho_SWT) * c1o4; - dxy = ( drho_NEB + drho_NET - drho_NWB - drho_NWT - drho_SEB - drho_SET + drho_SWB + drho_SWT) * c1o2; - dxz = (-drho_NEB + drho_NET + drho_NWB - drho_NWT - drho_SEB + drho_SET + drho_SWB - drho_SWT) * c1o2; - dyz = (-drho_NEB + drho_NET - drho_NWB + drho_NWT + drho_SEB - drho_SET + drho_SWB - drho_SWT) * c1o2; - dxyz = -drho_NEB + drho_NET + drho_NWB - drho_NWT + drho_SEB - drho_SET - drho_SWB + drho_SWT; + // d0 = ( drho_NEB + drho_NET + drho_NWB + drho_NWT + drho_SEB + drho_SET + drho_SWB + drho_SWT) * c1o8; + // dx = ( drho_NEB + drho_NET - drho_NWB - drho_NWT + drho_SEB + drho_SET - drho_SWB - drho_SWT) * c1o4; + // dy = ( drho_NEB + drho_NET + drho_NWB + drho_NWT - drho_SEB - drho_SET - drho_SWB - drho_SWT) * c1o4; + // dz = (-drho_NEB + drho_NET - drho_NWB + drho_NWT - drho_SEB + drho_SET - drho_SWB + drho_SWT) * c1o4; + // dxy = ( drho_NEB + drho_NET - drho_NWB - drho_NWT - drho_SEB - drho_SET + drho_SWB + drho_SWT) * c1o2; + // dxz = (-drho_NEB + drho_NET + drho_NWB - drho_NWT - drho_SEB + drho_SET + drho_SWB - drho_SWT) * c1o2; + // dyz = (-drho_NEB + drho_NET - drho_NWB + drho_NWT + drho_SEB - drho_SET + drho_SWB - drho_SWT) * c1o2; + // dxyz = -drho_NEB + drho_NET + drho_NWB - drho_NWT + drho_SEB - drho_SET - drho_SWB + drho_SWT; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1747,7 +1749,7 @@ extern "C" __global__ void MoveParticlesWithoutBCs( real* coordX, y = (localY * (real)(pow((double)c2o1, (double)level))) - c1o2; //-c1o4; z = (localZ * (real)(pow((double)c2o1, (double)level))) - c1o2; //-c1o4; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - press = d0 + x*dx + y*dy + z*dz + x*y*dxy + x*z*dxz + y*z*dyz + x*y*z*dxyz; + //press = d0 + x*dx + y*dy + z*dz + x*y*dxy + x*z*dxz + y*z*dyz + x*y*z*dxyz; vx1 = (a0 + x*ax + y*ay + z*az + x*x*axx + y*y*ayy + z*z*azz + x*y*axy + x*z*axz + y*z*ayz + x*y*z*axyz); vx2 = (b0 + x*bx + y*by + z*bz + x*x*bxx + y*y*byy + z*z*bzz + x*y*bxy + x*z*bxz + y*z*byz + x*y*z*bxyz); vx3 = (c0 + x*cx + y*cy + z*cz + x*x*cxx + y*y*cyy + z*z*czz + x*y*cxy + x*z*cxz + y*z*cyz + x*y*z*cxyz); @@ -1927,415 +1929,373 @@ extern "C" __global__ void ParticleNoSlipDeviceComp27(real* coordX, unsigned int size_Mat, bool evenOrOdd) { - Distributions27 D; - if (evenOrOdd==true) - { - D.f[dirE ] = &DD[dirE *size_Mat]; - D.f[dirW ] = &DD[dirW *size_Mat]; - D.f[dirN ] = &DD[dirN *size_Mat]; - D.f[dirS ] = &DD[dirS *size_Mat]; - D.f[dirT ] = &DD[dirT *size_Mat]; - D.f[dirB ] = &DD[dirB *size_Mat]; - D.f[dirNE ] = &DD[dirNE *size_Mat]; - D.f[dirSW ] = &DD[dirSW *size_Mat]; - D.f[dirSE ] = &DD[dirSE *size_Mat]; - D.f[dirNW ] = &DD[dirNW *size_Mat]; - D.f[dirTE ] = &DD[dirTE *size_Mat]; - D.f[dirBW ] = &DD[dirBW *size_Mat]; - D.f[dirBE ] = &DD[dirBE *size_Mat]; - D.f[dirTW ] = &DD[dirTW *size_Mat]; - D.f[dirTN ] = &DD[dirTN *size_Mat]; - D.f[dirBS ] = &DD[dirBS *size_Mat]; - D.f[dirBN ] = &DD[dirBN *size_Mat]; - D.f[dirTS ] = &DD[dirTS *size_Mat]; - D.f[dirZERO] = &DD[dirZERO*size_Mat]; - D.f[dirTNE ] = &DD[dirTNE *size_Mat]; - D.f[dirTSW ] = &DD[dirTSW *size_Mat]; - D.f[dirTSE ] = &DD[dirTSE *size_Mat]; - D.f[dirTNW ] = &DD[dirTNW *size_Mat]; - D.f[dirBNE ] = &DD[dirBNE *size_Mat]; - D.f[dirBSW ] = &DD[dirBSW *size_Mat]; - D.f[dirBSE ] = &DD[dirBSE *size_Mat]; - D.f[dirBNW ] = &DD[dirBNW *size_Mat]; - } - else - { - D.f[dirW ] = &DD[dirE *size_Mat]; - D.f[dirE ] = &DD[dirW *size_Mat]; - D.f[dirS ] = &DD[dirN *size_Mat]; - D.f[dirN ] = &DD[dirS *size_Mat]; - D.f[dirB ] = &DD[dirT *size_Mat]; - D.f[dirT ] = &DD[dirB *size_Mat]; - D.f[dirSW ] = &DD[dirNE *size_Mat]; - D.f[dirNE ] = &DD[dirSW *size_Mat]; - D.f[dirNW ] = &DD[dirSE *size_Mat]; - D.f[dirSE ] = &DD[dirNW *size_Mat]; - D.f[dirBW ] = &DD[dirTE *size_Mat]; - D.f[dirTE ] = &DD[dirBW *size_Mat]; - D.f[dirTW ] = &DD[dirBE *size_Mat]; - D.f[dirBE ] = &DD[dirTW *size_Mat]; - D.f[dirBS ] = &DD[dirTN *size_Mat]; - D.f[dirTN ] = &DD[dirBS *size_Mat]; - D.f[dirTS ] = &DD[dirBN *size_Mat]; - D.f[dirBN ] = &DD[dirTS *size_Mat]; - D.f[dirZERO] = &DD[dirZERO*size_Mat]; - D.f[dirTNE ] = &DD[dirBSW *size_Mat]; - D.f[dirTSW ] = &DD[dirBNE *size_Mat]; - D.f[dirTSE ] = &DD[dirBNW *size_Mat]; - D.f[dirTNW ] = &DD[dirBSE *size_Mat]; - D.f[dirBNE ] = &DD[dirTSW *size_Mat]; - D.f[dirBSW ] = &DD[dirTNE *size_Mat]; - D.f[dirBSE ] = &DD[dirTNW *size_Mat]; - D.f[dirBNW ] = &DD[dirTSE *size_Mat]; - } - //////////////////////////////////////////////////////////////////////////////// - const unsigned x = threadIdx.x; // Globaler x-Index - const unsigned y = blockIdx.x; // Globaler y-Index - const unsigned z = blockIdx.y; // Globaler z-Index - const unsigned nx = blockDim.x; - const unsigned ny = gridDim.x; - - const unsigned k = nx*(ny*z + y) + x; - ////////////////////////////////////////////////////////////////////////// - - if(k<sizeQ) - { - //////////////////////////////////////////////////////////////////////////////// - real *q_dirE, *q_dirW, *q_dirN, *q_dirS, *q_dirT, *q_dirB, - *q_dirNE, *q_dirSW, *q_dirSE, *q_dirNW, *q_dirTE, *q_dirBW, - *q_dirBE, *q_dirTW, *q_dirTN, *q_dirBS, *q_dirBN, *q_dirTS, - *q_dirTNE, *q_dirTSW, *q_dirTSE, *q_dirTNW, *q_dirBNE, *q_dirBSW, - *q_dirBSE, *q_dirBNW; - q_dirE = &QQ[dirE *sizeQ]; - q_dirW = &QQ[dirW *sizeQ]; - q_dirN = &QQ[dirN *sizeQ]; - q_dirS = &QQ[dirS *sizeQ]; - q_dirT = &QQ[dirT *sizeQ]; - q_dirB = &QQ[dirB *sizeQ]; - q_dirNE = &QQ[dirNE *sizeQ]; - q_dirSW = &QQ[dirSW *sizeQ]; - q_dirSE = &QQ[dirSE *sizeQ]; - q_dirNW = &QQ[dirNW *sizeQ]; - q_dirTE = &QQ[dirTE *sizeQ]; - q_dirBW = &QQ[dirBW *sizeQ]; - q_dirBE = &QQ[dirBE *sizeQ]; - q_dirTW = &QQ[dirTW *sizeQ]; - q_dirTN = &QQ[dirTN *sizeQ]; - q_dirBS = &QQ[dirBS *sizeQ]; - q_dirBN = &QQ[dirBN *sizeQ]; - q_dirTS = &QQ[dirTS *sizeQ]; - q_dirTNE = &QQ[dirTNE *sizeQ]; - q_dirTSW = &QQ[dirTSW *sizeQ]; - q_dirTSE = &QQ[dirTSE *sizeQ]; - q_dirTNW = &QQ[dirTNW *sizeQ]; - q_dirBNE = &QQ[dirBNE *sizeQ]; - q_dirBSW = &QQ[dirBSW *sizeQ]; - q_dirBSE = &QQ[dirBSE *sizeQ]; - q_dirBNW = &QQ[dirBNW *sizeQ]; - //////////////////////////////////////////////////////////////////////////////// - real *nx_dirE, *nx_dirW, *nx_dirN, *nx_dirS, *nx_dirT, *nx_dirB, - *nx_dirNE, *nx_dirSW, *nx_dirSE, *nx_dirNW, *nx_dirTE, *nx_dirBW, - *nx_dirBE, *nx_dirTW, *nx_dirTN, *nx_dirBS, *nx_dirBN, *nx_dirTS, - *nx_dirTNE, *nx_dirTSW, *nx_dirTSE, *nx_dirTNW, *nx_dirBNE, *nx_dirBSW, - *nx_dirBSE, *nx_dirBNW; - nx_dirE = &NormalX[dirE *sizeQ]; - nx_dirW = &NormalX[dirW *sizeQ]; - nx_dirN = &NormalX[dirN *sizeQ]; - nx_dirS = &NormalX[dirS *sizeQ]; - nx_dirT = &NormalX[dirT *sizeQ]; - nx_dirB = &NormalX[dirB *sizeQ]; - nx_dirNE = &NormalX[dirNE *sizeQ]; - nx_dirSW = &NormalX[dirSW *sizeQ]; - nx_dirSE = &NormalX[dirSE *sizeQ]; - nx_dirNW = &NormalX[dirNW *sizeQ]; - nx_dirTE = &NormalX[dirTE *sizeQ]; - nx_dirBW = &NormalX[dirBW *sizeQ]; - nx_dirBE = &NormalX[dirBE *sizeQ]; - nx_dirTW = &NormalX[dirTW *sizeQ]; - nx_dirTN = &NormalX[dirTN *sizeQ]; - nx_dirBS = &NormalX[dirBS *sizeQ]; - nx_dirBN = &NormalX[dirBN *sizeQ]; - nx_dirTS = &NormalX[dirTS *sizeQ]; - nx_dirTNE = &NormalX[dirTNE *sizeQ]; - nx_dirTSW = &NormalX[dirTSW *sizeQ]; - nx_dirTSE = &NormalX[dirTSE *sizeQ]; - nx_dirTNW = &NormalX[dirTNW *sizeQ]; - nx_dirBNE = &NormalX[dirBNE *sizeQ]; - nx_dirBSW = &NormalX[dirBSW *sizeQ]; - nx_dirBSE = &NormalX[dirBSE *sizeQ]; - nx_dirBNW = &NormalX[dirBNW *sizeQ]; - //////////////////////////////////////////////////////////////////////////////// - real *ny_dirE, *ny_dirW, *ny_dirN, *ny_dirS, *ny_dirT, *ny_dirB, - *ny_dirNE, *ny_dirSW, *ny_dirSE, *ny_dirNW, *ny_dirTE, *ny_dirBW, - *ny_dirBE, *ny_dirTW, *ny_dirTN, *ny_dirBS, *ny_dirBN, *ny_dirTS, - *ny_dirTNE, *ny_dirTSW, *ny_dirTSE, *ny_dirTNW, *ny_dirBNE, *ny_dirBSW, - *ny_dirBSE, *ny_dirBNW; - ny_dirE = &NormalY[dirE *sizeQ]; - ny_dirW = &NormalY[dirW *sizeQ]; - ny_dirN = &NormalY[dirN *sizeQ]; - ny_dirS = &NormalY[dirS *sizeQ]; - ny_dirT = &NormalY[dirT *sizeQ]; - ny_dirB = &NormalY[dirB *sizeQ]; - ny_dirNE = &NormalY[dirNE *sizeQ]; - ny_dirSW = &NormalY[dirSW *sizeQ]; - ny_dirSE = &NormalY[dirSE *sizeQ]; - ny_dirNW = &NormalY[dirNW *sizeQ]; - ny_dirTE = &NormalY[dirTE *sizeQ]; - ny_dirBW = &NormalY[dirBW *sizeQ]; - ny_dirBE = &NormalY[dirBE *sizeQ]; - ny_dirTW = &NormalY[dirTW *sizeQ]; - ny_dirTN = &NormalY[dirTN *sizeQ]; - ny_dirBS = &NormalY[dirBS *sizeQ]; - ny_dirBN = &NormalY[dirBN *sizeQ]; - ny_dirTS = &NormalY[dirTS *sizeQ]; - ny_dirTNE = &NormalY[dirTNE *sizeQ]; - ny_dirTSW = &NormalY[dirTSW *sizeQ]; - ny_dirTSE = &NormalY[dirTSE *sizeQ]; - ny_dirTNW = &NormalY[dirTNW *sizeQ]; - ny_dirBNE = &NormalY[dirBNE *sizeQ]; - ny_dirBSW = &NormalY[dirBSW *sizeQ]; - ny_dirBSE = &NormalY[dirBSE *sizeQ]; - ny_dirBNW = &NormalY[dirBNW *sizeQ]; - //////////////////////////////////////////////////////////////////////////////// - real *nz_dirE, *nz_dirW, *nz_dirN, *nz_dirS, *nz_dirT, *nz_dirB, - *nz_dirNE, *nz_dirSW, *nz_dirSE, *nz_dirNW, *nz_dirTE, *nz_dirBW, - *nz_dirBE, *nz_dirTW, *nz_dirTN, *nz_dirBS, *nz_dirBN, *nz_dirTS, - *nz_dirTNE, *nz_dirTSW, *nz_dirTSE, *nz_dirTNW, *nz_dirBNE, *nz_dirBSW, - *nz_dirBSE, *nz_dirBNW; - nz_dirE = &NormalZ[dirE *sizeQ]; - nz_dirW = &NormalZ[dirW *sizeQ]; - nz_dirN = &NormalZ[dirN *sizeQ]; - nz_dirS = &NormalZ[dirS *sizeQ]; - nz_dirT = &NormalZ[dirT *sizeQ]; - nz_dirB = &NormalZ[dirB *sizeQ]; - nz_dirNE = &NormalZ[dirNE *sizeQ]; - nz_dirSW = &NormalZ[dirSW *sizeQ]; - nz_dirSE = &NormalZ[dirSE *sizeQ]; - nz_dirNW = &NormalZ[dirNW *sizeQ]; - nz_dirTE = &NormalZ[dirTE *sizeQ]; - nz_dirBW = &NormalZ[dirBW *sizeQ]; - nz_dirBE = &NormalZ[dirBE *sizeQ]; - nz_dirTW = &NormalZ[dirTW *sizeQ]; - nz_dirTN = &NormalZ[dirTN *sizeQ]; - nz_dirBS = &NormalZ[dirBS *sizeQ]; - nz_dirBN = &NormalZ[dirBN *sizeQ]; - nz_dirTS = &NormalZ[dirTS *sizeQ]; - nz_dirTNE = &NormalZ[dirTNE *sizeQ]; - nz_dirTSW = &NormalZ[dirTSW *sizeQ]; - nz_dirTSE = &NormalZ[dirTSE *sizeQ]; - nz_dirTNW = &NormalZ[dirTNW *sizeQ]; - nz_dirBNE = &NormalZ[dirBNE *sizeQ]; - nz_dirBSW = &NormalZ[dirBSW *sizeQ]; - nz_dirBSE = &NormalZ[dirBSE *sizeQ]; - nz_dirBNW = &NormalZ[dirBNW *sizeQ]; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - bool changeCell = false; - unsigned int KQK = k_Q[k]; - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if( q_dirW[k] > c0o1 || q_dirS[k] > c0o1 || q_dirB[k] > c0o1 ) { - KQK = neighborWSB[KQK]; - changeCell = true; - } - if( q_dirW[k] == c0o1 && changeCell == true ) { - KQK = neighborX[KQK]; - } - if( q_dirS[k] == c0o1 && changeCell == true ) { - KQK = neighborY[KQK]; - } - if( q_dirB[k] == c0o1 && changeCell == true ) { - KQK = neighborZ[KQK]; - } - - for(int i = 0; i < numberOfParticles; i++){ - //push back? - } - - //////////////////////////////////////////////////////////////////////////////// - //index - //unsigned int KQK = k_Q[k]; - unsigned int kzero= KQK; - unsigned int ke = KQK; - unsigned int kw = neighborX[KQK]; - unsigned int kn = KQK; - unsigned int ks = neighborY[KQK]; - unsigned int kt = KQK; - unsigned int kb = neighborZ[KQK]; - unsigned int ksw = neighborY[kw]; - unsigned int kne = KQK; - unsigned int kse = ks; - unsigned int knw = kw; - unsigned int kbw = neighborZ[kw]; - unsigned int kte = KQK; - unsigned int kbe = kb; - unsigned int ktw = kw; - unsigned int kbs = neighborZ[ks]; - unsigned int ktn = KQK; - unsigned int kbn = kb; - unsigned int kts = ks; - unsigned int ktse = ks; - unsigned int kbnw = kbw; - unsigned int ktnw = kw; - unsigned int kbse = kbs; - unsigned int ktsw = ksw; - unsigned int kbne = kb; - unsigned int ktne = KQK; - unsigned int kbsw = neighborZ[ksw]; - //////////////////////////////////////////////////////////////////////////////// - real f_W = (D.f[dirE ])[ke ]; - real f_E = (D.f[dirW ])[kw ]; - real f_S = (D.f[dirN ])[kn ]; - real f_N = (D.f[dirS ])[ks ]; - real f_B = (D.f[dirT ])[kt ]; - real f_T = (D.f[dirB ])[kb ]; - real f_SW = (D.f[dirNE ])[kne ]; - real f_NE = (D.f[dirSW ])[ksw ]; - real f_NW = (D.f[dirSE ])[kse ]; - real f_SE = (D.f[dirNW ])[knw ]; - real f_BW = (D.f[dirTE ])[kte ]; - real f_TE = (D.f[dirBW ])[kbw ]; - real f_TW = (D.f[dirBE ])[kbe ]; - real f_BE = (D.f[dirTW ])[ktw ]; - real f_BS = (D.f[dirTN ])[ktn ]; - real f_TN = (D.f[dirBS ])[kbs ]; - real f_TS = (D.f[dirBN ])[kbn ]; - real f_BN = (D.f[dirTS ])[kts ]; - real f_BSW = (D.f[dirTNE ])[ktne ]; - real f_BNE = (D.f[dirTSW ])[ktsw ]; - real f_BNW = (D.f[dirTSE ])[ktse ]; - real f_BSE = (D.f[dirTNW ])[ktnw ]; - real f_TSW = (D.f[dirBNE ])[kbne ]; - real f_TNE = (D.f[dirBSW ])[kbsw ]; - real f_TNW = (D.f[dirBSE ])[kbse ]; - real f_TSE = (D.f[dirBNW ])[kbnw ]; - //////////////////////////////////////////////////////////////////////////////// - real vx1, vx2, vx3, drho, feq, q; - drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + - f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + - f_T + f_B + f_N + f_S + f_E + f_W + ((D.f[dirZERO])[kzero]); - - vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + - (f_E - f_W)) / (c1o1 + drho); - - - vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + - (f_N - f_S)) / (c1o1 + drho); - - vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + - (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + - (f_T - f_B)) / (c1o1 + drho); - - real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3) * (c1o1 + drho); - - ////////////////////////////////////////////////////////////////////////// - if (evenOrOdd==false) - { - D.f[dirE ] = &DD[dirE *size_Mat]; - D.f[dirW ] = &DD[dirW *size_Mat]; - D.f[dirN ] = &DD[dirN *size_Mat]; - D.f[dirS ] = &DD[dirS *size_Mat]; - D.f[dirT ] = &DD[dirT *size_Mat]; - D.f[dirB ] = &DD[dirB *size_Mat]; - D.f[dirNE ] = &DD[dirNE *size_Mat]; - D.f[dirSW ] = &DD[dirSW *size_Mat]; - D.f[dirSE ] = &DD[dirSE *size_Mat]; - D.f[dirNW ] = &DD[dirNW *size_Mat]; - D.f[dirTE ] = &DD[dirTE *size_Mat]; - D.f[dirBW ] = &DD[dirBW *size_Mat]; - D.f[dirBE ] = &DD[dirBE *size_Mat]; - D.f[dirTW ] = &DD[dirTW *size_Mat]; - D.f[dirTN ] = &DD[dirTN *size_Mat]; - D.f[dirBS ] = &DD[dirBS *size_Mat]; - D.f[dirBN ] = &DD[dirBN *size_Mat]; - D.f[dirTS ] = &DD[dirTS *size_Mat]; - D.f[dirZERO] = &DD[dirZERO*size_Mat]; - D.f[dirTNE ] = &DD[dirTNE *size_Mat]; - D.f[dirTSW ] = &DD[dirTSW *size_Mat]; - D.f[dirTSE ] = &DD[dirTSE *size_Mat]; - D.f[dirTNW ] = &DD[dirTNW *size_Mat]; - D.f[dirBNE ] = &DD[dirBNE *size_Mat]; - D.f[dirBSW ] = &DD[dirBSW *size_Mat]; - D.f[dirBSE ] = &DD[dirBSE *size_Mat]; - D.f[dirBNW ] = &DD[dirBNW *size_Mat]; - } - else - { - D.f[dirW ] = &DD[dirE *size_Mat]; - D.f[dirE ] = &DD[dirW *size_Mat]; - D.f[dirS ] = &DD[dirN *size_Mat]; - D.f[dirN ] = &DD[dirS *size_Mat]; - D.f[dirB ] = &DD[dirT *size_Mat]; - D.f[dirT ] = &DD[dirB *size_Mat]; - D.f[dirSW ] = &DD[dirNE *size_Mat]; - D.f[dirNE ] = &DD[dirSW *size_Mat]; - D.f[dirNW ] = &DD[dirSE *size_Mat]; - D.f[dirSE ] = &DD[dirNW *size_Mat]; - D.f[dirBW ] = &DD[dirTE *size_Mat]; - D.f[dirTE ] = &DD[dirBW *size_Mat]; - D.f[dirTW ] = &DD[dirBE *size_Mat]; - D.f[dirBE ] = &DD[dirTW *size_Mat]; - D.f[dirBS ] = &DD[dirTN *size_Mat]; - D.f[dirTN ] = &DD[dirBS *size_Mat]; - D.f[dirTS ] = &DD[dirBN *size_Mat]; - D.f[dirBN ] = &DD[dirTS *size_Mat]; - D.f[dirZERO] = &DD[dirZERO*size_Mat]; - D.f[dirTNE ] = &DD[dirBSW *size_Mat]; - D.f[dirTSW ] = &DD[dirBNE *size_Mat]; - D.f[dirTSE ] = &DD[dirBNW *size_Mat]; - D.f[dirTNW ] = &DD[dirBSE *size_Mat]; - D.f[dirBNE ] = &DD[dirTSW *size_Mat]; - D.f[dirBSW ] = &DD[dirTNE *size_Mat]; - D.f[dirBSE ] = &DD[dirTNW *size_Mat]; - D.f[dirBNW ] = &DD[dirTSE *size_Mat]; - } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real VeloX = vx1; - real VeloY = vx2; - real VeloZ = vx3; - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - } + //TODO: What is this function for??? + + //Distributions27 D; + //if (evenOrOdd==true) + //{ + // D.f[dirE ] = &DD[dirE *size_Mat]; + // D.f[dirW ] = &DD[dirW *size_Mat]; + // D.f[dirN ] = &DD[dirN *size_Mat]; + // D.f[dirS ] = &DD[dirS *size_Mat]; + // D.f[dirT ] = &DD[dirT *size_Mat]; + // D.f[dirB ] = &DD[dirB *size_Mat]; + // D.f[dirNE ] = &DD[dirNE *size_Mat]; + // D.f[dirSW ] = &DD[dirSW *size_Mat]; + // D.f[dirSE ] = &DD[dirSE *size_Mat]; + // D.f[dirNW ] = &DD[dirNW *size_Mat]; + // D.f[dirTE ] = &DD[dirTE *size_Mat]; + // D.f[dirBW ] = &DD[dirBW *size_Mat]; + // D.f[dirBE ] = &DD[dirBE *size_Mat]; + // D.f[dirTW ] = &DD[dirTW *size_Mat]; + // D.f[dirTN ] = &DD[dirTN *size_Mat]; + // D.f[dirBS ] = &DD[dirBS *size_Mat]; + // D.f[dirBN ] = &DD[dirBN *size_Mat]; + // D.f[dirTS ] = &DD[dirTS *size_Mat]; + // D.f[dirZERO] = &DD[dirZERO*size_Mat]; + // D.f[dirTNE ] = &DD[dirTNE *size_Mat]; + // D.f[dirTSW ] = &DD[dirTSW *size_Mat]; + // D.f[dirTSE ] = &DD[dirTSE *size_Mat]; + // D.f[dirTNW ] = &DD[dirTNW *size_Mat]; + // D.f[dirBNE ] = &DD[dirBNE *size_Mat]; + // D.f[dirBSW ] = &DD[dirBSW *size_Mat]; + // D.f[dirBSE ] = &DD[dirBSE *size_Mat]; + // D.f[dirBNW ] = &DD[dirBNW *size_Mat]; + //} + //else + //{ + // D.f[dirW ] = &DD[dirE *size_Mat]; + // D.f[dirE ] = &DD[dirW *size_Mat]; + // D.f[dirS ] = &DD[dirN *size_Mat]; + // D.f[dirN ] = &DD[dirS *size_Mat]; + // D.f[dirB ] = &DD[dirT *size_Mat]; + // D.f[dirT ] = &DD[dirB *size_Mat]; + // D.f[dirSW ] = &DD[dirNE *size_Mat]; + // D.f[dirNE ] = &DD[dirSW *size_Mat]; + // D.f[dirNW ] = &DD[dirSE *size_Mat]; + // D.f[dirSE ] = &DD[dirNW *size_Mat]; + // D.f[dirBW ] = &DD[dirTE *size_Mat]; + // D.f[dirTE ] = &DD[dirBW *size_Mat]; + // D.f[dirTW ] = &DD[dirBE *size_Mat]; + // D.f[dirBE ] = &DD[dirTW *size_Mat]; + // D.f[dirBS ] = &DD[dirTN *size_Mat]; + // D.f[dirTN ] = &DD[dirBS *size_Mat]; + // D.f[dirTS ] = &DD[dirBN *size_Mat]; + // D.f[dirBN ] = &DD[dirTS *size_Mat]; + // D.f[dirZERO] = &DD[dirZERO*size_Mat]; + // D.f[dirTNE ] = &DD[dirBSW *size_Mat]; + // D.f[dirTSW ] = &DD[dirBNE *size_Mat]; + // D.f[dirTSE ] = &DD[dirBNW *size_Mat]; + // D.f[dirTNW ] = &DD[dirBSE *size_Mat]; + // D.f[dirBNE ] = &DD[dirTSW *size_Mat]; + // D.f[dirBSW ] = &DD[dirTNE *size_Mat]; + // D.f[dirBSE ] = &DD[dirTNW *size_Mat]; + // D.f[dirBNW ] = &DD[dirTSE *size_Mat]; + //} + ////////////////////////////////////////////////////////////////////////////////// + //const unsigned x = threadIdx.x; // Globaler x-Index + //const unsigned y = blockIdx.x; // Globaler y-Index + //const unsigned z = blockIdx.y; // Globaler z-Index + + //const unsigned nx = blockDim.x; + //const unsigned ny = gridDim.x; + + //const unsigned k = nx*(ny*z + y) + x; + //////////////////////////////////////////////////////////////////////////// + + //if(k < sizeQ) + //{ + // //////////////////////////////////////////////////////////////////////////////// + // real *q_dirW, *q_dirS, *q_dirB; + // // real *q_dirE, *q_dirW, *q_dirN, *q_dirS, *q_dirT, *q_dirB, + // // *q_dirNE, *q_dirSW, *q_dirSE, *q_dirNW, *q_dirTE, *q_dirBW, + // // *q_dirBE, *q_dirTW, *q_dirTN, *q_dirBS, *q_dirBN, *q_dirTS, + // // *q_dirTNE, *q_dirTSW, *q_dirTSE, *q_dirTNW, *q_dirBNE, *q_dirBSW, + // // *q_dirBSE, *q_dirBNW; + // // q_dirE = &QQ[dirE *sizeQ]; + // q_dirW = &QQ[dirW *sizeQ]; + // // q_dirN = &QQ[dirN *sizeQ]; + // q_dirS = &QQ[dirS *sizeQ]; + // // q_dirT = &QQ[dirT *sizeQ]; + // q_dirB = &QQ[dirB *sizeQ]; + // // q_dirNE = &QQ[dirNE *sizeQ]; + // // q_dirSW = &QQ[dirSW *sizeQ]; + // // q_dirSE = &QQ[dirSE *sizeQ]; + // // q_dirNW = &QQ[dirNW *sizeQ]; + // // q_dirTE = &QQ[dirTE *sizeQ]; + // // q_dirBW = &QQ[dirBW *sizeQ]; + // // q_dirBE = &QQ[dirBE *sizeQ]; + // // q_dirTW = &QQ[dirTW *sizeQ]; + // // q_dirTN = &QQ[dirTN *sizeQ]; + // // q_dirBS = &QQ[dirBS *sizeQ]; + // // q_dirBN = &QQ[dirBN *sizeQ]; + // // q_dirTS = &QQ[dirTS *sizeQ]; + // // q_dirTNE = &QQ[dirTNE *sizeQ]; + // // q_dirTSW = &QQ[dirTSW *sizeQ]; + // // q_dirTSE = &QQ[dirTSE *sizeQ]; + // // q_dirTNW = &QQ[dirTNW *sizeQ]; + // // q_dirBNE = &QQ[dirBNE *sizeQ]; + // // q_dirBSW = &QQ[dirBSW *sizeQ]; + // // q_dirBSE = &QQ[dirBSE *sizeQ]; + // // q_dirBNW = &QQ[dirBNW *sizeQ]; + // //////////////////////////////////////////////////////////////////////////////// + // // real *nx_dirE, *nx_dirW, *nx_dirN, *nx_dirS, *nx_dirT, *nx_dirB, + // // *nx_dirNE, *nx_dirSW, *nx_dirSE, *nx_dirNW, *nx_dirTE, *nx_dirBW, + // // *nx_dirBE, *nx_dirTW, *nx_dirTN, *nx_dirBS, *nx_dirBN, *nx_dirTS, + // // *nx_dirTNE, *nx_dirTSW, *nx_dirTSE, *nx_dirTNW, *nx_dirBNE, *nx_dirBSW, + // // *nx_dirBSE, *nx_dirBNW; + // // nx_dirE = &NormalX[dirE *sizeQ]; + // // nx_dirW = &NormalX[dirW *sizeQ]; + // // nx_dirN = &NormalX[dirN *sizeQ]; + // // nx_dirS = &NormalX[dirS *sizeQ]; + // // nx_dirT = &NormalX[dirT *sizeQ]; + // // nx_dirB = &NormalX[dirB *sizeQ]; + // // nx_dirNE = &NormalX[dirNE *sizeQ]; + // // nx_dirSW = &NormalX[dirSW *sizeQ]; + // // nx_dirSE = &NormalX[dirSE *sizeQ]; + // // nx_dirNW = &NormalX[dirNW *sizeQ]; + // // nx_dirTE = &NormalX[dirTE *sizeQ]; + // // nx_dirBW = &NormalX[dirBW *sizeQ]; + // // nx_dirBE = &NormalX[dirBE *sizeQ]; + // // nx_dirTW = &NormalX[dirTW *sizeQ]; + // // nx_dirTN = &NormalX[dirTN *sizeQ]; + // // nx_dirBS = &NormalX[dirBS *sizeQ]; + // // nx_dirBN = &NormalX[dirBN *sizeQ]; + // // nx_dirTS = &NormalX[dirTS *sizeQ]; + // // nx_dirTNE = &NormalX[dirTNE *sizeQ]; + // // nx_dirTSW = &NormalX[dirTSW *sizeQ]; + // // nx_dirTSE = &NormalX[dirTSE *sizeQ]; + // // nx_dirTNW = &NormalX[dirTNW *sizeQ]; + // // nx_dirBNE = &NormalX[dirBNE *sizeQ]; + // // nx_dirBSW = &NormalX[dirBSW *sizeQ]; + // // nx_dirBSE = &NormalX[dirBSE *sizeQ]; + // // nx_dirBNW = &NormalX[dirBNW *sizeQ]; + // //////////////////////////////////////////////////////////////////////////////// + // // real *ny_dirE, *ny_dirW, *ny_dirN, *ny_dirS, *ny_dirT, *ny_dirB, + // // *ny_dirNE, *ny_dirSW, *ny_dirSE, *ny_dirNW, *ny_dirTE, *ny_dirBW, + // // *ny_dirBE, *ny_dirTW, *ny_dirTN, *ny_dirBS, *ny_dirBN, *ny_dirTS, + // // *ny_dirTNE, *ny_dirTSW, *ny_dirTSE, *ny_dirTNW, *ny_dirBNE, *ny_dirBSW, + // // *ny_dirBSE, *ny_dirBNW; + // // ny_dirE = &NormalY[dirE *sizeQ]; + // // ny_dirW = &NormalY[dirW *sizeQ]; + // // ny_dirN = &NormalY[dirN *sizeQ]; + // // ny_dirS = &NormalY[dirS *sizeQ]; + // // ny_dirT = &NormalY[dirT *sizeQ]; + // // ny_dirB = &NormalY[dirB *sizeQ]; + // // ny_dirNE = &NormalY[dirNE *sizeQ]; + // // ny_dirSW = &NormalY[dirSW *sizeQ]; + // // ny_dirSE = &NormalY[dirSE *sizeQ]; + // // ny_dirNW = &NormalY[dirNW *sizeQ]; + // // ny_dirTE = &NormalY[dirTE *sizeQ]; + // // ny_dirBW = &NormalY[dirBW *sizeQ]; + // // ny_dirBE = &NormalY[dirBE *sizeQ]; + // // ny_dirTW = &NormalY[dirTW *sizeQ]; + // // ny_dirTN = &NormalY[dirTN *sizeQ]; + // // ny_dirBS = &NormalY[dirBS *sizeQ]; + // // ny_dirBN = &NormalY[dirBN *sizeQ]; + // // ny_dirTS = &NormalY[dirTS *sizeQ]; + // // ny_dirTNE = &NormalY[dirTNE *sizeQ]; + // // ny_dirTSW = &NormalY[dirTSW *sizeQ]; + // // ny_dirTSE = &NormalY[dirTSE *sizeQ]; + // // ny_dirTNW = &NormalY[dirTNW *sizeQ]; + // // ny_dirBNE = &NormalY[dirBNE *sizeQ]; + // // ny_dirBSW = &NormalY[dirBSW *sizeQ]; + // // ny_dirBSE = &NormalY[dirBSE *sizeQ]; + // // ny_dirBNW = &NormalY[dirBNW *sizeQ]; + // //////////////////////////////////////////////////////////////////////////////// + // // real *nz_dirE, *nz_dirW, *nz_dirN, *nz_dirS, *nz_dirT, *nz_dirB, + // // *nz_dirNE, *nz_dirSW, *nz_dirSE, *nz_dirNW, *nz_dirTE, *nz_dirBW, + // // *nz_dirBE, *nz_dirTW, *nz_dirTN, *nz_dirBS, *nz_dirBN, *nz_dirTS, + // // *nz_dirTNE, *nz_dirTSW, *nz_dirTSE, *nz_dirTNW, *nz_dirBNE, *nz_dirBSW, + // // *nz_dirBSE, *nz_dirBNW; + // // nz_dirE = &NormalZ[dirE *sizeQ]; + // // nz_dirW = &NormalZ[dirW *sizeQ]; + // // nz_dirN = &NormalZ[dirN *sizeQ]; + // // nz_dirS = &NormalZ[dirS *sizeQ]; + // // nz_dirT = &NormalZ[dirT *sizeQ]; + // // nz_dirB = &NormalZ[dirB *sizeQ]; + // // nz_dirNE = &NormalZ[dirNE *sizeQ]; + // // nz_dirSW = &NormalZ[dirSW *sizeQ]; + // // nz_dirSE = &NormalZ[dirSE *sizeQ]; + // // nz_dirNW = &NormalZ[dirNW *sizeQ]; + // // nz_dirTE = &NormalZ[dirTE *sizeQ]; + // // nz_dirBW = &NormalZ[dirBW *sizeQ]; + // // nz_dirBE = &NormalZ[dirBE *sizeQ]; + // // nz_dirTW = &NormalZ[dirTW *sizeQ]; + // // nz_dirTN = &NormalZ[dirTN *sizeQ]; + // // nz_dirBS = &NormalZ[dirBS *sizeQ]; + // // nz_dirBN = &NormalZ[dirBN *sizeQ]; + // // nz_dirTS = &NormalZ[dirTS *sizeQ]; + // // nz_dirTNE = &NormalZ[dirTNE *sizeQ]; + // // nz_dirTSW = &NormalZ[dirTSW *sizeQ]; + // // nz_dirTSE = &NormalZ[dirTSE *sizeQ]; + // // nz_dirTNW = &NormalZ[dirTNW *sizeQ]; + // // nz_dirBNE = &NormalZ[dirBNE *sizeQ]; + // // nz_dirBSW = &NormalZ[dirBSW *sizeQ]; + // // nz_dirBSE = &NormalZ[dirBSE *sizeQ]; + // // nz_dirBNW = &NormalZ[dirBNW *sizeQ]; + // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + //bool changeCell = false; + // unsigned int KQK = k_Q[k]; + // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + //if( q_dirW[k] > c0o1 || q_dirS[k] > c0o1 || q_dirB[k] > c0o1 ) { + // KQK = neighborWSB[KQK]; + // changeCell = true; + //} + //if( q_dirW[k] == c0o1 && changeCell == true ) { + // KQK = neighborX[KQK]; + //} + //if( q_dirS[k] == c0o1 && changeCell == true ) { + // KQK = neighborY[KQK]; + //} + //if( q_dirB[k] == c0o1 && changeCell == true ) { + // KQK = neighborZ[KQK]; + //} + + ////for(int i = 0; i < numberOfParticles; i++){ + //// //push back? + ////} + + // //////////////////////////////////////////////////////////////////////////////// + // //index + // //unsigned int KQK = k_Q[k]; + // unsigned int kzero= KQK; + // unsigned int ke = KQK; + // unsigned int kw = neighborX[KQK]; + // unsigned int kn = KQK; + // unsigned int ks = neighborY[KQK]; + // unsigned int kt = KQK; + // unsigned int kb = neighborZ[KQK]; + // unsigned int ksw = neighborY[kw]; + // unsigned int kne = KQK; + // unsigned int kse = ks; + // unsigned int knw = kw; + // unsigned int kbw = neighborZ[kw]; + // unsigned int kte = KQK; + // unsigned int kbe = kb; + // unsigned int ktw = kw; + // unsigned int kbs = neighborZ[ks]; + // unsigned int ktn = KQK; + // unsigned int kbn = kb; + // unsigned int kts = ks; + // unsigned int ktse = ks; + // unsigned int kbnw = kbw; + // unsigned int ktnw = kw; + // unsigned int kbse = kbs; + // unsigned int ktsw = ksw; + // unsigned int kbne = kb; + // unsigned int ktne = KQK; + // unsigned int kbsw = neighborZ[ksw]; + // //////////////////////////////////////////////////////////////////////////////// + // real f_W = (D.f[dirE ])[ke ]; + // real f_E = (D.f[dirW ])[kw ]; + // real f_S = (D.f[dirN ])[kn ]; + // real f_N = (D.f[dirS ])[ks ]; + // real f_B = (D.f[dirT ])[kt ]; + // real f_T = (D.f[dirB ])[kb ]; + // real f_SW = (D.f[dirNE ])[kne ]; + // real f_NE = (D.f[dirSW ])[ksw ]; + // real f_NW = (D.f[dirSE ])[kse ]; + // real f_SE = (D.f[dirNW ])[knw ]; + // real f_BW = (D.f[dirTE ])[kte ]; + // real f_TE = (D.f[dirBW ])[kbw ]; + // real f_TW = (D.f[dirBE ])[kbe ]; + // real f_BE = (D.f[dirTW ])[ktw ]; + // real f_BS = (D.f[dirTN ])[ktn ]; + // real f_TN = (D.f[dirBS ])[kbs ]; + // real f_TS = (D.f[dirBN ])[kbn ]; + // real f_BN = (D.f[dirTS ])[kts ]; + // real f_BSW = (D.f[dirTNE ])[ktne ]; + // real f_BNE = (D.f[dirTSW ])[ktsw ]; + // real f_BNW = (D.f[dirTSE ])[ktse ]; + // real f_BSE = (D.f[dirTNW ])[ktnw ]; + // real f_TSW = (D.f[dirBNE ])[kbne ]; + // real f_TNE = (D.f[dirBSW ])[kbsw ]; + // real f_TNW = (D.f[dirBSE ])[kbse ]; + // real f_TSE = (D.f[dirBNW ])[kbnw ]; + // //////////////////////////////////////////////////////////////////////////////// + // // real feq, q; + // real vx1, vx2, vx3, drho; + // drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + + // f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + + // f_T + f_B + f_N + f_S + f_E + f_W + ((D.f[dirZERO])[kzero]); + + // vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + + // ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + + // (f_E - f_W)) / (c1o1 + drho); + // + + // vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + + // ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + + // (f_N - f_S)) / (c1o1 + drho); + + // vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + + // (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + + // (f_T - f_B)) / (c1o1 + drho); + + // //real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3) * (c1o1 + drho); + + // ////////////////////////////////////////////////////////////////////////// + // if (evenOrOdd==false) + // { + // D.f[dirE ] = &DD[dirE *size_Mat]; + // D.f[dirW ] = &DD[dirW *size_Mat]; + // D.f[dirN ] = &DD[dirN *size_Mat]; + // D.f[dirS ] = &DD[dirS *size_Mat]; + // D.f[dirT ] = &DD[dirT *size_Mat]; + // D.f[dirB ] = &DD[dirB *size_Mat]; + // D.f[dirNE ] = &DD[dirNE *size_Mat]; + // D.f[dirSW ] = &DD[dirSW *size_Mat]; + // D.f[dirSE ] = &DD[dirSE *size_Mat]; + // D.f[dirNW ] = &DD[dirNW *size_Mat]; + // D.f[dirTE ] = &DD[dirTE *size_Mat]; + // D.f[dirBW ] = &DD[dirBW *size_Mat]; + // D.f[dirBE ] = &DD[dirBE *size_Mat]; + // D.f[dirTW ] = &DD[dirTW *size_Mat]; + // D.f[dirTN ] = &DD[dirTN *size_Mat]; + // D.f[dirBS ] = &DD[dirBS *size_Mat]; + // D.f[dirBN ] = &DD[dirBN *size_Mat]; + // D.f[dirTS ] = &DD[dirTS *size_Mat]; + // D.f[dirZERO] = &DD[dirZERO*size_Mat]; + // D.f[dirTNE ] = &DD[dirTNE *size_Mat]; + // D.f[dirTSW ] = &DD[dirTSW *size_Mat]; + // D.f[dirTSE ] = &DD[dirTSE *size_Mat]; + // D.f[dirTNW ] = &DD[dirTNW *size_Mat]; + // D.f[dirBNE ] = &DD[dirBNE *size_Mat]; + // D.f[dirBSW ] = &DD[dirBSW *size_Mat]; + // D.f[dirBSE ] = &DD[dirBSE *size_Mat]; + // D.f[dirBNW ] = &DD[dirBNW *size_Mat]; + // } + // else + // { + // D.f[dirW ] = &DD[dirE *size_Mat]; + // D.f[dirE ] = &DD[dirW *size_Mat]; + // D.f[dirS ] = &DD[dirN *size_Mat]; + // D.f[dirN ] = &DD[dirS *size_Mat]; + // D.f[dirB ] = &DD[dirT *size_Mat]; + // D.f[dirT ] = &DD[dirB *size_Mat]; + // D.f[dirSW ] = &DD[dirNE *size_Mat]; + // D.f[dirNE ] = &DD[dirSW *size_Mat]; + // D.f[dirNW ] = &DD[dirSE *size_Mat]; + // D.f[dirSE ] = &DD[dirNW *size_Mat]; + // D.f[dirBW ] = &DD[dirTE *size_Mat]; + // D.f[dirTE ] = &DD[dirBW *size_Mat]; + // D.f[dirTW ] = &DD[dirBE *size_Mat]; + // D.f[dirBE ] = &DD[dirTW *size_Mat]; + // D.f[dirBS ] = &DD[dirTN *size_Mat]; + // D.f[dirTN ] = &DD[dirBS *size_Mat]; + // D.f[dirTS ] = &DD[dirBN *size_Mat]; + // D.f[dirBN ] = &DD[dirTS *size_Mat]; + // D.f[dirZERO] = &DD[dirZERO*size_Mat]; + // D.f[dirTNE ] = &DD[dirBSW *size_Mat]; + // D.f[dirTSW ] = &DD[dirBNE *size_Mat]; + // D.f[dirTSE ] = &DD[dirBNW *size_Mat]; + // D.f[dirTNW ] = &DD[dirBSE *size_Mat]; + // D.f[dirBNE ] = &DD[dirTSW *size_Mat]; + // D.f[dirBSW ] = &DD[dirTNE *size_Mat]; + // D.f[dirBSE ] = &DD[dirTNW *size_Mat]; + // D.f[dirBNW ] = &DD[dirTSE *size_Mat]; + // } + //} } -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/VirtualFluids_GPU/GPU/PressBCs27.cu b/src/gpu/VirtualFluids_GPU/GPU/PressBCs27.cu index d60aecd5c850d557f6001ffb0d36d11a4682b99e..149daf632f2e1a1ece46c0524228d157658745af 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/PressBCs27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/PressBCs27.cu @@ -170,7 +170,7 @@ extern "C" __global__ void QInflowScaleByPressDevice27( real* rhoBC, real f1_BS = (D.f[dirBS ])[k1bs ]; real f1_BN = (D.f[dirBN ])[k1bn ]; real f1_TS = (D.f[dirTS ])[k1ts ]; - real f1_ZERO = (D.f[dirZERO])[k1zero]; + //real f1_ZERO = (D.f[dirZERO])[k1zero]; real f1_TNE = (D.f[dirTNE ])[k1tne ]; real f1_TSW = (D.f[dirTSW ])[k1tsw ]; real f1_TSE = (D.f[dirTSE ])[k1tse ]; @@ -198,7 +198,7 @@ extern "C" __global__ void QInflowScaleByPressDevice27( real* rhoBC, real f_BS = (D.f[dirBS ])[kbs ]; real f_BN = (D.f[dirBN ])[kbn ]; real f_TS = (D.f[dirTS ])[kts ]; - real f_ZERO = (D.f[dirZERO])[kzero]; + //real f_ZERO = (D.f[dirZERO])[kzero]; real f_TNE = (D.f[dirTNE ])[ktne ]; real f_TSW = (D.f[dirTSW ])[ktsw ]; real f_TSE = (D.f[dirTSE ])[ktse ]; @@ -208,7 +208,8 @@ extern "C" __global__ void QInflowScaleByPressDevice27( real* rhoBC, real f_BSE = (D.f[dirBSE ])[kbse ]; real f_BNW = (D.f[dirBNW ])[kbnw ]; ////////////////////////////////////////////////////////////////////////// - real vx1, vx2, vx3, drho, drho1; + // real vx1, vx2, vx3; + real drho, drho1; ////////////////////////////////////////////////////////////////////////// //Dichte drho1 = f1_TSE + f1_TNW + f1_TNE + f1_TSW + f1_BSE + f1_BNW + f1_BNE + f1_BSW + @@ -2856,7 +2857,7 @@ extern "C" __global__ void QPressNoRhoDevice27( real* rhoBC, //////////////////////////////////////////////////////////////////////////////// //index unsigned int KQK = k_Q[k]; - unsigned int kzero= KQK; + //unsigned int kzero= KQK; unsigned int ke = KQK; unsigned int kw = neighborX[KQK]; unsigned int kn = KQK; @@ -2886,7 +2887,7 @@ extern "C" __global__ void QPressNoRhoDevice27( real* rhoBC, //////////////////////////////////////////////////////////////////////////////// //index1 unsigned int K1QK = k_N[k]; - unsigned int k1zero= K1QK; + //unsigned int k1zero= K1QK; unsigned int k1e = K1QK; unsigned int k1w = neighborX[K1QK]; unsigned int k1n = K1QK; @@ -2994,7 +2995,7 @@ extern "C" __global__ void QPressNoRhoDevice27( real* rhoBC, real f1_BS = (D.f[dirBS ])[k1bs ]; real f1_BN = (D.f[dirBN ])[k1bn ]; real f1_TS = (D.f[dirTS ])[k1ts ]; - real f1_ZERO = (D.f[dirZERO])[k1zero]; + //real f1_ZERO = (D.f[dirZERO])[k1zero]; real f1_TNE = (D.f[dirTNE ])[k1tne ]; real f1_TSW = (D.f[dirTSW ])[k1tsw ]; real f1_TSE = (D.f[dirTSE ])[k1tse ]; @@ -3022,7 +3023,7 @@ extern "C" __global__ void QPressNoRhoDevice27( real* rhoBC, real f_BS = (D.f[dirBS ])[kbs ]; real f_BN = (D.f[dirBN ])[kbn ]; real f_TS = (D.f[dirTS ])[kts ]; - real f_ZERO = (D.f[dirZERO])[kzero]; + //real f_ZERO = (D.f[dirZERO])[kzero]; real f_TNE = (D.f[dirTNE ])[ktne ]; real f_TSW = (D.f[dirTSW ])[ktsw ]; real f_TSE = (D.f[dirTSE ])[ktse ]; @@ -3034,15 +3035,15 @@ extern "C" __global__ void QPressNoRhoDevice27( real* rhoBC, ////////////////////////////////////////////////////////////////////////// //real vx1, vx2, vx3, drho; - real vx1, vx2, vx3, drho, drho1; + //real vx1, vx2, vx3, drho, drho1; ////////////////////////////////////////////////////////////////////////// //Dichte - drho1 = f1_TSE + f1_TNW + f1_TNE + f1_TSW + f1_BSE + f1_BNW + f1_BNE + f1_BSW + - f1_BN + f1_TS + f1_TN + f1_BS + f1_BE + f1_TW + f1_TE + f1_BW + f1_SE + f1_NW + f1_NE + f1_SW + - f1_T + f1_B + f1_N + f1_S + f1_E + f1_W + ((D.f[dirZERO])[k1zero]); - drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + - f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + - f_T + f_B + f_N + f_S + f_E + f_W + ((D.f[dirZERO])[kzero]); + // drho1 = f1_TSE + f1_TNW + f1_TNE + f1_TSW + f1_BSE + f1_BNW + f1_BNE + f1_BSW + + // f1_BN + f1_TS + f1_TN + f1_BS + f1_BE + f1_TW + f1_TE + f1_BW + f1_SE + f1_NW + f1_NE + f1_SW + + // f1_T + f1_B + f1_N + f1_S + f1_E + f1_W + ((D.f[dirZERO])[k1zero]); + // drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + + // f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + + // f_T + f_B + f_N + f_S + f_E + f_W + ((D.f[dirZERO])[kzero]); ////////////////////////////////////////////////////////////////////////// //Ux @@ -3067,7 +3068,7 @@ extern "C" __global__ void QPressNoRhoDevice27( real* rhoBC, ////real omega = om1; // real cusq = c3o2*(vx1*vx1+vx2*vx2+vx3*vx3); // ////////////////////////////////////////////////////////////////////////// - ////Täst MK + ////T�st MK ////if(vx1 < zero) vx1 = zero; // ////////////////////////////////////////////////////////////////////////// // real fZERO = c8over27* (drho1-(one + drho1)*(cusq)) ; @@ -3753,34 +3754,34 @@ extern "C" __global__ void QPressDeviceEQZ27(real* rhoBC, D.f[dirBNW ] = &DD[dirTSE *size_Mat]; } //////////////////////////////////////////////////////////////////////////////// - Distributions27 kDistTest; - kDistTest.f[dirE ] = &kTestRE[dirE *kQ]; - kDistTest.f[dirW ] = &kTestRE[dirW *kQ]; - kDistTest.f[dirN ] = &kTestRE[dirN *kQ]; - kDistTest.f[dirS ] = &kTestRE[dirS *kQ]; - kDistTest.f[dirT ] = &kTestRE[dirT *kQ]; - kDistTest.f[dirB ] = &kTestRE[dirB *kQ]; - kDistTest.f[dirNE ] = &kTestRE[dirNE *kQ]; - kDistTest.f[dirSW ] = &kTestRE[dirSW *kQ]; - kDistTest.f[dirSE ] = &kTestRE[dirSE *kQ]; - kDistTest.f[dirNW ] = &kTestRE[dirNW *kQ]; - kDistTest.f[dirTE ] = &kTestRE[dirTE *kQ]; - kDistTest.f[dirBW ] = &kTestRE[dirBW *kQ]; - kDistTest.f[dirBE ] = &kTestRE[dirBE *kQ]; - kDistTest.f[dirTW ] = &kTestRE[dirTW *kQ]; - kDistTest.f[dirTN ] = &kTestRE[dirTN *kQ]; - kDistTest.f[dirBS ] = &kTestRE[dirBS *kQ]; - kDistTest.f[dirBN ] = &kTestRE[dirBN *kQ]; - kDistTest.f[dirTS ] = &kTestRE[dirTS *kQ]; - kDistTest.f[dirZERO] = &kTestRE[dirZERO*kQ]; - kDistTest.f[dirTNE ] = &kTestRE[dirTNE *kQ]; - kDistTest.f[dirTSW ] = &kTestRE[dirTSW *kQ]; - kDistTest.f[dirTSE ] = &kTestRE[dirTSE *kQ]; - kDistTest.f[dirTNW ] = &kTestRE[dirTNW *kQ]; - kDistTest.f[dirBNE ] = &kTestRE[dirBNE *kQ]; - kDistTest.f[dirBSW ] = &kTestRE[dirBSW *kQ]; - kDistTest.f[dirBSE ] = &kTestRE[dirBSE *kQ]; - kDistTest.f[dirBNW ] = &kTestRE[dirBNW *kQ]; + // Distributions27 kDistTest; + // kDistTest.f[dirE ] = &kTestRE[dirE *kQ]; + // kDistTest.f[dirW ] = &kTestRE[dirW *kQ]; + // kDistTest.f[dirN ] = &kTestRE[dirN *kQ]; + // kDistTest.f[dirS ] = &kTestRE[dirS *kQ]; + // kDistTest.f[dirT ] = &kTestRE[dirT *kQ]; + // kDistTest.f[dirB ] = &kTestRE[dirB *kQ]; + // kDistTest.f[dirNE ] = &kTestRE[dirNE *kQ]; + // kDistTest.f[dirSW ] = &kTestRE[dirSW *kQ]; + // kDistTest.f[dirSE ] = &kTestRE[dirSE *kQ]; + // kDistTest.f[dirNW ] = &kTestRE[dirNW *kQ]; + // kDistTest.f[dirTE ] = &kTestRE[dirTE *kQ]; + // kDistTest.f[dirBW ] = &kTestRE[dirBW *kQ]; + // kDistTest.f[dirBE ] = &kTestRE[dirBE *kQ]; + // kDistTest.f[dirTW ] = &kTestRE[dirTW *kQ]; + // kDistTest.f[dirTN ] = &kTestRE[dirTN *kQ]; + // kDistTest.f[dirBS ] = &kTestRE[dirBS *kQ]; + // kDistTest.f[dirBN ] = &kTestRE[dirBN *kQ]; + // kDistTest.f[dirTS ] = &kTestRE[dirTS *kQ]; + // kDistTest.f[dirZERO] = &kTestRE[dirZERO*kQ]; + // kDistTest.f[dirTNE ] = &kTestRE[dirTNE *kQ]; + // kDistTest.f[dirTSW ] = &kTestRE[dirTSW *kQ]; + // kDistTest.f[dirTSE ] = &kTestRE[dirTSE *kQ]; + // kDistTest.f[dirTNW ] = &kTestRE[dirTNW *kQ]; + // kDistTest.f[dirBNE ] = &kTestRE[dirBNE *kQ]; + // kDistTest.f[dirBSW ] = &kTestRE[dirBSW *kQ]; + // kDistTest.f[dirBSE ] = &kTestRE[dirBSE *kQ]; + // kDistTest.f[dirBNW ] = &kTestRE[dirBNW *kQ]; // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // //real f1_E,f1_W,f1_N,f1_S,f1_T,f1_B,f1_NE,f1_SW,f1_SE,f1_NW,f1_TE,f1_BW,f1_BE,f1_TW,f1_TN,f1_BS,f1_BN,f1_TS,f1_ZERO,f1_TNE,f1_TSW,f1_TSE,f1_TNW,f1_BNE,f1_BSW,f1_BSE,f1_BNW; // //f1_W = (D.f[dirE ])[k1e ]; @@ -3852,7 +3853,7 @@ extern "C" __global__ void QPressDeviceEQZ27(real* rhoBC, ////real omega = om1; // real cusq = c3o2*(vx1*vx1+vx2*vx2+vx3*vx3); // ////////////////////////////////////////////////////////////////////////// - ////Täst MK + ////T�st MK ////if(vx1 < zero) vx1 = zero; // ////////////////////////////////////////////////////////////////////////// ////becomes higher with neighbor source and lower with local source diff --git a/src/gpu/VirtualFluids_GPU/GPU/ScaleCF27.cu b/src/gpu/VirtualFluids_GPU/GPU/ScaleCF27.cu index 76d07fb26bf5fe692b3654752e71f6acac95bc1e..43f06fb0f8dce6c5983f0123a49d73111bad396a 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/ScaleCF27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/ScaleCF27.cu @@ -155,7 +155,8 @@ extern "C" __global__ void scaleCF_0817_comp_27( real* DC, real xoff, yoff, zoff; real xoff_sq, yoff_sq, zoff_sq; - real vvx, vvy, vvz, vx2, vy2, vz2, drho; + // real drho; + real vvx, vvy, vvz, vx2, vy2, vz2; real press;//,drho,vx1,vx2,vx3; real /*pressMMP,*/drhoMMP,vx1MMP,vx2MMP,vx3MMP; real /*pressMPP,*/drhoMPP,vx1MPP,vx2MPP,vx3MPP; @@ -718,6 +719,7 @@ extern "C" __global__ void scaleCF_0817_comp_27( real* DC, dxy = ( ((drhoPPM - drhoPMP) + (drhoPPP - drhoPMM)) + ((drhoMMP - drhoMPM) + (drhoMMM - drhoMPP))) * c1o2; dxz = ( ((drhoMMM - drhoPPM) + (drhoPPP - drhoMMP)) + ((drhoMPM - drhoPMM) + (drhoPMP - drhoMPP))) * c1o2; dyz = ( ((drhoMPP - drhoPPM) + (drhoPPP - drhoMPM)) + ((drhoPMM - drhoMMP) + (drhoMMM - drhoPMP))) * c1o2; + dxyz = -drhoPPM + drhoPPP + drhoMPM - drhoMPP + drhoPMM - drhoPMP - drhoMMM + drhoMMP; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Bernd das Brot @@ -813,6 +815,7 @@ extern "C" __global__ void scaleCF_0817_comp_27( real* DC, // drho_NWB * (c9o64 + c3o16 * xoff - c9o16 * yoff + c3o16 * zoff) + // drho_SEB * (c9o64 - c9o16 * xoff + c3o16 * yoff + c3o16 * zoff) + // drho_SWB * (c27o64 + c9o16 * xoff + c9o16 * yoff + c9o16 * zoff); + press = d0 + x*dx + y*dy + z*dz + x*y*dxy + x*z*dxz + y*z*dyz + x*y*z*dxyz; vvx = (a0 + x*ax + y*ay + z*az + x*x*axx + y*y*ayy + z*z*azz + x*y*axy + x*z*axz + y*z*ayz + x*y*z*axyz); vvy = (b0 + x*bx + y*by + z*bz + x*x*bxx + y*y*byy + z*z*bzz + x*y*bxy + x*z*bxz + y*z*byz + x*y*z*bxyz); @@ -4240,23 +4243,23 @@ extern "C" __global__ void scaleCF_AA2016_comp_27(real* DC, real x,y,z; ////////////////////////////////////////////////////////////////////////////////////// real mfcbb, mfabb, mfbcb, mfbab, mfbbc, mfbba, mfccb, mfaab, mfcab, mfacb, mfcbc, mfaba, mfcba, mfabc, mfbcc, mfbaa, mfbca, mfbac, mfbbb, mfccc, mfaac, mfcac, mfacc, mfcca, mfaaa, mfcaa, mfaca; - real wadjust; - real qudricLimitP = 0.01f;// * 0.0001f; - real qudricLimitM = 0.01f;// * 0.0001f; - real qudricLimitD = 0.01f;// * 0.001f; - real omega = omCoarse; + //real wadjust; + //real qudricLimitP = 0.01f;// * 0.0001f; + //real qudricLimitM = 0.01f;// * 0.0001f; + //real qudricLimitD = 0.01f;// * 0.001f; + //real omega = omCoarse; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real m0, m1, m2, vvx, vvy, vvz, vx2, vy2, vz2, oMdrho; real mxxPyyPzz, mxxMyy, mxxMzz, mxxyPyzz, mxxyMyzz, mxxzPyyz, mxxzMyyz, mxyyPxzz, mxyyMxzz; real NeqOn = c1o1; real drho, rho; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real OxxPyyPzz; - real OxyyPxzz; - real OxyyMxzz; - real Oxyz ; - real O4, O5, O6; - real CUMcbb, CUMbcb, CUMbbc, CUMcca, CUMcac, CUMacc, CUMbcc, CUMcbc, CUMccb, CUMccc; + //real OxxPyyPzz; + //real OxyyPxzz; + //real OxyyMxzz; + //real Oxyz ; + //real O4, O5, O6; + //real CUMcbb, CUMbcb, CUMbbc, CUMcca, CUMcac, CUMacc, CUMbcc, CUMcbc, CUMccb, CUMccc; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -11123,23 +11126,23 @@ extern "C" __global__ void scaleCF_RhoSq_3rdMom_comp_27(real* DC, real x,y,z; ////////////////////////////////////////////////////////////////////////////////////// real mfcbb, mfabb, mfbcb, mfbab, mfbbc, mfbba, mfccb, mfaab, mfcab, mfacb, mfcbc, mfaba, mfcba, mfabc, mfbcc, mfbaa, mfbca, mfbac, mfbbb, mfccc, mfaac, mfcac, mfacc, mfcca, mfaaa, mfcaa, mfaca; - real wadjust; - real qudricLimitP = 0.01f;// * 0.0001f; - real qudricLimitM = 0.01f;// * 0.0001f; - real qudricLimitD = 0.01f;// * 0.001f; - real omega = omCoarse; + //real wadjust; + //real qudricLimitP = 0.01f;// * 0.0001f; + //real qudricLimitM = 0.01f;// * 0.0001f; + //real qudricLimitD = 0.01f;// * 0.001f; + //real omega = omCoarse; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real m0, m1, m2, vvx, vvy, vvz, vx2, vy2, vz2, oMdrho; real mxxPyyPzz, mxxMyy, mxxMzz, mxxyPyzz, mxxyMyzz, mxxzPyyz, mxxzMyyz, mxyyPxzz, mxyyMxzz; real NeqOn = c1o1; real drho, rho; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real OxxPyyPzz; - real OxyyPxzz; - real OxyyMxzz; - real Oxyz ; - real O4, O5, O6; - real CUMcbb, CUMbcb, CUMbbc, CUMcca, CUMcac, CUMacc, CUMbcc, CUMcbc, CUMccb, CUMccc; + //real OxxPyyPzz; + //real OxyyPxzz; + //real OxyyMxzz; + //real Oxyz ; + //real O4, O5, O6; + //real CUMcbb, CUMbcb, CUMbbc, CUMcca, CUMcac, CUMacc, CUMbcc, CUMcbc, CUMccb, CUMccc; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -26459,7 +26462,8 @@ extern "C" __global__ void scaleCF_Fix_comp_27( real* DC, real xoff, yoff, zoff; real xoff_sq, yoff_sq, zoff_sq; - real vvx, vvy, vvz, vx2, vy2, vz2, drho; + //real dhro; + real vvx, vvy, vvz, vx2, vy2, vz2; real press;//,drho,vx1,vx2,vx3; real /*press_SWT,*/drho_SWT,vx1_SWT,vx2_SWT,vx3_SWT; real /*press_NWT,*/drho_NWT,vx1_NWT,vx2_NWT,vx3_NWT; @@ -27674,7 +27678,7 @@ extern "C" __global__ void scaleCF_Fix_comp_27( real* DC, //dxy = ( drho_NEB + drho_NET - drho_NWB - drho_NWT - drho_SEB - drho_SET + drho_SWB + drho_SWT) * c1o2; //dxz = (-drho_NEB + drho_NET + drho_NWB - drho_NWT - drho_SEB + drho_SET + drho_SWB - drho_SWT) * c1o2; //dyz = (-drho_NEB + drho_NET - drho_NWB + drho_NWT + drho_SEB - drho_SET + drho_SWB - drho_SWT) * c1o2; - //dxyz = -drho_NEB + drho_NET + drho_NWB - drho_NWT + drho_SEB - drho_SET - drho_SWB + drho_SWT; + dxyz = -drho_NEB + drho_NET + drho_NWB - drho_NWT + drho_SEB - drho_SET - drho_SWB + drho_SWT; // d0 = zero; //dx = zero; //dy = zero; @@ -27820,6 +27824,7 @@ extern "C" __global__ void scaleCF_Fix_comp_27( real* DC, // drho_NWB * (c9o64 + c3o16 * xoff - c9o16 * yoff + c3o16 * zoff) + // drho_SEB * (c9o64 - c9o16 * xoff + c3o16 * yoff + c3o16 * zoff) + // drho_SWB * (c27o64 + c9o16 * xoff + c9o16 * yoff + c9o16 * zoff); + press = d0 + x*dx + y*dy + z*dz + x*y*dxy + x*z*dxz + y*z*dyz + x*y*z*dxyz; vvx = (a0 + x*ax + y*ay + z*az + x*x*axx + y*y*ayy + z*z*azz + x*y*axy + x*z*axz + y*z*ayz + x*y*z*axyz); vvy = (b0 + x*bx + y*by + z*bz + x*x*bxx + y*y*byy + z*z*bzz + x*y*bxy + x*z*bxz + y*z*byz + x*y*z*bxyz); @@ -43368,8 +43373,8 @@ extern "C" __global__ void scaleCFThSMG7( real* DC, //real omegaD_C = two / (six * diffusivity_fine/two + one); //real omegaD_F = two / (six * diffusivity_fine + one); - real omegaD_C = c3o1 - sqrt(c3o1); //Quick and Dörrrty - real omegaD_F = c3o1 - sqrt(c3o1); //Quick and Dörrrty + real omegaD_C = c3o1 - sqrt(c3o1); //Quick and D�rrrty + real omegaD_F = c3o1 - sqrt(c3o1); //Quick and D�rrrty real Lam = -(c1o2-c1o1/omegaD_C); real nue_d = Lam/c3o1; //real ae = zero; @@ -44590,8 +44595,8 @@ extern "C" __global__ void scaleCFThS7( real* DC, //real omegaD_C = two / (six * diffusivity_fine/two + one); //real omegaD_F = two / (six * diffusivity_fine + one); - real omegaD_C = c3o1 - sqrt(c3o1); //Quick and Dörrrty - real omegaD_F = c3o1 - sqrt(c3o1); //Quick and Dörrrty + real omegaD_C = c3o1 - sqrt(c3o1); //Quick and D�rrrty + real omegaD_F = c3o1 - sqrt(c3o1); //Quick and D�rrrty real Lam = -(c1o2-c1o1/omegaD_C); real nue_d = Lam/c3o1; //real ae = zero; @@ -45770,7 +45775,7 @@ extern "C" __global__ void scaleCFThS27( real* DC, real f27E,f27W,f27N,f27S,f27T,f27B,f27NE,f27SW,f27SE,f27NW,f27TE,f27BW,f27BE,f27TW,f27TN,f27BS,f27BN,f27TS,f27ZERO,f27TNE,f27TSW,f27TSE,f27TNW,f27BNE,f27BSW,f27BSE,f27BNW; real Mx,My,Mz/*,Mxx,Myy,Mzz,M0*/; real Conc_C_SWB, Conc_C_SWT, Conc_C_SET, Conc_C_SEB, Conc_C_NWB, Conc_C_NWT, Conc_C_NET, Conc_C_NEB; - real Conc_F_SWB, Conc_F_SWT, Conc_F_SET, Conc_F_SEB, Conc_F_NWB, Conc_F_NWT, Conc_F_NET, Conc_F_NEB; + //real Conc_F_SWB, Conc_F_SWT, Conc_F_SET, Conc_F_SEB, Conc_F_NWB, Conc_F_NWT, Conc_F_NET, Conc_F_NEB; real omegaD_C = c2o1 / (c6o1 * diffusivity_fine/c2o1 + c1o1); real omegaD_F = c2o1 / (c6o1 * diffusivity_fine + c1o1); diff --git a/src/gpu/VirtualFluids_GPU/GPU/ScaleCF_F3_27.cu b/src/gpu/VirtualFluids_GPU/GPU/ScaleCF_F3_27.cu index afec3d0bfcaed0b31bdaf23bfa47683fec331db0..0b4c4aae603c714756546ae29b0865840ea62774 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/ScaleCF_F3_27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/ScaleCF_F3_27.cu @@ -165,7 +165,8 @@ extern "C" __global__ void scaleCF_comp_D3Q27F3_2018(real* DC, real xoff, yoff, zoff; real xoff_sq, yoff_sq, zoff_sq; - real vvx, vvy, vvz, vx2, vy2, vz2, drho; + // real drho; + real vvx, vvy, vvz, vx2, vy2, vz2; real press;//,drho,vx1,vx2,vx3; real /*pressMMP,*/drhoMMP,vx1MMP,vx2MMP,vx3MMP; real /*pressMPP,*/drhoMPP,vx1MPP,vx2MPP,vx3MPP; @@ -728,6 +729,7 @@ extern "C" __global__ void scaleCF_comp_D3Q27F3_2018(real* DC, dxy = ( ((drhoPPM - drhoPMP) + (drhoPPP - drhoPMM)) + ((drhoMMP - drhoMPM) + (drhoMMM - drhoMPP))) * c1o2; dxz = ( ((drhoMMM - drhoPPM) + (drhoPPP - drhoMMP)) + ((drhoMPM - drhoPMM) + (drhoPMP - drhoMPP))) * c1o2; dyz = ( ((drhoMPP - drhoPPM) + (drhoPPP - drhoMPM)) + ((drhoPMM - drhoMMP) + (drhoMMM - drhoPMP))) * c1o2; + dxyz = -drhoPPM + drhoPPP + drhoMPM - drhoMPP + drhoPMM - drhoPMP - drhoMMM + drhoMMP; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Bernd das Brot @@ -833,6 +835,7 @@ extern "C" __global__ void scaleCF_comp_D3Q27F3_2018(real* DC, // drho_NWB * (c9o64 + c3o16 * xoff - c9o16 * yoff + c3o16 * zoff) + // drho_SEB * (c9o64 - c9o16 * xoff + c3o16 * yoff + c3o16 * zoff) + // drho_SWB * (c27o64 + c9o16 * xoff + c9o16 * yoff + c9o16 * zoff); + press = d0 + x*dx + y*dy + z*dz + x*y*dxy + x*z*dxz + y*z*dyz + x*y*z*dxyz; vvx = (a0 + x*ax + y*ay + z*az + x*x*axx + y*y*ayy + z*z*azz + x*y*axy + x*z*axz + y*z*ayz + x*y*z*axyz); vvy = (b0 + x*bx + y*by + z*bz + x*x*bxx + y*y*byy + z*z*bzz + x*y*bxy + x*z*bxz + y*z*byz + x*y*z*bxyz); @@ -4509,7 +4512,8 @@ extern "C" __global__ void scaleCF_comp_D3Q27F3( real* DC, real xoff, yoff, zoff; real xoff_sq, yoff_sq, zoff_sq; - real vvx, vvy, vvz, vx2, vy2, vz2, drho; + // real drho; + real vvx, vvy, vvz, vx2, vy2, vz2; real press;//,drho,vx1,vx2,vx3; real /*pressMMP,*/drhoMMP,vx1MMP,vx2MMP,vx3MMP; real /*pressMPP,*/drhoMPP,vx1MPP,vx2MPP,vx3MPP; @@ -5072,6 +5076,7 @@ extern "C" __global__ void scaleCF_comp_D3Q27F3( real* DC, dxy = ( ((drhoPPM - drhoPMP) + (drhoPPP - drhoPMM)) + ((drhoMMP - drhoMPM) + (drhoMMM - drhoMPP))) * c1o2; dxz = ( ((drhoMMM - drhoPPM) + (drhoPPP - drhoMMP)) + ((drhoMPM - drhoPMM) + (drhoPMP - drhoMPP))) * c1o2; dyz = ( ((drhoMPP - drhoPPM) + (drhoPPP - drhoMPM)) + ((drhoPMM - drhoMMP) + (drhoMMM - drhoPMP))) * c1o2; + dxyz = -drhoPPM + drhoPPP + drhoMPM - drhoMPP + drhoPMM - drhoPMP - drhoMMM + drhoMMP; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Bernd das Brot @@ -5174,6 +5179,7 @@ extern "C" __global__ void scaleCF_comp_D3Q27F3( real* DC, // drho_NWB * (c9o64 + c3o16 * xoff - c9o16 * yoff + c3o16 * zoff) + // drho_SEB * (c9o64 - c9o16 * xoff + c3o16 * yoff + c3o16 * zoff) + // drho_SWB * (c27o64 + c9o16 * xoff + c9o16 * yoff + c9o16 * zoff); + press = d0 + x*dx + y*dy + z*dz + x*y*dxy + x*z*dxz + y*z*dyz + x*y*z*dxyz; vvx = (a0 + x*ax + y*ay + z*az + x*x*axx + y*y*ayy + z*z*azz + x*y*axy + x*z*axz + y*z*ayz + x*y*z*axyz); vvy = (b0 + x*bx + y*by + z*bz + x*x*bxx + y*y*byy + z*z*bzz + x*y*bxy + x*z*bxz + y*z*byz + x*y*z*bxyz); diff --git a/src/gpu/VirtualFluids_GPU/GPU/ScaleFC27.cu b/src/gpu/VirtualFluids_GPU/GPU/ScaleFC27.cu index f20da3b376de2ba34d40b53673958272d045e281..4b085a7d6ba9cd2e509adf8ff89fa6cc84664cbf 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/ScaleFC27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/ScaleFC27.cu @@ -154,7 +154,8 @@ extern "C" __global__ void scaleFC_0817_comp_27( real* DC, real xoff, yoff, zoff; real xoff_sq, yoff_sq, zoff_sq; - real vvx, vvy, vvz, vx2, vy2, vz2, drho; + //real drho; + real vvx, vvy, vvz, vx2, vy2, vz2; real press;//,drho,vx1,vx2,vx3; real /*pressMMM,*/drhoMMM,vx1MMM,vx2MMM,vx3MMM; real /*pressMMP,*/drhoMMP,vx1MMP,vx2MMP,vx3MMP; @@ -770,10 +771,10 @@ extern "C" __global__ void scaleFC_0817_comp_27( real* DC, //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real m0, m1, m2, oMdrho; real mxxPyyPzz, mxxMyy, mxxMzz, mxxyPyzz, mxxyMyzz, mxxzPyyz, mxxzMyyz, mxyyPxzz, mxyyMxzz; - real qudricLimit = c1o100;//ganz schlechte Idee -> muss global sein - real O3 = c2o1 - o; - real residu, residutmp; - residutmp = c0o1;///*-*/ c2o9 * (1./o - c1o2) * eps_new * eps_new; + //real qudricLimit = c1o100;//ganz schlechte Idee -> muss global sein + //real O3 = c2o1 - o; + //real residu, residutmp; + //residutmp = c0o1;///*-*/ c2o9 * (1./o - c1o2) * eps_new * eps_new; real NeqOn = c1o1;//zero;//one; //.... one = on ..... zero = off //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1367,23 +1368,23 @@ extern "C" __global__ void scaleFC_AA2016_comp_27(real* DC, real d0, dx, dy, dz, dxy, dxz, dyz/*, dxyz*/; ////////////////////////////////////////////////////////////////////////////////////// real mfcbb, mfabb, mfbcb, mfbab, mfbbc, mfbba, mfccb, mfaab, mfcab, mfacb, mfcbc, mfaba, mfcba, mfabc, mfbcc, mfbaa, mfbca, mfbac, mfbbb, mfccc, mfaac, mfcac, mfacc, mfcca, mfaaa, mfcaa, mfaca; - real wadjust; - real qudricLimitP = 0.01f;// * 0.0001f; - real qudricLimitM = 0.01f;// * 0.0001f; - real qudricLimitD = 0.01f;// * 0.001f; - real omega = omFine; + //real wadjust; + //real qudricLimitP = 0.01f;// * 0.0001f; + //real qudricLimitM = 0.01f;// * 0.0001f; + //real qudricLimitD = 0.01f;// * 0.001f; + //real omega = omFine; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real m0, m1, m2, vvx, vvy, vvz, vx2, vy2, vz2, oMdrho; real mxxPyyPzz, mxxMyy, mxxMzz, mxxyPyzz, mxxyMyzz, mxxzPyyz, mxxzMyyz, mxyyPxzz, mxyyMxzz; real NeqOn = c1o1; real drho, rho; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real OxxPyyPzz; - real OxyyPxzz; - real OxyyMxzz; - real Oxyz ; - real O4, O5, O6; - real CUMcbb, CUMbcb, CUMbbc, CUMcca, CUMcac, CUMacc, CUMbcc, CUMcbc, CUMccb, CUMccc; + //real OxxPyyPzz; + //real OxyyPxzz; + //real OxyyMxzz; + //real Oxyz; + //real O4, O5, O6; + //real CUMcbb, CUMbcb, CUMbbc, CUMcca, CUMcac, CUMacc, CUMbcc, CUMcbc, CUMccb, CUMccc; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if(k<kFC) @@ -5556,23 +5557,23 @@ extern "C" __global__ void scaleFC_RhoSq_3rdMom_comp_27(real* DC, real d0, dx, dy, dz, dxy, dxz, dyz/*, dxyz*/; ////////////////////////////////////////////////////////////////////////////////////// real mfcbb, mfabb, mfbcb, mfbab, mfbbc, mfbba, mfccb, mfaab, mfcab, mfacb, mfcbc, mfaba, mfcba, mfabc, mfbcc, mfbaa, mfbca, mfbac, mfbbb, mfccc, mfaac, mfcac, mfacc, mfcca, mfaaa, mfcaa, mfaca; - real wadjust; - real qudricLimitP = 0.01f;// * 0.0001f; - real qudricLimitM = 0.01f;// * 0.0001f; - real qudricLimitD = 0.01f;// * 0.001f; - real omega = omFine; + //real wadjust; + //real qudricLimitP = 0.01f;// * 0.0001f; + //real qudricLimitM = 0.01f;// * 0.0001f; + //real qudricLimitD = 0.01f;// * 0.001f; + //real omega = omFine; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real m0, m1, m2, vvx, vvy, vvz, vx2, vy2, vz2, oMdrho; real mxxPyyPzz, mxxMyy, mxxMzz, mxxyPyzz, mxxyMyzz, mxxzPyyz, mxxzMyyz, mxyyPxzz, mxyyMxzz; real NeqOn = c1o1; real drho, rho; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - real OxxPyyPzz; - real OxyyPxzz; - real OxyyMxzz; - real Oxyz ; - real O4, O5, O6; - real CUMcbb, CUMbcb, CUMbbc, CUMcca, CUMcac, CUMacc, CUMbcc, CUMcbc, CUMccb, CUMccc; + //real OxxPyyPzz; + //real OxyyPxzz; + //real OxyyMxzz; + //real Oxyz; + //real O4, O5, O6; + //real CUMcbb, CUMbcb, CUMbbc, CUMcca, CUMcac, CUMacc, CUMbcc, CUMcbc, CUMccb, CUMccc; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if(k<kFC) @@ -10502,10 +10503,10 @@ extern "C" __global__ void scaleFC_RhoSq_comp_27(real* DC, //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real m0, m1, m2, vvx, vvy, vvz, vx2, vy2, vz2, oMdrho; real mxxPyyPzz, mxxMyy, mxxMzz, mxxyPyzz, mxxyMyzz, mxxzPyyz, mxxzMyyz, mxyyPxzz, mxyyMxzz; - real qudricLimit = c1o100;//ganz schlechte Idee -> muss global sein - real O3 = c2o1 - o; - real residu, residutmp; - residutmp = c0o1;///*-*/ c2o9 * (1./o - c1o2) * eps_new * eps_new; + //real qudricLimit = c1o100;//ganz schlechte Idee -> muss global sein + //real O3 = c2o1 - o; + //real residu, residutmp; + //residutmp = c0o1;///*-*/ c2o9 * (1./o - c1o2) * eps_new * eps_new; real NeqOn = c1o1;//zero;//one; //.... one = on ..... zero = off //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -13196,7 +13197,8 @@ extern "C" __global__ void scaleFC_Fix_comp_27( real* DC, real xoff, yoff, zoff; real xoff_sq, yoff_sq, zoff_sq; - real vvx, vvy, vvz, vx2, vy2, vz2, drho; + // real drho; + real vvx, vvy, vvz, vx2, vy2, vz2; real press;//,drho,vx1,vx2,vx3; real /*press_SWT,*/drho_SWT,vx1_SWT,vx2_SWT,vx3_SWT; real /*press_NWT,*/drho_NWT,vx1_NWT,vx2_NWT,vx3_NWT; @@ -14481,10 +14483,10 @@ extern "C" __global__ void scaleFC_Fix_comp_27( real* DC, //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real m0, m1, m2, oMdrho; real mxxPyyPzz, mxxMyy, mxxMzz, mxxyPyzz, mxxyMyzz, mxxzPyyz, mxxzMyyz, mxyyPxzz, mxyyMxzz; - real qudricLimit = c1o100;//ganz schlechte Idee -> muss global sein - real O3 = c2o1 - o; - real residu, residutmp; - residutmp = c0o1;///*-*/ c2o9 * (1./o - c1o2) * eps_new * eps_new; + //real qudricLimit = c1o100;//ganz schlechte Idee -> muss global sein + //real O3 = c2o1 - o; + //real residu, residutmp; + //residutmp = c0o1;///*-*/ c2o9 * (1./o - c1o2) * eps_new * eps_new; real NeqOn = c1o1;//zero;//one; //.... one = on ..... zero = off //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -19972,8 +19974,8 @@ extern "C" __global__ void scaleFCThSMG7( real* DC, //real omegaD_C = two / (six * diffusivity_coarse + one); //real omegaD_F = two / (six * diffusivity_coarse*two + one); - real omegaD_C = c3o1 - sqrt(c3o1); //Quick and Dörrrty - real omegaD_F = c3o1 - sqrt(c3o1); //Quick and Dörrrty + real omegaD_C = c3o1 - sqrt(c3o1); //Quick and D�rrrty + real omegaD_F = c3o1 - sqrt(c3o1); //Quick and D�rrrty real Lam = -(c1o2-c1o1/omegaD_C); real nue_d = Lam/c3o1; //real ae = zero; @@ -20844,8 +20846,8 @@ extern "C" __global__ void scaleFCThS7( real* DC, //real omegaD_C = two / (six * diffusivity_coarse + one); //real omegaD_F = two / (six * diffusivity_coarse*two + one); - real omegaD_C = c3o1 - sqrt(c3o1); //Quick and Dörrrty - real omegaD_F = c3o1 - sqrt(c3o1); //Quick and Dörrrty + real omegaD_C = c3o1 - sqrt(c3o1); //Quick and D�rrrty + real omegaD_F = c3o1 - sqrt(c3o1); //Quick and D�rrrty real Lam = -(c1o2-c1o1/omegaD_C); real nue_d = Lam/c3o1; //real ae = zero; @@ -21691,7 +21693,7 @@ extern "C" __global__ void scaleFCThS27( real* DC, real f27E,f27W,f27N,f27S,f27T,f27B,f27NE,f27SW,f27SE,f27NW,f27TE,f27BW,f27BE,f27TW,f27TN,f27BS,f27BN,f27TS,f27ZERO,f27TNE,f27TSW,f27TSE,f27TNW,f27BNE,f27BSW,f27BSE,f27BNW; real Mx,My,Mz/*,Mxx,Myy,Mzz,M0*/; - real Conc_C_C; + //real Conc_C_C; real Conc_F_SWB, Conc_F_SWT, Conc_F_SET, Conc_F_SEB, Conc_F_NWB, Conc_F_NWT, Conc_F_NET, Conc_F_NEB; real omegaD_C = c2o1 / (c6o1 * diffusivity_coarse + c1o1); @@ -21704,7 +21706,7 @@ extern "C" __global__ void scaleFCThS27( real* DC, //real ae = diffusivity_fine/nue_d - one; //real ae_F = (diffusivity_fine/two)/nue_d - one; - real x, y, z; + // real x, y, z; real xoff, yoff, zoff; real xoff_sq, yoff_sq, zoff_sq; diff --git a/src/gpu/VirtualFluids_GPU/GPU/ScaleFC_F3_27.cu b/src/gpu/VirtualFluids_GPU/GPU/ScaleFC_F3_27.cu index 42744480c1d9fed6350656bb875c40275d5c3464..3cccd8cb1f496f141b871cc5e5a2b244e44bd9de 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/ScaleFC_F3_27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/ScaleFC_F3_27.cu @@ -176,7 +176,8 @@ extern "C" __global__ void scaleFC_comp_D3Q27F3_2018(real* DC, real xoff, yoff, zoff; real xoff_sq, yoff_sq, zoff_sq; - real vvx, vvy, vvz, vx2, vy2, vz2, drho; + // real drho; + real vvx, vvy, vvz, vx2, vy2, vz2; real press;//,drho,vx1,vx2,vx3; real /*pressMMM,*/drhoMMM,vx1MMM,vx2MMM,vx3MMM; real /*pressMMP,*/drhoMMP,vx1MMP,vx2MMP,vx3MMP; @@ -799,10 +800,10 @@ extern "C" __global__ void scaleFC_comp_D3Q27F3_2018(real* DC, //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real m0, m1, m2, oMdrho; real mxxPyyPzz, mxxMyy, mxxMzz, mxxyPyzz, mxxyMyzz, mxxzPyyz, mxxzMyyz, mxyyPxzz, mxyyMxzz; - real qudricLimit = c1o100;//ganz schlechte Idee -> muss global sein - real O3 = c2o1 - o; - real residu, residutmp; - residutmp = c0;///*-*/ c2o9 * (1./o - c1o2) * eps_new * eps_new; + //real qudricLimit = c1o100;//ganz schlechte Idee -> muss global sein + //real O3 = c2o1 - o; + //real residu, residutmp; + //residutmp = c0;///*-*/ c2o9 * (1./o - c1o2) * eps_new * eps_new; real NeqOn = c1o1;//zero;//one; //.... one = on ..... zero = off //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1422,7 +1423,8 @@ extern "C" __global__ void scaleFC_comp_D3Q27F3( real* DC, real xoff, yoff, zoff; real xoff_sq, yoff_sq, zoff_sq; - real vvx, vvy, vvz, vx2, vy2, vz2, drho; + // real drho; + real vvx, vvy, vvz, vx2, vy2, vz2; real press;//,drho,vx1,vx2,vx3; real /*pressMMM,*/drhoMMM,vx1MMM,vx2MMM,vx3MMM; real /*pressMMP,*/drhoMMP,vx1MMP,vx2MMP,vx3MMP; @@ -2045,10 +2047,10 @@ extern "C" __global__ void scaleFC_comp_D3Q27F3( real* DC, //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real m0, m1, m2, oMdrho; real mxxPyyPzz, mxxMyy, mxxMzz, mxxyPyzz, mxxyMyzz, mxxzPyyz, mxxzMyyz, mxyyPxzz, mxyyMxzz; - real qudricLimit = c1o100;//ganz schlechte Idee -> muss global sein - real O3 = c2o1 - o; - real residu, residutmp; - residutmp = c0;///*-*/ c2o9 * (1./o - c1o2) * eps_new * eps_new; + //real qudricLimit = c1o100;//ganz schlechte Idee -> muss global sein + //real O3 = c2o1 - o; + //real residu, residutmp; + //residutmp = c0;///*-*/ c2o9 * (1./o - c1o2) * eps_new * eps_new; real NeqOn = c1o1;//zero;//one; //.... one = on ..... zero = off //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/VirtualFluids_GPU/GPU/SlipBCs27.cu b/src/gpu/VirtualFluids_GPU/GPU/SlipBCs27.cu index c984b883e706e3df8a94183277ad5a3ed5c859bb..30540769f2641e47d7e44a1542165487c8e2724c 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/SlipBCs27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/SlipBCs27.cu @@ -1717,7 +1717,7 @@ extern "C" __global__ void QSlipGeomDeviceComp27(real* DD, real VeloZ = vx3; real fac = c0o1;//0.5; real phi = c0o1; - real alpha = c1o100; + //real alpha = c1o100; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real kxyFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_SW+f_BSW+f_TSW-f_NW-f_BNW-f_TNW-f_SE-f_BSE-f_TSE+f_NE+f_BNE+f_TNE ) / (c1o1 + drho) - ((vx1*vx2))); real kyzFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_BS+f_BSE+f_BSW-f_TS-f_TSE-f_TSW-f_BN-f_BNE-f_BNW+f_TN+f_TNE+f_TNW ) / (c1o1 + drho) - ((vx2*vx3))); @@ -2602,7 +2602,7 @@ extern "C" __global__ void QSlipNormDeviceComp27(real* DD, real VeloY = vx2; real VeloZ = vx3; real fac = c1o100;//0.5; - real phi = c0o1; + //real phi = c0o1; real alpha = c1o100; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// real kxyFromfcNEQ = -(c3o1 * om1 / (c1o1-om1))*((f_SW+f_BSW+f_TSW-f_NW-f_BNW-f_TNW-f_SE-f_BSE-f_TSE+f_NE+f_BNE+f_TNE ) / (c1o1 + drho) - ((vx1*vx2))); diff --git a/src/gpu/VirtualFluids_GPU/GPU/ThinWallBCs27.cu b/src/gpu/VirtualFluids_GPU/GPU/ThinWallBCs27.cu index a2c6ab0fa0db9ff0b66d900262f42b002a0f49b4..78e6f08dc523453214f0ec827a6db82c16b70d98 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/ThinWallBCs27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/ThinWallBCs27.cu @@ -933,7 +933,7 @@ extern "C" __global__ void QThinWallsPartTwo27( //////////////////////////////////////////////////////////////////////////////// //index uint KQK = k_Q[k]; - uint kzero= KQK; + //uint kzero= KQK; uint ke = KQK; uint kw = neighborX[KQK]; uint kn = KQK; diff --git a/src/gpu/VirtualFluids_GPU/GPU/VelocityBCs27.cu b/src/gpu/VirtualFluids_GPU/GPU/VelocityBCs27.cu index e7841bd7638e80fc728e06a2366f1820f765a5de..f3288175c61888e6125c7159df9be099d3b7f2c4 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/VelocityBCs27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/VelocityBCs27.cu @@ -2870,7 +2870,7 @@ extern "C" __global__ void QVelDeviceCompZeroPress1h27( int inx, //////////////////////////////////////////////////////////////////////////////// //index unsigned int KQK = k_Q[k]; - unsigned int kzero= KQK; + //unsigned int kzero= KQK; unsigned int ke = KQK; unsigned int kw = neighborX[KQK]; unsigned int kn = KQK; diff --git a/src/gpu/VirtualFluids_GPU/GPU/WaleCumulant27.cu b/src/gpu/VirtualFluids_GPU/GPU/WaleCumulant27.cu index e4e6d9fb2b4582afb95b97826bedacd96bd80eb7..d39e229c49fb14265132fc74d5bb3ba01ea59576 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/WaleCumulant27.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/WaleCumulant27.cu @@ -177,8 +177,8 @@ extern "C" __global__ void LB_Kernel_WaleBySoniMalav_Cum_AA2016_Comp_SP_27( //////////////////////////////////////////////////////////////////////////////////// ///////////////////// WALE model /////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// - - float tauTotal, wOper; // total relaxation time and operator for the WALE model + //float tauTotal; + float wOper; // total relaxation time and operator for the WALE model float dxux, dyuy, dzuz, dyux, dxuy, dzux, dxuz, dzuy, dyuz; // 9 velocity gradients required for computing the strain rate tensor and vorticity tensor // gradients wrt X-axis diff --git a/src/gpu/VirtualFluids_GPU/GPU/WallFunction.cu b/src/gpu/VirtualFluids_GPU/GPU/WallFunction.cu index 3f91015c2777e0686d7b7ca66a822652576e1845..44319be27246c5b771e92d2b40d4812a88007980 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/WallFunction.cu +++ b/src/gpu/VirtualFluids_GPU/GPU/WallFunction.cu @@ -98,8 +98,8 @@ extern "C" __global__ void WallFunction27(int inx, { //////////////////////////////////////////////////////////////////////////////// real VeloX = vx[k]; - real VeloY = vy[k]; - real VeloZ = vz[k]; //(16.0*(u0*2.0)*bbx*bby*(grid_nx-bbx)*(grid_ny-bby))/(grid_nx*grid_nx*grid_ny*grid_ny) + //real VeloY = vy[k]; + //real VeloZ = vz[k]; //(16.0*(u0*2.0)*bbx*bby*(grid_nx-bbx)*(grid_ny-bby))/(grid_nx*grid_nx*grid_ny*grid_ny) //////////////////////////////////////////////////////////////////////////////// //real *q_dirE, *q_dirW, *q_dirN, *q_dirS, *q_dirT, *q_dirB, // *q_dirNE, *q_dirSW, *q_dirSE, *q_dirNW, *q_dirTE, *q_dirBW, @@ -193,23 +193,24 @@ extern "C" __global__ void WallFunction27(int inx, f_TNW = (D.f[dirBSE ])[kbse ]; f_TSE = (D.f[dirBNW ])[kbnw ]; //////////////////////////////////////////////////////////////////////////////// - real vx1, vx2, vx3, drho, feq, q; + // real vx2, vx3, feq, q; + real vx1, drho; drho = f_TSE + f_TNW + f_TNE + f_TSW + f_BSE + f_BNW + f_BNE + f_BSW + f_BN + f_TS + f_TN + f_BS + f_BE + f_TW + f_TE + f_BW + f_SE + f_NW + f_NE + f_SW + f_T + f_B + f_N + f_S + f_E + f_W + ((D.f[dirZERO])[kzero]); - vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + - (f_E - f_W)) / (c1o1 + drho); + vx1 = (((f_TSE - f_BNW) - (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + + ((f_BE - f_TW) + (f_TE - f_BW)) + ((f_SE - f_NW) + (f_NE - f_SW)) + + (f_E - f_W)) / (c1o1 + drho); - vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + - ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + - (f_N - f_S)) / (c1o1 + drho); + // vx2 = ((-(f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) - (f_TSW - f_BNE)) + + // ((f_BN - f_TS) + (f_TN - f_BS)) + (-(f_SE - f_NW) + (f_NE - f_SW)) + + // (f_N - f_S)) / (c1o1 + drho); - vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + - (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + - (f_T - f_B)) / (c1o1 + drho); + // vx3 = (((f_TSE - f_BNW) + (f_TNW - f_BSE)) + ((f_TNE - f_BSW) + (f_TSW - f_BNE)) + + // (-(f_BN - f_TS) + (f_TN - f_BS)) + ((f_TE - f_BW) - (f_BE - f_TW)) + + // (f_T - f_B)) / (c1o1 + drho); //real cu_sq=c3o2*(vx1*vx1+vx2*vx2+vx3*vx3) * (one + drho); diff --git a/src/gpu/VirtualFluids_GPU/Input/ConfigFile.cpp b/src/gpu/VirtualFluids_GPU/Input/ConfigFile.cpp index 613af04d7f89a646f5c8327e5f0fe697d043c6c8..cfe4da2c7381fbcd5998a91eee2c662601dff554 100644 --- a/src/gpu/VirtualFluids_GPU/Input/ConfigFile.cpp +++ b/src/gpu/VirtualFluids_GPU/Input/ConfigFile.cpp @@ -58,7 +58,7 @@ void ConfigFile::get_token_and_value(void) } if (i==0) { - // It didn’t find a token, in this case. + // It didn�t find a token, in this case. m_token=""; m_value=""; return; @@ -78,7 +78,7 @@ void ConfigFile::get_token_and_value(void) return; } } - // Get the token’s value. + // Get the token�s value. i=0; char c = eat_white_and_comments(false); if ( c != '\n' ) @@ -139,6 +139,7 @@ char ConfigFile::eat_white_and_comments(bool traverse_newlines) bool in_comment; in_comment = false; while (!(m_in.get(ch)).fail()) + { if (ch == '#') in_comment = true; else if (ch == '\n') @@ -155,7 +156,8 @@ char ConfigFile::eat_white_and_comments(bool traverse_newlines) m_in.putback(ch); return 0; } - return 0; + } + return 0; } void ConfigFile::makeLower(std::string &instring) { diff --git a/src/gpu/VirtualFluids_GPU/Input/PositionReader.cpp b/src/gpu/VirtualFluids_GPU/Input/PositionReader.cpp index 82a4dd9ea95d4d87d6dc5c3e2b4b9661f40458f6..b2a942c9a36590b589cab7eacd0b299f76fd7f2c 100644 --- a/src/gpu/VirtualFluids_GPU/Input/PositionReader.cpp +++ b/src/gpu/VirtualFluids_GPU/Input/PositionReader.cpp @@ -2,33 +2,33 @@ #include "basics/utilities/UbFileInputASCII.h" -static const int E = dirE; //static const int E = 0; -static const int W = dirW; //static const int W = 1; -static const int N = dirN; //static const int N = 2; -static const int S = dirS; //static const int S = 3; -static const int T = dirT; //static const int T = 4; -static const int B = dirB; //static const int B = 5; -static const int NE = dirNE; //static const int NE = 6; -static const int SW = dirSW; //static const int SW = 7; -static const int SE = dirSE; //static const int SE = 8; -static const int NW = dirNW; //static const int NW = 9; -static const int TE = dirTE; //static const int TE = 10; -static const int BW = dirBW; //static const int BW = 11; -static const int BE = dirBE; //static const int BE = 12; -static const int TW = dirTW; //static const int TW = 13; -static const int TN = dirTN; //static const int TN = 14; -static const int BS = dirBS; //static const int BS = 15; -static const int BN = dirBN; //static const int BN = 16; -static const int TS = dirTS; //static const int TS = 17; -static const int TNE = dirTNE; //static const int TNE = 18; -static const int TNW = dirTNW; //static const int TNW = 19; -static const int TSE = dirTSE; //static const int TSE = 20; -static const int TSW = dirTSW; //static const int TSW = 21; -static const int BNE = dirBNE; //static const int BNE = 22; -static const int BNW = dirBNW; //static const int BNW = 23; -static const int BSE = dirBSE; //static const int BSE = 24; -static const int BSW = dirBSW; //static const int BSW = 25; -static const int ZERO = dirZERO; //static const int ZERO = 26; +// static const int E = dirE; //static const int E = 0; +// static const int W = dirW; //static const int W = 1; +// static const int N = dirN; //static const int N = 2; +// static const int S = dirS; //static const int S = 3; +// static const int T = dirT; //static const int T = 4; +// static const int B = dirB; //static const int B = 5; +// static const int NE = dirNE; //static const int NE = 6; +// static const int SW = dirSW; //static const int SW = 7; +// static const int SE = dirSE; //static const int SE = 8; +// static const int NW = dirNW; //static const int NW = 9; +// static const int TE = dirTE; //static const int TE = 10; +// static const int BW = dirBW; //static const int BW = 11; +// static const int BE = dirBE; //static const int BE = 12; +// static const int TW = dirTW; //static const int TW = 13; +// static const int TN = dirTN; //static const int TN = 14; +// static const int BS = dirBS; //static const int BS = 15; +// static const int BN = dirBN; //static const int BN = 16; +// static const int TS = dirTS; //static const int TS = 17; +// static const int TNE = dirTNE; //static const int TNE = 18; +// static const int TNW = dirTNW; //static const int TNW = 19; +// static const int TSE = dirTSE; //static const int TSE = 20; +// static const int TSW = dirTSW; //static const int TSW = 21; +// static const int BNE = dirBNE; //static const int BNE = 22; +// static const int BNW = dirBNW; //static const int BNW = 23; +// static const int BSE = dirBSE; //static const int BSE = 24; +// static const int BSW = dirBSW; //static const int BSW = 25; +// static const int ZERO = dirZERO; //static const int ZERO = 26; static const int INV_E = dirE; //= W; @@ -91,7 +91,7 @@ const int INVDIR[] = { INV_E, static const int optionDigits = 2; //--> 2 bits f�r secondary Option static const long long maxOptionVal = ( 1<<optionDigits ) - 1; //2^3-1 -> 7 -float q[27]; +//float q[27]; long long noslipBoundaryFlags; diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernel.h b/src/gpu/VirtualFluids_GPU/Kernel/Kernel.h index 02846d7c19515915382d8e852774e0331df567df..8932dadb3f92256cba279121193f94dbabdc0a6d 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernel.h +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernel.h @@ -16,6 +16,7 @@ class Kernel { public: + virtual ~Kernel() = default; virtual void run() = 0; virtual bool checkParameter() = 0; diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantAll4/CumulantAll4CompSP27_Device.cu b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantAll4/CumulantAll4CompSP27_Device.cu index 246ec79658674c8383012f97776ca60554883158..99f7a4c034b4912e1ee2ce8f15f23e2ad5c459ac 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantAll4/CumulantAll4CompSP27_Device.cu +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantAll4/CumulantAll4CompSP27_Device.cu @@ -563,8 +563,8 @@ extern "C" __global__ void LB_Kernel_Cumulant_D3Q27All4( real omega, //////////////////////////////////////////////////////////////////////////////////// //limiter advect - real lambdaAdvect = 1000;//100000; - real limAdvect = lambdaAdvect * (c1o1 / omega - c1o2) * (c1o1 / omega - c1o2); + //real lambdaAdvect = 1000;//100000; + //real limAdvect = lambdaAdvect * (c1o1 / omega - c1o2) * (c1o1 / omega - c1o2); //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// @@ -681,8 +681,8 @@ extern "C" __global__ void LB_Kernel_Cumulant_D3Q27All4( real omega, real dzuz = dxux + omega * c3o2 * mxxMzz; ////////////////////////////////////////////////////////////////////////////// - real divTest = (mxxPyyPzz - (mfaaa + (-c3o1 * (c1o1 - OxxPyyPzz*c1o2)*(vx2*dxux + vy2*dyuy + vz2*dzuz) + (c6o1 - c3o1 * (omega + OxxPyyPzz) + omega*OxxPyyPzz) / - (c3o1 * omega)*(dxux*dxux / rho + dyuy*dyuy / rho + dzuz*dzuz / rho + vvx*dxxux + vvy*dyyuy + vvz*dzzuz)) / OxxPyyPzz)) / OxxPyyPzz; + //real divTest = (mxxPyyPzz - (mfaaa + (-c3o1 * (c1o1 - OxxPyyPzz*c1o2)*(vx2*dxux + vy2*dyuy + vz2*dzuz) + (c6o1 - c3o1 * (omega + OxxPyyPzz) + omega*OxxPyyPzz) / + //(c3o1 * omega)*(dxux*dxux / rho + dyuy*dyuy / rho + dzuz*dzuz / rho + vvx*dxxux + vvy*dyyuy + vvz*dzzuz)) / OxxPyyPzz)) / OxxPyyPzz; //dxxux *= limAdvect / (limAdvect + sqrt(abs(divTest))); //dyyuy *= limAdvect / (limAdvect + sqrt(abs(divTest))); diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/MRT/MRTCompSP27_Device.cu b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/MRT/MRTCompSP27_Device.cu index 133084ecf90090a1820c03bf188924b11f56f347..87984a4d963631462b3efac0f31667667ea1c96c 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/MRT/MRTCompSP27_Device.cu +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/MRT/MRTCompSP27_Device.cu @@ -192,8 +192,8 @@ extern "C" __global__ void LB_Kernel_MRT_Comp_SP_27(real omega, vy2 = vvy*vvy; vz2 = vvz*vvz; //////////////////////////////////////////////////////////////////////////////////// - real wadjust; - real qudricLimit = 0.01f; + //real wadjust; + //real qudricLimit = 0.01f; //////////////////////////////////////////////////////////////////////////////////// //Hin //////////////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/BGKPlus/BGKPlusIncompSP27_Device.cu b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/BGKPlus/BGKPlusIncompSP27_Device.cu index e0e48ab3273fde8caa2be3cb4098db49cacc32ab..e82de30a7d8484e50b8ce9099138845ac773af79 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/BGKPlus/BGKPlusIncompSP27_Device.cu +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/BGKPlus/BGKPlusIncompSP27_Device.cu @@ -178,8 +178,8 @@ extern "C" __global__ void LB_Kernel_BGK_Plus_Incomp_SP_27(real omega, vy2 = vvy*vvy; vz2 = vvz*vvz; //////////////////////////////////////////////////////////////////////////////////// - real wadjust; - real qudricLimit = 0.01f; + //real wadjust; + //real qudricLimit = 0.01f; //////////////////////////////////////////////////////////////////////////////////// //Hin //////////////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/CumulantK15/CumulantK15Incomp_Device.cu b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/CumulantK15/CumulantK15Incomp_Device.cu index 829a9e0c354afe848abe4dc0fde19b445077af24..1aece78752106eccdf5a9c0ab22985eceb58fd27 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/CumulantK15/CumulantK15Incomp_Device.cu +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/CumulantK15/CumulantK15Incomp_Device.cu @@ -208,7 +208,7 @@ extern "C" __global__ void LB_Kernel_CumulantK15Incomp(real omega, // mfbbc-mfbba; //////////////////////////////////////////////////////////////////////////////////// // oMdrho assembler style -------> faaaaaastaaaa - // or much sloooowaaaa ... it depändssssss on sadaku + // or much sloooowaaaa ... it dep�ndssssss on sadaku real m0, m1, m2; //real oMdrho; //{ @@ -305,8 +305,8 @@ extern "C" __global__ void LB_Kernel_CumulantK15Incomp(real omega, vy2 = vvy*vvy; vz2 = vvz*vvz; //////////////////////////////////////////////////////////////////////////////////// - real wadjust; - real qudricLimit = 0.01f; + //real wadjust; + //real qudricLimit = 0.01f; //real s9 = minusomega; //test //s9 = 0.; @@ -797,7 +797,7 @@ extern "C" __global__ void LB_Kernel_CumulantK15Incomp(real omega, real mxxMzz = mfcaa - mfaac; ////////////////////////////////////////////////////////////////////////// - real magicBulk = (CUMacc + CUMcac + CUMcca)*(c1o1 / OxxPyyPzz - c1o2)*c3o2*8.; + //real magicBulk = (CUMacc + CUMcac + CUMcca)*(c1o1 / OxxPyyPzz - c1o2)*c3o2*8.; ////////////////////////////////////////////////////////////////////////// //limiter-Scheise Teil 1 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/MRT/MRTIncompSP27_Device.cu b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/MRT/MRTIncompSP27_Device.cu index 6dd208964c631beb56d55201acf20c55a618b954..97b5e96aae03c2d881689026665e84ca00c2a349 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/MRT/MRTIncompSP27_Device.cu +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/MRT/MRTIncompSP27_Device.cu @@ -187,8 +187,8 @@ extern "C" __global__ void LB_Kernel_MRT_Incomp_SP_27(real omega, vy2 = vvy*vvy; vz2 = vvz*vvz; //////////////////////////////////////////////////////////////////////////////////// - real wadjust; - real qudricLimit = 0.01f; + //real wadjust; + //real qudricLimit = 0.01f; //////////////////////////////////////////////////////////////////////////////////// //Hin //////////////////////////////////////////////////////////////////////////////////// diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod27/ADComp27/ADComp27_Device.cu b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod27/ADComp27/ADComp27_Device.cu index b36290b33d4b38fe0a734f8e6930d253a569d829..34c71db68f102d989e590994fbe88bdcae8e1bb8 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod27/ADComp27/ADComp27_Device.cu +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod27/ADComp27/ADComp27_Device.cu @@ -227,7 +227,7 @@ extern "C" __global__ void LB_KERNEL_AD_COMP_27(real diffusivity, (((mfbac + mfbca) + (mfbaa + mfbcc)) + ((mfabc + mfcba) + (mfaba + mfcbc)) + ((mfacb + mfcab) + (mfaab + mfccb))) + ((mfabb + mfcbb) + (mfbab + mfbcb)) + (mfbba + mfbbc)) + mfbbb; - real rho = c1o1 + drho; + //real rho = c1o1 + drho; //////////////////////////////////////////////////////////////////////////////// real rho0fluid = (fTNE + fBSW) + (fTSW + fBNE) + (fTSE + fBNW) + (fTNW + fBSE) + (fNE + fSW) + (fNW + fSE) + (fTE + fBW) + (fBE + fTW) + (fTN + fBS) + (fBN + fTS) + (fE + fW) + (fN + fS) + (fT + fB) + fZERO; real rhofluid = rho0fluid + c1o1; diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod27/ADIncomp27/ADIncomp27_Device.cu b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod27/ADIncomp27/ADIncomp27_Device.cu index 6eebbebc404d0c3406ccee25e896e11f090c5c9e..0daf75c0a47bca0c26918b77e92ab442cdc9ccf4 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod27/ADIncomp27/ADIncomp27_Device.cu +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod27/ADIncomp27/ADIncomp27_Device.cu @@ -184,7 +184,7 @@ extern "C" __global__ void LB_Kernel_AD_Incomp_27(real diffusivity, real fTN = (D.f[dirBS])[kbs]; real fTS = (D.f[dirBN])[kb];//kbn real fBN = (D.f[dirTS])[ks];//kts - real fZERO = (D.f[dirZERO])[k];//kzero + //real fZERO = (D.f[dirZERO])[k];//kzero real fBSW = (D.f[dirTNE])[k];//ktne real fBNE = (D.f[dirTSW])[ksw];//ktsw real fBNW = (D.f[dirTSE])[ks];//ktse @@ -260,7 +260,7 @@ extern "C" __global__ void LB_Kernel_AD_Incomp_27(real diffusivity, real drho = ((((mfccc + mfaaa) + (mfaca + mfcac)) + ((mfacc + mfcaa) + (mfaac + mfcca))) + (((mfbac + mfbca) + (mfbaa + mfbcc)) + ((mfabc + mfcba) + (mfaba + mfcbc)) + ((mfacb + mfcab) + (mfaab + mfccb))) + ((mfabb + mfcbb) + (mfbab + mfbcb)) + (mfbba + mfbbc)) + mfbbb; - real rho = c1o1 + drho; + //real rho = c1o1 + drho; //////////////////////////////////////////////////////////////////////////////////// real vvx = ((fTNE - fBSW) + (fBNE - fTSW) + (fTSE - fBNW) + (fBSE - fTNW) + (fNE - fSW) + (fSE - fNW) + (fTE - fBW) + (fBE - fTW) + (fE - fW)); diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod7/ADIncomp7/ADIncomp7_Device.cu b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod7/ADIncomp7/ADIncomp7_Device.cu index e981d3c2507737fb81d80cb4740fd68028f08841..43d02e0f1fb7282efb4a1f7ee3c00d33d8a68f4a 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod7/ADIncomp7/ADIncomp7_Device.cu +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod7/ADIncomp7/ADIncomp7_Device.cu @@ -144,7 +144,7 @@ extern "C" __global__ void LB_Kernel_AD_Incomp_7(real diffusivity, real fTN = (D.f[dirBS])[kbs]; real fTS = (D.f[dirBN])[kb];//kbn real fBN = (D.f[dirTS])[ks];//kts - real fZERO = (D.f[dirZERO])[k];//kzero + //real fZERO = (D.f[dirZERO])[k];//kzero real fBSW = (D.f[dirTNE])[k];//ktne real fBNE = (D.f[dirTSW])[ksw];//ktsw real fBNW = (D.f[dirTSE])[ks];//ktse @@ -192,14 +192,14 @@ extern "C" __global__ void LB_Kernel_AD_Incomp_7(real diffusivity, real vx = ((fTNE - fBSW) + (fBNE - fTSW) + (fTSE - fBNW) + (fBSE - fTNW) + (fNE - fSW) + (fSE - fNW) + (fTE - fBW) + (fBE - fTW) + (fE - fW)); real vy = ((fTNE - fBSW) + (fBNE - fTSW) + (fBNW - fTSE) + (fTNW - fBSE) + (fNE - fSW) + (fNW - fSE) + (fTN - fBS) + (fBN - fTS) + (fN - fS)); real vz = ((fTNE - fBSW) + (fTSW - fBNE) + (fTSE - fBNW) + (fTNW - fBSE) + (fTE - fBW) + (fTW - fBE) + (fTN - fBS) + (fTS - fBN) + (fT - fB)); - ////dörrrrrty !!!!!!!!!!!!! + ////d�rrrrrty !!!!!!!!!!!!! // real vx = ten * ((fTNE-fBSW)+(fBNE-fTSW)+(fTSE-fBNW)+(fBSE-fTNW) +(fNE-fSW)+(fSE-fNW)+(fTE-fBW)+(fBE-fTW)+(fE-fW)); // real vy = ten * ((fTNE-fBSW)+(fBNE-fTSW)+(fBNW-fTSE)+(fTNW-fBSE) +(fNE-fSW)+(fNW-fSE)+(fTN-fBS)+(fBN-fTS)+(fN-fS)); // real vz = ten * ((fTNE-fBSW)+(fTSW-fBNE)+(fTSE-fBNW)+(fTNW-fBSE) +(fTE-fBW)+(fTW-fBE)+(fTN-fBS)+(fTS-fBN)+(fT-fB)); //////////////////////////////////////////////////////////////////////////////// - real ux_sq = vx * vx; - real uy_sq = vy * vy; - real uz_sq = vz * vz; + //real ux_sq = vx * vx; + //real uy_sq = vy * vy; + //real uz_sq = vz * vz; //////////////////////////////////////////////////////////////////////////////// //BGK //real omegaD = -three + sqrt(three); !!!!!!!!!!!!!!Achtung!!!!!!!!!!!!!!!!!! anderes Vorzeichen als in den Randbedingungen @@ -219,10 +219,10 @@ extern "C" __global__ void LB_Kernel_AD_Incomp_7(real diffusivity, //////////////////////////////////////////////////////////////////////////////// //TRT Yoshida Kernel - based on Ying - real cs2 = c1o4; + //real cs2 = c1o4; real Lam = diffusivity*c4o1;//diffusivity/(one)/cs2; real omegaD = -c1o1 / (Lam + c1o2); - real ae = c0o1; + //real ae = c0o1; //////////////////////////////////////////////////////////////////////////////// real ConcD = f7ZERO + f7E + f7W + f7N + f7S + f7T + f7B; diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/PorousMediaKernels/Advection/Compressible/CumulantOne/PMCumulantOneCompSP27_Device.cu b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/PorousMediaKernels/Advection/Compressible/CumulantOne/PMCumulantOneCompSP27_Device.cu index 945d8706415cfc66bde65390894f8729b3ef6dce..734b71e7a4b227b90f83587f47c1357a6d44e85a 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/PorousMediaKernels/Advection/Compressible/CumulantOne/PMCumulantOneCompSP27_Device.cu +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/PorousMediaKernels/Advection/Compressible/CumulantOne/PMCumulantOneCompSP27_Device.cu @@ -475,7 +475,7 @@ extern "C" __global__ void LB_Kernel_PM_Cum_One_Comp_SP_27(real omega, real mxxMzz = mfcaa - mfaac; ////////////////////////////////////////////////////////////////////////// - real magicBulk = (CUMacc + CUMcac + CUMcca)*(c1o1 / OxxPyyPzz - c1o2)*c3o2*8.; + //real magicBulk = (CUMacc + CUMcac + CUMcca)*(c1o1 / OxxPyyPzz - c1o2)*c3o2*8.; ////////////////////////////////////////////////////////////////////////// //limiter-Scheise Teil 1 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK15BySoniMalav/WaleBySoniMalavCumulantK15Comp_Device.cu b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK15BySoniMalav/WaleBySoniMalavCumulantK15Comp_Device.cu index 7f93133cb660c0af5a5d35ab6be37686b14f0e4c..7d3e1fab7d01b8a4d2b546e6227279f5ed46431f 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK15BySoniMalav/WaleBySoniMalavCumulantK15Comp_Device.cu +++ b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK15BySoniMalav/WaleBySoniMalavCumulantK15Comp_Device.cu @@ -174,7 +174,8 @@ extern "C" __global__ void LB_Kernel_WaleBySoniMalavCumulantK15Comp( ///////////////////// WALE model /////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// - float tauTotal, wOper; // total relaxation time and operator for the WALE model + // float tauTotal; + float wOper; // total relaxation time and operator for the WALE model float dxux, dyuy, dzuz, dyux, dxuy, dzux, dxuz, dzuy, dyuz; // 9 velocity gradients required for computing the strain rate tensor and vorticity tensor // gradients wrt X-axis diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/CheckParameterStrategy/CheckParameterStrategy.h b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/CheckParameterStrategy/CheckParameterStrategy.h index 2cb2b1b4200356020236c26e7fe264d9bc16b013..2fcd9a081df520af8d5517747b021a3f0353df6f 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/CheckParameterStrategy/CheckParameterStrategy.h +++ b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/CheckParameterStrategy/CheckParameterStrategy.h @@ -8,7 +8,8 @@ class Parameter; class CheckParameterStrategy { public: - virtual bool checkParameter(std::shared_ptr<Parameter> para) = 0; + virtual ~CheckParameterStrategy() = default; + virtual bool checkParameter(std::shared_ptr<Parameter> para) = 0; }; #endif \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactory.h b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactory.h index b799354b7db532090490db33cbbf1e67ae0e38a8..34a16e564023de43503b70246b12253f746a2bc8 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactory.h +++ b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactory.h @@ -17,6 +17,7 @@ class PorousMedia; class VIRTUALFLUIDS_GPU_EXPORT KernelFactory { public: + virtual ~KernelFactory() = default; virtual std::vector< std::shared_ptr< Kernel>> makeKernels(std::shared_ptr<Parameter> para) = 0; virtual std::vector< std::shared_ptr< ADKernel>> makeAdvDifKernels(std::shared_ptr<Parameter> para) = 0; diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.cpp b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.cpp index b6cd8b1b6525a64fcb31d737d6d6aca1cbe6ef60..1a5870d82064b9b47bad87352dc88cef64f895d3 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.cpp +++ b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/KernelFactoryImp.cpp @@ -63,7 +63,7 @@ std::vector<std::shared_ptr<Kernel>> KernelFactoryImp::makeKernels(std::shared_p if (para->getMaxLevel() > 0) if (para->getMultiKernelOn()) - for (int i = 0; i < para->getMultiKernelLevel().size(); i++) + for (std::size_t i = 0; i < para->getMultiKernelLevel().size(); i++) setKernelAtLevel(kernels, para, para->getMultiKernel().at(i), para->getMultiKernelLevel().at(i)); return kernels; } 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" diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.h b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.h index c4bda81d8d4af6470743619a9b0dcc3aafcb97f1..c493ca8f154b7b999a49c977fdcce51754720ba9 100644 --- a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.h +++ b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/KernelMapper.h @@ -1,4 +1,4 @@ -#ifndef KERNEL_MAPPPER_H +#ifndef KERNEL_MAPPER_H #define KERNEL_MAPPER_H #include "Utilities/EnumMapper/EnumMapperImp.h" diff --git a/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp b/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp index a4dbc09a99fb4e5ffe434b6d0bfeb27a73da1052..d185487bb2642fb1628e1a9dc0a932c0ea1e71a0 100644 --- a/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp +++ b/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp @@ -396,10 +396,7 @@ void Simulation::run() unsigned int t_MP = 0; ////////////////////////////////////////////////////////////////////////// para->setStepEnsight(0); - ////////////////////////////////////////////////////////////////////////// - real visSponge = 0.001f; - real omegaSponge = 1.f / ( 3.f * visSponge + 0.5f ); - ////////////////////////////////////////////////////////////////////////// + //turning Ship real Pi = (real)3.14159265358979323846; real delta_x_F = (real)0.1; @@ -1306,7 +1303,7 @@ void Simulation::free() gridProvider->~GridProvider(); dataWriter->~DataWriter(); comm->~Communicator(); - for(int i = 0; i < kernels.size(); i++) + for(std::size_t i = 0; i < kernels.size(); i++) kernels.at(i)->~Kernel(); } \ No newline at end of file diff --git a/src/gpu/VirtualFluids_GPU/Output/DataWriter.h b/src/gpu/VirtualFluids_GPU/Output/DataWriter.h index 0bba66ed8e5d89c4c6560087586b4395c735a445..6e61fc696ffe2af2e7e425a25867de8f3c0d2c0f 100644 --- a/src/gpu/VirtualFluids_GPU/Output/DataWriter.h +++ b/src/gpu/VirtualFluids_GPU/Output/DataWriter.h @@ -16,13 +16,11 @@ class CudaMemoryManager; class DataWriter { public: - DataWriter() {} - virtual ~DataWriter() {} + DataWriter() = default; + virtual ~DataWriter() = default; virtual void writeInit(std::shared_ptr<Parameter> para, std::shared_ptr<CudaMemoryManager> cudaManager) = 0; virtual void writeTimestep(std::shared_ptr<Parameter> para, unsigned int timestep) = 0; virtual void writeTimestep(std::shared_ptr<Parameter> para, unsigned int timestep, int level) = 0; - - DataWriter(const DataWriter& dataWriter) {} }; #endif diff --git a/src/gpu/VirtualFluids_GPU/Output/FileWriter.cpp b/src/gpu/VirtualFluids_GPU/Output/FileWriter.cpp index 7abf61b862968dc3cb78c43a4e19aa63091063d0..a554d63cccbb9a2622f0bbffa143c8a586b88f44 100644 --- a/src/gpu/VirtualFluids_GPU/Output/FileWriter.cpp +++ b/src/gpu/VirtualFluids_GPU/Output/FileWriter.cpp @@ -184,7 +184,6 @@ void FileWriter::writeUnstrucuredGridLT(std::shared_ptr<Parameter> para, int lev unsigned int number1, number2, number3, number4, number5, number6, number7, number8; uint dn1, dn2, dn3, dn4, dn5, dn6, dn7, dn8; bool neighborsAreFluid; - double vxmax = 0; unsigned int startpos = 0; unsigned int endpos = 0; unsigned int sizeOfNodes = 0; @@ -289,7 +288,6 @@ void FileWriter::writeUnstrucuredGridLTConc(std::shared_ptr<Parameter> para, int unsigned int number1, number2, number3, number4, number5, number6, number7, number8; uint dn1, dn2, dn3, dn4, dn5, dn6, dn7, dn8; bool neighborsAreFluid; - double vxmax = 0; unsigned int startpos = 0; unsigned int endpos = 0; unsigned int sizeOfNodes = 0; @@ -396,7 +394,6 @@ void FileWriter::writeUnstrucuredGridMedianLT(std::shared_ptr<Parameter> para, i unsigned int number1, number2, number3, number4, number5, number6, number7, number8; unsigned int dn1, dn2, dn3, dn4, dn5, dn6, dn7, dn8; bool neighborsFluid; - double vxmax = 0; unsigned int startpos = 0; unsigned int endpos = 0; unsigned int sizeOfNodes = 0; @@ -405,7 +402,6 @@ void FileWriter::writeUnstrucuredGridMedianLT(std::shared_ptr<Parameter> para, i //printf("\n test for if... \n"); for (unsigned int part = 0; part < fname.size(); part++) { - vxmax = 0; //printf("\n test in if I... \n"); ////////////////////////////////////////////////////////////////////////// if (((part + 1)*para->getlimitOfNodesForVTK()) > para->getParH(level)->size_Mat_SP) diff --git a/src/gpu/VirtualFluids_GPU/Output/FileWriter.h b/src/gpu/VirtualFluids_GPU/Output/FileWriter.h index 863d3a116ee2b98d954da256f0df70200d444617..7f5c3c2d27f852b72966d3a837952c70a3fcf54e 100644 --- a/src/gpu/VirtualFluids_GPU/Output/FileWriter.h +++ b/src/gpu/VirtualFluids_GPU/Output/FileWriter.h @@ -29,7 +29,7 @@ private: void VIRTUALFLUIDS_GPU_EXPORT writeUnstrucuredGridMedianLTConc(std::shared_ptr<Parameter> para, int level, std::vector<std::string >& fname); bool VIRTUALFLUIDS_GPU_EXPORT isPeriodicCell(std::shared_ptr<Parameter> para, int level, unsigned int number2, unsigned int number1, unsigned int number3, unsigned int number5); - FileWriter(const FileWriter& fileWriter) {}; + FileWriter(const FileWriter& fileWriter) = default; void VIRTUALFLUIDS_GPU_EXPORT writeCollectionFile( std::shared_ptr<Parameter> para, unsigned int timestep ); diff --git a/src/gpu/VirtualFluids_GPU/Output/InterfaceDebugWriter.hpp b/src/gpu/VirtualFluids_GPU/Output/InterfaceDebugWriter.hpp index 86f380705a3b89105b084fe40a7ffbae65cb10e6..8d1337be8088f3daa55f03fc5fcf1e405c8d0b3d 100644 --- a/src/gpu/VirtualFluids_GPU/Output/InterfaceDebugWriter.hpp +++ b/src/gpu/VirtualFluids_GPU/Output/InterfaceDebugWriter.hpp @@ -149,11 +149,6 @@ namespace InterfaceDebugWriter int nodeCount = 0; for (int level = 0; level < para->getMaxLevel(); level++) { - double nodeDeltaLevel = para->getParH(level)->dx; - double nodeDeltaLevelFine = para->getParH(level+1)->dx; - double halfNodeDeltaLevel = 0.5*nodeDeltaLevel; - double halfNodeDeltaLevelFine = 0.5*nodeDeltaLevelFine; - for(unsigned int u=0;u<para->getParH(level)->K_CF;u++) { double xoff = para->getParH(level)->offCF.xOffCF[u]; @@ -199,9 +194,6 @@ namespace InterfaceDebugWriter int nodeCount2 = 0; for (int level = 0; level < para->getMaxLevel(); level++) { - double nodeDeltaLevel = para->getParH(level)->dx; - double halfNodeDeltaLevel = 0.5*nodeDeltaLevel; - for(unsigned int u=0;u<para->getParH(level)->K_CF;u++) { int pos = para->getParH(level)->intCF.ICellCFC[u]; @@ -234,9 +226,6 @@ namespace InterfaceDebugWriter int nodeCount2 = 0; for (int level = 0; level <= para->getMaxLevel(); level++) { - double nodeDeltaLevel = para->getParH(level)->dx; - double halfNodeDeltaLevel = 0.5*nodeDeltaLevel; - for(int u=0;u<para->getParH(level)->QWall.kQ;u++) { int pos = para->getParH(level)->QWall.k[u]; @@ -540,9 +529,6 @@ namespace InterfaceDebugWriter int nodeCount = 0; for (int level = 0; level < para->getMaxLevel(); level++) { - double nodeDeltaLevel = para->getParH(level)->dx; - double halfNodeDeltaLevel = 0.5*nodeDeltaLevel; - for(unsigned int u=0;u<para->getParH(level)->K_CF;u++) { int pos = para->getParH(level)->intCF.ICellCFC[u]; @@ -587,9 +573,6 @@ namespace InterfaceDebugWriter int nodeCount = 0; for (int level = 0; level < para->getMaxLevel(); level++) { - double nodeDeltaLevel = para->getParH(level+1)->dx; - double halfNodeDeltaLevel = 0.5*nodeDeltaLevel; - for(unsigned int u=0;u<para->getParH(level)->K_CF;u++) { int pos = para->getParH(level )->intCF.ICellCFF[u]; diff --git a/src/gpu/VirtualFluids_GPU/Output/LogWriter.hpp b/src/gpu/VirtualFluids_GPU/Output/LogWriter.hpp index 587364be902b1673451090191d4b2e366124c0aa..cbce9a48cdc8ca36127ab61363fdb9a3dff9dec8 100644 --- a/src/gpu/VirtualFluids_GPU/Output/LogWriter.hpp +++ b/src/gpu/VirtualFluids_GPU/Output/LogWriter.hpp @@ -21,9 +21,9 @@ public: consoleOut = false; this->fname = fname; } - void setName(std::string fname) + void setName(std::string name) { - this->fname = fname; + this->fname = name; } void setConsoleOut(bool flag) { diff --git a/src/gpu/VirtualFluids_GPU/Output/QDebugWriter.hpp b/src/gpu/VirtualFluids_GPU/Output/QDebugWriter.hpp index d661aef500b745b49d28892a01fae96e5a6d5dd3..d0c15ec08b7c817538bef86323fe753437e40d30 100644 --- a/src/gpu/VirtualFluids_GPU/Output/QDebugWriter.hpp +++ b/src/gpu/VirtualFluids_GPU/Output/QDebugWriter.hpp @@ -21,7 +21,7 @@ namespace QDebugWriter { std::vector< std::vector<real> > qs; - for (size_t j = 0; j < kq; j++) + for (int j = 0; j < kq; j++) { uint32_t qKey = 0; std::vector<real> qNode; @@ -49,14 +49,14 @@ namespace QDebugWriter - for (int index = 0; index < qs.size(); index++) { + for (std::size_t index = 0; index < qs.size(); index++) { std::vector<real> bcs = qs[index]; uint32_t key = *((uint32_t*)&bcs[bcs.size() - 2]); int qIndex = (int)bcs[bcs.size() - 1]; *outQ << qIndex << " " << key; - for (int i = 0; i < bcs.size() - 2; i++) { + for (std::size_t i = 0; i < bcs.size() - 2; i++) { *outQ << " " << std::fixed << std::setprecision(16) << bcs[i]; } diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp index a8928462f9832b44b419cd831d1e1e95f6541c85..fda9a458d2326dd849b3748654e71b0ce6ea22b7 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.cpp @@ -395,9 +395,9 @@ Parameter::Parameter(SPtr<ConfigData> configData, Communicator* comm) this->setForcing(forcingX, forcingY, forcingZ); ////////////////////////////////////////////////////////////////////////// //quadricLimiters - real quadricLimiterP = 0.01; - real quadricLimiterM = 0.01; - real quadricLimiterD = 0.01; + real quadricLimiterP = (real)0.01; + real quadricLimiterM = (real)0.01; + real quadricLimiterD = (real)0.01; if (configData->isQuadricLimiterPInConfigFile()) quadricLimiterP = configData->getQuadricLimiterP(); @@ -552,7 +552,7 @@ Parameter::Parameter(SPtr<ConfigData> configData, Communicator* comm) if (configData->isMultiKernelNameInConfigFile()) { std::vector<KernelType> kernels; - for (int i = 0; i < configData->getMultiKernelName().size(); i++) { + for (std::size_t i = 0; i < configData->getMultiKernelName().size(); i++) { kernels.push_back(kernelMapper->getEnum(configData->getMultiKernelName().at(i))); } this->setMultiKernel(kernels); @@ -807,10 +807,10 @@ void Parameter::setSizeMatSparse(int level) } void Parameter::fillSparse(int level) { - unsigned int li = ((parH[level]->gridNX+STARTOFFX-2)-(STARTOFFX+1)-1); - unsigned int lj = ((parH[level]->gridNY+STARTOFFY-2)-(STARTOFFY+1)-1); - real globalX, globalY, globalZ; - //real InitglobalX, InitglobalY, InitglobalZ; + //nsigned int li = ((parH[level]->gridNX+STARTOFFX-2)-(STARTOFFX+1)-1); + //unsigned int lj = ((parH[level]->gridNY+STARTOFFY-2)-(STARTOFFY+1)-1); + // real globalX, globalY, globalZ; + real PI = 3.141592653589793238462643383279f; for (unsigned int k=1; k<parH[level]->gridNZ + 2 * STARTOFFZ - 1; k++) @@ -876,9 +876,9 @@ void Parameter::fillSparse(int level) //{ // parH[level]->rho_SP[parH[level]->k[m]] = (real)0.0f; //} - globalX = TrafoXtoWorld(i,level); - globalY = TrafoYtoWorld(j,level); - globalZ = TrafoZtoWorld(k,level); + // globalX = TrafoXtoWorld(i,level); + // globalY = TrafoYtoWorld(j,level); + // globalZ = TrafoZtoWorld(k,level); //without setting a pressure parH[level]->rho_SP[parH[level]->k[m]] = (real)0.0f; //parH[level]->Conc_Full[m];//bitte schnell wieder entfernen!!! ////////////////////////////////////////////////////////////////////////// @@ -4282,7 +4282,7 @@ void Parameter::setMultiKernelOn(bool isOn) } void Parameter::setMultiKernelLevel(std::vector< int> kernelLevel) { - this->multiKernelLevel = multiKernelLevel; + this->multiKernelLevel = kernelLevel; } void Parameter::setMultiKernel(std::vector< KernelType> kernel) { @@ -5077,6 +5077,7 @@ std::vector<std::string> Parameter::getPossNeighborFiles(std::string sor) { return this->possNeighborFilesRecv; } + throw std::runtime_error("Parameter string invalid."); } unsigned int Parameter::getNumberOfProcessNeighbors(int level, std::string sor) { @@ -5088,6 +5089,7 @@ unsigned int Parameter::getNumberOfProcessNeighbors(int level, std::string sor) { return (unsigned int)parH[level]->recvProcessNeighbor.size(); } + throw std::runtime_error("Parameter string invalid."); } bool Parameter::getIsNeighbor() { @@ -5104,6 +5106,7 @@ std::vector<std::string> Parameter::getPossNeighborFilesX(std::string sor) { return this->possNeighborFilesRecvX; } + throw std::runtime_error("Parameter string invalid."); } std::vector<std::string> Parameter::getPossNeighborFilesY(std::string sor) { @@ -5115,6 +5118,7 @@ std::vector<std::string> Parameter::getPossNeighborFilesY(std::string sor) { return this->possNeighborFilesRecvY; } + throw std::runtime_error("Parameter string invalid."); } std::vector<std::string> Parameter::getPossNeighborFilesZ(std::string sor) { @@ -5126,6 +5130,7 @@ std::vector<std::string> Parameter::getPossNeighborFilesZ(std::string sor) { return this->possNeighborFilesRecvZ; } + throw std::runtime_error("Parameter string invalid."); } unsigned int Parameter::getNumberOfProcessNeighborsX(int level, std::string sor) { @@ -5137,6 +5142,7 @@ unsigned int Parameter::getNumberOfProcessNeighborsX(int level, std::string sor) { return (unsigned int)parH[level]->recvProcessNeighborX.size(); } + throw std::runtime_error("Parameter string invalid."); } unsigned int Parameter::getNumberOfProcessNeighborsY(int level, std::string sor) { @@ -5148,6 +5154,7 @@ unsigned int Parameter::getNumberOfProcessNeighborsY(int level, std::string sor) { return (unsigned int)parH[level]->recvProcessNeighborY.size(); } + throw std::runtime_error("Parameter string invalid."); } unsigned int Parameter::getNumberOfProcessNeighborsZ(int level, std::string sor) { @@ -5159,7 +5166,9 @@ unsigned int Parameter::getNumberOfProcessNeighborsZ(int level, std::string sor) { return (unsigned int)parH[level]->recvProcessNeighborZ.size(); } + throw std::runtime_error("Parameter string invalid."); } + bool Parameter::getIsNeighborX() { return this->isNeigborX; diff --git a/src/gpu/VirtualFluids_GPU/Particles/Particles.cpp b/src/gpu/VirtualFluids_GPU/Particles/Particles.cpp index 9ec6f2e6485ffab2f9c80e2c583e6b110ae5ad23..5cf30536fba525f5dae9e6a067326408c8f7f558 100644 --- a/src/gpu/VirtualFluids_GPU/Particles/Particles.cpp +++ b/src/gpu/VirtualFluids_GPU/Particles/Particles.cpp @@ -74,7 +74,7 @@ void initParticles(Parameter* para) } ////////////////////////////////////////////////////////////////////////// //set bool "hot wall" - for (unsigned int h = 0; h < para->getParH(lev)->QGeom.kQ; h++) + for (int h = 0; h < para->getParH(lev)->QGeom.kQ; h++) { if (para->getParH(lev)->coordX_SP[para->getParH(lev)->QGeom.k[h]] < para->getStartXHotWall() || para->getParH(lev)->coordX_SP[para->getParH(lev)->QGeom.k[h]] > para->getEndXHotWall()) @@ -104,7 +104,7 @@ void initParticles(Parameter* para) para->getParH(lev)->plp.veloZ[i] = (real)0.0; } ////////////////////////////////////////////////////////////////////////// - real centerX = 1.0f; //uebergabeparameter + // real centerX = 1.0f; //uebergabeparameter real centerY = 10.5f; //uebergabeparameter real centerZ = 10.5f; //uebergabeparameter real diameter = 15.0f;//21.0f; //uebergabeparameter @@ -158,7 +158,7 @@ void initParticles(Parameter* para) ////////////////////////////////////////////////////////////////////////// for (unsigned int i = 0; i < para->getParH(lev)->plp.numberOfParticles; i++) { - for (int ii = 0; ii < tempID.size(); ii++) + for (std::size_t ii = 0; ii < tempID.size(); ii++) { if ((para->getParH(lev)->coordY_SP[tempID[ii]] <= para->getParH(lev)->plp.coordYabsolut[i]) && ((para->getParH(lev)->plp.coordYabsolut[i] - para->getParH(lev)->coordY_SP[tempID[ii]]) <= dx) && @@ -455,7 +455,7 @@ void rearrangeGeometry(Parameter* para, CudaMemoryManager* cudaManager) int counter2 = 0; ////////////////////////////////////////////////////////////////////////// //redefine fluid nodes - for (int index = 0; index < para->getParH(lev)->size_Mat_SP; index++) + for (uint index = 0; index < para->getParH(lev)->size_Mat_SP; index++) { if (para->getParH(lev)->geoSP[index] == GEO_FLUID_OLD) { diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessor.h b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessor.h index 1d64b40c5252c261cc61b6588c6c6fb95c31eb0b..3c7fac487405ea95615d7913400992c05035ff92 100644 --- a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessor.h +++ b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessor.h @@ -8,6 +8,7 @@ class Parameter; class PreProcessor { public: + virtual ~PreProcessor() = default; virtual void init(std::shared_ptr<Parameter> para, int level) = 0; virtual bool checkParameter() = 0; diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactory.h b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactory.h index 6c43ac7dd23aedd0d9b65c1b4b0beaaf449a471d..80413722b0266d19daae03eb3d0a539b95c62507 100644 --- a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactory.h +++ b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactory.h @@ -14,6 +14,7 @@ class Parameter; class VIRTUALFLUIDS_GPU_EXPORT PreProcessorFactory { public: + virtual ~PreProcessorFactory() = default; virtual std::shared_ptr<PreProcessor> makePreProcessor(std::vector<PreProcessorType> preProcessorTypes, std::shared_ptr<Parameter> para) = 0; }; diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp index ced53f8e29790e32b3476c7c5fdea7f3805c42d1..7bddc1e471b7615e0b83fe37d6d81edf7dfd0c52 100644 --- a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp +++ b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/PreProcessorFactoryImp.cpp @@ -22,7 +22,7 @@ std::shared_ptr<PreProcessor> PreProcessorFactoryImp::makePreProcessor(std::vect { std::shared_ptr<PreProcessorImp> prePro = PreProcessorImp::getNewInstance(); - for (int i = 0; i < preProcessorTypes.size(); i++) + for (std::size_t i = 0; i < preProcessorTypes.size(); i++) prePro->addStrategy(makePreProcessorStrategy(preProcessorTypes.at(i), para)); return prePro; diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorImp.cpp b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorImp.cpp index 0825b41a30fc2304c8b2e6a0ac22654d7d72b1c8..17c5c406d768b53b5191cd8cf18466a21dad98aa 100644 --- a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorImp.cpp +++ b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorImp.cpp @@ -17,17 +17,17 @@ void PreProcessorImp::addStrategy(std::shared_ptr<PreProcessorStrategy> strategy void PreProcessorImp::init(std::shared_ptr<Parameter> para, int level) { para->getParD(level)->evenOrOdd = false; - for (int i = 0; i < strategies.size(); i++) + for (std::size_t i = 0; i < strategies.size(); i++) strategies.at(i)->init(level); para->getParD(level)->evenOrOdd = true; - for (int i = 0; i < strategies.size(); i++) + for (std::size_t i = 0; i < strategies.size(); i++) strategies.at(i)->init(level); } bool PreProcessorImp::checkParameter() { - for (int i = 0; i < strategies.size(); i++) { + for (std::size_t i = 0; i < strategies.size(); i++) { if (!strategies.at(i)->checkParameter()) return false; } diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitF3/InitF3_Device.cu b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitF3/InitF3_Device.cu index 60c8dedf96d60e5410ef04ac19fdfdef59780999..3024af8bafa1bc0c6b593bbfef3dda84d2c2f3ab 100644 --- a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitF3/InitF3_Device.cu +++ b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitF3/InitF3_Device.cu @@ -57,7 +57,7 @@ extern "C" __global__ void LB_Init_F3(unsigned int* neighborX, ////////////////////////////////////////////////////////////////////////// //index ////////////////////////////////////////////////////////////////////////// - unsigned int kzero = k; + // unsigned int kzero = k; unsigned int ke = k; unsigned int kw = neighborX[k]; unsigned int kn = k; diff --git a/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp b/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp index 5f209e3556457628ed45d91544d9599330ac3ed4..c5f391e5a75bb59ce599a603b7c824a387f4615f 100644 --- a/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp +++ b/src/gpu/VirtualFluids_GPU/Temperature/FindQTemp.cpp @@ -18,8 +18,8 @@ void findTempPress(Parameter* para) unsigned int nnz = para->getParH(para->getCoarse())->gridNZ; int* geo_mat = para->getParH(para->getCoarse())->geo; unsigned int* kk = para->getParH(para->getCoarse())->k; - real TempBC = para->getTemperatureBC(); - real VelBC = para->getVelocity(); + // real TempBC = para->getTemperatureBC(); + // real VelBC = para->getVelocity(); TempPressforBoundaryConditions Temp = para->getParH(para->getCoarse())->TempPress; Temp.kTemp = 0; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -139,7 +139,7 @@ void findTempVel(Parameter* para) int ny = para->getParH(para->getCoarse())->ny; unsigned int nnx = para->getParH(para->getCoarse())->gridNX; unsigned int nny = para->getParH(para->getCoarse())->gridNY; - unsigned int nnz = para->getParH(para->getCoarse())->gridNZ; + // unsigned int nnz = para->getParH(para->getCoarse())->gridNZ; int* geo_mat = para->getParH(para->getCoarse())->geo; unsigned int* kk = para->getParH(para->getCoarse())->k; real TempBC = para->getTemperatureBC(); @@ -217,7 +217,7 @@ void findKforTempVel(Parameter* para) int ny = para->getParH(para->getCoarse())->ny; unsigned int nnx = para->getParH(para->getCoarse())->gridNX; unsigned int nny = para->getParH(para->getCoarse())->gridNY; - unsigned int nnz = para->getParH(para->getCoarse())->gridNZ; + // unsigned int nnz = para->getParH(para->getCoarse())->gridNZ; int* geo_mat = para->getParH(para->getCoarse())->geo; TempVelforBoundaryConditions Temp = para->getParH(para->getCoarse())->TempVel; Temp.kTemp = 0;