diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 259eb8342cc74704e265e1013fa2bc5dcfc05a90..d9755e3fa2579df69c8dbf246012f19a002b2a5a 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -67,6 +67,35 @@ gcc_12: - export CC=gcc - export CXX=g++ +############################################################################### +gcc_12_float: + extends: .gnu_build_template + + before_script: + - export CC=gcc + - export CXX=g++ + + script: + - export CCACHE_BASEDIR=$CI_PROJECT_DIR + - export CCACHE_DIR=$CI_PROJECT_DIR/cache + - export CCACHE_COMPILERCHECK=content + - ccache --zero-stats + - ccache --show-stats + - $CXX --version + - $CC --version + - cmake --version + - mpirun --version + - mkdir -p $CI_PROJECT_DIR/$BUILD_FOLDER + - cd $CI_PROJECT_DIR/$BUILD_FOLDER + - rm -r -f ./* + - cmake .. -LAH + --preset=make_all + -DVF_ENABLE_DOUBLE_ACCURACY=OFF + -DVF_ENABLE_WARNINGS_AS_ERRORS=ON + -DCMAKE_CUDA_ARCHITECTURES=70 + - make -j4 + - ccache --show-stats + ############################################################################### clang_15: extends: .gnu_build_template diff --git a/apps/cpu/AcousticPulse/CMakeLists.txt b/apps/cpu/AcousticPulse/CMakeLists.txt deleted file mode 100644 index 891fafd8a8312d854b7b471490ba0042be3fc90d..0000000000000000000000000000000000000000 --- a/apps/cpu/AcousticPulse/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) - -######################################################## -## C++ PROJECT ### -######################################################## -PROJECT(AcousticPulse) - -INCLUDE(${APPS_ROOT}/IncludsList.cmake) - -################################################################# -### LOCAL FILES ### -################################################################# -FILE(GLOB SPECIFIC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp ) - -SET(ALL_SOURCES ${ALL_SOURCES} ${SPECIFIC_FILES}) -SOURCE_GROUP(src FILES ${SPECIFIC_FILES}) - -SET(CAB_ADDITIONAL_LINK_LIBRARIES VirtualFluids) - -################################################################# -### CREATE PROJECT ### -################################################################# -CREATE_CAB_PROJECT(ap BINARY) diff --git a/apps/cpu/AcousticPulse/ap.cpp b/apps/cpu/AcousticPulse/ap.cpp deleted file mode 100644 index 1ef22dd18a9d34cf476877f2b1c8c6edcca1d79e..0000000000000000000000000000000000000000 --- a/apps/cpu/AcousticPulse/ap.cpp +++ /dev/null @@ -1,261 +0,0 @@ -#include <iostream> -#include <string> - -#include "VirtualFluids.h" - -using namespace std; - - -void run() -{ - try - { - SPtr<vf::parallel::Communicator> comm = vf::parallel::MPICommunicator::getInstance(); - int myid = comm->getProcessID(); - - int numOfThreads = 4; - double availMem = 5e9; - - //40 - //string pathname = "d:/temp/AcousticPulse40Cube2y_test"; - //double endTime = 20; - //double outTime = 20; - //real dx = 0.05; - - //80 - //string pathname = "d:/temp/AcousticPulse80Cube2y"; - //double endTime = 40; - //double outTime = 40; - //real dx = 0.025; - - //160 - //string pathname = "d:/temp/AcousticPulse160Cube2y"; - //double endTime = 80; - //double outTime = 80; - //real dx = 0.0125; - - //real dx = 0.1; - //real dx = 1.66666666667e-2; //120 - - //real rhoLB = 0.0; - //real nuLB = 3.97e-7; - - ////////////////////////////////////////////////////////////////////////// - //DLR-F16 test - ////dx_coarse = 0.003 mm - string pathname = "d:/temp/AcousticPulseXZ-4th-0.003"; - int endTime = 20; - double outTime = 20; - real dx = 0.003; - real rhoLB = 0.0; - real nuLB = 8.66025e-6; - ////////////////////////////////////////////////////////////////////////// - ////dx_coarse = 0.0015 mm - //string pathname = "d:/temp/AcousticPulseXZ-4th-0.0015"; - //double endTime = 40; - //double outTime = 40; - //real dx = 0.0015; - //real rhoLB = 0.0; - //real nuLB = 8.66025e-6*2.0; - //////////////////////////////////////////////////////////////////////////// - ////dx_coarse = 0.00075 mm - //string pathname = "d:/temp/AcousticPulseXZ-4th-0.00075"; - //double endTime = 80; - //double outTime = 80; - //real dx = 0.00075; - //real rhoLB = 0.0; - //real nuLB = 8.66025e-6*4.0; - ////////////////////////////////////////////////////////////////////////// - - SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter()); - - int baseLevel = 0; - int refineLevel = 1; - - //bounding box - double g_minX1 = -0.06; - double g_minX2 = -0.06; - double g_minX3 = -0.06; - - double g_maxX1 = 0.06; - double g_maxX2 = 0.06; - double g_maxX3 = 0.06; - - //double g_minX1 = -1; - //double g_minX2 = -1; - //double g_minX3 = -1; - - //double g_maxX1 = 1; - //double g_maxX2 = 1; - //double g_maxX3 = 1; - - vector<int> blocknx(3); - blocknx[0] = 10; - blocknx[1] = 10; - blocknx[2] = 10; - - //geometry - SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3)); - if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); - - - double blockLength = blocknx[0] * dx; - - SPtr<Grid3D> grid(new Grid3D(comm)); - grid->setDeltaX(dx); - grid->setBlockNX(blocknx[0], blocknx[1], blocknx[2]); - grid->setPeriodicX1(true); - grid->setPeriodicX2(true); - grid->setPeriodicX3(true); - - - GenBlocksGridVisitor genBlocks(gridCube); - grid->accept(genBlocks); - - SPtr<GbObject3D> refCube(new GbCuboid3D(-0.02,-0.02,-0.02,0.02,0.02,0.02)); - if (myid==0) GbSystem3D::writeGeoObject(refCube.get(), pathname+"/geo/refCube", WbWriterVtkXmlBinary::getInstance()); - - if (refineLevel>0) - { - if (myid==0) UBLOG(logINFO, "Refinement - start"); - RefineCrossAndInsideGbObjectHelper refineHelper(grid, refineLevel, comm); - refineHelper.addGbObject(refCube, refineLevel); - refineHelper.refine(); - if (myid==0) UBLOG(logINFO, "Refinement - end"); - } - - SPtr<CoProcessor> ppblocks(new WriteBlocksCoProcessor(grid, SPtr<UbScheduler>(new UbScheduler(1)), pathname, WbWriterVtkXmlBinary::getInstance(), comm)); - - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::B)); - InteractorsHelper intHelper(grid, metisVisitor); - intHelper.selectBlocks(); - - ppblocks->process(0); - ppblocks.reset(); - - - unsigned long long numberOfBlocks = (unsigned long long)grid->getNumberOfBlocks(); - int ghostLayer = 3; - unsigned long long numberOfNodesPerBlock = (unsigned long long)(blocknx[0])* (unsigned long long)(blocknx[1])* (unsigned long long)(blocknx[2]); - unsigned long long numberOfNodes = numberOfBlocks * numberOfNodesPerBlock; - unsigned long long numberOfNodesPerBlockWithGhostLayer = numberOfBlocks * (blocknx[0] + ghostLayer) * (blocknx[1] + ghostLayer) * (blocknx[2] + ghostLayer); - double needMemAll = double(numberOfNodesPerBlockWithGhostLayer*(27 * sizeof(double) + sizeof(int) + sizeof(float) * 4)); - double needMem = needMemAll / double(comm->getNumberOfProcesses()); - - if (myid == 0) - { - UBLOG(logINFO, "Number of blocks = " << numberOfBlocks); - UBLOG(logINFO, "Number of nodes = " << numberOfNodes); - int minInitLevel = grid->getCoarsestInitializedLevel(); - int maxInitLevel = grid->getFinestInitializedLevel(); - for (int level = minInitLevel; level <= maxInitLevel; level++) - { - int nobl = grid->getNumberOfBlocks(level); - UBLOG(logINFO, "Number of blocks for level " << level << " = " << nobl); - UBLOG(logINFO, "Number of nodes for level " << level << " = " << nobl*numberOfNodesPerBlock); - } - UBLOG(logINFO, "Necessary memory = " << needMemAll << " bytes"); - UBLOG(logINFO, "Necessary memory per process = " << needMem << " bytes"); - UBLOG(logINFO, "Available memory per process = " << availMem << " bytes"); - } - - double bulckViscosity = 10.0*nuLB; - SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new K17CompressibleNavierStokes()); - //dynamicPointerCast<K17CompressibleNavierStokes>(kernel)->setBulkViscosity(bulckViscosity); - //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new K15CompressibleNavierStokes()); - //dynamicPointerCast<K15CompressibleNavierStokes>(kernel)->setBulkOmegaToOmega(true); - // - SPtr<BCProcessor> bcProcessor(new BCProcessor()); - - kernel->setBCProcessor(bcProcessor); - - SetKernelBlockVisitor kernelVisitor(kernel, nuLB, availMem, needMem); - grid->accept(kernelVisitor); - - if (refineLevel>0) - { - SetUndefinedNodesBlockVisitor undefNodesVisitor; - grid->accept(undefNodesVisitor); - } - - //set connectors - //SPtr<Interpolator> iProcessor(new CompressibleOffsetInterpolator()); - SPtr<Interpolator> iProcessor(new CompressibleOffsetMomentsInterpolator()); - //dynamicPointerCast<CompressibleOffsetMomentsInterpolator>(iProcessor)->setBulkViscosity(nuLB, bulckViscosity); - SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nuLB, iProcessor); - - UBLOG(logINFO, "SetConnectorsBlockVisitor:start"); - grid->accept(setConnsVisitor); - UBLOG(logINFO, "SetConnectorsBlockVisitor:end"); - - mu::Parser fctRoh; - //z - //fctRoh.SetExpr("epsilon*exp(-alpha*(x1*x1+x2*x2))"); - //x - //fctRoh.SetExpr("epsilon*exp(-alpha*(x3*x3+x2*x2))"); - //y - fctRoh.SetExpr("epsilon*exp(-alpha*scaleFactor*(x3*x3+x1*x1))"); - //fctRoh.SetExpr("epsilon*exp(-alpha*(x3*x3+x1*x1))"); - - fctRoh.DefineConst("epsilon", 1e-3); - fctRoh.DefineConst("alpha", log(2.0)/(0.01)); - fctRoh.DefineConst("scaleFactor", 277.777777779); - //fctRoh.SetExpr("x1*0.001"); - - //initialization of distributions - InitDistributionsBlockVisitor initVisitor; - initVisitor.setRho(fctRoh); - grid->accept(initVisitor); - - //Postrozess - SPtr<UbScheduler> geoSch(new UbScheduler(1)); - SPtr<CoProcessor> ppgeo(new WriteBoundaryConditionsCoProcessor(grid, geoSch, pathname, WbWriterVtkXmlBinary::getInstance(), comm)); - ppgeo->process(0); - ppgeo.reset(); - - if (myid==0) UBLOG(logINFO, "Preprozess - end"); - - if (myid == 0) - { - UBLOG(logINFO, "PID = " << myid << " Total Physical Memory (RAM): " << Utilities::getTotalPhysMem()); - UBLOG(logINFO, "PID = " << myid << " Physical Memory currently used: " << Utilities::getPhysMemUsed()); - UBLOG(logINFO, "PID = " << myid << " Physical Memory currently used by current process: " << Utilities::getPhysMemUsedByMe()); - } - - SPtr<UbScheduler> visSch(new UbScheduler(outTime)); - SPtr<WriteMacroscopicQuantitiesCoProcessor> writeMQCoProcessor(new WriteMacroscopicQuantitiesCoProcessor(grid, visSch, pathname, WbWriterVtkXmlBinary::getInstance(), conv, comm)); - writeMQCoProcessor->process(0); - - SPtr<UbScheduler> nupsSch(new UbScheduler(10, 30, 100)); - std::shared_ptr<NUPSCounterCoProcessor> nupsCoProcessor(new NUPSCounterCoProcessor(grid, nupsSch, numOfThreads, comm)); - - SPtr<UbScheduler> stepGhostLayer(new UbScheduler(1)); - SPtr<Calculator> calculator(new BasicCalculator(grid, stepGhostLayer, endTime)); - calculator->addCoProcessor(nupsCoProcessor); - calculator->addCoProcessor(writeMQCoProcessor); - - //omp_set_num_threads(1); - - if (myid==0) UBLOG(logINFO, "Simulation-start"); - calculator->calculate(); - if (myid==0) UBLOG(logINFO, "Simulation-end"); - } - catch (std::exception& e) - { - cerr << e.what() << endl << flush; - } - catch (std::string& s) - { - cerr << s << endl; - } - catch (...) - { - cerr << "unknown exception" << endl; - } - -} -int main(int argc, char* argv[]) -{ - run(); -} - diff --git a/apps/cpu/FlowAroundCylinder/CMakeLists.txt b/apps/cpu/FlowAroundCylinder/CMakeLists.txt deleted file mode 100644 index 0fcac4f761ea1ec3d57ee367853a91ba199f03f2..0000000000000000000000000000000000000000 --- a/apps/cpu/FlowAroundCylinder/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -######################################################## -## C++ PROJECT ### -######################################################## -PROJECT(cylinder) - -vf_add_library(BUILDTYPE binary PRIVATE_LINK cpu_core basics ${MPI_CXX_LIBRARIES} FILES cylinder.cpp ) diff --git a/apps/cpu/FlowAroundCylinder/cylinder.cfg b/apps/cpu/FlowAroundCylinder/cylinder.cfg deleted file mode 100644 index 1869a668ad6a8a456a5b131234c082b05d9b17be..0000000000000000000000000000000000000000 --- a/apps/cpu/FlowAroundCylinder/cylinder.cfg +++ /dev/null @@ -1,22 +0,0 @@ -pathOut = ./output/FlowAroundCylinder - -numOfThreads = 8 -availMem = 15e9 -refineLevel = 1 -blockNx = 25 41 41 -uLB = 0.001 -#dx = 0.005 -dx = 0.01 - -logToFile = false - -newStart = true -restartStep = 1000 - -cpStart = 1000 -cpStep = 1000 - -outTime = 10 -endTime = 100 - -nupsStep = 100 100 10000000 \ No newline at end of file diff --git a/apps/cpu/FlowAroundCylinder/cylinder.cpp b/apps/cpu/FlowAroundCylinder/cylinder.cpp deleted file mode 100644 index 1d11dc93ae82ec5005be11bfe5bf5eb3b96b092f..0000000000000000000000000000000000000000 --- a/apps/cpu/FlowAroundCylinder/cylinder.cpp +++ /dev/null @@ -1,350 +0,0 @@ -#include <iostream> -#include <string> - -#include "K17CompressibleNavierStokes.h" -#include "VirtualFluids.h" - -using namespace std; - - -////////////////////////////////////////////////////////////////////////// -void run(string configname) -{ - using namespace vf::lbm::dir; - - try - { - //DEBUG/////////////////////////////////////// - //Sleep(30000); - ///////////////////////////////////////////// - vf::basics::ConfigurationFile config; - config.load(configname); - - string pathOut = config.getValue<string>("pathOut"); - real uLB = config.getValue<real>("uLB"); - real restartStep = config.getValue<real>("restartStep"); - real cpStart = config.getValue<real>("cpStart"); - real cpStep = config.getValue<real>("cpStep"); - real endTime = config.getValue<real>("endTime"); - real outTime = config.getValue<real>("outTime"); - real availMem = config.getValue<real>("availMem"); - int refineLevel = config.getValue<int>("refineLevel"); - bool logToFile = config.getValue<bool>("logToFile"); - vector<real> nupsStep = config.getVector<real>("nupsStep"); - bool newStart = config.getValue<bool>("newStart"); - int numOfThreads = config.getValue<int>("numOfThreads"); - vector<int> blockNx = config.getVector<int>("blockNx"); - real dx = config.getValue<real>("dx"); - - SPtr<vf::parallel::Communicator> comm = vf::parallel::MPICommunicator::getInstance(); - int myid = comm->getProcessID(); - - if (logToFile) - { -#if defined(__unix__) - if (myid==0) - { - const char* str = pathOut.c_str(); - mkdir(str, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH); - } -#endif - - if (myid==0) - { - stringstream logFilename; - logFilename<<pathOut+"/logfile"+UbSystem::toString(UbSystem::getTimeStamp())+".txt"; - UbLog::output_policy::setStream(logFilename.str()); - } - } - - if (myid == 0) UBLOG(logINFO, "Test case: flow around cylinder"); - - - - real L1 = 2.5; - real L2, L3, H; - L2 = L3 = H = 0.41; - - real Re = 20.0; - real radius = 0.05; - real rhoReal = 1.0; //kg/m^3 - real uReal = 0.45;//m/s - real nueReal = (uReal*radius*2.0)/Re; - - real rhoLB = 0.0; - real nueLB = (((4.0/9.0)*uLB)*2.0*(radius/dx))/Re; - - SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter()); - -// const int baseLevel = 0; - - SPtr<Grid3D> grid(new Grid3D(comm)); - - //BC - SPtr<BC> noSlipAdapter(new NoSlipBC()); - noSlipAdapter->setBCStrategy(SPtr<BCStrategy>(new NoSlipInterpolated())); - - mu::Parser fct; - fct.SetExpr("16*U*x2*x3*(H-x2)*(H-x3)/H^4"); - fct.DefineConst("U", uLB); - fct.DefineConst("H", H); - SPtr<BC> velBC(new VelocityBC(true, false, false, fct, 0, BCFunction::INFCONST)); - velBC->setBCStrategy(SPtr<BCStrategy>(new VelocityWithPressureInterpolated())); - - SPtr<BC> denBC(new PressureBC(rhoLB)); - denBC->setBCStrategy(SPtr<BCStrategy>(new OutflowNonReflecting())); - - BoundaryConditionsBlockVisitor bcVisitor; - - ////////////////////////////////////////////////////////////////////////// - //restart - SPtr<UbScheduler> rSch(new UbScheduler(cpStep, cpStart)); - MPIIORestartSimulationObserver rcp(grid, rSch, pathOut, comm); - ////////////////////////////////////////////////////////////////////////// - - ////cylinder - SPtr<GbObject3D> cylinder(new GbCylinder3D(0.5, 0.2, -0.1, 0.5, 0.2, L3+0.1, radius)); - GbSystem3D::writeGeoObject(cylinder.get(), pathOut+"/geo/cylinder", WbWriterVtkXmlBinary::getInstance()); - - SPtr<D3Q27Interactor> cylinderInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(cylinder, grid, noSlipAdapter, Interactor3D::SOLID)); - - if (newStart) - { - if (myid==0) - { - UBLOG(logINFO, "Number of processes = "<<comm->getNumberOfProcesses()); - UBLOG(logINFO, "Number of threads = "<<numOfThreads); - UBLOG(logINFO, "path = "<<pathOut); - UBLOG(logINFO, "L = "<<L1/dx); - UBLOG(logINFO, "H = "<<H/dx); - UBLOG(logINFO, "uReal = "<<uReal<<" m/s"); - UBLOG(logINFO, "rhoReal = "<<rhoReal<<" kg/m^3"); - UBLOG(logINFO, "nueReal = "<<nueReal<<" m^2/s"); - UBLOG(logINFO, "uLB = "<<uLB); - UBLOG(logINFO, "rhoLB = "<<rhoLB); - UBLOG(logINFO, "nueLB = "<<nueLB); - UBLOG(logINFO, "Re = "<<Re); - UBLOG(logINFO, "dx coarse= "<<dx); - UBLOG(logINFO, "dx fine = "<<dx/(1<<refineLevel) ); - UBLOG(logINFO, "Number of level = "<<refineLevel+1); - UBLOG(logINFO, "Preprozess - start"); - } - - SPtr<GbObject3D> refCylinder(new GbCylinder3D(0.5, 0.2, -0.1, 0.5, 0.2, L3+0.1, radius+7.0*dx/(1<<refineLevel))); - GbSystem3D::writeGeoObject(refCylinder.get(), pathOut+"/geo/refCylinder", WbWriterVtkXmlBinary::getInstance()); - - //bounding box - real g_minX1 = 0.0; - real g_minX2 = 0.0; - real g_minX3 = 0.0; - - real g_maxX1 = L1; - real g_maxX2 = L2; - real g_maxX3 = L3; - - SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3)); - if (myid==0) GbSystem3D::writeGeoObject(gridCube.get(), pathOut+"/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); - - const int blocknx1 = blockNx[0]; - const int blocknx2 = blockNx[1]; - const int blocknx3 = blockNx[2]; - - real blockLength = blocknx1*dx; - - grid->setDeltaX(dx); - grid->setBlockNX(blocknx1, blocknx2, blocknx3); - - GenBlocksGridVisitor genBlocks(gridCube); - grid->accept(genBlocks); - - //walls - GbCuboid3DPtr addWallYmin(new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3-blockLength, g_maxX1+blockLength, g_minX2, g_maxX3+blockLength)); - if (myid==0) GbSystem3D::writeGeoObject(addWallYmin.get(), pathOut+"/geo/addWallYmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallYmax(new GbCuboid3D(g_minX1-blockLength, g_maxX2, g_minX3-blockLength, g_maxX1+blockLength, g_maxX2+blockLength, g_maxX3+blockLength)); - if (myid==0) GbSystem3D::writeGeoObject(addWallYmax.get(), pathOut+"/geo/addWallYmax", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmin(new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3-blockLength, g_maxX1+blockLength, g_maxX2+blockLength, g_minX3)); - if (myid==0) GbSystem3D::writeGeoObject(addWallZmin.get(), pathOut+"/geo/addWallZmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmax(new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_maxX3, g_maxX1+blockLength, g_maxX2+blockLength, g_maxX3+blockLength)); - if (myid==0) GbSystem3D::writeGeoObject(addWallZmax.get(), pathOut+"/geo/addWallZmax", WbWriterVtkXmlASCII::getInstance()); - - //inflow - GbCuboid3DPtr geoInflow(new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3-blockLength, g_minX1, g_maxX2+blockLength, g_maxX3+blockLength)); - if (myid==0) GbSystem3D::writeGeoObject(geoInflow.get(), pathOut+"/geo/geoInflow", WbWriterVtkXmlASCII::getInstance()); - - //outflow - GbCuboid3DPtr geoOutflow(new GbCuboid3D(g_maxX1, g_minX2-blockLength, g_minX3-blockLength, g_maxX1+blockLength, g_maxX2+blockLength, g_maxX3+blockLength)); - if (myid==0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathOut+"/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance()); - - SPtr<SimulationObserver> ppblocks(new WriteBlocksSimulationObserver(grid, SPtr<UbScheduler>(new UbScheduler(1)), pathOut, WbWriterVtkXmlBinary::getInstance(), comm)); - - if (refineLevel>0) - { - if (myid==0) UBLOG(logINFO, "Refinement - start"); - RefineCrossAndInsideGbObjectHelper refineHelper(grid, refineLevel, comm); - refineHelper.addGbObject(refCylinder, refineLevel); - refineHelper.refine(); - if (myid==0) UBLOG(logINFO, "Refinement - end"); - } - - //walls - SPtr<D3Q27Interactor> addWallYminInt(new D3Q27Interactor(addWallYmin, grid, noSlipAdapter, Interactor3D::SOLID)); - SPtr<D3Q27Interactor> addWallYmaxInt(new D3Q27Interactor(addWallYmax, grid, noSlipAdapter, Interactor3D::SOLID)); - SPtr<D3Q27Interactor> addWallZminInt(new D3Q27Interactor(addWallZmin, grid, noSlipAdapter, Interactor3D::SOLID)); - SPtr<D3Q27Interactor> addWallZmaxInt(new D3Q27Interactor(addWallZmax, grid, noSlipAdapter, Interactor3D::SOLID)); - - //inflow - SPtr<D3Q27Interactor> inflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoInflow, grid, velBC, Interactor3D::SOLID)); - - //outflow - SPtr<D3Q27Interactor> outflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, denBC, Interactor3D::SOLID)); - - - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, d00M)); - InteractorsHelper intHelper(grid, metisVisitor); - intHelper.addInteractor(cylinderInt); - intHelper.addInteractor(addWallYminInt); - intHelper.addInteractor(addWallYmaxInt); - intHelper.addInteractor(addWallZminInt); - intHelper.addInteractor(addWallZmaxInt); - intHelper.addInteractor(inflowInt); - intHelper.addInteractor(outflowInt); - intHelper.selectBlocks(); - - - ppblocks->update(0); - ppblocks.reset(); - - unsigned long long numberOfBlocks = (unsigned long long)grid->getNumberOfBlocks(); - int ghostLayer = 3; - unsigned long long numberOfNodesPerBlock = (unsigned long long)(blockNx[0])* (unsigned long long)(blockNx[1])* (unsigned long long)(blockNx[2]); - unsigned long long numberOfNodes = numberOfBlocks * numberOfNodesPerBlock; - unsigned long long numberOfNodesPerBlockWithGhostLayer = numberOfBlocks * (blockNx[0]+ghostLayer) * (blockNx[1]+ghostLayer) * (blockNx[2]+ghostLayer); - real needMemAll = real(numberOfNodesPerBlockWithGhostLayer*(27*sizeof(real)+sizeof(int)+sizeof(float)*4)); - real needMem = needMemAll/real(comm->getNumberOfProcesses()); - - if (myid==0) - { - UBLOG(logINFO, "Number of blocks = "<<numberOfBlocks); - UBLOG(logINFO, "Number of nodes = "<<numberOfNodes); - int minInitLevel = grid->getCoarsestInitializedLevel(); - int maxInitLevel = grid->getFinestInitializedLevel(); - for (int level = minInitLevel; level<=maxInitLevel; level++) - { - int nobl = grid->getNumberOfBlocks(level); - UBLOG(logINFO, "Number of blocks for level "<<level<<" = "<<nobl); - UBLOG(logINFO, "Number of nodes for level "<<level<<" = "<<nobl*numberOfNodesPerBlock); - } - UBLOG(logINFO, "Necessary memory = "<<needMemAll<<" bytes"); - UBLOG(logINFO, "Necessary memory per process = "<<needMem<<" bytes"); - UBLOG(logINFO, "Available memory per process = "<<availMem<<" bytes"); - } - - SPtr<LBMKernel> kernel(new K17CompressibleNavierStokes()); - - SPtr<BCSet> bcProc(new BCSet()); - kernel->setBCSet(bcProc); - - SetKernelBlockVisitor kernelVisitor(kernel, nueLB, availMem, needMem); - grid->accept(kernelVisitor); - - if (refineLevel>0) - { - SetUndefinedNodesBlockVisitor undefNodesVisitor; - grid->accept(undefNodesVisitor); - } - - intHelper.setBC(); - - //initialization of distributions - InitDistributionsBlockVisitor initVisitor; - initVisitor.setVx1(fct); - grid->accept(initVisitor); - -; - grid->accept(bcVisitor); - - //Postrozess - SPtr<UbScheduler> geoSch(new UbScheduler(1)); - SPtr<SimulationObserver> ppgeo( - new WriteBoundaryConditionsSimulationObserver(grid, geoSch, pathOut, WbWriterVtkXmlBinary::getInstance(), comm)); - ppgeo->update(0); - ppgeo.reset(); - - if (myid==0) UBLOG(logINFO, "Preprozess - end"); - } - else - { - rcp.restart((int)restartStep); - grid->setTimeStep(restartStep); - - grid->accept(bcVisitor); - } - - //set connectors - OneDistributionSetConnectorsBlockVisitor setConnsVisitor(comm); - grid->accept(setConnsVisitor); - - SPtr<Interpolator> iProcessor(new CompressibleOffsetMomentsInterpolator()); - SetInterpolationConnectorsBlockVisitor setInterConnsVisitor(comm, nueLB, iProcessor); - grid->accept(setInterConnsVisitor); - - SPtr<UbScheduler> stepSch(new UbScheduler(outTime)); - - SPtr<SimulationObserver> writeMQSimulationObserver(new WriteMacroscopicQuantitiesSimulationObserver(grid, stepSch, pathOut, WbWriterVtkXmlBinary::getInstance(), conv, comm)); - - real area = (2.0*radius*H)/(dx*dx); - real v = 4.0*uLB/9.0; - SPtr<UbScheduler> forceSch(new UbScheduler(100)); - SPtr<CalculateForcesSimulationObserver> fp = make_shared<CalculateForcesSimulationObserver>(grid, forceSch, pathOut + "/results/forces.txt", comm, v, area); - fp->addInteractor(cylinderInt); - - SPtr<UbScheduler> nupsSch(new UbScheduler(nupsStep[0], nupsStep[1], nupsStep[2])); - std::shared_ptr<SimulationObserver> nupsSimulationObserver(new NUPSCounterSimulationObserver(grid, nupsSch, numOfThreads, comm)); - -#ifdef _OPENMP - omp_set_num_threads(numOfThreads); -#endif - SPtr<UbScheduler> stepGhostLayer(new UbScheduler(1)); - SPtr<Simulation> simulation(new Simulation(grid, stepGhostLayer, endTime)); - simulation->addSimulationObserver(nupsSimulationObserver); - simulation->addSimulationObserver(fp); - simulation->addSimulationObserver(writeMQSimulationObserver); - - if(myid == 0) UBLOG(logINFO,"Simulation-start"); - simulation->run(); - if(myid == 0) UBLOG(logINFO,"Simulation-end"); - } - catch(std::exception& e) - { - cerr << e.what() << endl << flush; - } - catch(std::string& s) - { - cerr << s << endl; - } - catch(...) - { - cerr << "unknown exception" << endl; - } - -} -////////////////////////////////////////////////////////////////////////// -int main(int argc, char* argv[]) -{ - if (argv!=NULL) - { - if (argv[1]!=NULL) - { - run(string(argv[1])); - } - else - { - cout<<"Configuration file must be set!: "<<argv[0]<<" <config file>"<<endl<<std::flush; - } - } - return 0; -} - diff --git a/apps/cpu/FlowAroundCylinder/cylinder.cpp.old b/apps/cpu/FlowAroundCylinder/cylinder.cpp.old deleted file mode 100644 index f411506ed807af5d1d6c0c8b5b099d2dfde79f14..0000000000000000000000000000000000000000 --- a/apps/cpu/FlowAroundCylinder/cylinder.cpp.old +++ /dev/null @@ -1,755 +0,0 @@ -#include <iostream> -#include <string> - -#include <vfluids.h> - -using namespace std; - - -void run(const char *cstr) -{ - try - { - string machine = QUOTEME(CAB_MACHINE); - string pathname; - int numOfThreads = 1; - double availMem = 0; - - CommunicatorPtr comm = vf::parallel::MPICommunicator::getInstance(); - int myid = comm->getProcessID(); - - if(machine == "BOMBADIL") - { - pathname = "d:/temp/cylinder_20nu"; - numOfThreads = 4; - availMem = 10.0e9; - } - else if(machine == "M01" || machine == "M02") - { - pathname = "/work/koskuche/scratch/cylinder_Re20nu2l"; - numOfThreads = 1; - availMem = 12.0e9; - - if(myid ==0) - { - stringstream logFilename; - logFilename << pathname + "/logfile"+UbSystem::toString(UbSystem::getTimeStamp())+".txt"; - UbLog::output_policy::setStream(logFilename.str()); - } - } - else throw UbException(UB_EXARGS, "unknown CAB_MACHINE"); - - double dx = 0.1; - - double L1 = 2.5; - double L2, L3, H; - L2 = L3 = H = 0.41; - - real radius = 0.05; - real rhoReal = 1.0; //kg/m^3 - real uReal = 0.45;//m/s - real uLB = 0.05; - real Re = 20.0; - real rhoLB = 0.0; - real l = L2 / dx; - - //LBMUnitConverterPtr conv = LBMUnitConverterPtr(new LBMUnitConverter(1.0, 1/sqrt(3.0)*(uReal/uLB), 1.0, 1.0/dx, dx*dx*dx)); - LBMUnitConverterPtr conv = LBMUnitConverterPtr(new LBMUnitConverter()); - - const int baseLevel = 0; - const int refineLevel = 3; - - //obstacle - GbObject3DPtr cylinder(new GbCylinder3D(0.5, 0.2, -0.1, 0.5, 0.2, L3+0.1, radius)); - GbSystem3D::writeGeoObject(cylinder.get(),pathname + "/geo/cylinder", WbWriterVtkXmlBinary::getInstance()); - - GbObject3DPtr refCylinder(new GbCylinder3D(0.5, 0.2, -0.1, 0.5, 0.2, L3+0.1, radius+2.0*dx/(1<<refineLevel))); - GbSystem3D::writeGeoObject(refCylinder.get(),pathname + "/geo/refCylinder", WbWriterVtkXmlBinary::getInstance()); - - D3Q27InteractorPtr cylinderInt; - - //bounding box - double d_minX1 = 0.0; - double d_minX2 = 0.0; - double d_minX3 = 0.0; - - double d_maxX1 = L1; - double d_maxX2 = L2; - double d_maxX3 = L3; - - double offs = dx; - - //double g_minX1 = d_minX1-offs-0.499999*dx; - double g_minX1 = d_minX1-offs; - double g_minX2 = d_minX2-offs; - double g_minX3 = d_minX3-offs; - - double g_maxX1 = d_maxX1+offs; - double g_maxX2 = d_maxX2+offs; - double g_maxX3 = d_maxX3+offs; - - GbObject3DPtr gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3)); - - const int blocknx1 = 8; - const int blocknx2 = 8; - const int blocknx3 = 8; - - dx = (0.41+2.0*dx)/(10.0*(int)blocknx2); - - real nueLB = (((4.0/9.0)*uLB)*2.0*(radius/dx))/Re; - - double blockLength = blocknx1*dx; - - //refinement area - double rf = cylinder->getLengthX1()/4; - GbObject3DPtr refineCube(new GbCuboid3D(cylinder->getX1Minimum()-rf, cylinder->getX2Minimum()-rf, cylinder->getX3Minimum(), - cylinder->getX1Maximum()+rf, cylinder->getX2Maximum()+rf, cylinder->getX3Maximum())); -// GbObject3DPtr refineCube(new GbCuboid3D(g_minX1 + 7.05*blockLength, g_minX2 + 3.05*blockLength, cylinder->getX3Minimum(), -// g_minX1 + 12.95*blockLength, g_maxX2 - 3.05*blockLength, cylinder->getX3Maximum())); - - Grid3DPtr grid(new Grid3D(comm)); - - UbSchedulerPtr rSch(new UbScheduler(100000, 100000)); - //RestartPostprocessorPtr rp(new RestartPostprocessor(grid, rSch, comm, pathname+"/checkpoints", RestartPostprocessor::BINARY)); - - //UbSchedulerPtr emSch(new UbScheduler(1000, 1000)); - //EmergencyExitPostprocessor em(grid, emSch, pathname+"/checkpoints/emex.txt", rp, comm); - - std::string opt; - - if(cstr!= NULL) - opt = std::string(cstr); - - if/*(cstr== NULL)*/(cstr!= NULL) - { - opt = std::string(cstr); - - if(myid==0) UBLOG(logINFO,"Restart step: " << opt); - - //grid = rp->restart(UbSystem::stringTo<int>(opt)); - //rp->reconnect(); - - //cylinderInt = - - //set connectors - D3Q27InterpolationProcessorPtr iProcessor(new D3Q27OffsetInterpolationProcessor()); - D3Q27SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nueLB, iProcessor); - grid->accept( setConnsVisitor ); - - //domain decomposition - PQueuePartitioningGridVisitor pqPartVisitor(numOfThreads); - grid->accept(pqPartVisitor); - } - else - { - if(myid ==0) - { - UBLOG(logINFO,"Number of processes = " << comm->getNumberOfProcesses() ); - UBLOG(logINFO,"path = " << pathname ); - UBLOG(logINFO,"L = " << L1/dx ); - UBLOG(logINFO,"H = " << H/dx ); - UBLOG(logINFO,"v = " << uLB ); - UBLOG(logINFO,"rho = " << rhoLB ); - UBLOG(logINFO,"nue = " << nueLB ); - UBLOG(logINFO,"Re = " << Re ); - UBLOG(logINFO,"dx = " << dx ); - UBLOG(logINFO,"Number of level = " << refineLevel+1 ); - //UBLOG(logINFO,conv->toString() ); - UBLOG(logINFO,"Preprozess - start"); - } - - grid->setDeltaX(dx); - grid->setBlockNX(blocknx1, blocknx2, blocknx3); - - // UbTupleDouble6 bouningBox(gridCube->getX1Minimum(),gridCube->getX2Minimum(),gridCube->getX3Minimum(), - // gridCube->getX1Maximum(),gridCube->getX2Maximum(),gridCube->getX3Maximum()); - // UbTupleInt3 blockNx(blocknx1, blocknx2, blocknx3); - // UbTupleInt3 gridNx(8, 16, 16); - // grid = Grid3DPtr(new Grid3D(bouningBox, blockNx, gridNx)); - - if(myid ==0) GbSystem3D::writeGeoObject(gridCube.get(),pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); - if(myid ==0) GbSystem3D::writeGeoObject(refineCube.get(),pathname + "/geo/refineCube", WbWriterVtkXmlBinary::getInstance()); - - GenBlocksGridVisitor genBlocks; - genBlocks.addGeoObject(gridCube); - grid->accept(genBlocks); - - //walls - GbCuboid3DPtr addWallYmin (new GbCuboid3D(d_minX1-4.0*blockLength, d_minX2-4.0*blockLength, d_minX3-4.0*blockLength, d_maxX1+4.0*blockLength, d_minX2, d_maxX3+4.0*blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallYmin.get(), pathname+"/geo/addWallYmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmin (new GbCuboid3D(d_minX1-4.0*blockLength, d_minX2-4.0*blockLength, d_minX3-4.0*blockLength, d_maxX1+4.0*blockLength, d_maxX2+4.0*blockLength, d_minX3)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallZmin.get(), pathname+"/geo/addWallZmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallYmax (new GbCuboid3D(d_minX1-4.0*blockLength, d_maxX2, d_minX3-4.0*blockLength, d_maxX1+4.0*blockLength, d_maxX2+4.0*blockLength, d_maxX3+4.0*blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallYmax.get(), pathname+"/geo/addWallYmax", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmax (new GbCuboid3D(d_minX1-4.0*blockLength, d_minX2-4.0*blockLength, d_maxX3, d_maxX1+4.0*blockLength, d_maxX2+4.0*blockLength, d_maxX3+4.0*blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallZmax.get(), pathname+"/geo/addWallZmax", WbWriterVtkXmlASCII::getInstance()); - - //inflow - GbCuboid3DPtr geoInflow (new GbCuboid3D(d_minX1-4.0*blockLength, d_minX2-4.0*blockLength, d_minX3-4.0*blockLength, d_minX1, d_maxX2+4.0*blockLength, d_maxX3+4.0*blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(geoInflow.get(), pathname+"/geo/geoInflow", WbWriterVtkXmlASCII::getInstance()); - - //outflow - GbCuboid3DPtr geoOutflow (new GbCuboid3D(d_maxX1, d_minX2-4.0*blockLength, d_minX3-4.0*blockLength, d_maxX1+4.0*blockLength, d_maxX2+4.0*blockLength, d_maxX3+4.0*blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathname+"/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance()); - - BlocksPostprocessorPtr ppblocks(new BlocksPostprocessor(grid, UbSchedulerPtr(new UbScheduler(1)), pathname + "/grid/blocks", WbWriterVtkXmlBinary::getInstance(), comm)); - - if (refineLevel > 0) - { - if(myid == 0) UBLOG(logINFO,"Refinement - start"); - RefineCrossAndInsideGbObjectHelper refineHelper(grid, refineLevel); - //refineHelper.addGbObject(refineCube, refineLevel); - refineHelper.addGbObject(refCylinder, refineLevel); - refineHelper.refine(); - if(myid == 0) UBLOG(logINFO,"Refinement - end"); - } - - MetisPartitioningGridVisitor metisVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::B); - grid->accept( metisVisitor ); - - SolidBlocksHelper sd(grid, comm); - - int bbOption = 1; //0=simple Bounce Back, 1=quadr. BB - D3Q27BoundaryConditionAdapterPtr bcObst(new D3Q27NoSlipBCAdapter(bbOption)); - cylinderInt = D3Q27InteractorPtr ( new D3Q27Interactor(cylinder, grid, bcObst,Interactor3D::SOLID)); - - //walls - D3Q27InteractorPtr addWallYminInt(new D3Q27Interactor(addWallYmin, grid, bcObst,Interactor3D::SOLID)); - D3Q27InteractorPtr addWallZminInt(new D3Q27Interactor(addWallZmin, grid, bcObst,Interactor3D::SOLID)); - D3Q27InteractorPtr addWallYmaxInt(new D3Q27Interactor(addWallYmax, grid, bcObst,Interactor3D::SOLID)); - D3Q27InteractorPtr addWallZmaxInt(new D3Q27Interactor(addWallZmax, grid, bcObst,Interactor3D::SOLID)); - - mu::Parser fct; - fct.SetExpr("16*U*x2*x3*(H-x2)*(H-x3)/H^4"); - fct.DefineConst("U", uLB); - fct.DefineConst("H", H); - - //inflow - D3Q27BoundaryConditionAdapterPtr velBCAdapter(new D3Q27VelocityBCAdapter (true, false ,false ,fct, 0, D3Q27BCFunction::INFCONST)); - velBCAdapter->setSecondaryBcOption(2); - D3Q27InteractorPtr inflowInt = D3Q27InteractorPtr( new D3Q27Interactor(geoInflow, grid, velBCAdapter, Interactor3D::SOLID)); - - //outflow - D3Q27BoundaryConditionAdapterPtr denBCAdapter(new D3Q27DensityBCAdapter(rhoLB)); - D3Q27InteractorPtr outflowInt = D3Q27InteractorPtr( new D3Q27Interactor(geoOutflow, grid, denBCAdapter,Interactor3D::SOLID)); - - sd.addInteractor(cylinderInt); - sd.addInteractor(addWallYminInt); - sd.addInteractor(addWallZminInt); - sd.addInteractor(addWallYmaxInt); - sd.addInteractor(addWallZmaxInt); - sd.addInteractor(inflowInt); - sd.addInteractor(outflowInt); - - sd.deleteSolidBlocks(); - - grid->accept( metisVisitor ); - - sd.setTransBlocks(); - - ppblocks->update(0); - ppblocks.reset(); - - //set connectors - D3Q27InterpolationProcessorPtr iProcessor(new D3Q27IncompressibleOffsetInterpolationProcessor()); - D3Q27SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nueLB, iProcessor); - grid->accept( setConnsVisitor ); - - unsigned long nob = grid->getNumberOfBlocks(); - int gl = 3; - unsigned long nod = nob * (blocknx1+gl) * (blocknx2+gl) * (blocknx3+gl); - - double needMemAll = double(nod*(27*sizeof(double) + sizeof(int) + sizeof(float)*4)); - double needMem = needMemAll / double(comm->getNumberOfProcesses()); - - if(myid == 0) - { - UBLOG(logINFO,"Number of blocks = " << nob); - UBLOG(logINFO,"Number of nodes = " << nod); - UBLOG(logINFO,"Necessary memory = " << needMemAll << " bytes"); - UBLOG(logINFO,"Necessary memory per process = " << needMem << " bytes"); - UBLOG(logINFO,"Available memory per process = " << availMem << " bytes"); - } - - LBMKernel3DPtr kernel(new LBMKernelETD3Q27CCLB(blocknx1, blocknx2, blocknx3, LBMKernelETD3Q27CCLB::NORMAL)); - - BCProcessorPtr bcProc(new D3Q27ETBCProcessor()); - kernel->setBCProcessor(bcProc); - - SetKernelBlockVisitor kernelVisitor(kernel, nueLB, availMem, needMem); - grid->accept(kernelVisitor); - - if (refineLevel > 0) - { - D3Q27SetUndefinedNodesBlockVisitor undefNodesVisitor; - grid->accept(undefNodesVisitor); - } - - //walls - grid->addAndInitInteractor(addWallYminInt); - grid->addAndInitInteractor(addWallZminInt); - grid->addAndInitInteractor(addWallYmaxInt); - grid->addAndInitInteractor(addWallZmaxInt); - - //obstacle - grid->addAndInitInteractor(cylinderInt); - - //inflow - grid->addAndInitInteractor(inflowInt); - - //outflow - grid->addAndInitInteractor(outflowInt); - - //domain decomposition - PQueuePartitioningGridVisitor pqPartVisitor(numOfThreads); - grid->accept(pqPartVisitor); - - //initialization of distributions - D3Q27ETInitDistributionsBlockVisitor initVisitor(nueLB, rhoLB); - initVisitor.setVx1(fct); - grid->accept(initVisitor); - - //Postrozess - UbSchedulerPtr geoSch(new UbScheduler(1)); - D3Q27MacroscopicQuantitiesPostprocessorPtr ppgeo( - new D3Q27MacroscopicQuantitiesPostprocessor(grid, geoSch, pathname + "/grid/nodes", WbWriterVtkXmlBinary::getInstance(), conv, comm, true)); - ppgeo->update(0); - ppgeo.reset(); - - if(myid == 0) UBLOG(logINFO,"Preprozess - end"); - } - - double outTime = 10000.0; - UbSchedulerPtr visSch(new UbScheduler(outTime)); - //visSch->addSchedule(1000, 1000, 10000); - //visSch->addSchedule(10000, 10000, 50000); - //visSch->addSchedule(100, 100, 10000); - - D3Q27MacroscopicQuantitiesPostprocessor pp(grid, visSch, pathname + "/steps/step", WbWriterVtkXmlBinary::getInstance(), conv, comm); - - double fdx = grid->getDeltaX(grid->getFinestInitializedLevel()); - double point1[3] = {0.45, 0.20, 0.205}; - double point2[3] = {0.55, 0.20, 0.205}; - - D3Q27IntegrateValuesHelperPtr h1(new D3Q27IntegrateValuesHelper(grid, comm, - point1[0]-1.0*fdx, point1[1]-1.0*fdx, point1[2]-1.0*fdx, - point1[0], point1[1], point1[2])); - if(myid ==0) GbSystem3D::writeGeoObject(h1->getBoundingBox().get(),pathname + "/geo/iv1", WbWriterVtkXmlBinary::getInstance()); - D3Q27IntegrateValuesHelperPtr h2(new D3Q27IntegrateValuesHelper(grid, comm, - point2[0], point2[1]-1.0*fdx, point2[2]-1.0*fdx, - point2[0]+1.0*fdx, point2[1], point2[2])); - if(myid ==0) GbSystem3D::writeGeoObject(h2->getBoundingBox().get(),pathname + "/geo/iv2", WbWriterVtkXmlBinary::getInstance()); - //D3Q27PressureDifferencePostprocessor rhopp(grid, visSch, pathname + "/results/rho_diff.txt", h1, h2, conv, comm); - D3Q27PressureDifferencePostprocessor rhopp(grid, visSch, pathname + "/results/rho_diff.txt", h1, h2, rhoReal, uReal, uLB, comm); - - double area = (2.0*radius*H)/(dx*dx); - double v = 4.0*uLB/9.0; - D3Q27ForcesPostprocessor fp(grid, visSch, pathname + "/results/forces.txt", comm, v, area); - fp.addInteractor(cylinderInt); - - UbSchedulerPtr nupsSch(new UbScheduler(10, 10, 40)); - NUPSCounterPostprocessor npr(grid, nupsSch, pathname + "/results/nups.txt", comm); - - double endTime = 100001.0; - CalculationManagerPtr calculation(new CalculationManager(grid, numOfThreads, endTime, visSch)); - if(myid == 0) UBLOG(logINFO,"Simulation-start"); - calculation->calculate(); - if(myid == 0) UBLOG(logINFO,"Simulation-end"); - } - catch(std::exception& e) - { - cerr << e.what() << endl << flush; - } - catch(std::string& s) - { - cerr << s << endl; - } - catch(...) - { - cerr << "unknown exception" << endl; - } - -} - -////////////////////////////////////////////////////////////////////////// -void run2(const char *cstr) -{ - try - { - Sleep(30000); - string machine = QUOTEME(CAB_MACHINE); - string pathname; - int numOfThreads = 1; - double availMem = 0; - - CommunicatorPtr comm = vf::parallel::MPICommunicator::getInstance(); - int myid = comm->getProcessID(); - - if(machine == "BOMBADIL") - { - pathname = "d:/temp/cylinder_20nu"; - numOfThreads = 4; - availMem = 10.0e9; - } - else if(machine == "M01" || machine == "M02") - { - pathname = "/work/koskuche/scratch/cylinder_Re20nu4l"; - numOfThreads = 1; - availMem = 12.0e9; - - if(myid ==0) - { - stringstream logFilename; - logFilename << pathname + "/logfile"+UbSystem::toString(UbSystem::getTimeStamp())+".txt"; - UbLog::output_policy::setStream(logFilename.str()); - } - } - else throw UbException(UB_EXARGS, "unknown CAB_MACHINE"); - - double dx = 0.01; - - double L1 = 2.5*2.0; - double L2, L3, H; - L2 = L3 = H = 0.41*2.0; - - real radius = 0.05*2.0; - real rhoReal = 1.0; //kg/m^3 - real uReal = 0.45;//m/s - real uLB = 0.05; - real Re = 20.0; - real rhoLB = 0.0; - real l = L2 / dx; - - //LBMUnitConverterPtr conv = LBMUnitConverterPtr(new LBMUnitConverter(1.0, 1/sqrt(3.0)*(uReal/uLB), 1.0, 1.0/dx, dx*dx*dx)); - LBMUnitConverterPtr conv = LBMUnitConverterPtr(new LBMUnitConverter()); - - const int baseLevel = 0; - const int refineLevel = 1; - - //obstacle - GbObject3DPtr cylinder(new GbCylinder3D(0.5*2.0, 0.2*2.0, -0.1, 0.5*2.0, 0.2*2.0, L3+0.1, radius)); - GbSystem3D::writeGeoObject(cylinder.get(),pathname + "/geo/cylinder", WbWriterVtkXmlBinary::getInstance()); - - GbObject3DPtr refCylinder(new GbCylinder3D(0.5*2.0, 0.2*2.0, -0.1, 0.5*2.0, 0.2*2.0, L3+0.1, radius+7.0*dx/(1<<refineLevel))); - GbSystem3D::writeGeoObject(refCylinder.get(),pathname + "/geo/refCylinder", WbWriterVtkXmlBinary::getInstance()); - - D3Q27InteractorPtr cylinderInt; - - //bounding box - double d_minX1 = 0.0; - double d_minX2 = 0.0; - double d_minX3 = 0.0; - - double d_maxX1 = L1; - double d_maxX2 = L2; - double d_maxX3 = L3; - - //double offs = dx; - double offs = 0; - - //double g_minX1 = d_minX1-offs-0.499999*dx; - double g_minX1 = d_minX1; - double g_minX2 = d_minX2-7.0*dx; - double g_minX3 = d_minX3; - - double g_maxX1 = d_maxX1; - double g_maxX2 = d_maxX2; - double g_maxX3 = d_maxX3; - - GbObject3DPtr gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3)); - - const int blocknx1 = 8; - const int blocknx2 = 8; - const int blocknx3 = 8; - - //dx = (0.41+2.0*dx)/(10.0*(int)blocknx2); - - real nueLB = (((4.0/9.0)*uLB)*2.0*(radius/dx))/Re; - - double blockLength = blocknx1*dx; - - //refinement area - double rf = cylinder->getLengthX1()/4; - GbObject3DPtr refineCube(new GbCuboid3D(cylinder->getX1Minimum()-rf, cylinder->getX2Minimum()-rf, cylinder->getX3Minimum(), - cylinder->getX1Maximum()+rf, cylinder->getX2Maximum()+rf, cylinder->getX3Maximum())); - // GbObject3DPtr refineCube(new GbCuboid3D(g_minX1 + 7.05*blockLength, g_minX2 + 3.05*blockLength, cylinder->getX3Minimum(), - // g_minX1 + 12.95*blockLength, g_maxX2 - 3.05*blockLength, cylinder->getX3Maximum())); - - Grid3DPtr grid(new Grid3D(comm)); - - UbSchedulerPtr rSch(new UbScheduler(100000, 100000)); - //RestartPostprocessorPtr rp(new RestartPostprocessor(grid, rSch, comm, pathname+"/checkpoints", RestartPostprocessor::BINARY)); - - //UbSchedulerPtr emSch(new UbScheduler(1000, 1000)); - //EmergencyExitPostprocessor em(grid, emSch, pathname+"/checkpoints/emex.txt", rp, comm); - - std::string opt; - - if(cstr!= NULL) - opt = std::string(cstr); - - if/*(cstr== NULL)*/(cstr!= NULL) - { - opt = std::string(cstr); - - if(myid==0) UBLOG(logINFO,"Restart step: " << opt); - - //grid = rp->restart(UbSystem::stringTo<int>(opt)); - //rp->reconnect(); - - //cylinderInt = - - //set connectors - D3Q27InterpolationProcessorPtr iProcessor(new D3Q27OffsetInterpolationProcessor()); - D3Q27SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nueLB, iProcessor); - grid->accept( setConnsVisitor ); - - //domain decomposition - PQueuePartitioningGridVisitor pqPartVisitor(numOfThreads); - grid->accept(pqPartVisitor); - } - else - { - if(myid ==0) - { - UBLOG(logINFO,"Number of processes = " << comm->getNumberOfProcesses() ); - UBLOG(logINFO,"path = " << pathname ); - UBLOG(logINFO,"L = " << L1/dx ); - UBLOG(logINFO,"H = " << H/dx ); - UBLOG(logINFO,"v = " << uLB ); - UBLOG(logINFO,"rho = " << rhoLB ); - UBLOG(logINFO,"nue = " << nueLB ); - UBLOG(logINFO,"Re = " << Re ); - UBLOG(logINFO,"dx = " << dx ); - UBLOG(logINFO,"Number of level = " << refineLevel+1 ); - //UBLOG(logINFO,conv->toString() ); - UBLOG(logINFO,"Preprozess - start"); - } - - grid->setDeltaX(dx); - grid->setBlockNX(blocknx1, blocknx2, blocknx3); - - // UbTupleDouble6 bouningBox(gridCube->getX1Minimum(),gridCube->getX2Minimum(),gridCube->getX3Minimum(), - // gridCube->getX1Maximum(),gridCube->getX2Maximum(),gridCube->getX3Maximum()); - // UbTupleInt3 blockNx(blocknx1, blocknx2, blocknx3); - // UbTupleInt3 gridNx(8, 16, 16); - // grid = Grid3DPtr(new Grid3D(bouningBox, blockNx, gridNx)); - - if(myid ==0) GbSystem3D::writeGeoObject(gridCube.get(),pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); - if(myid ==0) GbSystem3D::writeGeoObject(refineCube.get(),pathname + "/geo/refineCube", WbWriterVtkXmlBinary::getInstance()); - - GenBlocksGridVisitor genBlocks; - genBlocks.addGeoObject(gridCube); - grid->accept(genBlocks); - - //walls - GbCuboid3DPtr addWallYmin (new GbCuboid3D(d_minX1-blockLength, d_minX2-blockLength, d_minX3-blockLength, d_maxX1+blockLength, d_minX2, d_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallYmin.get(), pathname+"/geo/addWallYmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmin (new GbCuboid3D(d_minX1-blockLength, d_minX2-blockLength, d_minX3-blockLength, d_maxX1+blockLength, d_maxX2+blockLength, d_minX3)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallZmin.get(), pathname+"/geo/addWallZmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallYmax (new GbCuboid3D(d_minX1-blockLength, d_maxX2, d_minX3-blockLength, d_maxX1+blockLength, d_maxX2+blockLength, d_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallYmax.get(), pathname+"/geo/addWallYmax", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmax (new GbCuboid3D(d_minX1-blockLength, d_minX2-blockLength, d_maxX3, d_maxX1+blockLength, d_maxX2+blockLength, d_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallZmax.get(), pathname+"/geo/addWallZmax", WbWriterVtkXmlASCII::getInstance()); - - //inflow - GbCuboid3DPtr geoInflow (new GbCuboid3D(d_minX1-blockLength, d_minX2-blockLength, d_minX3-blockLength, d_minX1, d_maxX2+blockLength, d_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(geoInflow.get(), pathname+"/geo/geoInflow", WbWriterVtkXmlASCII::getInstance()); - - //outflow - GbCuboid3DPtr geoOutflow (new GbCuboid3D(d_maxX1, d_minX2-blockLength, d_minX3-blockLength, d_maxX1+blockLength, d_maxX2+blockLength, d_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathname+"/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance()); - - BlocksPostprocessorPtr ppblocks(new BlocksPostprocessor(grid, UbSchedulerPtr(new UbScheduler(1)), pathname + "/grid/blocks", WbWriterVtkXmlBinary::getInstance(), comm)); - - if (refineLevel > 0) - { - if(myid == 0) UBLOG(logINFO,"Refinement - start"); - RefineCrossAndInsideGbObjectHelper refineHelper(grid, refineLevel); - //refineHelper.addGbObject(refineCube, refineLevel); - refineHelper.addGbObject(refCylinder, refineLevel); - refineHelper.refine(); - if(myid == 0) UBLOG(logINFO,"Refinement - end"); - } - - MetisPartitioningGridVisitor metisVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::B); - grid->accept( metisVisitor ); - - SolidBlocksHelper sd(grid, comm); - - int bbOption = 1; //0=simple Bounce Back, 1=quadr. BB - D3Q27BoundaryConditionAdapterPtr bcObst(new D3Q27NoSlipBCAdapter(bbOption)); - cylinderInt = D3Q27InteractorPtr ( new D3Q27Interactor(cylinder, grid, bcObst,Interactor3D::SOLID)); - - //walls - D3Q27InteractorPtr addWallYminInt(new D3Q27Interactor(addWallYmin, grid, bcObst,Interactor3D::SOLID)); - D3Q27InteractorPtr addWallZminInt(new D3Q27Interactor(addWallZmin, grid, bcObst,Interactor3D::SOLID)); - D3Q27InteractorPtr addWallYmaxInt(new D3Q27Interactor(addWallYmax, grid, bcObst,Interactor3D::SOLID)); - D3Q27InteractorPtr addWallZmaxInt(new D3Q27Interactor(addWallZmax, grid, bcObst,Interactor3D::SOLID)); - - mu::Parser fct; - fct.SetExpr("16*U*x2*x3*(H-x2)*(H-x3)/H^4"); - fct.DefineConst("U", uLB); - fct.DefineConst("H", H); - - //inflow - D3Q27BoundaryConditionAdapterPtr velBCAdapter(new D3Q27VelocityBCAdapter (true, false ,false ,fct, 0, D3Q27BCFunction::INFCONST)); - velBCAdapter->setSecondaryBcOption(2); - D3Q27InteractorPtr inflowInt = D3Q27InteractorPtr( new D3Q27Interactor(geoInflow, grid, velBCAdapter, Interactor3D::SOLID)); - - //outflow - D3Q27BoundaryConditionAdapterPtr denBCAdapter(new D3Q27DensityBCAdapter(rhoLB)); - D3Q27InteractorPtr outflowInt = D3Q27InteractorPtr( new D3Q27Interactor(geoOutflow, grid, denBCAdapter,Interactor3D::SOLID)); - - sd.addInteractor(cylinderInt); - sd.addInteractor(addWallYminInt); - sd.addInteractor(addWallZminInt); - sd.addInteractor(addWallYmaxInt); - sd.addInteractor(addWallZmaxInt); - sd.addInteractor(inflowInt); - sd.addInteractor(outflowInt); - - sd.deleteSolidBlocks(); - - grid->accept( metisVisitor ); - - sd.setTransBlocks(); - - ppblocks->update(0); - ppblocks.reset(); - - //set connectors - D3Q27InterpolationProcessorPtr iProcessor(new D3Q27IncompressibleOffsetInterpolationProcessor()); - D3Q27SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nueLB, iProcessor); - grid->accept( setConnsVisitor ); - - unsigned long nob = grid->getNumberOfBlocks(); - int gl = 3; - unsigned long nod = nob * (blocknx1+gl) * (blocknx2+gl) * (blocknx3+gl); - - double needMemAll = double(nod*(27*sizeof(double) + sizeof(int) + sizeof(float)*4)); - double needMem = needMemAll / double(comm->getNumberOfProcesses()); - - if(myid == 0) - { - UBLOG(logINFO,"Number of blocks = " << nob); - UBLOG(logINFO,"Number of nodes = " << nod); - UBLOG(logINFO,"Necessary memory = " << needMemAll << " bytes"); - UBLOG(logINFO,"Necessary memory per process = " << needMem << " bytes"); - UBLOG(logINFO,"Available memory per process = " << availMem << " bytes"); - } - - LBMKernel3DPtr kernel(new LBMKernelETD3Q27CCLB(blocknx1, blocknx2, blocknx3, LBMKernelETD3Q27CCLB::NORMAL)); - - BCProcessorPtr bcProc(new D3Q27ETBCProcessor()); - kernel->setBCProcessor(bcProc); - - SetKernelBlockVisitor kernelVisitor(kernel, nueLB, availMem, needMem); - grid->accept(kernelVisitor); - - if (refineLevel > 0) - { - D3Q27SetUndefinedNodesBlockVisitor undefNodesVisitor; - grid->accept(undefNodesVisitor); - } - - //walls - grid->addAndInitInteractor(addWallYminInt); - grid->addAndInitInteractor(addWallZminInt); - grid->addAndInitInteractor(addWallYmaxInt); - grid->addAndInitInteractor(addWallZmaxInt); - - //obstacle - grid->addAndInitInteractor(cylinderInt); - - //inflow - grid->addAndInitInteractor(inflowInt); - - //outflow - grid->addAndInitInteractor(outflowInt); - - //domain decomposition - PQueuePartitioningGridVisitor pqPartVisitor(numOfThreads); - grid->accept(pqPartVisitor); - - //initialization of distributions - D3Q27ETInitDistributionsBlockVisitor initVisitor(nueLB, rhoLB); - initVisitor.setVx1(fct); - grid->accept(initVisitor); - - //Postrozess - UbSchedulerPtr geoSch(new UbScheduler(1)); - D3Q27MacroscopicQuantitiesPostprocessorPtr ppgeo( - new D3Q27MacroscopicQuantitiesPostprocessor(grid, geoSch, pathname + "/grid/nodes", WbWriterVtkXmlBinary::getInstance(), conv, comm, true)); - ppgeo->update(0); - ppgeo.reset(); - - if(myid == 0) UBLOG(logINFO,"Preprozess - end"); - } - - double outTime = 100.0; - UbSchedulerPtr visSch(new UbScheduler(outTime)); - //visSch->addSchedule(1000, 1000, 10000); - //visSch->addSchedule(10000, 10000, 50000); - //visSch->addSchedule(100, 100, 10000); - - D3Q27MacroscopicQuantitiesPostprocessor pp(grid, visSch, pathname + "/steps/step", WbWriterVtkXmlBinary::getInstance(), conv, comm); - - double fdx = grid->getDeltaX(grid->getFinestInitializedLevel()); - double point1[3] = {0.45, 0.20, 0.205}; - double point2[3] = {0.55, 0.20, 0.205}; - - D3Q27IntegrateValuesHelperPtr h1(new D3Q27IntegrateValuesHelper(grid, comm, - point1[0]-1.0*fdx, point1[1]-1.0*fdx, point1[2]-1.0*fdx, - point1[0], point1[1], point1[2])); - if(myid ==0) GbSystem3D::writeGeoObject(h1->getBoundingBox().get(),pathname + "/geo/iv1", WbWriterVtkXmlBinary::getInstance()); - D3Q27IntegrateValuesHelperPtr h2(new D3Q27IntegrateValuesHelper(grid, comm, - point2[0], point2[1]-1.0*fdx, point2[2]-1.0*fdx, - point2[0]+1.0*fdx, point2[1], point2[2])); - if(myid ==0) GbSystem3D::writeGeoObject(h2->getBoundingBox().get(),pathname + "/geo/iv2", WbWriterVtkXmlBinary::getInstance()); - //D3Q27PressureDifferencePostprocessor rhopp(grid, visSch, pathname + "/results/rho_diff.txt", h1, h2, conv, comm); - D3Q27PressureDifferencePostprocessor rhopp(grid, visSch, pathname + "/results/rho_diff.txt", h1, h2, rhoReal, uReal, uLB, comm); - - double area = (2.0*radius*H)/(dx*dx); - double v = 4.0*uLB/9.0; - D3Q27ForcesPostprocessor fp(grid, visSch, pathname + "/results/forces.txt", comm, v, area); - fp.addInteractor(cylinderInt); - - UbSchedulerPtr nupsSch(new UbScheduler(10, 10, 40)); - NUPSCounterPostprocessor npr(grid, nupsSch, pathname + "/results/nups.txt", comm); - - double endTime = 100001.0; - CalculationManagerPtr calculation(new CalculationManager(grid, numOfThreads, endTime, visSch)); - if(myid == 0) UBLOG(logINFO,"Simulation-start"); - calculation->calculate(); - if(myid == 0) UBLOG(logINFO,"Simulation-end"); - } - catch(std::exception& e) - { - cerr << e.what() << endl << flush; - } - catch(std::string& s) - { - cerr << s << endl; - } - catch(...) - { - cerr << "unknown exception" << endl; - } - -} -////////////////////////////////////////////////////////////////////////// -int main(int argc, char* argv[]) -{ - - run2(argv[1]); - - return 0; -} - diff --git a/apps/cpu/FlowAroundCylinder/cylinder.cpp1 b/apps/cpu/FlowAroundCylinder/cylinder.cpp1 deleted file mode 100644 index 591002f9783d033aeb4c4b5123d7dca8da0d5bdc..0000000000000000000000000000000000000000 --- a/apps/cpu/FlowAroundCylinder/cylinder.cpp1 +++ /dev/null @@ -1,383 +0,0 @@ -#include <iostream> -#include <string> - -#include "geometry3d/CoordinateTransformation3D.h" -#include "Grid3D.h" -#include "GenBlocksGridVisitor.h" -#include "geometry3d/GbSystem3D.h" -#include "geometry3d/GbCuboid3D.h" -#include "geometry3d/GbCylinder3D.h" -#include "basics/writer/WbWriterVtkXmlASCII.h" -#include "basics/writer/WbWriterVtkXmlBinary.h" -#include "RefineCrossAndInsideGbObjectBlockVisitor.h" -#include "RatioBlockVisitor.h" -#include "RatioSmoothBlockVisitor.h" -#include "OverlapBlockVisitor.h" -#include "RefineInterGbObjectsVisitor.h" -#include "SetKernelBlockVisitor.h" -#include "LBMKernelETD3Q27Cascaded.h" -#include "D3Q27MacroscopicQuantitiesPostprocessor.h" -#include "MPICommunicator.h" -#include "D3Q27ETBCProcessor.h" -#include "SimulationParameters.h" -#include "D3Q27SetUndefinedNodesBlockVisitor.h" -#include "SetInterpolationDirsBlockVisitor.h" -#include "D3Q27SetConnectorsBlockVisitor.h" -#include "NullCommunicator.h" -#include "D3Q27ETInitDistributionsBlockVisitor.h" -#include "CalculationManager.h" -#include "PQueuePartitioningGridVisitor.h" -#include "MetisPartitioningGridVisitor.h" -#include "D3Q27Interactor.h" -#include "D3Q27NoSlipBCAdapter.h" -#include "D3Q27VelocityBCAdapter.h" -#include "D3Q27DensityBCAdapter.h" -#include "D3Q27BoundaryConditionAdapter.h" -#include "StringUtil.hpp" -#include "D3Q27OffsetInterpolationProcessor.h" -#include "D3Q27CompactInterpolationProcessor.h" -#include "D3Q27PressureDifferencePostprocessor.h" -#include "D3Q27IntegrateValuesHelper.h" -#include "RestartPostprocessor.h" -#include "SolidBlocksHelper.h" -#include "NUPSCounterPostprocessor.h" - -using namespace std; - - -void run(const char *cstr) -{ - try - { - string machine = QUOTEME(CAB_MACHINE); - string pathname; - int numOfThreads = 1; - double availMem = 0; - - CommunicatorPtr comm(new MPICommunicator()); - int myid = comm->getProcessID(); - - if(machine == "BOMBADIL") - { - pathname = "c:/temp/cylinder"; - numOfThreads = 1; - availMem = 3.0e9; - } - else if(machine == "M01" || machine == "M02") - { - pathname = "/work/koskuche/scratch/cylinder"; - numOfThreads = 8; - availMem = 12.0e9; - - if(myid ==0) - { - stringstream logFilename; - logFilename << pathname + "/logfile.txt"; - UbLog::output_policy::setStream(logFilename.str()); - } - } - else throw UbException(UB_EXARGS, "unknown CAB_MACHINE"); - - const double dx = 0.00205*5.0; - - double L1 = 2.5; - double L2 = 0.41; - double L3 = 0.41; - - real radius = 0.05; - real uLB = 0.01; - real Re = 100.0; - real rhoLB = 1.0; - real l = L2 / dx; - //real nueLB = (uLB*l)/Re; - real nueLB = (((4.0/9.0)*uLB)*2.0*(radius/dx))/Re; - - LBMUnitConverterPtr conv = LBMUnitConverterPtr(new LBMUnitConverter()); - - const int baseLevel = 0; - const int refineLevel = 0; - - //obstacle - GbObject3DPtr cylinder(new GbCylinder3D(0.5, 0.2, -0.1, 0.5, 0.2, L3+0.1, radius)); - GbSystem3D::writeGeoObject(cylinder.get(),pathname + "/geo/cylinder", WbWriterVtkXmlBinary::getInstance()); - - //bounding box - double g_minX1 = 0.0; - double g_minX2 = 0.0; - double g_minX3 = 0.0; - - double g_maxX1 = L1; - double g_maxX2 = L2; - double g_maxX3 = L3; - - double offs = dx; - GbObject3DPtr gridCube(new GbCuboid3D(g_minX1-offs, g_minX2-offs, g_minX3-offs*2, g_maxX1+offs, g_maxX2+offs, g_maxX3+offs*2)); - - //refinement area - double rf = cylinder->getLengthX1(); - GbObject3DPtr refineCube(new GbCuboid3D(cylinder->getX1Minimum()-rf, cylinder->getX2Minimum()-rf/2, cylinder->getX3Minimum(), - cylinder->getX1Maximum()+2*rf, cylinder->getX2Maximum()+rf, cylinder->getX3Maximum())); - - const int blocknx1 = 6; - const int blocknx2 = 6; - const int blocknx3 = 6; - - double blockLength = blocknx1*dx; - - Grid3DPtr grid(new Grid3D()); - UbSchedulerPtr rSch(new UbScheduler(50000, 50000)); - RestartPostprocessor rp(grid, rSch, comm, pathname+"/checkpoints", RestartPostprocessor::BINARY); - - std::string opt; - - if(cstr!= NULL) - opt = std::string(cstr); - - if(cstr!= NULL) - { - opt = std::string(cstr); - - if(myid==0) UBLOG(logINFO,"Restart step: " << opt); - - grid = rp.restart(UbSystem::stringTo<int>(opt)); - rp.reconnect(); - - SimulationParametersPtr param = SimulationParameters::getInstanz(); - param->setCollisionModelType(SimulationParameters::COMPRESSIBLE); - - //set connectors - D3Q27InterpolationProcessorPtr iProcessor(new D3Q27OffsetInterpolationProcessor()); - D3Q27SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nueLB, iProcessor); - grid->accept( setConnsVisitor ); - - //domain decomposition - PQueuePartitioningGridVisitor pqPartVisitor(numOfThreads); - grid->accept(pqPartVisitor); - } - else - { - if(myid ==0) - { - UBLOG(logINFO,"L = " << l ); - UBLOG(logINFO,"v = " << uLB ); - UBLOG(logINFO,"rho = " << rhoLB ); - UBLOG(logINFO,"nue = " << nueLB ); - UBLOG(logINFO,"Re = " << Re ); - UBLOG(logINFO,"dx = " << dx ); - UBLOG(logINFO,"Preprozess - start"); - } - - SimulationParametersPtr param = SimulationParameters::getInstanz(); - param->setCollisionModelType(SimulationParameters::COMPRESSIBLE); - param->setRho(rhoLB); - param->setVelocityX(uLB); - param->setViscosity(nueLB); - - grid->setDeltaX(dx); - grid->setBlockNX(blocknx1, blocknx2, blocknx3); - - if(myid ==0) GbSystem3D::writeGeoObject(gridCube.get(),pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); - if(myid ==0) GbSystem3D::writeGeoObject(refineCube.get(),pathname + "/geo/refineCube", WbWriterVtkXmlBinary::getInstance()); - - GenBlocksGridVisitor genBlocks; - genBlocks.addGeoObject(gridCube); - grid->accept(genBlocks); - - //walls - GbCuboid3DPtr addWallYmin (new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3-blockLength, g_maxX1+blockLength, g_minX2, g_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallYmin.get(), pathname+"/geo/addWallYmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmin (new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3-blockLength, g_maxX1+blockLength, g_maxX2+blockLength, g_minX3)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallZmin.get(), pathname+"/geo/addWallZmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallYmax (new GbCuboid3D(g_minX1-blockLength, g_maxX2, g_minX3-blockLength, g_maxX1+blockLength, g_maxX2+2.0*blockLength, g_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallYmax.get(), pathname+"/geo/addWallYmax", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmax (new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_maxX3, g_maxX1+blockLength, g_maxX2+blockLength, g_maxX3+2.0*blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallZmax.get(), pathname+"/geo/addWallZmax", WbWriterVtkXmlASCII::getInstance()); - - //inflow - GbCuboid3DPtr geoInflow (new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3-blockLength, g_minX1, g_maxX2+blockLength, g_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(geoInflow.get(), pathname+"/geo/geoInflow", WbWriterVtkXmlASCII::getInstance()); - - //outflow - GbCuboid3DPtr geoOutflow (new GbCuboid3D(g_maxX1, g_minX2-blockLength, g_minX3-blockLength, g_maxX1+2.0*blockLength, g_maxX2+blockLength, g_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathname+"/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance()); - - - if (refineLevel > 0) - { - if(myid == 0) UBLOG(logINFO,"Refinement - start"); - RefineCrossAndInsideGbObjectBlockVisitor refVisitor(refineCube, baseLevel, refineLevel-1); - grid->accept(refVisitor); - - RatioBlockVisitor ratioVisitor(refineLevel); - grid->accept(ratioVisitor); - - RatioSmoothBlockVisitor ratioSmoothVisitor(refineLevel); - grid->accept(ratioSmoothVisitor); - - OverlapBlockVisitor overlapVisitor(refineLevel); - grid->accept(overlapVisitor); - - std::vector<int> dirs; - D3Q27System::getLBMDirections(dirs); - SetInterpolationDirsBlockVisitor interDirsVisitor(dirs); - grid->accept(interDirsVisitor); - if(myid == 0) UBLOG(logINFO,"Refinement - end"); - } - - MetisPartitioningGridVisitor metisVisitor(numOfThreads, D3Q27System::B, comm, false); - grid->accept( metisVisitor ); - - SolidBlocksHelper sd(grid, comm); - - int bbOption = 1; //0=simple Bounce Back, 1=quadr. BB - D3Q27BoundaryConditionAdapterPtr bcObst(new D3Q27NoSlipBCAdapter(bbOption)); - D3Q27InteractorPtr cylinderInt( new D3Q27Interactor(cylinder, grid, bcObst,Interactor3D::SOLID)); - - sd.addInteractor(cylinderInt); - sd.deleteSolidBlocks(); - - grid->accept( metisVisitor ); - - //if(myid ==0) grid->writeBlocks(pathname + "/grid/blocks" + StringUtil::toString(myid), 0, WbWriterVtkXmlBinary::getInstance(), false); - - unsigned long nob = grid->getNumberOfBlocks(); - int gl = 3; - unsigned long nod = nob * (blocknx1+gl) * (blocknx2+gl) * (blocknx3+gl); - - double needMemAll = double(nod*(27*sizeof(double) + sizeof(int) + sizeof(float)*4)); - double needMem = needMemAll / double(comm->getNumberOfProcesses()); - - if(myid == 0) - { - UBLOG(logINFO,"Number of blocks = " << nob); - UBLOG(logINFO,"Number of nodes = " << nod); - UBLOG(logINFO,"Necessary memory = " << needMemAll << " bytes"); - UBLOG(logINFO,"Necessary memory per process = " << needMem << " bytes"); - UBLOG(logINFO,"Available memory per process = " << availMem << " bytes"); - } - - LBMKernel3DPtr kernel(new LBMKernelETD3Q27Cascaded(blocknx1, blocknx2, blocknx3)); - - BCProcessorPtr bcProc(new D3Q27ETBCProcessor()); - kernel->setBCProcessor(bcProc); - - SetKernelBlockVisitor kernelVisitor(kernel, nueLB, availMem, needMem); - grid->accept(kernelVisitor); - - if (refineLevel > 0) - { - D3Q27SetUndefinedNodesBlockVisitor undefNodesVisitor; - grid->accept(undefNodesVisitor); - } - - //walls - D3Q27InteractorPtr addWallYminInt(new D3Q27Interactor(addWallYmin, grid, bcObst,Interactor3D::SOLID)); - grid->addAndInitInteractor(addWallYminInt); - - D3Q27InteractorPtr addWallZminInt(new D3Q27Interactor(addWallZmin, grid, bcObst,Interactor3D::SOLID)); - grid->addAndInitInteractor(addWallZminInt); - - D3Q27InteractorPtr addWallYmaxInt(new D3Q27Interactor(addWallYmax, grid, bcObst,Interactor3D::SOLID)); - grid->addAndInitInteractor(addWallYmaxInt); - - D3Q27InteractorPtr addWallZmaxInt(new D3Q27Interactor(addWallZmax, grid, bcObst,Interactor3D::SOLID)); - grid->addAndInitInteractor(addWallZmaxInt); - - //inflow - double Cz = geoInflow->getX3Centroid(); - double Hz = geoInflow->getLengthX3()-2.0*blockLength; - double Cy = geoInflow->getX2Centroid(); - double Hy = geoInflow->getLengthX2()-2.0*blockLength; - mu::Parser fct = MathUtil::getDuctParaboloidX(Cy,Hy,Cz,Hz,uLB); - - D3Q27BoundaryConditionAdapterPtr velBCAdapter(new D3Q27VelocityBCAdapter (true, false ,false ,fct, 0, D3Q27BCFunction::INFCONST)); - velBCAdapter->setSecondaryBcOption(2); - D3Q27InteractorPtr inflowInt = D3Q27InteractorPtr( new D3Q27Interactor(geoInflow, grid, velBCAdapter, Interactor3D::SOLID)); - grid->addAndInitInteractor(inflowInt); - - //outflow - D3Q27BoundaryConditionAdapterPtr denBCAdapter(new D3Q27DensityBCAdapter(rhoLB)); - D3Q27InteractorPtr outflowInt = D3Q27InteractorPtr( new D3Q27Interactor(geoOutflow, grid, denBCAdapter,Interactor3D::SOLID)); - grid->addAndInitInteractor(outflowInt); - - //obstacle - grid->addAndInitInteractor(cylinderInt); - - sd.updateGrid(); - - //set connectors - D3Q27InterpolationProcessorPtr iProcessor(new D3Q27OffsetInterpolationProcessor()); - //D3Q27InterpolationProcessorPtr iProcessor(new D3Q27CompactInterpolationProcessor()); - D3Q27SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nueLB, iProcessor); - grid->accept( setConnsVisitor ); - - //domain decomposition - PQueuePartitioningGridVisitor pqPartVisitor(numOfThreads); - grid->accept(pqPartVisitor); - - //initialization of distributions - D3Q27ETInitDistributionsBlockVisitor initVisitor(1.0); - grid->accept(initVisitor); - - //Postrozess - if(myid ==0) grid->writeBlocks(pathname + "/grid/blocks" + StringUtil::toString(myid), 0, WbWriterVtkXmlBinary::getInstance(), false); - - { - UbSchedulerPtr geoSch(new UbScheduler(1)); - D3Q27MacroscopicQuantitiesPostprocessor ppgeo(grid, pathname + "/grid/nodes", WbWriterVtkXmlBinary::getInstance(), conv, geoSch, comm, true); - grid->doPostProcess(0); - } - - if(myid == 0) UBLOG(logINFO,"Preprozess - end"); - } - - double outTime = 50000.0; - UbSchedulerPtr visSch(new UbScheduler(outTime)); - visSch->addSchedule(10000, 10000, 50000); - - D3Q27MacroscopicQuantitiesPostprocessor pp(grid, pathname + "/steps/step", WbWriterVtkXmlBinary::getInstance(), conv, visSch, comm); - - double fdx = grid->getDeltaX(grid->getCoarsestInitializedLevel()); - D3Q27IntegrateValuesHelperPtr h1(new D3Q27IntegrateValuesHelper(grid, comm, - refineCube->getX1Minimum()-2.0*fdx-blockLength, gridCube->getX2Minimum()-1.0*fdx, cylinder->getX3Minimum()-1.0*fdx, - refineCube->getX1Minimum()-1.0*fdx-blockLength, gridCube->getX2Maximum()+1.0*fdx, cylinder->getX3Maximum()+1.0*fdx)); - if(myid ==0) GbSystem3D::writeGeoObject(h1->getBoundingBox().get(),pathname + "/geo/iv1", WbWriterVtkXmlBinary::getInstance()); - D3Q27IntegrateValuesHelperPtr h2(new D3Q27IntegrateValuesHelper(grid, comm, - refineCube->getX1Maximum()+1.0*fdx+blockLength, gridCube->getX2Minimum()-1.0*fdx, cylinder->getX3Minimum()-1.0*fdx, - refineCube->getX1Maximum()+2.0*fdx+blockLength, gridCube->getX2Maximum()+1.0*fdx, cylinder->getX3Maximum()+1.0*fdx)); - if(myid ==0) GbSystem3D::writeGeoObject(h2->getBoundingBox().get(),pathname + "/geo/iv2", WbWriterVtkXmlBinary::getInstance()); - D3Q27PressureDifferencePostprocessor rhopp(grid, pathname + "/results/rho_diff.txt", h1, h2, conv, visSch, comm); - - NUPSCounterPostprocessor npr(grid, visSch, pathname + "/results/nups.txt", comm); - - double endTime = 1000001.0; - CalculationManagerPtr calculation(new CalculationManager(grid, numOfThreads, endTime, visSch)); - if(myid == 0) UBLOG(logINFO,"Simulation-start"); - calculation->calculate(); - if(myid == 0) UBLOG(logINFO,"Simulation-end"); - } - catch(std::exception& e) - { - cerr << e.what() << endl << flush; - } - catch(std::string& s) - { - cerr << s << endl; - } - catch(...) - { - cerr << "unknown exception" << endl; - } - -} -int main(int argc, char* argv[]) -{ - - run(argv[1]); - - return 0; -} - diff --git a/apps/cpu/FlowAroundCylinder/cylinder.cpp2 b/apps/cpu/FlowAroundCylinder/cylinder.cpp2 deleted file mode 100644 index 9548681c7e510b0a9a216a743717bf665fd50b2f..0000000000000000000000000000000000000000 --- a/apps/cpu/FlowAroundCylinder/cylinder.cpp2 +++ /dev/null @@ -1,400 +0,0 @@ -#include <iostream> -#include <string> - -#include "geometry3d/CoordinateTransformation3D.h" -#include "Grid3D.h" -#include "GenBlocksGridVisitor.h" -#include "geometry3d/GbSystem3D.h" -#include "geometry3d/GbCuboid3D.h" -#include "geometry3d/GbCylinder3D.h" -#include "basics/writer/WbWriterVtkXmlASCII.h" -#include "basics/writer/WbWriterVtkXmlBinary.h" -#include "RefineCrossAndInsideGbObjectBlockVisitor.h" -#include "RatioBlockVisitor.h" -#include "RatioSmoothBlockVisitor.h" -#include "OverlapBlockVisitor.h" -#include "RefineInterGbObjectsVisitor.h" -#include "SetKernelBlockVisitor.h" -#include "LBMKernelETD3Q27Cascaded.h" -#include "D3Q27MacroscopicQuantitiesPostprocessor.h" -#include "MPICommunicator.h" -#include "D3Q27ETBCProcessor.h" -#include "SimulationParameters.h" -#include "D3Q27SetUndefinedNodesBlockVisitor.h" -#include "SetInterpolationDirsBlockVisitor.h" -#include "D3Q27SetConnectorsBlockVisitor.h" -#include "NullCommunicator.h" -#include "D3Q27ETInitDistributionsBlockVisitor.h" -#include "CalculationManager.h" -#include "PQueuePartitioningGridVisitor.h" -#include "MetisPartitioningGridVisitor.h" -#include "D3Q27Interactor.h" -#include "D3Q27NoSlipBCAdapter.h" -#include "D3Q27VelocityBCAdapter.h" -#include "D3Q27DensityBCAdapter.h" -#include "D3Q27BoundaryConditionAdapter.h" -#include "StringUtil.hpp" -#include "D3Q27OffsetInterpolationProcessor.h" -#include "D3Q27CompactInterpolationProcessor.h" -#include "D3Q27PressureDifferencePostprocessor.h" -#include "D3Q27IntegrateValuesHelper.h" -#include "RestartPostprocessor.h" -#include "SolidBlocksHelper.h" -#include "NUPSCounterPostprocessor.h" - -using namespace std; - - -void run(const char *cstr) -{ - try - { - string machine = QUOTEME(CAB_MACHINE); - string pathname; - int numOfThreads = 1; - double availMem = 0; - - CommunicatorPtr comm(new MPICommunicator()); - int myid = comm->getProcessID(); - - if(machine == "BOMBADIL") - { - pathname = "c:/temp/cylinder"; - numOfThreads = 1; - availMem = 3.0e9; - } - else if(machine == "M01" || machine == "M02") - { - pathname = "/work/koskuche/scratch/cylinder3"; - numOfThreads = 8; - availMem = 12.0e9; - - if(myid ==0) - { - stringstream logFilename; - logFilename << pathname + "/logfile.txt"; - UbLog::output_policy::setStream(logFilename.str()); - } - } - else if(machine == "ESLOGIN001" || machine == "ESLOGIN002" || machine == "ESLOGIN003") - { - pathname = "/zhome/academic/HLRS/xrm/xrmkuchr/work/cylinder"; - numOfThreads = 16; - availMem = 12.0e9; - - if(myid ==0) - { - stringstream logFilename; - logFilename << pathname + "/logfile.txt"; - UbLog::output_policy::setStream(logFilename.str()); - } - } - else throw UbException(UB_EXARGS, "unknown CAB_MACHINE: " + machine); - - const double dx = 0.00205*5.0; - - double L1 = 2.5; - double L2 = 0.41; - double L3 = 0.41; - - real radius = 0.05; - real uLB = 0.01; - real Re = 100.0; - real rhoLB = 1.0; - real l = L2 / dx; - //real nueLB = (uLB*l)/Re; - real nueLB = (((4.0/9.0)*uLB)*2.0*(radius/dx))/Re; - - LBMUnitConverterPtr conv = LBMUnitConverterPtr(new LBMUnitConverter()); - - const int baseLevel = 0; - const int refineLevel = 0; - - //obstacle - GbObject3DPtr cylinder(new GbCylinder3D(0.5, 0.2, -0.1, 0.5, 0.2, L3+0.1, radius)); - GbSystem3D::writeGeoObject(cylinder.get(),pathname + "/geo/cylinder", WbWriterVtkXmlBinary::getInstance()); - - //bounding box - double g_minX1 = 0.0; - double g_minX2 = 0.0; - double g_minX3 = 0.0; - - double g_maxX1 = L1; - double g_maxX2 = L2; - double g_maxX3 = L3; - - double offs = dx; - GbObject3DPtr gridCube(new GbCuboid3D(g_minX1-offs, g_minX2-offs, g_minX3-offs*2, g_maxX1+offs, g_maxX2+offs, g_maxX3+offs*2)); - - //refinement area - double rf = cylinder->getLengthX1(); - GbObject3DPtr refineCube(new GbCuboid3D(cylinder->getX1Minimum()-rf, cylinder->getX2Minimum()-rf/2, cylinder->getX3Minimum(), - cylinder->getX1Maximum()+2*rf, cylinder->getX2Maximum()+rf, cylinder->getX3Maximum())); - - const int blocknx1 = 6; - const int blocknx2 = 6; - const int blocknx3 = 6; - - double blockLength = blocknx1*dx; - - Grid3DPtr grid(new Grid3D()); - UbSchedulerPtr rSch(new UbScheduler(50000, 50000)); - RestartPostprocessor rp(grid, rSch, comm, pathname+"/checkpoints", RestartPostprocessor::BINARY); - - std::string opt; - - if(cstr!= NULL) - opt = std::string(cstr); - - if(cstr!= NULL) - { - opt = std::string(cstr); - - if(myid==0) UBLOG(logINFO,"Restart step: " << opt); - - grid = rp.restart(UbSystem::stringTo<int>(opt)); - rp.reconnect(); - - SimulationParametersPtr param = SimulationParameters::getInstanz(); - param->setCollisionModelType(SimulationParameters::COMPRESSIBLE); - - //set connectors - D3Q27InterpolationProcessorPtr iProcessor(new D3Q27OffsetInterpolationProcessor()); - D3Q27SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nueLB, iProcessor); - grid->accept( setConnsVisitor ); - - //domain decomposition - PQueuePartitioningGridVisitor pqPartVisitor(numOfThreads); - grid->accept(pqPartVisitor); - } - else - { - if(myid ==0) - { - UBLOG(logINFO,"Number of threads = " << numOfThreads ); - UBLOG(logINFO,"L = " << l ); - UBLOG(logINFO,"v = " << uLB ); - UBLOG(logINFO,"rho = " << rhoLB ); - UBLOG(logINFO,"nue = " << nueLB ); - UBLOG(logINFO,"Re = " << Re ); - UBLOG(logINFO,"dx = " << dx ); - UBLOG(logINFO,"Preprozess - start"); - } - - SimulationParametersPtr param = SimulationParameters::getInstanz(); - param->setCollisionModelType(SimulationParameters::COMPRESSIBLE); - param->setRho(rhoLB); - param->setVelocityX(uLB); - param->setViscosity(nueLB); - - grid->setDeltaX(dx); - grid->setBlockNX(blocknx1, blocknx2, blocknx3); - - if(myid ==0) GbSystem3D::writeGeoObject(gridCube.get(),pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); - if(myid ==0) GbSystem3D::writeGeoObject(refineCube.get(),pathname + "/geo/refineCube", WbWriterVtkXmlBinary::getInstance()); - - GenBlocksGridVisitor genBlocks; - genBlocks.addGeoObject(gridCube); - grid->accept(genBlocks); - - //walls - GbCuboid3DPtr addWallYmin (new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3-blockLength, g_maxX1+blockLength, g_minX2, g_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallYmin.get(), pathname+"/geo/addWallYmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmin (new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3-blockLength, g_maxX1+blockLength, g_maxX2+blockLength, g_minX3)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallZmin.get(), pathname+"/geo/addWallZmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallYmax (new GbCuboid3D(g_minX1-blockLength, g_maxX2, g_minX3-blockLength, g_maxX1+blockLength, g_maxX2+2.0*blockLength, g_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallYmax.get(), pathname+"/geo/addWallYmax", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmax (new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_maxX3, g_maxX1+blockLength, g_maxX2+blockLength, g_maxX3+2.0*blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(addWallZmax.get(), pathname+"/geo/addWallZmax", WbWriterVtkXmlASCII::getInstance()); - - //inflow - GbCuboid3DPtr geoInflow (new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3-blockLength, g_minX1, g_maxX2+blockLength, g_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(geoInflow.get(), pathname+"/geo/geoInflow", WbWriterVtkXmlASCII::getInstance()); - - //outflow - GbCuboid3DPtr geoOutflow (new GbCuboid3D(g_maxX1, g_minX2-blockLength, g_minX3-blockLength, g_maxX1+2.0*blockLength, g_maxX2+blockLength, g_maxX3+blockLength)); - if(myid == 0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathname+"/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance()); - - - if (refineLevel > 0) - { - if(myid == 0) UBLOG(logINFO,"Refinement - start"); - RefineCrossAndInsideGbObjectBlockVisitor refVisitor(refineCube, baseLevel, refineLevel-1); - grid->accept(refVisitor); - - RatioBlockVisitor ratioVisitor(refineLevel); - grid->accept(ratioVisitor); - - RatioSmoothBlockVisitor ratioSmoothVisitor(refineLevel); - grid->accept(ratioSmoothVisitor); - - OverlapBlockVisitor overlapVisitor(refineLevel); - grid->accept(overlapVisitor); - - std::vector<int> dirs; - D3Q27System::getLBMDirections(dirs); - SetInterpolationDirsBlockVisitor interDirsVisitor(dirs); - grid->accept(interDirsVisitor); - if(myid == 0) UBLOG(logINFO,"Refinement - end"); - } - - MetisPartitioningGridVisitor metisVisitor(numOfThreads, D3Q27System::B, comm, false); - grid->accept( metisVisitor ); - - SolidBlocksHelper sd(grid, comm); - - int bbOption = 1; //0=simple Bounce Back, 1=quadr. BB - D3Q27BoundaryConditionAdapterPtr bcObst(new D3Q27NoSlipBCAdapter(bbOption)); - D3Q27InteractorPtr cylinderInt( new D3Q27Interactor(cylinder, grid, bcObst,Interactor3D::SOLID)); - - sd.addInteractor(cylinderInt); - sd.deleteSolidBlocks(); - - grid->accept( metisVisitor ); - - //if(myid ==0) grid->writeBlocks(pathname + "/grid/blocks" + StringUtil::toString(myid), 0, WbWriterVtkXmlBinary::getInstance(), false); - - unsigned long nob = grid->getNumberOfBlocks(); - int gl = 3; - unsigned long nod = nob * (blocknx1+gl) * (blocknx2+gl) * (blocknx3+gl); - - double needMemAll = double(nod*(27*sizeof(double) + sizeof(int) + sizeof(float)*4)); - double needMem = needMemAll / double(comm->getNumberOfProcesses()); - - if(myid == 0) - { - UBLOG(logINFO,"Number of blocks = " << nob); - UBLOG(logINFO,"Number of nodes = " << nod); - UBLOG(logINFO,"Necessary memory = " << needMemAll << " bytes"); - UBLOG(logINFO,"Necessary memory per process = " << needMem << " bytes"); - UBLOG(logINFO,"Available memory per process = " << availMem << " bytes"); - } - - LBMKernel3DPtr kernel(new LBMKernelETD3Q27Cascaded(blocknx1, blocknx2, blocknx3)); - - BCProcessorPtr bcProc(new D3Q27ETBCProcessor()); - kernel->setBCProcessor(bcProc); - - SetKernelBlockVisitor kernelVisitor(kernel, nueLB, availMem, needMem); - grid->accept(kernelVisitor); - - if (refineLevel > 0) - { - D3Q27SetUndefinedNodesBlockVisitor undefNodesVisitor; - grid->accept(undefNodesVisitor); - } - - //walls - D3Q27InteractorPtr addWallYminInt(new D3Q27Interactor(addWallYmin, grid, bcObst,Interactor3D::SOLID)); - grid->addAndInitInteractor(addWallYminInt); - - D3Q27InteractorPtr addWallZminInt(new D3Q27Interactor(addWallZmin, grid, bcObst,Interactor3D::SOLID)); - grid->addAndInitInteractor(addWallZminInt); - - D3Q27InteractorPtr addWallYmaxInt(new D3Q27Interactor(addWallYmax, grid, bcObst,Interactor3D::SOLID)); - grid->addAndInitInteractor(addWallYmaxInt); - - D3Q27InteractorPtr addWallZmaxInt(new D3Q27Interactor(addWallZmax, grid, bcObst,Interactor3D::SOLID)); - grid->addAndInitInteractor(addWallZmaxInt); - - //inflow - double Cz = geoInflow->getX3Centroid(); - double Hz = geoInflow->getLengthX3()-2.0*blockLength; - double Cy = geoInflow->getX2Centroid(); - double Hy = geoInflow->getLengthX2()-2.0*blockLength; - mu::Parser fct = MathUtil::getDuctParaboloidX(Cy,Hy,Cz,Hz,uLB); - - D3Q27BoundaryConditionAdapterPtr velBCAdapter(new D3Q27VelocityBCAdapter (true, false ,false ,fct, 0, D3Q27BCFunction::INFCONST)); - velBCAdapter->setSecondaryBcOption(2); - D3Q27InteractorPtr inflowInt = D3Q27InteractorPtr( new D3Q27Interactor(geoInflow, grid, velBCAdapter, Interactor3D::SOLID)); - grid->addAndInitInteractor(inflowInt); - - //outflow - D3Q27BoundaryConditionAdapterPtr denBCAdapter(new D3Q27DensityBCAdapter(rhoLB)); - D3Q27InteractorPtr outflowInt = D3Q27InteractorPtr( new D3Q27Interactor(geoOutflow, grid, denBCAdapter,Interactor3D::SOLID)); - grid->addAndInitInteractor(outflowInt); - - //obstacle - grid->addAndInitInteractor(cylinderInt); - - sd.updateGrid(); - - //set connectors - D3Q27InterpolationProcessorPtr iProcessor(new D3Q27OffsetInterpolationProcessor()); - //D3Q27InterpolationProcessorPtr iProcessor(new D3Q27CompactInterpolationProcessor()); - D3Q27SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nueLB, iProcessor); - grid->accept( setConnsVisitor ); - - //domain decomposition - PQueuePartitioningGridVisitor pqPartVisitor(numOfThreads); - grid->accept(pqPartVisitor); - - //initialization of distributions - D3Q27ETInitDistributionsBlockVisitor initVisitor(1.0); - grid->accept(initVisitor); - - //Postrozess - if(myid ==0) grid->writeBlocks(pathname + "/grid/blocks" + StringUtil::toString(myid), 0, WbWriterVtkXmlBinary::getInstance(), false); - - { - UbSchedulerPtr geoSch(new UbScheduler(1)); - D3Q27MacroscopicQuantitiesPostprocessor ppgeo(grid, pathname + "/grid/nodes", WbWriterVtkXmlBinary::getInstance(), conv, geoSch, comm, true); - grid->doPostProcess(0); - } - - if(myid == 0) UBLOG(logINFO,"Preprozess - end"); - } - - double outTime = 50000.0; - UbSchedulerPtr visSch(new UbScheduler(outTime)); - visSch->addSchedule(1000, 0, 5001); - - //D3Q27MacroscopicQuantitiesPostprocessor pp(grid, pathname + "/steps/step", WbWriterVtkXmlBinary::getInstance(), conv, visSch, comm); -// - //double fdx = grid->getDeltaX(grid->getFinestInitializedLevel()); - //double point1[3] = {0.45, 0.20, 0.205}; - //double point2[3] = {0.55, 0.20, 0.205}; -// - //D3Q27IntegrateValuesHelperPtr h1(new D3Q27IntegrateValuesHelper(grid, comm, - //point1[0]-2.0*fdx-blockLength, point1[1]-1.0*fdx, point1[2]-1.0*fdx, - //point1[0]-1.0*fdx-blockLength, point1[1]+1.0*fdx, point1[2]+1.0*fdx)); - //if(myid ==0) GbSystem3D::writeGeoObject(h1->getBoundingBox().get(),pathname + "/geo/iv1", WbWriterVtkXmlBinary::getInstance()); - //D3Q27IntegrateValuesHelperPtr h2(new D3Q27IntegrateValuesHelper(grid, comm, - //point2[0]+1.0*fdx+blockLength, point2[1]-1.0*fdx, point2[2]-1.0*fdx, - //point2[0]+2.0*fdx+blockLength, point2[1]+1.0*fdx, point2[2]+1.0*fdx)); - //if(myid ==0) GbSystem3D::writeGeoObject(h2->getBoundingBox().get(),pathname + "/geo/iv2", WbWriterVtkXmlBinary::getInstance()); - //D3Q27PressureDifferencePostprocessor rhopp(grid, pathname + "/results/rho_diff.txt", h1, h2, conv, visSch, comm); - - NUPSCounterPostprocessor npr(grid, visSch, pathname + "/results/nups.txt", comm); - - double endTime = 5001.0; - CalculationManagerPtr calculation(new CalculationManager(grid, numOfThreads, endTime, visSch)); - if(myid == 0) UBLOG(logINFO,"Simulation-start"); - calculation->calculate(); - if(myid == 0) UBLOG(logINFO,"Simulation-end"); - } - catch(std::exception& e) - { - cerr << e.what() << endl << flush; - } - catch(std::string& s) - { - cerr << s << endl; - } - catch(...) - { - cerr << "unknown exception" << endl; - } - -} -int main(int argc, char* argv[]) -{ - - run(argv[1]); - - return 0; -} - diff --git a/apps/cpu/GyroidsRow/GyroidsRow.cpp b/apps/cpu/GyroidsRow/GyroidsRow.cpp index 94390e3af1806bbce59ec7bd1d18768180c42ddf..39cdee4e25b1ed04193c9d2c3e4cc0dd02621447 100644 --- a/apps/cpu/GyroidsRow/GyroidsRow.cpp +++ b/apps/cpu/GyroidsRow/GyroidsRow.cpp @@ -222,7 +222,7 @@ void run(string configname) } ////////////////////////////////////////////////////////////////////////// - SetKernelBlockVisitor kernelVisitor(kernel, nu, availMem, needMem); + SetKernelBlockVisitor kernelVisitor(kernel, nu); grid->accept(kernelVisitor); intHelper.setBC(); diff --git a/apps/cpu/LaminarPipeFlow/CMakeLists.txt b/apps/cpu/LaminarPipeFlow/CMakeLists.txt index fa0e32f6807f94fb567ced0966469507517d363a..eae44b0f88e173f5377cbe282c32c3f4b2c1ab07 100644 --- a/apps/cpu/LaminarPipeFlow/CMakeLists.txt +++ b/apps/cpu/LaminarPipeFlow/CMakeLists.txt @@ -1,7 +1,7 @@ PROJECT(LaminarPipeFlow) -vf_add_library(BUILDTYPE binary PRIVATE_LINK cpu_core muparser basics ${MPI_CXX_LIBRARIES} FILES lpf.cpp ) +vf_add_library(BUILDTYPE binary PRIVATE_LINK cpu_core muparser basics ${MPI_CXX_LIBRARIES} FILES LaminarPipeFlow.cpp ) vf_get_library_name (library_name) target_include_directories(${library_name} PRIVATE ${APPS_ROOT_CPU}) \ No newline at end of file diff --git a/apps/cpu/LaminarPipeFlow/LaminarPipeFlow.cfg b/apps/cpu/LaminarPipeFlow/LaminarPipeFlow.cfg new file mode 100644 index 0000000000000000000000000000000000000000..ce47a265c1fc5a6c37e23376563d8973252b806b --- /dev/null +++ b/apps/cpu/LaminarPipeFlow/LaminarPipeFlow.cfg @@ -0,0 +1,18 @@ +pathname = ./output/LaminarPipeFlow +numOfThreads = 1 + +#Grid +length = 128 64 64 +blocknx = 16 16 16 +dx = 1 +refineLevel = 1 + +#Simulation +newStart = true +restartStep = 1000 + +cpStart = 1000000 +cpStep = 1000000 + +outTime = 10 +endTime = 10 \ No newline at end of file diff --git a/apps/cpu/LaminarPipeFlow/LaminarPipeFlow.cpp b/apps/cpu/LaminarPipeFlow/LaminarPipeFlow.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ce2b7aacbe9ade5a66f17ad9acada6fbadbee01b --- /dev/null +++ b/apps/cpu/LaminarPipeFlow/LaminarPipeFlow.cpp @@ -0,0 +1,307 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file LaminarPipeFlow.cpp +//! \ingroup apps +//! \author Konstantin Kutscher +//======================================================================================= +#include <iostream> +#include <string> +//#include <omp.h> + +#include "VirtualFluids.h" + +using namespace std; + + +void run(string configname) +{ + using namespace vf::lbm::dir; + + try + { + vf::basics::ConfigurationFile config; + config.load(configname); + + string pathname = config.getValue<string>("pathname"); + int numOfThreads = config.getValue<int>("numOfThreads"); + vector<int> blocknx = config.getVector<int>("blocknx"); + real endTime = config.getValue<real>("endTime"); + real outTime = config.getValue<real>("outTime"); + int refineLevel = config.getValue<int>("refineLevel"); + real dx = config.getValue<real>("dx"); + vector<real> length = config.getVector<real>("length"); + real restartStep = config.getValue<real>("restartStep"); + real cpStart = config.getValue<real>("cpStart"); + real cpStep = config.getValue<real>("cpStep"); + bool newStart = config.getValue<bool>("newStart"); + + SPtr<vf::parallel::Communicator> comm = vf::parallel::MPICommunicator::getInstance(); + int myid = comm->getProcessID(); + + real dLB = length[1] / dx; + real rhoLB1 = 0.00001; + real rhoLB2 = 0.0; + real nuLB = 0.0064; + + SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter()); + + //boundary conditions + ////////////////////////////////////////////////////////////////////////////// + SPtr<BC> noSlipBC(new NoSlipBC()); + noSlipBC->setBCStrategy(SPtr<BCStrategy>(new NoSlipInterpolated())); + + SPtr<BC> pressureBC1(new PressureBC(rhoLB1)); + pressureBC1->setBCStrategy(SPtr<BCStrategy>(new PressureNonEquilibrium())); + + SPtr<BC> pressureBC2(new PressureBC(rhoLB2)); + pressureBC2->setBCStrategy(SPtr<BCStrategy>(new PressureNonEquilibrium())); + + ////////////////////////////////////////////////////////////////////////////////// + //BC visitor + BoundaryConditionsBlockVisitor bcVisitor; + + SPtr<Grid3D> grid(new Grid3D(comm)); + + SPtr<BCSet> bcProc; + bcProc = SPtr<BCSet>(new BCSet()); + + SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new K17CompressibleNavierStokes()); + kernel->setBCSet(bcProc); + + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, d00M)); + + + ////////////////////////////////////////////////////////////////////////// + //restart + SPtr<UbScheduler> mSch(new UbScheduler(cpStep, cpStart)); + SPtr<MPIIOMigrationSimulationObserver> restart(new MPIIOMigrationSimulationObserver(grid, mSch, metisVisitor, pathname, comm)); + restart->setLBMKernel(kernel); + restart->setBCSet(bcProc); + ////////////////////////////////////////////////////////////////////////// + real R = length[1] / 2.0; + real dp = (rhoLB1 / 3. - rhoLB2 / 3.); + real L = length[0]; + real u_max = R* R / (4. * nuLB) * (dp / L); + real Re = u_max * 2 * R / nuLB; + + if (myid == 0) + { + VF_LOG_INFO("Parameters:"); + VF_LOG_INFO("p1 = {}", rhoLB1 / 3.); + VF_LOG_INFO("p1 = {}", rhoLB2 / 3.); + VF_LOG_INFO("nuLb = {}", nuLB); + VF_LOG_INFO("u_max = {}", u_max ); + VF_LOG_INFO("Re = {}", Re); + VF_LOG_INFO("dx = {}", dx); + VF_LOG_INFO("number of levels = {}", refineLevel + 1); + VF_LOG_INFO("numOfThreads = {}", numOfThreads); + VF_LOG_INFO("path = {}", pathname); + VF_LOG_INFO("Preprocess - start"); + } + + if (newStart) + { + + //bounding box + real g_minX1 = 0.0; + real g_minX2 = -length[1] / 2.0; + real g_minX3 = -length[2] / 2.0; + + real g_maxX1 = length[0]; + real g_maxX2 = length[1] / 2.0; + real g_maxX3 = length[2] / 2.0; + + SPtr<GbObject3D> cylinder(new GbCylinder3D(g_minX1 - 2.0*dx, 0.0, 0.0, g_maxX1 + 2.0*dx, 0.0, 0.0, dLB / 2.0)); + GbSystem3D::writeGeoObject(cylinder.get(), pathname + "/geo/cylinder", WbWriterVtkXmlBinary::getInstance()); + + SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3)); + if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); + + real blockLength = 3. * dx; + + grid->setDeltaX(dx); + grid->setBlockNX(blocknx[0], blocknx[1], blocknx[2]); + grid->setPeriodicX1(false); + grid->setPeriodicX2(false); + grid->setPeriodicX3(false); + + if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); + + GenBlocksGridVisitor genBlocks(gridCube); + grid->accept(genBlocks); + + SPtr<GbObject3D> refineCube1_1(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_minX2 + blockLength, g_maxX3)); + if (myid == 0) GbSystem3D::writeGeoObject(refineCube1_1.get(), pathname + "/geo/refineCube1_1", WbWriterVtkXmlBinary::getInstance()); + + SPtr<GbObject3D> refineCube1_2(new GbCuboid3D(g_minX1, g_maxX2 - blockLength, g_minX3, g_maxX1, g_maxX2, g_maxX3)); + if (myid == 0) GbSystem3D::writeGeoObject(refineCube1_2.get(), pathname + "/geo/refineCube1_2", WbWriterVtkXmlBinary::getInstance()); + + SPtr<GbObject3D> refineCube1_3(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_minX3 + blockLength)); + if (myid == 0) GbSystem3D::writeGeoObject(refineCube1_3.get(), pathname + "/geo/refineCube1_3", WbWriterVtkXmlBinary::getInstance()); + + SPtr<GbObject3D> refineCube1_4(new GbCuboid3D(g_minX1, g_minX2, g_maxX3 - blockLength, g_maxX1, g_maxX2, g_maxX3)); + if (myid == 0) GbSystem3D::writeGeoObject(refineCube1_4.get(), pathname + "/geo/refineCube1_4", WbWriterVtkXmlBinary::getInstance()); + + if (refineLevel > 0) + { + if (myid == 0) UBLOG(logINFO, "Refinement - start"); + RefineCrossAndInsideGbObjectHelper refineHelper(grid, refineLevel, comm); + refineHelper.addGbObject(refineCube1_1, 1); + refineHelper.addGbObject(refineCube1_2, 1); + refineHelper.addGbObject(refineCube1_3, 1); + refineHelper.addGbObject(refineCube1_4, 1); + refineHelper.refine(); + if (myid == 0) UBLOG(logINFO, "Refinement - end"); + } + + //inflow + GbCuboid3DPtr geoInflow(new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3-blockLength, g_minX1, g_maxX2+blockLength, g_maxX3+blockLength)); + if (myid==0) GbSystem3D::writeGeoObject(geoInflow.get(), pathname+"/geo/geoInflow", WbWriterVtkXmlASCII::getInstance()); + + //outflow + GbCuboid3DPtr geoOutflow(new GbCuboid3D(g_maxX1, g_minX2-blockLength, g_minX3-blockLength, g_maxX1+blockLength, g_maxX2+blockLength, g_maxX3+blockLength)); + if (myid==0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathname+"/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance()); + + SPtr<D3Q27Interactor> cylinderInt(new D3Q27Interactor(cylinder, grid, noSlipBC, Interactor3D::INVERSESOLID)); + + SPtr<D3Q27Interactor> inflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoInflow, grid, pressureBC1, Interactor3D::SOLID)); + + SPtr<D3Q27Interactor> outflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, pressureBC2, Interactor3D::SOLID)); + + InteractorsHelper intHelper(grid, metisVisitor); + intHelper.addInteractor(cylinderInt); + intHelper.addInteractor(inflowInt); + intHelper.addInteractor(outflowInt); + intHelper.selectBlocks(); + + SPtr<SimulationObserver> ppblocks(new WriteBlocksSimulationObserver(grid, SPtr<UbScheduler>(new UbScheduler(1)), pathname, WbWriterVtkXmlBinary::getInstance(), comm)); + ppblocks->update(0); + ppblocks.reset(); + + if (myid == 0) VF_LOG_INFO("{}",Utilities::toString(grid, comm->getNumberOfProcesses())); + + SetKernelBlockVisitor kernelVisitor(kernel, nuLB); + grid->accept(kernelVisitor); + + if (refineLevel > 0) + { + SetUndefinedNodesBlockVisitor undefNodesVisitor; + grid->accept(undefNodesVisitor); + } + + intHelper.setBC(); + + //initialization of distributions + InitDistributionsBlockVisitor initVisitor; + grid->accept(initVisitor); + + //boundary conditions grid + { + SPtr<UbScheduler> geoSch(new UbScheduler(1)); + SPtr<SimulationObserver> ppgeo(new WriteBoundaryConditionsSimulationObserver(grid, geoSch, pathname, WbWriterVtkXmlBinary::getInstance(), comm)); + ppgeo->update(0); + ppgeo.reset(); + } + + + } + else + { + restart->restart((int)restartStep); + grid->setTimeStep(restartStep); + + if (myid == 0) VF_LOG_INFO("Restart - end"); + } + + grid->accept(bcVisitor); + + OneDistributionSetConnectorsBlockVisitor setConnsVisitor(comm); + grid->accept(setConnsVisitor); + + SPtr<Interpolator> iProcessor(new CompressibleOffsetMomentsInterpolator()); + SetInterpolationConnectorsBlockVisitor setInterConnsVisitor(comm, nuLB, iProcessor); + grid->accept(setInterConnsVisitor); + + SPtr<UbScheduler> visSch(new UbScheduler(outTime)); + SPtr<SimulationObserver> pp(new WriteMacroscopicQuantitiesSimulationObserver(grid, visSch, pathname, WbWriterVtkXmlBinary::getInstance(), conv, comm)); + + SPtr<UbScheduler> nupsSch(new UbScheduler(10, 10, 100)); + SPtr<SimulationObserver> npr(new NUPSCounterSimulationObserver(grid, nupsSch, numOfThreads, comm)); + +#ifdef _OPENMP + omp_set_num_threads(numOfThreads); +#endif + + if (myid == 0) + VF_LOG_INFO("Preprocess - end"); + + SPtr<UbScheduler> stepGhostLayer(visSch); + SPtr<Simulation> simulation(new Simulation(grid, stepGhostLayer, int(endTime))); + simulation->addSimulationObserver(npr); + simulation->addSimulationObserver(pp); + simulation->addSimulationObserver(restart); + + if (myid == 0) VF_LOG_INFO("Simulation-start"); + simulation->run(); + if (myid == 0) VF_LOG_INFO("Simulation-end"); + } + catch (std::exception& e) + { + cerr << e.what() << endl << flush; + } + catch (std::string& s) + { + cerr << s << endl; + } + catch (...) + { + cerr << "unknown exception" << endl; + } + +} + + +int main(int argc, char *argv[]) +{ + try { + vf::logging::Logger::initializeLogger(); + + VF_LOG_INFO("Starting VirtualFluids..."); + + if (argc > 1) + run(std::string(argv[1])); + else + VF_LOG_CRITICAL("Configuration file is missing!"); + + VF_LOG_INFO("VirtualFluids is finished."); + + } catch (const spdlog::spdlog_ex &ex) { + std::cout << "Log initialization failed: " << ex.what() << std::endl; + } +} diff --git a/apps/cpu/LaminarPipeFlow/lpf.cfg b/apps/cpu/LaminarPipeFlow/lpf.cfg deleted file mode 100644 index 110b99d35005d90bfc869ff4f962b2e55560d543..0000000000000000000000000000000000000000 --- a/apps/cpu/LaminarPipeFlow/lpf.cfg +++ /dev/null @@ -1,26 +0,0 @@ -pathname = d:/temp/LaminarTubeFlow -numOfThreads = 1 -availMem = 10e9 - -#Grid -length = 64 32 32 -#length = 21 6 13 -blocknx = 8 8 8 -dx = 1 -refineLevel = 0 - -#Simulation -uLB = 0.01 -Re = 10 - - -logToFile = false - -newStart = true -restartStep = 10 - -cpStart = 1000 -cpStep = 1000 - -outTime = 10 -endTime = 1000 \ No newline at end of file diff --git a/apps/cpu/LaminarPipeFlow/lpf.cpp b/apps/cpu/LaminarPipeFlow/lpf.cpp deleted file mode 100644 index d46dd60aedc26bf540fdd193596be4a109c01004..0000000000000000000000000000000000000000 --- a/apps/cpu/LaminarPipeFlow/lpf.cpp +++ /dev/null @@ -1,372 +0,0 @@ -#include <iostream> -#include <string> -//#include <omp.h> - -#include "VirtualFluids.h" - -using namespace std; - - -void run(string configname) -{ - using namespace vf::lbm::dir; - - try - { - vf::basics::ConfigurationFile config; - config.load(configname); - - string pathname = config.getValue<string>("pathname"); - int numOfThreads = config.getValue<int>("numOfThreads"); - vector<int> blocknx = config.getVector<int>("blocknx"); - real uLB = config.getValue<real>("uLB"); - real endTime = config.getValue<real>("endTime"); - real outTime = config.getValue<real>("outTime"); - real availMem = config.getValue<real>("availMem"); - int refineLevel = config.getValue<int>("refineLevel"); - real Re = config.getValue<real>("Re"); - real dx = config.getValue<real>("dx"); - vector<real> length = config.getVector<real>("length"); - bool logToFile = config.getValue<bool>("logToFile"); - real restartStep = config.getValue<real>("restartStep"); - real cpStart = config.getValue<real>("cpStart"); - real cpStep = config.getValue<real>("cpStep"); - bool newStart = config.getValue<bool>("newStart"); - - SPtr<vf::parallel::Communicator> comm = vf::parallel::MPICommunicator::getInstance(); - int myid = comm->getProcessID(); - - if (logToFile) - { -#if defined(__unix__) - if (myid == 0) - { - const char* str = pathname.c_str(); - mkdir(str, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - } -#endif - - if (myid == 0) - { - stringstream logFilename; - logFilename << pathname + "/logfile" + UbSystem::toString(UbSystem::getTimeStamp()) + ".txt"; - UbLog::output_policy::setStream(logFilename.str()); - - vf::logging::Logger::changeLogPath(pathname); - } - } - - //Sleep(30000); - - real dLB = length[1] / dx; - real rhoLB = 0.0; - real nuLB = (uLB*dLB) / Re; - - SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter()); - - //BC Adapter - ////////////////////////////////////////////////////////////////////////////// - SPtr<BC> noSlipBC(new NoSlipBC()); - //noSlipBC->setBCStrategy(SPtr<BCStrategy>(new ThinWallNoSlip())); - //SPtr<BC> denBC(new PressureBC(rhoLB)); - //denBC->setBCStrategy(SPtr<BCStrategy>(new EqDensityBCStrategy())); - - noSlipBC->setBCStrategy(SPtr<BCStrategy>(new NoSlipInterpolated())); - - SPtr<BC> denBC(new PressureBC(rhoLB)); - denBC->setBCStrategy(SPtr<BCStrategy>(new OutflowNonReflecting())); - //denBC->setBCStrategy(SPtr<BCStrategy>(new PressureNonEquilibrium())); - - //double startTime = 5; - mu::Parser fct1; - fct1.SetExpr("U"); - fct1.DefineConst("U", uLB); - SPtr<BC> velBC1(new VelocityBC(true, false, false, fct1, 0, BCFunction::INFCONST)); - //velBC1->setBCStrategy(SPtr<BCStrategy>(new VelocityInterpolated())); - velBC1->setBCStrategy(SPtr<BCStrategy>(new VelocityWithPressureInterpolated())); - - //mu::Parser fct2; - //fct2.SetExpr("U"); - //fct2.DefineConst("U", uLB); - //SPtr<BC> velBC2(new VelocityBC(true, false, false, fct2, startTime, BCFunction::INFCONST)); - - ////////////////////////////////////////////////////////////////////////////////// - //BS visitor - BoundaryConditionsBlockVisitor bcVisitor; - - SPtr<Grid3D> grid(new Grid3D(comm)); - - SPtr<BCSet> bcProc; - bcProc = SPtr<BCSet>(new BCSet()); - - //SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new K17CompressibleNavierStokes()); - //double bulckViscosity = 3700*nuLB; - //dynamicPointerCast<K17CompressibleNavierStokes>(kernel)->setBulkViscosity(bulckViscosity); - SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new K17CompressibleNavierStokes()); - kernel->setBCSet(bcProc); - kernel->setBCSet(bcProc); - - ////////////////////////////////////////////////////////////////////////// - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, d00M)); - //restart - SPtr<UbScheduler> mSch(new UbScheduler(cpStep, cpStart)); - //SPtr<MPIIOMigrationSimulationObserver> migSimulationObserver(new MPIIOMigrationSimulationObserver(grid, mSch, metisVisitor, pathname + "/mig", comm)); - SPtr<MPIIOMigrationBESimulationObserver> migSimulationObserver(new MPIIOMigrationBESimulationObserver(grid, mSch, metisVisitor, pathname + "/mig", comm)); - migSimulationObserver->setLBMKernel(kernel); - migSimulationObserver->setBCSet(bcProc); - migSimulationObserver->setNu(nuLB); - migSimulationObserver->setNuLG(0.01, 0.01); - migSimulationObserver->setDensityRatio(1); - ////////////////////////////////////////////////////////////////////////// - - SPtr<D3Q27Interactor> inflowInt; - - if (newStart) - { - - //bounding box - real g_minX1 = 0.0; - real g_minX2 = -length[1] / 2.0; - real g_minX3 = -length[2] / 2.0; - - real g_maxX1 = length[0]; - real g_maxX2 = length[1] / 2.0; - real g_maxX3 = length[2] / 2.0; - - //geometry - //x - //SPtr<GbObject3D> cylinder(new GbCylinder3D(g_minX1 - 2.0*dx, 0.0, 0.0, g_maxX1 + 2.0*dx, 0.0, 0.0, dLB / 2.0)); - //y - SPtr<GbObject3D> cylinder(new GbCylinder3D(g_minX1 - 2.0*dx, 0.0, 0.0, g_maxX1 + 2.0*dx, 0.0, 0.0, dLB / 2.0)); - GbSystem3D::writeGeoObject(cylinder.get(), pathname + "/geo/cylinder", WbWriterVtkXmlBinary::getInstance()); - - SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3)); - if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); - - - real blockLength = blocknx[0] * dx; - - - - if (myid == 0) - { - VF_LOG_INFO("uLb = {}", uLB); - VF_LOG_INFO("rho = {}", rhoLB); - VF_LOG_INFO("nuLb = {}", nuLB); - VF_LOG_INFO("Re = {}", Re); - VF_LOG_INFO("dx = {}", dx); - VF_LOG_INFO("Preprocess - start"); - } - - grid->setDeltaX(dx); - grid->setBlockNX(blocknx[0], blocknx[1], blocknx[2]); - - grid->setPeriodicX1(false); - grid->setPeriodicX2(false); - grid->setPeriodicX3(false); - - if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); - - GenBlocksGridVisitor genBlocks(gridCube); - grid->accept(genBlocks); - - ////inflow - //GbCuboid3DPtr geoInflow(new GbCuboid3D(g_minX1 - 2.0*dx, g_minX2 - dx, g_minX3 - dx, g_minX1, g_maxX2, g_maxX3 + dx)); - //if (myid == 0) GbSystem3D::writeGeoObject(geoInflow.get(), pathname + "/geo/geoInflow", WbWriterVtkXmlASCII::getInstance()); - - ////outflow - //GbCuboid3DPtr geoOutflow(new GbCuboid3D(g_maxX1, g_minX2, g_minX3 - dx, g_maxX1 + 2.0*dx, g_maxX2 + dx, g_maxX3 + dx)); - //if (myid == 0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathname + "/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance()); - - //inflow - GbCuboid3DPtr geoInflow(new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3-blockLength, g_minX1, g_maxX2+blockLength, g_maxX3+blockLength)); - if (myid==0) GbSystem3D::writeGeoObject(geoInflow.get(), pathname+"/geo/geoInflow", WbWriterVtkXmlASCII::getInstance()); - - //outflow - GbCuboid3DPtr geoOutflow(new GbCuboid3D(g_maxX1, g_minX2-blockLength, g_minX3-blockLength, g_maxX1+blockLength, g_maxX2+blockLength, g_maxX3+blockLength)); - if (myid==0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathname+"/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance()); - - SPtr<SimulationObserver> ppblocks(new WriteBlocksSimulationObserver(grid, SPtr<UbScheduler>(new UbScheduler(1)), pathname, WbWriterVtkXmlBinary::getInstance(), comm)); - - ppblocks->update(0); - - SPtr<D3Q27Interactor> cylinderInt(new D3Q27Interactor(cylinder, grid, noSlipBC, Interactor3D::INVERSESOLID)); - - //double r = dynamicPointerCast<GbCylinder3D>(cylinder)->getRadius(); - //double cx1 = g_minX1; - //double cx2 = cylinder->getX2Centroid(); - //double cx3 = cylinder->getX3Centroid(); - - //mu::Parser fct; - //fct.SetExpr("vx1"); - ////fct.SetExpr("vx1*(1-((x2-y0)^2+(x3-z0)^2)/(R^2))"); - ////fct.DefineConst("x2Vmax", 0.0); //x2-Pos fuer vmax - ////fct.DefineConst("x3Vmax", 0.0); //x3-Pos fuer vmax - ////fct.DefineConst("R", r); - //fct.DefineConst("vx1", uLB); - ////fct.DefineConst("x0", cx1); - ////fct.DefineConst("y0", cx2); - ////fct.DefineConst("z0", cx3); - ////fct.DefineConst("nue", nuLB); - //SPtr<BC> velBC(new VelocityBC(true, false, false, fct, 0, BCFunction::INFCONST)); - //velBC->setBCStrategy(SPtr<BCStrategy>(new VelocityInterpolated())); - //velBC->setBCStrategy(SPtr<BCStrategy>(new VelocityWithPressureInterpolated())); - - inflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoInflow, grid, velBC1, Interactor3D::SOLID)); - //inflowInt->addBC(velBC2); - - - //outflow - SPtr<D3Q27Interactor> outflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, denBC, Interactor3D::SOLID)); - - //SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_00M)); - InteractorsHelper intHelper(grid, metisVisitor); - intHelper.addInteractor(cylinderInt); - intHelper.addInteractor(inflowInt); - intHelper.addInteractor(outflowInt); - intHelper.selectBlocks(); - - ppblocks->update(0); - ppblocks.reset(); - - unsigned long long numberOfBlocks = (unsigned long long)grid->getNumberOfBlocks(); - int ghostLayer = 3; - unsigned long long numberOfNodesPerBlock = (unsigned long long)(blocknx[0])* (unsigned long long)(blocknx[1])* (unsigned long long)(blocknx[2]); - unsigned long long numberOfNodes = numberOfBlocks * numberOfNodesPerBlock; - unsigned long long numberOfNodesPerBlockWithGhostLayer = numberOfBlocks * (blocknx[0] + ghostLayer) * (blocknx[1] + ghostLayer) * (blocknx[2] + ghostLayer); - real needMemAll = real(numberOfNodesPerBlockWithGhostLayer*(27 * sizeof(real) + sizeof(int) + sizeof(float) * 4)); - real needMem = needMemAll / real(comm->getNumberOfProcesses()); - - if (myid == 0) - { - VF_LOG_INFO("Number of blocks = {}", numberOfBlocks); - VF_LOG_INFO("Number of nodes = {}", numberOfNodes); - int minInitLevel = grid->getCoarsestInitializedLevel(); - int maxInitLevel = grid->getFinestInitializedLevel(); - for (int level = minInitLevel; level <= maxInitLevel; level++) - { - int nobl = grid->getNumberOfBlocks(level); - VF_LOG_INFO("Number of blocks for level {} = {}", level, nobl); - VF_LOG_INFO("Number of nodes for level {} = {}", level, nobl*numberOfNodesPerBlock); - } - VF_LOG_INFO("Necessary memory = {} bytes", needMemAll); - VF_LOG_INFO("Necessary memory per process = {} bytes", needMem); - VF_LOG_INFO("Available memory per process = {} bytes", availMem); - } - - SetKernelBlockVisitor kernelVisitor(kernel, nuLB, availMem, needMem); - grid->accept(kernelVisitor); - - if (refineLevel > 0) - { - SetUndefinedNodesBlockVisitor undefNodesVisitor; - grid->accept(undefNodesVisitor); - } - - intHelper.setBC(); - - //bcVisitor.addBC(velBC1); - grid->accept(bcVisitor); - - //initialization of distributions - InitDistributionsBlockVisitor initVisitor; - //initVisitor.setVx1(fct); - //initVisitor.setVx1(uLB); - grid->accept(initVisitor); - - //boundary conditions grid - { - SPtr<UbScheduler> geoSch(new UbScheduler(1)); - SPtr<SimulationObserver> ppgeo(new WriteBoundaryConditionsSimulationObserver(grid, geoSch, pathname, WbWriterVtkXmlBinary::getInstance(), comm)); - ppgeo->update(0); - ppgeo.reset(); - } - - if (myid == 0) VF_LOG_INFO("Preprocess - end"); - } - else - { - if (myid == 0) - { - VF_LOG_INFO("Parameters:"); - VF_LOG_INFO("uLb = {}", uLB); - VF_LOG_INFO("rho = {}", rhoLB); - VF_LOG_INFO("nuLb = {}", nuLB); - VF_LOG_INFO("Re = {}", Re); - VF_LOG_INFO("dx = {}", dx); - VF_LOG_INFO("number of levels = {}", refineLevel + 1); - VF_LOG_INFO("numOfThreads = {}", numOfThreads); - VF_LOG_INFO("path = {}", pathname); - } - - migSimulationObserver->restart((int)restartStep); - grid->setTimeStep(restartStep); - - if (myid == 0) VF_LOG_INFO("Restart - end"); - } - - OneDistributionSetConnectorsBlockVisitor setConnsVisitor(comm); - grid->accept(setConnsVisitor); - - SPtr<Interpolator> iProcessor(new CompressibleOffsetMomentsInterpolator()); - SetInterpolationConnectorsBlockVisitor setInterConnsVisitor(comm, nuLB, iProcessor); - grid->accept(setInterConnsVisitor); - - SPtr<UbScheduler> visSch(new UbScheduler(outTime)); - SPtr<SimulationObserver> pp(new WriteMacroscopicQuantitiesSimulationObserver(grid, visSch, pathname, WbWriterVtkXmlBinary::getInstance(), conv, comm)); - - SPtr<UbScheduler> nupsSch(new UbScheduler(100, 100, 100000000)); - SPtr<SimulationObserver> npr(new NUPSCounterSimulationObserver(grid, nupsSch, numOfThreads, comm)); - - //SPtr<UbScheduler> timeBCSch(new UbScheduler(1, startTime, startTime)); - //auto timeDepBC = make_shared<TimeDependentBCSimulationObserver>(TimeDependentBCSimulationObserver(grid, timeBCSch)); - //timeDepBC->addInteractor(inflowInt); -#ifdef _OPENMP - omp_set_num_threads(numOfThreads); -#endif - numOfThreads = 1; - SPtr<UbScheduler> stepGhostLayer(visSch); - SPtr<Simulation> simulation(new Simulation(grid, stepGhostLayer, int(endTime))); - simulation->addSimulationObserver(npr); - simulation->addSimulationObserver(pp); - simulation->addSimulationObserver(migSimulationObserver); - //simulation->addSimulationObserver(timeDepBC); - - if (myid == 0) VF_LOG_INFO("Simulation-start"); - simulation->run(); - if (myid == 0) VF_LOG_INFO("Simulation-end"); - } - catch (std::exception& e) - { - cerr << e.what() << endl << flush; - } - catch (std::string& s) - { - cerr << s << endl; - } - catch (...) - { - cerr << "unknown exception" << endl; - } - -} - - -int main(int argc, char *argv[]) -{ - try { - vf::logging::Logger::initializeLogger(); - - VF_LOG_INFO("Starting VirtualFluids..."); - - if (argc > 1) - run(std::string(argv[1])); - else - VF_LOG_CRITICAL("Configuration file is missing!"); - - VF_LOG_INFO("VirtualFluids is finished."); - - } catch (const spdlog::spdlog_ex &ex) { - std::cout << "Log initialization failed: " << ex.what() << std::endl; - } -} diff --git a/apps/cpu/LaminarPlaneFlow/CMakeLists.txt b/apps/cpu/LaminarPlaneFlow/CMakeLists.txt index 6a09da205607ea0583524ae85d129c4fa014f5d5..7cf23bed7c8ec5224ec1005f0a356f40e829b122 100644 --- a/apps/cpu/LaminarPlaneFlow/CMakeLists.txt +++ b/apps/cpu/LaminarPlaneFlow/CMakeLists.txt @@ -1,6 +1,6 @@ PROJECT(LaminarPlaneFlow) -vf_add_library(BUILDTYPE binary PRIVATE_LINK cpu_core muparser basics ${MPI_CXX_LIBRARIES} FILES pflow.cpp ) +vf_add_library(BUILDTYPE binary PRIVATE_LINK cpu_core muparser basics ${MPI_CXX_LIBRARIES} FILES LaminarPlaneFlow.cpp ) vf_get_library_name (library_name) target_include_directories(${library_name} PRIVATE ${APPS_ROOT_CPU}) \ No newline at end of file diff --git a/apps/cpu/LaminarPlaneFlow/LaminarPlaneFlow.cfg b/apps/cpu/LaminarPlaneFlow/LaminarPlaneFlow.cfg new file mode 100644 index 0000000000000000000000000000000000000000..a767d4d2a6cca4a697ea6e6fb13b03c39c43b0ed --- /dev/null +++ b/apps/cpu/LaminarPlaneFlow/LaminarPlaneFlow.cfg @@ -0,0 +1,15 @@ +pathname = ./output/LaminarPlaneFlow +numOfThreads = 1 +blocknx = 16 16 1 +boundingBox = 64 64 1 +deltax = 1 + +refineLevel = 1 + +newStart = true +restartStep = 1000000 + +cpStep = 1000000 +cpStart = 1000000 +outTime = 10 +endTime = 10 diff --git a/apps/cpu/LaminarPlaneFlow/LaminarPlaneFlow.cpp b/apps/cpu/LaminarPlaneFlow/LaminarPlaneFlow.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5808dc7dddc028300251e8e230acf835a2e46671 --- /dev/null +++ b/apps/cpu/LaminarPlaneFlow/LaminarPlaneFlow.cpp @@ -0,0 +1,327 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file LaminarPlaneFlow.cpp +//! \ingroup apps +//! \author Konstantin Kutscher +//======================================================================================= + +#include <iostream> +#include <string> + +#include <VirtualFluids.h> + +using namespace std; + + +void pflowdp(string configname) +{ + using namespace vf::lbm::dir; + try + { + vf::basics::ConfigurationFile config; + config.load(configname); + + string pathname = config.getValue<string>("pathname"); + int numOfThreads = config.getValue<int>("numOfThreads"); + vector<int> blocknx = config.getVector<int>("blocknx"); + vector<real> boundingBox = config.getVector<real>("boundingBox"); + real endTime = config.getValue<real>("endTime"); + real outTime = config.getValue<real>("outTime"); + int refineLevel = config.getValue<int>("refineLevel"); + real restartStep = config.getValue<real>("restartStep"); + real deltax = config.getValue<real>("deltax"); + real cpStep = config.getValue<real>("cpStep"); + real cpStart = config.getValue<real>("cpStart"); + bool newStart = config.getValue<bool>("newStart"); + + SPtr<vf::parallel::Communicator> comm = vf::parallel::MPICommunicator::getInstance(); + int myid = comm->getProcessID(); + + + real rhoLB1 = 0.00001; + real rhoLB2 = 0.0; + real nu = 0.0064; + + real h = boundingBox[1] / 2.0; + real dp = (rhoLB1 / 3. - rhoLB2 / 3.); + real L = boundingBox[0]; + real u_max = h * h / (2. * nu) * (dp / L); + real Re = u_max * 2 * h / nu; + + SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter()); + + //bounding box + real g_minX1 = 0; + real g_minX2 = 0; + real g_minX3 = 0; + + real g_maxX1 = boundingBox[0]; + real g_maxX2 = boundingBox[1]; + real g_maxX3 = boundingBox[2]; + + real blockLength = 3.0 * deltax; + + //bc + SPtr<BC> noSlipBC(new NoSlipBC()); + noSlipBC->setBCStrategy(SPtr<BCStrategy>(new NoSlipInterpolated())); + + SPtr<BC> pressureBC1(new PressureBC(rhoLB1)); + pressureBC1->setBCStrategy(SPtr<BCStrategy>(new PressureNonEquilibrium())); + + SPtr<BC> pressureBC2(new PressureBC(rhoLB2)); + pressureBC2->setBCStrategy(SPtr<BCStrategy>(new PressureNonEquilibrium())); + + //BS visitor + BoundaryConditionsBlockVisitor bcVisitor; + + SPtr<Grid3D> grid(new Grid3D(comm)); + grid->setPeriodicX1(false); + grid->setPeriodicX2(false); + grid->setPeriodicX3(true); + grid->setDeltaX(deltax); + grid->setBlockNX(blocknx[0], blocknx[1], blocknx[2]); + + SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3)); + if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); + + real k1 = 4; + + SPtr<GbObject3D> refineCube1_1(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2 / k1 - 1.0, g_maxX3)); + if (myid == 0) GbSystem3D::writeGeoObject(refineCube1_1.get(), pathname + "/geo/refineCube1_1", WbWriterVtkXmlBinary::getInstance()); + + SPtr<GbObject3D> refineCube1_2(new GbCuboid3D(g_minX1, g_maxX2 - g_maxX2 / k1 + 1.0, g_minX3, g_maxX1, g_maxX2, g_maxX3)); + if (myid == 0) GbSystem3D::writeGeoObject(refineCube1_2.get(), pathname + "/geo/refineCube1_2", WbWriterVtkXmlBinary::getInstance()); + + SPtr<LBMKernel> kernel; + kernel = SPtr<LBMKernel>(new K17CompressibleNavierStokes()); + + SPtr<BCSet> bcProc; + bcProc = std::make_shared<BCSet>(); + kernel->setBCSet(bcProc); + + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, d00M)); + + ////////////////////////////////////////////////////////////////////////// + // restart + SPtr<UbScheduler> mSch(new UbScheduler(cpStep, cpStart)); + SPtr<MPIIOMigrationSimulationObserver> restart(new MPIIOMigrationSimulationObserver(grid, mSch, metisVisitor, pathname, comm)); + restart->setLBMKernel(kernel); + restart->setBCSet(bcProc); + ////////////////////////////////////////////////////////////////////////// + + if (newStart) + { + GenBlocksGridVisitor genBlocks(gridCube); + grid->accept(genBlocks); + + if (myid == 0) + { + UBLOG(logINFO, "Parameters:"); + UBLOG(logINFO, "h = " << h); + UBLOG(logINFO, "nue = " << nu); + UBLOG(logINFO, "Re = " << Re); + UBLOG(logINFO, "dx = " << deltax); + UBLOG(logINFO, "dpLB = " << dp); + UBLOG(logINFO, "Umax = " << u_max); + UBLOG(logINFO, "number of levels = " << refineLevel + 1); + UBLOG(logINFO, "numOfThreads = " << numOfThreads); + UBLOG(logINFO, "path = " << pathname); + UBLOG(logINFO, "Preprozess - start"); + } + + //walls + GbCuboid3DPtr addWallYmin(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_minX3 - blockLength, g_maxX1 + blockLength, g_minX2, g_maxX3 + blockLength)); + if (myid == 0) GbSystem3D::writeGeoObject(addWallYmin.get(), pathname + "/geo/addWallYmin", WbWriterVtkXmlASCII::getInstance()); + + GbCuboid3DPtr addWallYmax(new GbCuboid3D(g_minX1 - blockLength, g_maxX2, g_minX3 - blockLength, g_maxX1 + blockLength, g_maxX2 + blockLength, g_maxX3 + blockLength)); + if (myid == 0) GbSystem3D::writeGeoObject(addWallYmax.get(), pathname + "/geo/addWallYmax", WbWriterVtkXmlASCII::getInstance()); + + //inflow + GbCuboid3DPtr geoInflow(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_minX3 - blockLength, g_minX1, g_maxX2 + blockLength, g_maxX3 + blockLength)); + if (myid == 0) GbSystem3D::writeGeoObject(geoInflow.get(), pathname + "/geo/geoInflow", WbWriterVtkXmlASCII::getInstance()); + + //outflow + GbCuboid3DPtr geoOutflow(new GbCuboid3D(g_maxX1, g_minX2 - blockLength, g_minX3 - blockLength, g_maxX1 + blockLength, g_maxX2 + blockLength, g_maxX3 + blockLength)); + if (myid == 0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathname + "/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance()); + + SPtr<SimulationObserver> ppblocks(new WriteBlocksSimulationObserver(grid, SPtr<UbScheduler>(new UbScheduler(1)), pathname, WbWriterVtkXmlBinary::getInstance(), comm)); + + if (refineLevel > 0) + { + if (myid == 0) UBLOG(logINFO, "Refinement - start"); + RefineCrossAndInsideGbObjectHelper refineHelper(grid, refineLevel, comm); + refineHelper.addGbObject(refineCube1_1, 1); + refineHelper.addGbObject(refineCube1_2, 1); + refineHelper.refine(); + if (myid == 0) UBLOG(logINFO, "Refinement - end"); + } + + //walls + SPtr<D3Q27Interactor> addWallYminInt(new D3Q27Interactor(addWallYmin, grid, noSlipBC, Interactor3D::SOLID)); + SPtr<D3Q27Interactor> addWallYmaxInt(new D3Q27Interactor(addWallYmax, grid, noSlipBC, Interactor3D::SOLID)); + + //inflow + SPtr<D3Q27Interactor> inflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoInflow, grid, pressureBC1, Interactor3D::SOLID)); + + //outflow + SPtr<D3Q27Interactor> outflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, pressureBC2, Interactor3D::SOLID)); + //SPtr<D3Q27Interactor> outflowSolidInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, noSlipBC, Interactor3D::SOLID)); + + //////////////////////////////////////////// + //METIS + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, d00M)); + //////////////////////////////////////////// + /////delete solid blocks + if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start"); + InteractorsHelper intHelper(grid, metisVisitor); + + intHelper.addInteractor(addWallYminInt); + intHelper.addInteractor(addWallYmaxInt); + + intHelper.addInteractor(inflowInt); + + intHelper.addInteractor(outflowInt); + + + + intHelper.selectBlocks(); + if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - end"); + ////////////////////////////////////// + + + + ppblocks->update(0); + ppblocks.reset(); + + if (myid == 0) VF_LOG_INFO("{}",Utilities::toString(grid, comm->getNumberOfProcesses())); + + + SetKernelBlockVisitor kernelVisitor(kernel, nu); + grid->accept(kernelVisitor); + + if (refineLevel > 0) + { + SetUndefinedNodesBlockVisitor undefNodesVisitor; + grid->accept(undefNodesVisitor); + } + + //walls + intHelper.setBC(); + + grid->accept(bcVisitor); + + + InitDistributionsBlockVisitor initVisitor; + grid->accept(initVisitor); + + //Postprocess + SPtr<UbScheduler> geoSch(new UbScheduler(1)); + SPtr<SimulationObserver> ppgeo( + new WriteBoundaryConditionsSimulationObserver(grid, geoSch, pathname, WbWriterVtkXmlBinary::getInstance(), comm)); + ppgeo->update(0); + ppgeo.reset(); + + if (myid == 0) UBLOG(logINFO, "Preprocess - end"); + } + else + { + restart->restart((int)restartStep); + grid->setTimeStep(restartStep); + + if (myid == 0) UBLOG(logINFO, "Restart - end"); + } + + grid->accept(bcVisitor); + + // set connectors + OneDistributionSetConnectorsBlockVisitor setConnsVisitor(comm); + grid->accept(setConnsVisitor); + + SPtr<Interpolator> iProcessor(new CompressibleOffsetMomentsInterpolator()); + SetInterpolationConnectorsBlockVisitor setInterConnsVisitor(comm, nu, iProcessor); + grid->accept(setInterConnsVisitor); + + SPtr<UbScheduler> nupsSch(new UbScheduler(10, 30, 100)); + SPtr<SimulationObserver> npr(new NUPSCounterSimulationObserver (grid, nupsSch, numOfThreads, comm)); + + //write data for visualization of macroscopic quantities + SPtr<UbScheduler> visSch(new UbScheduler(outTime)); + SPtr<WriteMacroscopicQuantitiesSimulationObserver> writeMQSimulationObserver(new WriteMacroscopicQuantitiesSimulationObserver(grid, visSch, pathname, + WbWriterVtkXmlASCII::getInstance(), SPtr<LBMUnitConverter>(new LBMUnitConverter()), comm)); + + + // OpenMP threads control +#ifdef _OPENMP + omp_set_num_threads(numOfThreads); +#endif + // Create simulation + SPtr<Simulation> simulation(new Simulation(grid, visSch, endTime)); + simulation->addSimulationObserver(npr); + simulation->addSimulationObserver(writeMQSimulationObserver); + + ////////////////////////////////////////////////////////////////////////// + // Run simulation + ////////////////////////////////////////////////////////////////////////// + + UBLOG(logINFO, "Simulation-start"); + simulation->run(); + UBLOG(logINFO, "Simulation-end"); + } + catch (std::exception & e) + { + cerr << e.what() << endl << flush; + } + catch (std::string & s) + { + cerr << s << endl; + } + catch (...) + { + cerr << "unknown exception" << endl; + } + +} +////////////////////////////////////////////////////////////////////////// +int main(int argc, char* argv[]) +{ + if (argv != NULL) + { + if (argv[1] != NULL) + { + //pflowForcing(string(argv[1])); + pflowdp(string(argv[1])); + } + else + { + cout << "Configuration file is missing!" << endl; + } + } + + return 0; +} diff --git a/apps/cpu/LaminarPlaneFlow/pf1.cfg b/apps/cpu/LaminarPlaneFlow/pf1.cfg deleted file mode 100644 index c813f9c35e0eb52e705917d14454c8fb9d5c6845..0000000000000000000000000000000000000000 --- a/apps/cpu/LaminarPlaneFlow/pf1.cfg +++ /dev/null @@ -1,18 +0,0 @@ -pathname = d:/temp/pflow1 -numOfThreads = 4 -availMem = 8e9 -logToFile = false -blocknx = 10 10 10 -gridnx = 2 1 2 -nuLB = 1e-2 -forcing = 5e-8 -deltax = 0.1 - -refineLevel = 0 -logToFile=false -thinWall = false - -restartStep = 100000 - -endTime = 100000 -outTime = 100000 \ No newline at end of file diff --git a/apps/cpu/LaminarPlaneFlow/pf2.cfg b/apps/cpu/LaminarPlaneFlow/pf2.cfg deleted file mode 100644 index 6ecbc0dfe05bc2973aa0c2ef6529bc9c80d1e197..0000000000000000000000000000000000000000 --- a/apps/cpu/LaminarPlaneFlow/pf2.cfg +++ /dev/null @@ -1,18 +0,0 @@ -pathname = d:/temp/pflow2 -numOfThreads = 4 -availMem = 8e9 -logToFile = false -blocknx = 10 10 10 -gridnx = 2 0.5 2 -nuLB = 1e-2 -forcing = 6.25e-9 -deltax = 0.05 - -refineLevel = 0 -logToFile=false -thinWall = false - -restartStep = 400000 - -endTime = 400000 -outTime = 400000 \ No newline at end of file diff --git a/apps/cpu/LaminarPlaneFlow/pf3.cfg b/apps/cpu/LaminarPlaneFlow/pf3.cfg deleted file mode 100644 index 111829262c062689296819e0c6cc771d92584d4d..0000000000000000000000000000000000000000 --- a/apps/cpu/LaminarPlaneFlow/pf3.cfg +++ /dev/null @@ -1,18 +0,0 @@ -pathname = d:/temp/pflow4 -numOfThreads = 8 -availMem = 8e9 -logToFile = false -blocknx = 10 10 10 -gridnx = 2 0.25 2 -nuLB = 1e-2 -forcing = 7.8125e-10 -deltax = 0.025 - -refineLevel = 0 -logToFile=false -thinWall = false - -restartStep = 400000 - -endTime = 1600000 -outTime = 400000 \ No newline at end of file diff --git a/apps/cpu/LaminarPlaneFlow/pf4.cfg b/apps/cpu/LaminarPlaneFlow/pf4.cfg deleted file mode 100644 index 41a53e96ad0e4c3ec10f8559fda567357bd1e65c..0000000000000000000000000000000000000000 --- a/apps/cpu/LaminarPlaneFlow/pf4.cfg +++ /dev/null @@ -1,19 +0,0 @@ -pathname = d:/temp/pflow4 -numOfThreads = 8 -availMem = 8e9 -logToFile = false -blocknx = 10 10 10 -gridnx = 2 0.25 2 -nuLB = 1e-2 -forcing = 7.8125e-10 -deltax = 0.025 - -refineLevel = 1 -logToFile=false -thinWall = false - -restartStep = 400000 - -endTime = 1600000 -#outTime = 400000 -outTime = 400 \ No newline at end of file diff --git a/apps/cpu/LaminarPlaneFlow/pfDP.cfg b/apps/cpu/LaminarPlaneFlow/pfDP.cfg deleted file mode 100644 index ad2cfe7e1b4a5008121ab0863b0a6e05fcc3e24d..0000000000000000000000000000000000000000 --- a/apps/cpu/LaminarPlaneFlow/pfDP.cfg +++ /dev/null @@ -1,24 +0,0 @@ -pathname = d:/temp/pflowDP -numOfThreads = 1 -availMem = 3e9 -logToFile = false -blocknx = 10 10 10 -boundingBox = 20 20 20 -nuLB = 0.01 -dpLB = 1e-6 #9.99685e-7 -deltax = 1 -#deltax = 3.9999999e-6 - -#deltax = 1 - -refineLevel = 0 -thinWall = false - - -newStart = true -restartStep = 100 - -cpStep = 100 -cpStepStart = 100 -outTime = 1 -endTime = 100 diff --git a/apps/cpu/LaminarPlaneFlow/pflow.cpp b/apps/cpu/LaminarPlaneFlow/pflow.cpp deleted file mode 100644 index 8ff91ea401869e09453765e7e0b73d77650817ac..0000000000000000000000000000000000000000 --- a/apps/cpu/LaminarPlaneFlow/pflow.cpp +++ /dev/null @@ -1,734 +0,0 @@ -#include <iostream> -#include <string> - -#include <VirtualFluids.h> - -using namespace std; - - -//void pflowForcing(string configname) -//{ -// try -// { -// vf::basics::ConfigurationFile config; -// config.load(configname); -// -// string pathname = config.getString("pathname"); -// int numOfThreads = config.getInt("numOfThreads"); -// vector<int> blocknx = config.getVector<int>("blocknx"); -// vector<double> gridnx = config.getVector<double>("gridnx"); -// double nuLB = config.getDouble("nuLB"); -// double endTime = config.getDouble("endTime"); -// double outTime = config.getDouble("outTime"); -// double availMem = config.getDouble("availMem"); -// int refineLevel = config.getInt("refineLevel"); -// bool logToFile = config.getBool("logToFile"); -// double restartStep = config.getDouble("restartStep"); -// double forcing = config.getDouble("forcing"); -// bool thinWall = config.getBool("thinWall"); -// double deltax = config.getDouble("deltax"); -// -// -// SPtr<vf::parallel::Communicator> comm = vf::parallel::MPICommunicator::getInstance(); -// int myid = comm->getProcessID(); -// -// if (logToFile) -// { -//#if defined(__unix__) -// if (myid == 0) -// { -// const char* str = pathname.c_str(); -// mkdir(str, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); -// } -//#endif -// -// if (myid == 0) -// { -// stringstream logFilename; -// logFilename << pathname + "/logfile" + UbSystem::toString(UbSystem::getTimeStamp()) + ".txt"; -// UbLog::output_policy::setStream(logFilename.str()); -// } -// } -// -// double dx = deltax; -// -// const int blocknx1 = blocknx[0]; -// const int blocknx2 = blocknx[1]; -// const int blocknx3 = blocknx[2]; -// -// real rhoLB = 0.0; -// -// SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter()); -// -// const int baseLevel = 0; -// -// //bounding box -// double g_minX1 = 0; -// double g_minX2 = 0; -// double g_minX3 = 0; -// -// double g_maxX1 = gridnx[0]; -// double g_maxX2 = gridnx[1]; -// double g_maxX3 = gridnx[2]; -// -// double blockLength = blocknx1*dx; -// -// SPtr<Grid3D> grid(new Grid3D(comm)); -// grid->setPeriodicX1(true); -// grid->setPeriodicX2(true); -// grid->setPeriodicX3(false); -// grid->setDeltaX(dx); -// grid->setBlockNX(blocknx1, blocknx2, blocknx3); -// -// SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3)); -// if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); -// -// ////////////////////////////////////////////////////////////////////////// -// //restart -// SPtr<UbScheduler> rSch(new UbScheduler(restartStep, restartStep)); -// RestartCoProcessor rp(grid, rSch, comm, pathname, RestartCoProcessor::TXT); -// ////////////////////////////////////////////////////////////////////////// -// -// if (grid->getTimeStep() == 0) -// { -// GenBlocksGridVisitor genBlocks(gridCube); -// grid->accept(genBlocks); -// -// if (myid == 0) -// { -// UBLOG(logINFO, "Parameters:"); -// UBLOG(logINFO, "forcing = " << forcing); -// UBLOG(logINFO, "rho = " << rhoLB); -// UBLOG(logINFO, "nu = " << nuLB); -// UBLOG(logINFO, "dx = " << dx); -// UBLOG(logINFO, "number of levels = " << refineLevel + 1); -// UBLOG(logINFO, "numOfThreads = " << numOfThreads); -// UBLOG(logINFO, "Preprozess - start"); -// } -// -// ////////////////////////////////////////////////////////////////////////// -// //refinement -// double blockLengthX3Fine = grid->getDeltaX(refineLevel) * blocknx[2]; -// -// GbCuboid3DPtr refineBoxTop(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_maxX3 - blockLengthX3Fine, g_maxX1 + blockLength, g_maxX2 + blockLength, g_maxX3 + blockLength)); -// if (myid == 0) GbSystem3D::writeGeoObject(refineBoxTop.get(), pathname + "/geo/refineBoxTop", WbWriterVtkXmlASCII::getInstance()); -// -// //GbCuboid3DPtr refineBoxBottom(new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3, g_maxX1+blockLength, g_maxX2+blockLength, g_minX3+offsetMinX3+blockLengthX3Fine)); -// GbCuboid3DPtr refineBoxBottom(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_minX3 - blockLengthX3Fine, g_maxX1 + blockLength, g_maxX2 + blockLength, g_minX3 + blockLengthX3Fine)); -// if (myid == 0) GbSystem3D::writeGeoObject(refineBoxBottom.get(), pathname + "/geo/refineBoxBottom", WbWriterVtkXmlASCII::getInstance()); -// -// if (refineLevel > 0) -// { -// if (myid == 0) UBLOG(logINFO, "Refinement - start"); -// RefineCrossAndInsideGbObjectHelper refineHelper(grid, refineLevel); -// refineHelper.addGbObject(refineBoxTop, refineLevel); -// refineHelper.addGbObject(refineBoxBottom, refineLevel); -// refineHelper.refine(); -// if (myid == 0) UBLOG(logINFO, "Refinement - end"); -// } -// ////////////////////////////////////////////////////////////////////////// -// -// //walls -// GbCuboid3DPtr addWallZmin(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_minX3 - blockLength, g_maxX1 + blockLength, g_maxX2 + blockLength, g_minX3)); -// if (myid == 0) GbSystem3D::writeGeoObject(addWallZmin.get(), pathname + "/geo/addWallZmin", WbWriterVtkXmlASCII::getInstance()); -// -// GbCuboid3DPtr addWallZmax(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_maxX3, g_maxX1 + blockLength, g_maxX2 + blockLength, g_maxX3 + blockLength)); -// if (myid == 0) GbSystem3D::writeGeoObject(addWallZmax.get(), pathname + "/geo/addWallZmax", WbWriterVtkXmlASCII::getInstance()); -// -// //wall interactors -// int bbOption = 1; -// D3Q27BoundaryConditionAdapterPtr bcNoSlip(new D3Q27NoSlipBCAdapter(bbOption)); -// SPtr<D3Q27Interactor> addWallZminInt(new D3Q27Interactor(addWallZmin, grid, bcNoSlip, Interactor3D::SOLID)); -// SPtr<D3Q27Interactor> addWallZmaxInt(new D3Q27Interactor(addWallZmax, grid, bcNoSlip, Interactor3D::SOLID)); -// -// //////////////////////////////////////////// -// //METIS -// SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::KWAY)); -// //////////////////////////////////////////// -// /////delete solid blocks -// if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start"); -// InteractorsHelper intHelper(grid, metisVisitor); -// intHelper.addInteractor(addWallZminInt); -// intHelper.addInteractor(addWallZmaxInt); -// intHelper.selectBlocks(); -// if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - end"); -// ////////////////////////////////////// -// -// //set connectors -// D3Q27InterpolationProcessorPtr iProcessor(new D3Q27IncompressibleOffsetInterpolationProcessor()); -// D3Q27SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nuLB, iProcessor); -// grid->accept(setConnsVisitor); -// -// //domain decomposition for threads -// PQueuePartitioningGridVisitor pqPartVisitor(numOfThreads); -// grid->accept(pqPartVisitor); -// -// WriteBlocksSPtr<CoProcessor> ppblocks(new WriteBlocksCoProcessor(grid, SPtr<UbScheduler>(new UbScheduler(1)), pathname, WbWriterVtkXmlBinary::getInstance(), comm)); -// ppblocks->process(0); -// ppblocks.reset(); -// -// unsigned long nob = grid->getNumberOfBlocks(); -// int gl = 3; -// unsigned long nodb = (blocknx1) * (blocknx2) * (blocknx3); -// unsigned long nod = nob * (blocknx1) * (blocknx2) * (blocknx3); -// unsigned long nodg = nob * (blocknx1 + gl) * (blocknx2 + gl) * (blocknx3 + gl); -// double needMemAll = double(nodg*(27 * sizeof(double) + sizeof(int) + sizeof(float) * 4)); -// double needMem = needMemAll / double(comm->getNumberOfProcesses()); -// -// if (myid == 0) -// { -// UBLOG(logINFO, "Number of blocks = " << nob); -// UBLOG(logINFO, "Number of nodes = " << nod); -// int minInitLevel = grid->getCoarsestInitializedLevel(); -// int maxInitLevel = grid->getFinestInitializedLevel(); -// for (int level = minInitLevel; level <= maxInitLevel; level++) -// { -// int nobl = grid->getNumberOfBlocks(level); -// UBLOG(logINFO, "Number of blocks for level " << level << " = " << nob); -// UBLOG(logINFO, "Number of nodes for level " << level << " = " << nob*nodb); -// } -// UBLOG(logINFO, "Necessary memory = " << needMemAll << " bytes"); -// UBLOG(logINFO, "Necessary memory per process = " << needMem << " bytes"); -// UBLOG(logINFO, "Available memory per process = " << availMem << " bytes"); -// } -// -// LBMKernel3DPtr kernel = LBMKernel3DPtr(new LBMKernelETD3Q27CCLB(blocknx[0], blocknx[1], blocknx[2], LBMKernelETD3Q27CCLB::NORMAL)); -// -// mu::Parser fctForcingX1; -// fctForcingX1.SetExpr("Fx1"); -// fctForcingX1.DefineConst("Fx1", forcing); -// -// kernel->setWithForcing(true); -// kernel->setForcingX1(fctForcingX1); -// -// SPtr<BCProcessor> bcProc; -// BoundaryConditionPtr noSlipBC; -// -// if (thinWall) -// { -// bcProc = SPtr<BCProcessor>(new D3Q27ETForThinWallBCProcessor()); -// noSlipBC = BoundaryConditionPtr(new ThinWallNoSlipBoundaryCondition()); -// } -// else -// { -// bcProc = SPtr<BCProcessor>(new D3Q27ETBCProcessor()); -// noSlipBC = BoundaryConditionPtr(new NoSlipBoundaryCondition()); -// } -// -// bcProc->addBC(noSlipBC); -// -// kernel->setBCProcessor(bcProc); -// -// SetKernelBlockVisitor kernelVisitor(kernel, nuLB, availMem, needMem); -// grid->accept(kernelVisitor); -// -// ////////////////////////////////// -// //undef nodes for refinement -// if (refineLevel > 0) -// { -// D3Q27SetUndefinedNodesBlockVisitor undefNodesVisitor; -// grid->accept(undefNodesVisitor); -// } -// -// //BC -// intHelper.setBC(); -// BoundaryConditionBlockVisitor bcVisitor; -// grid->accept(bcVisitor); -// -// //initialization of distributions -// D3Q27ETInitDistributionsBlockVisitor initVisitor(nuLB, rhoLB); -// grid->accept(initVisitor); -// -// //Postrozess -// SPtr<UbScheduler> geoSch(new UbScheduler(1)); -// MacroscopicQuantitiesSPtr<CoProcessor> ppgeo( -// new MacroscopicQuantitiesCoProcessor(grid, geoSch, pathname, WbWriterVtkXmlBinary::getInstance(), conv, true)); -// ppgeo->process(0); -// ppgeo.reset(); -// -// if (myid == 0) UBLOG(logINFO, "Preprozess - end"); -// } -// else -// { -// mu::Parser fctForcingX1; -// mu::Parser fctForcingX2; -// mu::Parser fctForcingX3; -// fctForcingX1.SetExpr("Fx1"); -// fctForcingX1.DefineConst("Fx1", forcing); -// fctForcingX2.SetExpr("0.0"); -// fctForcingX3.SetExpr("0.0"); -// -// SetForcingBlockVisitor forcingVisitor(fctForcingX1, fctForcingX2, fctForcingX3); -// grid->accept(forcingVisitor); -// -// D3Q27InterpolationProcessorPtr iProcessor(new D3Q27IncompressibleOffsetInterpolationProcessor()); -// D3Q27SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nuLB, iProcessor); -// grid->accept(setConnsVisitor); -// -// //domain decomposition for threads -// PQueuePartitioningGridVisitor pqPartVisitor(numOfThreads); -// grid->accept(pqPartVisitor); -// } -// -// SPtr<UbScheduler> nupsSch(new UbScheduler(10, 30, 100)); -// NUPSCounterCoProcessor npr(grid, nupsSch, numOfThreads, comm); -// -// SPtr<UbScheduler> stepSch(new UbScheduler(outTime)); -// -// MacroscopicQuantitiesCoProcessor pp(grid, stepSch, pathname, WbWriterVtkXmlBinary::getInstance(), conv); -// -// CalculationManagerPtr calculation(new CalculationManager(grid, numOfThreads, endTime, stepSch)); -// if (myid == 0) UBLOG(logINFO, "Simulation-start"); -// calculation->calculate(); -// if (myid == 0) UBLOG(logINFO, "Simulation-end"); -// } -// catch (std::exception& e) -// { -// cerr << e.what() << endl << flush; -// } -// catch (std::string& s) -// { -// cerr << s << endl; -// } -// catch (...) -// { -// cerr << "unknown exception" << endl; -// } -// -//} -////////////////////////////////////////////////////////////////////////// -void pflowdp(string configname) -{ - try - { - vf::basics::ConfigurationFile config; - config.load(configname); - - string pathname = config.getValue<string>("pathname"); - int numOfThreads = config.getValue<int>("numOfThreads"); - vector<int> blocknx = config.getVector<int>("blocknx"); - vector<double> boundingBox = config.getVector<double>("boundingBox"); - double nuLB = config.getValue<double>("nuLB"); - double endTime = config.getValue<double>("endTime"); - double outTime = config.getValue<double>("outTime"); - double availMem = config.getValue<double>("availMem"); - int refineLevel = config.getValue<int>("refineLevel"); - bool logToFile = config.getValue<bool>("logToFile"); - double restartStep = config.getValue<double>("restartStep"); - double dpLB = config.getValue<double>("dpLB"); - bool thinWall = config.getValue<bool>("thinWall"); - double deltax = config.getValue<double>("deltax"); - double cpStep = config.getValue<double>("cpStep"); - double cpStepStart = config.getValue<double>("cpStepStart"); - bool newStart = config.getValue<bool>("newStart"); - - SPtr<vf::parallel::Communicator> comm = vf::parallel::MPICommunicator::getInstance(); - int myid = comm->getProcessID(); - - real rhoLB = 0.0; - double rhoLBinflow = dpLB * 3.0; - - SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter()); - - const int baseLevel = 0; - - //bounding box - double g_minX1 = 0; - double g_minX2 = 0; - double g_minX3 = 0; - - double g_maxX1 = boundingBox[0]; - double g_maxX2 = boundingBox[1]; - double g_maxX3 = boundingBox[2]; - - double blockLength = 3.0 * deltax; - - double h = (g_maxX2) / 2.0; - double dex = g_maxX1; - double Umax = (1.0 / (4.0 * nuLB)) * (dpLB / dex) * (h * h); - double Re = (4 * h * Umax) / (3 * nuLB); - - //bc - real uLB = 0.01; - mu::Parser fct; - fct.SetExpr("U"); - fct.DefineConst("U", uLB); - SPtr<BCAdapter> denBCAdapterInflow(new VelocityBCAdapter(true, false, false, fct, 0, BCFunction::INFCONST)); - //denBCAdapterInflow->setBcAlgorithm(SPtr<BCAlgorithm>(new VelocityWithDensityBCAlgorithm())); - denBCAdapterInflow->setBcAlgorithm(SPtr<BCAlgorithm>(new VelocityBCAlgorithm())); - - //SPtr<BCAdapter> denBCAdapterOutflow(new DensityBCAdapter(rhoLB)); - //denBCAdapterOutflow->setBcAlgorithm(SPtr<BCAlgorithm>(new NonReflectingOutflowBCAlgorithm())); - ////denBCAdapterOutflow->setBcAlgorithm(SPtr<BCAlgorithm>(new NonEqDensityBCAlgorithm())); - - //SPtr<BCAdapter> slipBCAdapter(new SlipBCAdapter()); - ////slipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NonReflectingSlipBCAlgorithm())); - //slipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new SlipBCAlgorithm())); - // - - //SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter()); - //noSlipBCAdapter->setBcAlgorithm(NoSlipSPtr<BCAlgorithm>(new NoSlipBCAlgorithm())); - - //BoundaryConditionsBlockVisitor bcVisitor; - //bcVisitor.addBC(noSlipBCAdapter); - //bcVisitor.addBC(slipBCAdapter); - //bcVisitor.addBC(denBCAdapterInflow); - //bcVisitor.addBC(denBCAdapterOutflow); - - - - SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter()); - noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NoSlipBCAlgorithm())); - - //SPtr<BCAdapter> denBCAdapterInflow(new DensityBCAdapter(rhoLBinflow)); - //denBCAdapterInflow->setBcAlgorithm(SPtr<BCAlgorithm>(new NonEqDensityBCAlgorithm())); - - SPtr<BCAdapter> denBCAdapterOutflow(new DensityBCAdapter(rhoLB)); - denBCAdapterOutflow->setBcAlgorithm(SPtr<BCAlgorithm>(new NonEqDensityBCAlgorithm())); - - //BS visitor - BoundaryConditionsBlockVisitor bcVisitor; - bcVisitor.addBC(noSlipBCAdapter); - bcVisitor.addBC(denBCAdapterInflow); - bcVisitor.addBC(denBCAdapterOutflow); - - SPtr<Grid3D> grid(new Grid3D(comm)); - grid->setPeriodicX1(false); - grid->setPeriodicX2(true); - grid->setPeriodicX3(false); - grid->setDeltaX(deltax); - grid->setBlockNX(blocknx[0], blocknx[1], blocknx[2]); - - SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3)); - if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance()); - - double k1 = 4; - double k2 = 8; - - SPtr<GbObject3D> refineCube1_1(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2 / k1 - 1.0, g_maxX3)); - if (myid == 0) GbSystem3D::writeGeoObject(refineCube1_1.get(), pathname + "/geo/refineCube1_1", WbWriterVtkXmlBinary::getInstance()); - - SPtr<GbObject3D> refineCube1_2(new GbCuboid3D(g_minX1, g_maxX2 - g_maxX2 / k1 + 1.0, g_minX3, g_maxX1, g_maxX2, g_maxX3)); - if (myid == 0) GbSystem3D::writeGeoObject(refineCube1_2.get(), pathname + "/geo/refineCube1_2", WbWriterVtkXmlBinary::getInstance()); - - SPtr<GbObject3D> refineCube2_1(new GbCuboid3D(g_minX1 + 2 * blockLength + 2 * deltax, g_minX2, g_minX3, g_maxX1 - 2 * blockLength - 2 * deltax, g_maxX2 / k2 - 1.0, g_maxX3)); - if (myid == 0) GbSystem3D::writeGeoObject(refineCube2_1.get(), pathname + "/geo/refineCube2_1", WbWriterVtkXmlBinary::getInstance()); - - SPtr<GbObject3D> refineCube2_2(new GbCuboid3D(g_minX1 + 2 * blockLength + 2 * deltax, g_maxX2 - g_maxX2 / k2 + 1.0, g_minX3, g_maxX1 - 2 * blockLength - 2 * deltax, g_maxX2, g_maxX3)); - if (myid == 0) GbSystem3D::writeGeoObject(refineCube2_2.get(), pathname + "/geo/refineCube2_2", WbWriterVtkXmlBinary::getInstance()); - - SPtr<GbObject3D> refineCube2_3(new GbCuboid3D(g_minX1 + blockLength + 2 * deltax, g_minX2 + blockLength + 2 * deltax, g_minX3 + blockLength + 2 * deltax, g_maxX1 - blockLength - 2 * deltax, g_maxX2 - blockLength - 2 * deltax, g_maxX3 - blockLength - 2 * deltax)); - if (myid == 0) GbSystem3D::writeGeoObject(refineCube2_3.get(), pathname + "/geo/refineCube2_3", WbWriterVtkXmlBinary::getInstance()); - - ////////////////////////////////////////////////////////////////////////// - //restart - //SPtr<UbScheduler> rSch(new UbScheduler(restartStep)); - //RestartCoProcessor rp(grid, rSch, comm, pathname, RestartCoProcessor::TXT); - - //SPtr<UbScheduler> rSch2(new UbScheduler(cpStep, cpStepStart)); - //MPIIORestart1CoProcessor rcp(grid, rSch2, pathname, comm); - - SPtr<LBMKernel> kernel; - kernel = SPtr<LBMKernel>(new InK15CompressibleNavierStokes()); - - SPtr<BCProcessor> bcProc(new BCProcessor()); - //SPtr<BCProcessor> bcProc = SPtr<BCProcessor>(new ThinWallBCProcessor()); - kernel->setBCProcessor(bcProc); - - //rcp.setLBMKernel(kernel); - //rcp.setBCProcessor(bcProc); - //rcp.setChunk(1); - ////////////////////////////////////////////////////////////////////////// - - if (newStart) - { - GenBlocksGridVisitor genBlocks(gridCube); - grid->accept(genBlocks); - - if (myid == 0) - { - UBLOG(logINFO, "Parameters:"); - UBLOG(logINFO, "h = " << h); - UBLOG(logINFO, "rho = " << rhoLB); - UBLOG(logINFO, "nue = " << nuLB); - UBLOG(logINFO, "Re = " << Re); - UBLOG(logINFO, "dx = " << deltax); - UBLOG(logINFO, "dpLB = " << dpLB); - UBLOG(logINFO, "Umax = " << Umax); - UBLOG(logINFO, "number of levels = " << refineLevel + 1); - UBLOG(logINFO, "numOfThreads = " << numOfThreads); - UBLOG(logINFO, "path = " << pathname); - UBLOG(logINFO, "Preprozess - start"); - } - - //walls - GbCuboid3DPtr addWallYmin(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_minX3 - blockLength, g_maxX1 + blockLength, g_minX2, g_maxX3 + blockLength)); - if (myid == 0) GbSystem3D::writeGeoObject(addWallYmin.get(), pathname + "/geo/addWallYmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallYmax(new GbCuboid3D(g_minX1 - blockLength, g_maxX2, g_minX3 - blockLength, g_maxX1 + blockLength, g_maxX2 + blockLength, g_maxX3 + blockLength)); - if (myid == 0) GbSystem3D::writeGeoObject(addWallYmax.get(), pathname + "/geo/addWallYmax", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmin(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_minX3 - blockLength, g_maxX1 + blockLength, g_maxX2 + blockLength, g_minX3)); - if (myid == 0) GbSystem3D::writeGeoObject(addWallZmin.get(), pathname + "/geo/addWallZmin", WbWriterVtkXmlASCII::getInstance()); - - GbCuboid3DPtr addWallZmax(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_maxX3, g_maxX1 + blockLength, g_maxX2 + blockLength, g_maxX3 + blockLength)); - if (myid == 0) GbSystem3D::writeGeoObject(addWallZmax.get(), pathname + "/geo/addWallZmax", WbWriterVtkXmlASCII::getInstance()); - - - //GbCuboid3DPtr addWallXmax(new GbCuboid3D(g_maxX1-4.0*deltax, g_maxX2, g_minX3 - 4.0*blockLength, g_maxX1 + 4.0*blockLength, g_maxX2 + 4.0*blockLength, g_maxX3 + 4.0*blockLength)); - //if (myid == 0) GbSystem3D::writeGeoObject(addWallXmax.get(), pathname+"/geo/addWallXmax", WbWriterVtkXmlASCII::getInstance()); - - //inflow - GbCuboid3DPtr geoInflow(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_minX3 - blockLength, g_minX1, g_maxX2 + blockLength, g_maxX3 + blockLength)); - if (myid == 0) GbSystem3D::writeGeoObject(geoInflow.get(), pathname + "/geo/geoInflow", WbWriterVtkXmlASCII::getInstance()); - - //outflow - GbCuboid3DPtr geoOutflow(new GbCuboid3D(g_maxX1, g_minX2 - blockLength, g_minX3 - blockLength, g_maxX1 + blockLength, g_maxX2 + blockLength, g_maxX3 + blockLength)); - if (myid == 0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathname + "/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance()); - - //GbCuboid3DPtr geoOutflowSolid(new GbCuboid3D(g_maxX1-1.0*deltax, g_minX2 - 4.0*blockLength, g_minX3 - 4.0*blockLength, g_maxX1 + 4.0*blockLength, g_maxX2+4.0*blockLength, g_maxX3 + 4.0*blockLength)); - //if (myid == 0) GbSystem3D::writeGeoObject(geoOutflowSolid.get(), pathname + "/geo/geoOutflowSolid", WbWriterVtkXmlASCII::getInstance()); - - ////inflow - //GbCuboid3DPtr geoInflow (new GbCuboid3D(g_minX1-4.0*blockLength, g_minX2-4.0*blockLength, g_minX3-4.0*blockLength, g_maxX1+4.0*blockLength, g_maxX2+4.0*blockLength, g_minX3)); - //if(myid == 0) GbSystem3D::writeGeoObject(geoInflow.get(), pathname+"/geo/geoInflow", WbWriterVtkXmlASCII::getInstance()); - - ////outflow - //GbCuboid3DPtr geoOutflow (new GbCuboid3D(g_minX1-4.0*blockLength, g_minX2-4.0*blockLength, g_maxX3, g_maxX1+4.0*blockLength, g_maxX2+4.0*blockLength, g_maxX3+4.0*blockLength)); - //if(myid == 0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathname+"/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance()); - - SPtr<CoProcessor> ppblocks(new WriteBlocksCoProcessor(grid, SPtr<UbScheduler>(new UbScheduler(1)), pathname, WbWriterVtkXmlBinary::getInstance(), comm)); - - if (refineLevel > 0) - { - if (myid == 0) UBLOG(logINFO, "Refinement - start"); - RefineCrossAndInsideGbObjectHelper refineHelper(grid, refineLevel, comm); - //refineHelper.addGbObject(refineCube1_1, 1); - //refineHelper.addGbObject(refineCube1_2, 1); - //refineHelper.addGbObject(refineCube2_1, 2); - //refineHelper.addGbObject(refineCube2_2, 2); - refineHelper.addGbObject(refineCube2_3, refineLevel); - refineHelper.refine(); - if (myid == 0) UBLOG(logINFO, "Refinement - end"); - } - - //walls - SPtr<D3Q27Interactor> addWallYminInt(new D3Q27Interactor(addWallYmin, grid, noSlipBCAdapter, Interactor3D::SOLID)); - SPtr<D3Q27Interactor> addWallYmaxInt(new D3Q27Interactor(addWallYmax, grid, noSlipBCAdapter, Interactor3D::SOLID)); - - SPtr<D3Q27Interactor> addWallZminInt(new D3Q27Interactor(addWallZmin, grid, noSlipBCAdapter, Interactor3D::SOLID)); - SPtr<D3Q27Interactor> addWallZmaxInt(new D3Q27Interactor(addWallZmax, grid, noSlipBCAdapter, Interactor3D::SOLID)); - - //SPtr<D3Q27Interactor> addWallXmaxInt(new D3Q27Interactor(addWallXmax, grid, denBCAdapterOutflow,Interactor3D::SOLID)); - - SPtr<D3Q27Interactor> inflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoInflow, grid, denBCAdapterInflow, Interactor3D::SOLID)); - - //outflow - SPtr<D3Q27Interactor> outflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, denBCAdapterOutflow, Interactor3D::SOLID)); - //SPtr<D3Q27Interactor> outflowSolidInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, noSlipBCAdapter, Interactor3D::SOLID)); - - //////////////////////////////////////////// - //METIS - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::B)); - //////////////////////////////////////////// - /////delete solid blocks - if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start"); - InteractorsHelper intHelper(grid, metisVisitor); - - //intHelper.addInteractor(addWallYminInt); - //intHelper.addInteractor(addWallYmaxInt); - intHelper.addInteractor(addWallZminInt); - intHelper.addInteractor(addWallZmaxInt); - - intHelper.addInteractor(inflowInt); - - intHelper.addInteractor(outflowInt); - - //die Geschwindigkeit Randbedingung soll Ausfl�� �berdecken !!!!! - - - - intHelper.selectBlocks(); - if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - end"); - ////////////////////////////////////// - - //set connectors - //InterpolationProcessorPtr iProcessor(new IncompressibleOffsetInterpolator()); - InterpolationProcessorPtr iProcessor(new CompressibleOffsetInterpolator()); - SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nuLB, iProcessor); - grid->accept(setConnsVisitor); - - //domain decomposition for threads - PQueuePartitioningGridVisitor pqPartVisitor(numOfThreads); - grid->accept(pqPartVisitor); - - ppblocks->process(0); - ppblocks.reset(); - - unsigned long nob = grid->getNumberOfBlocks(); - int gl = 3; - unsigned long nodb = (blocknx[0]) * (blocknx[1]) * (blocknx[2]); - unsigned long nod = nob * (blocknx[0]) * (blocknx[1]) * (blocknx[2]); - unsigned long nodg = nob * (blocknx[0] + gl) * (blocknx[1] + gl) * (blocknx[1] + gl); - double needMemAll = double(nodg * (27 * sizeof(double) + sizeof(int) + sizeof(float) * 4)); - double needMem = needMemAll / double(comm->getNumberOfProcesses()); - - if (myid == 0) - { - UBLOG(logINFO, "Number of blocks = " << nob); - UBLOG(logINFO, "Number of nodes = " << nod); - int minInitLevel = grid->getCoarsestInitializedLevel(); - int maxInitLevel = grid->getFinestInitializedLevel(); - for (int level = minInitLevel; level <= maxInitLevel; level++) - { - int nobl = grid->getNumberOfBlocks(level); - UBLOG(logINFO, "Number of blocks for level " << level << " = " << nobl); - UBLOG(logINFO, "Number of nodes for level " << level << " = " << nobl * nodb); - } - UBLOG(logINFO, "Necessary memory = " << needMemAll << " bytes"); - UBLOG(logINFO, "Necessary memory per process = " << needMem << " bytes"); - UBLOG(logINFO, "Available memory per process = " << availMem << " bytes"); - } - - //SPtr<LBMKernel> kernel; - //kernel = SPtr<LBMKernel>(new InK15CompressibleNavierStokes(blocknx[0], blocknx[1], blocknx[2], InK15CompressibleNavierStokes::NORMAL)); - //kernel = SPtr<LBMKernel>(new K15CompressibleNavierStokes(blocknx[0], blocknx[1], blocknx[2], K15CompressibleNavierStokes::NORMAL)); - //} - //kernel->setWithForcing(true); - //kernel->setForcingX1(2e-6); - //SPtr<BCProcessor> bcProc(new BCProcessor()); - //kernel->setBCProcessor(bcProc); - - SetKernelBlockVisitor kernelVisitor(kernel, nuLB, availMem, needMem); - grid->accept(kernelVisitor); - - if (refineLevel > 0) - { - SetUndefinedNodesBlockVisitor undefNodesVisitor; - grid->accept(undefNodesVisitor); - } - - //walls - intHelper.setBC(); - - grid->accept(bcVisitor); - - - //initialization of distributions - //mu::Parser fct; - //fct.SetExpr("-(1.0/(2.0*nu))*(dp/dx)*((x2-h)^2 - h^2)"); - //fct.DefineConst("dp", dpLB); - //fct.DefineConst("dx", dex); - //fct.DefineConst("h", h); - //fct.DefineConst("nu", nuLB); - - mu::Parser fct; - fct.SetExpr("(x1max-x1)/l*dp*3.0"); - fct.DefineConst("dp", dpLB); - fct.DefineConst("x1max", g_maxX1); - fct.DefineConst("l", g_maxX1 - g_minX1); - - InitDistributionsBlockVisitor initVisitor; - //initVisitor.setVx1(fct); - //initVisitor.setVx1(uLB); - //initVisitor.setVx3(fct); - //initVisitor.setRho(fct); - grid->accept(initVisitor); - - //Postrozess - SPtr<UbScheduler> geoSch(new UbScheduler(1)); - SPtr<CoProcessor> ppgeo( - new WriteBoundaryConditionsCoProcessor(grid, geoSch, pathname, WbWriterVtkXmlBinary::getInstance(), comm)); - ppgeo->process(0); - ppgeo.reset(); - - if (myid == 0) UBLOG(logINFO, "Preprozess - end"); - } - else - { - //rcp.readBlocks(restartStep); - //SPtr<Grid3DVisitor> newMetisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::KWAY)); - //grid->accept(newMetisVisitor); - //rcp.readDataSet(restartStep); - //rcp.readBoundaryConds(restartStep); - - //rcp.restart((int)restartStep); - - grid->setTimeStep(restartStep); - - //set connectors - InterpolationProcessorPtr iProcessor(new IncompressibleOffsetInterpolator()); - SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nuLB, iProcessor); - grid->accept(setConnsVisitor); - - grid->accept(bcVisitor); - - SPtr<UbScheduler> geoSch(new UbScheduler(1)); - WriteBoundaryConditionsCoProcessor ppgeo = WriteBoundaryConditionsCoProcessor(grid, geoSch, pathname, WbWriterVtkXmlBinary::getInstance(), comm); - ppgeo.process(1); - - if (myid == 0) UBLOG(logINFO, "Restart - end"); - } - SPtr<UbScheduler> nupsSch(new UbScheduler(10, 30, 100)); - SPtr<CoProcessor> npr(new NUPSCounterCoProcessor (grid, nupsSch, numOfThreads, comm)); - - //write data for visualization of macroscopic quantities - SPtr<UbScheduler> visSch(new UbScheduler(outTime)); - SPtr<WriteMacroscopicQuantitiesCoProcessor> writeMQCoProcessor(new WriteMacroscopicQuantitiesCoProcessor(grid, visSch, pathname, - WbWriterVtkXmlASCII::getInstance(), SPtr<LBMUnitConverter>(new LBMUnitConverter()), comm)); - - SPtr<UbScheduler> AdjForcSch(new UbScheduler()); - AdjForcSch->addSchedule(10, 0, 10000000); - SPtr<IntegrateValuesHelper> intValHelp(new IntegrateValuesHelper(grid, comm, - g_minX1, g_minX2, g_minX3, - g_maxX1, g_maxX2, g_maxX3)); - if (myid == 0) GbSystem3D::writeGeoObject(intValHelp->getBoundingBox().get(), pathname + "/geo/IntValHelp", WbWriterVtkXmlBinary::getInstance()); - - double vxTarget = uLB; - AdjustForcingCoProcessor AdjForcPPPtr(grid, AdjForcSch, pathname, intValHelp, vxTarget, comm); - - //start simulation - //omp_set_num_threads(numOfThreads); - SPtr<UbScheduler> stepGhostLayer(new UbScheduler(outTime)); - SPtr<Calculator> calculator(new BasicCalculator(grid, stepGhostLayer, endTime)); - calculator->addCoProcessor(npr); - calculator->addCoProcessor(writeMQCoProcessor); - //calculator->addCoProcessor(migCoProcessor); - //calculator->addCoProcessor(restartCoProcessor); - - if (myid == 0) UBLOG(logINFO, "Simulation-start"); - calculator->calculate(); - if (myid == 0) UBLOG(logINFO, "Simulation-end"); - } - catch (std::exception & e) - { - cerr << e.what() << endl << flush; - } - catch (std::string & s) - { - cerr << s << endl; - } - catch (...) - { - cerr << "unknown exception" << endl; - } - -} -////////////////////////////////////////////////////////////////////////// -int main(int argc, char* argv[]) -{ - if (argv != NULL) - { - if (argv[1] != NULL) - { - //pflowForcing(string(argv[1])); - pflowdp(string(argv[1])); - } - else - { - cout << "Configuration file is missing!" << endl; - } - } - - return 0; -} diff --git a/apps/cpu/LidDrivenCavity/LidDrivenCavity.cpp b/apps/cpu/LidDrivenCavity/LidDrivenCavity.cpp index 01d6262c299f8f49e1e3cfd62ba1d9c39b127080..007da1dcbbb2755208f3b4420ccea9437a6ee2e0 100644 --- a/apps/cpu/LidDrivenCavity/LidDrivenCavity.cpp +++ b/apps/cpu/LidDrivenCavity/LidDrivenCavity.cpp @@ -27,7 +27,7 @@ // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // //! \file LidDrivenCavity.cpp -//! \ingroup Applications +//! \ingroup apps //! \author Konstantin Kutscher //======================================================================================= @@ -39,6 +39,7 @@ using namespace std; int main(int /*argc*/, char* /*argv*/[]) { + using namespace vf::lbm::dir; try { ////////////////////////////////////////////////////////////////////////// @@ -46,41 +47,42 @@ int main(int /*argc*/, char* /*argv*/[]) ////////////////////////////////////////////////////////////////////////// // set your output path here - string path = "./output"; + string path = "./output/LidDrivenCavity"; - const double L = 1.0; - const double Re = 1000.0; - const double velocity = 1.0; - const double dt = 0.5e-3; + const real L = 1.0; + const real Re = 1000.0; + const real velocity = 1.0; + const real dt = 0.5e-3; const unsigned int nx = 64; - const double timeStepOut = 1000; - const double timeStepEnd = 25000; + const real timeStepOut = 10; + const real timeStepEnd = 10; // Number of OpenMP threads - int numOfThreads = 4; + int numOfThreads = 1; ////////////////////////////////////////////////////////////////////////// - double dx = L / double(nx); - const double velocityLB = velocity * dt / dx; // LB units - const double u = velocityLB / sqrt(2.0); // LB units - const double viscosityLB = nx * velocityLB / Re; // LB unit + real dx = L / real(nx); + const real velocityLB = velocity * dt / dx; // LB units + const real u = velocityLB / sqrt(2.0); // LB units + const real viscosityLB = nx * velocityLB / Re; // LB unit ////////////////////////////////////////////////////////////////////////// // create grid ////////////////////////////////////////////////////////////////////////// // bounding box - double g_minX1 = -0.5; - double g_minX2 = -0.5; - double g_minX3 = -0.5; + real g_minX1 = -0.5; + real g_minX2 = -0.5; + real g_minX3 = -0.5; - double g_maxX1 = 0.5; - double g_maxX2 = 0.5; - double g_maxX3 = 0.5; + real g_maxX1 = 0.5; + real g_maxX2 = 0.5; + real g_maxX3 = 0.5; + + SPtr<vf::parallel::Communicator> comm = vf::parallel::MPICommunicator::getInstance(); + int myid = comm->getProcessID(); - // NullCommunicator is a place-holder for interprocess communication - SPtr<vf::parallel::Communicator> comm = NullCommunicator::getInstance(); // new grid object SPtr<Grid3D> grid(new Grid3D(comm)); // set grid spacing @@ -110,37 +112,35 @@ int main(int /*argc*/, char* /*argv*/[]) grid->accept(genBlocks); // Write block grid to VTK-file - auto ppblocks = std::make_shared<WriteBlocksCoProcessor>(grid, SPtr<UbScheduler>(new UbScheduler(1)), path, WbWriterVtkXmlBinary::getInstance(), comm); - ppblocks->process(0); + auto ppblocks = std::make_shared<WriteBlocksSimulationObserver>(grid, SPtr<UbScheduler>(new UbScheduler(1)), path, WbWriterVtkXmlBinary::getInstance(), comm); + ppblocks->update(0); ppblocks.reset(); // Create LBM kernel - auto kernel = std::make_shared<LBMKernelETD3Q27BGK>(); - // auto kernel = std::make_shared<CumulantK17LBMKernel>(); + auto kernel = std::make_shared<K17CompressibleNavierStokes>(); ////////////////////////////////////////////////////////////////////////// // Create boundary conditions (BC) ////////////////////////////////////////////////////////////////////////// // Create no-slip BC - auto noSlipBCAdapter = std::make_shared<NoSlipBCAdapter>(); - noSlipBCAdapter->setBcAlgorithm(std::make_shared<NoSlipBCAlgorithm>()); + auto noSlipBC = std::make_shared<NoSlipBC>(); + noSlipBC->setBCStrategy(std::make_shared<NoSlipInterpolated>()); // Velocity BC mu::Parser fct; fct.SetExpr("u"); fct.DefineConst("u", u); // Set the same velocity in x and y-direction - auto velBCAdapter = std::make_shared<VelocityBCAdapter>(true, true, false, fct, 0, BCFunction::INFCONST); - velBCAdapter->setBcAlgorithm(std::make_shared<VelocityBCAlgorithm>()); + auto velBC = std::make_shared<VelocityBC>(true, true, false, fct, 0, BCFunction::INFCONST); + velBC->setBCStrategy(std::make_shared<VelocityInterpolated>()); // Add velocity boundary condition to visitor. No-slip boundary BoundaryConditionsBlockVisitor bcVisitor; - bcVisitor.addBC(velBCAdapter); - // Create boundary conditions processor - SPtr<BCProcessor> bcProc; - bcProc = std::make_shared<BCProcessor>(); - kernel->setBCProcessor(bcProc); + // Create boundary conditions + SPtr<BCSet> bcProc; + bcProc = std::make_shared<BCSet>(); + kernel->setBCSet(bcProc); // Create boundary conditions geometry GbCuboid3DPtr wallXmin(new GbCuboid3D(g_minX1 - dx, g_minX2 - dx, g_minX3 - dx, g_minX1, g_maxX2 + dx, g_maxX3)); @@ -157,14 +157,15 @@ int main(int /*argc*/, char* /*argv*/[]) GbSystem3D::writeGeoObject(wallZmax.get(), path + "/geo/wallZmax", WbWriterVtkXmlASCII::getInstance()); // Add boundary conditions to grid generator - SPtr<D3Q27Interactor> wallXminInt(new D3Q27Interactor(wallXmin, grid, noSlipBCAdapter, Interactor3D::SOLID)); - SPtr<D3Q27Interactor> wallXmaxInt(new D3Q27Interactor(wallXmax, grid, noSlipBCAdapter, Interactor3D::SOLID)); - SPtr<D3Q27Interactor> wallYminInt(new D3Q27Interactor(wallYmin, grid, noSlipBCAdapter, Interactor3D::SOLID)); - SPtr<D3Q27Interactor> wallYmaxInt(new D3Q27Interactor(wallYmax, grid, noSlipBCAdapter, Interactor3D::SOLID)); - SPtr<D3Q27Interactor> wallZminInt(new D3Q27Interactor(wallZmin, grid, noSlipBCAdapter, Interactor3D::SOLID)); - SPtr<D3Q27Interactor> wallZmaxInt(new D3Q27Interactor(wallZmax, grid, velBCAdapter, Interactor3D::SOLID)); - - InteractorsHelper intHelper(grid); + SPtr<D3Q27Interactor> wallXminInt(new D3Q27Interactor(wallXmin, grid, noSlipBC, Interactor3D::SOLID)); + SPtr<D3Q27Interactor> wallXmaxInt(new D3Q27Interactor(wallXmax, grid, noSlipBC, Interactor3D::SOLID)); + SPtr<D3Q27Interactor> wallYminInt(new D3Q27Interactor(wallYmin, grid, noSlipBC, Interactor3D::SOLID)); + SPtr<D3Q27Interactor> wallYmaxInt(new D3Q27Interactor(wallYmax, grid, noSlipBC, Interactor3D::SOLID)); + SPtr<D3Q27Interactor> wallZminInt(new D3Q27Interactor(wallZmin, grid, noSlipBC, Interactor3D::SOLID)); + SPtr<D3Q27Interactor> wallZmaxInt(new D3Q27Interactor(wallZmax, grid, velBC, Interactor3D::SOLID)); + + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, d00M)); + InteractorsHelper intHelper(grid, metisVisitor); intHelper.addInteractor(wallZmaxInt); intHelper.addInteractor(wallXminInt); intHelper.addInteractor(wallXmaxInt); @@ -174,6 +175,8 @@ int main(int /*argc*/, char* /*argv*/[]) intHelper.selectBlocks(); + if (myid == 0) VF_LOG_INFO("{}",Utilities::toString(grid, comm->getNumberOfProcesses())); + // Generate grid SetKernelBlockVisitor kernelVisitor(kernel, viscosityLB); grid->accept(kernelVisitor); @@ -185,7 +188,7 @@ int main(int /*argc*/, char* /*argv*/[]) grid->accept(initVisitor); // Set connectivity between blocks - SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, viscosityLB); + OneDistributionSetConnectorsBlockVisitor setConnsVisitor(comm); grid->accept(setConnsVisitor); // Create lists of boundary nodes @@ -193,8 +196,8 @@ int main(int /*argc*/, char* /*argv*/[]) // Write grid with boundary conditions information to VTK-file SPtr<UbScheduler> geoSch(new UbScheduler(1)); - WriteBoundaryConditionsCoProcessor ppgeo(grid, geoSch, path, WbWriterVtkXmlBinary::getInstance(), comm); - ppgeo.process(0); + WriteBoundaryConditionsSimulationObserver ppgeo(grid, geoSch, path, WbWriterVtkXmlBinary::getInstance(), comm); + ppgeo.update(0); UBLOG(logINFO, "Preprocess - end"); @@ -204,29 +207,28 @@ int main(int /*argc*/, char* /*argv*/[]) // Create coprocessor object for writing macroscopic quantities to VTK-file SPtr<UbScheduler> visSch(new UbScheduler(timeStepOut)); - SPtr<CoProcessor> mqCoProcessor(new WriteMacroscopicQuantitiesCoProcessor(grid, visSch, path, WbWriterVtkXmlBinary::getInstance(), SPtr<LBMUnitConverter>(new LBMUnitConverter(L, velocity, 1.0, nx, velocityLB)), comm)); - mqCoProcessor->process(0); + SPtr<SimulationObserver> mqSimulationObserver(new WriteMacroscopicQuantitiesSimulationObserver(grid, visSch, path, WbWriterVtkXmlBinary::getInstance(), SPtr<LBMUnitConverter>(new LBMUnitConverter(L, velocity, 1.0, nx, velocityLB)), comm)); + mqSimulationObserver->update(0); // Create coprocessor object for writing NUPS SPtr<UbScheduler> nupsSch(new UbScheduler(100, 100)); - SPtr<CoProcessor> nupsCoProcessor(new NUPSCounterCoProcessor(grid, nupsSch, numOfThreads, comm)); + SPtr<SimulationObserver> nupsSimulationObserver(new NUPSCounterSimulationObserver(grid, nupsSch, numOfThreads, comm)); // OpenMP threads control #ifdef _OPENMP omp_set_num_threads(numOfThreads); #endif // Create simulation - SPtr<Calculator> calculator(new BasicCalculator(grid, visSch, (int)timeStepEnd)); - // Add coprocessors objects to simulation - calculator->addCoProcessor(nupsCoProcessor); - calculator->addCoProcessor(mqCoProcessor); + SPtr<Simulation> simulation(new Simulation(grid, visSch, timeStepEnd)); + simulation->addSimulationObserver(nupsSimulationObserver); + simulation->addSimulationObserver(mqSimulationObserver); ////////////////////////////////////////////////////////////////////////// // Run simulation ////////////////////////////////////////////////////////////////////////// UBLOG(logINFO, "Simulation-start"); - calculator->calculate(); + simulation->run(); UBLOG(logINFO, "Simulation-end"); } catch (std::exception& e) diff --git a/apps/gpu/tests/NumericalTests/Utilities/VirtualFluidSimulationFactory/VirtualFluidSimulationFactory.cpp b/apps/gpu/tests/NumericalTests/Utilities/VirtualFluidSimulationFactory/VirtualFluidSimulationFactory.cpp index 9e514fa26ded48d82ce3f82b13a7b115040b5788..80327d68aa537016bc4a13b12cf2401cf0c1fb6f 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/VirtualFluidSimulationFactory/VirtualFluidSimulationFactory.cpp +++ b/apps/gpu/tests/NumericalTests/Utilities/VirtualFluidSimulationFactory/VirtualFluidSimulationFactory.cpp @@ -80,7 +80,7 @@ std::shared_ptr<Parameter> vf::gpu::tests::makeParameter(std::shared_ptr<Simulat para->setCalc3rdOrderMoments(false); para->setCalcHighOrderMoments(false); para->setReadGeo(false); - para->setCalcMedian(false); + para->setCalcMean(false); para->setConcFile(false); para->setUseMeasurePoints(false); para->setForcing(0.0, 0.0, 0.0); diff --git a/cpu.cmake b/cpu.cmake index 321ec4e22da64cf03ebf291fdc991404bb870217..da0cb69ce6da954ca3dac49b2a1f7391d5b4de47 100644 --- a/cpu.cmake +++ b/cpu.cmake @@ -35,11 +35,10 @@ endif() ### Apps ### ############################################################# -add_subdirectory(apps/cpu/FlowAroundCylinder) -#add_subdirectory(apps/cpu/LidDrivenCavity) -#add_subdirectory(apps/cpu/LaminarPlaneFlow) -#add_subdirectory(apps/cpu/LaminarPipeFlow) -#add_subdirectory(apps/cpu/AcousticPulse) +add_subdirectory(apps/cpu/LidDrivenCavity) +add_subdirectory(apps/cpu/LaminarPlaneFlow) +add_subdirectory(apps/cpu/LaminarPipeFlow) + if(VF_ENABLE_BOOST) add_subdirectory(apps/cpu/GyroidsRow) diff --git a/regression-tests/gyroidsrow_test.sh b/regression-tests/cpu/gyroidsrow_test.sh similarity index 100% rename from regression-tests/gyroidsrow_test.sh rename to regression-tests/cpu/gyroidsrow_test.sh diff --git a/regression-tests/cpu/laminar_pipe_flow_test.sh b/regression-tests/cpu/laminar_pipe_flow_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..c7b95383a1f5c867f7fe1170a3b95e60a1cfcf02 --- /dev/null +++ b/regression-tests/cpu/laminar_pipe_flow_test.sh @@ -0,0 +1,18 @@ +#!/bin/bash +source ./regression-tests/__regression_test_executer.sh + + +# 1. set reference data directory (must match the folder structure in https://github.com/irmb/test_data) +REFERENCE_DATA_DIR=regression_tests/cpu/LaminarPipeFlow + +# 2. set cmake flags for the build of VirtualFluids +CMAKE_FLAGS="--preset=make_cpu -DCMAKE_BUILD_TYPE=Release" + +# 3. define the application to be executed +APPLICATION="mpiexec -np 8 --allow-run-as-root ./build/bin/LaminarPipeFlow ./apps/cpu/LaminarPipeFlow/LaminarPipeFlow.cfg" + +# 4. set the path to the produced data +RESULT_DATA_DIR=output/LaminarPipeFlow + + +run_regression_test "$REFERENCE_DATA_DIR" "$CMAKE_FLAGS" "$APPLICATION" "$RESULT_DATA_DIR" diff --git a/regression-tests/cpu/laminar_plane_flow_test.sh b/regression-tests/cpu/laminar_plane_flow_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..386e793fc4e884e09b8d5fd53ef7d7a7c8015ae8 --- /dev/null +++ b/regression-tests/cpu/laminar_plane_flow_test.sh @@ -0,0 +1,18 @@ +#!/bin/bash +source ./regression-tests/__regression_test_executer.sh + + +# 1. set reference data directory (must match the folder structure in https://github.com/irmb/test_data) +REFERENCE_DATA_DIR=regression_tests/cpu/LaminarPlaneFlow + +# 2. set cmake flags for the build of VirtualFluids +CMAKE_FLAGS="--preset=make_cpu -DCMAKE_BUILD_TYPE=Release" + +# 3. define the application to be executed +APPLICATION="./build/bin/LaminarPlaneFlow ./apps/cpu/LaminarPlaneFlow/LaminarPlaneFlow.cfg" + +# 4. set the path to the produced data +RESULT_DATA_DIR=output/LaminarPlaneFlow + + +run_regression_test "$REFERENCE_DATA_DIR" "$CMAKE_FLAGS" "$APPLICATION" "$RESULT_DATA_DIR" diff --git a/regression-tests/cpu/lid_driven_cavity_test.sh b/regression-tests/cpu/lid_driven_cavity_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..a61e83dd1b30a8b43787ee11d19e5f9d89220224 --- /dev/null +++ b/regression-tests/cpu/lid_driven_cavity_test.sh @@ -0,0 +1,18 @@ +#!/bin/bash +source ./regression-tests/__regression_test_executer.sh + + +# 1. set reference data directory (must match the folder structure in https://github.com/irmb/test_data) +REFERENCE_DATA_DIR=regression_tests/cpu/LidDrivenCavity + +# 2. set cmake flags for the build of VirtualFluids +CMAKE_FLAGS="--preset=make_cpu -DCMAKE_BUILD_TYPE=Release" + +# 3. define the application to be executed +APPLICATION="./build/bin/LidDrivenCavityCPU" + +# 4. set the path to the produced data +RESULT_DATA_DIR=output/LidDrivenCavity + + +run_regression_test "$REFERENCE_DATA_DIR" "$CMAKE_FLAGS" "$APPLICATION" "$RESULT_DATA_DIR" diff --git a/regression-tests/flow_around_cylinder_test.sh b/regression-tests/flow_around_cylinder_test.sh deleted file mode 100755 index a4b0e49f54ce6c97d01f7bb731784c57e03aba72..0000000000000000000000000000000000000000 --- a/regression-tests/flow_around_cylinder_test.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -source ./regression-tests/__regression_test_executer.sh - - -# 1. set reference data directory (must match the folder structure in https://github.com/irmb/test_data) -REFERENCE_DATA_DIR=regression_tests/cpu/FlowAroundCylinder - -# 2. set cmake flags for the build of VirtualFluids -CMAKE_FLAGS="--preset=make_cpu -DCMAKE_BUILD_TYPE=Release" - -# 3. define the application to be executed -APPLICATION="./build/bin/FlowAroundCylinder ./apps/cpu/FlowAroundCylinder/cylinder.cfg" - -# 4. set the path to the produced data -RESULT_DATA_DIR=output/FlowAroundCylinder - - -run_regression_test "$REFERENCE_DATA_DIR" "$CMAKE_FLAGS" "$APPLICATION" "$RESULT_DATA_DIR" - - -# compare forces file manually -file1="$RESULT_DATA_DIR/results/forces.txt" -file2="reference_data/$REFERENCE_DATA_DIR/results/forces.txt" - -if cmp -s "$file1" "$file2"; then - printf 'The file "%s" is the same as "%s"\n' "$file1" "$file2" -else - printf 'The file "%s" is different from "%s"\n' "$file1" "$file2" - printf $file1 - cat $file1 - printf $file2 - cat $file2 - exit 1 -fi diff --git a/regression-tests/actuator_line_test.sh b/regression-tests/gpu/actuator_line_test.sh similarity index 100% rename from regression-tests/actuator_line_test.sh rename to regression-tests/gpu/actuator_line_test.sh diff --git a/regression-tests/atmospheric_boundary_layer_test.sh b/regression-tests/gpu/atmospheric_boundary_layer_test.sh similarity index 100% rename from regression-tests/atmospheric_boundary_layer_test.sh rename to regression-tests/gpu/atmospheric_boundary_layer_test.sh diff --git a/regression-tests/driven_cavity_test.sh b/regression-tests/gpu/driven_cavity_test.sh similarity index 100% rename from regression-tests/driven_cavity_test.sh rename to regression-tests/gpu/driven_cavity_test.sh diff --git a/regression-tests/driven_cavity_uniform_test.sh b/regression-tests/gpu/driven_cavity_uniform_test.sh similarity index 100% rename from regression-tests/driven_cavity_uniform_test.sh rename to regression-tests/gpu/driven_cavity_uniform_test.sh diff --git a/regression-tests/refined_sphere_in_channel_test.sh b/regression-tests/gpu/refined_sphere_in_channel_test.sh similarity index 100% rename from regression-tests/refined_sphere_in_channel_test.sh rename to regression-tests/gpu/refined_sphere_in_channel_test.sh diff --git a/regression-tests/sphere_in_channel_test.sh b/regression-tests/gpu/sphere_in_channel_test.sh similarity index 100% rename from regression-tests/sphere_in_channel_test.sh rename to regression-tests/gpu/sphere_in_channel_test.sh diff --git a/src/cpu/VirtualFluids.h b/src/cpu/VirtualFluids.h index 7695cb0cbfa609e0383ef16aed10787221f51974..13026378cd7f66cd579f2192ca35708f4800ef78 100644 --- a/src/cpu/VirtualFluids.h +++ b/src/cpu/VirtualFluids.h @@ -229,7 +229,6 @@ #include <geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h> #include <geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h> -#include <cpu/core/Parallel/BlocksDistributor.h> #include <cpu/core/Parallel/MetisPartitioner.h> #include <cpu/core/Utilities/ChangeRandomQs.hpp> @@ -248,7 +247,6 @@ #include <cpu/core/Visitors/Grid3DVisitor.h> #include <cpu/core/Visitors/InitDistributionsBlockVisitor.h> #include <cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.h> -#include <cpu/core/Visitors/InitThixotropyBlockVisitor.h> #include <cpu/core/Visitors/MetisPartitioningGridVisitor.h> #include <cpu/core/Visitors/OverlapBlockVisitor.h> #include <cpu/core/Visitors/RatioBlockVisitor.h> diff --git a/src/cpu/core/BoundaryConditions/BC.cpp b/src/cpu/core/BoundaryConditions/BC.cpp index f6bc5c635736d6faa7652303187899cee76349ea..33f390207f7899c79c78668afd2d6a249b5fc5e9 100644 --- a/src/cpu/core/BoundaryConditions/BC.cpp +++ b/src/cpu/core/BoundaryConditions/BC.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BC.cpp +//! \ingroup BoundaryConditions +//! \author Sören Freudiger +//======================================================================================= #include "BC.h" char BC::keyCounter = 0; \ No newline at end of file diff --git a/src/cpu/core/BoundaryConditions/BCSet.cpp b/src/cpu/core/BoundaryConditions/BCSet.cpp index c9939eea1adae1a806b0e82339cbaf7b7b3552f0..1ef81a3218aea5dbc80819a31c97e6ea61b8059c 100644 --- a/src/cpu/core/BoundaryConditions/BCSet.cpp +++ b/src/cpu/core/BoundaryConditions/BCSet.cpp @@ -26,7 +26,7 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file BCSet.h +//! \file BCSet.cpp //! \ingroup BoundarConditions //! \author Konstantin Kutscher //======================================================================================= diff --git a/src/cpu/core/BoundaryConditions/BCStrategyRegistry.cpp b/src/cpu/core/BoundaryConditions/BCStrategyRegistry.cpp index 4742753d0b19a117a8d50dce0243c07df0d92bc0..c56519fd00508ebb79877a3f9af65b29dfff9106 100644 --- a/src/cpu/core/BoundaryConditions/BCStrategyRegistry.cpp +++ b/src/cpu/core/BoundaryConditions/BCStrategyRegistry.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file BCStrategyRegistry.cpp +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= + #include "BCStrategyRegistry.h" #include "BC.h" #include "BCStrategy.h" diff --git a/src/cpu/core/BoundaryConditions/BoundaryConditions.cpp b/src/cpu/core/BoundaryConditions/BoundaryConditions.cpp index abaf5480802c384d963134580c2408808a0885cd..8bda4d93b74c1cc77bad9cf8bcbae5c1eabeeb69 100644 --- a/src/cpu/core/BoundaryConditions/BoundaryConditions.cpp +++ b/src/cpu/core/BoundaryConditions/BoundaryConditions.cpp @@ -26,7 +26,7 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file BoundaryConditions.h +//! \file BoundaryConditions.cpp //! \ingroup BoundarConditions //! \author Sören Freudiger //======================================================================================= diff --git a/src/cpu/core/BoundaryConditions/NoSlipBC.h b/src/cpu/core/BoundaryConditions/NoSlipBC.h index 28c1f2ed132b6c144f317044e021cf909e81efd8..3dde2755ac700c4a5b80be07d05bab20253f1544 100644 --- a/src/cpu/core/BoundaryConditions/NoSlipBC.h +++ b/src/cpu/core/BoundaryConditions/NoSlipBC.h @@ -26,7 +26,7 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file NoSlipBC.cpp +//! \file NoSlipBC.h //! \ingroup BoundarConditions //! \author Sören Freudiger //======================================================================================= diff --git a/src/cpu/core/BoundaryConditions/SlipBC.cpp b/src/cpu/core/BoundaryConditions/SlipBC.cpp index 50b0cbc390cd99b77faa435cba30d8afde88d22c..2f2602bbbdef197635adf8dd41821c762c51151e 100644 --- a/src/cpu/core/BoundaryConditions/SlipBC.cpp +++ b/src/cpu/core/BoundaryConditions/SlipBC.cpp @@ -35,16 +35,6 @@ #include "D3Q27System.h" #include "geometry3d/GbCuboid3D.h" -//*==========================================================*/ -// ObObject* D3Q27SlipBCCreator::createObObject() -//{ -// return new D3Q27SlipBC; -//} -//*==========================================================*/ -// ObObjectCreator* D3Q27SlipBC::getCreator() -//{ -// return D3Q27SlipBCCreator::getInstance(); -//} //*==========================================================*/ void SlipBC::adaptBC(const D3Q27Interactor &interactor, SPtr<BoundaryConditions> bc, const real & /*worldX1*/, const real & /*worldX2*/, const real & /*worldX3*/, const real & /*time*/) diff --git a/src/cpu/core/BoundaryConditions/SlipBC.h b/src/cpu/core/BoundaryConditions/SlipBC.h index 8e8788db8ded7a2f9eb0e47135f9babbc69e37da..687ea9bac85ec344793eae9f97fc95ff20934657 100644 --- a/src/cpu/core/BoundaryConditions/SlipBC.h +++ b/src/cpu/core/BoundaryConditions/SlipBC.h @@ -35,29 +35,6 @@ #include "BC.h" -/*=======================================================*/ -// D3Q27SlipBCCreator -// class D3Q27SlipBCCreator : public ObObjectCreator -//{ -// public: -// static D3Q27SlipBCCreator* getInstance() -// { -// static D3Q27SlipBCCreator instance; -// return &instance; -// } -// -// ObObject* createObObject(); -// -// std::string getTypeID() { return "D3Q27SlipBC";} -// std::string toString() { return "D3Q27SlipBCCreator"; } -// -// private: -// D3Q27SlipBCCreator( const D3Q27SlipBCCreator& ); //no copy allowed -// const D3Q27SlipBCCreator& operator=( const D3Q27SlipBCCreator& ); //no copy allowed -// D3Q27SlipBCCreator() : ObObjectCreator() {} -//}; -// - class SlipBC : public BC { public: diff --git a/src/cpu/core/BoundaryConditions/SlipBounceBack.h b/src/cpu/core/BoundaryConditions/SlipBounceBack.h index 923ab2002f396396bf2d97722f9a37e6e2cc1989..072c0661e91b86921a30ac8f81806e9d97a19843 100644 --- a/src/cpu/core/BoundaryConditions/SlipBounceBack.h +++ b/src/cpu/core/BoundaryConditions/SlipBounceBack.h @@ -26,7 +26,7 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file VelocityBounceBack.h +//! \file SlipBounceBack.h //! \ingroup BoundarConditions //! \author Konstantin Kutscher //======================================================================================= diff --git a/src/cpu/core/BoundaryConditions/SlipInterpolated.cpp b/src/cpu/core/BoundaryConditions/SlipInterpolated.cpp index 81978d610e1599397b70e3caa7d2055e4f91c01f..3639e6b4f22634f1d7cfafb4e0d3fbac3840b582 100644 --- a/src/cpu/core/BoundaryConditions/SlipInterpolated.cpp +++ b/src/cpu/core/BoundaryConditions/SlipInterpolated.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SlipInterpolated.cpp +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= + #include "SlipInterpolated.h" #include "BoundaryConditions.h" #include "DistributionArray3D.h" diff --git a/src/cpu/core/BoundaryConditions/SlipInterpolated.h b/src/cpu/core/BoundaryConditions/SlipInterpolated.h index 54f7406cc6fbb53250a175aa0bc936ea07e36887..839419a09d6baddb5f84f2db3aaa8b6ae6daaacf 100644 --- a/src/cpu/core/BoundaryConditions/SlipInterpolated.h +++ b/src/cpu/core/BoundaryConditions/SlipInterpolated.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SlipInterpolated.h +//! \ingroup BoundarConditions +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef SlipInterpolated_h__ #define SlipInterpolated_h__ diff --git a/src/cpu/core/Connectors/FullVectorConnector.h b/src/cpu/core/Connectors/FullVectorConnector.h index 802a91290cfc0994e1ef2ae33fce78c6a6a4964e..8f26774ee735ffcc0e30122b6242005f7726f650 100644 --- a/src/cpu/core/Connectors/FullVectorConnector.h +++ b/src/cpu/core/Connectors/FullVectorConnector.h @@ -39,10 +39,8 @@ #include "Block3D.h" #include "RemoteBlock3DConnector.h" -// daten werden in einen vector (dieser befindet sich im transmitter) kopiert -// der vector wird via transmitter uebertragen -// transmitter kann ein lokal, MPI, RCG, CTL oder was auch immer fuer ein -// transmitter sein, der von Transmitter abgeleitet ist ;-) +//! \brief Exchange data between blocks. +//! \details Connector send and receive full distributions between two blocks in distributed memory. class FullVectorConnector : public RemoteBlock3DConnector { public: diff --git a/src/cpu/core/Connectors/OneDistributionFullVectorConnector.cpp b/src/cpu/core/Connectors/OneDistributionFullVectorConnector.cpp index 2ce640d47d00836d8b289ccb159a07455c280b45..1997ac02fd6f40991e1f5d738a023173cec99f4c 100644 --- a/src/cpu/core/Connectors/OneDistributionFullVectorConnector.cpp +++ b/src/cpu/core/Connectors/OneDistributionFullVectorConnector.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file OneDistributionFullVectorConnector.cpp +//! \ingroup Connectors +//! \author Konstantin Kutscher +//======================================================================================= + #include "OneDistributionFullVectorConnector.h" #include "DataSet3D.h" #include "LBMKernel.h" diff --git a/src/cpu/core/Connectors/OneDistributionFullVectorConnector.h b/src/cpu/core/Connectors/OneDistributionFullVectorConnector.h index f0ca437ad70aaa3cefc8ce3abd37aeaecabf7a52..054208444ecb241c67080ff679108f0e4cea911a 100644 --- a/src/cpu/core/Connectors/OneDistributionFullVectorConnector.h +++ b/src/cpu/core/Connectors/OneDistributionFullVectorConnector.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file OneDistributionFullVectorConnector.h +//! \ingroup Connectors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef OneDistributionFullVectorConnector_H #define OneDistributionFullVectorConnector_H @@ -13,10 +45,8 @@ #include "basics/container/CbArray3D.h" #include "basics/container/CbArray4D.h" -// daten werden in einen vector (dieser befindet sich im transmitter) kopiert -// der vector wird via transmitter uebertragen -// transmitter kann ein lokal, MPI, RCG, CTL oder was auch immer fuer ein -// transmitter sein, der von Transmitter abgeleitet ist ;-) +//! \brief Exchange data between blocks. +//! \details Connector send and receive full distributions between two blocks in distributed memory. class OneDistributionFullVectorConnector : public FullVectorConnector { public: diff --git a/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.h b/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.h index 891536fe66624e85915be768527cd9e4454b3147..c38d27e05b42d97c61ee432df6d43f3c0bf74901 100644 --- a/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.h +++ b/src/cpu/core/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.h @@ -46,10 +46,9 @@ class EsoTwist3D; class Block3D; -//daten werden in einen vector (dieser befindet sich im transmitter) kopiert -//der vector wird via transmitter uebertragen -//transmitter kann ein lokal, MPI, RCG, CTL oder was auch immer fuer ein -//transmitter sein, der von Transmitter abgeleitet ist ;-) +//! \brief Exchange data between blocks. +//! \details Connector send and receive full distributions between two blocks in distributed memory. + class ThreeDistributionsDoubleGhostLayerFullVectorConnector : public FullVectorConnector { public: diff --git a/src/cpu/core/Connectors/ThreeDistributionsFullVectorConnector.h b/src/cpu/core/Connectors/ThreeDistributionsFullVectorConnector.h index 589ca46767e128d48f6d814c889314d9cdb4cff5..c6aeaa596132678c5ff53e241f7129923e6d8179 100644 --- a/src/cpu/core/Connectors/ThreeDistributionsFullVectorConnector.h +++ b/src/cpu/core/Connectors/ThreeDistributionsFullVectorConnector.h @@ -45,10 +45,8 @@ class EsoTwist3D; class Block3D; -//daten werden in einen vector (dieser befindet sich im transmitter) kopiert -//der vector wird via transmitter uebertragen -//transmitter kann ein lokal, MPI, RCG, CTL oder was auch immer fuer ein -//transmitter sein, der von Transmitter abgeleitet ist ;-) +//! \brief Exchange data between blocks. +//! \details Connector send and receive full distributions between two blocks in distributed memory. class ThreeDistributionsFullVectorConnector : public FullVectorConnector { public: diff --git a/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.h b/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.h index 3944f09d6ca9379d1ff3cec9da4945e1579dfb09..52d5995d3f97bfbbac524927ee115ddd44a83430 100644 --- a/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.h +++ b/src/cpu/core/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.h @@ -46,10 +46,9 @@ class EsoTwist3D; class Block3D; -//daten werden in einen vector (dieser befindet sich im transmitter) kopiert -//der vector wird via transmitter uebertragen -//transmitter kann ein lokal, MPI, RCG, CTL oder was auch immer fuer ein -//transmitter sein, der von Transmitter abgeleitet ist ;-) +//! \brief Exchange data between blocks. +//! \details Connector send and receive full distributions between two blocks in distributed memory. + class TwoDistributionsDoubleGhostLayerFullVectorConnector : public FullVectorConnector { public: diff --git a/src/cpu/core/Connectors/TwoDistributionsFullVectorConnector.h b/src/cpu/core/Connectors/TwoDistributionsFullVectorConnector.h index c518cb6fd8f8b0704e18dad82f1990f358da82a6..4185389028a9fdef34521ed31f40016254e16208 100644 --- a/src/cpu/core/Connectors/TwoDistributionsFullVectorConnector.h +++ b/src/cpu/core/Connectors/TwoDistributionsFullVectorConnector.h @@ -45,10 +45,8 @@ class EsoTwist3D; class Block3D; -//daten werden in einen vector (dieser befindet sich im transmitter) kopiert -//der vector wird via transmitter uebertragen -//transmitter kann ein lokal, MPI, RCG, CTL oder was auch immer fuer ein -//transmitter sein, der von Transmitter abgeleitet ist ;-) +//! \brief Exchange data between blocks. +//! \details Connector send and receive full distributions between two blocks in distributed memory. class TwoDistributionsFullVectorConnector : public FullVectorConnector { public: diff --git a/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.cpp b/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.cpp index a503b573cc55480c1d67597692bc2e8e78c0b989..ef7c2064cbe3f9142a3476c5d7d84040a7c2e249 100644 --- a/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.cpp +++ b/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.cpp @@ -1,3 +1,39 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file D3Q27TriFaceMeshInteractor.cpp +//! \ingroup Interactor +//! \author Sören Freudiger +//! \author Sebastian Geller +//! \author Ehsan Kian Far +//! \author Konstantin Kutscher +//======================================================================================= + #include "D3Q27TriFaceMeshInteractor.h" #include <basics/utilities/UbLogger.h> #include <basics/utilities/UbMath.h> @@ -30,25 +66,25 @@ using namespace std; -D3Q27TriFaceMeshInteractor::D3Q27TriFaceMeshInteractor() : D3Q27Interactor() { this->stressMode = STRESSNORMAL; } +D3Q27TriFaceMeshInteractor::D3Q27TriFaceMeshInteractor() : D3Q27Interactor() { } ////////////////////////////////////////////////////////////////////////// D3Q27TriFaceMeshInteractor::D3Q27TriFaceMeshInteractor(SPtr<Grid3D> /*grid*/, std::string /*name*/) { - this->stressMode = STRESSNORMAL; + } ////////////////////////////////////////////////////////////////////////// D3Q27TriFaceMeshInteractor::D3Q27TriFaceMeshInteractor(SPtr<GbTriFaceMesh3D> triFaceMesh, SPtr<Grid3D> grid, SPtr<BC> BC, int type) : D3Q27Interactor(triFaceMesh, grid, BC, type) { - this->stressMode = STRESSNORMAL; + } ////////////////////////////////////////////////////////////////////////// D3Q27TriFaceMeshInteractor::D3Q27TriFaceMeshInteractor(SPtr<GbTriFaceMesh3D> triFaceMesh, SPtr<Grid3D> grid, SPtr<BC> BC, int type, Interactor3D::Accuracy a) : D3Q27Interactor(triFaceMesh, grid, BC, type, a) { - this->stressMode = STRESSNORMAL; + } ////////////////////////////////////////////////////////////////////////// D3Q27TriFaceMeshInteractor::~D3Q27TriFaceMeshInteractor() = default; @@ -71,8 +107,7 @@ bool D3Q27TriFaceMeshInteractor::setDifferencesToGbObject3D(const SPtr<Block3D> solidNodeIndicesMap[block] = set<UbTupleInt3>(); set<UbTupleInt3> &solidNodeIndices = solidNodeIndicesMap[block]; - bool oneEntryGotBC = false; // ob ueberhaupt ein eintrag ein BC zugewiesen wurde - // bool gotQs = false; //true, wenn "difference" gesetzt wurde + bool oneEntryGotBC = false; SPtr<BoundaryConditions> bc; SPtr<ILBMKernel> kernel = block->getKernel(); @@ -83,9 +118,6 @@ bool D3Q27TriFaceMeshInteractor::setDifferencesToGbObject3D(const SPtr<Block3D> int startIX1 = 0, startIX2 = 0, startIX3 = 0; int stopIX1 = (int)bcArray->getNX1(), stopIX2 = (int)bcArray->getNX2(), stopIX3 = (int)bcArray->getNX3(); - // double dx = grid.lock()->getDeltaX(block); - // UbTupleDouble3 orgDelta = grid.lock()->getNodeOffset(block); - bool pointOnBoundary = false; for (int ix3 = startIX3; ix3 < stopIX3; ix3++) { @@ -104,7 +136,7 @@ bool D3Q27TriFaceMeshInteractor::setDifferencesToGbObject3D(const SPtr<Block3D> } } } else if (this->isInverseSolid()) { - // bei inverse solid sind alle Knoten AUSSERHALB und auf der boundary SOLID + // with inverse solid all nodes are OUTSIDE and on the boundary SOLID if (!this->geoObject3D->isPointInGbObject3D(internX1, internX2, internX3, pointOnBoundary) || pointOnBoundary == true) { if (bcArray->isFluid(ix1, ix2, ix3)) { @@ -163,9 +195,9 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) int finestInitLevel = grid.lock()->getFinestInitializedLevel(); UbTupleInt3 blocknx = grid.lock()->getBlockNX(); - int blocknx1 = val<1>(blocknx); // gilt fuer alle Level - int blocknx2 = val<2>(blocknx); // gilt fuer alle Level - int blocknx3 = val<3>(blocknx); // gilt fuer alle Level + int blocknx1 = val<1>(blocknx); // applies to all levels + int blocknx2 = val<2>(blocknx); // applies to all levels + int blocknx3 = val<3>(blocknx); // applies to all levels // grobe Blocklaengen SPtr<CoordinateTransformation3D> trafo = grid.lock()->getCoordinateTransformator(); @@ -176,14 +208,14 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) cblockDeltaX2 = trafo->getX2CoordinateScaling() * delta; cblockDeltaX3 = trafo->getX3CoordinateScaling() * delta; } - // levelspezifische blocklaengen und knotenabstaende + // Level-specific block lengths and node spacing std::vector<std::vector<double>> nodeDeltaToNeigh(finestInitLevel + 1); std::vector<float> deltaMinX1(finestInitLevel + 1), deltaMinX2(finestInitLevel + 1), deltaMinX3(finestInitLevel + 1); std::vector<float> deltaMaxX1(finestInitLevel + 1), deltaMaxX2(finestInitLevel + 1), deltaMaxX3(finestInitLevel + 1); - // Im Boltzmankontext muss dx1==dx2==dx3 sein!! + // In the Boltzman context, dx1==dx2==dx3 must be!! assert(UbMath::equal(cblockDeltaX1 / (double)blocknx1, cblockDeltaX2 / (double)blocknx2)); assert(UbMath::equal(cblockDeltaX1 / (double)blocknx1, cblockDeltaX3 / (double)blocknx3)); @@ -194,23 +226,14 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) std::vector<real> distNeigh(D3Q27System::FENDDIR + 1, 0.0); D3Q27System::calcDistanceToNeighbors(distNeigh, nodeDeltaX1, nodeDeltaX2, nodeDeltaX3); - // D3Q27System::calcDistanceToNeighbors(distNeigh, nodeDeltaX1); nodeDeltaToNeigh[level].resize(D3Q27System::ENDDIR + 1, 0.0); for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) { nodeDeltaToNeigh[level][fdir] = distNeigh[fdir]; } - // im gegensatz zum allg. Cell3DInteractor kann man hier auf max(0.02*blockDeltaX1[level],fabs(...)) verzichten - // da dies nur für blockDeltaCalculator->getMinX1Delta(level)==0.0 benötigt wird. ist im D3Q19... aber nie so - // Geller: kann man nicht diesen befuckten DeltaCalculator weglassen und hier einfach die Formel zum Delta - // rechnen reinpacken SirAnn: klar, mann kann auch weißwuerste am Alex verkaufen... aber zum einen ist das Ding - // dazu da - // und zum anderen sollt eman mal überlegen: "Formel zum Delta rechnen"->man muss rechnen - // blockDeltaCalculator->getMinX1Delta(level) -> ein geinlinter wert wird geholt - // TODO: set 5.0 as variable parameter in constructor, default 2.0 - deltaMinX1[level] = (float)(c5o1 * nodeDeltaX1); // kein minus da unten -deltaMin + deltaMinX1[level] = (float)(c5o1 * nodeDeltaX1); // no minus down there -deltaMin deltaMinX2[level] = (float)(c5o1 * nodeDeltaX2); deltaMinX3[level] = (float)(c5o1 * nodeDeltaX3); deltaMaxX1[level] = (float)(c5o1 * nodeDeltaX1); @@ -219,20 +242,10 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) } ////////////////////////////////////////////////////////////////////////// - // bounding cubes des TriFaceMesh ermitteln (pro level) + // TRIANGLES: q-determination ////////////////////////////////////////////////////////////////////////// - // min/max Werte des Dreiecksnetzes holen - // double geoMinX1(0.0), geoMinX2(0.0), geoMinX3(0.0), geoMaxX1(0.0), geoMaxX2(0.0), geoMaxX3(0.0); - - // geoMinX1 = this->geoObject3D->getX1Minimum(); geoMaxX1 = this->geoObject3D->getX1Maximum(); - // geoMinX2 = this->geoObject3D->getX2Minimum(); geoMaxX2 = this->geoObject3D->getX2Maximum(); - // geoMinX3 = this->geoObject3D->getX3Minimum(); geoMaxX3 = this->geoObject3D->getX3Maximum(); - ////////////////////////////////////////////////////////////////////////// - // DREIECKE: q-Bestimmung - ////////////////////////////////////////////////////////////////////////// - - // notwendige variablen initialisieren (u.a. blockDeltas des groben levels) + // initialize necessary variables (including blockDeltas of the coarse level) float triPoints[3][3]; float vx1 = 0.0, vx2 = 0.0, vx3 = 0.0; std::vector<GbTriFaceMesh3D::TriFace> &triangles = *mesh->getTriangles(); @@ -246,12 +259,12 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) setQTimer.start(); UBLOG(logDEBUG3, " - setQs for " << (int)triangles.size() << " triangles"); - // bool solidFromOtherInteractor = false; + float blockMinX[3], blockMaxX[3], boxCenter[3], halfBoxSize[3]; for (size_t t = 0; t < triangles.size(); t++) { ////////////////////////////////////////////////////////////////////////// - // Halfspace zum Dreieck generieren und min/max des Dreiecks ermitteln + // Generate halfspace for the triangle and determine the min/max of the triangle ////////////////////////////////////////////////////////////////////////// GbTriFaceMesh3D::TriFace &triangle = triangles[t]; @@ -267,7 +280,7 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) GbHalfSpace3D halfSpace(v1.x, v1.y, v1.z, triangle.nx, triangle.ny, triangle.nz); ////////////////////////////////////////////////////////////////////////// - // fuer GbMeshTools3D::triBoxOverlap + // for GbMeshTools3D::triBoxOverlap ////////////////////////////////////////////////////////////////////////// triPoints[0][0] = v1.x; triPoints[0][1] = v1.y; @@ -287,7 +300,7 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) double maxX3 = triangle.getMaxZ(nodes); ////////////////////////////////////////////////////////////////////////// - // Schleife ueber alle Level + // Loop through all levels ////////////////////////////////////////////////////////////////////////// double e1x1, e1x2, e1x3, e2x1, e2x2, e2x3, px1, px2, px3, a, f, sx1, sx2, sx3, u, qx1, qx2, qx3, v; bool gotQs = false; @@ -295,7 +308,7 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) for (int level = coarsestInitLevel; level <= finestInitLevel; level++) { ////////////////////////////////////////////////////////////////////////// - // levelspezifisches BoundCube des Dreicks ermitteln und zugehörige Bloecke beziehen + // Determine the level-specific BoundCube of the triangle and obtain the associated blocks ////////////////////////////////////////////////////////////////////////// double boundCubeTriangleMinX1 = minX1 - deltaMinX1[level]; double boundCubeTriangleMaxX1 = maxX1 + deltaMaxX1[level]; @@ -313,13 +326,13 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) boundCubeTriangleMaxX3, triBlocks); ////////////////////////////////////////////////////////////////////////// - // Schleife ueber bloecke des level, die das dreieck beinhalten + // Loop over blocks of the level that contain the triangle ////////////////////////////////////////////////////////////////////////// for (std::size_t b = 0; b < triBlocks.size(); b++) { SPtr<Block3D> block = triBlocks[b]; //////////////////////////////////////////////////////////////////////////// - //// Block Dreieck-/test + //// Block triangle/test //////////////////////////////////////////////////////////////////////////// UbTupleDouble3 coords = grid.lock()->getBlockWorldCoordinates(block); UbTupleDouble3 deltas = grid.lock()->getBlockLengths(block); @@ -340,13 +353,13 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) halfBoxSize[1] = (float)(c1o2 * (blockMaxX[1] - blockMinX[1])); halfBoxSize[2] = (float)(c1o2 * (blockMaxX[2] - blockMinX[2])); - // wenn dreieck "vergroesserten cube" nicht schneidet/beruehrt -> keine BC moeglich -> continue + // if triangle "enlarged cube" does not intersect/touch -> no BC possible -> continue if (!GbMeshTools3D::triBoxOverlap(boxCenter, halfBoxSize, triPoints)) { continue; } ////////////////////////////////////////////////////////////////////////// - // Untersuchung der einzelnen nodes + // Examination of the individual nodes ////////////////////////////////////////////////////////////////////////// bool blockGotBCs = false; @@ -362,8 +375,6 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) int indexMaxX3 = (int)bcMatrix->getNX3(); std::set<std::vector<int>> &bcNodeIndices = this->bcNodeIndicesMap[block]; - // std::set< UbTupleInt3 >& solidsFromOtherInteractors = - // tmpSolidNodesFromOtherInteractors[block]; double q, distance; double &nodeDx1 = nodeDeltaToNeigh[level][dP00]; @@ -381,18 +392,14 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) double internX2 = pointplane1[1]; double internX3 = pointplane1[2]; - // int blx1 = block->getX1(); - // int blx2 = block->getX2(); - // int blx3 = block->getX3(); - if (bcMatrix->isSolid(ix1, ix2, ix3) || bcMatrix->isUndefined(ix1, ix2, ix3)) { continue; } ////////////////////////////////////////////////////////////////////////// - // Punkt in AABB von Dreieck? + // Point in AABB of triangle? ////////////////////////////////////////////////////////////////////////// - // ehsan changed + // Ehsan changed bool pointIsOnBoundary = true; if (!boundingCubeTriangle.isPointInGbObject3D(internX1, internX2, internX3, pointIsOnBoundary)) { @@ -400,23 +407,23 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) } // std::cout<<"internX3 "<<internX3<<" internX2"<<internX2<<" internX1 "<<internX1<<"\n"; ////////////////////////////////////////////////////////////////////////// - // Halbebenentests + // Half-plane tests ////////////////////////////////////////////////////////////////////////// distance = halfSpace.getDistance(internX1, internX2, internX3); - // Punkt in Halbebene? (nein, wenn distance<0) + // Point in half plane? (no, if distance<0) if (useHalfSpace && UbMath::less(distance, 0.0)) //== !halfSpace.ptInside(internX1,internX2,internX3) ) { continue; } - // BilligOBB-Test: wenn distance > qEinflussDelta -> kein q + // CheapOBB test: if distance > qInfluenceDelta -> no q if (UbMath::greater(fabs(distance), qEinflussDelta)) { continue; } ///////////////////////////////////////////////////////////////////////////// - // Raytracingfür diskrete Boltzmannrichtungen + // Ray tracing for discrete Boltzmann directions ///////////////////////////////////////////////////////////////////////////// gotQs = false; bc = SPtr<BoundaryConditions>(); @@ -497,13 +504,13 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) if (UbMath::greater(q, c1o1) || UbMath::lessEqual(q, 0.0)) continue; - // gefundenes q auf gueltigkeit pruefen + //Check found q for validity if (UbMath::zero(q)) { - // neu (18.05.2010) - // es kann vorkommen, dass bei dünnwandigen geos punkte, die auf einem dreieck - // liegen, qs bekommen, die durch die geo durchgehen. diese punkte werden später - // jedoch nicht mehr auf solid getestet, da sie ja ne BC bekommen haben - //--> da mind ein q==0.0 für eines der dreiecke -> dort solid setzen + // new (05/18/2010) + // It can happen that with thin-walled geos there are points on a triangle + // lie, get qs that go through the geo. these points will come later + // but no longer tested for solidity because they didn't get a BC + //--> there is at least a q==0.0 for one of the triangles -> put it solid there this->solidNodeIndicesMap[block].insert(UbTupleInt3(ix1, ix2, ix3)); bcMatrix->setSolid(ix1, ix2, ix3); continue; @@ -524,11 +531,11 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) } else if (UbMath::less(bc->getQ(fdir), q) && UbMath::equal(-999.0, q)) // schon ein kuerzeres q voehanden? { - // neu:: 18.05.2010 - // um falsche qs die evtl durch die "wand" gehen zu vermeiden - // q nur dann neu setzen, wenn neues q kleiner als vorhandenes! - // Zudem: insbesondere an ecken mit zwei BC geos ist nur das - // naehere gueltig + // new:: May 18, 2010 + // to avoid incorrect qs that might go through the "wall". + // only reset q if new q is smaller than existing one! + // Also: especially on corners with two BC geos, that's all + // more details valid continue; } @@ -540,7 +547,7 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) this->BCs[index]->adaptBCForDirection(*this, bc, internX1, internX2, internX3, q, fdir); - // fuer beschleunigtes wiedereinlesen + // for accelerated rereading if (this->reinitWithStoredQsFlag) { bcNodeIndicesAndQsMap[block][UbTupleInt3(ix1, ix2, ix3)].resize( D3Q27System::FENDDIR + 1 + 3, -1.0f); @@ -569,746 +576,27 @@ void D3Q27TriFaceMeshInteractor::setQs(const real &timeStep) } } } - // dynamische Punkte des GbCuboids muessen leider per "Hand" geloescht werden :-( + // Unfortunately, dynamic points of the GbCuboids have to be deleted manually :-( boundingCubeTriangle.finalize(); } } UBLOGML(logDEBUG1, "\nLBMTriFaceMeshInteractor - setQs end "); } ////////////////////////////////////////////////////////////////////////// -// Vorgehesnweise -// A – Bestimmung der q's -// 1. fuer jeden Bounding cube eines Dreiecks des netzes werden die Bloecke des Blockgitter ermittelt -// 2. mittels eines Dreieck/Block Verschneidungstest werden weitere nicht relevante Bloecke aussortiert -// (fuer lange „schief“ im Raum stehende Dreicke, bei denen das Bounding Cube suboptimal ist) -// 3. jeder Knoten dieser blöcke wird gegen das bound cube des dreiecks getestet -// 4. Knoten die innerhalb des Cubes aber „innerhalb“ des Netzes liegen werden mittels Halbebenentest aussoriert -// 5. fuer die restliche Knoten erfolgt die q bestimmung mittels effizienter raytracing algorithmen -// fuer die diskreten Boltzmannrichtungen -// B – Setzen der nicht aktiven Bloecke und Solid Nodes -// alle Bloecke des Bounding Cube des Netzes, die mind eine BC erhielten, wurden in A markiert -// 1. fuer nicht markierte Bloecke genuegt EIN pointInObject(Dreicksnetz)-Test um den gesamten Block bei Erfolg als -// „not active“ zu markieren -// 2. fuer markiertre Bloecke wird ein rekursiver Fuellalgorithmus durchgefuehrt -void D3Q27TriFaceMeshInteractor::initInteractor2(const real &timeStep) -{ - using namespace vf::lbm::dir; - using namespace vf::basics::constant; - - UBLOGML(logDEBUG1, "\nLBMTriFaceMeshInteractor - initInteractor start "); - if (!this->grid.lock()) - throw UbException(UB_EXARGS, "ups, no grid.lock()!!"); - - if (this->reinitWithStoredQsFlag && !bcNodeIndicesAndQsMap.empty()) { - this->reinitWithStoredQs(timeStep); - return; - } - - GbTriFaceMesh3D *mesh = dynamic_cast<GbTriFaceMesh3D *>(this->geoObject3D.get()); - - UBLOGML(logDEBUG1, "\nLBMTriFaceMeshInteractor - initInteractor for \"" << mesh->getName() << " \" t=" << timeStep); - // cout<<" - init basics ..."; - - this->removeBcBlocks(); // hier wird auch die nodeIndicesMap geloescht! - this->removeSolidBlocks(); - - ////////////////////////////////////////////////////////////////////////// - // init bcs - ////////////////////////////////////////////////////////////////////////// - int nofAdapter = (int)this->BCs.size(); - if (nofAdapter == 0) - std::cout - << "WARNING - D3Q27TriFaceMeshInteractor::initInteractor Warning - no nodeAdapter available for " /*<<this->getName()*/ - << std::endl; - bool needTimeDependence = false; - for (int pos = 0; pos < nofAdapter; ++pos) { - this->BCs[pos]->init(this, timeStep); - if (this->BCs[pos]->isTimeDependent()) - needTimeDependence = true; - } - if (needTimeDependence) - this->setTimeDependent(); - else - this->unsetTimeDependent(); - - ////////////////////////////////////////////////////////////////////////// - // grid.lock() info - ////////////////////////////////////////////////////////////////////////// - int coarsestInitLevel = grid.lock()->getCoarsestInitializedLevel(); - int finestInitLevel = grid.lock()->getFinestInitializedLevel(); - - UbTupleInt3 blocknx = grid.lock()->getBlockNX(); - int blocknx1 = val<1>(blocknx); // gilt fuer alle Level - int blocknx2 = val<2>(blocknx); // gilt fuer alle Level - int blocknx3 = val<3>(blocknx); // gilt fuer alle Level - - // grobe Blocklaengen - SPtr<CoordinateTransformation3D> trafo = grid.lock()->getCoordinateTransformator(); - double cblockDeltaX1, cblockDeltaX2, cblockDeltaX3, delta; - cblockDeltaX1 = cblockDeltaX2 = cblockDeltaX3 = delta = c1o1 / (double)(1 << coarsestInitLevel); - if (trafo) { - cblockDeltaX1 = trafo->getX1CoordinateScaling() * delta; - cblockDeltaX2 = trafo->getX2CoordinateScaling() * delta; - cblockDeltaX3 = trafo->getX3CoordinateScaling() * delta; - } - // levelspezifische blocklaengen und knotenabstaende - std::vector<std::vector<double>> nodeDeltaToNeigh(finestInitLevel + 1); - // vector<double> blockDeltaX1(finestInitLevel+1), blockDeltaX2(finestInitLevel+1), blockDeltaX3(finestInitLevel+1); - std::vector<float> deltaMinX1(finestInitLevel + 1), deltaMinX2(finestInitLevel + 1), - deltaMinX3(finestInitLevel + 1); - std::vector<float> deltaMaxX1(finestInitLevel + 1), deltaMaxX2(finestInitLevel + 1), - deltaMaxX3(finestInitLevel + 1); - - // Im Boltzmankontext muss dx1==dx2==dx3 sein!! - assert(UbMath::equal(cblockDeltaX1 / (double)blocknx1, cblockDeltaX2 / (double)blocknx2)); - assert(UbMath::equal(cblockDeltaX1 / (double)blocknx1, cblockDeltaX3 / (double)blocknx3)); - - for (int level = coarsestInitLevel; level <= finestInitLevel; level++) { - real nodeDelta = cblockDeltaX1 / (double)(blocknx1 * (1 << (level - coarsestInitLevel))); - - std::vector<real> distNeigh(D3Q27System::FENDDIR + 1, 0.0); - D3Q27System::calcDistanceToNeighbors(distNeigh, nodeDelta); - - nodeDeltaToNeigh[level].resize(D3Q27System::ENDDIR + 1, 0.0); - for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) { - nodeDeltaToNeigh[level][fdir] = distNeigh[fdir]; - } - - // im gegensatz zum allg. Cell3DInteractor kann man hier auf max(0.02*blockDeltaX1[level],fabs(...)) verzichten - // da dies nur für blockDeltaCalculator->getMinX1Delta(level)==0.0 benötigt wird. ist im D3Q19... aber nie so - // Geller: kann man nicht diesen befuckten DeltaCalculator weglassen und hier einfach die Formel zum Delta - // rechnen reinpacken SirAnn: klar, mann kann auch weißwuerste am Alex verkaufen... aber zum einen ist das Ding - // dazu da - // und zum anderen sollt eman mal überlegen: "Formel zum Delta rechnen"->man muss rechnen - // blockDeltaCalculator->getMinX1Delta(level) -> ein geinlinter wert wird geholt - - deltaMinX1[level] = (float)(1.2 * nodeDelta); // kein minus da unten -deltaMin - deltaMinX2[level] = (float)(1.2 * nodeDelta); - deltaMinX3[level] = (float)(1.2 * nodeDelta); - deltaMaxX1[level] = (float)(1.2 * nodeDelta); - deltaMaxX2[level] = (float)(1.2 * nodeDelta); - deltaMaxX3[level] = (float)(1.2 * nodeDelta); - } - - ////////////////////////////////////////////////////////////////////////// - // bounding cubes des TriFaceMesh ermitteln (pro level) - ////////////////////////////////////////////////////////////////////////// - // min/max Werte des Dreiecksnetzes holen - double geoMinX1(0.0), geoMinX2(0.0), geoMinX3(0.0), geoMaxX1(0.0), geoMaxX2(0.0), geoMaxX3(0.0); - if (this->isSolid() || this->isMoveable()) { - geoMinX1 = this->geoObject3D->getX1Minimum(); - geoMaxX1 = this->geoObject3D->getX1Maximum(); - geoMinX2 = this->geoObject3D->getX2Minimum(); - geoMaxX2 = this->geoObject3D->getX2Maximum(); - geoMinX3 = this->geoObject3D->getX3Minimum(); - geoMaxX3 = this->geoObject3D->getX3Maximum(); - } else - throw UbException(UB_EXARGS, "only TYPE==SOLID is implemented"); - - std::map<SPtr<Block3D>, SolidCheckMethod> blocksForSolidCheck; - - for (int level = coarsestInitLevel; level <= finestInitLevel; level++) { - if (this->isSolid() || this->isMoveable()) { - // bloecke fuer "bounding cube gesamt" - std::vector<SPtr<Block3D>> tmpblocks; - grid.lock()->getBlocksByCuboid(level, geoMinX1 - deltaMinX1[level], geoMinX2 - deltaMinX2[level], - geoMinX3 - deltaMinX3[level], geoMaxX1 + deltaMaxX1[level], - geoMaxX2 + deltaMaxX2[level], geoMaxX3 + deltaMaxX3[level], tmpblocks); - - for (size_t i = 0; i < tmpblocks.size(); i++) - blocksForSolidCheck[tmpblocks[i]] = PointInObject; - } - } - - ////////////////////////////////////////////////////////////////////////// - // FE-specific - ////////////////////////////////////////////////////////////////////////// - // bool calcVelocities = false; - // FeTriFaceMesh3D* feMesh = dynamic_cast<FeTriFaceMesh3D*>(mesh); - // std::vector<FeTriFaceMesh3D::VertexAttributes>* attributes = NULL; - // if(feMesh) - //{ - // calcVelocities = true; - // attributes = feMesh->getAttributes(); - //} - - ////////////////////////////////////////////////////////////////////////// - // DREIECKE: q-Bestimmung - ////////////////////////////////////////////////////////////////////////// - - // notwendige variablen initialisieren (u.a. blockDeltas des groben levels) - float triPoints[3][3]; - real vx1 = c0o1, vx2 = c0o1, vx3 = c0o1; - unsigned counterTriBoxOverlap = 0, counterAABBTriFace = 0, counterHalfspace = 0, counterBilligOBB = 0; - std::vector<GbTriFaceMesh3D::TriFace> &triangles = *mesh->getTriangles(); - std::vector<GbTriFaceMesh3D::Vertex> &nodes = *mesh->getNodes(); - std::map<SPtr<Block3D>, std::set<std::vector<int>>> tmpSolidNodesFromOtherInteractors; - - int onePercent = UbMath::integerRounding(triangles.size() * c1o100); - if (onePercent == 0) - onePercent = 1; - vf::basics::Timer setQTimer; - setQTimer.start(); - UBLOG(logDEBUG3, " - setQs for " << (int)triangles.size() << " triangles"); - - // bool solidFromOtherInteractor = false; - float blockMinX[3], blockMaxX[3], boxCenter[3], halfBoxSize[3]; - - for (size_t t = 0; t < triangles.size(); t++) { - // if (t==10577) - //{ - // int ehsan=0; - //} - ////////////////////////////////////////////////////////////////////////// - // Halfspace zum Dreieck generieren und min/max des Dreiecks ermitteln - ////////////////////////////////////////////////////////////////////////// - GbTriFaceMesh3D::TriFace &triangle = triangles[t]; - - GbTriFaceMesh3D::Vertex &v1 = nodes[triangle.v1]; - GbTriFaceMesh3D::Vertex &v2 = nodes[triangle.v2]; - GbTriFaceMesh3D::Vertex &v3 = nodes[triangle.v3]; - - GbHalfSpace3D halfSpace(v1.x, v1.y, v1.z, v2.x, v2.y, v2.z, v3.x, v3.y, v3.z); - - // if(calcVelocities) - //{ - // FeTriFaceMesh3D::VertexAttributes& vAttribut1 = (*attributes)[triangle.v1]; - // FeTriFaceMesh3D::VertexAttributes& vAttribut2 = (*attributes)[triangle.v2]; - // FeTriFaceMesh3D::VertexAttributes& vAttribut3 = (*attributes)[triangle.v3]; - // vx1 = - // (float)(vf::basics::constant::c1o3*(vAttribut1.getVelocityX()+vAttribut2.getVelocityX()+vAttribut3.getVelocityX())); vx2 - // = (float)(vf::basics::constant::c1o3*(vAttribut1.getVelocityY()+vAttribut2.getVelocityY()+vAttribut3.getVelocityY())); - // vx3 = - // (float)(vf::basics::constant::c1o3*(vAttribut1.getVelocityZ()+vAttribut2.getVelocityZ()+vAttribut3.getVelocityZ())); - //} - - ////////////////////////////////////////////////////////////////////////// - // fuer GbMeshTools3D::triBoxOverlap - ////////////////////////////////////////////////////////////////////////// - triPoints[0][0] = v1.x; - triPoints[0][1] = v1.y; - triPoints[0][2] = v1.z; - triPoints[1][0] = v2.x; - triPoints[1][1] = v2.y; - triPoints[1][2] = v2.z; - triPoints[2][0] = v3.x; - triPoints[2][1] = v3.y; - triPoints[2][2] = v3.z; - - double minX1 = triangle.getMinX(nodes); - double maxX1 = triangle.getMaxX(nodes); - double minX2 = triangle.getMinY(nodes); - double maxX2 = triangle.getMaxY(nodes); - double minX3 = triangle.getMinZ(nodes); - double maxX3 = triangle.getMaxZ(nodes); - - ////////////////////////////////////////////////////////////////////////// - // Schleife ueber alle Level - ////////////////////////////////////////////////////////////////////////// - double e1x1, e1x2, e1x3, e2x1, e2x2, e2x3, px1, px2, px3, a, f, sx1, sx2, sx3, u, qx1, qx2, qx3, v; - bool gotQs = false; - SPtr<BoundaryConditions> bc; - - for (int level = coarsestInitLevel; level <= finestInitLevel; level++) { - ////////////////////////////////////////////////////////////////////////// - // levelspezifisches BoundCube des Dreicks ermitteln und zugehörige Bloecke beziehen - ////////////////////////////////////////////////////////////////////////// - double boundCubeTriangleMinX1 = minX1 - deltaMinX1[level]; - double boundCubeTriangleMaxX1 = maxX1 + deltaMaxX1[level]; - double boundCubeTriangleMinX2 = minX2 - deltaMinX2[level]; - double boundCubeTriangleMaxX2 = maxX2 + deltaMaxX2[level]; - double boundCubeTriangleMinX3 = minX3 - deltaMinX3[level]; - double boundCubeTriangleMaxX3 = maxX3 + deltaMaxX3[level]; - - GbCuboid3D boundingCubeTriangle(boundCubeTriangleMinX1, boundCubeTriangleMinX2, boundCubeTriangleMinX3, - boundCubeTriangleMaxX1, boundCubeTriangleMaxX2, boundCubeTriangleMaxX3); - - std::vector<SPtr<Block3D>> triBlocks; - grid.lock()->getBlocksByCuboid(level, boundCubeTriangleMinX1, boundCubeTriangleMinX2, - boundCubeTriangleMinX3, boundCubeTriangleMaxX1, boundCubeTriangleMaxX2, - boundCubeTriangleMaxX3, triBlocks); - - ////////////////////////////////////////////////////////////////////////// - // Schleife ueber bloecke des level, die das dreieck beinhalten - ////////////////////////////////////////////////////////////////////////// - for (std::size_t b = 0; b < triBlocks.size(); b++) { - SPtr<Block3D> block = triBlocks[b]; - - //////////////////////////////////////////////////////////////////////////// - //// Block Dreieck-/test - //////////////////////////////////////////////////////////////////////////// - UbTupleDouble3 coords = grid.lock()->getBlockWorldCoordinates(block); - UbTupleDouble3 deltas = grid.lock()->getBlockLengths(block); - - blockMinX[0] = (float)(val<1>(coords) - deltaMinX1[level]); - blockMinX[1] = (float)(val<2>(coords) - deltaMinX2[level]); - blockMinX[2] = (float)(val<3>(coords) - deltaMinX3[level]); - - blockMaxX[0] = (float)(val<1>(coords) + val<1>(deltas) + deltaMaxX1[level]); - blockMaxX[1] = (float)(val<2>(coords) + val<2>(deltas) + deltaMaxX2[level]); - blockMaxX[2] = (float)(val<3>(coords) + val<3>(deltas) + deltaMaxX3[level]); - - boxCenter[0] = (float)(c1o2 * (blockMaxX[0] + blockMinX[0])); - boxCenter[1] = (float)(c1o2 * (blockMaxX[1] + blockMinX[1])); - boxCenter[2] = (float)(c1o2 * (blockMaxX[2] + blockMinX[2])); - - halfBoxSize[0] = (float)(c1o2 * (blockMaxX[0] - blockMinX[0])); - halfBoxSize[1] = (float)(c1o2 * (blockMaxX[1] - blockMinX[1])); - halfBoxSize[2] = (float)(c1o2 * (blockMaxX[2] - blockMinX[2])); - - // wenn dreieck "vergroesserten cube" nicht schneidet/beruehrt -> keine BC moeglich -> continue - if (!GbMeshTools3D::triBoxOverlap(boxCenter, halfBoxSize, triPoints)) { - counterTriBoxOverlap++; - continue; - } - - ////////////////////////////////////////////////////////////////////////// - // Untersuchung der einzelnen nodes - ////////////////////////////////////////////////////////////////////////// - bool blockGotBCs = false; - - SPtr<ILBMKernel> kernel = block->getKernel(); - SPtr<BCArray3D> bcMatrix = kernel->getBCSet()->getBCArray(); - - int indexMinX1 = 0; - int indexMinX2 = 0; - int indexMinX3 = 0; - - int indexMaxX1 = (int)bcMatrix->getNX1(); - int indexMaxX2 = (int)bcMatrix->getNX2(); - int indexMaxX3 = (int)bcMatrix->getNX3(); - - std::set<std::vector<int>> &bcNodeIndices = this->bcNodeIndicesMap[block]; - std::set<std::vector<int>> &solidsFromOtherInteractors = tmpSolidNodesFromOtherInteractors[block]; - double q, internX1, internX2, internX3, distance; - - double &nodeDx1 = nodeDeltaToNeigh[level][dP00]; - double &nodeDx2 = nodeDeltaToNeigh[level][d0P0]; - double &nodeDx3 = nodeDeltaToNeigh[level][d00P]; - - // fuer OBB-Test - double qEinflussDelta = 1.1 * sqrt(nodeDx1 * nodeDx1 + nodeDx2 * nodeDx2 + nodeDx3 * nodeDx3); - - for (int ix3 = indexMinX3; ix3 < indexMaxX3; ix3++) { - internX3 = val<3>(coords) + nodeDx3 * ix3 - c1o2 * nodeDx3; - for (int ix2 = indexMinX2; ix2 < indexMaxX2; ix2++) { - internX2 = val<2>(coords) + nodeDx2 * ix2 - c1o2 * nodeDx2; - for (int ix1 = indexMinX1; ix1 < indexMaxX1; ix1++) { - - // int blx1 =block->getX1(); - // int blx2 = block->getX2(); - // int blx3 = block->getX3(); - - // if (blx1==0&&blx2==1&&blx3==0) - // { - // //if (ix2==39&&ix3==4) - // if (ix2==39&&ix3==4) - // { - // int seb=0; - // } - // } - // Problem: wenn voher der punkt durch eine andere geo not active gesetzt wird und - // dieser nun uebersprungen wird, dann hat man spaeter beim fuellalgorithmus luecken - // in der front und der block wird u.U. faelschlicher weise komplett solid markiert - // Lsg: positionen merken und erst Nach dem fuellarlgo wieder auf not active setzen :-) - // solidFromOtherInteractor = false; - if (bcMatrix->isSolid(ix1, ix2, ix3)) { - if (this->reinitWithStoredQsFlag) { - // solidFromOtherInteractor = true; //hier muss man weitermachen - // SG //oje - std::vector<int> p(3); - p[0] = ix1; - p[1] = ix2; - p[2] = ix3; - solidsFromOtherInteractors.insert(p); - } else { - // SG //oje - std::vector<int> p(3); - p[0] = ix1; - p[1] = ix2; - p[2] = ix3; - solidsFromOtherInteractors.insert(p); - // SG continue; - // solidFromOtherInteractor = true; - } - } - - internX1 = val<1>(coords) + nodeDx1 * ix1 - c1o2 * nodeDx1; - - ////////////////////////////////////////////////////////////////////////// - // Punkt in AABB von Dreieck? - ////////////////////////////////////////////////////////////////////////// - // ehsan changedâ—˜ - bool pointIsOnBoundary = false; - if (!boundingCubeTriangle.isPointInGbObject3D(internX1, internX2, internX3, - pointIsOnBoundary)) - // if( !boundingCubeTriangle.isPointInGbObject3D(internX1, internX2, internX3) ) - { - counterAABBTriFace++; - continue; - } - - ////////////////////////////////////////////////////////////////////////// - // Halbebenentests - ////////////////////////////////////////////////////////////////////////// - distance = halfSpace.getDistance(internX1, internX2, internX3); - - // Punkt in Halbebene? (nein, wenn distance<0) - if (useHalfSpace && - UbMath::less(distance, 0.0)) //== !halfSpace.ptInside(internX1,internX2,internX3) ) - { - counterHalfspace++; - continue; - } - - // BilligOBB-Test: wenn distance > qEinflussDelta -> kein q - if (UbMath::greater(fabs(distance), qEinflussDelta)) { - counterBilligOBB++; - continue; - } - - ///////////////////////////////////////////////////////////////////////////// - // Raytracingfür diskrete Boltzmannrichtungen - ///////////////////////////////////////////////////////////////////////////// - gotQs = false; - bc = SPtr<BoundaryConditions>(); - - // RAYTRACING - diskrete LB-dir zu Dreick - // e1 = v1 - v0 - e1x1 = v2.x - v1.x; - e1x2 = v2.y - v1.y; - e1x3 = v2.z - v1.z; - - // e2 = v2 - v0 - e2x1 = v3.x - v1.x; - e2x2 = v3.y - v1.y; - e2x3 = v3.z - v1.z; - - // s = o - v0 - sx1 = internX1 - v1.x; - sx2 = internX2 - v1.y; - sx3 = internX3 - v1.z; - - for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) { - // p = d x e2 - px1 = this->rayX2[fdir] * e2x3 - this->rayX3[fdir] * e2x2; - px2 = this->rayX3[fdir] * e2x1 - this->rayX1[fdir] * e2x3; - px3 = this->rayX1[fdir] * e2x2 - this->rayX2[fdir] * e2x1; - - // a = e1 dot p - a = e1x1 * px1 + e1x2 * px2 + e1x3 * px3; - if (fabs(a) < 1.E-10) - continue; - f = c1o1 / a; - - // u = f * ( s dot p) - u = f * (sx1 * px1 + sx2 * px2 + sx3 * px3); - if (u < -1.E-10 || u > c1o1 + 1.E-10) - continue; - - // q = s x e1 - qx1 = sx2 * e1x3 - sx3 * e1x2; - qx2 = sx3 * e1x1 - sx1 * e1x3; - qx3 = sx1 * e1x2 - sx2 * e1x1; - - // v = f*(e2 dot q) - v = f * (this->rayX1[fdir] * qx1 + this->rayX2[fdir] * qx2 + this->rayX3[fdir] * qx3); - if (v < -1.E-10 || (u + v) > c1o1 + 1.E-10) - continue; - - // t = f * (e2 dot q) - q = f * (e2x1 * qx1 + e2x2 * qx2 + e2x3 * qx3); - q /= nodeDeltaToNeigh[level][fdir]; - - // gefundenes q auf gueltigkeit pruefen - if (UbMath::zero(q)) { - // neu (18.05.2010) - // es kann vorkommen, dass bei dünnwandigen geos punkte, die auf einem dreieck - // liegen, qs bekommen, die durch die geo durchgehen. diese punkte werden später - // jedoch nicht mehr auf solid getestet, da sie ja ne BC bekommen haben - //--> da mind ein q==0.0 für eines der dreiecke -> dort solid setzen - this->solidNodeIndicesMap[block].insert(UbTupleInt3(ix1, ix2, ix3)); - bcMatrix->setSolid(ix1, ix2, ix3); - continue; - } - - if (UbMath::inClosedInterval(q, c1o1, c1o1)) - q = c1o1; - if (UbMath::greater(q, 0.0) && UbMath::lessEqual(q, c1o1)) { - // if( !solidFromOtherInteractor ) //--> Knoten schon solid-->BC setzen - // ueberfluessig SG changed to if( solidFromOtherInteractor ) //--> Knoten schon - // solid-->BC setzen ueberfluessig - { - // SG 26.08.2010 muss bereits hierhin, da das continue sonst den Knoten nicht - // als transNode fürs markiert - gotQs = blockGotBCs = true; - - bc = bcMatrix->getBC(ix1, ix2, ix3); - - // SG 26.08.2010 if(!bc && !bcMatrix->isSolid()) - if (!bc) { - bc = SPtr<BoundaryConditions>(new BoundaryConditions); - bcMatrix->setBC(ix1, ix2, ix3, bc); - } else if (UbMath::less(bc->getQ(fdir), q)) // schon ein kuerzeres q voehanden? - { - // neu:: 18.05.2010 - // um falsche qs die evtl durch die "wand" gehen zu vermeiden - // q nur dann neu setzen, wenn neues q kleiner als vorhandenes! - // Zudem: insbesondere an ecken mit zwei BC geos ist nur das - // naehere gueltig - continue; - } - - bc->setBoundaryVelocityX1(vx1); - bc->setBoundaryVelocityX2(vx2); - bc->setBoundaryVelocityX3(vx3); - - for (int index = (int)this->BCs.size() - 1; index >= 0; --index) - this->BCs[index]->adaptBCForDirection(*this, bc, internX1, internX2, - internX3, q, fdir); - - // SG 26.08.2010 gotQs=blockGotBCs=true; - } - // fuer beschleunigtes wiedereinlesen - if (this->reinitWithStoredQsFlag) { - bcNodeIndicesAndQsMap[block][UbTupleInt3(ix1, ix2, ix3)].resize( - D3Q27System::FENDDIR + 1 + 3, -1.0f); - bcNodeIndicesAndQsMap[block][UbTupleInt3(ix1, ix2, ix3)][fdir] = float(q); - bcNodeIndicesAndQsMap[block][UbTupleInt3(ix1, ix2, ix3)] - [D3Q27System::FENDDIR + 1 + 0] = float(internX1); - bcNodeIndicesAndQsMap[block][UbTupleInt3(ix1, ix2, ix3)] - [D3Q27System::FENDDIR + 1 + 1] = float(internX2); - bcNodeIndicesAndQsMap[block][UbTupleInt3(ix1, ix2, ix3)] - [D3Q27System::FENDDIR + 1 + 2] = float(internX3); - } - } - } - - if (gotQs) { - std::vector<int> p(3); - p[0] = ix1; - p[1] = ix2; - p[2] = ix3; - bcNodeIndices.insert(p); - - for (int index = (int)this->BCs.size() - 1; index >= 0; --index) - this->BCs[index]->adaptBC(*this, bc, internX1, internX2, internX3); - } - } - } - } - // Block wird für scanline-check "anmelden", dieser wird dann spaeter zu "transBlocks" hinzugefuegt - if (blockGotBCs) { - blocksForSolidCheck[block] = ScanLine; - } - // bvd->getTimer().stop(); - } - // dynamische Punkte des GbCuboids muessen leider per "Hand" geloescht werden :-( - boundingCubeTriangle.finalize(); - } - } - setQTimer.end(); - - UBLOG(logDEBUG1, " - setQs for " /*<< this->getName()*/ << " - " << (int)triangles.size() - << " triangles: 100% done in " << setQTimer.getTimeInSeconds() - << "sec"); - UBLOG(logDEBUG1, " * rejected blocks with tribox overlap test : " << counterTriBoxOverlap); - UBLOG(logDEBUG1, " * rejected nodes with AABB test : " << counterAABBTriFace); - UBLOG(logDEBUG1, " * rejected nodes with halfspace test : " << counterHalfspace); - UBLOG(logDEBUG1, " * rejected nodes with OBB test : " << counterBilligOBB); - - using BlockSolidCheckMethodIterator = std::map<SPtr<Block3D>, SolidCheckMethod>::iterator; - - ////////////////////////////////////////////////////////////////////////// - // SOLID checks - ////////////////////////////////////////////////////////////////////////// - if (regardPIOTest) { - int pointInObjectCounter = 0; - int scanlineCounter = 0; - // int counter = 0; - - // sollte die matrix groesse zu gross sein und der rekursive floodFill mehr speicher - // benoetigen als der Stack hergibt -> keinen floodFill verwenden! - void (D3Q27TriFaceMeshInteractor::*gridFill)(CbArray3D<FLAGS> &, const short &, const short &, const short &, - const FLAGS &) = NULL; - /*if(blocknx1*blocknx2*blocknx3 < 200000 ) gridFill = &D3Q27TriFaceMeshInteractor::recursiveGridFill;*/ - /*else */ gridFill = &D3Q27TriFaceMeshInteractor::iterativeGridFill; - - UBLOG(logDEBUG1, " - setSolids for " << blocksForSolidCheck.size() << " blocks"); - - vf::basics::Timer scanLineTimer; - vf::basics::Timer solidTimer; - solidTimer.start(); - - for (BlockSolidCheckMethodIterator pos = blocksForSolidCheck.begin(); pos != blocksForSolidCheck.end(); ++pos) { - SPtr<Block3D> const &block = pos->first; - int level = block->getLevel(); - - UbTupleDouble3 coords = grid.lock()->getBlockWorldCoordinates(block); - - // Bloecke, die keinerlei Verschneidung mit Dreicken bzw. deren BoundCubes hatten - // hier: durch inside/outside Tests EINES knotens gilt fuer ALLE Knoten des blockes - if (pos->second == PointInObject) { - pointInObjectCounter++; - if (mesh->isPointInGbObject3D(val<1>(coords), val<2>(coords), val<3>(coords))) { - // block->setActive(false); - // this->solidBlocks.push_back(block); - } - } - // Bloecke, die Verschneidung mit Dreicken bzw. deren BoundCubes hatten - // scanline algortihmus. dieser berücksichtigt durch weitere tests, dass innerhalb evtl schon andere - // geos bcs gesetzt haben. es werden ausschließelich solids gesetzt (also keine FLUIDS oder neuen BCs) - else if (pos->second == ScanLine) { - scanlineCounter++; - scanLineTimer.start(); - - SPtr<ILBMKernel> kernel = block->getKernel(); - if (!kernel) - throw UbException(UB_EXARGS, "na sowas kein kernel bzw. kernel=NULL (2)"); - SPtr<BCArray3D> bcMatrix = kernel->getBCSet()->getBCArray(); - - // bvd->getTimer().start(); - // int indexMinX1 = 0; - // int indexMinX2 = 0; - // int indexMinX3 = 0; - int indexMaxX1 = (int)bcMatrix->getNX1(); - int indexMaxX2 = (int)bcMatrix->getNX2(); - int indexMaxX3 = (int)bcMatrix->getNX3(); - - // quick and dirty - blocknx1 = indexMaxX1; - blocknx2 = indexMaxX2; - blocknx3 = indexMaxX3; - - std::set<UbTupleInt3> &solidNodeIndices = this->solidNodeIndicesMap[block]; - - float nodeDeltaX1 = (float)nodeDeltaToNeigh[level][dP00]; - float nodeDeltaX2 = (float)nodeDeltaToNeigh[level][d0P0]; - float nodeDeltaX3 = (float)nodeDeltaToNeigh[level][d00P]; - - // flagfield matrix initialisieren - CbArray3D<FLAGS> flagField(blocknx1, blocknx2, blocknx3, UNDEF_FLAG); - - // hier gesetzte bcs markieren - std::set<std::vector<int>> &transNodeIndices = this->bcNodeIndicesMap[block]; - std::set<std::vector<int>>::iterator setPos; - for (setPos = transNodeIndices.begin(); setPos != transNodeIndices.end(); ++setPos) - flagField((*setPos)[0], (*setPos)[1], (*setPos)[2]) = BC_FLAG; - - // solids die bereits durch andere interaktoren gesetzt wurden (wurden oben gespeichert) - // ist EMPTY bei reinitWithStoredQsFlag == true - // SG 28.08.2010 std::set< UbTupleInt3 >& tmpSolidNodeIndices = - // tmpSolidNodesFromOtherInteractors[block]; SG 28.08.2010 if(reinitWithStoredQsFlag && - // !tmpSolidNodeIndices.empty() ) throw UbException(UB_EXARGS, "tmpSolidNodeIndices darf bei - // reinitWithStoredQsFlag==true keine Knoten enthalten"); SG 28.08.2010 - // for(setPos=tmpSolidNodeIndices.begin(); setPos!=tmpSolidNodeIndices.end(); ++setPos) SG 28.08.2010 - // flagField( val<1>(*setPos), val<2>(*setPos), val<3>(*setPos) ) = OLDSOLID_FLAG; - - // flagfield matrix belegen - for (int bx3 = 0; bx3 < blocknx3; ++bx3) { - for (int bx2 = 0; bx2 < blocknx2; ++bx2) { - for (int bx1 = 0; bx1 < blocknx1; ++bx1) { - - // if (bx2==9&&bx3==29) - // { - // int ride=0; - // } - if (flagField(bx1, bx2, bx3) == UNDEF_FLAG) { - if (mesh->isPointInGbObject3D(val<1>(coords) + bx1 * nodeDeltaX1 - c1o2 * nodeDeltaX1, - val<2>(coords) + bx2 * nodeDeltaX2 - c1o2 * nodeDeltaX2, - val<3>(coords) + bx3 * nodeDeltaX3 - c1o2 * nodeDeltaX3)) { - (this->*gridFill)(flagField, bx1, bx2, bx3, SOLID_FLAG); - } else { - (this->*gridFill)(flagField, bx1, bx2, bx3, FLUID_FLAG); - } - } - - if (flagField(bx1, bx2, bx3) == SOLID_FLAG) { - // hier ist noch das Problem, das "alle" solid in die solidNodeIndices kommen - // evtl. Abhilfe durch einführen eines anderen Flags bei tmpSolidNodeIndices .. - solidNodeIndices.insert(UbTupleInt3(bx1, bx2, bx3)); - bcMatrix->setSolid(bx1, bx2, bx3); - } - // SG 28.08.2010 else if( flagField(bx1,bx2,bx3)==OLDSOLID_FLAG ) - // SG 28.08.2010 { - // SG 28.08.2010 bcMatrix->setSolid(bx1,bx2,bx3); - // SG 28.08.2010 } - } - } - } - - // SG 28.08.2010 halt danach setzen, damit die BCs die fälschlicherweise gesetzt wurden korrigiert - // werden - std::set<std::vector<int>> &tmpSolidNodeIndices = tmpSolidNodesFromOtherInteractors[block]; - for (setPos = tmpSolidNodeIndices.begin(); setPos != tmpSolidNodeIndices.end(); ++setPos) - bcMatrix->setSolid((*setPos)[0], (*setPos)[1], (*setPos)[2]); - - // block hat in initInteractor mind eine BC erhalten -> transBlock - this->bcBlocks.push_back(block); - scanLineTimer.end(); - - // bvd->getTimer().stop(); - } else - throw UbException(UB_EXARGS, "unknown option for in object test"); - } - - solidTimer.end(); - - UBLOG(logDEBUG1, " - setSolids for " << blocksForSolidCheck.size() << " blocks: 100% done in " - << solidTimer.getTimeInSeconds() << "s"); - UBLOG(logDEBUG1, " * pointInObject for " << pointInObjectCounter << " blocks in " - << solidTimer.getTimeInSeconds() - scanLineTimer.getTimeInSeconds() - << "s"); - UBLOG(logDEBUG1, " * flood fill for " << scanlineCounter << " blocks in " - << scanLineTimer.getTimeInSeconds() << " secs"); - UBLOG(logDEBUG1, "LBMTriFaceMeshInteractor::initInteractor for \"" - << mesh->getName() << "\" done in " << setQTimer.getTimeInSeconds() + solidTimer.getTimeInSeconds() - << "s"); - } - - // calcForces arbeitet nicht korrekt, wenn Geo mit Bloecken - // unterschiedlicher Leveltiefe diskretisiert -> exception - // abfrage steht hier, weil es theoretisch sein kann, dass bei parallelen rechnungen - // genau der block mit dem anderen level auf einem anderen prozess liegt... - // Update: es kann u.U. passieren, dass Blöcke in der Liste nicht aktiv sin - //(falls diese z.B. duch andere Interactoren solid gesetzt wurden) - // diese werden nicht berücksichtigt (auch nicht beid er kraftauswertung später) - // if( this->isRelevantForForces() ) - //{ - // int level = -1; - // for( std::vector<SPtr<Block3D>>::const_iterator pos = this->transBlocks.begin(); pos!=this->transBlocks.end(); - // ++pos) - // if( (*pos)->isActive() ) - // { - // level = (*pos)->getLevel(); - // break; - // } - - // bool check = false; - // for( std::vector<SPtr<Block3D>>::const_iterator pos = this->transBlocks.begin(); - // pos!=this->transBlocks.end(); ++pos) - // if( (*pos)->isActive() && (*pos)->getLevel()!=level) - // { - // (*pos)->setRank(1000); - // check = true; - // UbTupleDouble3 coords = grid.lock()->getBlockWorldCoordinates((*pos)); - // std::cout<<(*pos)->getLevel()<<","<<(*pos)->getX1()<<","<<(*pos)->getX2()<<","<<(*pos)->getX3()<<std::endl; - // std::cout<<std::setprecision(15)<<val<1>(coords)<<","<<val<2>(coords)<<","<<val<3>(coords)<<std::endl<<std::endl; - - // } - // if(check) - // { - // //this->grid.lock()->writeBlocks(UbStaticPathMap::getPath(UbStaticPathMap::GLOBAL)+"/error_grid",0, - // WbWriterVtkXmlASCII::getInstance(), false); - - // throw UbException(UB_EXARGS,"interactor is relevant for forces," - // +(std::string)" but has transblocks with different levels (wrote error_grid)" - // +(std::string)" -> not supportet by LBMInteractor::getForces()" - // +(std::string)" -> increase refineWidth"); - - // } - //} -} +// Procedure +// A – Determination of the q's +// 1. The blocks of the block grid are determined for each bounding cube of a triangle in the network +// 2. using a triangle/block intersection test, further irrelevant blocks are sorted out +// (for long triangles that are crooked in space and where the bounding cube is suboptimal) +// 3. Each node of these blocks is tested against the bound cube of the triangle +// 4. Nodes that are within the cube but “within†the network are sorted out using a half-plane test +// 5. For the remaining nodes, the q determination is carried out using efficient ray tracing algorithms +// for the discrete Boltzmann directions +// B – Setting the inactive blocks and solid nodes +// all blocks of the bounding cube of the network that received at least one BC were marked in A +// 1. for unmarked blocks, ONE pointInObject (triangular network) test is sufficient for the entire block if successful +// mark “not activeâ€. +// 2. a recursive filling algorithm is carried out for marked blocks ////////////////////////////////////////////////////////////////////////// void D3Q27TriFaceMeshInteractor::refineBlockGridToLevel(int level, real startDistance, real stopDistance) { @@ -1316,8 +604,8 @@ void D3Q27TriFaceMeshInteractor::refineBlockGridToLevel(int level, real startDis UBLOG(logDEBUG1, "D3Q27TriFaceMeshInteractor::refineBlockGridToLevel - start"); - // ToDo: evtl checken, ob man noch einen HalbraumCheck für StopDistance einbaut - // oder ob man schneller ist, wenn man gar keinen halbraum test macht... + // ToDo: maybe check whether you can install a half-space check for StopDistance + // or whether you're faster if you don't do a half-space test at all... if (!grid.lock()) throw UbException(UB_EXARGS, "Grid isn't exist!"); if (UbMath::greater(startDistance, 0.0)) @@ -1361,14 +649,14 @@ void D3Q27TriFaceMeshInteractor::refineBlockGridToLevel(int level, real startDis assert((fabs(std::sqrt(triangle.nx * triangle.nx + triangle.ny * triangle.ny + triangle.nz * triangle.nz)) - 1.0f) < 1.0E-6); - // Halfspace um startDistance entgegen normale verscheiebn, ansonsten werden spaeter - // zu testende bloecke auf der dreicksrueckseite nicht getestet!!! + // Move halfspace around startDistance to normal, otherwise we will do it later + // blocks to be tested on the back of the triangle not tested!!! GbHalfSpace3D halfSpace( v1.x + startDistance * triangle.nx, v1.y + startDistance * triangle.ny, v1.z + startDistance * triangle.nz, v2.x + startDistance * triangle.nx, v2.y + startDistance * triangle.ny, v2.z + startDistance * triangle.nz, v3.x + startDistance * triangle.nx, v3.y + startDistance * triangle.ny, v3.z + startDistance * triangle.nz); - // Boundingbox um massgebliches dx erweitern -> zur Bestimmung der zu testenden Bloecke + // Expand the bounding box with relevant dx -> to determine the blocks to be tested if (triangle.nx > 1.0E-8) { minX1 = triangle.getMinX(nodes) + c21o20 * triangle.nx * startDistance; maxX1 = triangle.getMaxX(nodes) + c21o20 * triangle.nx * stopDistance; @@ -1394,8 +682,8 @@ void D3Q27TriFaceMeshInteractor::refineBlockGridToLevel(int level, real startDis } int flag = 0; - // Levelweise alle Bloecke holen, die erweiterte BB schneiden - // und bearbeiten + // Get all the blocks that intersect extended BB level by level + // and edit for (int l = coarsestLevel; l < level; l++) { std::vector<SPtr<Block3D>> consideredBlocks; bgrid->getBlocksByCuboid(l, minX1, minX2, minX3, maxX1, maxX2, maxX3, consideredBlocks); @@ -1406,11 +694,11 @@ void D3Q27TriFaceMeshInteractor::refineBlockGridToLevel(int level, real startDis if (block->getLevel() >= level) continue; - // start coordinaten des blocks ermitteln + // Determine the start coordinates of the block UbTupleDouble3 coords = bgrid->getBlockWorldCoordinates(block); UbTupleDouble3 deltas = bgrid->getBlockLengths(block); - // Check, ob block komplett im Halbraum + // Check whether the block is completely in the half space x1a = val<1>(coords); x1b = val<1>(coords) + val<1>(deltas); x2a = val<2>(coords); @@ -1437,9 +725,9 @@ void D3Q27TriFaceMeshInteractor::refineBlockGridToLevel(int level, real startDis flag |= (1 << 7); // 128 if (true && flag != 255) { - // blockseite ermitteln (skalarprodukt dreiecks-normale, vector (midTri->midCub) ) - // je nachdem muss für den massgeblichen block start oder stopdistance verwendet werden - // liegt block auf pos seite -> stopdistance ansonsten startdistance + // determine block side (scalar product triangle-normal, vector (midTri->midCub) ) + // depending on this, start or stopdistance must be used for the relevant block + // block is on the pos side -> stopdistance otherwise startdistance double skalarprod = triangle.nx * (c1o2 * (x1a + x1b) - triangle.getX1Centroid(nodes)) + triangle.ny * (c1o2 * (x2a + x2b) - triangle.getX2Centroid(nodes)) + triangle.nz * (c1o2 * (x3a + x3b) - triangle.getX3Centroid(nodes)); @@ -1450,7 +738,7 @@ void D3Q27TriFaceMeshInteractor::refineBlockGridToLevel(int level, real startDis else if (fabs(skalarprod) < 1.E-8) blockdelta = c21o20 * UbMath::max(-startDistance, stopDistance); - // block anpassen + // adjust block blockMinX[0] = (float)(val<1>(coords) - blockdelta); blockMinX[1] = (float)(val<2>(coords) - blockdelta); blockMinX[2] = (float)(val<3>(coords) - blockdelta); @@ -1481,7 +769,7 @@ void D3Q27TriFaceMeshInteractor::refineBlockGridToLevel(int level, real startDis triPoints[2][1] = v3_.y; triPoints[2][2] = v3_.z; - // wenn block dreick schneidet, dann muss er verfeinert werden + // if block triangle cuts, then it needs to be refined if (GbMeshTools3D::triBoxOverlap(boxCenter, halfBoxSize, triPoints)) { bgrid->expandBlock(block->getX1(), block->getX2(), block->getX3(), block->getLevel()); } @@ -1554,270 +842,6 @@ void D3Q27TriFaceMeshInteractor::iterativeGridFill(CbArray3D<FLAGS> &flagfield, return; } ////////////////////////////////////////////////////////////////////////// -UbTupleDouble3 D3Q27TriFaceMeshInteractor::getForces() -{ - // FeTriFaceMesh3D* feMesh = dynamic_cast<FeTriFaceMesh3D*>(this->geoObject3D.get()); - // if(!feMesh) - //{ - // return D3Q19AMRInteractor::getForces(); - //} - ////return getForcesTriangle(); - // this->calculateForces(); - using namespace vf::basics::constant; - - real forceX1 = c0o1; - real forceX2 = c0o1; - real forceX3 = c0o1; - - // double area = 0.0; - - // vector<FeTriFaceMesh3D::VertexAttributes>* attributes = feMesh->getAttributes(); - - // for(size_t i=0; i<attributes->size(); i++) - //{ - // FeTriFaceMesh3D::VertexAttributes& attribut = (*attributes)[i]; - // area = attribut.getArea(); - // forceX1 += attribut.getFX()*area; - // forceX2 += attribut.getFY()*area; - // forceX3 += attribut.getFZ()*area; - //} - return { forceX1, forceX2, forceX3 }; -} -////////////////////////////////////////////////////////////////////////// -UbTupleDouble3 D3Q27TriFaceMeshInteractor::getForcesTriangle() -{ - using namespace vf::basics::constant; - - real forceX1 = c0o1; - real forceX2 = c0o1; - real forceX3 = c0o1; - - // D3Q19BlockGrid& grid.lock() = dynamic_cast<D3Q19BlockGrid&>(*this->grid.lock()); - //// CoordinateTransformation3D *trafo = this->grid.lock()->getTransformation(); - //// int minLevel = this->grid.lock()->getFinestInitializedLevel(); - //// double scaleX = trafo->getX1CoordinateScaling()/(1<<minLevel); - //// double scaleY = trafo->getX2CoordinateScaling()/(1<<minLevel); - //// double scaleZ = trafo->getX3CoordinateScaling()/(1<<minLevel); - //// int blocknx1 = grid.lock()->getBlockNX1(); - //// int blocknx2 = grid.lock()->getBlockNX2(); - //// int blocknx3 = grid.lock()->getBlockNX3(); - //// double xOffset = trafo->getX1CoordinateOffset(); - //// double yOffset = trafo->getX2CoordinateOffset(); - //// double zOffset = trafo->getX3CoordinateOffset(); - // vector<D3Q19Real> collFactors = ((D3Q19Calculator*)grid.lock()->getCalculator())->getCollisionsFactors(); - - ////for (int i=0;i<(int)gbTriangle3DInteractors.size(); i++) - ////{ - //// GbTriangle3D* tri = (GbTriangle3D*)gbTriangle3DInteractors[i]->getGbObject3D(); - - //// double px0 = tri->getX1Centroid(); - //// double py0 = tri->getX2Centroid(); - //// double pz0 = tri->getX3Centroid(); - //// double px = px0-xOffset; - //// double py = py0-yOffset; - //// double pz = pz0-zOffset; - //// px = px/scaleX; - //// py = py/scaleY; - //// pz = pz/scaleZ; - //// int x1 = (int)px; - //// int y1 = (int)py; - //// int z1 = (int)pz; - //// AMR3DBlock* block = this->grid.lock()->getBlock(x1,y1,z1,minLevel); - //// if(!block) block = this->grid.lock()->getSuperBlock(x1,y1,z1,minLevel); - //// if(!block) throw UbException(__FILE__,__LINE__,"kein Block ..."); - - //// double collFactor = collFactors[block->getLevel()]; - //// double nodeDistance = grid.lock()->getNodeDeltaX(block->getLevel()); - //// double bertX1 = ((px0-xOffset)/(1000.*nodeDistance)); - //// double bertX2 = ((py0-yOffset)/(1000.*nodeDistance)); - //// double bertX3 = ((pz0-zOffset)/(1000.*nodeDistance)); - //// int abstaendeX1 = (int)(bertX1*1000.); - //// int abstaendeX2 = (int)(bertX2*1000.); - //// int abstaendeX3 = (int)(bertX3*1000.); - //// int posW = abstaendeX1 - block->getX1Index()*blocknx1; - //// int posS = abstaendeX2 - block->getX2Index()*blocknx2; - //// int posB = abstaendeX3 - block->getX3Index()*blocknx3; - //// int posE=posW+1; - //// int posN=posS+1; - //// int posT=posB+1; - - //// D3Q19BlockDescriptor *bvd = dynamic_cast<D3Q19BlockDescriptor*>(block->getBlockDescriptor()); - //// if(!bvd) throw UbException(__FILE__,__LINE__,"kein Bvd ..."); - - //// CbUniformMatrix4D<double,IndexerX1X2X3X4>* tempdistributions = bvd->getTempDistributionMatrix(); - //// D3Q19BCMatrix<D3Q19BoundaryCondition> *bcMatrix = bvd->getBcMatrix(); - - //// UbTupleDouble6 stresses; - //// double dX = px0-this->geoObject3D->getX1Centroid(); - //// double dY = py0-this->geoObject3D->getX2Centroid(); - //// double dZ = pz0-this->geoObject3D->getX3Centroid(); - //// if(dX<=0.0 && dY<=0.0 && dZ<=0.0) - //// { - //// double *fWSB = tempdistributions->getStartAdressOfSortedArray(posW,posS,posB,0); - //// if(bcMatrix->isFluid(posW,posS,posB)) stresses = D3Q19System::getIncompStresses(fWSB, collFactor ); - //// else cout<<__LINE__<<" nicht fluid ..."; - //// } - //// else if(dX<=0.0 && dY>0.0 && dZ<=0.0) - //// { - //// double *fWNB = tempdistributions->getStartAdressOfSortedArray(posW,posN,posB,0); - //// if(bcMatrix->isFluid(posW,posN,posB)) stresses = D3Q19System::getIncompStresses(fWNB, collFactor ); - //// else cout<<__LINE__<<" nicht fluid ..."; - //// } - //// else if(dX<=0.0 && dY<=0.0 && dZ>0.0) - //// { - //// double *fWST = tempdistributions->getStartAdressOfSortedArray(posW,posS,posT,0); - //// if(bcMatrix->isFluid(posW,posS,posT)) stresses = D3Q19System::getIncompStresses(fWST, collFactor ); - //// else cout<<__LINE__<<" nicht fluid ..."; - //// } - //// else if(dX<=0.0 && dY>0.0 && dZ>0.0) - //// { - //// double *fWNT = tempdistributions->getStartAdressOfSortedArray(posW,posN,posT,0); - //// if(bcMatrix->isFluid(posW,posN,posT)) stresses = D3Q19System::getIncompStresses(fWNT, collFactor ); - //// else cout<<__LINE__<<" nicht fluid ..."; - //// } - //// else if(dX>0.0 && dY<=0.0 && dZ<=0.0) - //// { - //// double *fESB = tempdistributions->getStartAdressOfSortedArray(posE,posS,posB,0); - //// if(bcMatrix->isFluid(posE,posS,posB)) stresses = D3Q19System::getIncompStresses(fESB, collFactor ); - //// else cout<<__LINE__<<" nicht fluid ..."; - //// } - //// else if(dX>0.0 && dY>0.0 && dZ<=0.0) - //// { - //// double *fENB = tempdistributions->getStartAdressOfSortedArray(posE,posN,posB,0); - //// if(bcMatrix->isFluid(posE,posN,posB)) stresses = D3Q19System::getIncompStresses(fENB, collFactor ); - //// else cout<<__LINE__<<" nicht fluid ..."; - //// } - //// else if(dX>0.0 && dY<=0.0 && dZ>0.0) - //// { - //// double *fEST = tempdistributions->getStartAdressOfSortedArray(posE,posS,posT,0); - //// if(bcMatrix->isFluid(posE,posS,posT)) stresses = D3Q19System::getIncompStresses(fEST, collFactor ); - //// else cout<<__LINE__<<" nicht fluid ..."; - //// } - //// else if(dX>0.0 && dY>0.0 && dZ>0.0) - //// { - //// double *fENT = tempdistributions->getStartAdressOfSortedArray(posE,posN,posT,0); - //// if(bcMatrix->isFluid(posE,posN,posT)) stresses = D3Q19System::getIncompStresses(fENT, collFactor ); - //// else cout<<__LINE__<<" nicht fluid ..."; - //// } - //// else cout<<"punkt mit:"<<dX<<" "<<dY<<" "<<dZ<<" ist nicht bei \n"; - - //// double S11 = val<1>(stresses); - //// double S22 = val<2>(stresses); - //// double S33 = val<3>(stresses); - //// double S12 = val<4>(stresses); - //// double S13 = val<5>(stresses); - //// double S23 = val<6>(stresses); - - //// GbVector3D normal = tri->getNormal(); - //// double nx = normal.X1(); - //// double ny = normal.X2(); - //// double nz = normal.X3(); - //// double area = tri->getArea(); - - //// double Fx1 = area*(S11*nx+S12*ny+S13*nz); - //// double Fy1 = area*(S12*nx+S22*ny+S23*nz); - //// double Fz1 = area*(S13*nx+S23*ny+S33*nz); - //// forceX1 += Fx1; - //// forceX2 += Fy1; - //// forceX3 += Fz1; - ////} - return { forceX1, forceX2, forceX3 }; -} -////////////////////////////////////////////////////////////////////////// -void D3Q27TriFaceMeshInteractor::calculateForces() -{ - // FeTriFaceMesh3D* feMesh = dynamic_cast<FeTriFaceMesh3D*>(this->geoObject3D.get()); - // if(!feMesh) throw UbException(UB_EXARGS,"geoObject is not a FeTriFaceMesh3D!"); - - // if(this->stressMode == STRESSNORMAL) this->calculateStresses(); - // else if(this->stressMode == STRESSALTERNATIV) this->calculateStressesAlternativ(); - - // vector<FeTriFaceMesh3D::VertexAttributes>* attributes = feMesh->getAttributes(); - - // for (int i=0;i<(int)attributes->size() ;i++) - //{ - // FeTriFaceMesh3D::VertexAttributes& attribut = (*attributes)[i]; - // attribut.setFX(0.0); - // attribut.setFY(0.0); - // attribut.setFZ(0.0); - // attribut.setArea(0.0); - //} - // vector<GbTriFaceMesh3D::TriFace>& triangles = *feMesh->getTriangles(); - // vector<GbTriFaceMesh3D::Vertex>& nodes = *feMesh->getNodes(); - // for (size_t i=0; i<triangles.size(); i++) - //{ - // GbTriFaceMesh3D::TriFace& triangle = triangles[i]; - // FeTriFaceMesh3D::VertexAttributes& vAttribut1 = (*attributes)[triangle.v1]; - // FeTriFaceMesh3D::VertexAttributes& vAttribut2 = (*attributes)[triangle.v2]; - // FeTriFaceMesh3D::VertexAttributes& vAttribut3 = (*attributes)[triangle.v3]; - // UbTupleDouble6& stressesP1 = vAttribut1.getStresses(); - // UbTupleDouble6& stressesP2 = vAttribut2.getStresses(); - // UbTupleDouble6& stressesP3 = vAttribut3.getStresses(); - // double p1S11 = val<1>(stressesP1); double p2S11 = val<1>(stressesP2); double p3S11 = val<1>(stressesP3); - // double p1S22 = val<2>(stressesP1); double p2S22 = val<2>(stressesP2); double p3S22 = val<2>(stressesP3); - // double p1S33 = val<3>(stressesP1); double p2S33 = val<3>(stressesP2); double p3S33 = val<3>(stressesP3); - // double p1S12 = val<4>(stressesP1); double p2S12 = val<4>(stressesP2); double p3S12 = val<4>(stressesP3); - // double p1S13 = val<5>(stressesP1); double p2S13 = val<5>(stressesP2); double p3S13 = val<5>(stressesP3); - // double p1S23 = val<6>(stressesP1); double p2S23 = val<6>(stressesP2); double p3S23 = val<6>(stressesP3); - - // triangle.calculateNormal(nodes); - // double nx = triangle.nx; - // double ny = triangle.ny; - // double nz = triangle.nz; - // double area = 0.3333*triangle.getArea(nodes); - - // if(UbMath::lessEqual(area,0.0)) cout<<__FILE__<<" "<<__LINE__<<" area <= 0 "<<endl; - - // double Fx1 = - // area*(0.333*(p1S11*nx+p1S12*ny+p1S13*nz)+0.333*(p2S11*nx+p2S12*ny+p2S13*nz)+0.333*(p3S11*nx+p3S12*ny+p3S13*nz)); - // double Fx2 = Fx1; - // double Fx3 = Fx1; - - // double Fy1 = - // area*(0.333*(p1S12*nx+p1S22*ny+p1S23*nz)+0.333*(p2S12*nx+p2S22*ny+p2S23*nz)+0.333*(p3S12*nx+p3S22*ny+p3S23*nz)); - // double Fy2 = Fy1; - // double Fy3 = Fy1; - - // double Fz1 = - // area*(0.333*(p1S13*nx+p1S23*ny+p1S33*nz)+0.333*(p2S13*nx+p2S23*ny+p2S33*nz)+0.333*(p3S13*nx+p3S23*ny+p3S33*nz)); - // double Fz2 = Fz1; - // double Fz3 = Fz1; - // // cout<<Fx1<<" "<<Fy1<<" "<<Fz1<<endl; - // vAttribut1.addFX(Fx1); vAttribut2.addFX(Fx2); vAttribut3.addFX(Fx3); - // vAttribut1.addFY(Fy1); vAttribut2.addFY(Fy2); vAttribut3.addFY(Fy3); - // vAttribut1.addFZ(Fz1); vAttribut2.addFZ(Fz2); vAttribut3.addFZ(Fz3); - // vAttribut1.addArea(area); vAttribut2.addArea(area); vAttribut3.addArea(area); - //} - // for (size_t i=0; i<attributes->size(); i++) - //{ - // FeTriFaceMesh3D::VertexAttributes& attribut = (*attributes)[i]; - - // double newFX = attribut.getFX()/attribut.getArea(); - // double newFY = attribut.getFY()/attribut.getArea(); - // double newFZ = attribut.getFZ()/attribut.getArea(); - // //if(i==100) cout<<"F:"<<newFX<<" "<<newFY<<" "<<newFZ<<endl; - // //double oldFX = p->getOldFX(); - // //double oldFY = p->getOldFY(); - // //int alphaSteps = p->getFilteringSteps(); - // //double alpha = 1.0; - // //if(alphaSteps != 0) - // //{ - // // alpha = (1.0-alphaSteps*0.1); - // // // cout<<p->toString()<<" alpha:"<<alpha<<" steps:"<<alphaSteps<<endl; - // // p->reduceFilteringSteps(); - // //} - // //newFX = (1.-alpha)*oldFX+alpha*newFX; - // //newFY = (1.-alpha)*oldFY+alpha*newFY; - - // attribut.setFX(newFX); - // attribut.setFY(newFY); - // attribut.setFZ(newFZ); - // //cout<<i<<" "<<newFX<<" "<<newFY<<" "<<newFZ<<endl; - // //cout<<i<<" "<<p->toString()<<endl; - - //} -} -////////////////////////////////////////////////////////////////////////// string D3Q27TriFaceMeshInteractor::toString() { stringstream ss; @@ -1829,7 +853,7 @@ string D3Q27TriFaceMeshInteractor::toString() if (this->isTimeDependent()) ss << ", timedependent"; if (geoObject3D != NULL) - ss << ", AMR3DInteractor: " << geoObject3D->toString(); + ss << ", D3Q27TriFaceMeshInteractor: " << geoObject3D->toString(); ss << "]"; return ss.str(); @@ -1885,14 +909,14 @@ void D3Q27TriFaceMeshInteractor::reinitWithStoredQs(const real & /*timeStep*/) double x2w = qs[D3Q27System::FENDDIR + 1 + 1]; double x3w = qs[D3Q27System::FENDDIR + 1 + 2]; - // TODO: HACK GEHOERT NICHT HIERHIER!!! - start - // es handelt sich un ein statisches Objekt und beim Propeller gibt - // es Schwierigkeiten an den Flügelspitzen, dass kann daher kommen, - // dass dort zuviel bc-flaggs sind und mit Geschwindigkeit ergibt dies ziemlich grosse Werte + // TODO: HACK DOES NOT BELONG HERE!!! - begin + // it is a static object and the propeller is there + // there are difficulties at the wing tips, that can come from + // that there are too many bc flags and at speed this results in quite large values bc->setBoundaryVelocityX1(c0o1); bc->setBoundaryVelocityX2(c0o1); bc->setBoundaryVelocityX3(c0o1); - // TODO: HACK GEHOERT NICHT HIERHIER!!! - end + // TODO: HACK DOES NOT BELONG HERE!!! - end bool gotQs = false; for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) { diff --git a/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.h b/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.h index ddcac4ad22a50f31f1c1f884bc234b9bd49c6080..88c1b2004027dfd10da8418328d08145c22dff12 100644 --- a/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.h +++ b/src/cpu/core/Interactors/D3Q27TriFaceMeshInteractor.h @@ -1,3 +1,39 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file D3Q27TriFaceMeshInteractor.h +//! \ingroup Interactor +//! \author Sören Freudiger +//! \author Sebastian Geller +//! \author Ehsan Kian Far +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef D3Q19AMRTRIFACEMESHINTERACTOR_H #define D3Q19AMRTRIFACEMESHINTERACTOR_H @@ -18,26 +54,16 @@ class Block3D; class D3Q27TriFaceMeshInteractor : public D3Q27Interactor { public: - static const int STRESSNORMAL = 0; - static const int STRESSALTERNATIV = 1; - D3Q27TriFaceMeshInteractor(); D3Q27TriFaceMeshInteractor(SPtr<Grid3D> grid, std::string name = "D3Q27TriFaceMeshInteractor"); D3Q27TriFaceMeshInteractor(SPtr<GbObject3D> geoObject3D, SPtr<Grid3D> grid, int type); - D3Q27TriFaceMeshInteractor(SPtr<GbTriFaceMesh3D> triFaceMesh, SPtr<Grid3D> grid, SPtr<BC> BC, - int type); - D3Q27TriFaceMeshInteractor(SPtr<GbTriFaceMesh3D> triFaceMesh, SPtr<Grid3D> grid, SPtr<BC> BC, - int type, Interactor3D::Accuracy a); - // D3Q27TriFaceMeshInteractor(SPtr<GbTriFaceMesh3D> triFaceMesh, D3Q27BoundaryConditionAdapterPtr BC, int - // type, std::string name="D3Q27TriFaceMeshInteractor"); + D3Q27TriFaceMeshInteractor(SPtr<GbTriFaceMesh3D> triFaceMesh, SPtr<Grid3D> grid, SPtr<BC> BC, int type); + D3Q27TriFaceMeshInteractor(SPtr<GbTriFaceMesh3D> triFaceMesh, SPtr<Grid3D> grid, SPtr<BC> BC, int type, Interactor3D::Accuracy a); ~D3Q27TriFaceMeshInteractor() override; void initInteractor(const real &timeStep = 0) override; - virtual void initInteractor2(const real &timeStep = 0); - void updateInteractor(const real ×tep = 0) override; - void updateMovedGeometry(const real &timeStep = 0); void setQs(const real &timeStep); void refineBlockGridToLevel(int level, real startDistance, real stopDistance); @@ -48,73 +74,21 @@ public: ObObject *clone() { throw UbException(UB_EXARGS, "not implemented"); } - UbTupleDouble3 getForces() override; - UbTupleDouble3 getForcesTriangle(); - - void setStressMode(int stressMode) { this->stressMode = stressMode; } - void setUseHalfSpaceCheck(bool useHalfSpace) { this->useHalfSpace = useHalfSpace; } - // void setReinitWithStoredQs(bool reinitWithStoredQsFlag) { this->reinitWithStoredQsFlag = reinitWithStoredQsFlag; - // } - - void calculateForces(); - void calculateStresses(); - void calculateStressesAlternativ(); - - void calcStressesLine(UbTupleDouble6 &stresses, const real &weight, const UbTupleDouble6 &stvW, - const UbTupleDouble6 &stvE); - void calcStressesFace(UbTupleDouble6 &stresses, const real &weightX, const real &weightY, - const UbTupleDouble6 &stvSW, const UbTupleDouble6 &stvSE, const UbTupleDouble6 &stvNE, - const UbTupleDouble6 &stvNW); - void calcStressesCube(UbTupleDouble6 &stresses, const real &weightX, const real &weightY, const real &weightZ, - const UbTupleDouble6 &stvBSW, const UbTupleDouble6 &stvBSE, const UbTupleDouble6 &stvBNE, - const UbTupleDouble6 &stvBNW, const UbTupleDouble6 &stvTSW, const UbTupleDouble6 &stvTSE, - const UbTupleDouble6 &stvTNE, const UbTupleDouble6 &stvTNW); - - void calculatePressure(); - void calcPressureLine(real &p, const real &weight, const real &pW, const real &pE); - void calcPressureFace(real &p, const real &weightX, const real &weightY, const real &pSW, const real &pSE, - const real &pNE, const real &pNW); - void calcPressureCube(real &p, const real &weightX, const real &weightY, const real &weightZ, - const real &pBSW, const real &pBSE, const real &pBNE, const real &pBNW, - const real &pTSW, const real &pTSE, const real &pTNE, const real &pTNW); - - void setForceShift(real forceshift) - { - this->forceshift = forceshift; - this->forceshiftpolicy = true; - } - void setVelocityShift(real velocityshift) - { - this->velocityshift = velocityshift; - this->velocityshiftpolicy = true; - } - real getForceShift() { return this->forceshift; } - real getVelocityShift() { return this->velocityshift; } - bool getForceShiftPolicy() { return forceshiftpolicy; } - bool getVelocityShiftPolicy() { return velocityshiftpolicy; } - void clearBcNodeIndicesAndQsMap() { this->bcNodeIndicesAndQsMap.clear(); } virtual std::string toString(); protected: - int stressMode; - - double forceshift{ 0.0 }; - double velocityshift{ 0.0 }; - bool forceshiftpolicy{ false }; - bool velocityshiftpolicy{ false }; bool useHalfSpace{ true }; bool regardPIOTest{ true }; void reinitWithStoredQs(const real &timeStep); // bool reinitWithStoredQsFlag; - std::map<SPtr<Block3D>, std::map<UbTupleInt3, std::vector<float>>> - bcNodeIndicesAndQsMap; //!!! es kann sein, dass in diesem interactor - // an eine rpos eine BC gesetzt wurde, aber derselbe node in - // in einem anderen in einen anderen Typ (z.B. Solid) geaendert - // wurde --> es ist keine BC mehr an der stelle! - + std::map<SPtr<Block3D>, std::map<UbTupleInt3, std::vector<float>>> bcNodeIndicesAndQsMap; + //!!! it may be that in this interactor + // a BC was set to an rpos, but the same node in + // changed to another type (e.g. Solid) in another + // became --> there is no longer any BC in the place! enum SolidCheckMethod { ScanLine, PointInObject }; enum FLAGS { BC_FLAG, UNDEF_FLAG, FLUID_FLAG, SOLID_FLAG, OLDSOLID_FLAG }; diff --git a/src/cpu/core/LBM/B92IncompressibleNavierStokes.cpp b/src/cpu/core/LBM/B92IncompressibleNavierStokes.cpp index a06a9a15d7e580d16d9be4763d09fad594bd56b3..8a7eda39bfb448a53cc0dcd072b54e3ff66e8fd6 100644 --- a/src/cpu/core/LBM/B92IncompressibleNavierStokes.cpp +++ b/src/cpu/core/LBM/B92IncompressibleNavierStokes.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file B92IncompressibleNavierStokes.cpp +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= + #include "B92IncompressibleNavierStokes.h" #include "BCArray3D.h" #include "BCSet.h" diff --git a/src/cpu/core/LBM/B92IncompressibleNavierStokes.h b/src/cpu/core/LBM/B92IncompressibleNavierStokes.h index 90a1618bf0a69f8eb2d1fe6d0f321ba7e44c0812..5d4abc92aab94bf629f026611825f9e24daf7aec 100644 --- a/src/cpu/core/LBM/B92IncompressibleNavierStokes.h +++ b/src/cpu/core/LBM/B92IncompressibleNavierStokes.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file B92IncompressibleNavierStokes.h +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= #ifndef B92IncompressibleNavierStokes_H #define B92IncompressibleNavierStokes_H diff --git a/src/cpu/core/LBM/D3Q27System.cpp b/src/cpu/core/LBM/D3Q27System.cpp index 174c7d8e30b5604da6a5dc71acbcd7b51bf0197a..d0968610aacac40599cc44e3801fac28d940d46d 100644 --- a/src/cpu/core/LBM/D3Q27System.cpp +++ b/src/cpu/core/LBM/D3Q27System.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file D3Q27System.cpp +//! \ingroup LBM +//! \author Konstantin Kutscher, Sebastian Geller, Soeren Freudiger +//======================================================================================= #include "D3Q27System.h" #include "lbm/MacroscopicQuantities.h" @@ -8,17 +40,10 @@ namespace D3Q27System using namespace vf::basics::constant; using namespace vf::lbm::dir; -// index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 -// f: E, W, N, S, T, B, NE, SW, SE, NW, TE, BW, BE, TW, TN, BS, BN, TS, TNE TNW TSE TSW BNE BNW BSE BSW -//const int DX1[] = { 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1 }; -//const int DX2[] = { 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1 }; -//const int DX3[] = { 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1 }; - -// index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 -// f: REST, E, W, N, S, T, B, NE, SW, SE, NW, TE, BW, BE, TW, TN, BS, BN, TS, TNE TNW TSE TSW BNE BNW BSE BSW -const int DX1[] = { 0, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1 }; -const int DX2[] = { 0, 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1 }; -const int DX3[] = { 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1 }; +// index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +const int DX1[] = { 0, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1 }; +const int DX2[] = { 0, 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1 }; +const int DX3[] = { 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1 }; const real WEIGTH[] = { c8o27, c2o27, c2o27, c2o27, c2o27, c2o27, c2o27, @@ -29,13 +54,6 @@ const int INVDIR[] = { d000, iP00, iM00, i0P0, i0M0, i00P, i00M, iPP0, iMM0, iPM0, iMP0, iP0P, iM0M, iP0M, iM0P, i0PP, i0MM, i0PM, i0MP, iPPP, iMPP, iPMP, iMMP, iPPM, iMPM, iPMM, iMMM }; -// index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 -// direction: E, W, N, S, T, B, NE, SW, SE, NW, TE, BW, BE, TW, TN, BS, BN, TS, TNE TNW TSE TSW BNE BNW BSE -// BSW -//const int EX1[] = { 0, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1 }; -//const int EX2[] = { 0, 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1 }; -//const int EX3[] = { 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1 }; - ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/core/LBM/Interpolation/CompressibleOffsetMomentsInterpolator.cpp b/src/cpu/core/LBM/Interpolation/CompressibleOffsetMomentsInterpolator.cpp index e659227a0b09cb7ba214770efa9b19da33b2ee37..eb9e06c6e4cb590f4764e438f59ca397366b1be6 100644 --- a/src/cpu/core/LBM/Interpolation/CompressibleOffsetMomentsInterpolator.cpp +++ b/src/cpu/core/LBM/Interpolation/CompressibleOffsetMomentsInterpolator.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CompressibleOffsetMomentsInterpolator.cpp +//! \ingroup Interpolation +//! \author Konstantin Kutscher +//======================================================================================= + #include "CompressibleOffsetMomentsInterpolator.h" #include <algorithm> diff --git a/src/cpu/core/LBM/Interpolation/CompressibleOffsetMomentsInterpolator.h b/src/cpu/core/LBM/Interpolation/CompressibleOffsetMomentsInterpolator.h index 444170d565fc80cf735cd134f0b46ac54fc38902..56488e9a453ed63934d8078c6d33018e68f20b33 100644 --- a/src/cpu/core/LBM/Interpolation/CompressibleOffsetMomentsInterpolator.h +++ b/src/cpu/core/LBM/Interpolation/CompressibleOffsetMomentsInterpolator.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CompressibleOffsetMomentsInterpolator.h +//! \ingroup Interpolation +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef CompressibleOffsetMomentsInterpolationProcessor_H_ #define CompressibleOffsetMomentsInterpolationProcessor_H_ diff --git a/src/cpu/core/LBM/Interpolation/ICell.h b/src/cpu/core/LBM/Interpolation/ICell.h index e9b07b1eee9b5819c95203ceabe4af1afd562e7d..52e751d91a72f7ae1804705ba1240da1559911c4 100644 --- a/src/cpu/core/LBM/Interpolation/ICell.h +++ b/src/cpu/core/LBM/Interpolation/ICell.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ICell.h +//! \ingroup Interpolation +//! \author Konstantin Kutscher +//======================================================================================= #ifndef ICell_H #define ICell_H diff --git a/src/cpu/core/LBM/Interpolation/IncompressibleOffsetInterpolator.cpp b/src/cpu/core/LBM/Interpolation/IncompressibleOffsetInterpolator.cpp index 5858172934a1fd6f0e0e0de270cb9c436d0d2f17..49539eb2d83b28d93061bd319c8771140be00441 100644 --- a/src/cpu/core/LBM/Interpolation/IncompressibleOffsetInterpolator.cpp +++ b/src/cpu/core/LBM/Interpolation/IncompressibleOffsetInterpolator.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file IncompressibleOffsetInterpolator.cpp +//! \ingroup Interpolation +//! \author Konstantin Kutscher +//======================================================================================= + #include "IncompressibleOffsetInterpolator.h" #include "D3Q27System.h" diff --git a/src/cpu/core/LBM/Interpolation/IncompressibleOffsetInterpolator.h b/src/cpu/core/LBM/Interpolation/IncompressibleOffsetInterpolator.h index 1944199fd22857bd80c84cb6fcaba43ed4133827..aeac4204020edea3c7ce6f48685f841cdcd3821d 100644 --- a/src/cpu/core/LBM/Interpolation/IncompressibleOffsetInterpolator.h +++ b/src/cpu/core/LBM/Interpolation/IncompressibleOffsetInterpolator.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file IncompressibleOffsetInterpolator.h +//! \ingroup Interpolation +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef IncompressibleOffsetInterpolationProcessor_H_ #define IncompressibleOffsetInterpolationProcessor_H_ diff --git a/src/cpu/core/LBM/Interpolation/Interpolator.cpp b/src/cpu/core/LBM/Interpolation/Interpolator.cpp index 8bbd38b51b8351a93c4a544c50abc6194aed6648..cb37a27f2a2d5deb01b813ec5d71b7280cfa9aae 100644 --- a/src/cpu/core/LBM/Interpolation/Interpolator.cpp +++ b/src/cpu/core/LBM/Interpolation/Interpolator.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file Interpolator.cpp +//! \ingroup Interpolation +//! \author Konstantin Kutscher +//======================================================================================= + #include "Interpolator.h" diff --git a/src/cpu/core/LBM/Interpolation/Interpolator.h b/src/cpu/core/LBM/Interpolation/Interpolator.h index 81a0d7a363b73a01f079c412b2fd97765841d939..bb54ca3ac568a4429155f69ddc9296218b22b453 100644 --- a/src/cpu/core/LBM/Interpolation/Interpolator.h +++ b/src/cpu/core/LBM/Interpolation/Interpolator.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file Interpolator.h +//! \ingroup Interpolation +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef CPU_INTERPOLATER_H #define CPU_INTERPOLATER_H diff --git a/src/cpu/core/LBM/K15CompressibleNavierStokes.cpp b/src/cpu/core/LBM/K15CompressibleNavierStokes.cpp index efa11e6dcc099adf7986014901a0cda09d16eb7f..d2b4bd2001b060263dbc50ab6810ef9a1cc4e3fa 100644 --- a/src/cpu/core/LBM/K15CompressibleNavierStokes.cpp +++ b/src/cpu/core/LBM/K15CompressibleNavierStokes.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file K15CompressibleNavierStokes.cpp +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= #include "K15CompressibleNavierStokes.h" #include "D3Q27System.h" #include "Interpolator.h" diff --git a/src/cpu/core/LBM/K15CompressibleNavierStokes.h b/src/cpu/core/LBM/K15CompressibleNavierStokes.h index fd0b4e9e6005a844108778a7b9fdfa7dd7dded28..5c4ccaad462be1530b59182b7e6ed08cb1bf1270 100644 --- a/src/cpu/core/LBM/K15CompressibleNavierStokes.h +++ b/src/cpu/core/LBM/K15CompressibleNavierStokes.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file K15CompressibleNavierStokes.h +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= #ifndef K15CompressibleNavierStokes_h__ #define K15CompressibleNavierStokes_h__ diff --git a/src/cpu/core/LBM/K16IncompressibleNavierStokes.cpp b/src/cpu/core/LBM/K16IncompressibleNavierStokes.cpp index 3337331d1c64167401e4433b5ae44d4f02a61bce..0974f387a284cae61155fe27dc90e0e2e661df48 100644 --- a/src/cpu/core/LBM/K16IncompressibleNavierStokes.cpp +++ b/src/cpu/core/LBM/K16IncompressibleNavierStokes.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file K16IncompressibleNavierStokes.cpp +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= #include "K16IncompressibleNavierStokes.h" #include "D3Q27System.h" #include "Interpolator.h" diff --git a/src/cpu/core/LBM/K16IncompressibleNavierStokes.h b/src/cpu/core/LBM/K16IncompressibleNavierStokes.h index f7c8a1dc0329150f1847c12c2c2c52c636e46b21..1e995807e16b64da4f75ceb8962e28261e656472 100644 --- a/src/cpu/core/LBM/K16IncompressibleNavierStokes.h +++ b/src/cpu/core/LBM/K16IncompressibleNavierStokes.h @@ -1,4 +1,35 @@ -//Cascaded Cumulant LBM +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file K16IncompressibleNavierStokes.h +//! \ingroup LBM +//! \author Konstantin Kutscher +//======================================================================================= #ifndef K16IncompressibleNavierStokes_H #define K16IncompressibleNavierStokes_H diff --git a/src/cpu/core/LBM/K17CompressibleNavierStokes.cpp b/src/cpu/core/LBM/K17CompressibleNavierStokes.cpp index 6d8cfb7ec48721b20c371427221388bbac959a3b..b7bfb36e839075bcd7972acffad44a17ad142c6b 100644 --- a/src/cpu/core/LBM/K17CompressibleNavierStokes.cpp +++ b/src/cpu/core/LBM/K17CompressibleNavierStokes.cpp @@ -26,7 +26,7 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file CumulantK17LBMKernel.cpp +//! \file K17CompressibleNavierStokes.cpp //! \ingroup LBM //! \author Konstantin Kutscher, Martin Geier //======================================================================================= diff --git a/src/cpu/core/LBM/K17CompressibleNavierStokes.h b/src/cpu/core/LBM/K17CompressibleNavierStokes.h index 6c6268206b09398ab07150f3a03fd2cdeaf40e30..0ce69b414b7ebe3ecfdc5ff5f954f8cac9e2e551 100644 --- a/src/cpu/core/LBM/K17CompressibleNavierStokes.h +++ b/src/cpu/core/LBM/K17CompressibleNavierStokes.h @@ -26,7 +26,7 @@ // You should have received a copy of the GNU General Public License along // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // -//! \file CumulantK17LBMKernel.h +//! \file K17CompressibleNavierStokes.h //! \ingroup LBM //! \author Konstantin Kutscher, Martin Geier //======================================================================================= diff --git a/src/cpu/core/LBM/LBMKernel.cpp b/src/cpu/core/LBM/LBMKernel.cpp index 369bcd8c9880c6304e83056d25fc23983b16d5b7..2b6e9f126f30c7122f8e5061746e49ce8c37bf20 100644 --- a/src/cpu/core/LBM/LBMKernel.cpp +++ b/src/cpu/core/LBM/LBMKernel.cpp @@ -113,7 +113,7 @@ void LBMKernel::checkFunction(mu::Parser fct) { using namespace vf::basics::constant; - real x1 = c1o1, x2 = c1o1, x3 = c1o1, dt = c1o1, nue = c1o1, rho = c1o1; + double x1 = c1o1, x2 = c1o1, x3 = c1o1, dt = c1o1, nue = c1o1, rho = c1o1; fct.DefineVar("x1", &x1); fct.DefineVar("x2", &x2); fct.DefineVar("x3", &x3); diff --git a/src/cpu/core/Parallel/BlocksDistributor.cpp b/src/cpu/core/Parallel/BlocksDistributor.cpp deleted file mode 100644 index 718267be635c95e53d4cd1076e2cefee90fc492b..0000000000000000000000000000000000000000 --- a/src/cpu/core/Parallel/BlocksDistributor.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "BlocksDistributor.h" - -BlocksDistributor::BlocksDistributor(SPtr<Grid3D> grid, std::shared_ptr<vf::parallel::Communicator> comm) : grid(grid), comm(comm) {} diff --git a/src/cpu/core/Parallel/BlocksDistributor.h b/src/cpu/core/Parallel/BlocksDistributor.h deleted file mode 100644 index 7db87d0885f53b9651f401f9cbf9502b606efd68..0000000000000000000000000000000000000000 --- a/src/cpu/core/Parallel/BlocksDistributor.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef BlocksDistributor_H -#define BlocksDistributor_H - -#include <parallel/Communicator.h> -#include "Grid3D.h" - -#include <PointerDefinitions.h> - -class BlocksDistributor -{ -public: - BlocksDistributor(SPtr<Grid3D> grid, std::shared_ptr<vf::parallel::Communicator> comm); - ~BlocksDistributor(); - -protected: -private: - SPtr<Grid3D> grid; - std::shared_ptr<vf::parallel::Communicator> comm; -}; - -#endif diff --git a/src/cpu/core/Parallel/MPIIODataStructures.h b/src/cpu/core/Parallel/MPIIODataStructures.h index aa10500fb3acf71e74afb8f5d7a22aadccf84e53..77ffb295cbe9405a2dbc12ab80ea55909703bfde 100644 --- a/src/cpu/core/Parallel/MPIIODataStructures.h +++ b/src/cpu/core/Parallel/MPIIODataStructures.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MPIIODataStructures.h +//! \ingroup Parallel +//! \author Alena Karanchuk +//======================================================================================= + #ifndef _MPI_STRUCTURES_H_ #define _MPI_STRUCTURES_H_ diff --git a/src/cpu/core/Parallel/MetisPartitioner.cpp b/src/cpu/core/Parallel/MetisPartitioner.cpp index a2da1904ecbfda60be9139aa9ded1cb1b5efc15f..da7c4200b59034920f80e76c5d9ddfd43c9f148d 100644 --- a/src/cpu/core/Parallel/MetisPartitioner.cpp +++ b/src/cpu/core/Parallel/MetisPartitioner.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MetisPartitioner.cpp +//! \ingroup Parallel +//! \author Konstantin Kutscher +//======================================================================================= #if defined VF_METIS #include "MetisPartitioner.h" diff --git a/src/cpu/core/Parallel/MetisPartitioner.h b/src/cpu/core/Parallel/MetisPartitioner.h index 18e222760bf4a0c93db17ea6fa96a6afdf7f3313..d547e238f005e32e454c768b9f53577c8e5d5a9c 100644 --- a/src/cpu/core/Parallel/MetisPartitioner.h +++ b/src/cpu/core/Parallel/MetisPartitioner.h @@ -1,9 +1,36 @@ -/** - * @file MetisPartitioner.h - * @brief Class use METIS library for graph-based partitioning. - * @author Kostyantyn Kucher - * @date 22.09.2011 - */ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MetisPartitioner.h +//! \ingroup Parallel +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef METISPARTITIONER_H #define METISPARTITIONER_H @@ -16,6 +43,12 @@ #include <string> #include <vector> + +//! \brief Class use METIS library for graph-based partitioning. +//! \author Konstantin Kutscher +//! \date 22.09.2011 + + class MetisPartitioner { public: diff --git a/src/cpu/core/Simulation/Block3D.cpp b/src/cpu/core/Simulation/Block3D.cpp index 856924874f853b60c617c33a5d0f3c7084da762f..83fa8dc5cd61424a8746fc0be7590dff18af0f89 100644 --- a/src/cpu/core/Simulation/Block3D.cpp +++ b/src/cpu/core/Simulation/Block3D.cpp @@ -27,7 +27,7 @@ // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // //! \file Block3D.cpp -//! \ingroup Grid +//! \ingroup Simulation //! \author Konstantin Kutscher //======================================================================================= diff --git a/src/cpu/core/Simulation/Grid3D.cpp b/src/cpu/core/Simulation/Grid3D.cpp index 8985fc1d450c3e30b3d9b311534883f2274dc66c..b9fff7b7732e77ac8ca61cea3a3b1f4a63407e5a 100644 --- a/src/cpu/core/Simulation/Grid3D.cpp +++ b/src/cpu/core/Simulation/Grid3D.cpp @@ -27,7 +27,7 @@ // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // //! \file Grid.cpp -//! \ingroup Grid +//! \ingroup Simulation //! \author Konstantin Kutscher //======================================================================================= @@ -484,7 +484,7 @@ UbTupleDouble3 Grid3D::getBlockLengths(const SPtr<Block3D> block) const } ////////////////////////////////////////////////////////////////////////// using namespace vf::basics::constant; -UbTupleDouble6 Grid3D::getBlockOversize() const { return makeUbTuple(c0o1, c0o1, c0o1, c0o1, c0o1, c0o1); } +UbTupleDouble6 Grid3D::getBlockOversize() const { return makeUbTuple(0., 0., 0., 0., 0., 0.); } ////////////////////////////////////////////////////////////////////////// void Grid3D::setCoordinateTransformator(SPtr<CoordinateTransformation3D> trafo) { this->trafo = trafo; } ////////////////////////////////////////////////////////////////////////// @@ -504,8 +504,8 @@ real Grid3D::getDeltaX(SPtr<Block3D> block) const { return getDeltaX(block->getL ////////////////////////////////////////////////////////////////////////// UbTupleDouble3 Grid3D::getNodeOffset(SPtr<Block3D> block) const { - real delta = this->getDeltaX(block); - return makeUbTuple(offset * delta, offset * delta, offset * delta); + double delta = (double)this->getDeltaX(block); + return makeUbTuple((double)offset * delta, (double)offset * delta, (double)offset * delta); } //////////////////////////////////////////////////////////////////////////// Vector3D Grid3D::getNodeCoordinates(SPtr<Block3D> block, int ix1, int ix2, int ix3) const diff --git a/src/cpu/core/Simulation/Simulation.cpp b/src/cpu/core/Simulation/Simulation.cpp index c4766c8cfd0865880fa2df2a76e9a28036915dea..3550be7be2bd50b0fb0d24b8ade4e3aa3e749c43 100644 --- a/src/cpu/core/Simulation/Simulation.cpp +++ b/src/cpu/core/Simulation/Simulation.cpp @@ -27,7 +27,7 @@ // with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. // //! \file Simulation.cpp -//! \ingroup Grid +//! \ingroup Simulation //! \author Konstantin Kutscher //======================================================================================= diff --git a/src/cpu/core/SimulationObservers/AdjustForcingSimulationObserver.cpp b/src/cpu/core/SimulationObservers/AdjustForcingSimulationObserver.cpp index d062f8395ed5d3c26867ef2fc0c1bac1e5f7e7f3..14bdf94d70a3c8659d05d5ffc046a14a4546b8fa 100644 --- a/src/cpu/core/SimulationObservers/AdjustForcingSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/AdjustForcingSimulationObserver.cpp @@ -1,7 +1,35 @@ -/* - * D3Q27AdjustForcingSimulationObserver.cpp - * Author: Konstantin Kutscher - */ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file AdjustForcingSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "AdjustForcingSimulationObserver.h" #include <fstream> diff --git a/src/cpu/core/SimulationObservers/AdjustForcingSimulationObserver.h b/src/cpu/core/SimulationObservers/AdjustForcingSimulationObserver.h index 13f88c71162efcca53b913891955b6216b3c943f..058cdbdf6f8e8d735c1b8ccf93c5b944a42af8d7 100644 --- a/src/cpu/core/SimulationObservers/AdjustForcingSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/AdjustForcingSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file AdjustForcingSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef D3Q27ADJUSTFORCINGSimulationObserver_H #define D3Q27ADJUSTFORCINGSimulationObserver_H diff --git a/src/cpu/core/SimulationObservers/AverageValuesSimulationObserver.cpp b/src/cpu/core/SimulationObservers/AverageValuesSimulationObserver.cpp index f0e2d84af4fa33ae7fc2145a1a94a130eaa1136e..718dd511cae0da7e79b0fb6e33c4ec4d0719f42f 100644 --- a/src/cpu/core/SimulationObservers/AverageValuesSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/AverageValuesSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file AverageValuesSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "AverageValuesSimulationObserver.h" #include "BCSet.h" diff --git a/src/cpu/core/SimulationObservers/AverageValuesSimulationObserver.h b/src/cpu/core/SimulationObservers/AverageValuesSimulationObserver.h index b5ce823ba3cedffd145d0d513c5acf715a631430..62fd57b5faa5fdf6ace6cf9de7c55b6990e3c777 100644 --- a/src/cpu/core/SimulationObservers/AverageValuesSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/AverageValuesSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file AverageValuesSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef AverageValuesSimulationObserver_H #define AverageValuesSimulationObserver_H @@ -53,7 +85,7 @@ private: std::vector<UbTupleFloat3> nodes; std::vector<UbTupleUInt8> cells; std::vector<std::string> datanames; - std::vector<std::vector<real>> data; + std::vector<std::vector<double>> data; std::vector<std::vector<SPtr<Block3D>>> blockVector; int minInitLevel; // min init level int maxInitLevel; diff --git a/src/cpu/core/SimulationObservers/CalculateForcesSimulationObserver.cpp b/src/cpu/core/SimulationObservers/CalculateForcesSimulationObserver.cpp index 5ee3e47bf6e2a9cae5d8e322f5e713252f25ed84..793b3da8e1b41f4d98e2de339231424087b7179e 100644 --- a/src/cpu/core/SimulationObservers/CalculateForcesSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/CalculateForcesSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CalculateForcesSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "CalculateForcesSimulationObserver.h" #include "BCSet.h" @@ -195,10 +227,12 @@ UbTupleDouble3 CalculateForcesSimulationObserver::getForces(int x1, int x2, int if (bc) { // references to tuple "force" - real &forceX1 = val<1>(force); - real &forceX2 = val<2>(force); - real &forceX3 = val<3>(force); - real f, fnbr; + double &forceX1 = val<1>(force); + double &forceX2 = val<2>(force); + double &forceX3 = val<3>(force); + double f, fnbr; + + dynamicPointerCast<EsoTwist3D>(distributions)->swap(); for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) { if (bc->hasNoSlipBoundaryFlag(fdir)) { @@ -214,6 +248,7 @@ UbTupleDouble3 CalculateForcesSimulationObserver::getForces(int x1, int x2, int forceX3 += (f + fnbr) * D3Q27System::DX3[invDir]; } } + dynamicPointerCast<EsoTwist3D>(distributions)->swap(); } return force; diff --git a/src/cpu/core/SimulationObservers/CalculateForcesSimulationObserver.h b/src/cpu/core/SimulationObservers/CalculateForcesSimulationObserver.h index e1d376f4c6938b3874cd2a0eebedae294bd502b1..1f3ec3ea621edeccc42127d2c85d0443ccd46ede 100644 --- a/src/cpu/core/SimulationObservers/CalculateForcesSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/CalculateForcesSimulationObserver.h @@ -1,10 +1,35 @@ -/* - * D3Q27ForcesSimulationObserver.h - * - * Created on: 29.09.2012 - * Author: K. Kucher - */ - +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CalculateForcesSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef D3Q27ForcesSimulationObserver_H #define D3Q27ForcesSimulationObserver_H diff --git a/src/cpu/core/SimulationObservers/DecreaseViscositySimulationObserver.cpp b/src/cpu/core/SimulationObservers/DecreaseViscositySimulationObserver.cpp index ffbfde51ce2d8100cc845364e31038180892f800..0bf1c428363a1884f216dbeacaebc958ebcb4c85 100644 --- a/src/cpu/core/SimulationObservers/DecreaseViscositySimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/DecreaseViscositySimulationObserver.cpp @@ -1,9 +1,36 @@ -/* - * DecreaseViscositySimulationObserver - * - * Created on: 10.05.2013 - * Author: uphoff - */ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file DecreaseViscositySimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Sonja Uphoff +//======================================================================================= + #include "DecreaseViscositySimulationObserver.h" diff --git a/src/cpu/core/SimulationObservers/DecreaseViscositySimulationObserver.h b/src/cpu/core/SimulationObservers/DecreaseViscositySimulationObserver.h index 741b65783c2634d45f6d012f67e1f42283b22d9c..7e439055005a7df4ba9c7012f7ff74a3a80e4e6e 100644 --- a/src/cpu/core/SimulationObservers/DecreaseViscositySimulationObserver.h +++ b/src/cpu/core/SimulationObservers/DecreaseViscositySimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file DecreaseViscositySimulationObserver.h +//! \ingroup SimulationObservers +//! \author Sonja Uphoff +//======================================================================================= #ifndef DecreaseViscositySimulationObserver_H #define DecreaseViscositySimulationObserver_H diff --git a/src/cpu/core/SimulationObservers/EmergencyExitSimulationObserver.cpp b/src/cpu/core/SimulationObservers/EmergencyExitSimulationObserver.cpp index ea6287ff358bce160791c7ab16568a9cc4a989bb..4d1265fcbb6ab0a0c70d19efc3a8eb15814e42f8 100644 --- a/src/cpu/core/SimulationObservers/EmergencyExitSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/EmergencyExitSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file EmergencyExitSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "EmergencyExitSimulationObserver.h" #include <parallel/Communicator.h> #include "Grid3D.h" diff --git a/src/cpu/core/SimulationObservers/EmergencyExitSimulationObserver.h b/src/cpu/core/SimulationObservers/EmergencyExitSimulationObserver.h index f2757d8ed842f14d77b16b7d1aa2821e5a8b8d72..d99461f5870dc9eec14c29fbb65054cd0199efec 100644 --- a/src/cpu/core/SimulationObservers/EmergencyExitSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/EmergencyExitSimulationObserver.h @@ -1,9 +1,35 @@ -/* - * EmergencyExitSimulationObserver.h - * - * Created on: 05.10.2012 - * Author: K. Kucher - */ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file EmergencyExitSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef EmergencyExitSimulationObserver_H #define EmergencyExitSimulationObserver_H diff --git a/src/cpu/core/SimulationObservers/ForceCalculator.cpp b/src/cpu/core/SimulationObservers/ForceCalculator.cpp index 6b57cf6f99c66e219d619ada02d9f0e299a088ee..39fb30022c917ed6f8ade6aefa89a133d74e56a9 100644 --- a/src/cpu/core/SimulationObservers/ForceCalculator.cpp +++ b/src/cpu/core/SimulationObservers/ForceCalculator.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ForceCalculator.h +//! \ingroup SimulationObservers +//! \author Sören Peters +//======================================================================================= #include "ForceCalculator.h" #include "BCSet.h" diff --git a/src/cpu/core/SimulationObservers/ForceCalculator.h b/src/cpu/core/SimulationObservers/ForceCalculator.h index 6f7266d8e49a0f1e9cce4192712b37f1306ff5e0..0109f772687f9e4a3ee307ffd3771e8dc9f14cc7 100644 --- a/src/cpu/core/SimulationObservers/ForceCalculator.h +++ b/src/cpu/core/SimulationObservers/ForceCalculator.h @@ -1,9 +1,36 @@ -/* - * ForceCalculator.h - * - * Created on: 25.10.2017 - * Author: S. Peters - */ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ForceCalculator.h +//! \ingroup SimulationObservers +//! \author Sören Peters +//======================================================================================= + #include "lbm/constants/D3Q27.h" #ifndef ForceCalculator_H diff --git a/src/cpu/core/SimulationObservers/InSituCatalystSimulationObserver.cpp b/src/cpu/core/SimulationObservers/InSituCatalystSimulationObserver.cpp index 07040524541aa8168cd186c98d7a7882be1a332a..bd03c24c37f0bff89efc8ec3ae25084dbb89afc6 100644 --- a/src/cpu/core/SimulationObservers/InSituCatalystSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/InSituCatalystSimulationObserver.cpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file InSituCatalystSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= + #ifdef VF_CATALYST #include "InSituCatalystSimulationObserver.h" diff --git a/src/cpu/core/SimulationObservers/InSituCatalystSimulationObserver.h b/src/cpu/core/SimulationObservers/InSituCatalystSimulationObserver.h index f81fe767a448a75f04d8cf965b33a14cdf36b2b4..b1832fd5798cf76053e84d6be1060237286e46f2 100644 --- a/src/cpu/core/SimulationObservers/InSituCatalystSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/InSituCatalystSimulationObserver.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file InSituCatalystSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= + #ifdef VF_CATALYST #ifndef InSituCatalystSimulationObserver_h__ diff --git a/src/cpu/core/SimulationObservers/InSituVTKSimulationObserver.cpp b/src/cpu/core/SimulationObservers/InSituVTKSimulationObserver.cpp index 6728a96f1eccc0cf4a7eaf51e8b8baf53e1b4528..36086cf0f67989696d55becd27eb04b06eb05a31 100644 --- a/src/cpu/core/SimulationObservers/InSituVTKSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/InSituVTKSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file InSituVTKSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifdef VF_VTK #include "InSituVTKSimulationObserver.h" diff --git a/src/cpu/core/SimulationObservers/InSituVTKSimulationObserver.h b/src/cpu/core/SimulationObservers/InSituVTKSimulationObserver.h index 1171c54252fa315d1e9e84caed34d2596b9520c2..1607e3a7a37a205f35a13c483663ab5c0e144a35 100644 --- a/src/cpu/core/SimulationObservers/InSituVTKSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/InSituVTKSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file InSituVTKSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifdef VF_VTK #ifndef InSituVTKSimulationObserver_h__ diff --git a/src/cpu/core/SimulationObservers/IntegrateValuesHelper.cpp b/src/cpu/core/SimulationObservers/IntegrateValuesHelper.cpp index 76c4a5aa570b0badd4e050e4938d728521f14f71..94f61929fd749f7bd6934bd795d7e67beb0d8ff1 100644 --- a/src/cpu/core/SimulationObservers/IntegrateValuesHelper.cpp +++ b/src/cpu/core/SimulationObservers/IntegrateValuesHelper.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file IntegrateValuesHelper.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "IntegrateValuesHelper.h" #include <geometry3d/CoordinateTransformation3D.h> diff --git a/src/cpu/core/SimulationObservers/IntegrateValuesHelper.h b/src/cpu/core/SimulationObservers/IntegrateValuesHelper.h index a5cfc4aa67fa1759d2bf73b8bea5592633825d77..470420d09e96f8fb75946664abe9fe8b9c0faa9a 100644 --- a/src/cpu/core/SimulationObservers/IntegrateValuesHelper.h +++ b/src/cpu/core/SimulationObservers/IntegrateValuesHelper.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file IntegrateValuesHelper.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef INTEGRATEVALUESHELPER_H #define INTEGRATEVALUESHELPER_H diff --git a/src/cpu/core/SimulationObservers/LineTimeSeriesSimulationObserver.cpp b/src/cpu/core/SimulationObservers/LineTimeSeriesSimulationObserver.cpp index 091044960b2513bf25f63a23086153d8e98dbfb4..8af7d93c4df1318b05f56214765f4dc34b06ad91 100644 --- a/src/cpu/core/SimulationObservers/LineTimeSeriesSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/LineTimeSeriesSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file LineTimeSeriesSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "LineTimeSeriesSimulationObserver.h" #include "BCSet.h" #include "WbWriterVtkXmlASCII.h" diff --git a/src/cpu/core/SimulationObservers/LineTimeSeriesSimulationObserver.h b/src/cpu/core/SimulationObservers/LineTimeSeriesSimulationObserver.h index db4fea82f2aecfd87a4c90cdea36cc310b73aabe..b2d0f1df808a25960771e2ee48261fdbdd3556b3 100644 --- a/src/cpu/core/SimulationObservers/LineTimeSeriesSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/LineTimeSeriesSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file LineTimeSeriesSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef LineTimeSeriesSimulationObserver_h__ #define LineTimeSeriesSimulationObserver_h__ diff --git a/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp b/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp index a754674685ccf47c2e7bb88d6aed6564a334d5f0..a8969b1baec26b14e67e197fa867a6aaeffe09f6 100644 --- a/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MPIIOMigrationBESimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Alena Karanchuk +//======================================================================================= #include "MPIIOMigrationBESimulationObserver.h" #include "BCArray3D.h" #include "BCSet.h" diff --git a/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.h b/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.h index cec360a7300e07909c0b5b6bc14a7969f8686264..0ee552664061b2fa4c0f2d11bc65cbee8b86b688 100644 --- a/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.h +++ b/src/cpu/core/SimulationObservers/MPIIOMigrationBESimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MPIWriteBlocksBESimulationObserver.h +//! \ingroup SimulationObservers +//! \author Alena Karanchuk +//======================================================================================= #ifndef _MPIIOMigrationBESimulationObserver_H_ #define _MPIIOMigrationBESimulationObserver_H_ diff --git a/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.cpp b/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.cpp index 5d2d6864a85bc7d08ed9dd20f1399265ea5cc6b2..3fb5d78793009988203e87f6c89b51767595e9a4 100644 --- a/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MPIIOMigrationSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Alena Karanchuk +//======================================================================================= #include "MPIIOMigrationSimulationObserver.h" #include "BCArray3D.h" #include "BCSet.h" diff --git a/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.h b/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.h index 4e7d1ba44644cef527a623ea8b94cb28ac9474ac..a8f4aa86cc227da8d36943a1f98db6dc0a0f64f0 100644 --- a/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/MPIIOMigrationSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MPIIOMigrationSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Alena Karanchuk +//======================================================================================= #ifndef _MPIIOMigrationSimulationObserver_H_ #define _MPIIOMigrationSimulationObserver_H_ diff --git a/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.cpp b/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.cpp index e0e65a3ba3d095e4b6b0a312325753cc579610dd..e47b86e222c0f6629a645505ddc3df6bed0f5af1 100644 --- a/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MPIIORestartSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Alena Karanchuk +//======================================================================================= #include "MPIIORestartSimulationObserver.h" #include "BCArray3D.h" #include "BCSet.h" diff --git a/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.h b/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.h index d07bf6b77b8a4f56da0d4a6c88139f4d01bca104..3e71fbf220eaa6341acb9f60ae5182912f48cdb5 100644 --- a/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/MPIIORestartSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MPIIORestartSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Alena Karanchuk +//======================================================================================= #ifndef _MPIIORestartSimulationObserver_H_ #define _MPIIORestartSimulationObserver_H_ diff --git a/src/cpu/core/SimulationObservers/MPIIOSimulationObserver.cpp b/src/cpu/core/SimulationObservers/MPIIOSimulationObserver.cpp index 644a420531fed62b9da51effe0293fd4c21ef0f4..604da7b0edf55887eabb1a5d9e83a4d3a3051c3a 100644 --- a/src/cpu/core/SimulationObservers/MPIIOSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/MPIIOSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MPIIOSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Alena Karanchuk +//======================================================================================= #include "MPIIOSimulationObserver.h" #include "Block3D.h" #include <parallel/Communicator.h> diff --git a/src/cpu/core/SimulationObservers/MPIIOSimulationObserver.h b/src/cpu/core/SimulationObservers/MPIIOSimulationObserver.h index 9ecaf89a74d2f42db7d35349b27389f0f1cfc796..218dcd687d8ffeaa6acb67f015e895e51758e91d 100644 --- a/src/cpu/core/SimulationObservers/MPIIOSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/MPIIOSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MPIIOSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Alena Karanchuk +//======================================================================================= #ifndef _MPIIOSimulationObserver_H_ #define _MPIIOSimulationObserver_H_ diff --git a/src/cpu/core/SimulationObservers/MicrophoneArraySimulationObserver.cpp b/src/cpu/core/SimulationObservers/MicrophoneArraySimulationObserver.cpp index 5575cc53e8d40f9a322d3912a8346403b04e75f3..323728ddec59a7bc66f585acc2135197101f6126 100644 --- a/src/cpu/core/SimulationObservers/MicrophoneArraySimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/MicrophoneArraySimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MicrophoneArraySimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "MicrophoneArraySimulationObserver.h" #include "BCArray3D.h" #include "BCSet.h" diff --git a/src/cpu/core/SimulationObservers/MicrophoneArraySimulationObserver.h b/src/cpu/core/SimulationObservers/MicrophoneArraySimulationObserver.h index f95b435ba8b784c9e7d25ac80399239460144c9b..7495f4dff9521e668ac6a9d99274498ca79d2177 100644 --- a/src/cpu/core/SimulationObservers/MicrophoneArraySimulationObserver.h +++ b/src/cpu/core/SimulationObservers/MicrophoneArraySimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MicrophoneArraySimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef MicrophoneArraySimulationObserver_h__ #define MicrophoneArraySimulationObserver_h__ diff --git a/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.cpp b/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.cpp index 9fd7a3bef5375969d7f79da0b5d8478d369eb241..37357f48cb3573b88941336f722497a0d182d1a5 100644 --- a/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/NUPSCounterSimulationObserver.cpp @@ -33,10 +33,15 @@ #include "NUPSCounterSimulationObserver.h" -#include <parallel/Communicator.h> +#include "parallel/Communicator.h" +#include "logger/Logger.h" #include "Grid3D.h" #include "UbScheduler.h" +#ifdef _OPENMP +#include <omp.h> +#endif + NUPSCounterSimulationObserver::NUPSCounterSimulationObserver(SPtr<Grid3D> grid, SPtr<UbScheduler> s, int numOfThreads, std::shared_ptr<vf::parallel::Communicator> comm) : SimulationObserver(grid, s), numOfThreads(numOfThreads), nup(0), nup_t(0), nupsStep(0.0), comm(comm) @@ -71,15 +76,16 @@ void NUPSCounterSimulationObserver::collectData(real step) { if (comm->getProcessID() == comm->getRoot()) { timer.end(); - double time = timer.getCurrentRuntimeInSeconds(); - double nups_t = nup_t * (step - nupsStep) / time; - double nups = nup * (step - nupsStep) / time; - double tnups = nups / (double)numOfThreads; - UBLOG(logINFO, "Calculation step = " << step); - UBLOG(logINFO, "Total performance = " << nups_t << " NUPS"); - UBLOG(logINFO, "Performance per update = " << nups << " NUPS"); - UBLOG(logINFO, "Performance per thread = " << tnups << " NUPS"); - UBLOG(logINFO, "Time for " << step - nupsStep << " steps = " << time << " s"); + real time = timer.getCurrentRuntimeInSeconds(); + real nups_t = nup_t * (step - nupsStep) / time; + real nups = nup * (step - nupsStep) / time; + real tnups = nups / numOfThreads; + VF_LOG_INFO("Calculation step = {}", step); + VF_LOG_INFO("Number of threads = {}", numOfThreads); + VF_LOG_INFO("Total performance = {:03.2e} NUPS", nups_t); + VF_LOG_INFO("Performance per process = {:03.2e} NUPS", nups); + VF_LOG_INFO("Performance per thread = {:03.2e} NUPS", tnups); + VF_LOG_INFO("Time for {} steps = {} s", step - nupsStep, time ); nupsStep = step; timer.start(); } diff --git a/src/cpu/core/SimulationObservers/PressureCoefficientSimulationObserver.cpp b/src/cpu/core/SimulationObservers/PressureCoefficientSimulationObserver.cpp index d82a51e175075ad211ac6d6c187b707e605cb7fe..fd5ce59c3f24ee241efff67c051acad4b41d5818 100644 --- a/src/cpu/core/SimulationObservers/PressureCoefficientSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/PressureCoefficientSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file PressureCoefficientSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "PressureCoefficientSimulationObserver.h" #include <WbWriterVtkXmlASCII.h> diff --git a/src/cpu/core/SimulationObservers/PressureCoefficientSimulationObserver.h b/src/cpu/core/SimulationObservers/PressureCoefficientSimulationObserver.h index 16e14af6420c5b1f634bb3f7988ba9c3f8595881..3f713f9a49a3fbe4ce02b7b3729e20c86ea4e9fe 100644 --- a/src/cpu/core/SimulationObservers/PressureCoefficientSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/PressureCoefficientSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file PressureCoefficientSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef PressureCoefficientSimulationObserver_h__ #define PressureCoefficientSimulationObserver_h__ @@ -42,7 +74,7 @@ private: std::vector<UbTupleFloat3> nodes; std::vector<std::string> datanames; - std::vector<std::vector<real>> data; + std::vector<std::vector<double>> data; std::vector<real> outValues; diff --git a/src/cpu/core/SimulationObservers/PressureDifferenceSimulationObserver.cpp b/src/cpu/core/SimulationObservers/PressureDifferenceSimulationObserver.cpp index 3576349e3ac9b9f421c4dbf7476a5869a0fb9930..995ca211d074846952fbefce86d960a93de1bfbb 100644 --- a/src/cpu/core/SimulationObservers/PressureDifferenceSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/PressureDifferenceSimulationObserver.cpp @@ -1,9 +1,35 @@ -/* - * D3Q27RhoSimulationObserver.cpp - * - * Created on: 28.12.2010 - * Author: kucher - */ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file PressureDifferenceSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "PressureDifferenceSimulationObserver.h" diff --git a/src/cpu/core/SimulationObservers/PressureDifferenceSimulationObserver.h b/src/cpu/core/SimulationObservers/PressureDifferenceSimulationObserver.h index df9d5364bf68921ebf1c567f0cdfd4c4ed76a92a..abf75694243cda8e295924af7b1bb8cd1870d474 100644 --- a/src/cpu/core/SimulationObservers/PressureDifferenceSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/PressureDifferenceSimulationObserver.h @@ -1,9 +1,35 @@ -/* - * D3Q27PressureDifferenceSimulationObserver.h - * - * Created on: 28.12.2010 - * Author: kucher - */ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file PressureDifferenceSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef D3Q27PRESSUREDIFFERENCESimulationObserver_H #define D3Q27PRESSUREDIFFERENCESimulationObserver_H diff --git a/src/cpu/core/SimulationObservers/QCriterionSimulationObserver.cpp b/src/cpu/core/SimulationObservers/QCriterionSimulationObserver.cpp index e6689b697cfef95636f882018d5bf9e81a6d9309..755c92021c114e7172d609e3dd8d5825a099ee2e 100644 --- a/src/cpu/core/SimulationObservers/QCriterionSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/QCriterionSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file QCriterionSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Sonja Uphoff +//======================================================================================= #include "QCriterionSimulationObserver.h" #include "BCSet.h" #include "Block3D.h" diff --git a/src/cpu/core/SimulationObservers/QCriterionSimulationObserver.h b/src/cpu/core/SimulationObservers/QCriterionSimulationObserver.h index 806829092ff3b0ff8fb77b5d50264c6a11d527c3..803c025de6be83579dd2f3ed1d5d64e1408c7af0 100644 --- a/src/cpu/core/SimulationObservers/QCriterionSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/QCriterionSimulationObserver.h @@ -1,6 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// //! \file QCriterionSimulationObserver.h -//! \brief Created on: 25.08.2013 -//! \author: Sonja Uphoff +//! \ingroup SimulationObservers +//! \author Sonja Uphoff +//======================================================================================= #ifndef QCriterionSimulationObserver_H #define QCriterionSimulationObserver_H @@ -51,7 +80,7 @@ private: std::vector<UbTupleFloat3> nodes; std::vector<UbTupleUInt8> cells; std::vector<std::string> datanames; // only one entry for QKrit-SimulationObserver: Q - std::vector<std::vector<real>> data; + std::vector<std::vector<double>> data; std::vector<std::vector<SPtr<Block3D>>> blockVector; int minInitLevel; // go through all levels for block vector of current process from minInitLevel to maxInitLevel int maxInitLevel; diff --git a/src/cpu/core/SimulationObservers/ShearStressSimulationObserver.cpp b/src/cpu/core/SimulationObservers/ShearStressSimulationObserver.cpp index 416ffeaa0359480450d4f3e11e05f0baf2f65398..7993dc86c299775f1bbf422a6aaf1b594a4f6046 100644 --- a/src/cpu/core/SimulationObservers/ShearStressSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/ShearStressSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ShearStressSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher, S. Uphoff, M. Geier, E. Goraki Fard +//======================================================================================= #include "ShearStressSimulationObserver.h" #include "BCSet.h" #include "WbWriterVtkXmlASCII.h" diff --git a/src/cpu/core/SimulationObservers/ShearStressSimulationObserver.h b/src/cpu/core/SimulationObservers/ShearStressSimulationObserver.h index 66a76356d5a1fe8d7b096e3db0e1452dca8d613f..ea5a7af32ee4f091b690cb6edb5eb46ce0a612fa 100644 --- a/src/cpu/core/SimulationObservers/ShearStressSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/ShearStressSimulationObserver.h @@ -1,5 +1,37 @@ -#ifndef D3Q27ShearStressSimulationObserver_H -#define D3Q27ShearStressSimulationObserver_H +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ShearStressSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher, S. Uphoff, M. Geier, E. Goraki Fard +//======================================================================================= +#ifndef ShearStressSimulationObserver_H +#define ShearStressSimulationObserver_H #include <PointerDefinitions.h> #include <string> @@ -54,7 +86,7 @@ protected: private: std::vector<UbTupleFloat3> nodes; std::vector<std::string> datanames; - std::vector<std::vector<real>> data; + std::vector<std::vector<double>> data; std::string path; std::vector<SPtr<D3Q27Interactor>> interactors; std::vector<real> normals; diff --git a/src/cpu/core/SimulationObservers/TimeAveragedValuesSimulationObserver.cpp b/src/cpu/core/SimulationObservers/TimeAveragedValuesSimulationObserver.cpp index 5161e887b63c8c0b1ed945839a00f25b2fb5d070..0fc338c2c4e0871884c0dc685d50e688c13b40e5 100644 --- a/src/cpu/core/SimulationObservers/TimeAveragedValuesSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/TimeAveragedValuesSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file TimeAveragedValuesSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "TimeAveragedValuesSimulationObserver.h" #include "BCSet.h" diff --git a/src/cpu/core/SimulationObservers/TimeAveragedValuesSimulationObserver.h b/src/cpu/core/SimulationObservers/TimeAveragedValuesSimulationObserver.h index a9f78137b8452f476dc37f8dfac711c9a414e889..771d0dd920564917469989f862c43292e57ff4e1 100644 --- a/src/cpu/core/SimulationObservers/TimeAveragedValuesSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/TimeAveragedValuesSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file TimeAveragedValuesSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef TimeAveragedValuesSimulationObserver_H #define TimeAveragedValuesSimulationObserver_H @@ -74,7 +106,7 @@ private: std::vector<UbTupleFloat3> nodes; std::vector<UbTupleUInt8> cells; std::vector<std::string> datanames; - std::vector<std::vector<real>> data; + std::vector<std::vector<double>> data; std::vector<std::vector<SPtr<Block3D>>> blockVector; bool root; int minInitLevel; // min init level diff --git a/src/cpu/core/SimulationObservers/TimeDependentBCSimulationObserver.cpp b/src/cpu/core/SimulationObservers/TimeDependentBCSimulationObserver.cpp index cedf228b665fff58a777f01aee8832c0e8e1cec4..bdb05ae322e3d73ac8d8c4e4ccc627a2dcd4397f 100644 --- a/src/cpu/core/SimulationObservers/TimeDependentBCSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/TimeDependentBCSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file TimeDependentBCSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "TimeDependentBCSimulationObserver.h" #include "Grid3D.h" diff --git a/src/cpu/core/SimulationObservers/TimeDependentBCSimulationObserver.h b/src/cpu/core/SimulationObservers/TimeDependentBCSimulationObserver.h index 0c72054f2feadcaa6cf9792453d1e3389e7213bb..c8ba0a182ec9c77d9f6ec19571bd6b4156c35528 100644 --- a/src/cpu/core/SimulationObservers/TimeDependentBCSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/TimeDependentBCSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file TimeDependentBCSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef TimeDependentBCSimulationObserver_H #define TimeDependentBCSimulationObserver_H diff --git a/src/cpu/core/SimulationObservers/TimeseriesSimulationObserver.cpp b/src/cpu/core/SimulationObservers/TimeseriesSimulationObserver.cpp index 5245c51d9cb8b01324388d5cbfc61db5dc5ce5a1..f049dbee1a2470ef52f1dc79f339dd1fcea05e28 100644 --- a/src/cpu/core/SimulationObservers/TimeseriesSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/TimeseriesSimulationObserver.cpp @@ -1,9 +1,35 @@ -/* - * TimeseriesWriterSimulationObserver.h - * - * Created on: 08.05.2013 - * Author: uphoff - */ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file TimeseriesSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Sonja Uphoff +//======================================================================================= #include "TimeseriesSimulationObserver.h" diff --git a/src/cpu/core/SimulationObservers/TimeseriesSimulationObserver.h b/src/cpu/core/SimulationObservers/TimeseriesSimulationObserver.h index d467b2301688d716ffb0b879fd8d0fab7353b077..223d195537b0b0228c2f1f3d9b18102eb2c50a10 100644 --- a/src/cpu/core/SimulationObservers/TimeseriesSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/TimeseriesSimulationObserver.h @@ -1,9 +1,36 @@ -/* - * TimeseriesSimulationObserver.h - * - * Created on: 08.05.2013 - * Author: uphoff - */ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file TimeseriesSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Sonja Uphoff +//======================================================================================= + #ifndef TimeseriesSimulationObserver_H #define TimeseriesSimulationObserver_H diff --git a/src/cpu/core/SimulationObservers/TurbulenceIntensitySimulationObserver.cpp b/src/cpu/core/SimulationObservers/TurbulenceIntensitySimulationObserver.cpp index 424c3411f05400597c1722df793153354ba874b7..10e0963c815afff221bf7405d893cd338e80f477 100644 --- a/src/cpu/core/SimulationObservers/TurbulenceIntensitySimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/TurbulenceIntensitySimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file TurbulenceIntensitySimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "TurbulenceIntensitySimulationObserver.h" #include "BCArray3D.h" diff --git a/src/cpu/core/SimulationObservers/TurbulenceIntensitySimulationObserver.h b/src/cpu/core/SimulationObservers/TurbulenceIntensitySimulationObserver.h index cffaf49ede459093bae2e0709da27a244f74ad5a..20fca1fe7ab7ad768fc9be4b109b41441671c8a3 100644 --- a/src/cpu/core/SimulationObservers/TurbulenceIntensitySimulationObserver.h +++ b/src/cpu/core/SimulationObservers/TurbulenceIntensitySimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file TurbulenceIntensitySimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef TurbulenceIntensitySimulationObserver_H #define TurbulenceIntensitySimulationObserver_H @@ -32,7 +64,7 @@ private: std::vector<UbTupleFloat3> nodes; std::vector<UbTupleUInt8> cells; std::vector<std::string> datanames; - std::vector<std::vector<real>> data; + std::vector<std::vector<double>> data; std::vector<std::vector<SPtr<Block3D>>> blockVector; int minInitLevel; int maxInitLevel; diff --git a/src/cpu/core/SimulationObservers/WriteBlocksSimulationObserver.cpp b/src/cpu/core/SimulationObservers/WriteBlocksSimulationObserver.cpp index 45ea8b5714775bca42b23dc14d96fa764129d962..8a215e5c4a0e079939e706fa17e54d1bc123386d 100644 --- a/src/cpu/core/SimulationObservers/WriteBlocksSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/WriteBlocksSimulationObserver.cpp @@ -76,7 +76,7 @@ void WriteBlocksSimulationObserver::collectData(real step) celldatanames.push_back("bundle"); #endif - std::vector<std::vector<real>> celldata(celldatanames.size()); + std::vector<std::vector<double>> celldata(celldatanames.size()); int nr = 0; int minInitLevel = this->grid->getCoarsestInitializedLevel(); diff --git a/src/cpu/core/SimulationObservers/WriteBoundaryConditionsSimulationObserver.h b/src/cpu/core/SimulationObservers/WriteBoundaryConditionsSimulationObserver.h index aff7893432dfbd99f9ceae5d407e26c39e16304d..9071cd60fb3831482ea894b90a3f160c7ceceab6 100644 --- a/src/cpu/core/SimulationObservers/WriteBoundaryConditionsSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/WriteBoundaryConditionsSimulationObserver.h @@ -77,7 +77,7 @@ private: std::vector<UbTupleFloat3> nodes; std::vector<UbTupleUInt8> cells; std::vector<std::string> datanames; - std::vector<std::vector<real>> data; + std::vector<std::vector<double>> data; std::string path; WbWriter *writer; std::vector<std::vector<SPtr<Block3D>>> blockVector; diff --git a/src/cpu/core/SimulationObservers/WriteGbObjectsSimulationObserver.cpp b/src/cpu/core/SimulationObservers/WriteGbObjectsSimulationObserver.cpp index 7ad8c2dc113e2b5b8f9aba6e173efc3dd6817f05..228d7ea3b02f6559df9c3d7b16f467e8c8330040 100644 --- a/src/cpu/core/SimulationObservers/WriteGbObjectsSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/WriteGbObjectsSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file WriteGbObjectsSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "WriteGbObjectsSimulationObserver.h" #include <parallel/Communicator.h> #include "GbObject3D.h" diff --git a/src/cpu/core/SimulationObservers/WriteGbObjectsSimulationObserver.h b/src/cpu/core/SimulationObservers/WriteGbObjectsSimulationObserver.h index 44e466ee95713675dd507643c8fa0b7194b0f612..05b8d9ba765fa5154cfd22e5c7d188ce3682cbc1 100644 --- a/src/cpu/core/SimulationObservers/WriteGbObjectsSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/WriteGbObjectsSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file WriteGbObjectsSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef WriteGbObjectsSimulationObserver_h__ #define WriteGbObjectsSimulationObserver_h__ diff --git a/src/cpu/core/SimulationObservers/WriteMQFromSelectionSimulationObserver.cpp b/src/cpu/core/SimulationObservers/WriteMQFromSelectionSimulationObserver.cpp index 639ebb21ee57b4610c352b505dd1cb010730df43..7027f3c8d2e389164326782636740dd0d9680db6 100644 --- a/src/cpu/core/SimulationObservers/WriteMQFromSelectionSimulationObserver.cpp +++ b/src/cpu/core/SimulationObservers/WriteMQFromSelectionSimulationObserver.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file WriteMQFromSelectionSimulationObserver.cpp +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #include "WriteMQFromSelectionSimulationObserver.h" #include "BCSet.h" #include "LBMKernel.h" diff --git a/src/cpu/core/SimulationObservers/WriteMQFromSelectionSimulationObserver.h b/src/cpu/core/SimulationObservers/WriteMQFromSelectionSimulationObserver.h index 107d49720faed3f4fb1e5478b2bb75047f48ddb5..d01268adfd66fc7967d85b0394dfe1abb101a27d 100644 --- a/src/cpu/core/SimulationObservers/WriteMQFromSelectionSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/WriteMQFromSelectionSimulationObserver.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file WriteMQFromSelectionSimulationObserver.h +//! \ingroup SimulationObservers +//! \author Konstantin Kutscher +//======================================================================================= #ifndef WriteMQFromSelectionSimulationObserver_H #define WriteMQFromSelectionSimulationObserver_H @@ -38,7 +70,7 @@ private: void init(); std::vector<UbTupleFloat3> nodes; std::vector<std::string> datanames; - std::vector<std::vector<real>> data; + std::vector<std::vector<double>> data; std::string path; WbWriter *writer; SPtr<LBMUnitConverter> conv; diff --git a/src/cpu/core/SimulationObservers/WriteMacroscopicQuantitiesSimulationObserver.h b/src/cpu/core/SimulationObservers/WriteMacroscopicQuantitiesSimulationObserver.h index 279f9dfba3cc41c0a06ef4cc66b06e6b841f4259..039c9ce10eb735b9a326f1491cc4fbe84c98eaab 100644 --- a/src/cpu/core/SimulationObservers/WriteMacroscopicQuantitiesSimulationObserver.h +++ b/src/cpu/core/SimulationObservers/WriteMacroscopicQuantitiesSimulationObserver.h @@ -82,7 +82,7 @@ private: std::vector<UbTupleFloat3> nodes; std::vector<UbTupleUInt8> cells; std::vector<std::string> datanames; - std::vector<std::vector<real>> data; + std::vector<std::vector<double>> data; std::string path; WbWriter *writer; SPtr<LBMUnitConverter> conv; diff --git a/src/cpu/core/Utilities/ChangeRandomQs.hpp b/src/cpu/core/Utilities/ChangeRandomQs.hpp index ff1c30c741e2cf02171b611c6d1eda2d234ab9ac..42a56c3081a45c45bc622f7eb76ae7f2190cedd2 100644 --- a/src/cpu/core/Utilities/ChangeRandomQs.hpp +++ b/src/cpu/core/Utilities/ChangeRandomQs.hpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ChangeRandomQs.hpp +//! \ingroup Utilities +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef ChangeRandomQs_h__ #define ChangeRandomQs_h__ diff --git a/src/cpu/core/Utilities/CheckpointConverter.cpp b/src/cpu/core/Utilities/CheckpointConverter.cpp index f882fd5678eb7b118f4abff78252dc058180e773..f4e4a6b38788f2d56d0cbeec6315162b9da4cd46 100644 --- a/src/cpu/core/Utilities/CheckpointConverter.cpp +++ b/src/cpu/core/Utilities/CheckpointConverter.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CheckpointConverter.cpp +//! \ingroup Utilities +//! \author Alena Karanchuk +//======================================================================================= #include "CheckpointConverter.h" #include "Block3D.h" #include "BoundaryConditions.h" diff --git a/src/cpu/core/Utilities/CheckpointConverter.h b/src/cpu/core/Utilities/CheckpointConverter.h index a2902b366cc1c4c06ccdc0513ed329757f22a558..04d9d0f6d104b05d5246ad472b7c2cdd8c4ae22b 100644 --- a/src/cpu/core/Utilities/CheckpointConverter.h +++ b/src/cpu/core/Utilities/CheckpointConverter.h @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CheckpointConverter.h +//! \ingroup Utilities +//! \author Alena Karanchuk +//======================================================================================= + #ifndef _UTILITACONVERTOR_H_ #define _UTILITACONVERTOR_H_ diff --git a/src/cpu/core/Utilities/VoxelMatrixUtil.hpp b/src/cpu/core/Utilities/VoxelMatrixUtil.hpp index 1903cba9b2318f094142bdd1f2562a845d05f069..60c169d9ada1d41e506cc859989607f8397d21a7 100644 --- a/src/cpu/core/Utilities/VoxelMatrixUtil.hpp +++ b/src/cpu/core/Utilities/VoxelMatrixUtil.hpp @@ -1,3 +1,36 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file voxelMatrixUtil.hpp +//! \ingroup Utilities +//! \author Konstantin Kutscher +//======================================================================================= + #ifndef VoxelMatrixUtil_h__ #define VoxelMatrixUtil_h__ diff --git a/src/cpu/core/Visitors/ChangeBoundaryDensityBlockVisitor.cpp b/src/cpu/core/Visitors/ChangeBoundaryDensityBlockVisitor.cpp index 682f1d65b2475001d59d4fad57fb3b4f39eaa918..8bf39f0f7ccaf7e7abd98d0c8c62292faefb5ac2 100644 --- a/src/cpu/core/Visitors/ChangeBoundaryDensityBlockVisitor.cpp +++ b/src/cpu/core/Visitors/ChangeBoundaryDensityBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ChangeBoundaryDensityBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #include "ChangeBoundaryDensityBlockVisitor.h" #include "BCArray3D.h" #include "BCSet.h" diff --git a/src/cpu/core/Visitors/ChangeBoundaryDensityBlockVisitor.h b/src/cpu/core/Visitors/ChangeBoundaryDensityBlockVisitor.h index 64592f7bb2f81e1df1b22cdc6bcbb6bbb7528dfc..20eea161836f938769cfa527b230fd38ca7aea29 100644 --- a/src/cpu/core/Visitors/ChangeBoundaryDensityBlockVisitor.h +++ b/src/cpu/core/Visitors/ChangeBoundaryDensityBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ChangeBoundaryDensityBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef ChangeBoundaryDensityBlockVisitor_h__ #define ChangeBoundaryDensityBlockVisitor_h__ diff --git a/src/cpu/core/Visitors/CheckRatioBlockVisitor.cpp b/src/cpu/core/Visitors/CheckRatioBlockVisitor.cpp index d329763a43d6985b8930ec0e73b7a06b991801d0..c3f893405f3d5b2451702dc88f977c413be8d866 100644 --- a/src/cpu/core/Visitors/CheckRatioBlockVisitor.cpp +++ b/src/cpu/core/Visitors/CheckRatioBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CheckRatioBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #include "CheckRatioBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" diff --git a/src/cpu/core/Visitors/CheckRatioBlockVisitor.h b/src/cpu/core/Visitors/CheckRatioBlockVisitor.h index c727447ff6395c050119b211b019540d980e67d8..285eee87567d439a339e79f36e03b65836e8a613 100644 --- a/src/cpu/core/Visitors/CheckRatioBlockVisitor.h +++ b/src/cpu/core/Visitors/CheckRatioBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CheckRatioBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef CheckRatioBlockVisitor_H #define CheckRatioBlockVisitor_H diff --git a/src/cpu/core/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.cpp b/src/cpu/core/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.cpp index 384983726353455e8c497fb26e9283b0bda0a2b3..def19f2665310c0736a8eebc795f171caf2b2157 100644 --- a/src/cpu/core/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.cpp +++ b/src/cpu/core/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CoarsenCrossAndInsideGbObjectBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #include "CoarsenCrossAndInsideGbObjectBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" diff --git a/src/cpu/core/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.h b/src/cpu/core/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.h index 0c234358dbadeb6a1b48de8ae98a19dcd6722c1f..0efe9c505a1de7ed59a772bf993a81c116d4ddfb 100644 --- a/src/cpu/core/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.h +++ b/src/cpu/core/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CoarsenCrossAndInsideGbObjectBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef CoarsenCrossAndInsideGbObjectBlockVisitor_H #define CoarsenCrossAndInsideGbObjectBlockVisitor_H diff --git a/src/cpu/core/Visitors/InitDistributionsBlockVisitor.cpp b/src/cpu/core/Visitors/InitDistributionsBlockVisitor.cpp index 6a306e26caa0423e51e12444d57ab045a3734072..2c65409c6224dce73c6a6f80e114373677cd9118 100644 --- a/src/cpu/core/Visitors/InitDistributionsBlockVisitor.cpp +++ b/src/cpu/core/Visitors/InitDistributionsBlockVisitor.cpp @@ -303,7 +303,7 @@ void InitDistributionsBlockVisitor::checkFunction(mu::Parser fct) { using namespace vf::basics::constant; - real x1 = c1o1, x2 = c1o1, x3 = c1o1; + double x1 = c1o1, x2 = c1o1, x3 = c1o1; fct.DefineVar("x1", &x1); fct.DefineVar("x2", &x2); fct.DefineVar("x3", &x3); diff --git a/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp b/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp index 6874c3dcab52601665605d2521372e934dbfd6df..220df829be93c753892bc2a4d34521fc5d8ad1c3 100644 --- a/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp +++ b/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file InitDistributionsWithInterpolationGridVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #include "InitDistributionsWithInterpolationGridVisitor.h" #include "mpi.h" diff --git a/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.h b/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.h index eab801e448b4c797c7260274af66ea50a4677def..ae5414a715b50fdc16e4a3f7fddff286372a73af 100644 --- a/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.h +++ b/src/cpu/core/Visitors/InitDistributionsWithInterpolationGridVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file InitDistributionsWithInterpolationGridVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef InitDistributionsWithCoarseGridBlockVisitor_h__ #define InitDistributionsWithCoarseGridBlockVisitor_h__ diff --git a/src/cpu/core/Visitors/InitThixotropyBlockVisitor.cpp b/src/cpu/core/Visitors/InitThixotropyBlockVisitor.cpp deleted file mode 100644 index 8a85982a65913380f951186b2902fb107ba25ed2..0000000000000000000000000000000000000000 --- a/src/cpu/core/Visitors/InitThixotropyBlockVisitor.cpp +++ /dev/null @@ -1,463 +0,0 @@ - //======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids is free software: you can -// redistribute it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either version 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License along -// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file InitThixotropyBlockVisitor.h -//! \ingroup Visitors -//! \author Konstantin Kutscher -//======================================================================================= - -#include "InitThixotropyBlockVisitor.h" -#include "LBMKernel.h" -#include "BCSet.h" -#include "D3Q27System.h" -#include "DataSet3D.h" -#include "EsoTwist3D.h" -#include "Grid3D.h" -#include "Block3D.h" -#include "BCArray3D.h" - -InitThixotropyBlockVisitor::InitThixotropyBlockVisitor() - : Block3DVisitor(0, D3Q27System::MAXLEVEL) -{ - using namespace vf::basics::constant; - - //this->setVx1(0.0); - //this->setVx2(0.0); - //this->setVx3(0.0); - //this->setRho(0.0); - //this->setf1(0.0); - //this->setf2(0.0); - //this->setf3(0.0); - //this->setConcentration(0.0); - this->setLambda(c0o1); -} -////////////////////////////////////////////////////////////////////////// -//InitThixotropyBlockVisitor::InitThixotropyBlockVisitor(real lambda /*real nu, real D, real rho, real vx1, real vx2, real vx3, real c, real f1, real f2, real f3*/) -// : Block3DVisitor(0, D3Q27System::MAXLEVEL) -//{ -// //this->setVx1(vx1); -// //this->setVx2(vx2); -// //this->setVx3(vx3); -// //this->setRho(rho); -// //this->setf1(vx1); -// //this->setf2(vx2); -// //this->setf3(vx3); -// //this->setConcentration(rho); -// //this->setNu(nu); -// //this->setD(D); -// this->setLambda(lambda); -//} -////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setVx1(const mu::Parser& parser) -//{ -// this->checkFunction(parser); -// this->muVx1 = parser; -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setVx2(const mu::Parser& parser) -//{ -// this->checkFunction(parser); -// this->muVx2 = parser; -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setVx3(const mu::Parser& parser) -//{ -// this->checkFunction(parser); -// this->muVx3 = parser; -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setRho(const mu::Parser& parser) -//{ -// this->checkFunction(parser); -// this->muRho = parser; -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setf1(const mu::Parser& parser) -//{ -// this->checkFunction(parser); -// this->muf1 = parser; -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setf2(const mu::Parser& parser) -//{ -// this->checkFunction(parser); -// this->muf2 = parser; -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setf3(const mu::Parser& parser) -//{ -// this->checkFunction(parser); -// this->muf3 = parser; -//} -//////////////////////////////////////////////////////////////////////////// -void InitThixotropyBlockVisitor::setLambda(const mu::Parser& parser) -{ - this->checkFunction(parser); - this->muLambda = parser; -} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setVx1(const std::string& muParserString) -//{ -// this->muVx1.SetExpr(muParserString); -// this->checkFunction(muVx1); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setVx2(const std::string& muParserString) -//{ -// this->muVx2.SetExpr(muParserString); -// this->checkFunction(muVx2); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setVx3(const std::string& muParserString) -//{ -// this->muVx3.SetExpr(muParserString); -// this->checkFunction(muVx3); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setRho(const std::string& muParserString) -//{ -// this->muRho.SetExpr(muParserString); -// this->checkFunction(muRho); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setf1(const std::string& muParserString) -//{ -// this->muf1.SetExpr(muParserString); -// this->checkFunction(muf1); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setf2(const std::string& muParserString) -//{ -// this->muf2.SetExpr(muParserString); -// this->checkFunction(muf2); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setf3(const std::string& muParserString) -//{ -// this->muf3.SetExpr(muParserString); -// this->checkFunction(muf3); -//} -//////////////////////////////////////////////////////////////////////////// -void InitThixotropyBlockVisitor::setLambda(const std::string& muParserString) -{ - this->muLambda.SetExpr(muParserString); - this->checkFunction(muLambda); -} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setVx1(real vx1) -//{ -// this->muVx1.SetExpr(UbSystem::toString(vx1, realLim::digits10)); -// this->checkFunction(muVx1); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setVx2(real vx2) -//{ -// this->muVx2.SetExpr(UbSystem::toString(vx2, realLim::digits10)); -// this->checkFunction(muVx2); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setVx3(real vx3) -//{ -// this->muVx3.SetExpr(UbSystem::toString(vx3, realLim::digits10)); -// this->checkFunction(muVx3); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setRho(real rho) -//{ -// this->muRho.SetExpr(UbSystem::toString(rho, realLim::digits10)); -// this->checkFunction(muRho); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setf1(real f1) -//{ -// this->muf1.SetExpr(UbSystem::toString(f1, realLim::digits10)); -// this->checkFunction(muf1); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setf2(real f2) -//{ -// this->muf2.SetExpr(UbSystem::toString(f2, realLim::digits10)); -// this->checkFunction(muf2); -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setf3(real f3) -//{ -// this->muf3.SetExpr(UbSystem::toString(f3, realLim::digits10)); -// this->checkFunction(muf3); -//} -////////////////////////////////////////////////////////////////////////// -void InitThixotropyBlockVisitor::setLambda(real lambda) -{ - this->muLambda.SetExpr(UbSystem::toString(lambda, realLim::digits10)); - this->checkFunction(muLambda); -} -////////////////////////////////////////////////////////////////////////// -void InitThixotropyBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block) -{ - using namespace D3Q27System; - using namespace vf::basics::constant; - - if(!block) UB_THROW( UbException(UB_EXARGS,"block is not exist") ); - -// double dx = grid->getDeltaX(block); - - //define vars for functions - mu::value_type x1,x2,x3; - //this->muVx1.DefineVar("x1",&x1); this->muVx1.DefineVar("x2",&x2); this->muVx1.DefineVar("x3",&x3); - //this->muVx2.DefineVar("x1",&x1); this->muVx2.DefineVar("x2",&x2); this->muVx2.DefineVar("x3",&x3); - //this->muVx3.DefineVar("x1",&x1); this->muVx3.DefineVar("x2",&x2); this->muVx3.DefineVar("x3",&x3); - //this->muRho.DefineVar("x1",&x1); this->muRho.DefineVar("x2",&x2); this->muRho.DefineVar("x3",&x3); - - this->muLambda.DefineVar("x1",&x1); this->muLambda.DefineVar("x2",&x2); this->muLambda.DefineVar("x3",&x3); - - //Funktionszeiger - typedef void (*CalcFeqsFct)(real* const& /*feq[27]*/,const real& /*(d)rho*/,const real& /*vx1*/,const real& /*vx2*/,const real& /*vx3*/); - CalcFeqsFct calcFeqsFct = NULL; - - int gridRank = grid->getRank(); - int blockRank = block->getRank(); - - if (blockRank == gridRank && block->isActive()) - { - SPtr<ILBMKernel> kernel = block->getKernel(); - if (!kernel) - throw UbException(UB_EXARGS, "The LBM kernel isn't exist in block: "+block->toString()); - - if(kernel->getCompressible()) - calcFeqsFct = &D3Q27System::calcCompFeq; - else - calcFeqsFct = &D3Q27System::calcIncompFeq; - - SPtr<BCArray3D> bcArray = kernel->getBCSet()->getBCArray(); - SPtr<DistributionArray3D> distributions = kernel->getDataSet()->getHdistributions(); - - real h[D3Q27System::ENDF+1]; - - for(std::size_t ix3=0; ix3<bcArray->getNX3(); ix3++) - for(std::size_t ix2=0; ix2<bcArray->getNX2(); ix2++) - for(std::size_t ix1=0; ix1<bcArray->getNX1(); ix1++) - { - //UbTupleDouble3 coords = grid->getNodeCoordinates(block, ix1, ix2, ix3); - //x1 = val<1>(coords); - //x2 = val<2>(coords); - //x3 = val<3>(coords); - - //vx1 = muVx1.Eval(); - //vx2 = muVx2.Eval(); - //vx3 = muVx3.Eval(); - //rho = muRho.Eval(); - - //f1 = muf1.Eval(); - //f2 = muf2.Eval(); - //f3 = muf3.Eval(); - //conc = muConcentration.Eval(); - - //initialize(f, x1, x2, x3, vx1, vx2, vx3, rho, coords, dx, o, true); - //initialize(h, x1, x2, x3, f1, f2, f3, conc, coords, dx, oDiffusion, false); - - - //distributionsf->setPostCollisionDistribution(f, ix1, ix2, ix3); - //distributionsf->setPreCollisionDistribution(f, ix1, ix2, ix3); - - real lambda = muLambda.Eval(); - - calcFeqsFct(h,lambda,c0o1,c0o1,c0o1); - - distributions->setPostCollisionDistribution(h, ix1, ix2, ix3); - distributions->setPreCollisionDistribution(h, ix1, ix2, ix3); - - - } - } - - //variablen der functions loeschen, da die verwiesenen Objecte nach dem verlassen des scopes ungueltig sind! - //this->muVx1.ClearVar(); - //this->muVx2.ClearVar(); - //this->muVx3.ClearVar(); - //this->muRho.ClearVar(); - - this->muLambda.ClearVar(); -} -////////////////////////////////////////////////////////////////////////// -void InitThixotropyBlockVisitor::checkFunction(mu::Parser fct) -{ - real x1 = 1.0, x2 = 1.0, x3 = 1.0; - fct.DefineVar("x1", &x1); - fct.DefineVar("x2", &x2); - fct.DefineVar("x3", &x3); - - try - { - fct.Eval(); - fct.ClearVar(); - } - catch (mu::ParserError & e) - { - throw UbException(UB_EXARGS, "function: " + e.GetExpr() + (std::string)"error: " + e.GetMsg() - + (std::string)", only x1,x2,x3 are allowed as variables"); - } -} -////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setNu(real nu) -//{ -// this->nu = nu; -//} -//////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::setD(real D) -//{ -// this->D = D; -//} -////////////////////////////////////////////////////////////////////////// -//void InitThixotropyBlockVisitor::initialize(double* f, double x1, double x2, double x3, double vx1, double vx2, double vx3, double rho, UbTupleDouble3 coords, double dx, double o, bool NSE) -//{ -// using namespace D3Q27System; -// //Funktionszeiger -// typedef void(*CalcFeqsFct)(real* const& /*feq[27]*/, const real& /*(d)rho*/, const real& /*vx1*/, const real& /*vx2*/, const real& /*vx3*/); -// CalcFeqsFct calcFeqsFct = NULL; -// -// -// //if (NSE) -// //{ -// // calcFeqsFct = &D3Q27System::calcIncompFeq; -// -// //} -// //else -// //{ -// //calcFeqsFct = &D3Q27System::calcCompFeq; -// //muVx1 = muf1; -// //muVx2 = muf2; -// //muVx3 = muf3; -// //} -// -// if (kernel->getCompressible()) -// calcFeqsFct = &D3Q27System::calcCompFeq; -// else -// calcFeqsFct = &D3Q27System::calcIncompFeq; -// -// //x-derivative -// double deltaX = dx * 0.5; -// x1 = val<1>(coords) + deltaX; -// double vx1Plusx1 = muVx1.Eval(); -// double vx2Plusx1 = muVx2.Eval(); -// double vx3Plusx1 = muVx3.Eval(); -// -// x1 = val<1>(coords) - deltaX; -// double vx1Minusx1 = muVx1.Eval(); -// double vx2Minusx1 = muVx2.Eval(); -// double vx3Minusx1 = muVx3.Eval(); -// -// //y-derivative -// x1 = val<1>(coords); -// x2 = val<2>(coords) + deltaX; -// double vx1Plusx2 = muVx1.Eval(); -// double vx2Plusx2 = muVx2.Eval(); -// double vx3Plusx2 = muVx3.Eval(); -// -// x2 = val<2>(coords) - deltaX; -// double vx1Minusx2 = muVx1.Eval(); -// double vx2Minusx2 = muVx2.Eval(); -// double vx3Minusx2 = muVx3.Eval(); -// -// //z-derivative -// x2 = val<2>(coords); -// x3 = val<3>(coords) + deltaX; -// double vx1Plusx3 = muVx1.Eval(); -// double vx2Plusx3 = muVx2.Eval(); -// double vx3Plusx3 = muVx3.Eval(); -// -// x3 = val<3>(coords) - deltaX; -// double vx1Minusx3 = muVx1.Eval(); -// double vx2Minusx3 = muVx2.Eval(); -// double vx3Minusx3 = muVx3.Eval(); -// -// double ax = (vx1Plusx1 - vx1Minusx1) / (2.0 * deltaX) * dx; -// double bx = (vx2Plusx1 - vx2Minusx1) / (2.0 * deltaX) * dx; -// double cx = (vx3Plusx1 - vx3Minusx1) / (2.0 * deltaX) * dx; -// -// double ay = (vx1Plusx2 - vx1Minusx2) / (2.0 * deltaX) * dx; -// double by = (vx2Plusx2 - vx2Minusx2) / (2.0 * deltaX) * dx; -// double cy = (vx3Plusx2 - vx3Minusx2) / (2.0 * deltaX) * dx; -// -// double az = (vx1Plusx3 - vx1Minusx3) / (2.0 * deltaX) * dx; -// double bz = (vx2Plusx3 - vx2Minusx3) / (2.0 * deltaX) * dx; -// double cz = (vx3Plusx3 - vx3Minusx3) / (2.0 * deltaX) * dx; -// double eps_new = 1.0; -// real op = 1.; -// -// real feq[27]; -// -// calcFeqsFct(feq, rho, vx1, vx2, vx3); -// -// double f_E = eps_new * ((5. * ax * o + 5. * by * o + 5. * cz * o - 8. * ax * op + 4. * by * op + 4. * cz * op) / (54. * o * op)); -// double f_N = f_E + eps_new * ((2. * (ax - by)) / (9. * o)); -// double f_T = f_E + eps_new * ((2. * (ax - cz)) / (9. * o)); -// double f_NE = eps_new * (-(5. * cz * o + 3. * (ay + bx) * op - 2. * cz * op + ax * (5. * o + op) + by * (5. * o + op)) / (54. * o * op)); -// double f_SE = f_NE + eps_new * ((ay + bx) / (9. * o)); -// double f_TE = eps_new * (-(5. * cz * o + by * (5. * o - 2. * op) + 3. * (az + cx) * op + cz * op + ax * (5. * o + op)) / (54. * o * op)); -// double f_BE = f_TE + eps_new * ((az + cx) / (9. * o)); -// double f_TN = eps_new * (-(5. * ax * o + 5. * by * o + 5. * cz * o - 2. * ax * op + by * op + 3. * bz * op + 3. * cy * op + cz * op) / (54. * o * op)); -// double f_BN = f_TN + eps_new * ((bz + cy) / (9. * o)); -// double f_ZERO = eps_new * ((5. * (ax + by + cz)) / (9. * op)); -// double f_TNE = eps_new * (-(ay + az + bx + bz + cx + cy) / (72. * o)); -// double f_TSW = -eps_new * ((ay + bx) / (36. * o)) - f_TNE; -// double f_TSE = -eps_new * ((az + cx) / (36. * o)) - f_TNE; -// double f_TNW = -eps_new * ((bz + cy) / (36. * o)) - f_TNE; -// -// -// f[dP00] = f_E + feq[dP00]; -// f[W] = f_E + feq[W]; -// f[N] = f_N + feq[N]; -// f[S] = f_N + feq[S]; -// f[T] = f_T + feq[T]; -// f[B] = f_T + feq[B]; -// f[NE] = f_NE + feq[NE]; -// f[SW] = f_NE + feq[SW]; -// f[SE] = f_SE + feq[SE]; -// f[NW] = f_SE + feq[NW]; -// f[TE] = f_TE + feq[TE]; -// f[BW] = f_TE + feq[BW]; -// f[BE] = f_BE + feq[BE]; -// f[TW] = f_BE + feq[TW]; -// f[TN] = f_TN + feq[TN]; -// f[BS] = f_TN + feq[BS]; -// f[BN] = f_BN + feq[BN]; -// f[TS] = f_BN + feq[TS]; -// f[TNE] = f_TNE + feq[TNE]; -// f[TNW] = f_TNW + feq[TNW]; -// f[TSE] = f_TSE + feq[TSE]; -// f[TSW] = f_TSW + feq[TSW]; -// f[BNE] = f_TSW + feq[BNE]; -// f[BNW] = f_TSE + feq[BNW]; -// f[BSE] = f_TNW + feq[BSE]; -// f[BSW] = f_TNE + feq[BSW]; -// f[REST] = f_ZERO + feq[REST]; -// -// -// -// -//} diff --git a/src/cpu/core/Visitors/InitThixotropyBlockVisitor.h b/src/cpu/core/Visitors/InitThixotropyBlockVisitor.h deleted file mode 100644 index b883e33f10eb0043d02791b9cf0adeb391af6f70..0000000000000000000000000000000000000000 --- a/src/cpu/core/Visitors/InitThixotropyBlockVisitor.h +++ /dev/null @@ -1,116 +0,0 @@ -//======================================================================================= -// ____ ____ __ ______ __________ __ __ __ __ -// \ \ | | | | | _ \ |___ ___| | | | | / \ | | -// \ \ | | | | | |_) | | | | | | | / \ | | -// \ \ | | | | | _ / | | | | | | / /\ \ | | -// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ -// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| -// \ \ | | ________________________________________________________________ -// \ \ | | | ______________________________________________________________| -// \ \| | | | __ __ __ __ ______ _______ -// \ | | |_____ | | | | | | | | | _ \ / _____) -// \ | | _____| | | | | | | | | | | \ \ \_______ -// \ | | | | |_____ | \_/ | | | | |_/ / _____ | -// \ _____| |__| |________| \_______/ |__| |______/ (_______/ -// -// This file is part of VirtualFluids. VirtualFluids is free software: you can -// redistribute it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either version 3 of -// the License, or (at your option) any later version. -// -// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// for more details. -// -// You should have received a copy of the GNU General Public License along -// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. -// -//! \file InitThixotropyBlockVisitor.h -//! \ingroup Visitors -//! \author Konstantin Kutscher -//======================================================================================= - -#ifndef InitThixotropyBlockVisitor_H -#define InitThixotropyBlockVisitor_H - -#include <PointerDefinitions.h> - -#include "Block3DVisitor.h" -#include "D3Q27System.h" - -#include <muParser.h> - -class InitThixotropyBlockVisitor : public Block3DVisitor -{ -public: - InitThixotropyBlockVisitor(); - //D3Q27ETInitThixotropyBlockVisitor(real rho, real vx1=0.0, real vx2=0.0, real vx3=0.0); - //! Constructor - //! \param nu - viscosity - //! \param rho - density - //! \param vx1 - velocity in x - //! \param vx2 - velocity in y - //! \param vx3 - velocity in z - //InitThixotropyBlockVisitor(real lambda /*real nu, real D, real rho, real vx1 = 0.0, real vx2 = 0.0, real vx3 = 0.0, real c=0.0, real f1 = 0.0, real f2 = 0.0, real f3 = 0.0*/); - ////////////////////////////////////////////////////////////////////////// - //automatic vars are: x1,x2, x3 - //ussage example: setVx1("x1*0.01+x2*0.003") - ////////////////////////////////////////////////////////////////////////// - //void setVx1(const mu::Parser& parser); - //void setVx2(const mu::Parser& parser); - //void setVx3(const mu::Parser& parser); - //void setRho(const mu::Parser& parser); - - //void setVx1(const std::string& muParserString); - //void setVx2(const std::string& muParserString); - //void setVx3(const std::string& muParserString); - //void setRho(const std::string& muParserString); - //////////////////////////////////////////////////////////////////////////// - //void setVx1(real vx1); - //void setVx2(real vx2); - //void setVx3(real vx3); - //void setRho(real rho); - //void setNu(real nu); - - ////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// - //void setf1(const mu::Parser& parser); - //void setf2(const mu::Parser& parser); - //void setf3(const mu::Parser& parser); - void setLambda(const mu::Parser& parser); - - //void setf1(const std::string& muParserString); - //void setf2(const std::string& muParserString); - //void setf3(const std::string& muParserString); - void setLambda(const std::string& muParserString); - ////////////////////////////////////////////////////////////////////////// - //void setf1(real f1); - //void setf2(real f2); - //void setf3(real f3); - void setLambda(real lambda); - //void setD(real D); - - //void initialize(double* f, double x1, double x2, double x3, double vx1, double vx2, double vx3, double rho, UbTupleDouble3 coords, double dx, double o, bool NSE); - - void visit(SPtr<Grid3D> grid, SPtr<Block3D> block) override; - -protected: - void checkFunction(mu::Parser fct); - typedef void(*CalcFeqsFct)(real* const& /*feq[27]*/, const real& /*(d)rho*/, const real& /*vx1*/, const real& /*vx2*/, const real& /*vx3*/); - -private: - mu::Parser muVx1; - mu::Parser muVx2; - mu::Parser muVx3; - //mu::Parser muRho; - //real nu; - - //mu::Parser muf1; - //mu::Parser muf2; - //mu::Parser muf3; - mu::Parser muLambda; - //real D; -}; - -#endif //D3Q27INITDISTRIBUTIONSPATCHVISITOR_H diff --git a/src/cpu/core/Visitors/MetisPartitioningGridVisitor.cpp b/src/cpu/core/Visitors/MetisPartitioningGridVisitor.cpp index 26787a1530681d98f29469c95443503611ec62ce..04c99d51ed6170ae6efea5bbf3105d4e8afab255 100644 --- a/src/cpu/core/Visitors/MetisPartitioningGridVisitor.cpp +++ b/src/cpu/core/Visitors/MetisPartitioningGridVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MetisPartitioningGridVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #if defined VF_METIS && defined VF_MPI #include "MetisPartitioningGridVisitor.h" diff --git a/src/cpu/core/Visitors/MetisPartitioningGridVisitor.h b/src/cpu/core/Visitors/MetisPartitioningGridVisitor.h index d4e29060932b61abeaa68d03e3e0fd566d45a927..c0ecb9c1fa0bb90e3224a359929c179e69dc32a7 100644 --- a/src/cpu/core/Visitors/MetisPartitioningGridVisitor.h +++ b/src/cpu/core/Visitors/MetisPartitioningGridVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file MetisPartitioningGridVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef MetisPartitioningGridVisitor_h #define MetisPartitioningGridVisitor_h diff --git a/src/cpu/core/Visitors/OverlapBlockVisitor.cpp b/src/cpu/core/Visitors/OverlapBlockVisitor.cpp index 54bbeda59663bf16173abcdb302f123a97b776ac..498452a0fca7fb05a430ce44c623b61aafbed8a1 100644 --- a/src/cpu/core/Visitors/OverlapBlockVisitor.cpp +++ b/src/cpu/core/Visitors/OverlapBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file OverlapBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #include "OverlapBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" diff --git a/src/cpu/core/Visitors/OverlapBlockVisitor.h b/src/cpu/core/Visitors/OverlapBlockVisitor.h index d839d80418a29897e5da0951d71d47f12372134c..5714f596df338784bfd7365011df8e096426a782 100644 --- a/src/cpu/core/Visitors/OverlapBlockVisitor.h +++ b/src/cpu/core/Visitors/OverlapBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file OverlapBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef OverlapBlockVisitor_H #define OverlapBlockVisitor_H diff --git a/src/cpu/core/Visitors/RatioBlockVisitor.cpp b/src/cpu/core/Visitors/RatioBlockVisitor.cpp index 137c737e6dd85853da328b0d0cc9ccf1bca1f878..5dd4c7194ee60e4c23d789341ab523ce1daea1f8 100644 --- a/src/cpu/core/Visitors/RatioBlockVisitor.cpp +++ b/src/cpu/core/Visitors/RatioBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RatioBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #include "RatioBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" diff --git a/src/cpu/core/Visitors/RatioBlockVisitor.h b/src/cpu/core/Visitors/RatioBlockVisitor.h index 037d06dbfea92062dc957fe996c02cefdf46af9f..4378b51e1b992dea63bb8f0af8075a2dffd6911c 100644 --- a/src/cpu/core/Visitors/RatioBlockVisitor.h +++ b/src/cpu/core/Visitors/RatioBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RatioBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef RatioBlockVisitor_H #define RatioBlockVisitor_H diff --git a/src/cpu/core/Visitors/RatioSmoothBlockVisitor.cpp b/src/cpu/core/Visitors/RatioSmoothBlockVisitor.cpp index b48aee7cd8dcd3d3cc33c949e8a71281214c8f19..d7e100e932443550d3eefc446cc037f69e3f0092 100644 --- a/src/cpu/core/Visitors/RatioSmoothBlockVisitor.cpp +++ b/src/cpu/core/Visitors/RatioSmoothBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RatioSmoothBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #include "RatioSmoothBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" diff --git a/src/cpu/core/Visitors/RatioSmoothBlockVisitor.h b/src/cpu/core/Visitors/RatioSmoothBlockVisitor.h index b9347c8476683576d4cf4ede0bca7871eab8e559..078ff308439726b0470ac4f33bbab679eda16bed 100644 --- a/src/cpu/core/Visitors/RatioSmoothBlockVisitor.h +++ b/src/cpu/core/Visitors/RatioSmoothBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RatioSmoothBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef RatioSmoothBlockVisitor_H #define RatioSmoothBlockVisitor_H diff --git a/src/cpu/core/Visitors/RefineAroundGbObjectHelper.cpp b/src/cpu/core/Visitors/RefineAroundGbObjectHelper.cpp index 3245fa58c090d0cc790a40ddef69f13ab638cd16..181b0ace7a76c89baa2c88574f7131417119dd37 100644 --- a/src/cpu/core/Visitors/RefineAroundGbObjectHelper.cpp +++ b/src/cpu/core/Visitors/RefineAroundGbObjectHelper.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RefineAroundGbObjectHelper.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #include "RefineAroundGbObjectHelper.h" #include <parallel/Communicator.h> #include "OverlapBlockVisitor.h" diff --git a/src/cpu/core/Visitors/RefineAroundGbObjectHelper.h b/src/cpu/core/Visitors/RefineAroundGbObjectHelper.h index c5cc4d6fc426566770bdfbfd4637f32e1ecd411d..c9d89352216fcd3c5896ba019c8cf4c2fecddd43 100644 --- a/src/cpu/core/Visitors/RefineAroundGbObjectHelper.h +++ b/src/cpu/core/Visitors/RefineAroundGbObjectHelper.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RefineAroundGbObjectHelper.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef RefineAroundGbObjectHelper_H #define RefineAroundGbObjectHelper_H diff --git a/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.cpp b/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.cpp index 9d5126d992ad7257607eb3a4f966fa9248f02848..ac8583024b9bb1d1b3d1caf810f3f825cbed69af 100644 --- a/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.cpp +++ b/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RefineCrossAndInsideGbObjectBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #include "RefineCrossAndInsideGbObjectBlockVisitor.h" #include "Block3D.h" diff --git a/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.h b/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.h index 9696b447c83d658d9c04b5720ea0260a00c0e6db..3e76cae0d04060aac16095336c02b0ed1c44207d 100644 --- a/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.h +++ b/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RefineCrossAndInsideGbObjectBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef RefineCrossAndInsideGbObjectBlockVisitor_H #define RefineCrossAndInsideGbObjectBlockVisitor_H diff --git a/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectHelper.cpp b/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectHelper.cpp index f11e8e5ce1bc04af79775be7bfdd14201febbc3f..5d40a4753f560fcd92d98eb95ff3f6cc523f392c 100644 --- a/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectHelper.cpp +++ b/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectHelper.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RefineCrossAndInsideGbObjectBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #include "RefineCrossAndInsideGbObjectHelper.h" #include "CheckRatioBlockVisitor.h" #include <parallel/Communicator.h> diff --git a/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectHelper.h b/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectHelper.h index 64bb923d04ff75fedce821ffc43a73a8f5e2d730..4201e528af013acc2275282c52ad0967e853acf2 100644 --- a/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectHelper.h +++ b/src/cpu/core/Visitors/RefineCrossAndInsideGbObjectHelper.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RefineCrossAndInsideGbObjectBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef RefineCrossAndInsideGbObjectHelper_H #define RefineCrossAndInsideGbObjectHelper_H diff --git a/src/cpu/core/Visitors/RefineInterGbObjectsVisitor.cpp b/src/cpu/core/Visitors/RefineInterGbObjectsVisitor.cpp index b1a9a3b399dd0e3a8538187165af079e6bd3fdc5..b117afb057382d30b1eedbb418b18e09d5228672 100644 --- a/src/cpu/core/Visitors/RefineInterGbObjectsVisitor.cpp +++ b/src/cpu/core/Visitors/RefineInterGbObjectsVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RefineInterGbObjectsBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #include "RefineInterGbObjectsVisitor.h" #include "Block3D.h" diff --git a/src/cpu/core/Visitors/RefineInterGbObjectsVisitor.h b/src/cpu/core/Visitors/RefineInterGbObjectsVisitor.h index 6bcf41e041b03f88dbcfd3c27790c1b45685975c..caf3abef0919800d1325503b7184f4b04f40ac0c 100644 --- a/src/cpu/core/Visitors/RefineInterGbObjectsVisitor.h +++ b/src/cpu/core/Visitors/RefineInterGbObjectsVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RefineInterGbObjectsBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher, Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef RefineInterGbObjectsVisirtor_H #define RefineInterGbObjectsVisirtor_H diff --git a/src/cpu/core/Visitors/RenumberBlockVisitor.cpp b/src/cpu/core/Visitors/RenumberBlockVisitor.cpp index b2a4d9337ad49edc4e508555929a6ca64e6f9243..4a93bd4246652adb380c3e32af7a5a527b367069 100644 --- a/src/cpu/core/Visitors/RenumberBlockVisitor.cpp +++ b/src/cpu/core/Visitors/RenumberBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RenumberBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #include "RenumberBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" diff --git a/src/cpu/core/Visitors/RenumberBlockVisitor.h b/src/cpu/core/Visitors/RenumberBlockVisitor.h index e0ceb4a74bae6b74452f112417a15e632ae109e2..d5c5814f546e75a2c0e3084ec2f8ffd858dd2b26 100644 --- a/src/cpu/core/Visitors/RenumberBlockVisitor.h +++ b/src/cpu/core/Visitors/RenumberBlockVisitor.h @@ -1,9 +1,35 @@ -/** - * @file RenumberBlockVisitor.h - * @brief Visitor class which renumber blocks. - * @author Konstantin Kutscher - * @date 06.06.2011 - */ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RenumberBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef RenumberBlockVisitor_h #define RenumberBlockVisitor_h diff --git a/src/cpu/core/Visitors/RenumberGridVisitor.cpp b/src/cpu/core/Visitors/RenumberGridVisitor.cpp index a21b8b8a61575eedbacdc76fdd55ef89c4318173..c2f13ea014a0a0af8da1dbe00e4fe058dc2285b9 100644 --- a/src/cpu/core/Visitors/RenumberGridVisitor.cpp +++ b/src/cpu/core/Visitors/RenumberGridVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RenumberGridVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #include "RenumberGridVisitor.h" #include "Block3D.h" #include "Grid3D.h" diff --git a/src/cpu/core/Visitors/RenumberGridVisitor.h b/src/cpu/core/Visitors/RenumberGridVisitor.h index aa56b469107dc2be3332622b747e0c0f3e3b9fe7..0772c2ece3532a87304d8e926da35df6f0ce7f84 100644 --- a/src/cpu/core/Visitors/RenumberGridVisitor.h +++ b/src/cpu/core/Visitors/RenumberGridVisitor.h @@ -1,9 +1,35 @@ -/** - * @file RenumberGridVisitor.h - * @brief Visitor class which renumber blocks. - * @author Konstantin Kutscher - * @date 06.06.2011 - */ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file RenumberGridVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef RenumberGridVisitor_h #define RenumberGridVisitor_h diff --git a/src/cpu/core/Visitors/SetForcingBlockVisitor.cpp b/src/cpu/core/Visitors/SetForcingBlockVisitor.cpp index a325fc5ac355e31a1cf1188b884d5e719e85c7be..e6f10f13748e01062e7debf1d1ebf40b80403e28 100644 --- a/src/cpu/core/Visitors/SetForcingBlockVisitor.cpp +++ b/src/cpu/core/Visitors/SetForcingBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SetForcingBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #include "SetForcingBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" diff --git a/src/cpu/core/Visitors/SetForcingBlockVisitor.h b/src/cpu/core/Visitors/SetForcingBlockVisitor.h index e7237d7fc7833f69aa486858527a167f53864afe..23248355014af91d528528686348f9567eb4e445 100644 --- a/src/cpu/core/Visitors/SetForcingBlockVisitor.h +++ b/src/cpu/core/Visitors/SetForcingBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SetForcingBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef SetForcingBlockVisitor_h #define SetForcingBlockVisitor_h diff --git a/src/cpu/core/Visitors/SetInterpolationConnectorsBlockVisitor.cpp b/src/cpu/core/Visitors/SetInterpolationConnectorsBlockVisitor.cpp index 4f882353f1ce6d7675271e753bd1ebf9f9962c8e..8daa44f81d9dc69961ba1cd9a5042b43b2f0a221 100644 --- a/src/cpu/core/Visitors/SetInterpolationConnectorsBlockVisitor.cpp +++ b/src/cpu/core/Visitors/SetInterpolationConnectorsBlockVisitor.cpp @@ -59,6 +59,10 @@ void SetInterpolationConnectorsBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block { if(!block) return; + UbTupleInt3 blockNX = grid->getBlockNX(); + if (val<1>(blockNX) % 2 != 0 && val<2>(blockNX) % 2 != 0 && val<3>(blockNX) % 2 != 0) + UB_THROW(UbException(UB_EXARGS, "Odd number of nodes: The number of nodes in each dimension (x,y,z) has to be even.")); + UBLOG(logDEBUG5, "SetInterpolationConnectorsBlockVisitor::visit() - start"); UBLOG(logDEBUG5, block->toString()); diff --git a/src/cpu/core/Visitors/SetInterpolationDirsBlockVisitor.cpp b/src/cpu/core/Visitors/SetInterpolationDirsBlockVisitor.cpp index dcf71314768d8274941d5631906b972d0ab82561..225c19e0092d3cfa53b6ea7876a0f388ef18fa66 100644 --- a/src/cpu/core/Visitors/SetInterpolationDirsBlockVisitor.cpp +++ b/src/cpu/core/Visitors/SetInterpolationDirsBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SetInterpolationDirsBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #include "SetInterpolationDirsBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" diff --git a/src/cpu/core/Visitors/SetInterpolationDirsBlockVisitor.h b/src/cpu/core/Visitors/SetInterpolationDirsBlockVisitor.h index 078a06766d7a7b351ca36bdc79e604f9201bab6c..ba033279d51549617e9437e976fa9b749ed91847 100644 --- a/src/cpu/core/Visitors/SetInterpolationDirsBlockVisitor.h +++ b/src/cpu/core/Visitors/SetInterpolationDirsBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SetInterpolationDirsBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef SetInterpolationDirsBlockVisitor_h #define SetInterpolationDirsBlockVisitor_h diff --git a/src/cpu/core/Visitors/SetKernelBlockVisitor.cpp b/src/cpu/core/Visitors/SetKernelBlockVisitor.cpp index 1111429442829adca999bf6c587819419c8bd9fb..9153ff9498f7ecd4a3bffb730c7b2bc698f0092d 100644 --- a/src/cpu/core/Visitors/SetKernelBlockVisitor.cpp +++ b/src/cpu/core/Visitors/SetKernelBlockVisitor.cpp @@ -44,19 +44,14 @@ #include <utility> ////////////////////////////////////////////////////////////////////////// -SetKernelBlockVisitor::SetKernelBlockVisitor(SPtr<LBMKernel> kernel, real nue, real availMem, real needMem, - SetKernelBlockVisitor::Action action) - : Block3DVisitor(0, D3Q27System::MAXLEVEL), kernel(std::move(kernel)), nue(nue), action(action), dataSetFlag(true) +SetKernelBlockVisitor::SetKernelBlockVisitor(SPtr<LBMKernel> kernel, real nue, SetKernelBlockVisitor::Action action) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), kernel(std::move(kernel)), nue(nue), action(action) { - if (needMem > availMem) { - throw UbException(UB_EXARGS, "SetKernelBlockVisitor: Not enough memory!!!"); - } } SetKernelBlockVisitor::SetKernelBlockVisitor(SPtr<LBMKernel> kernel, real nue, int numberOfProcesses, SetKernelBlockVisitor::Action action) - : Block3DVisitor(0, D3Q27System::MAXLEVEL), kernel(std::move(kernel)), nue(nue), action(action), dataSetFlag(true), - numberOfProcesses(numberOfProcesses) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), kernel(std::move(kernel)), nue(nue), action(action), numberOfProcesses(numberOfProcesses) { } @@ -112,8 +107,6 @@ void SetKernelBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block) } } -void SetKernelBlockVisitor::setNoDataSetFlag(bool flag) { dataSetFlag = flag; } - void SetKernelBlockVisitor::throwExceptionIfNotEnoughMemory(const SPtr<Grid3D> &grid) { auto availableMemory = Utilities::getTotalPhysMem(); diff --git a/src/cpu/core/Visitors/SetKernelBlockVisitor.h b/src/cpu/core/Visitors/SetKernelBlockVisitor.h index 29685f49908e5266dc5307f17da42c9e8c874491..dee716f27f97e5d9ef98e9bbd8fce9f34ef900c1 100644 --- a/src/cpu/core/Visitors/SetKernelBlockVisitor.h +++ b/src/cpu/core/Visitors/SetKernelBlockVisitor.h @@ -49,8 +49,7 @@ class SetKernelBlockVisitor : public Block3DVisitor public: enum Action { NewKernel, ChangeKernel, ChangeKernelWithData }; - SetKernelBlockVisitor(SPtr<LBMKernel> kernel, real nue, real availMem, real needMem, - SetKernelBlockVisitor::Action action = SetKernelBlockVisitor::NewKernel); + SetKernelBlockVisitor(SPtr<LBMKernel> kernel, real nue, SetKernelBlockVisitor::Action action = SetKernelBlockVisitor::NewKernel); SetKernelBlockVisitor(SPtr<LBMKernel> kernel, real nue, int numberOfProcesses, SetKernelBlockVisitor::Action action = SetKernelBlockVisitor::NewKernel); @@ -59,13 +58,10 @@ public: void visit(SPtr<Grid3D> grid, SPtr<Block3D> block) override; - void setNoDataSetFlag(bool flag); - private: SPtr<LBMKernel> kernel; real nue; Action action; - bool dataSetFlag; int numberOfProcesses{ 1 }; diff --git a/src/cpu/core/Visitors/SetUndefinedNodesBlockVisitor.cpp b/src/cpu/core/Visitors/SetUndefinedNodesBlockVisitor.cpp index 797e8886e7825075cbff8ce9e762d0286dc81bea..407fca9b7390b07129a2e4c133fcbc7e3c0498df 100644 --- a/src/cpu/core/Visitors/SetUndefinedNodesBlockVisitor.cpp +++ b/src/cpu/core/Visitors/SetUndefinedNodesBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SetUndefinedNodesBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #include "SetUndefinedNodesBlockVisitor.h" #include "BCArray3D.h" #include "BCSet.h" diff --git a/src/cpu/core/Visitors/SetUndefinedNodesBlockVisitor.h b/src/cpu/core/Visitors/SetUndefinedNodesBlockVisitor.h index 17fa5b2ebb2b7230955e9ce4209a3cb341369326..7156051f64d1a6054ede454c34da012a2a0ac6a3 100644 --- a/src/cpu/core/Visitors/SetUndefinedNodesBlockVisitor.h +++ b/src/cpu/core/Visitors/SetUndefinedNodesBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SetUndefinedNodesBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef SetUndefinedNodesBlockVisitor_h #define SetUndefinedNodesBlockVisitor_h diff --git a/src/cpu/core/Visitors/SpongeLayerBlockVisitor.cpp b/src/cpu/core/Visitors/SpongeLayerBlockVisitor.cpp index 01bb35cd52b78231a82651575006d7682afbdda5..c4e65c38736791f70d32bfa4d3cdf86c57d81180 100644 --- a/src/cpu/core/Visitors/SpongeLayerBlockVisitor.cpp +++ b/src/cpu/core/Visitors/SpongeLayerBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SpongeLayerBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #include "SpongeLayerBlockVisitor.h" #include "D3Q27System.h" #include "LBMSystem.h" diff --git a/src/cpu/core/Visitors/SpongeLayerBlockVisitor.h b/src/cpu/core/Visitors/SpongeLayerBlockVisitor.h index 184a89eba969f3a6506c83758b79d11cfb8d3d60..7d00cc28070ab4a61c3cc812e3b81250fccb089d 100644 --- a/src/cpu/core/Visitors/SpongeLayerBlockVisitor.h +++ b/src/cpu/core/Visitors/SpongeLayerBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file SpongeLayerBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef SpongeLayerBlockVisitor_h__ #define SpongeLayerBlockVisitor_h__ diff --git a/src/cpu/core/Visitors/ViscosityBlockVisitor.cpp b/src/cpu/core/Visitors/ViscosityBlockVisitor.cpp index 3dbe4d9c7c01a11f33d0f1e04a563ba1016a748b..a32e889160131d4690b96808062e6ae0725e2f72 100644 --- a/src/cpu/core/Visitors/ViscosityBlockVisitor.cpp +++ b/src/cpu/core/Visitors/ViscosityBlockVisitor.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ViscosityBlockVisitor.cpp +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #include "ViscosityBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" diff --git a/src/cpu/core/Visitors/ViscosityBlockVisitor.h b/src/cpu/core/Visitors/ViscosityBlockVisitor.h index cb665f41c47f62d61584943bdf6f3ce64f84cc4f..abf42d60aefffc4e42af4b3baff03f92d2d94b1e 100644 --- a/src/cpu/core/Visitors/ViscosityBlockVisitor.h +++ b/src/cpu/core/Visitors/ViscosityBlockVisitor.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ViscosityBlockVisitor.h +//! \ingroup Visitors +//! \author Konstantin Kutscher +//======================================================================================= #ifndef ViscosityBlockVisitor_h #define ViscosityBlockVisitor_h diff --git a/src/gpu/core/Calculation/CalcMedian.cpp b/src/gpu/core/Calculation/CalcMean.cpp similarity index 86% rename from src/gpu/core/Calculation/CalcMedian.cpp rename to src/gpu/core/Calculation/CalcMean.cpp index f2056c24c6baffa5b227a111bd66d7dbf815e373..69e971040720811bc34f7272b3189ae019f6a70b 100644 --- a/src/gpu/core/Calculation/CalcMedian.cpp +++ b/src/gpu/core/Calculation/CalcMean.cpp @@ -5,15 +5,15 @@ // |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ \____/_/ \_____/ // ////////////////////////////////////////////////////////////////////////// -#include "Calculation/CalcMedian.h" +#include "Calculation/CalcMean.h" #include <cuda_runtime.h> #include <helper_cuda.h> -void allocMedian(Parameter* para, CudaMemoryManager* cudaMemoryManager) +void allocMean(Parameter* para, CudaMemoryManager* cudaMemoryManager) { for (int lev = para->getCoarse(); lev <= para->getFine(); lev++) { - cudaMemoryManager->cudaAllocMedianOut(lev); + cudaMemoryManager->cudaAllocMeanOut(lev); for (size_t pos = 0; pos < para->getParH(lev)->numberOfNodes; pos++) { para->getParH(lev)->vx_SP_Med_Out[pos] = (real)0.0; @@ -29,7 +29,7 @@ void allocMedian(Parameter* para, CudaMemoryManager* cudaMemoryManager) -void calcMedian(Parameter* para, uint tdiff) +void calcMean(Parameter* para, uint tdiff) { for (int lev = para->getCoarse(); lev <= para->getFine(); lev++) { @@ -48,11 +48,11 @@ void calcMedian(Parameter* para, uint tdiff) -void resetMedian(Parameter* para) +void resetMean(Parameter* para) { for (int lev = para->getCoarse(); lev <= para->getFine(); lev++) { - ResetMedianValuesSP27( + ResetMeanValuesSP27( para->getParD(lev)->vx_SP_Med, para->getParD(lev)->vy_SP_Med, para->getParD(lev)->vz_SP_Med, @@ -61,7 +61,7 @@ void resetMedian(Parameter* para) para->getParD(lev)->numberOfNodes, para->getParD(lev)->numberofthreads, para->getParD(lev)->isEvenTimestep); - getLastCudaError("ResetMedianValuesSP27 execution failed"); + getLastCudaError("ResetMeanValuesSP27 execution failed"); } } @@ -70,11 +70,11 @@ void resetMedian(Parameter* para) //Advection-Diffusion -void allocMedianAD(Parameter* para, CudaMemoryManager* cudaMemoryManager) +void allocMeanAD(Parameter* para, CudaMemoryManager* cudaMemoryManager) { for (int lev = para->getCoarse(); lev <= para->getFine(); lev++) { - cudaMemoryManager->cudaAllocMedianOutAD(lev); + cudaMemoryManager->cudaAllocMeanOutAD(lev); for (size_t pos = 0; pos < para->getParH(lev)->numberOfNodes; pos++) { para->getParH(lev)->vx_SP_Med_Out[pos] = (real)0.0; @@ -91,7 +91,7 @@ void allocMedianAD(Parameter* para, CudaMemoryManager* cudaMemoryManager) -void calcMedianAD(Parameter* para, uint tdiff) +void calcMeanAD(Parameter* para, uint tdiff) { for (int lev = para->getCoarse(); lev <= para->getFine(); lev++) { @@ -111,11 +111,11 @@ void calcMedianAD(Parameter* para, uint tdiff) -void resetMedianAD(Parameter* para) +void resetMeanAD(Parameter* para) { for (int lev = para->getCoarse(); lev <= para->getFine(); lev++) { - ResetMedianValuesAD27( + ResetMeanValuesAD27( para->getParD(lev)->vx_SP_Med, para->getParD(lev)->vy_SP_Med, para->getParD(lev)->vz_SP_Med, @@ -125,7 +125,7 @@ void resetMedianAD(Parameter* para) para->getParD(lev)->numberOfNodes, para->getParD(lev)->numberofthreads, para->getParD(lev)->isEvenTimestep); - getLastCudaError("ResetMedianValuesSP27 execution failed"); + getLastCudaError("ResetMeanValuesAD27 execution failed"); } } diff --git a/src/gpu/core/Calculation/CalcMean.h b/src/gpu/core/Calculation/CalcMean.h new file mode 100644 index 0000000000000000000000000000000000000000..46b82baaf25fea041d37e46a406b57916f7a6ff7 --- /dev/null +++ b/src/gpu/core/Calculation/CalcMean.h @@ -0,0 +1,14 @@ +#ifndef CalcMean_H +#define CalcMean_H + +#include "LBM/LB.h" +#include "GPU/GPU_Interface.h" +#include "Parameter/Parameter.h" +#include "GPU/CudaMemoryManager.h" + +void allocMean(Parameter* para, CudaMemoryManager* cudaMemoryManager); +void allocMeanAD(Parameter* para, CudaMemoryManager* cudaMemoryManager); +void calcMean(Parameter* para, unsigned int tdiff); +void resetMean(Parameter* para); + +#endif diff --git a/src/gpu/core/Calculation/CalcMedian.h b/src/gpu/core/Calculation/CalcMedian.h deleted file mode 100644 index 262c22a1a557bfdd6aefaee492d2f8351f166599..0000000000000000000000000000000000000000 --- a/src/gpu/core/Calculation/CalcMedian.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef CalcMedian_H -#define CalcMedian_H - -#include "LBM/LB.h" -#include "GPU/GPU_Interface.h" -#include "Parameter/Parameter.h" -#include "GPU/CudaMemoryManager.h" - -void allocMedian(Parameter* para, CudaMemoryManager* cudaMemoryManager); -void allocMedianAD(Parameter* para, CudaMemoryManager* cudaMemoryManager); -void calcMedian(Parameter* para, unsigned int tdiff); -void resetMedian(Parameter* para); - -#endif diff --git a/src/gpu/core/DataStructureInitializer/GridProvider.cpp b/src/gpu/core/DataStructureInitializer/GridProvider.cpp index 1cd12f9ba5c48a46f05b1e41f190790dd163632f..02a98e46bb1985d7c3a5926cd196ea90f78e212c 100644 --- a/src/gpu/core/DataStructureInitializer/GridProvider.cpp +++ b/src/gpu/core/DataStructureInitializer/GridProvider.cpp @@ -65,7 +65,7 @@ void GridProvider::setInitialNodeValues(uint numberOfNodes, int level) const ////////////////////////////////////////////////////////////////////////// - if (para->getCalcMedian()) { + if (para->getCalcMean()) { para->getParH(level)->vx_SP_Med[pos] = 0.0f; para->getParH(level)->vy_SP_Med[pos] = 0.0f; para->getParH(level)->vz_SP_Med[pos] = 0.0f; diff --git a/src/gpu/core/GPU/CalcMac27.cu b/src/gpu/core/GPU/CalcMac27.cu index 607be0840d15fceeaab5da71fa3ed430b6b2247b..f2e92d43a543791d8c6449aff52ab7a9e9ccdc14 100644 --- a/src/gpu/core/GPU/CalcMac27.cu +++ b/src/gpu/core/GPU/CalcMac27.cu @@ -974,7 +974,7 @@ __global__ void LBCalcMacMedSP27( //////////////////////////////////////////////////////////////////////////////// -__global__ void LBResetMedianValuesSP27( +__global__ void LBResetMeanValuesSP27( real* vxD, real* vyD, real* vzD, @@ -1022,7 +1022,7 @@ __global__ void LBResetMedianValuesSP27( //////////////////////////////////////////////////////////////////////////////// -__global__ void LBResetMedianValuesAD27( +__global__ void LBResetMeanValuesAD27( real* vxD, real* vyD, real* vzD, diff --git a/src/gpu/core/GPU/CudaMemoryManager.cpp b/src/gpu/core/GPU/CudaMemoryManager.cpp index 211d8f070a1d3cde7579cfedd427bd7436827365..a1b9b39fc9da1aa1ad0eab80903a642ea06d15fa 100644 --- a/src/gpu/core/GPU/CudaMemoryManager.cpp +++ b/src/gpu/core/GPU/CudaMemoryManager.cpp @@ -34,7 +34,7 @@ void CudaMemoryManager::cudaCopyPrint(int lev) checkCudaErrors( cudaMemcpy(parameter->getParH(lev)->turbViscosity , parameter->getParD(lev)->turbViscosity , parameter->getParH(lev)->memSizeRealLBnodes , cudaMemcpyDeviceToHost)); } } -void CudaMemoryManager::cudaCopyMedianPrint(int lev) +void CudaMemoryManager::cudaCopyMeanPrint(int lev) { checkCudaErrors( cudaMemcpy(parameter->getParH(lev)->vx_SP_Med , parameter->getParD(lev)->vx_SP_Med , parameter->getParH(lev)->memSizeRealLBnodes , cudaMemcpyDeviceToHost)); checkCudaErrors( cudaMemcpy(parameter->getParH(lev)->vy_SP_Med , parameter->getParD(lev)->vy_SP_Med , parameter->getParH(lev)->memSizeRealLBnodes , cudaMemcpyDeviceToHost)); @@ -988,8 +988,8 @@ void CudaMemoryManager::cudaFreeTurbulenceIntensity(int lev) checkCudaErrors( cudaFreeHost(parameter->getParH(lev)->vy_mean )); checkCudaErrors( cudaFreeHost(parameter->getParH(lev)->vz_mean )); } -//median -void CudaMemoryManager::cudaAllocMedianSP(int lev) +//mean +void CudaMemoryManager::cudaAllocMeanSP(int lev) { //Host checkCudaErrors( cudaMallocHost((void**) &(parameter->getParH(lev)->rho_SP_Med ), parameter->getParH(lev)->memSizeRealLBnodes)); @@ -1007,7 +1007,7 @@ void CudaMemoryManager::cudaAllocMedianSP(int lev) double tmp = 5. * (double)parameter->getParH(lev)->memSizeRealLBnodes; setMemsizeGPU(tmp, false); } -void CudaMemoryManager::cudaCopyMedianSP(int lev) +void CudaMemoryManager::cudaCopyMeanSP(int lev) { //copy host to device checkCudaErrors( cudaMemcpy(parameter->getParD(lev)->rho_SP_Med , parameter->getParH(lev)->rho_SP_Med , parameter->getParH(lev)->memSizeRealLBnodes , cudaMemcpyHostToDevice)); @@ -1016,7 +1016,7 @@ void CudaMemoryManager::cudaCopyMedianSP(int lev) checkCudaErrors( cudaMemcpy(parameter->getParD(lev)->vz_SP_Med , parameter->getParH(lev)->vz_SP_Med , parameter->getParH(lev)->memSizeRealLBnodes , cudaMemcpyHostToDevice)); checkCudaErrors( cudaMemcpy(parameter->getParD(lev)->press_SP_Med, parameter->getParH(lev)->press_SP_Med, parameter->getParH(lev)->memSizeRealLBnodes , cudaMemcpyHostToDevice)); } -void CudaMemoryManager::cudaFreeMedianSP(int lev) +void CudaMemoryManager::cudaFreeMeanSP(int lev) { checkCudaErrors( cudaFreeHost(parameter->getParH(lev)->vx_SP_Med )); checkCudaErrors( cudaFreeHost(parameter->getParH(lev)->vy_SP_Med )); @@ -1024,7 +1024,7 @@ void CudaMemoryManager::cudaFreeMedianSP(int lev) checkCudaErrors( cudaFreeHost(parameter->getParH(lev)->rho_SP_Med )); checkCudaErrors( cudaFreeHost(parameter->getParH(lev)->press_SP_Med)); } -void CudaMemoryManager::cudaAllocMedianOut(int lev) +void CudaMemoryManager::cudaAllocMeanOut(int lev) { //Host checkCudaErrors( cudaMallocHost((void**) &(parameter->getParH(lev)->rho_SP_Med_Out ), parameter->getParH(lev)->memSizeRealLBnodes)); @@ -1033,7 +1033,7 @@ void CudaMemoryManager::cudaAllocMedianOut(int lev) checkCudaErrors( cudaMallocHost((void**) &(parameter->getParH(lev)->vz_SP_Med_Out ), parameter->getParH(lev)->memSizeRealLBnodes)); checkCudaErrors( cudaMallocHost((void**) &(parameter->getParH(lev)->press_SP_Med_Out ), parameter->getParH(lev)->memSizeRealLBnodes)); } -void CudaMemoryManager::cudaFreeMedianOut(int lev) +void CudaMemoryManager::cudaFreeMeanOut(int lev) { checkCudaErrors( cudaFreeHost(parameter->getParH(lev)->vx_SP_Med_Out )); checkCudaErrors( cudaFreeHost(parameter->getParH(lev)->vy_SP_Med_Out )); @@ -2500,7 +2500,7 @@ void CudaMemoryManager::cudaFreeConcFile(int lev) checkCudaErrors( cudaFreeHost(parameter->getParH(lev)->concIndex)); } ////////////////////////////////////////////////////////////////////////// -void CudaMemoryManager::cudaAllocMedianOutAD(int lev) +void CudaMemoryManager::cudaAllocMeanOutAD(int lev) { //Host checkCudaErrors(cudaMallocHost((void**) &(parameter->getParH(lev)->rho_SP_Med_Out), parameter->getParH(lev)->memSizeRealLBnodes)); @@ -2510,7 +2510,7 @@ void CudaMemoryManager::cudaAllocMedianOutAD(int lev) checkCudaErrors(cudaMallocHost((void**) &(parameter->getParH(lev)->press_SP_Med_Out), parameter->getParH(lev)->memSizeRealLBnodes)); checkCudaErrors(cudaMallocHost((void**) &(parameter->getParH(lev)->Conc_Med_Out), parameter->getParH(lev)->memSizeRealLBnodes)); } -void CudaMemoryManager::cudaFreeMedianOutAD(int lev) +void CudaMemoryManager::cudaFreeMeanOutAD(int lev) { checkCudaErrors(cudaFreeHost(parameter->getParH(lev)->vx_SP_Med_Out)); checkCudaErrors(cudaFreeHost(parameter->getParH(lev)->vy_SP_Med_Out)); diff --git a/src/gpu/core/GPU/CudaMemoryManager.h b/src/gpu/core/GPU/CudaMemoryManager.h index 6d67b671ddcd9b906c081f706cde2249b1220399..b41fcf1a28c0a4ce4f020e278e7413d46d4e7822 100644 --- a/src/gpu/core/GPU/CudaMemoryManager.h +++ b/src/gpu/core/GPU/CudaMemoryManager.h @@ -39,7 +39,7 @@ public: double getMemsizeGPU(); void cudaCopyPrint(int lev); - void cudaCopyMedianPrint(int lev); + void cudaCopyMeanPrint(int lev); void cudaAllocCoord(int lev); void cudaCopyCoord(int lev); @@ -147,15 +147,15 @@ public: void cudaCopyTurbulenceIntensityDH(int lev, uint size); void cudaFreeTurbulenceIntensity(int lev); - void cudaAllocMedianSP(int lev); - void cudaCopyMedianSP(int lev); - void cudaFreeMedianSP(int lev); + void cudaAllocMeanSP(int lev); + void cudaCopyMeanSP(int lev); + void cudaFreeMeanSP(int lev); - void cudaAllocMedianOut(int lev); - void cudaFreeMedianOut(int lev); + void cudaAllocMeanOut(int lev); + void cudaFreeMeanOut(int lev); - void cudaAllocMedianOutAD(int lev); - void cudaFreeMedianOutAD(int lev); + void cudaAllocMeanOutAD(int lev); + void cudaFreeMeanOutAD(int lev); void cudaAllocInterfaceCF(int lev); void cudaCopyInterfaceCF(int lev); diff --git a/src/gpu/core/GPU/GPU_Interface.h b/src/gpu/core/GPU/GPU_Interface.h index 4d6bade8b398c7c60f0d87a6b5dc61215d4c87b3..dc3ac7370a5af615d0ed3ea1ef533c4c1c424ca3 100644 --- a/src/gpu/core/GPU/GPU_Interface.h +++ b/src/gpu/core/GPU/GPU_Interface.h @@ -35,17 +35,6 @@ #include <cuda.h> #include <cuda_runtime.h> -#include <curand.h> - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -#pragma clang diagnostic ignored "-Wunused-but-set-parameter" -#endif -#include <curand_kernel.h> -#ifdef __clang__ -#pragma clang diagnostic pop -#endif struct LBMSimulationParameter; class Parameter; @@ -197,7 +186,7 @@ void CalcMacMedSP27( real* vxD, unsigned int numberOfThreads, bool isEvenTimestep); -void ResetMedianValuesSP27( +void ResetMeanValuesSP27( real* vxD, real* vyD, real* vzD, @@ -207,7 +196,7 @@ void ResetMedianValuesSP27( unsigned int numberOfThreads, bool isEvenTimestep); -void ResetMedianValuesAD27( +void ResetMeanValuesAD27( real* vxD, real* vyD, real* vzD, @@ -1458,21 +1447,6 @@ void setRecvGsDevF3( bool isEvenTimestep, unsigned int numberOfThreads); -void WallFuncDev27(unsigned int numberOfThreads, - real* vx, - real* vy, - real* vz, - real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - void SetOutputWallVelocitySP27(unsigned int numberOfThreads, real* vxD, real* vyD, @@ -1492,19 +1466,6 @@ void SetOutputWallVelocitySP27(unsigned int numberOfThreads, real* DD, bool isEvenTimestep); -void GetVelotoForce27(unsigned int numberOfThreads, - real* DD, - int* bcIndex, - int nonAtBC, - real* Vx, - real* Vy, - real* Vz, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - void CalcTurbulenceIntensityDevice( real* vxx, real* vyy, diff --git a/src/gpu/core/GPU/GPU_Kernels.cuh b/src/gpu/core/GPU/GPU_Kernels.cuh index 0dbb8ebdcb633aee222e972e27b43c71d5c9bb6a..de38cb7338f34501c1b6d1c54382b40ebd96c63f 100644 --- a/src/gpu/core/GPU/GPU_Kernels.cuh +++ b/src/gpu/core/GPU/GPU_Kernels.cuh @@ -166,7 +166,7 @@ __global__ void LBCalcMacMedSP27( real* vxD, unsigned long long numberOfLBnodes, bool isEvenTimestep); -__global__ void LBResetMedianValuesSP27( +__global__ void LBResetMeanValuesSP27( real* vxD, real* vyD, real* vzD, @@ -175,7 +175,7 @@ __global__ void LBResetMedianValuesSP27( unsigned long long numberOfLBnodes, bool isEvenTimestep); -__global__ void LBResetMedianValuesAD27( +__global__ void LBResetMeanValuesAD27( real* vxD, real* vyD, real* vzD, @@ -1425,20 +1425,6 @@ __global__ void setRecvGsF3( unsigned long long numberOfLBnodes, bool isEvenTimestep); -__global__ void WallFunction27( real* vx, - real* vy, - real* vz, - real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - __global__ void LBSetOutputWallVelocitySP27( real* vxD, real* vyD, real* vzD, @@ -1457,18 +1443,6 @@ __global__ void LBSetOutputWallVelocitySP27( real* vxD, real* DD, bool isEvenTimestep); -__global__ void GetVeloforForcing27( real* DD, - int* bcIndex, - int nonAtBC, - real* Vx, - real* Vy, - real* Vz, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep); - __global__ void CalcTurbulenceIntensity( real* vxx, real* vyy, diff --git a/src/gpu/core/GPU/LBMKernel.cu b/src/gpu/core/GPU/LBMKernel.cu index 50832cb2f3aadfeafa6c1bb1e02959524679dfef..6f063b302867b60481984d83ab2df48e91f62c6e 100644 --- a/src/gpu/core/GPU/LBMKernel.cu +++ b/src/gpu/core/GPU/LBMKernel.cu @@ -385,7 +385,7 @@ void CalcMacMedSP27( getLastCudaError("LBCalcMacMedSP27 execution failed"); } ////////////////////////////////////////////////////////////////////////// -void ResetMedianValuesSP27( +void ResetMeanValuesSP27( real* vxD, real* vyD, real* vzD, @@ -397,7 +397,7 @@ void ResetMedianValuesSP27( { vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(numberOfThreads, numberOfLBnodes); - LBResetMedianValuesSP27 <<< grid.grid, grid.threads >>> ( + LBResetMeanValuesSP27 <<< grid.grid, grid.threads >>> ( vxD, vyD, vzD, @@ -405,10 +405,10 @@ void ResetMedianValuesSP27( pressD, numberOfLBnodes, isEvenTimestep); - getLastCudaError("LBResetMedianValuesSP27 execution failed"); + getLastCudaError("LBResetMeanValuesSP27 execution failed"); } ////////////////////////////////////////////////////////////////////////// -void ResetMedianValuesAD27( +void ResetMeanValuesAD27( real* vxD, real* vyD, real* vzD, @@ -421,7 +421,7 @@ void ResetMedianValuesAD27( { vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(numberOfThreads, numberOfLBnodes); - LBResetMedianValuesAD27 <<< grid.grid, grid.threads >>> ( + LBResetMeanValuesAD27 <<< grid.grid, grid.threads >>> ( vxD, vyD, vzD, @@ -430,7 +430,7 @@ void ResetMedianValuesAD27( concD, numberOfLBnodes, isEvenTimestep); - getLastCudaError("LBResetMedianValuesAD27 execution failed"); + getLastCudaError("LBResetMeanValuesAD27 execution failed"); } ////////////////////////////////////////////////////////////////////////// void Calc2ndMomentsIncompSP27( @@ -3319,41 +3319,6 @@ void setRecvGsDevF3( getLastCudaError("setRecvGsF3 execution failed"); } ////////////////////////////////////////////////////////////////////////// -void WallFuncDev27( - unsigned int numberOfThreads, - real* vx, - real* vy, - real* vz, - real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(numberOfThreads, numberOfBCnodes); - - WallFunction27<<< grid.grid, grid.threads >>> ( - vx, - vy, - vz, - DD, - k_Q, - QQ, - numberOfBCnodes, - om1, - neighborX, - neighborY, - neighborZ, - numberOfLBnodes, - isEvenTimestep); - getLastCudaError("WallFunction27 execution failed"); -} -////////////////////////////////////////////////////////////////////////// void SetOutputWallVelocitySP27( unsigned int numberOfThreads, real* vxD, @@ -3397,37 +3362,6 @@ void SetOutputWallVelocitySP27( getLastCudaError("LBSetOutputWallVelocitySP27 execution failed"); } ////////////////////////////////////////////////////////////////////////// -void GetVelotoForce27( - unsigned int numberOfThreads, - real* DD, - int* bcIndex, - int nonAtBC, - real* Vx, - real* Vy, - real* Vz, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - vf::cuda::CudaGrid grid = vf::cuda::CudaGrid(numberOfThreads, nonAtBC); - - GetVeloforForcing27<<< grid.grid, grid.threads >>> ( - DD, - bcIndex, - nonAtBC, - Vx, - Vy, - Vz, - neighborX, - neighborY, - neighborZ, - numberOfLBnodes, - isEvenTimestep); - getLastCudaError("GetVeloforForcing27 execution failed"); -} -////////////////////////////////////////////////////////////////////////// void CalcTurbulenceIntensityDevice( real* vxx, real* vyy, diff --git a/src/gpu/core/GPU/Random.cu b/src/gpu/core/GPU/Random.cu deleted file mode 100644 index 603cd14c42e9afdfa9912883a316742edc31f106..0000000000000000000000000000000000000000 --- a/src/gpu/core/GPU/Random.cu +++ /dev/null @@ -1,59 +0,0 @@ -/* Device code */ -#include "LBM/LB.h" -#include "lbm/constants/D3Q27.h" -#include <basics/constants/NumericConstants.h> - -using namespace vf::basics::constant; -using namespace vf::lbm::dir; - -//random numbers -#include <curand.h> -#include <curand_kernel.h> - - -////////////////////////////////////////////////////////////////////////////// -__global__ void initRandom(curandState* state) -{ - //////////////////////////////////////////////////////////////////////////////// - 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; - ////////////////////////////////////////////////////////////////////////// - - curand_init(k, k, 0, &state[k]); - - ////////////////////////////////////////////////////////////////////////// -} -////////////////////////////////////////////////////////////////////////////// - - - - - -////////////////////////////////////////////////////////////////////////////// -__global__ void generateRandomValues(curandState* state, real* randArray) -{ - //////////////////////////////////////////////////////////////////////////////// - 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; - ////////////////////////////////////////////////////////////////////////// - - randArray[k] = (real)curand_uniform(&state[k]); - - ////////////////////////////////////////////////////////////////////////// -} -////////////////////////////////////////////////////////////////////////////// - - - diff --git a/src/gpu/core/GPU/SetForcing27.cu b/src/gpu/core/GPU/SetForcing27.cu deleted file mode 100644 index 63e8e95e69cd032a9e89aa12c11980ae429083ae..0000000000000000000000000000000000000000 --- a/src/gpu/core/GPU/SetForcing27.cu +++ /dev/null @@ -1,174 +0,0 @@ -/* Device code */ -#include "LBM/LB.h" -#include "lbm/constants/D3Q27.h" -#include <basics/constants/NumericConstants.h> - -using namespace vf::basics::constant; -using namespace vf::lbm::dir; - -//////////////////////////////////////////////////////////////////////////////// -__global__ void GetVeloforForcing27( real* DD, - int* bcIndex, - int nonAtBC, - real* Vx, - real* Vy, - real* Vz, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - Distributions27 D; - if (isEvenTimestep==false) - { - D.f[dP00] = &DD[dP00 * numberOfLBnodes]; - D.f[dM00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00P] = &DD[d00P * numberOfLBnodes]; - D.f[d00M] = &DD[d00M * numberOfLBnodes]; - D.f[dPP0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dMM0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dP0P] = &DD[dP0P * numberOfLBnodes]; - D.f[dM0M] = &DD[dM0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dP0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dM0P * numberOfLBnodes]; - D.f[d0PP] = &DD[d0PP * numberOfLBnodes]; - D.f[d0MM] = &DD[d0MM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0PM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dPPP * numberOfLBnodes]; - D.f[dMMP] = &DD[dMMP * numberOfLBnodes]; - D.f[dPMP] = &DD[dPMP * numberOfLBnodes]; - D.f[dMPP] = &DD[dMPP * numberOfLBnodes]; - D.f[dPPM] = &DD[dPPM * numberOfLBnodes]; - D.f[dMMM] = &DD[dMMM * numberOfLBnodes]; - D.f[dPMM] = &DD[dPMM * numberOfLBnodes]; - D.f[dMPM] = &DD[dMPM * numberOfLBnodes]; - } - else - { - D.f[dM00] = &DD[dP00 * numberOfLBnodes]; - D.f[dP00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00M] = &DD[d00P * numberOfLBnodes]; - D.f[d00P] = &DD[d00M * numberOfLBnodes]; - D.f[dMM0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dPP0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dM0M] = &DD[dP0P * numberOfLBnodes]; - D.f[dP0P] = &DD[dM0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dP0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dM0P * numberOfLBnodes]; - D.f[d0MM] = &DD[d0PP * numberOfLBnodes]; - D.f[d0PP] = &DD[d0MM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0PM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dMMM * numberOfLBnodes]; - D.f[dMMP] = &DD[dPPM * numberOfLBnodes]; - D.f[dPMP] = &DD[dMPM * numberOfLBnodes]; - D.f[dMPP] = &DD[dPMM * numberOfLBnodes]; - D.f[dPPM] = &DD[dMMP * numberOfLBnodes]; - D.f[dMMM] = &DD[dPPP * numberOfLBnodes]; - D.f[dPMM] = &DD[dMPP * numberOfLBnodes]; - D.f[dMPM] = &DD[dPMP * numberOfLBnodes]; - } - //////////////////////////////////////////////////////////////////////////////// - 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 < nonAtBC) - { - //////////////////////////////////////////////////////////////////////////////// - //index - unsigned int KQK = bcIndex[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 mfcbb = (D.f[dP00])[ke ]; - real mfabb = (D.f[dM00])[kw ]; - real mfbcb = (D.f[d0P0])[kn ]; - real mfbab = (D.f[d0M0])[ks ]; - real mfbbc = (D.f[d00P])[kt ]; - real mfbba = (D.f[d00M])[kb ]; - real mfccb = (D.f[dPP0])[kne ]; - real mfaab = (D.f[dMM0])[ksw ]; - real mfcab = (D.f[dPM0])[kse ]; - real mfacb = (D.f[dMP0])[knw ]; - real mfcbc = (D.f[dP0P])[kte ]; - real mfaba = (D.f[dM0M])[kbw ]; - real mfcba = (D.f[dP0M])[kbe ]; - real mfabc = (D.f[dM0P])[ktw ]; - real mfbcc = (D.f[d0PP])[ktn ]; - real mfbaa = (D.f[d0MM])[kbs ]; - real mfbca = (D.f[d0PM])[kbn ]; - real mfbac = (D.f[d0MP])[kts ]; - real mfbbb = (D.f[d000])[kzero]; - real mfccc = (D.f[dPPP])[ktne ]; - real mfaac = (D.f[dMMP])[ktsw ]; - real mfcac = (D.f[dPMP])[ktse ]; - real mfacc = (D.f[dMPP])[ktnw ]; - real mfcca = (D.f[dPPM])[kbne ]; - real mfaaa = (D.f[dMMM])[kbsw ]; - real mfcaa = (D.f[dPMM])[kbse ]; - real mfaca = (D.f[dMPM])[kbnw ]; - //////////////////////////////////////////////////////////////////////////////////// - real rho = (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 + c1o1);//!!!!Achtung + one - //////////////////////////////////////////////////////////////////////////////////// - real vx =((((mfccc-mfaaa) + (mfcac-mfaca)) + ((mfcaa-mfacc) + (mfcca-mfaac))) + - (((mfcba-mfabc) + (mfcbc-mfaba)) + ((mfcab-mfacb) + (mfccb-mfaab))) + - (mfcbb-mfabb))/ rho; - real vy =((((mfccc-mfaaa) + (mfaca-mfcac)) + ((mfacc-mfcaa) + (mfcca-mfaac))) + - (((mfbca-mfbac) + (mfbcc-mfbaa)) + ((mfacb-mfcab) + (mfccb-mfaab))) + - (mfbcb-mfbab)) / rho; - real vz =((((mfccc-mfaaa) + (mfcac-mfaca)) + ((mfacc-mfcaa) + (mfaac-mfcca))) + - (((mfbac-mfbca) + (mfbcc-mfbaa)) + ((mfabc-mfcba) + (mfcbc-mfaba))) + - (mfbbc-mfbba)) / rho; - //////////////////////////////////////////////////////////////////////////////////// - Vx[k] = vx; - Vy[k] = vy; - Vz[k] = vz; - //////////////////////////////////////////////////////////////////////////////////// - } -} - diff --git a/src/gpu/core/GPU/WallFunction.cu b/src/gpu/core/GPU/WallFunction.cu deleted file mode 100644 index 0c81eba65f7c5d8f711bee9499168d4fa73de9bd..0000000000000000000000000000000000000000 --- a/src/gpu/core/GPU/WallFunction.cu +++ /dev/null @@ -1,520 +0,0 @@ -/* Device code */ -#include "LBM/LB.h" -#include "lbm/constants/D3Q27.h" -#include <basics/constants/NumericConstants.h> - -using namespace vf::basics::constant; -using namespace vf::lbm::dir; - - -////////////////////////////////////////////////////////////////////////////// -__global__ void WallFunction27( - real* vx, - real* vy, - real* vz, - real* DD, - int* k_Q, - real* QQ, - unsigned int numberOfBCnodes, - real om1, - unsigned int* neighborX, - unsigned int* neighborY, - unsigned int* neighborZ, - unsigned long long numberOfLBnodes, - bool isEvenTimestep) -{ - Distributions27 D; - if (isEvenTimestep==true) - { - D.f[dP00] = &DD[dP00 * numberOfLBnodes]; - D.f[dM00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00P] = &DD[d00P * numberOfLBnodes]; - D.f[d00M] = &DD[d00M * numberOfLBnodes]; - D.f[dPP0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dMM0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dP0P] = &DD[dP0P * numberOfLBnodes]; - D.f[dM0M] = &DD[dM0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dP0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dM0P * numberOfLBnodes]; - D.f[d0PP] = &DD[d0PP * numberOfLBnodes]; - D.f[d0MM] = &DD[d0MM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0PM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dPPP * numberOfLBnodes]; - D.f[dMMP] = &DD[dMMP * numberOfLBnodes]; - D.f[dPMP] = &DD[dPMP * numberOfLBnodes]; - D.f[dMPP] = &DD[dMPP * numberOfLBnodes]; - D.f[dPPM] = &DD[dPPM * numberOfLBnodes]; - D.f[dMMM] = &DD[dMMM * numberOfLBnodes]; - D.f[dPMM] = &DD[dPMM * numberOfLBnodes]; - D.f[dMPM] = &DD[dMPM * numberOfLBnodes]; - } - else - { - D.f[dM00] = &DD[dP00 * numberOfLBnodes]; - D.f[dP00] = &DD[dM00 * numberOfLBnodes]; - D.f[d0M0] = &DD[d0P0 * numberOfLBnodes]; - D.f[d0P0] = &DD[d0M0 * numberOfLBnodes]; - D.f[d00M] = &DD[d00P * numberOfLBnodes]; - D.f[d00P] = &DD[d00M * numberOfLBnodes]; - D.f[dMM0] = &DD[dPP0 * numberOfLBnodes]; - D.f[dPP0] = &DD[dMM0 * numberOfLBnodes]; - D.f[dMP0] = &DD[dPM0 * numberOfLBnodes]; - D.f[dPM0] = &DD[dMP0 * numberOfLBnodes]; - D.f[dM0M] = &DD[dP0P * numberOfLBnodes]; - D.f[dP0P] = &DD[dM0M * numberOfLBnodes]; - D.f[dM0P] = &DD[dP0M * numberOfLBnodes]; - D.f[dP0M] = &DD[dM0P * numberOfLBnodes]; - D.f[d0MM] = &DD[d0PP * numberOfLBnodes]; - D.f[d0PP] = &DD[d0MM * numberOfLBnodes]; - D.f[d0MP] = &DD[d0PM * numberOfLBnodes]; - D.f[d0PM] = &DD[d0MP * numberOfLBnodes]; - D.f[d000] = &DD[d000 * numberOfLBnodes]; - D.f[dPPP] = &DD[dMMM * numberOfLBnodes]; - D.f[dMMP] = &DD[dPPM * numberOfLBnodes]; - D.f[dPMP] = &DD[dMPM * numberOfLBnodes]; - D.f[dMPP] = &DD[dPMM * numberOfLBnodes]; - D.f[dPPM] = &DD[dMMP * numberOfLBnodes]; - D.f[dMMM] = &DD[dPPP * numberOfLBnodes]; - D.f[dPMM] = &DD[dMPP * numberOfLBnodes]; - D.f[dMPM] = &DD[dPMP * numberOfLBnodes]; - } - //////////////////////////////////////////////////////////////////////////////// - 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<numberOfBCnodes) - { - //////////////////////////////////////////////////////////////////////////////// - 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 *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[dP00 * numberOfBCnodes]; - //q_dirW = &QQ[dM00 * numberOfBCnodes]; - //q_dirN = &QQ[d0P0 * numberOfBCnodes]; - //q_dirS = &QQ[d0M0 * numberOfBCnodes]; - //q_dirT = &QQ[d00P * numberOfBCnodes]; - //q_dirB = &QQ[d00M * numberOfBCnodes]; - //q_dirNE = &QQ[dPP0 * numberOfBCnodes]; - //q_dirSW = &QQ[dMM0 * numberOfBCnodes]; - //q_dirSE = &QQ[dPM0 * numberOfBCnodes]; - //q_dirNW = &QQ[dMP0 * numberOfBCnodes]; - //q_dirTE = &QQ[dP0P * numberOfBCnodes]; - //q_dirBW = &QQ[dM0M * numberOfBCnodes]; - //q_dirBE = &QQ[dP0M * numberOfBCnodes]; - //q_dirTW = &QQ[dM0P * numberOfBCnodes]; - //q_dirTN = &QQ[d0PP * numberOfBCnodes]; - //q_dirBS = &QQ[d0MM * numberOfBCnodes]; - //q_dirBN = &QQ[d0PM * numberOfBCnodes]; - //q_dirTS = &QQ[d0MP * numberOfBCnodes]; - //q_dirTNE = &QQ[dPPP * numberOfBCnodes]; - //q_dirTSW = &QQ[dMMP * numberOfBCnodes]; - //q_dirTSE = &QQ[dPMP * numberOfBCnodes]; - //q_dirTNW = &QQ[dMPP * numberOfBCnodes]; - //q_dirBNE = &QQ[dPPM * numberOfBCnodes]; - //q_dirBSW = &QQ[dMMM * numberOfBCnodes]; - //q_dirBSE = &QQ[dPMM * numberOfBCnodes]; - //q_dirBNW = &QQ[dMPM * numberOfBCnodes]; - //////////////////////////////////////////////////////////////////////////////// - //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_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[dP00])[ke ]; - f_E = (D.f[dM00])[kw ]; - f_S = (D.f[d0P0])[kn ]; - f_N = (D.f[d0M0])[ks ]; - f_B = (D.f[d00P])[kt ]; - f_T = (D.f[d00M])[kb ]; - f_SW = (D.f[dPP0])[kne ]; - f_NE = (D.f[dMM0])[ksw ]; - f_NW = (D.f[dPM0])[kse ]; - f_SE = (D.f[dMP0])[knw ]; - f_BW = (D.f[dP0P])[kte ]; - f_TE = (D.f[dM0M])[kbw ]; - f_TW = (D.f[dP0M])[kbe ]; - f_BE = (D.f[dM0P])[ktw ]; - f_BS = (D.f[d0PP])[ktn ]; - f_TN = (D.f[d0MM])[kbs ]; - f_TS = (D.f[d0PM])[kbn ]; - f_BN = (D.f[d0MP])[kts ]; - f_BSW = (D.f[dPPP])[ktne ]; - f_BNE = (D.f[dMMP])[ktsw ]; - f_BNW = (D.f[dPMP])[ktse ]; - f_BSE = (D.f[dMPP])[ktnw ]; - f_TSW = (D.f[dPPM])[kbne ]; - f_TNE = (D.f[dMMM])[kbsw ]; - f_TNW = (D.f[dPMM])[kbse ]; - f_TSE = (D.f[dMPM])[kbnw ]; - //////////////////////////////////////////////////////////////////////////////// - // 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[d000])[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) * (one + drho); - - real nu = c1o3 * (c1o1 / om1 - c1o2); - real qw = c1o1; - real uTau = sqrt(nu * (vx1 - VeloX) / qw); - - if (abs(uTau)/nu>11){ - uTau = vx1 * 0.41 / (log10(9.8 * uTau * qw / nu)); - - - - vx[k] = vx1 - uTau * uTau * qw / nu; - vx[k] = (vx[k]> 0.05) ? 0.05 : ((vx[k]< -0.05) ? -0.05 : vx[k] ); - } - else{ vx[k]=c0o1; } - //vy[k] = 0.01; //Test...muss wieder raus - //vz[k] = 0.01; //Test...muss wieder raus - - // ////////////////////////////////////////////////////////////////////////// - // if (isEvenTimestep==false) - // { - // D.f[dP00] = &DD[dP00 * size_Mat]; - // D.f[dM00] = &DD[dM00 * size_Mat]; - // D.f[d0P0] = &DD[d0P0 * size_Mat]; - // D.f[d0M0] = &DD[d0M0 * size_Mat]; - // D.f[d00P] = &DD[d00P * size_Mat]; - // D.f[d00M] = &DD[d00M * size_Mat]; - // D.f[dPP0] = &DD[dPP0 * size_Mat]; - // D.f[dMM0] = &DD[dMM0 * size_Mat]; - // D.f[dPM0] = &DD[dPM0 * size_Mat]; - // D.f[dMP0] = &DD[dMP0 * size_Mat]; - // D.f[dP0P] = &DD[dP0P * size_Mat]; - // D.f[dM0M] = &DD[dM0M * size_Mat]; - // D.f[dP0M] = &DD[dP0M * size_Mat]; - // D.f[dM0P] = &DD[dM0P * size_Mat]; - // D.f[d0PP] = &DD[d0PP * size_Mat]; - // D.f[d0MM] = &DD[d0MM * size_Mat]; - // D.f[d0PM] = &DD[d0PM * size_Mat]; - // D.f[d0MP] = &DD[d0MP * size_Mat]; - // D.f[d000] = &DD[d000 * size_Mat]; - // D.f[dPPP] = &DD[dPPP * size_Mat]; - // D.f[dMMP] = &DD[dMMP * size_Mat]; - // D.f[dPMP] = &DD[dPMP * size_Mat]; - // D.f[dMPP] = &DD[dMPP * size_Mat]; - // D.f[dPPM] = &DD[dPPM * size_Mat]; - // D.f[dMMM] = &DD[dMMM * size_Mat]; - // D.f[dPMM] = &DD[dPMM * size_Mat]; - // D.f[dMPM] = &DD[dMPM * size_Mat]; - // } - // else - // { - // D.f[dM00] = &DD[dP00 * size_Mat]; - // D.f[dP00] = &DD[dM00 * size_Mat]; - // D.f[d0M0] = &DD[d0P0 * size_Mat]; - // D.f[d0P0] = &DD[d0M0 * size_Mat]; - // D.f[d00M] = &DD[d00P * size_Mat]; - // D.f[d00P] = &DD[d00M * size_Mat]; - // D.f[dMM0] = &DD[dPP0 * size_Mat]; - // D.f[dPP0] = &DD[dMM0 * size_Mat]; - // D.f[dMP0] = &DD[dPM0 * size_Mat]; - // D.f[dPM0] = &DD[dMP0 * size_Mat]; - // D.f[dM0M] = &DD[dP0P * size_Mat]; - // D.f[dP0P] = &DD[dM0M * size_Mat]; - // D.f[dM0P] = &DD[dP0M * size_Mat]; - // D.f[dP0M] = &DD[dM0P * size_Mat]; - // D.f[d0MM] = &DD[d0PP * size_Mat]; - // D.f[d0PP] = &DD[d0MM * size_Mat]; - // D.f[d0MP] = &DD[d0PM * size_Mat]; - // D.f[d0PM] = &DD[d0MP * size_Mat]; - // D.f[d000] = &DD[d000 * size_Mat]; - // D.f[dPPP] = &DD[dMMM * size_Mat]; - // D.f[dMMP] = &DD[dPPM * size_Mat]; - // D.f[dPMP] = &DD[dMPM * size_Mat]; - // D.f[dMPP] = &DD[dPMM * size_Mat]; - // D.f[dPPM] = &DD[dMMP * size_Mat]; - // D.f[dMMM] = &DD[dPPP * size_Mat]; - // D.f[dPMM] = &DD[dMPP * size_Mat]; - // D.f[dMPM] = &DD[dPMP * size_Mat]; - // } - // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // //Test - // //(D.f[d000])[k]=c1o10; - // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - ////ToDo anders Klammern - - // q = q_dirE[k]; - // if (q>=zero && q<=one) - // { - // feq=c2over27* (drho/*+three*( vx1 )*/+c9over2*( vx1 )*( vx1 ) * (one + drho)-cu_sq); - // (D.f[dM00])[kw]=(one-q)/(one+q)*(f_E-f_W+(f_E+f_W-two*feq*om1)/(one-om1))*c1o2+(q*(f_E+f_W)-six*c2over27*( VeloX ))/(one+q);// - c2over27 * drho; - // //(D.f[dM00])[kw]=zero; - // } - - // q = q_dirW[k]; - // if (q>=zero && q<=one) - // { - // feq=c2over27* (drho/*+three*(-vx1 )*/+c9over2*(-vx1 )*(-vx1 ) * (one + drho)-cu_sq); - // (D.f[dP00])[ke]=(one-q)/(one+q)*(f_W-f_E+(f_W+f_E-two*feq*om1)/(one-om1))*c1o2+(q*(f_W+f_E)-six*c2over27*(-VeloX ))/(one+q);// - c2over27 * drho; - // //(D.f[dP00])[ke]=zero; - // } - - // q = q_dirN[k]; - // if (q>=zero && q<=one) - // { - // feq=c2over27* (drho/*+three*( vx2 )*/+c9over2*( vx2 )*( vx2 ) * (one + drho)-cu_sq); - // (D.f[d0M0])[ks]=(one-q)/(one+q)*(f_N-f_S+(f_N+f_S-two*feq*om1)/(one-om1))*c1o2+(q*(f_N+f_S)-six*c2over27*( VeloY ))/(one+q);// - c2over27 * drho; - // //(D.f[d0M0])[ks]=zero; - // } - - // q = q_dirS[k]; - // if (q>=zero && q<=one) - // { - // feq=c2over27* (drho/*+three*( -vx2 )*/+c9over2*( -vx2 )*( -vx2 ) * (one + drho)-cu_sq); - // (D.f[d0P0])[kn]=(one-q)/(one+q)*(f_S-f_N+(f_S+f_N-two*feq*om1)/(one-om1))*c1o2+(q*(f_S+f_N)-six*c2over27*(-VeloY ))/(one+q);// - c2over27 * drho; - // //(D.f[d0P0])[kn]=zero; - // } - - // q = q_dirT[k]; - // if (q>=zero && q<=one) - // { - // feq=c2over27* (drho/*+three*( vx3)*/+c9over2*( vx3)*( vx3) * (one + drho)-cu_sq); - // (D.f[d00M])[kb]=(one-q)/(one+q)*(f_T-f_B+(f_T+f_B-two*feq*om1)/(one-om1))*c1o2+(q*(f_T+f_B)-six*c2over27*( VeloZ ))/(one+q);// - c2over27 * drho; - // //(D.f[d00M])[kb]=one; - // } - - // q = q_dirB[k]; - // if (q>=zero && q<=one) - // { - // feq=c2over27* (drho/*+three*( -vx3)*/+c9over2*( -vx3)*( -vx3) * (one + drho)-cu_sq); - // (D.f[d00P])[kt]=(one-q)/(one+q)*(f_B-f_T+(f_B+f_T-two*feq*om1)/(one-om1))*c1o2+(q*(f_B+f_T)-six*c2over27*(-VeloZ ))/(one+q);// - c2over27 * drho; - // //(D.f[d00P])[kt]=zero; - // } - - // q = q_dirNE[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*( vx1+vx2 )*/+c9over2*( vx1+vx2 )*( vx1+vx2 ) * (one + drho)-cu_sq); - // (D.f[dMM0])[ksw]=(one-q)/(one+q)*(f_NE-f_SW+(f_NE+f_SW-two*feq*om1)/(one-om1))*c1o2+(q*(f_NE+f_SW)-six*c1over54*(VeloX+VeloY))/(one+q);// - c1over54 * drho; - // //(D.f[dMM0])[ksw]=zero; - // } - - // q = q_dirSW[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*(-vx1-vx2 )*/+c9over2*(-vx1-vx2 )*(-vx1-vx2 ) * (one + drho)-cu_sq); - // (D.f[dPP0])[kne]=(one-q)/(one+q)*(f_SW-f_NE+(f_SW+f_NE-two*feq*om1)/(one-om1))*c1o2+(q*(f_SW+f_NE)-six*c1over54*(-VeloX-VeloY))/(one+q);// - c1over54 * drho; - // //(D.f[dPP0])[kne]=zero; - // } - - // q = q_dirSE[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*( vx1-vx2 )*/+c9over2*( vx1-vx2 )*( vx1-vx2 ) * (one + drho)-cu_sq); - // (D.f[dMP0])[knw]=(one-q)/(one+q)*(f_SE-f_NW+(f_SE+f_NW-two*feq*om1)/(one-om1))*c1o2+(q*(f_SE+f_NW)-six*c1over54*( VeloX-VeloY))/(one+q);// - c1over54 * drho; - // //(D.f[dMP0])[knw]=zero; - // } - - // q = q_dirNW[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*(-vx1+vx2 )*/+c9over2*(-vx1+vx2 )*(-vx1+vx2 ) * (one + drho)-cu_sq); - // (D.f[dPM0])[kse]=(one-q)/(one+q)*(f_NW-f_SE+(f_NW+f_SE-two*feq*om1)/(one-om1))*c1o2+(q*(f_NW+f_SE)-six*c1over54*(-VeloX+VeloY))/(one+q);// - c1over54 * drho; - // //(D.f[dPM0])[kse]=zero; - // } - - // q = q_dirTE[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*( vx1 +vx3)*/+c9over2*( vx1 +vx3)*( vx1 +vx3) * (one + drho)-cu_sq); - // (D.f[dM0M])[kbw]=(one-q)/(one+q)*(f_TE-f_BW+(f_TE+f_BW-two*feq*om1)/(one-om1))*c1o2+(q*(f_TE+f_BW)-six*c1over54*( VeloX+VeloZ))/(one+q);// - c1over54 * drho; - // //(D.f[dM0M])[kbw]=zero; - // } - - // q = q_dirBW[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*(-vx1 -vx3)*/+c9over2*(-vx1 -vx3)*(-vx1 -vx3) * (one + drho)-cu_sq); - // (D.f[dP0P])[kte]=(one-q)/(one+q)*(f_BW-f_TE+(f_BW+f_TE-two*feq*om1)/(one-om1))*c1o2+(q*(f_BW+f_TE)-six*c1over54*(-VeloX-VeloZ))/(one+q);// - c1over54 * drho; - // //(D.f[dP0P])[kte]=zero; - // } - - // q = q_dirBE[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*( vx1 -vx3)*/+c9over2*( vx1 -vx3)*( vx1 -vx3) * (one + drho)-cu_sq); - // (D.f[dM0P])[ktw]=(one-q)/(one+q)*(f_BE-f_TW+(f_BE+f_TW-two*feq*om1)/(one-om1))*c1o2+(q*(f_BE+f_TW)-six*c1over54*( VeloX-VeloZ))/(one+q);// - c1over54 * drho; - // //(D.f[dM0P])[ktw]=zero; - // } - - // q = q_dirTW[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*(-vx1 +vx3)*/+c9over2*(-vx1 +vx3)*(-vx1 +vx3) * (one + drho)-cu_sq); - // (D.f[dP0M])[kbe]=(one-q)/(one+q)*(f_TW-f_BE+(f_TW+f_BE-two*feq*om1)/(one-om1))*c1o2+(q*(f_TW+f_BE)-six*c1over54*(-VeloX+VeloZ))/(one+q);// - c1over54 * drho; - // //(D.f[dP0M])[kbe]=zero; - // } - - // q = q_dirTN[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*( vx2+vx3)*/+c9over2*( vx2+vx3)*( vx2+vx3) * (one + drho)-cu_sq); - // (D.f[d0MM])[kbs]=(one-q)/(one+q)*(f_TN-f_BS+(f_TN+f_BS-two*feq*om1)/(one-om1))*c1o2+(q*(f_TN+f_BS)-six*c1over54*( VeloY+VeloZ))/(one+q);// - c1over54 * drho; - // //(D.f[d0MM])[kbs]=zero; - // } - - // q = q_dirBS[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*( -vx2-vx3)*/+c9over2*( -vx2-vx3)*( -vx2-vx3) * (one + drho)-cu_sq); - // (D.f[d0PP])[ktn]=(one-q)/(one+q)*(f_BS-f_TN+(f_BS+f_TN-two*feq*om1)/(one-om1))*c1o2+(q*(f_BS+f_TN)-six*c1over54*( -VeloY-VeloZ))/(one+q);// - c1over54 * drho; - // //(D.f[d0PP])[ktn]=zero; - // } - - // q = q_dirBN[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*( vx2-vx3)*/+c9over2*( vx2-vx3)*( vx2-vx3) * (one + drho)-cu_sq); - // (D.f[d0MP])[kts]=(one-q)/(one+q)*(f_BN-f_TS+(f_BN+f_TS-two*feq*om1)/(one-om1))*c1o2+(q*(f_BN+f_TS)-six*c1over54*( VeloY-VeloZ))/(one+q);// - c1over54 * drho; - // //(D.f[d0MP])[kts]=zero; - // } - - // q = q_dirTS[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over54* (drho/*+three*( -vx2+vx3)*/+c9over2*( -vx2+vx3)*( -vx2+vx3) * (one + drho)-cu_sq); - // (D.f[d0PM])[kbn]=(one-q)/(one+q)*(f_TS-f_BN+(f_TS+f_BN-two*feq*om1)/(one-om1))*c1o2+(q*(f_TS+f_BN)-six*c1over54*( -VeloY+VeloZ))/(one+q);// - c1over54 * drho; - // //(D.f[d0PM])[kbn]=zero; - // } - - // q = q_dirTNE[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over216*(drho/*+three*( vx1+vx2+vx3)*/+c9over2*( vx1+vx2+vx3)*( vx1+vx2+vx3) * (one + drho)-cu_sq); - // (D.f[dMMM])[kbsw]=(one-q)/(one+q)*(f_TNE-f_BSW+(f_TNE+f_BSW-two*feq*om1)/(one-om1))*c1o2+(q*(f_TNE+f_BSW)-six*c1over216*( VeloX+VeloY+VeloZ))/(one+q);// - c1over216 * drho; - // //(D.f[dMMM])[kbsw]=zero; - // } - - // q = q_dirBSW[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over216*(drho/*+three*(-vx1-vx2-vx3)*/+c9over2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3) * (one + drho)-cu_sq); - // (D.f[dPPP])[ktne]=(one-q)/(one+q)*(f_BSW-f_TNE+(f_BSW+f_TNE-two*feq*om1)/(one-om1))*c1o2+(q*(f_BSW+f_TNE)-six*c1over216*(-VeloX-VeloY-VeloZ))/(one+q);// - c1over216 * drho; - // //(D.f[dPPP])[ktne]=zero; - // } - - // q = q_dirBNE[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over216*(drho/*+three*( vx1+vx2-vx3)*/+c9over2*( vx1+vx2-vx3)*( vx1+vx2-vx3) * (one + drho)-cu_sq); - // (D.f[dMMP])[ktsw]=(one-q)/(one+q)*(f_BNE-f_TSW+(f_BNE+f_TSW-two*feq*om1)/(one-om1))*c1o2+(q*(f_BNE+f_TSW)-six*c1over216*( VeloX+VeloY-VeloZ))/(one+q);// - c1over216 * drho; - // //(D.f[dMMP])[ktsw]=zero; - // } - - // q = q_dirTSW[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over216*(drho/*+three*(-vx1-vx2+vx3)*/+c9over2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3) * (one + drho)-cu_sq); - // (D.f[dPPM])[kbne]=(one-q)/(one+q)*(f_TSW-f_BNE+(f_TSW+f_BNE-two*feq*om1)/(one-om1))*c1o2+(q*(f_TSW+f_BNE)-six*c1over216*(-VeloX-VeloY+VeloZ))/(one+q);// - c1over216 * drho; - // //(D.f[dPPM])[kbne]=zero; - // } - - // q = q_dirTSE[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over216*(drho/*+three*( vx1-vx2+vx3)*/+c9over2*( vx1-vx2+vx3)*( vx1-vx2+vx3) * (one + drho)-cu_sq); - // (D.f[dMPM])[kbnw]=(one-q)/(one+q)*(f_TSE-f_BNW+(f_TSE+f_BNW-two*feq*om1)/(one-om1))*c1o2+(q*(f_TSE+f_BNW)-six*c1over216*( VeloX-VeloY+VeloZ))/(one+q);// - c1over216 * drho; - // //(D.f[dMPM])[kbnw]=zero; - // } - - // q = q_dirBNW[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over216*(drho/*+three*(-vx1+vx2-vx3)*/+c9over2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3) * (one + drho)-cu_sq); - // (D.f[dPMP])[ktse]=(one-q)/(one+q)*(f_BNW-f_TSE+(f_BNW+f_TSE-two*feq*om1)/(one-om1))*c1o2+(q*(f_BNW+f_TSE)-six*c1over216*(-VeloX+VeloY-VeloZ))/(one+q);// - c1over216 * drho; - // //(D.f[dPMP])[ktse]=zero; - // } - - // q = q_dirBSE[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over216*(drho/*+three*( vx1-vx2-vx3)*/+c9over2*( vx1-vx2-vx3)*( vx1-vx2-vx3) * (one + drho)-cu_sq); - // (D.f[dMPP])[ktnw]=(one-q)/(one+q)*(f_BSE-f_TNW+(f_BSE+f_TNW-two*feq*om1)/(one-om1))*c1o2+(q*(f_BSE+f_TNW)-six*c1over216*( VeloX-VeloY-VeloZ))/(one+q);// - c1over216 * drho; - // //(D.f[dMPP])[ktnw]=zero; - // } - - // q = q_dirTNW[k]; - // if (q>=zero && q<=one) - // { - // feq=c1over216*(drho/*+three*(-vx1+vx2+vx3)*/+c9over2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3) * (one + drho)-cu_sq); - // (D.f[dPMM])[kbse]=(one-q)/(one+q)*(f_TNW-f_BSE+(f_TNW+f_BSE-two*feq*om1)/(one-om1))*c1o2+(q*(f_TNW+f_BSE)-six*c1over216*(-VeloX+VeloY+VeloZ))/(one+q);// - c1over216 * drho; - // //(D.f[dPMM])[kbse]=zero; - // } - } -} -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - - - - - diff --git a/src/gpu/core/LBM/Simulation.cpp b/src/gpu/core/LBM/Simulation.cpp index 7100b876bf4ffc3bd66c4238d5095caaa7801894..0098fbda016776201ebaa2b224b3eb3725e5168c 100644 --- a/src/gpu/core/LBM/Simulation.cpp +++ b/src/gpu/core/LBM/Simulation.cpp @@ -22,7 +22,6 @@ #include "Output/NeighborDebugWriter.hpp" #include "Output/VeloASCIIWriter.hpp" ////////////////////////////////////////////////////////////////////////// -#include "Utilities/Buffer2D.hpp" #include "StringUtilities/StringUtil.h" ////////////////////////////////////////////////////////////////////////// #include "PreProcessor/InitLattice.h" @@ -33,7 +32,7 @@ #include "Calculation/DragLift.h" #include "Calculation/Cp.h" #include "Calculation/Calc2ndMoments.h" -#include "Calculation/CalcMedian.h" +#include "Calculation/CalcMean.h" #include "Calculation/CalcTurbulenceIntensity.h" #include "Calculation/ForceCalculations.h" ////////////////////////////////////////////////////////////////////////// @@ -174,14 +173,14 @@ void Simulation::init(GridProvider &gridProvider, BoundaryConditionFactory *bcFa // if (para->getDiffOn()) allocPlaneConc(para.get(), cudaMemoryManager.get()); ////////////////////////////////////////////////////////////////////////// - // Median + // Mean ////////////////////////////////////////////////////////////////////////// - if (para->getCalcMedian()) { + if (para->getCalcMean()) { VF_LOG_INFO("alloc Calculation for Mean Values"); if (para->getDiffOn()) - allocMedianAD(para.get(), cudaMemoryManager.get()); + allocMeanAD(para.get(), cudaMemoryManager.get()); else - allocMedian(para.get(), cudaMemoryManager.get()); + allocMean(para.get(), cudaMemoryManager.get()); } ////////////////////////////////////////////////////////////////////////// @@ -485,9 +484,9 @@ void Simulation::calculateTimestep(uint timestep) if( this->enstrophyAnalyzer ) this->enstrophyAnalyzer->run(timestep); //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// - //Calc Median + //Calc Mean //////////////////////////////////////////////////////////////////////////////// - if (para->getCalcMedian() && ((int)timestep >= para->getTimeCalcMedStart()) && ((int)timestep <= para->getTimeCalcMedEnd())) + if (para->getCalcMean() && ((int)timestep >= para->getTimeCalcMedStart()) && ((int)timestep <= para->getTimeCalcMedEnd())) { for (int lev=para->getCoarse(); lev <= para->getFine(); lev++) { @@ -695,7 +694,7 @@ void Simulation::readAndWriteFiles(uint timestep) // } // else if (para->getD3Qxx()==27) // { - // if (para->getCalcMedian() && ((int)t > para->getTimeCalcMedStart()) && ((int)t <= para->getTimeCalcMedEnd())) + // if (para->getCalcMean() && ((int)t > para->getTimeCalcMedStart()) && ((int)t <= para->getTimeCalcMedEnd())) // { // unsigned int tdiff = t - t_prev; // CalcMacMedSP27(para->getParD(lev)->vx_SP_Med, @@ -783,9 +782,9 @@ void Simulation::readAndWriteFiles(uint timestep) // } cudaMemoryManager->cudaCopyPrint(lev); - if (para->getCalcMedian()) + if (para->getCalcMean()) { - cudaMemoryManager->cudaCopyMedianPrint(lev); + cudaMemoryManager->cudaCopyMeanPrint(lev); } ////////////////////////////////////////////////////////////////////////// //TODO: implement flag to write ASCII data @@ -891,16 +890,16 @@ void Simulation::readAndWriteFiles(uint timestep) if (para->getCalcHighOrderMoments()) calcHigherOrderMoments(para.get(), cudaMemoryManager.get()); //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// - //calculate median on host + //calculate mean on host //////////////////////////////////////////////////////////////////////// - if (para->getCalcMedian() && ((int)timestep > para->getTimeCalcMedStart()) && ((int)timestep <= para->getTimeCalcMedEnd()) && ((timestep%(unsigned int)para->getclockCycleForMP())==0)) + if (para->getCalcMean() && ((int)timestep > para->getTimeCalcMedStart()) && ((int)timestep <= para->getTimeCalcMedEnd()) && ((timestep%(unsigned int)para->getclockCycleForMP())==0)) { unsigned int tdiff = timestep - previousTimestepForAveraging; - calcMedian(para.get(), tdiff); + calcMean(para.get(), tdiff); ///////////////////////////////// //added for incremental averaging previousTimestepForAveraging = timestep; - resetMedian(para.get()); + resetMean(para.get()); ///////////////////////////////// } if (para->getCalcTurbulenceIntensity()) @@ -948,9 +947,9 @@ Simulation::~Simulation() //para->cudaFreeFull(lev); cudaMemoryManager->cudaFreeCoord(lev); cudaMemoryManager->cudaFreeSP(lev); - if (para->getCalcMedian()) + if (para->getCalcMean()) { - cudaMemoryManager->cudaFreeMedianSP(lev); + cudaMemoryManager->cudaFreeMeanSP(lev); } //para->cudaFreeVeloBC(lev); //para->cudaFreeWallBC(lev); diff --git a/src/gpu/core/LBM/Simulation.h b/src/gpu/core/LBM/Simulation.h index f7f2840b7e049dcfd0bf69cf87c0e6cebb624279..fe7967120ecb94bd1ea67b64740bf990519281f3 100644 --- a/src/gpu/core/LBM/Simulation.h +++ b/src/gpu/core/LBM/Simulation.h @@ -4,10 +4,8 @@ #include <memory> #include <vector> -#include <PointerDefinitions.h> - +#include "PointerDefinitions.h" #include "LBM/LB.h" -#include "Utilities/Buffer2D.hpp" namespace vf::parallel { @@ -64,16 +62,6 @@ private: std::unique_ptr<KernelFactory> kernelFactory; std::shared_ptr<PreProcessorFactory> preProcessorFactory; - Buffer2D <real> sbuf_t; - Buffer2D <real> rbuf_t; - Buffer2D <real> sbuf_b; - Buffer2D <real> rbuf_b; - - Buffer2D <int> geo_sbuf_t; - Buffer2D <int> geo_rbuf_t; - Buffer2D <int> geo_sbuf_b; - Buffer2D <int> geo_rbuf_b; - vf::parallel::Communicator& communicator; SPtr<Parameter> para; std::shared_ptr<DataWriter> dataWriter; diff --git a/src/gpu/core/Output/FileWriter.cpp b/src/gpu/core/Output/FileWriter.cpp index 773bd58fafc63c4aad324605b0babde2a0acaac5..9540b8f57ea8e1b354f9255899be9193a335b251 100644 --- a/src/gpu/core/Output/FileWriter.cpp +++ b/src/gpu/core/Output/FileWriter.cpp @@ -34,9 +34,9 @@ std::string makePartFileName(const std::string &prefix, uint level, int ID, int return prefix + "_bin" + WriterUtilities::makePartFileNameEnding(level, ID, part, timestep); } -std::string makeMedianPartFileName(const std::string &prefix, uint level, int ID, int part, int timestep) +std::string makeMeanPartFileName(const std::string &prefix, uint level, int ID, int part, int timestep) { - return prefix + "_bin_median" + WriterUtilities::makePartFileNameEnding(level, ID, part, timestep); + return prefix + "_bin_mean" + WriterUtilities::makePartFileNameEnding(level, ID, part, timestep); } @@ -45,9 +45,9 @@ std::string makeCollectionFileName(const std::string &prefix, int ID, int timest return prefix + "_bin" + makeCollectionFileNameEnding(ID, timestep); } -std::string makeMedianCollectionFileName(const std::string &prefix, int ID, int timestep) +std::string makeMeanCollectionFileName(const std::string &prefix, int ID, int timestep) { - return prefix + "_bin_median" + makeCollectionFileNameEnding(ID, timestep); + return prefix + "_bin_mean" + makeCollectionFileNameEnding(ID, timestep); } std::string makePvdCollectionFileName(const std::string &prefix, int mpiProcessID) @@ -67,8 +67,8 @@ void FileWriter::writeInit(std::shared_ptr<Parameter> para, std::shared_ptr<Cuda this->fileNamesForCollectionFileTimeSeries[timestep] = this->fileNamesForCollectionFile; this->writeCollectionFile(para, timestep); - if( para->getCalcMedian() ) - this->writeCollectionFileMedian(para, timestep); + if( para->getCalcMean() ) + this->writeCollectionFileMean(para, timestep); } void FileWriter::writeTimestep(std::shared_ptr<Parameter> para, unsigned int timestep) @@ -82,8 +82,8 @@ void FileWriter::writeTimestep(std::shared_ptr<Parameter> para, unsigned int tim this->writeCollectionFile(para, timestep); - if( para->getCalcMedian() ) - this->writeCollectionFileMedian(para, timestep); + if( para->getCalcMean() ) + this->writeCollectionFileMean(para, timestep); } void FileWriter::writeTimestep(std::shared_ptr<Parameter> para, unsigned int timestep, int level) @@ -95,7 +95,7 @@ void FileWriter::writeTimestep(std::shared_ptr<Parameter> para, unsigned int tim for (unsigned int i = 1; i <= numberOfParts; i++) { std::string fname = makePartFileName(para->getFName(), level, para->getMyProcessID(), i, timestep); - std::string fnameMed = makeMedianPartFileName(para->getFName(), level, para->getMyProcessID(), i, timestep); + std::string fnameMed = makeMeanPartFileName(para->getFName(), level, para->getMyProcessID(), i, timestep); fnames.push_back(fname); fnamesMed.push_back(fnameMed); @@ -105,11 +105,11 @@ void FileWriter::writeTimestep(std::shared_ptr<Parameter> para, unsigned int tim for(auto fname : fnamesLong) this->fileNamesForCollectionFile.push_back(fname.substr( fname.find_last_of('/') + 1 )); - if (para->getCalcMedian()) + if (para->getCalcMean()) { - std::vector<std::string> fnamesMedianLong = writeUnstructuredGridMedianLT(para, level, fnamesMed); - for(auto fname : fnamesMedianLong) - this->fileNamesForCollectionFileMedian.push_back(fname.substr( fname.find_last_of('/') + 1 )); + std::vector<std::string> fnamesMeanLong = writeUnstructuredGridMeanLT(para, level, fnamesMed); + for(auto fname : fnamesMeanLong) + this->fileNamesForCollectionFileMean.push_back(fname.substr( fname.find_last_of('/') + 1 )); } } @@ -150,7 +150,7 @@ std::vector<std::string> FileWriter::getNodeDataNames(std::shared_ptr<Parameter> return nodeDataNames; } -std::vector<std::string> FileWriter::getMedianNodeDataNames(std::shared_ptr<Parameter> para) +std::vector<std::string> FileWriter::getMeanNodeDataNames(std::shared_ptr<Parameter> para) { std::vector<std::string> nodeDataNames; @@ -176,13 +176,13 @@ std::string FileWriter::writeCollectionFile(std::shared_ptr<Parameter> para, uns return pFileName; } -std::string FileWriter::writeCollectionFileMedian(std::shared_ptr<Parameter> para, unsigned int timestep) +std::string FileWriter::writeCollectionFileMean(std::shared_ptr<Parameter> para, unsigned int timestep) { - std::string filename = makeMedianCollectionFileName(para->getFName(), para->getMyProcessID(), timestep); - std::vector<std::string> nodeDataNames = getMedianNodeDataNames(para); + std::string filename = makeMeanCollectionFileName(para->getFName(), para->getMyProcessID(), timestep); + std::vector<std::string> nodeDataNames = getMeanNodeDataNames(para); std::vector<std::string> cellDataNames; - std::string pFileName = WbWriterVtkXmlBinary::getInstance()->writeParallelFile(filename, this->fileNamesForCollectionFileMedian, nodeDataNames, cellDataNames); - this->fileNamesForCollectionFileMedian.clear(); + std::string pFileName = WbWriterVtkXmlBinary::getInstance()->writeParallelFile(filename, this->fileNamesForCollectionFileMean, nodeDataNames, cellDataNames); + this->fileNamesForCollectionFileMean.clear(); return pFileName; } @@ -302,14 +302,14 @@ std::vector<std::string> FileWriter::writeUnstructuredGridLT(std::shared_ptr<Par return outFNames; } -std::vector<std::string> FileWriter::writeUnstructuredGridMedianLT(std::shared_ptr<Parameter> para, int level, std::vector<std::string >& fname) +std::vector<std::string> FileWriter::writeUnstructuredGridMeanLT(std::shared_ptr<Parameter> para, int level, std::vector<std::string >& fname) { std::vector< std::string > outFNames; std::vector< UbTupleFloat3 > nodes; std::vector< UbTupleUInt8 > cells; //std::vector< UbTupleUInt8 > cells2; - std::vector< std::string > nodeDataNames = getMedianNodeDataNames(para); + std::vector< std::string > nodeDataNames = getMeanNodeDataNames(para); int startIndex = para->getDiffOn()? 1 : 0; unsigned int number1, number2, number3, number4, number5, number6, number7, number8; diff --git a/src/gpu/core/Output/FileWriter.h b/src/gpu/core/Output/FileWriter.h index 0024ea5aa8d10d2d3f6b06873c88a3cfd36db09c..6f7defd5bdd7bdb364b655e2e947a1ce0d7e4633 100644 --- a/src/gpu/core/Output/FileWriter.h +++ b/src/gpu/core/Output/FileWriter.h @@ -22,19 +22,19 @@ private: void writeTimestep(std::shared_ptr<Parameter> para, unsigned int timestep, int level) override; std::vector<std::string> writeUnstructuredGridLT(std::shared_ptr<Parameter> para, int level, std::vector<std::string> &fname); - std::vector<std::string> writeUnstructuredGridMedianLT(std::shared_ptr<Parameter> para, int level, std::vector<std::string >& fname); + std::vector<std::string> writeUnstructuredGridMeanLT(std::shared_ptr<Parameter> para, int level, std::vector<std::string >& fname); std::string writeCollectionFile( std::shared_ptr<Parameter> para, unsigned int timestep ); - std::string writeCollectionFileMedian( std::shared_ptr<Parameter> para, unsigned int timestep ); + std::string writeCollectionFileMean( std::shared_ptr<Parameter> para, unsigned int timestep ); std::string writePvdCollectionFileForTimeSeries(const Parameter ¶); std::vector<std::string> getNodeDataNames(std::shared_ptr<Parameter> para); - std::vector<std::string> getMedianNodeDataNames(std::shared_ptr<Parameter> para); + std::vector<std::string> getMeanNodeDataNames(std::shared_ptr<Parameter> para); std::vector< std::string > fileNamesForCollectionFile; - std::vector< std::string > fileNamesForCollectionFileMedian; + std::vector< std::string > fileNamesForCollectionFileMean; std::map<uint, std::vector<std::string>> fileNamesForCollectionFileTimeSeries; // key: timeStep, value: fileNames for timeStep }; diff --git a/src/gpu/core/Output/UnstructuredGridWriter.hpp b/src/gpu/core/Output/UnstructuredGridWriter.hpp index 3447313a3ce6e452886fbfa155f2e7e759ce14de..ef88f4d0f5ed2795d7d4a1b5f41ea136551679ca 100644 --- a/src/gpu/core/Output/UnstructuredGridWriter.hpp +++ b/src/gpu/core/Output/UnstructuredGridWriter.hpp @@ -1282,7 +1282,7 @@ namespace UnstructuredGridWriter ////////////////////////////////////////////////////////////////////////// - void writeUnstrucuredGridMedianLT(Parameter* para, int level, vector<string >& fname) + void writeUnstrucuredGridMeanLT(Parameter* para, int level, vector<string >& fname) { vector< UbTupleFloat3 > nodes; vector< UbTupleUInt8 > cells; @@ -1388,7 +1388,7 @@ namespace UnstructuredGridWriter } WbWriterVtkXmlBinary::getInstance()->writeOctsWithNodeData(fname[part],nodes,cells,nodedatanames,nodedata); ////////////////////////////////////////////////////////////////////////// - printf("\n vx median max: %.1f at level: %d\n", vxmax, level); + printf("\n vx mean max: %.1f at level: %d\n", vxmax, level); } } ////////////////////////////////////////////////////////////////////////// @@ -1400,7 +1400,7 @@ namespace UnstructuredGridWriter ////////////////////////////////////////////////////////////////////////// - void writeUnstrucuredGridMedianLTConc(Parameter* para, int level, vector<string >& fname) + void writeUnstrucuredGridMeanLTConc(Parameter* para, int level, vector<string >& fname) { vector< UbTupleFloat3 > nodes; vector< UbTupleUInt8 > cells; @@ -1505,7 +1505,7 @@ namespace UnstructuredGridWriter } WbWriterVtkXmlBinary::getInstance()->writeOctsWithNodeData(fname[part], nodes, cells, nodedatanames, nodedata); ////////////////////////////////////////////////////////////////////////// - printf("\n vx median max: %.1f at level: %d\n", vxmax, level); + printf("\n vx mean max: %.1f at level: %d\n", vxmax, level); } } ////////////////////////////////////////////////////////////////////////// @@ -1517,7 +1517,7 @@ namespace UnstructuredGridWriter ////////////////////////////////////////////////////////////////////////// - void writeUnstrucuredGridMedianLTwithDerivationsAndSqaredVelos(Parameter* para, int level, vector<string >& fname) + void writeUnstrucuredGridMeanLTwithDerivationsAndSqaredVelos(Parameter* para, int level, vector<string >& fname) { vector< UbTupleFloat3 > nodes; vector< UbTupleUInt8 > cells; @@ -1652,7 +1652,7 @@ namespace UnstructuredGridWriter } WbWriterVtkXmlBinary::getInstance()->writeOctsWithNodeData(fname[part], nodes, cells, nodedatanames, nodedata); ////////////////////////////////////////////////////////////////////////// - printf("\n vx median max: %.1f at level: %d\n", vxmax, level); + printf("\n vx mean max: %.1f at level: %d\n", vxmax, level); } } ////////////////////////////////////////////////////////////////////////// @@ -1664,7 +1664,7 @@ namespace UnstructuredGridWriter ////////////////////////////////////////////////////////////////////////// - void writeUnstrucuredGridEffMedian(Parameter* para, int level, std::string& fname) + void writeUnstrucuredGridEffMean(Parameter* para, int level, std::string& fname) { vector< UbTupleFloat3 > nodes; vector< UbTupleUInt8 > cells; diff --git a/src/gpu/core/Parameter/Parameter.cpp b/src/gpu/core/Parameter/Parameter.cpp index 9114fe816511f06ed26fb45d50e8b9d0d72ccd76..4f312d7a1956b119e8ad6b0e071eb56b1b193a72 100644 --- a/src/gpu/core/Parameter/Parameter.cpp +++ b/src/gpu/core/Parameter/Parameter.cpp @@ -109,8 +109,8 @@ void Parameter::readConfigData(const vf::basics::ConfigurationFile &configData) if (configData.contains("calcHigherOrderMoments")) this->setCalcHighOrderMoments(configData.getValue<bool>("calcHigherOrderMoments")); ////////////////////////////////////////////////////////////////////////// - if (configData.contains("calcMedian")) - this->setCalcMedian(configData.getValue<bool>("calcMedian")); + if (configData.contains("calcMean")) + this->setCalcMean(configData.getValue<bool>("calcMean")); ////////////////////////////////////////////////////////////////////////// if (configData.contains("calcCp")) this->calcCp = configData.getValue<bool>("calcCp"); @@ -145,11 +145,11 @@ void Parameter::readConfigData(const vf::basics::ConfigurationFile &configData) if (configData.contains("TimeStartOut")) this->setTimestepStartOut(configData.getValue<int>("TimeStartOut")); ////////////////////////////////////////////////////////////////////////// - if (configData.contains("TimeStartCalcMedian")) - this->setTimeCalcMedStart(configData.getValue<int>("TimeStartCalcMedian")); + if (configData.contains("TimeStartCalcMean")) + this->setTimeCalcMedStart(configData.getValue<int>("TimeStartCalcMean")); ////////////////////////////////////////////////////////////////////////// - if (configData.contains("TimeEndCalcMedian")) - this->setTimeCalcMedEnd(configData.getValue<int>("TimeEndCalcMedian")); + if (configData.contains("TimeEndCalcMean")) + this->setTimeCalcMedEnd(configData.getValue<int>("TimeEndCalcMean")); ////////////////////////////////////////////////////////////////////////// if (configData.contains("PressInID")) this->setPressInID(configData.getValue<int>("PressInID")); @@ -677,9 +677,9 @@ void Parameter::setCalcTurbulenceIntensity(bool calcVelocityAndFluctuations) { this->calcVelocityAndFluctuations = calcVelocityAndFluctuations; } -void Parameter::setCalcMedian(bool calcMedian) +void Parameter::setCalcMean(bool calcMean) { - this->calcMedian = calcMedian; + this->calcMean = calcMean; } void Parameter::setCalcDragLift(bool calcDragLift) { @@ -1735,9 +1735,9 @@ unsigned int Parameter::getTimestepStartOut() { return this->tStartOut; } -bool Parameter::getCalcMedian() +bool Parameter::getCalcMean() { - return this->calcMedian; + return this->calcMean; } bool Parameter::getCalcDragLift() { diff --git a/src/gpu/core/Parameter/Parameter.h b/src/gpu/core/Parameter/Parameter.h index 6f6f7b17426dd55a291b46177c39c08d5e20f25a..f95ddc723bc9ae649712bc89cec596193e4d0963 100644 --- a/src/gpu/core/Parameter/Parameter.h +++ b/src/gpu/core/Parameter/Parameter.h @@ -329,7 +329,7 @@ struct LBMSimulationParameter { real *vxx, *vyy, *vzz, *vxy, *vxz, *vyz; // fluctuations std::vector<real> turbulenceIntensity; - // median-macro-values///// + // mean-macro-values///// real *vx_SP_Med, *vy_SP_Med, *vz_SP_Med, *rho_SP_Med, *press_SP_Med; real *vx_SP_Med_Out, *vy_SP_Med_Out, *vz_SP_Med_Out, *rho_SP_Med_Out, *press_SP_Med_Out; // Advection-Diffusion @@ -492,7 +492,7 @@ public: void setTimestepStartOut(unsigned int tStartOut); void setTimestepOfCoarseLevel(unsigned int timestep); void setCalcTurbulenceIntensity(bool calcVelocityAndFluctuations); - void setCalcMedian(bool calcMedian); + void setCalcMean(bool calcMean); void setCalcDragLift(bool calcDragLift); void setCalcCp(bool calcCp); void setWriteVeloASCIIfiles(bool writeVeloASCII); @@ -692,7 +692,7 @@ public: bool getPrintFiles(); bool getReadGeo(); bool getCalcTurbulenceIntensity(); - bool getCalcMedian(); + bool getCalcMean(); bool getCalcDragLift(); bool getCalcCp(); bool getWriteVeloASCIIfiles(); @@ -982,7 +982,7 @@ private: bool is2ndOrderMoments{ false }; bool is3rdOrderMoments{ false }; bool isHighOrderMoments{ false }; - bool calcMedian{ false }; + bool calcMean{ false }; bool isConc{ false }; bool isTurbulentViscosity{ false }; bool isMeasurePoints{ false }; diff --git a/src/gpu/core/Parameter/ParameterTest.cpp b/src/gpu/core/Parameter/ParameterTest.cpp index 9bc865869d6d40810366d6aca8a4054a72979d09..63629267b7e3ccb1f424cd94f572e7c4cbf560dd 100644 --- a/src/gpu/core/Parameter/ParameterTest.cpp +++ b/src/gpu/core/Parameter/ParameterTest.cpp @@ -58,7 +58,7 @@ TEST(ParameterTest, check_all_Parameter_CanBePassedToConstructor) EXPECT_THAT(para.getCalc2ndOrderMoments(), testing::Eq(true)); EXPECT_THAT(para.getCalc3rdOrderMoments(), testing::Eq(true)); EXPECT_THAT(para.getCalcHighOrderMoments(), testing::Eq(true)); - EXPECT_THAT(para.getCalcMedian(), testing::Eq(true)); + EXPECT_THAT(para.getCalcMean(), testing::Eq(true)); EXPECT_THAT(para.getCalcCp(), testing::Eq(true)); EXPECT_THAT(para.getCalcDragLift(), testing::Eq(true)); EXPECT_THAT(para.getWriteVeloASCIIfiles(), testing::Eq(true)); diff --git a/src/gpu/core/Parameter/parameterTest.cfg b/src/gpu/core/Parameter/parameterTest.cfg index 6277f4f4cd22cf9f5428b0fb13851957eee04399..d1a31f7654c05d3325f2fad1a04a4bbabd4ceb8b 100644 --- a/src/gpu/core/Parameter/parameterTest.cfg +++ b/src/gpu/core/Parameter/parameterTest.cfg @@ -11,7 +11,7 @@ GeometryValues = true calc2ndOrderMoments = true calc3rdOrderMoments = true calcHigherOrderMoments = true -calcMedian = true +calcMean = true calcCp = true calcDrafLift = true writeVeloASCIIfiles = true @@ -25,8 +25,8 @@ D3Qxx = 99 TimeEnd = 33 TimeOut = 22 TimeStartOut = 11 -TimeStartCalcMedian = 22 -TimeEndCalcMedian = 44 +TimeStartCalcMean = 22 +TimeEndCalcMean = 44 PressInID = 25 PressOutID = 26 PressInZ = 27 diff --git a/src/gpu/core/PreProcessor/InitLattice.cpp b/src/gpu/core/PreProcessor/InitLattice.cpp index 5f1937b09a8cabc29cddb480a196442c53f13962..2472b3b80fb2246cc227e41794ae484c94cb7527 100644 --- a/src/gpu/core/PreProcessor/InitLattice.cpp +++ b/src/gpu/core/PreProcessor/InitLattice.cpp @@ -58,7 +58,7 @@ void initLattice(SPtr<Parameter> para, SPtr<PreProcessor> preProcessor, SPtr<Pre para->getParD(lev)->distributions.f[0], para->getParD(lev)->isEvenTimestep); - if (para->getCalcMedian()) { + if (para->getCalcMean()) { constexpr uint tdiff = 1; CalcMacMedSP27( para->getParD(lev)->vx_SP_Med, diff --git a/src/gpu/core/Utilities/Buffer2D.hpp b/src/gpu/core/Utilities/Buffer2D.hpp deleted file mode 100644 index 00232ec9f870ba68517465f57e1768f9f83cc7b1..0000000000000000000000000000000000000000 --- a/src/gpu/core/Utilities/Buffer2D.hpp +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef BUFFER2D_H -#define BUFFER2D_H - -#include <iostream> -#include <stdlib.h> - -template <class T> -class Buffer2D -{ -public: - Buffer2D() - { - data = NULL; - } - Buffer2D(int r, int c) - { - data = NULL; - setSize(r, c); - } - ~Buffer2D() - { - if(data != NULL) - delete[] data; - } - void setSize(int r, int c) - { - size = r*c; - row = r; - column = c; - if(data != NULL) - delete[] data; - data = new T[size]; - } - void Empty() - { - if(data != NULL) - { - delete[] data; - data = NULL; - } - } - T& operator [] (const int i) - { - try - { - if (i > row) - { - throw i; - } - } - catch (int i) - { - std::cout << "Error: row " << i << " does not exist!" << std::endl; - exit(EXIT_FAILURE); - } - return data[i*column]; - } - T* getData() - { - return data; - } - int getSize() - { - return size; - } - int getRowSize() - { - return column; - } - -private: - T* data; - int row, column; - int size; -}; -#endif //BUFFER2D_H diff --git a/utilities/ci-regression-tests/generate-ci.py b/utilities/ci-regression-tests/generate-ci.py index 834728b5b22d7cf566019483a3c405e75c6fc837..bb3f805ac5798af99d5d90b29fdd8329ee17651d 100644 --- a/utilities/ci-regression-tests/generate-ci.py +++ b/utilities/ci-regression-tests/generate-ci.py @@ -8,16 +8,19 @@ REGRESSION_CI_FILE = GENERATED_DIR / "regression-tests-ci.yml" TEST_FILE_DIR = Path("regression-tests") -def build_regression_job_string(regression_tests: list[str]) -> str: +def build_regression_job_string(regression_tests: list[(str,str)]) -> str: template = Template(REGRESSION_CI_TEMPLATE.read_text()) return template.render(regression_tests=regression_tests) +def trim_parent_path(name: str) -> str: + return name.replace(str(TEST_FILE_DIR)+"/", "") def main(): - regression_tests_files = [item.stem for item in TEST_FILE_DIR.glob("*_test.sh")] + regression_tests_files = [(item.stem, trim_parent_path(str(item.parent))) for item in TEST_FILE_DIR.rglob("*_test.sh")] + print(regression_tests_files) regression_tests_ci_file = build_regression_job_string(regression_tests_files) REGRESSION_CI_FILE.write_text(regression_tests_ci_file) if __name__ == "__main__": GENERATED_DIR.mkdir(parents=True, exist_ok=True) - main() \ No newline at end of file + main() diff --git a/utilities/ci-regression-tests/regression-tests-ci.yml.j2 b/utilities/ci-regression-tests/regression-tests-ci.yml.j2 index b4643c9fbe96f04644b9e688b420ac0f23c88a34..bcec3836f7839d32ddc2ade1bdeb6ae5265d6540 100644 --- a/utilities/ci-regression-tests/regression-tests-ci.yml.j2 +++ b/utilities/ci-regression-tests/regression-tests-ci.yml.j2 @@ -1,4 +1,4 @@ -image: git.rz.tu-bs.de:4567/irmb/virtualfluids/ubuntu22_04:1.0 +image: git.rz.tu-bs.de:4567/irmb/virtualfluids/ubuntu22_04:1.1 stages: - test @@ -13,7 +13,7 @@ stages: - linux before_script: - - chmod +x ./regression-tests/* + - chmod -R +x ./regression-tests/* - pip install fieldcompare artifacts: @@ -23,10 +23,10 @@ stages: when: on_failure {% for regression_test in regression_tests %} -run-regression-test-{{ regression_test }}: +run-regression-test-{{ regression_test[1] }}-{{ regression_test[0] }}: extends: .regression-test script: - - ./regression-tests/{{ regression_test }}.sh + - ./regression-tests/{{ regression_test[1] }}/{{ regression_test[0] }}.sh {% endfor %}