diff --git a/apps/cpu/CouetteFlow/cflow.cpp b/apps/cpu/CouetteFlow/cflow.cpp index 276fbe125b5b3cd0271542f7e9d8ab9f9abca518..3de4a3b36f7453eaafca24648d0aa770fb954d63 100644 --- a/apps/cpu/CouetteFlow/cflow.cpp +++ b/apps/cpu/CouetteFlow/cflow.cpp @@ -184,7 +184,7 @@ void bflow(string configname) //////////////////////////////////////////// //METIS - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::KWAY)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::KWAY)); //////////////////////////////////////////// /////delete solid blocks if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start"); diff --git a/apps/cpu/FlowAroundCylinder/cylinder.cfg b/apps/cpu/FlowAroundCylinder/cylinder.cfg index 0a7066ed9bc3351736c511d7aaeecaa04604fe55..97ece40e65d4ffe47a75e5377db49bd0018bbff6 100644 --- a/apps/cpu/FlowAroundCylinder/cylinder.cfg +++ b/apps/cpu/FlowAroundCylinder/cylinder.cfg @@ -1,6 +1,6 @@ -pathOut = d:/temp/cylinder_test +pathOut = d:/temp/cylinder_test_naming -numOfThreads = 4 +numOfThreads = 8 availMem = 15e9 refineLevel = 0 blockNx = 25 41 41 @@ -16,7 +16,7 @@ restartStep = 1000 cpStart = 1000 cpStep = 1000 -outTime = 10000 -endTime = 100000 +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 index 2f470d17dbac3600b2c42acede2bba9e6c45f872..5578ecb56b37e3b489e4c60d9a26adfa05e9b3d3 100644 --- a/apps/cpu/FlowAroundCylinder/cylinder.cpp +++ b/apps/cpu/FlowAroundCylinder/cylinder.cpp @@ -203,7 +203,7 @@ void run(string configname) SPtr<D3Q27Interactor> outflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, denBCAdapter, Interactor3D::SOLID)); - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::B)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_00M)); InteractorsHelper intHelper(grid, metisVisitor); intHelper.addInteractor(cylinderInt); intHelper.addInteractor(addWallYminInt); diff --git a/apps/cpu/HerschelBulkleyModel/hbflow.cpp b/apps/cpu/HerschelBulkleyModel/hbflow.cpp index 8483883aca772693758b9f52fcee53c54b84a1d5..b97942a1cd78c4ea9a5c73b4f24ddf4f6ae2edf6 100644 --- a/apps/cpu/HerschelBulkleyModel/hbflow.cpp +++ b/apps/cpu/HerschelBulkleyModel/hbflow.cpp @@ -218,7 +218,7 @@ void bflow(string configname) //////////////////////////////////////////// //METIS - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::RECURSIVE)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::RECURSIVE)); //////////////////////////////////////////// /////delete solid blocks if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start"); diff --git a/apps/cpu/HerschelBulkleySphere/hbsphere.cpp b/apps/cpu/HerschelBulkleySphere/hbsphere.cpp index f69bce237ec0518fb5148f60a0cdaed10230db8f..67f5a00ad49dcbe16a018e402f85ed02b3848650 100644 --- a/apps/cpu/HerschelBulkleySphere/hbsphere.cpp +++ b/apps/cpu/HerschelBulkleySphere/hbsphere.cpp @@ -161,7 +161,7 @@ void bflow(string configname) //////////////////////////////////////////// //METIS - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::KWAY)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::KWAY)); //////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// //restart @@ -243,7 +243,7 @@ void bflow(string configname) //////////////////////////////////////////// //METIS - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::KWAY)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::KWAY)); //////////////////////////////////////////// /////delete solid blocks if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start"); diff --git a/apps/cpu/JetBreakup/JetBreakup.cpp b/apps/cpu/JetBreakup/JetBreakup.cpp index 4ebc8e81482b3e4e157666ebf534e0a78dd176d1..83cb83fd41e9fa1f4049fceb7fb83862f74eb21b 100644 --- a/apps/cpu/JetBreakup/JetBreakup.cpp +++ b/apps/cpu/JetBreakup/JetBreakup.cpp @@ -200,7 +200,7 @@ void run(string configname) grid->setGhostLayerWidth(2); SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor( - comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::RECURSIVE)); + comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::RECURSIVE)); ////////////////////////////////////////////////////////////////////////// // restart diff --git a/apps/cpu/LaminarTubeFlow/ltf.cpp b/apps/cpu/LaminarTubeFlow/ltf.cpp index 3c93a21516af5bd1342ad6b0118cb93fa13fdcaf..93fd31083a1da92bc5fb73bb0606c7a8121bb5b8 100644 --- a/apps/cpu/LaminarTubeFlow/ltf.cpp +++ b/apps/cpu/LaminarTubeFlow/ltf.cpp @@ -108,7 +108,7 @@ void run(string configname) kernel->setBCProcessor(bcProc); ////////////////////////////////////////////////////////////////////////// - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::B)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_00M)); //restart SPtr<UbScheduler> mSch(new UbScheduler(cpStep, cpStart)); //SPtr<MPIIOMigrationCoProcessor> migCoProcessor(new MPIIOMigrationCoProcessor(grid, mSch, metisVisitor, pathname + "/mig", comm)); @@ -220,7 +220,7 @@ void run(string configname) //outflow SPtr<D3Q27Interactor> outflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, denBCAdapter, Interactor3D::SOLID)); - //SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::B)); + //SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_00M)); InteractorsHelper intHelper(grid, metisVisitor); intHelper.addInteractor(cylinderInt); intHelper.addInteractor(inflowInt); diff --git a/apps/cpu/Multiphase/Multiphase.cpp b/apps/cpu/Multiphase/Multiphase.cpp index 9623cd730b7a80548a5ca14c149ae3583aba8c7b..09d74e1473e9fef8e7f29343d758359eaf0752a2 100644 --- a/apps/cpu/Multiphase/Multiphase.cpp +++ b/apps/cpu/Multiphase/Multiphase.cpp @@ -122,7 +122,7 @@ void run(string configname) grid->setGhostLayerWidth(2); - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::RECURSIVE)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::RECURSIVE)); ////////////////////////////////////////////////////////////////////////// // restart diff --git a/apps/cpu/MultiphaseDropletTest/droplet.cpp b/apps/cpu/MultiphaseDropletTest/droplet.cpp index 29a2228bb7a6b7a6808e6e76162a9d3a20c23126..54b59fcfd8bd93f220b3d3d4ebb5bb29881079e5 100644 --- a/apps/cpu/MultiphaseDropletTest/droplet.cpp +++ b/apps/cpu/MultiphaseDropletTest/droplet.cpp @@ -187,7 +187,7 @@ void run(string configname) grid->setPeriodicX3(true); grid->setGhostLayerWidth(2); - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::RECURSIVE)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::RECURSIVE)); ////////////////////////////////////////////////////////////////////////// // restart diff --git a/apps/cpu/PoiseuilleFlow/pf1.cpp b/apps/cpu/PoiseuilleFlow/pf1.cpp index 25f86a206466023439abafefbed503a9b4a9f23d..d4d856d51f66a1ac6800e1f2f78da5b219b54488 100644 --- a/apps/cpu/PoiseuilleFlow/pf1.cpp +++ b/apps/cpu/PoiseuilleFlow/pf1.cpp @@ -11,7 +11,7 @@ void pf1() int myid = comm->getProcessID(); //parameters - string pathOut = "/gfs1/work/niikonst/pflow_pipe_forcing"; + string pathOut = "d:/temp/test_dir_naming"; //"/gfs1/work/niikonst/pflow_pipe_forcing"; int numOfThreads = 1; int blocknx[3] ={ 10,10,10 }; double endTime = 10; @@ -27,12 +27,12 @@ void pf1() //simulation bounding box double g_minX1 = 0.0; - double g_minX2 = -50.0; - double g_minX3 = -50.0; + double g_minX2 = -10.0; + double g_minX3 = -10.0; - double g_maxX1 = 2000; - double g_maxX2 = 50; - double g_maxX3 = 50; + double g_maxX1 = 50; + double g_maxX2 = 10; + double g_maxX3 = 10; //Sleep(15000); @@ -76,7 +76,7 @@ void pf1() //set boundary conditions for blocks and create process decomposition for MPI SPtr<D3Q27Interactor> cylinderInt(new D3Q27Interactor(cylinder, grid, noSlipBCAdapter, Interactor3D::INVERSESOLID)); - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::B)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_00M)); InteractorsHelper intHelper(grid, metisVisitor); intHelper.addInteractor(cylinderInt); intHelper.selectBlocks(); @@ -169,11 +169,11 @@ void pf1() //grid=SPtr<Grid3D>(new Grid3D(comm)); //restartCoProcessor->restart(200); - SPtr<MPIIOMigrationBECoProcessor> migCoProcessor(new MPIIOMigrationBECoProcessor(grid, mSch, metisVisitor, pathOut + "/mig", comm)); - migCoProcessor->setLBMKernel(kernel); - migCoProcessor->setBCProcessor(bcProc); - migCoProcessor->setNu(nuLB); - migCoProcessor->restart(10); + //SPtr<MPIIOMigrationBECoProcessor> migCoProcessor(new MPIIOMigrationBECoProcessor(grid, mSch, metisVisitor, pathOut + "/mig", comm)); + //migCoProcessor->setLBMKernel(kernel); + //migCoProcessor->setBCProcessor(bcProc); + //migCoProcessor->setNu(nuLB); + //migCoProcessor->restart(10); ppblocks->process(1); @@ -192,7 +192,7 @@ void pf1() SPtr<Calculator> calculator(new BasicCalculator(grid, stepGhostLayer, endTime)); calculator->addCoProcessor(npr); calculator->addCoProcessor(writeMQCoProcessor); - calculator->addCoProcessor(migCoProcessor); + //calculator->addCoProcessor(migCoProcessor); //calculator->addCoProcessor(restartCoProcessor); if (myid == 0) UBLOG(logINFO, "Simulation-start"); diff --git a/apps/cpu/RisingBubble2D/RisingBubble2D.cpp b/apps/cpu/RisingBubble2D/RisingBubble2D.cpp index 536936d669b20fa9d2d53905740c77d18740a56a..f5e215fe763b90b0e753c340a00e737d05c3ca97 100644 --- a/apps/cpu/RisingBubble2D/RisingBubble2D.cpp +++ b/apps/cpu/RisingBubble2D/RisingBubble2D.cpp @@ -189,7 +189,7 @@ void run(string configname) grid->setPeriodicX3(true); grid->setGhostLayerWidth(2); - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::RECURSIVE)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::RECURSIVE)); ////////////////////////////////////////////////////////////////////////// // restart diff --git a/apps/cpu/ViskomatXL/viskomat.cpp b/apps/cpu/ViskomatXL/viskomat.cpp index df7d292334135bfe562e15f7bcdc6720c18d1cc4..0b20e9367f446f0f8d194e59d026d5a91f3e32e9 100644 --- a/apps/cpu/ViskomatXL/viskomat.cpp +++ b/apps/cpu/ViskomatXL/viskomat.cpp @@ -191,7 +191,7 @@ void bflow(string configname) //////////////////////////////////////////// //METIS - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::RECURSIVE)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::RECURSIVE)); //////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// //restart diff --git a/apps/cpu/rheometer/rheometer.cpp b/apps/cpu/rheometer/rheometer.cpp index 70a11bdc77e01b34965e3cb09b6ac3c5b43d4f83..e79d9d13a3763cb5502c24f12fb6ec4d27651814 100644 --- a/apps/cpu/rheometer/rheometer.cpp +++ b/apps/cpu/rheometer/rheometer.cpp @@ -223,7 +223,7 @@ void bflow(string configname) //////////////////////////////////////////// //METIS - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::KWAY)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::KWAY)); //////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// //restart @@ -313,7 +313,7 @@ void bflow(string configname) //////////////////////////////////////////// //METIS - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::KWAY)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::KWAY)); //////////////////////////////////////////// /////delete solid blocks if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start"); diff --git a/apps/cpu/sphere/sphere.cpp b/apps/cpu/sphere/sphere.cpp index 5ab9a2a70f59273c326d7757faf13e4e338c6614..bad77ee999d96b89fea43183929ecf4a3b920588 100644 --- a/apps/cpu/sphere/sphere.cpp +++ b/apps/cpu/sphere/sphere.cpp @@ -180,7 +180,7 @@ void run(string configname) //outflow SPtr<D3Q27Interactor> outflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, denBCAdapter, Interactor3D::SOLID)); - SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::B)); + SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_00M)); InteractorsHelper intHelper(grid, metisVisitor); intHelper.addInteractor(sphereInt); intHelper.addInteractor(addWallYminInt); diff --git a/src/cpu/VirtualFluids.h b/src/cpu/VirtualFluids.h index a7e4e798bc68d14967d1351bcb011bdca51ff84f..a9181e2280c17bc20dd1940e1989b6751c6cee66 100644 --- a/src/cpu/VirtualFluids.h +++ b/src/cpu/VirtualFluids.h @@ -175,7 +175,6 @@ #include <Grid/Block3D.h> #include <Grid/Calculator.h> #include <Grid/Grid3D.h> -#include <Grid/Grid3DSystem.h> #include <Interactors/D3Q27Interactor.h> #include <Interactors/D3Q27TriFaceMeshInteractor.h> diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h index 555ef9852c0e386c4263bd6dc5d105d814583860..fa61e7224ede371f1c28d3eab8e0ba795ccfa3b1 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BoundaryConditions.h @@ -193,59 +193,59 @@ public: float getBoundaryVelocity(const int &direction) { switch (direction) { - case D3Q27System::E: + case D3Q27System::DIR_P00: return (float)(UbMath::c4o9 * (+bcVelocityX1)); //(2/cs^2)(=6)*rho_0(=1 bei inkompr)*wi*u*ei mit cs=1/sqrt(3) - case D3Q27System::W: + case D3Q27System::DIR_M00: return (float)(UbMath::c4o9 * (-bcVelocityX1)); // z.B. aus paper manfred MRT LB models in three dimensions (2002) - case D3Q27System::N: + case D3Q27System::DIR_0P0: return (float)(UbMath::c4o9 * (+bcVelocityX2)); - case D3Q27System::S: + case D3Q27System::DIR_0M0: return (float)(UbMath::c4o9 * (-bcVelocityX2)); - case D3Q27System::T: + case D3Q27System::DIR_00P: return (float)(UbMath::c4o9 * (+bcVelocityX3)); - case D3Q27System::B: + case D3Q27System::DIR_00M: return (float)(UbMath::c4o9 * (-bcVelocityX3)); - case D3Q27System::NE: + case D3Q27System::DIR_PP0: return (float)(UbMath::c1o9 * (+bcVelocityX1 + bcVelocityX2)); - case D3Q27System::SW: + case D3Q27System::DIR_MM0: return (float)(UbMath::c1o9 * (-bcVelocityX1 - bcVelocityX2)); - case D3Q27System::SE: + case D3Q27System::DIR_PM0: return (float)(UbMath::c1o9 * (+bcVelocityX1 - bcVelocityX2)); - case D3Q27System::NW: + case D3Q27System::DIR_MP0: return (float)(UbMath::c1o9 * (-bcVelocityX1 + bcVelocityX2)); - case D3Q27System::TE: + case D3Q27System::DIR_P0P: return (float)(UbMath::c1o9 * (+bcVelocityX1 + bcVelocityX3)); - case D3Q27System::BW: + case D3Q27System::DIR_M0M: return (float)(UbMath::c1o9 * (-bcVelocityX1 - bcVelocityX3)); - case D3Q27System::BE: + case D3Q27System::DIR_P0M: return (float)(UbMath::c1o9 * (+bcVelocityX1 - bcVelocityX3)); - case D3Q27System::TW: + case D3Q27System::DIR_M0P: return (float)(UbMath::c1o9 * (-bcVelocityX1 + bcVelocityX3)); - case D3Q27System::TN: + case D3Q27System::DIR_0PP: return (float)(UbMath::c1o9 * (+bcVelocityX2 + bcVelocityX3)); - case D3Q27System::BS: + case D3Q27System::DIR_0MM: return (float)(UbMath::c1o9 * (-bcVelocityX2 - bcVelocityX3)); - case D3Q27System::BN: + case D3Q27System::DIR_0PM: return (float)(UbMath::c1o9 * (+bcVelocityX2 - bcVelocityX3)); - case D3Q27System::TS: + case D3Q27System::DIR_0MP: return (float)(UbMath::c1o9 * (-bcVelocityX2 + bcVelocityX3)); - case D3Q27System::TNE: + case D3Q27System::DIR_PPP: return (float)(UbMath::c1o36 * (+bcVelocityX1 + bcVelocityX2 + bcVelocityX3)); - case D3Q27System::BSW: + case D3Q27System::DIR_MMM: return (float)(UbMath::c1o36 * (-bcVelocityX1 - bcVelocityX2 - bcVelocityX3)); - case D3Q27System::BNE: + case D3Q27System::DIR_PPM: return (float)(UbMath::c1o36 * (+bcVelocityX1 + bcVelocityX2 - bcVelocityX3)); - case D3Q27System::TSW: + case D3Q27System::DIR_MMP: return (float)(UbMath::c1o36 * (-bcVelocityX1 - bcVelocityX2 + bcVelocityX3)); - case D3Q27System::TSE: + case D3Q27System::DIR_PMP: return (float)(UbMath::c1o36 * (+bcVelocityX1 - bcVelocityX2 + bcVelocityX3)); - case D3Q27System::BNW: + case D3Q27System::DIR_MPM: return (float)(UbMath::c1o36 * (-bcVelocityX1 + bcVelocityX2 - bcVelocityX3)); - case D3Q27System::BSE: + case D3Q27System::DIR_PMM: return (float)(UbMath::c1o36 * (+bcVelocityX1 - bcVelocityX2 - bcVelocityX3)); - case D3Q27System::TNW: + case D3Q27System::DIR_MPP: return (float)(UbMath::c1o36 * (-bcVelocityX1 + bcVelocityX2 + bcVelocityX3)); default: throw UbException(UB_EXARGS, "unknown error"); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/EqDensityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/EqDensityBCAlgorithm.cpp index 8551c4371fed0f2c5d710fcf30ecad2da80abef3..bdddd2369377f1e2b30c86eb243bf4d4a843e06c 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/EqDensityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/EqDensityBCAlgorithm.cpp @@ -63,17 +63,17 @@ void EqDensityBCAlgorithm::applyBC() int nx3 = x3; // flag points in direction of fluid - if (bcPtr->hasDensityBoundaryFlag(D3Q27System::E)) { + if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_P00)) { nx1 -= 1; - } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::W)) { + } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_M00)) { nx1 += 1; - } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::N)) { + } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_0P0)) { nx2 -= 1; - } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::S)) { + } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_0M0)) { nx2 += 1; - } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::T)) { + } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_00P)) { nx3 -= 1; - } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::B)) { + } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_00M)) { nx3 += 1; } else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on density boundary...")); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseNonReflectingOutflowBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseNonReflectingOutflowBCAlgorithm.cpp index d0a3b39c83c1d828801dd442fb387c4d4d33d589..fc60192440f7e8dc7b4636a4d297a20620e2a0c9 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseNonReflectingOutflowBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseNonReflectingOutflowBCAlgorithm.cpp @@ -77,12 +77,12 @@ void MultiphaseNonReflectingOutflowBCAlgorithm::applyBC() int direction = -1; //flag points in direction of fluid - if (bcPtr->hasDensityBoundaryFlag(E)) { nx1 += 1; direction = E; } - else if (bcPtr->hasDensityBoundaryFlag(W)) { nx1 -= 1; direction = W; } - else if (bcPtr->hasDensityBoundaryFlag(N)) { nx2 += 1; direction = N; } - else if (bcPtr->hasDensityBoundaryFlag(S)) { nx2 -= 1; direction = S; } - else if (bcPtr->hasDensityBoundaryFlag(T)) { nx3 += 1; direction = T; } - else if (bcPtr->hasDensityBoundaryFlag(B)) { nx3 -= 1; direction = B; } + if (bcPtr->hasDensityBoundaryFlag(DIR_P00)) { nx1 += 1; direction = DIR_P00; } + else if (bcPtr->hasDensityBoundaryFlag(DIR_M00)) { nx1 -= 1; direction = DIR_M00; } + else if (bcPtr->hasDensityBoundaryFlag(DIR_0P0)) { nx2 += 1; direction = DIR_0P0; } + else if (bcPtr->hasDensityBoundaryFlag(DIR_0M0)) { nx2 -= 1; direction = DIR_0M0; } + else if (bcPtr->hasDensityBoundaryFlag(DIR_00P)) { nx3 += 1; direction = DIR_00P; } + else if (bcPtr->hasDensityBoundaryFlag(DIR_00M)) { nx3 -= 1; direction = DIR_00M; } else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on density boundary...")); distributions->getDistribution(f, x1, x2, x3); @@ -98,256 +98,256 @@ void MultiphaseNonReflectingOutflowBCAlgorithm::applyBC() switch (direction) { - case E: - f[E] = ftemp[E] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[E] ; - f[NE] = ftemp[NE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[NE] ; - f[SE] = ftemp[SE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[SE] ; - f[TE] = ftemp[TE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[TE] ; - f[BE] = ftemp[BE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[BE] ; - f[TNE] = ftemp[TNE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[TNE] ; - f[TSE] = ftemp[TSE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[TSE] ; - f[BNE] = ftemp[BNE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[BNE] ; - f[BSE] = ftemp[BSE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[BSE] ; + case DIR_P00: + f[DIR_P00] = ftemp[DIR_P00] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[DIR_P00]; + f[DIR_PP0] = ftemp[DIR_PP0] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[DIR_PP0]; + f[DIR_PM0] = ftemp[DIR_PM0] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[DIR_PM0]; + f[DIR_P0P] = ftemp[DIR_P0P] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[DIR_P0P]; + f[DIR_P0M] = ftemp[DIR_P0M] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[DIR_P0M]; + f[DIR_PPP] = ftemp[DIR_PPP] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[DIR_PPP]; + f[DIR_PMP] = ftemp[DIR_PMP] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[DIR_PMP]; + f[DIR_PPM] = ftemp[DIR_PPM] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[DIR_PPM]; + f[DIR_PMM] = ftemp[DIR_PMM] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*f[DIR_PMM]; - distributions->setDistributionInvForDirection(f[E], x1+DX1[W], x2+DX2[W], x3+DX3[W], W); - distributions->setDistributionInvForDirection(f[NE], x1+DX1[SW], x2+DX2[SW], x3+DX3[SW], SW); - distributions->setDistributionInvForDirection(f[SE], x1+DX1[NW], x2+DX2[NW], x3+DX3[NW], NW); - distributions->setDistributionInvForDirection(f[TE], x1+DX1[BW], x2+DX2[BW], x3+DX3[BW], BW); - distributions->setDistributionInvForDirection(f[BE], x1+DX1[TW], x2+DX2[TW], x3+DX3[TW], TW); - distributions->setDistributionInvForDirection(f[TNE], x1+DX1[BSW], x2+DX2[BSW], x3+DX3[BSW], BSW); - distributions->setDistributionInvForDirection(f[TSE], x1+DX1[BNW], x2+DX2[BNW], x3+DX3[BNW], BNW); - distributions->setDistributionInvForDirection(f[BNE], x1+DX1[TSW], x2+DX2[TSW], x3+DX3[TSW], TSW); - distributions->setDistributionInvForDirection(f[BSE], x1+DX1[TNW], x2+DX2[TNW], x3+DX3[TNW], TNW); + distributions->setDistributionInvForDirection(f[DIR_P00], x1+DX1[DIR_M00], x2+DX2[DIR_M00], x3+DX3[DIR_M00], DIR_M00); + distributions->setDistributionInvForDirection(f[DIR_PP0], x1+DX1[DIR_MM0], x2+DX2[DIR_MM0], x3+DX3[DIR_MM0], DIR_MM0); + distributions->setDistributionInvForDirection(f[DIR_PM0], x1+DX1[DIR_MP0], x2+DX2[DIR_MP0], x3+DX3[DIR_MP0], DIR_MP0); + distributions->setDistributionInvForDirection(f[DIR_P0P], x1+DX1[DIR_M0M], x2+DX2[DIR_M0M], x3+DX3[DIR_M0M], DIR_M0M); + distributions->setDistributionInvForDirection(f[DIR_P0M], x1+DX1[DIR_M0P], x2+DX2[DIR_M0P], x3+DX3[DIR_M0P], DIR_M0P); + distributions->setDistributionInvForDirection(f[DIR_PPP], x1+DX1[DIR_MMM], x2+DX2[DIR_MMM], x3+DX3[DIR_MMM], DIR_MMM); + distributions->setDistributionInvForDirection(f[DIR_PMP], x1+DX1[DIR_MPM], x2+DX2[DIR_MPM], x3+DX3[DIR_MPM], DIR_MPM); + distributions->setDistributionInvForDirection(f[DIR_PPM], x1+DX1[DIR_MMP], x2+DX2[DIR_MMP], x3+DX3[DIR_MMP], DIR_MMP); + distributions->setDistributionInvForDirection(f[DIR_PMM], x1+DX1[DIR_MPP], x2+DX2[DIR_MPP], x3+DX3[DIR_MPP], DIR_MPP); - h[E] = htemp[E] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[E] ; - h[NE] = htemp[NE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[NE] ; - h[SE] = htemp[SE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[SE] ; - h[TE] = htemp[TE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[TE] ; - h[BE] = htemp[BE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[BE] ; - h[TNE] = htemp[TNE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[TNE] ; - h[TSE] = htemp[TSE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[TSE] ; - h[BNE] = htemp[BNE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[BNE] ; - h[BSE] = htemp[BSE] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[BSE] ; + h[DIR_P00] = htemp[DIR_P00] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[DIR_P00]; + h[DIR_PP0] = htemp[DIR_PP0] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[DIR_PP0]; + h[DIR_PM0] = htemp[DIR_PM0] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[DIR_PM0]; + h[DIR_P0P] = htemp[DIR_P0P] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[DIR_P0P]; + h[DIR_P0M] = htemp[DIR_P0M] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[DIR_P0M]; + h[DIR_PPP] = htemp[DIR_PPP] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[DIR_PPP]; + h[DIR_PMP] = htemp[DIR_PMP] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[DIR_PMP]; + h[DIR_PPM] = htemp[DIR_PPM] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[DIR_PPM]; + h[DIR_PMM] = htemp[DIR_PMM] * (one_over_sqrt3 + vx1) + (1.0 - one_over_sqrt3 - vx1)*h[DIR_PMM]; - distributionsH->setDistributionInvForDirection(h[E], x1+DX1[W], x2+DX2[W], x3+DX3[W], W); - distributionsH->setDistributionInvForDirection(h[NE], x1+DX1[SW], x2+DX2[SW], x3+DX3[SW], SW); - distributionsH->setDistributionInvForDirection(h[SE], x1+DX1[NW], x2+DX2[NW], x3+DX3[NW], NW); - distributionsH->setDistributionInvForDirection(h[TE], x1+DX1[BW], x2+DX2[BW], x3+DX3[BW], BW); - distributionsH->setDistributionInvForDirection(h[BE], x1+DX1[TW], x2+DX2[TW], x3+DX3[TW], TW); - distributionsH->setDistributionInvForDirection(h[TNE], x1+DX1[BSW], x2+DX2[BSW], x3+DX3[BSW], BSW); - distributionsH->setDistributionInvForDirection(h[TSE], x1+DX1[BNW], x2+DX2[BNW], x3+DX3[BNW], BNW); - distributionsH->setDistributionInvForDirection(h[BNE], x1+DX1[TSW], x2+DX2[TSW], x3+DX3[TSW], TSW); - distributionsH->setDistributionInvForDirection(h[BSE], x1+DX1[TNW], x2+DX2[TNW], x3+DX3[TNW], TNW); + distributionsH->setDistributionInvForDirection(h[DIR_P00], x1+DX1[DIR_M00], x2+DX2[DIR_M00], x3+DX3[DIR_M00], DIR_M00); + distributionsH->setDistributionInvForDirection(h[DIR_PP0], x1+DX1[DIR_MM0], x2+DX2[DIR_MM0], x3+DX3[DIR_MM0], DIR_MM0); + distributionsH->setDistributionInvForDirection(h[DIR_PM0], x1+DX1[DIR_MP0], x2+DX2[DIR_MP0], x3+DX3[DIR_MP0], DIR_MP0); + distributionsH->setDistributionInvForDirection(h[DIR_P0P], x1+DX1[DIR_M0M], x2+DX2[DIR_M0M], x3+DX3[DIR_M0M], DIR_M0M); + distributionsH->setDistributionInvForDirection(h[DIR_P0M], x1+DX1[DIR_M0P], x2+DX2[DIR_M0P], x3+DX3[DIR_M0P], DIR_M0P); + distributionsH->setDistributionInvForDirection(h[DIR_PPP], x1+DX1[DIR_MMM], x2+DX2[DIR_MMM], x3+DX3[DIR_MMM], DIR_MMM); + distributionsH->setDistributionInvForDirection(h[DIR_PMP], x1+DX1[DIR_MPM], x2+DX2[DIR_MPM], x3+DX3[DIR_MPM], DIR_MPM); + distributionsH->setDistributionInvForDirection(h[DIR_PPM], x1+DX1[DIR_MMP], x2+DX2[DIR_MMP], x3+DX3[DIR_MMP], DIR_MMP); + distributionsH->setDistributionInvForDirection(h[DIR_PMM], x1+DX1[DIR_MPP], x2+DX2[DIR_MPP], x3+DX3[DIR_MPP], DIR_MPP); break; - case W: - f[W] = ftemp[W] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[W] ; - f[NW] = ftemp[NW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[NW] ; - f[SW] = ftemp[SW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[SW] ; - f[TW] = ftemp[TW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[TW] ; - f[BW] = ftemp[BW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[BW] ; - f[TNW] = ftemp[TNW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[TNW]; - f[TSW] = ftemp[TSW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[TSW]; - f[BNW] = ftemp[BNW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[BNW]; - f[BSW] = ftemp[BSW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[BSW]; + case DIR_M00: + f[DIR_M00] = ftemp[DIR_M00] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[DIR_M00] ; + f[DIR_MP0] = ftemp[DIR_MP0] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[DIR_MP0] ; + f[DIR_MM0] = ftemp[DIR_MM0] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[DIR_MM0] ; + f[DIR_M0P] = ftemp[DIR_M0P] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[DIR_M0P] ; + f[DIR_M0M] = ftemp[DIR_M0M] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[DIR_M0M] ; + f[DIR_MPP] = ftemp[DIR_MPP] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[DIR_MPP]; + f[DIR_MMP] = ftemp[DIR_MMP] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[DIR_MMP]; + f[DIR_MPM] = ftemp[DIR_MPM] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[DIR_MPM]; + f[DIR_MMM] = ftemp[DIR_MMM] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*f[DIR_MMM]; - distributions->setDistributionInvForDirection(f[W], x1+DX1[E], x2+DX2[E], x3+DX3[E], E); - distributions->setDistributionInvForDirection(f[NW], x1+DX1[SE], x2+DX2[SE], x3+DX3[SE], SE); - distributions->setDistributionInvForDirection(f[SW], x1+DX1[NE], x2+DX2[NE], x3+DX3[NE], NE); - distributions->setDistributionInvForDirection(f[TW], x1+DX1[BE], x2+DX2[BE], x3+DX3[BE], BE); - distributions->setDistributionInvForDirection(f[BW], x1+DX1[TE], x2+DX2[TE], x3+DX3[TE], TE); - distributions->setDistributionInvForDirection(f[TNW], x1+DX1[BSE], x2+DX2[BSE], x3+DX3[BSE], BSE); - distributions->setDistributionInvForDirection(f[TSW], x1+DX1[BNE], x2+DX2[BNE], x3+DX3[BNE], BNE); - distributions->setDistributionInvForDirection(f[BNW], x1+DX1[TSE], x2+DX2[TSE], x3+DX3[TSE], TSE); - distributions->setDistributionInvForDirection(f[BSW], x1+DX1[TNE], x2+DX2[TNE], x3+DX3[TNE], TNE); + distributions->setDistributionInvForDirection(f[DIR_M00], x1+DX1[DIR_P00], x2+DX2[DIR_P00], x3+DX3[DIR_P00], DIR_P00); + distributions->setDistributionInvForDirection(f[DIR_MP0], x1+DX1[DIR_PM0], x2+DX2[DIR_PM0], x3+DX3[DIR_PM0], DIR_PM0); + distributions->setDistributionInvForDirection(f[DIR_MM0], x1+DX1[DIR_PP0], x2+DX2[DIR_PP0], x3+DX3[DIR_PP0], DIR_PP0); + distributions->setDistributionInvForDirection(f[DIR_M0P], x1+DX1[DIR_P0M], x2+DX2[DIR_P0M], x3+DX3[DIR_P0M], DIR_P0M); + distributions->setDistributionInvForDirection(f[DIR_M0M], x1+DX1[DIR_P0P], x2+DX2[DIR_P0P], x3+DX3[DIR_P0P], DIR_P0P); + distributions->setDistributionInvForDirection(f[DIR_MPP], x1+DX1[DIR_PMM], x2+DX2[DIR_PMM], x3+DX3[DIR_PMM], DIR_PMM); + distributions->setDistributionInvForDirection(f[DIR_MMP], x1+DX1[DIR_PPM], x2+DX2[DIR_PPM], x3+DX3[DIR_PPM], DIR_PPM); + distributions->setDistributionInvForDirection(f[DIR_MPM], x1+DX1[DIR_PMP], x2+DX2[DIR_PMP], x3+DX3[DIR_PMP], DIR_PMP); + distributions->setDistributionInvForDirection(f[DIR_MMM], x1+DX1[DIR_PPP], x2+DX2[DIR_PPP], x3+DX3[DIR_PPP], DIR_PPP); - h[W] = htemp[W] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[W] ; - h[NW] = htemp[NW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[NW] ; - h[SW] = htemp[SW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[SW] ; - h[TW] = htemp[TW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[TW] ; - h[BW] = htemp[BW] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[BW] ; - h[TNW] = htemp[TNW]* (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[TNW]; - h[TSW] = htemp[TSW]* (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[TSW]; - h[BNW] = htemp[BNW]* (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[BNW]; - h[BSW] = htemp[BSW]* (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[BSW]; + h[DIR_M00] = htemp[DIR_M00] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[DIR_M00] ; + h[DIR_MP0] = htemp[DIR_MP0] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[DIR_MP0] ; + h[DIR_MM0] = htemp[DIR_MM0] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[DIR_MM0] ; + h[DIR_M0P] = htemp[DIR_M0P] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[DIR_M0P] ; + h[DIR_M0M] = htemp[DIR_M0M] * (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[DIR_M0M] ; + h[DIR_MPP] = htemp[DIR_MPP]* (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[DIR_MPP]; + h[DIR_MMP] = htemp[DIR_MMP]* (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[DIR_MMP]; + h[DIR_MPM] = htemp[DIR_MPM]* (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[DIR_MPM]; + h[DIR_MMM] = htemp[DIR_MMM]* (one_over_sqrt3 - vx1) + (1.0 - one_over_sqrt3 + vx1)*h[DIR_MMM]; - distributionsH->setDistributionInvForDirection(h[W], x1+DX1[E], x2+DX2[E], x3+DX3[E], E); - distributionsH->setDistributionInvForDirection(h[NW], x1+DX1[SE], x2+DX2[SE], x3+DX3[SE], SE); - distributionsH->setDistributionInvForDirection(h[SW], x1+DX1[NE], x2+DX2[NE], x3+DX3[NE], NE); - distributionsH->setDistributionInvForDirection(h[TW], x1+DX1[BE], x2+DX2[BE], x3+DX3[BE], BE); - distributionsH->setDistributionInvForDirection(h[BW], x1+DX1[TE], x2+DX2[TE], x3+DX3[TE], TE); - distributionsH->setDistributionInvForDirection(h[TNW], x1+DX1[BSE], x2+DX2[BSE], x3+DX3[BSE], BSE); - distributionsH->setDistributionInvForDirection(h[TSW], x1+DX1[BNE], x2+DX2[BNE], x3+DX3[BNE], BNE); - distributionsH->setDistributionInvForDirection(h[BNW], x1+DX1[TSE], x2+DX2[TSE], x3+DX3[TSE], TSE); - distributionsH->setDistributionInvForDirection(h[BSW], x1+DX1[TNE], x2+DX2[TNE], x3+DX3[TNE], TNE); + distributionsH->setDistributionInvForDirection(h[DIR_M00], x1+DX1[DIR_P00], x2+DX2[DIR_P00], x3+DX3[DIR_P00], DIR_P00); + distributionsH->setDistributionInvForDirection(h[DIR_MP0], x1+DX1[DIR_PM0], x2+DX2[DIR_PM0], x3+DX3[DIR_PM0], DIR_PM0); + distributionsH->setDistributionInvForDirection(h[DIR_MM0], x1+DX1[DIR_PP0], x2+DX2[DIR_PP0], x3+DX3[DIR_PP0], DIR_PP0); + distributionsH->setDistributionInvForDirection(h[DIR_M0P], x1+DX1[DIR_P0M], x2+DX2[DIR_P0M], x3+DX3[DIR_P0M], DIR_P0M); + distributionsH->setDistributionInvForDirection(h[DIR_M0M], x1+DX1[DIR_P0P], x2+DX2[DIR_P0P], x3+DX3[DIR_P0P], DIR_P0P); + distributionsH->setDistributionInvForDirection(h[DIR_MPP], x1+DX1[DIR_PMM], x2+DX2[DIR_PMM], x3+DX3[DIR_PMM], DIR_PMM); + distributionsH->setDistributionInvForDirection(h[DIR_MMP], x1+DX1[DIR_PPM], x2+DX2[DIR_PPM], x3+DX3[DIR_PPM], DIR_PPM); + distributionsH->setDistributionInvForDirection(h[DIR_MPM], x1+DX1[DIR_PMP], x2+DX2[DIR_PMP], x3+DX3[DIR_PMP], DIR_PMP); + distributionsH->setDistributionInvForDirection(h[DIR_MMM], x1+DX1[DIR_PPP], x2+DX2[DIR_PPP], x3+DX3[DIR_PPP], DIR_PPP); break; - case N: - f[N] = ftemp[N] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[N] ; - f[NE] = ftemp[NE] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[NE] ; - f[NW] = ftemp[NW] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[NW] ; - f[TN] = ftemp[TN] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[TN] ; - f[BN] = ftemp[BN] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[BN] ; - f[TNE] = ftemp[TNE] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[TNE] ; - f[TNW] = ftemp[TNW] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[TNW] ; - f[BNE] = ftemp[BNE] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[BNE] ; - f[BNW] = ftemp[BNW] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[BNW] ; + case DIR_0P0: + f[DIR_0P0] = ftemp[DIR_0P0] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[DIR_0P0] ; + f[DIR_PP0] = ftemp[DIR_PP0] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[DIR_PP0] ; + f[DIR_MP0] = ftemp[DIR_MP0] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[DIR_MP0] ; + f[DIR_0PP] = ftemp[DIR_0PP] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[DIR_0PP] ; + f[DIR_0PM] = ftemp[DIR_0PM] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[DIR_0PM] ; + f[DIR_PPP] = ftemp[DIR_PPP] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[DIR_PPP] ; + f[DIR_MPP] = ftemp[DIR_MPP] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[DIR_MPP] ; + f[DIR_PPM] = ftemp[DIR_PPM] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[DIR_PPM] ; + f[DIR_MPM] = ftemp[DIR_MPM] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*f[DIR_MPM] ; - distributions->setDistributionInvForDirection(f[N], x1+DX1[S], x2+DX2[S], x3+DX3[S], S); - distributions->setDistributionInvForDirection(f[NE], x1+DX1[SW], x2+DX2[SW], x3+DX3[SW], SW); - distributions->setDistributionInvForDirection(f[NW], x1+DX1[SE], x2+DX2[SE], x3+DX3[SE], SE); - distributions->setDistributionInvForDirection(f[TN], x1+DX1[BS], x2+DX2[BS], x3+DX3[BS], BS); - distributions->setDistributionInvForDirection(f[BN], x1+DX1[TS], x2+DX2[TS], x3+DX3[TS], TS); - distributions->setDistributionInvForDirection(f[TNE], x1+DX1[BSW], x2+DX2[BSW], x3+DX3[BSW], BSW); - distributions->setDistributionInvForDirection(f[TNW], x1+DX1[BSE], x2+DX2[BSE], x3+DX3[BSE], BSE); - distributions->setDistributionInvForDirection(f[BNE], x1+DX1[TSW], x2+DX2[TSW], x3+DX3[TSW], TSW); - distributions->setDistributionInvForDirection(f[BNW], x1+DX1[TSE], x2+DX2[TSE], x3+DX3[TSE], TSE); + distributions->setDistributionInvForDirection(f[DIR_0P0], x1+DX1[DIR_0M0], x2+DX2[DIR_0M0], x3+DX3[DIR_0M0], DIR_0M0); + distributions->setDistributionInvForDirection(f[DIR_PP0], x1+DX1[DIR_MM0], x2+DX2[DIR_MM0], x3+DX3[DIR_MM0], DIR_MM0); + distributions->setDistributionInvForDirection(f[DIR_MP0], x1+DX1[DIR_PM0], x2+DX2[DIR_PM0], x3+DX3[DIR_PM0], DIR_PM0); + distributions->setDistributionInvForDirection(f[DIR_0PP], x1+DX1[DIR_0MM], x2+DX2[DIR_0MM], x3+DX3[DIR_0MM], DIR_0MM); + distributions->setDistributionInvForDirection(f[DIR_0PM], x1+DX1[DIR_0MP], x2+DX2[DIR_0MP], x3+DX3[DIR_0MP], DIR_0MP); + distributions->setDistributionInvForDirection(f[DIR_PPP], x1+DX1[DIR_MMM], x2+DX2[DIR_MMM], x3+DX3[DIR_MMM], DIR_MMM); + distributions->setDistributionInvForDirection(f[DIR_MPP], x1+DX1[DIR_PMM], x2+DX2[DIR_PMM], x3+DX3[DIR_PMM], DIR_PMM); + distributions->setDistributionInvForDirection(f[DIR_PPM], x1+DX1[DIR_MMP], x2+DX2[DIR_MMP], x3+DX3[DIR_MMP], DIR_MMP); + distributions->setDistributionInvForDirection(f[DIR_MPM], x1+DX1[DIR_PMP], x2+DX2[DIR_PMP], x3+DX3[DIR_PMP], DIR_PMP); - h[N] = htemp[N] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[N] ; - h[NE] = htemp[NE] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[NE] ; - h[NW] = htemp[NW] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[NW] ; - h[TN] = htemp[TN] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[TN] ; - h[BN] = htemp[BN] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[BN] ; - h[TNE] = htemp[TNE] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[TNE] ; - h[TNW] = htemp[TNW] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[TNW] ; - h[BNE] = htemp[BNE] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[BNE] ; - h[BNW] = htemp[BNW] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[BNW] ; + h[DIR_0P0] = htemp[DIR_0P0] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[DIR_0P0] ; + h[DIR_PP0] = htemp[DIR_PP0] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[DIR_PP0] ; + h[DIR_MP0] = htemp[DIR_MP0] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[DIR_MP0] ; + h[DIR_0PP] = htemp[DIR_0PP] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[DIR_0PP] ; + h[DIR_0PM] = htemp[DIR_0PM] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[DIR_0PM] ; + h[DIR_PPP] = htemp[DIR_PPP] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[DIR_PPP] ; + h[DIR_MPP] = htemp[DIR_MPP] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[DIR_MPP] ; + h[DIR_PPM] = htemp[DIR_PPM] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[DIR_PPM] ; + h[DIR_MPM] = htemp[DIR_MPM] * (one_over_sqrt3 + vx2) + (1.0 - one_over_sqrt3 - vx2)*h[DIR_MPM] ; - distributionsH->setDistributionInvForDirection(h[N], x1+DX1[S], x2+DX2[S], x3+DX3[S], S); - distributionsH->setDistributionInvForDirection(h[NE], x1+DX1[SW], x2+DX2[SW], x3+DX3[SW], SW); - distributionsH->setDistributionInvForDirection(h[NW], x1+DX1[SE], x2+DX2[SE], x3+DX3[SE], SE); - distributionsH->setDistributionInvForDirection(h[TN], x1+DX1[BS], x2+DX2[BS], x3+DX3[BS], BS); - distributionsH->setDistributionInvForDirection(h[BN], x1+DX1[TS], x2+DX2[TS], x3+DX3[TS], TS); - distributionsH->setDistributionInvForDirection(h[TNE], x1+DX1[BSW], x2+DX2[BSW], x3+DX3[BSW], BSW); - distributionsH->setDistributionInvForDirection(h[TNW], x1+DX1[BSE], x2+DX2[BSE], x3+DX3[BSE], BSE); - distributionsH->setDistributionInvForDirection(h[BNE], x1+DX1[TSW], x2+DX2[TSW], x3+DX3[TSW], TSW); - distributionsH->setDistributionInvForDirection(h[BNW], x1+DX1[TSE], x2+DX2[TSE], x3+DX3[TSE], TSE); + distributionsH->setDistributionInvForDirection(h[DIR_0P0], x1+DX1[DIR_0M0], x2+DX2[DIR_0M0], x3+DX3[DIR_0M0], DIR_0M0); + distributionsH->setDistributionInvForDirection(h[DIR_PP0], x1+DX1[DIR_MM0], x2+DX2[DIR_MM0], x3+DX3[DIR_MM0], DIR_MM0); + distributionsH->setDistributionInvForDirection(h[DIR_MP0], x1+DX1[DIR_PM0], x2+DX2[DIR_PM0], x3+DX3[DIR_PM0], DIR_PM0); + distributionsH->setDistributionInvForDirection(h[DIR_0PP], x1+DX1[DIR_0MM], x2+DX2[DIR_0MM], x3+DX3[DIR_0MM], DIR_0MM); + distributionsH->setDistributionInvForDirection(h[DIR_0PM], x1+DX1[DIR_0MP], x2+DX2[DIR_0MP], x3+DX3[DIR_0MP], DIR_0MP); + distributionsH->setDistributionInvForDirection(h[DIR_PPP], x1+DX1[DIR_MMM], x2+DX2[DIR_MMM], x3+DX3[DIR_MMM], DIR_MMM); + distributionsH->setDistributionInvForDirection(h[DIR_MPP], x1+DX1[DIR_PMM], x2+DX2[DIR_PMM], x3+DX3[DIR_PMM], DIR_PMM); + distributionsH->setDistributionInvForDirection(h[DIR_PPM], x1+DX1[DIR_MMP], x2+DX2[DIR_MMP], x3+DX3[DIR_MMP], DIR_MMP); + distributionsH->setDistributionInvForDirection(h[DIR_MPM], x1+DX1[DIR_PMP], x2+DX2[DIR_PMP], x3+DX3[DIR_PMP], DIR_PMP); break; - case S: - f[S] = ftemp[S] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[S] ; - f[SE] = ftemp[SE] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[SE] ; - f[SW] = ftemp[SW] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[SW] ; - f[TS] = ftemp[TS] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[TS] ; - f[BS] = ftemp[BS] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[BS] ; - f[TSE] = ftemp[TSE] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[TSE] ; - f[TSW] = ftemp[TSW] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[TSW] ; - f[BSE] = ftemp[BSE] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[BSE] ; - f[BSW] = ftemp[BSW] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[BSW] ; + case DIR_0M0: + f[DIR_0M0] = ftemp[DIR_0M0] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[DIR_0M0] ; + f[DIR_PM0] = ftemp[DIR_PM0] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[DIR_PM0] ; + f[DIR_MM0] = ftemp[DIR_MM0] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[DIR_MM0] ; + f[DIR_0MP] = ftemp[DIR_0MP] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[DIR_0MP] ; + f[DIR_0MM] = ftemp[DIR_0MM] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[DIR_0MM] ; + f[DIR_PMP] = ftemp[DIR_PMP] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[DIR_PMP] ; + f[DIR_MMP] = ftemp[DIR_MMP] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[DIR_MMP] ; + f[DIR_PMM] = ftemp[DIR_PMM] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[DIR_PMM] ; + f[DIR_MMM] = ftemp[DIR_MMM] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*f[DIR_MMM] ; - distributions->setDistributionInvForDirection(f[S], x1+DX1[N], x2+DX2[N], x3+DX3[N], N); - distributions->setDistributionInvForDirection(f[SE], x1+DX1[NW], x2+DX2[NW], x3+DX3[NW], NW); - distributions->setDistributionInvForDirection(f[SW], x1+DX1[NE], x2+DX2[NE], x3+DX3[NE], NE); - distributions->setDistributionInvForDirection(f[TS], x1+DX1[BN], x2+DX2[BN], x3+DX3[BN], BN); - distributions->setDistributionInvForDirection(f[BS], x1+DX1[TN], x2+DX2[TN], x3+DX3[TN], TN); - distributions->setDistributionInvForDirection(f[TSE], x1+DX1[BNW], x2+DX2[BNW], x3+DX3[BNW], BNW); - distributions->setDistributionInvForDirection(f[TSW], x1+DX1[BNE], x2+DX2[BNE], x3+DX3[BNE], BNE); - distributions->setDistributionInvForDirection(f[BSE], x1+DX1[TNW], x2+DX2[TNW], x3+DX3[TNW], TNW); - distributions->setDistributionInvForDirection(f[BSW], x1+DX1[TNE], x2+DX2[TNE], x3+DX3[TNE], TNE); + distributions->setDistributionInvForDirection(f[DIR_0M0], x1+DX1[DIR_0P0], x2+DX2[DIR_0P0], x3+DX3[DIR_0P0], DIR_0P0); + distributions->setDistributionInvForDirection(f[DIR_PM0], x1+DX1[DIR_MP0], x2+DX2[DIR_MP0], x3+DX3[DIR_MP0], DIR_MP0); + distributions->setDistributionInvForDirection(f[DIR_MM0], x1+DX1[DIR_PP0], x2+DX2[DIR_PP0], x3+DX3[DIR_PP0], DIR_PP0); + distributions->setDistributionInvForDirection(f[DIR_0MP], x1+DX1[DIR_0PM], x2+DX2[DIR_0PM], x3+DX3[DIR_0PM], DIR_0PM); + distributions->setDistributionInvForDirection(f[DIR_0MM], x1+DX1[DIR_0PP], x2+DX2[DIR_0PP], x3+DX3[DIR_0PP], DIR_0PP); + distributions->setDistributionInvForDirection(f[DIR_PMP], x1+DX1[DIR_MPM], x2+DX2[DIR_MPM], x3+DX3[DIR_MPM], DIR_MPM); + distributions->setDistributionInvForDirection(f[DIR_MMP], x1+DX1[DIR_PPM], x2+DX2[DIR_PPM], x3+DX3[DIR_PPM], DIR_PPM); + distributions->setDistributionInvForDirection(f[DIR_PMM], x1+DX1[DIR_MPP], x2+DX2[DIR_MPP], x3+DX3[DIR_MPP], DIR_MPP); + distributions->setDistributionInvForDirection(f[DIR_MMM], x1+DX1[DIR_PPP], x2+DX2[DIR_PPP], x3+DX3[DIR_PPP], DIR_PPP); - h[S] = htemp[S] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[S] ; - h[SE] = htemp[SE] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[SE] ; - h[SW] = htemp[SW] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[SW] ; - h[TS] = htemp[TS] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[TS] ; - h[BS] = htemp[BS] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[BS] ; - h[TSE] = htemp[TSE] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[TSE] ; - h[TSW] = htemp[TSW] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[TSW] ; - h[BSE] = htemp[BSE] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[BSE] ; - h[BSW] = htemp[BSW] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[BSW] ; + h[DIR_0M0] = htemp[DIR_0M0] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[DIR_0M0] ; + h[DIR_PM0] = htemp[DIR_PM0] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[DIR_PM0] ; + h[DIR_MM0] = htemp[DIR_MM0] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[DIR_MM0] ; + h[DIR_0MP] = htemp[DIR_0MP] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[DIR_0MP] ; + h[DIR_0MM] = htemp[DIR_0MM] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[DIR_0MM] ; + h[DIR_PMP] = htemp[DIR_PMP] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[DIR_PMP] ; + h[DIR_MMP] = htemp[DIR_MMP] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[DIR_MMP] ; + h[DIR_PMM] = htemp[DIR_PMM] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[DIR_PMM] ; + h[DIR_MMM] = htemp[DIR_MMM] * (one_over_sqrt3 - vx2) + (1.0 - one_over_sqrt3 + vx2)*h[DIR_MMM] ; - distributionsH->setDistributionInvForDirection(h[S], x1+DX1[N], x2+DX2[N], x3+DX3[N], N); - distributionsH->setDistributionInvForDirection(h[SE], x1+DX1[NW], x2+DX2[NW], x3+DX3[NW], NW); - distributionsH->setDistributionInvForDirection(h[SW], x1+DX1[NE], x2+DX2[NE], x3+DX3[NE], NE); - distributionsH->setDistributionInvForDirection(h[TS], x1+DX1[BN], x2+DX2[BN], x3+DX3[BN], BN); - distributionsH->setDistributionInvForDirection(h[BS], x1+DX1[TN], x2+DX2[TN], x3+DX3[TN], TN); - distributionsH->setDistributionInvForDirection(h[TSE], x1+DX1[BNW], x2+DX2[BNW], x3+DX3[BNW], BNW); - distributionsH->setDistributionInvForDirection(h[TSW], x1+DX1[BNE], x2+DX2[BNE], x3+DX3[BNE], BNE); - distributionsH->setDistributionInvForDirection(h[BSE], x1+DX1[TNW], x2+DX2[TNW], x3+DX3[TNW], TNW); - distributionsH->setDistributionInvForDirection(h[BSW], x1+DX1[TNE], x2+DX2[TNE], x3+DX3[TNE], TNE); + distributionsH->setDistributionInvForDirection(h[DIR_0M0], x1+DX1[DIR_0P0], x2+DX2[DIR_0P0], x3+DX3[DIR_0P0], DIR_0P0); + distributionsH->setDistributionInvForDirection(h[DIR_PM0], x1+DX1[DIR_MP0], x2+DX2[DIR_MP0], x3+DX3[DIR_MP0], DIR_MP0); + distributionsH->setDistributionInvForDirection(h[DIR_MM0], x1+DX1[DIR_PP0], x2+DX2[DIR_PP0], x3+DX3[DIR_PP0], DIR_PP0); + distributionsH->setDistributionInvForDirection(h[DIR_0MP], x1+DX1[DIR_0PM], x2+DX2[DIR_0PM], x3+DX3[DIR_0PM], DIR_0PM); + distributionsH->setDistributionInvForDirection(h[DIR_0MM], x1+DX1[DIR_0PP], x2+DX2[DIR_0PP], x3+DX3[DIR_0PP], DIR_0PP); + distributionsH->setDistributionInvForDirection(h[DIR_PMP], x1+DX1[DIR_MPM], x2+DX2[DIR_MPM], x3+DX3[DIR_MPM], DIR_MPM); + distributionsH->setDistributionInvForDirection(h[DIR_MMP], x1+DX1[DIR_PPM], x2+DX2[DIR_PPM], x3+DX3[DIR_PPM], DIR_PPM); + distributionsH->setDistributionInvForDirection(h[DIR_PMM], x1+DX1[DIR_MPP], x2+DX2[DIR_MPP], x3+DX3[DIR_MPP], DIR_MPP); + distributionsH->setDistributionInvForDirection(h[DIR_MMM], x1+DX1[DIR_PPP], x2+DX2[DIR_PPP], x3+DX3[DIR_PPP], DIR_PPP); break; - case T: - f[T] = ftemp[T] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[T] ; - f[TE] = ftemp[TE] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[TE] ; - f[TW] = ftemp[TW] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[TW] ; - f[TN] = ftemp[TN] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[TN] ; - f[TS] = ftemp[TS] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[TS] ; - f[TNE] = ftemp[TNE] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[TNE] ; - f[TNW] = ftemp[TNW] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[TNW] ; - f[TSE] = ftemp[TSE] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[TSE] ; - f[TSW] = ftemp[TSW] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[TSW] ; + case DIR_00P: + f[DIR_00P] = ftemp[DIR_00P] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[DIR_00P] ; + f[DIR_P0P] = ftemp[DIR_P0P] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[DIR_P0P] ; + f[DIR_M0P] = ftemp[DIR_M0P] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[DIR_M0P] ; + f[DIR_0PP] = ftemp[DIR_0PP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[DIR_0PP] ; + f[DIR_0MP] = ftemp[DIR_0MP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[DIR_0MP] ; + f[DIR_PPP] = ftemp[DIR_PPP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[DIR_PPP] ; + f[DIR_MPP] = ftemp[DIR_MPP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[DIR_MPP] ; + f[DIR_PMP] = ftemp[DIR_PMP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[DIR_PMP] ; + f[DIR_MMP] = ftemp[DIR_MMP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*f[DIR_MMP] ; - distributions->setDistributionInvForDirection(f[T], x1+DX1[B], x2+DX2[B], x3+DX3[B], B); - distributions->setDistributionInvForDirection(f[TE], x1+DX1[BW], x2+DX2[BW], x3+DX3[BW], BW); - distributions->setDistributionInvForDirection(f[TW], x1+DX1[BE], x2+DX2[BE], x3+DX3[BE], BE); - distributions->setDistributionInvForDirection(f[TN], x1+DX1[BS], x2+DX2[BS], x3+DX3[BS], BS); - distributions->setDistributionInvForDirection(f[TS], x1+DX1[BN], x2+DX2[BN], x3+DX3[BN], BN); - distributions->setDistributionInvForDirection(f[TNE], x1+DX1[BSW], x2+DX2[BSW], x3+DX3[BSW], BSW); - distributions->setDistributionInvForDirection(f[TNW], x1+DX1[BSE], x2+DX2[BSE], x3+DX3[BSE], BSE); - distributions->setDistributionInvForDirection(f[TSE], x1+DX1[BNW], x2+DX2[BNW], x3+DX3[BNW], BNW); - distributions->setDistributionInvForDirection(f[TSW], x1+DX1[BNE], x2+DX2[BNE], x3+DX3[BNE], BNE); + distributions->setDistributionInvForDirection(f[DIR_00P], x1+DX1[DIR_00M], x2+DX2[DIR_00M], x3+DX3[DIR_00M], DIR_00M); + distributions->setDistributionInvForDirection(f[DIR_P0P], x1+DX1[DIR_M0M], x2+DX2[DIR_M0M], x3+DX3[DIR_M0M], DIR_M0M); + distributions->setDistributionInvForDirection(f[DIR_M0P], x1+DX1[DIR_P0M], x2+DX2[DIR_P0M], x3+DX3[DIR_P0M], DIR_P0M); + distributions->setDistributionInvForDirection(f[DIR_0PP], x1+DX1[DIR_0MM], x2+DX2[DIR_0MM], x3+DX3[DIR_0MM], DIR_0MM); + distributions->setDistributionInvForDirection(f[DIR_0MP], x1+DX1[DIR_0PM], x2+DX2[DIR_0PM], x3+DX3[DIR_0PM], DIR_0PM); + distributions->setDistributionInvForDirection(f[DIR_PPP], x1+DX1[DIR_MMM], x2+DX2[DIR_MMM], x3+DX3[DIR_MMM], DIR_MMM); + distributions->setDistributionInvForDirection(f[DIR_MPP], x1+DX1[DIR_PMM], x2+DX2[DIR_PMM], x3+DX3[DIR_PMM], DIR_PMM); + distributions->setDistributionInvForDirection(f[DIR_PMP], x1+DX1[DIR_MPM], x2+DX2[DIR_MPM], x3+DX3[DIR_MPM], DIR_MPM); + distributions->setDistributionInvForDirection(f[DIR_MMP], x1+DX1[DIR_PPM], x2+DX2[DIR_PPM], x3+DX3[DIR_PPM], DIR_PPM); - h[T] = htemp[T] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[T] ; - h[TE] = htemp[TE] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[TE] ; - h[TW] = htemp[TW] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[TW] ; - h[TN] = htemp[TN] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[TN] ; - h[TS] = htemp[TS] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[TS] ; - h[TNE] = htemp[TNE] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[TNE] ; - h[TNW] = htemp[TNW] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[TNW] ; - h[TSE] = htemp[TSE] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[TSE] ; - h[TSW] = htemp[TSW] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[TSW] ; + h[DIR_00P] = htemp[DIR_00P] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[DIR_00P] ; + h[DIR_P0P] = htemp[DIR_P0P] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[DIR_P0P] ; + h[DIR_M0P] = htemp[DIR_M0P] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[DIR_M0P] ; + h[DIR_0PP] = htemp[DIR_0PP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[DIR_0PP] ; + h[DIR_0MP] = htemp[DIR_0MP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[DIR_0MP] ; + h[DIR_PPP] = htemp[DIR_PPP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[DIR_PPP] ; + h[DIR_MPP] = htemp[DIR_MPP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[DIR_MPP] ; + h[DIR_PMP] = htemp[DIR_PMP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[DIR_PMP] ; + h[DIR_MMP] = htemp[DIR_MMP] * (one_over_sqrt3 + vx3) + (1.0 - one_over_sqrt3 - vx3)*h[DIR_MMP] ; - distributionsH->setDistributionInvForDirection(h[T], x1+DX1[B], x2+DX2[B], x3+DX3[B], B); - distributionsH->setDistributionInvForDirection(h[TE], x1+DX1[BW], x2+DX2[BW], x3+DX3[BW], BW); - distributionsH->setDistributionInvForDirection(h[TW], x1+DX1[BE], x2+DX2[BE], x3+DX3[BE], BE); - distributionsH->setDistributionInvForDirection(h[TN], x1+DX1[BS], x2+DX2[BS], x3+DX3[BS], BS); - distributionsH->setDistributionInvForDirection(h[TS], x1+DX1[BN], x2+DX2[BN], x3+DX3[BN], BN); - distributionsH->setDistributionInvForDirection(h[TNE], x1+DX1[BSW], x2+DX2[BSW], x3+DX3[BSW], BSW); - distributionsH->setDistributionInvForDirection(h[TNW], x1+DX1[BSE], x2+DX2[BSE], x3+DX3[BSE], BSE); - distributionsH->setDistributionInvForDirection(h[TSE], x1+DX1[BNW], x2+DX2[BNW], x3+DX3[BNW], BNW); - distributionsH->setDistributionInvForDirection(h[TSW], x1+DX1[BNE], x2+DX2[BNE], x3+DX3[BNE], BNE); + distributionsH->setDistributionInvForDirection(h[DIR_00P], x1+DX1[DIR_00M], x2+DX2[DIR_00M], x3+DX3[DIR_00M], DIR_00M); + distributionsH->setDistributionInvForDirection(h[DIR_P0P], x1+DX1[DIR_M0M], x2+DX2[DIR_M0M], x3+DX3[DIR_M0M], DIR_M0M); + distributionsH->setDistributionInvForDirection(h[DIR_M0P], x1+DX1[DIR_P0M], x2+DX2[DIR_P0M], x3+DX3[DIR_P0M], DIR_P0M); + distributionsH->setDistributionInvForDirection(h[DIR_0PP], x1+DX1[DIR_0MM], x2+DX2[DIR_0MM], x3+DX3[DIR_0MM], DIR_0MM); + distributionsH->setDistributionInvForDirection(h[DIR_0MP], x1+DX1[DIR_0PM], x2+DX2[DIR_0PM], x3+DX3[DIR_0PM], DIR_0PM); + distributionsH->setDistributionInvForDirection(h[DIR_PPP], x1+DX1[DIR_MMM], x2+DX2[DIR_MMM], x3+DX3[DIR_MMM], DIR_MMM); + distributionsH->setDistributionInvForDirection(h[DIR_MPP], x1+DX1[DIR_PMM], x2+DX2[DIR_PMM], x3+DX3[DIR_PMM], DIR_PMM); + distributionsH->setDistributionInvForDirection(h[DIR_PMP], x1+DX1[DIR_MPM], x2+DX2[DIR_MPM], x3+DX3[DIR_MPM], DIR_MPM); + distributionsH->setDistributionInvForDirection(h[DIR_MMP], x1+DX1[DIR_PPM], x2+DX2[DIR_PPM], x3+DX3[DIR_PPM], DIR_PPM); break; - case B: - f[B] = ftemp[B] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[B] ; - f[BE] = ftemp[BE] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[BE] ; - f[BW] = ftemp[BW] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[BW] ; - f[BN] = ftemp[BN] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[BN] ; - f[BS] = ftemp[BS] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[BS] ; - f[BNE] = ftemp[BNE] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[BNE] ; - f[BNW] = ftemp[BNW] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[BNW] ; - f[BSE] = ftemp[BSE] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[BSE] ; - f[BSW] = ftemp[BSW] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[BSW] ; + case DIR_00M: + f[DIR_00M] = ftemp[DIR_00M] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[DIR_00M] ; + f[DIR_P0M] = ftemp[DIR_P0M] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[DIR_P0M] ; + f[DIR_M0M] = ftemp[DIR_M0M] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[DIR_M0M] ; + f[DIR_0PM] = ftemp[DIR_0PM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[DIR_0PM] ; + f[DIR_0MM] = ftemp[DIR_0MM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[DIR_0MM] ; + f[DIR_PPM] = ftemp[DIR_PPM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[DIR_PPM] ; + f[DIR_MPM] = ftemp[DIR_MPM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[DIR_MPM] ; + f[DIR_PMM] = ftemp[DIR_PMM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[DIR_PMM] ; + f[DIR_MMM] = ftemp[DIR_MMM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*f[DIR_MMM] ; - distributions->setDistributionInvForDirection(f[B], x1+DX1[T], x2+DX2[T], x3+DX3[T], T); - distributions->setDistributionInvForDirection(f[BE], x1+DX1[TW], x2+DX2[TW], x3+DX3[TW], TW); - distributions->setDistributionInvForDirection(f[BW], x1+DX1[TE], x2+DX2[TE], x3+DX3[TE], TE); - distributions->setDistributionInvForDirection(f[BN], x1+DX1[TS], x2+DX2[TS], x3+DX3[TS], TS); - distributions->setDistributionInvForDirection(f[BS], x1+DX1[TN], x2+DX2[TN], x3+DX3[TN], TN); - distributions->setDistributionInvForDirection(f[BNE], x1+DX1[TSW], x2+DX2[TSW], x3+DX3[TSW], TSW); - distributions->setDistributionInvForDirection(f[BNW], x1+DX1[TSE], x2+DX2[TSE], x3+DX3[TSE], TSE); - distributions->setDistributionInvForDirection(f[BSE], x1+DX1[TNW], x2+DX2[TNW], x3+DX3[TNW], TNW); - distributions->setDistributionInvForDirection(f[BSW], x1+DX1[TNE], x2+DX2[TNE], x3+DX3[TNE], TNE); + distributions->setDistributionInvForDirection(f[DIR_00M], x1+DX1[DIR_00P], x2+DX2[DIR_00P], x3+DX3[DIR_00P], DIR_00P); + distributions->setDistributionInvForDirection(f[DIR_P0M], x1+DX1[DIR_M0P], x2+DX2[DIR_M0P], x3+DX3[DIR_M0P], DIR_M0P); + distributions->setDistributionInvForDirection(f[DIR_M0M], x1+DX1[DIR_P0P], x2+DX2[DIR_P0P], x3+DX3[DIR_P0P], DIR_P0P); + distributions->setDistributionInvForDirection(f[DIR_0PM], x1+DX1[DIR_0MP], x2+DX2[DIR_0MP], x3+DX3[DIR_0MP], DIR_0MP); + distributions->setDistributionInvForDirection(f[DIR_0MM], x1+DX1[DIR_0PP], x2+DX2[DIR_0PP], x3+DX3[DIR_0PP], DIR_0PP); + distributions->setDistributionInvForDirection(f[DIR_PPM], x1+DX1[DIR_MMP], x2+DX2[DIR_MMP], x3+DX3[DIR_MMP], DIR_MMP); + distributions->setDistributionInvForDirection(f[DIR_MPM], x1+DX1[DIR_PMP], x2+DX2[DIR_PMP], x3+DX3[DIR_PMP], DIR_PMP); + distributions->setDistributionInvForDirection(f[DIR_PMM], x1+DX1[DIR_MPP], x2+DX2[DIR_MPP], x3+DX3[DIR_MPP], DIR_MPP); + distributions->setDistributionInvForDirection(f[DIR_MMM], x1+DX1[DIR_PPP], x2+DX2[DIR_PPP], x3+DX3[DIR_PPP], DIR_PPP); - h[B] = htemp[B] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[B] ; - h[BE] = htemp[BE] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[BE] ; - h[BW] = htemp[BW] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[BW] ; - h[BN] = htemp[BN] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[BN] ; - h[BS] = htemp[BS] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[BS] ; - h[BNE] = htemp[BNE] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[BNE] ; - h[BNW] = htemp[BNW] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[BNW] ; - h[BSE] = htemp[BSE] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[BSE] ; - h[BSW] = htemp[BSW] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[BSW] ; + h[DIR_00M] = htemp[DIR_00M] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[DIR_00M] ; + h[DIR_P0M] = htemp[DIR_P0M] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[DIR_P0M] ; + h[DIR_M0M] = htemp[DIR_M0M] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[DIR_M0M] ; + h[DIR_0PM] = htemp[DIR_0PM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[DIR_0PM] ; + h[DIR_0MM] = htemp[DIR_0MM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[DIR_0MM] ; + h[DIR_PPM] = htemp[DIR_PPM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[DIR_PPM] ; + h[DIR_MPM] = htemp[DIR_MPM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[DIR_MPM] ; + h[DIR_PMM] = htemp[DIR_PMM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[DIR_PMM] ; + h[DIR_MMM] = htemp[DIR_MMM] * (one_over_sqrt3 - vx3) + (1.0 - one_over_sqrt3 + vx3)*h[DIR_MMM] ; - distributionsH->setDistributionInvForDirection(h[B], x1+DX1[T], x2+DX2[T], x3+DX3[T], T); - distributionsH->setDistributionInvForDirection(h[BE], x1+DX1[TW], x2+DX2[TW], x3+DX3[TW], TW); - distributionsH->setDistributionInvForDirection(h[BW], x1+DX1[TE], x2+DX2[TE], x3+DX3[TE], TE); - distributionsH->setDistributionInvForDirection(h[BN], x1+DX1[TS], x2+DX2[TS], x3+DX3[TS], TS); - distributionsH->setDistributionInvForDirection(h[BS], x1+DX1[TN], x2+DX2[TN], x3+DX3[TN], TN); - distributionsH->setDistributionInvForDirection(h[BNE], x1+DX1[TSW], x2+DX2[TSW], x3+DX3[TSW], TSW); - distributionsH->setDistributionInvForDirection(h[BNW], x1+DX1[TSE], x2+DX2[TSE], x3+DX3[TSE], TSE); - distributionsH->setDistributionInvForDirection(h[BSE], x1+DX1[TNW], x2+DX2[TNW], x3+DX3[TNW], TNW); - distributionsH->setDistributionInvForDirection(h[BSW], x1+DX1[TNE], x2+DX2[TNE], x3+DX3[TNE], TNE); + distributionsH->setDistributionInvForDirection(h[DIR_00M], x1+DX1[DIR_00P], x2+DX2[DIR_00P], x3+DX3[DIR_00P], DIR_00P); + distributionsH->setDistributionInvForDirection(h[DIR_P0M], x1+DX1[DIR_M0P], x2+DX2[DIR_M0P], x3+DX3[DIR_M0P], DIR_M0P); + distributionsH->setDistributionInvForDirection(h[DIR_M0M], x1+DX1[DIR_P0P], x2+DX2[DIR_P0P], x3+DX3[DIR_P0P], DIR_P0P); + distributionsH->setDistributionInvForDirection(h[DIR_0PM], x1+DX1[DIR_0MP], x2+DX2[DIR_0MP], x3+DX3[DIR_0MP], DIR_0MP); + distributionsH->setDistributionInvForDirection(h[DIR_0MM], x1+DX1[DIR_0PP], x2+DX2[DIR_0PP], x3+DX3[DIR_0PP], DIR_0PP); + distributionsH->setDistributionInvForDirection(h[DIR_PPM], x1+DX1[DIR_MMP], x2+DX2[DIR_MMP], x3+DX3[DIR_MMP], DIR_MMP); + distributionsH->setDistributionInvForDirection(h[DIR_MPM], x1+DX1[DIR_PMP], x2+DX2[DIR_PMP], x3+DX3[DIR_PMP], DIR_PMP); + distributionsH->setDistributionInvForDirection(h[DIR_PMM], x1+DX1[DIR_MPP], x2+DX2[DIR_MPP], x3+DX3[DIR_MPP], DIR_MPP); + distributionsH->setDistributionInvForDirection(h[DIR_MMM], x1+DX1[DIR_PPP], x2+DX2[DIR_PPP], x3+DX3[DIR_PPP], DIR_PPP); break; default: diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseSlipBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseSlipBCAlgorithm.cpp index 483cf3db8878a4b2b78e29327c2066bb8e79ec83..230a543f120a8ca8d18c5d2bb6a1c27e550aae92 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseSlipBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseSlipBCAlgorithm.cpp @@ -102,32 +102,32 @@ void MultiphaseSlipBCAlgorithm::applyBC() LBMReal velocity = 0.0; switch (invDir) { - case D3Q27System::E: velocity = (UbMath::c4o9*(+vx1)); break; //(2/cs^2)(=6)*rho_0(=1 bei imkompr)*wi*u*ei mit cs=1/sqrt(3) - case D3Q27System::W: velocity = (UbMath::c4o9*(-vx1)); break; //z.B. aus paper manfred MRT LB models in three dimensions (2002) - case D3Q27System::N: velocity = (UbMath::c4o9*(+vx2)); break; - case D3Q27System::S: velocity = (UbMath::c4o9*(-vx2)); break; - case D3Q27System::T: velocity = (UbMath::c4o9*(+vx3)); break; - case D3Q27System::B: velocity = (UbMath::c4o9*(-vx3)); break; - case D3Q27System::NE: velocity = (UbMath::c1o9*(+vx1+vx2)); break; - case D3Q27System::SW: velocity = (UbMath::c1o9*(-vx1-vx2)); break; - case D3Q27System::SE: velocity = (UbMath::c1o9*(+vx1-vx2)); break; - case D3Q27System::NW: velocity = (UbMath::c1o9*(-vx1+vx2)); break; - case D3Q27System::TE: velocity = (UbMath::c1o9*(+vx1 +vx3)); break; - case D3Q27System::BW: velocity = (UbMath::c1o9*(-vx1 -vx3)); break; - case D3Q27System::BE: velocity = (UbMath::c1o9*(+vx1 -vx3)); break; - case D3Q27System::TW: velocity = (UbMath::c1o9*(-vx1 +vx3)); break; - case D3Q27System::TN: velocity = (UbMath::c1o9*(+vx2+vx3)); break; - case D3Q27System::BS: velocity = (UbMath::c1o9*(-vx2-vx3)); break; - case D3Q27System::BN: velocity = (UbMath::c1o9*(+vx2-vx3)); break; - case D3Q27System::TS: velocity = (UbMath::c1o9*(-vx2+vx3)); break; - case D3Q27System::TNE: velocity = (UbMath::c1o36*(+vx1+vx2+vx3)); break; - case D3Q27System::BSW: velocity = (UbMath::c1o36*(-vx1-vx2-vx3)); break; - case D3Q27System::BNE: velocity = (UbMath::c1o36*(+vx1+vx2-vx3)); break; - case D3Q27System::TSW: velocity = (UbMath::c1o36*(-vx1-vx2+vx3)); break; - case D3Q27System::TSE: velocity = (UbMath::c1o36*(+vx1-vx2+vx3)); break; - case D3Q27System::BNW: velocity = (UbMath::c1o36*(-vx1+vx2-vx3)); break; - case D3Q27System::BSE: velocity = (UbMath::c1o36*(+vx1-vx2-vx3)); break; - case D3Q27System::TNW: velocity = (UbMath::c1o36*(-vx1+vx2+vx3)); break; + case D3Q27System::DIR_P00: velocity = (UbMath::c4o9*(+vx1)); break; //(2/cs^2)(=6)*rho_0(=1 bei imkompr)*wi*u*ei mit cs=1/sqrt(3) + case D3Q27System::DIR_M00: velocity = (UbMath::c4o9*(-vx1)); break; //z.B. aus paper manfred MRT LB models in three dimensions (2002) + case D3Q27System::DIR_0P0: velocity = (UbMath::c4o9*(+vx2)); break; + case D3Q27System::DIR_0M0: velocity = (UbMath::c4o9*(-vx2)); break; + case D3Q27System::DIR_00P: velocity = (UbMath::c4o9*(+vx3)); break; + case D3Q27System::DIR_00M: velocity = (UbMath::c4o9*(-vx3)); break; + case D3Q27System::DIR_PP0: velocity = (UbMath::c1o9*(+vx1+vx2)); break; + case D3Q27System::DIR_MM0: velocity = (UbMath::c1o9*(-vx1-vx2)); break; + case D3Q27System::DIR_PM0: velocity = (UbMath::c1o9*(+vx1-vx2)); break; + case D3Q27System::DIR_MP0: velocity = (UbMath::c1o9*(-vx1+vx2)); break; + case D3Q27System::DIR_P0P: velocity = (UbMath::c1o9*(+vx1 +vx3)); break; + case D3Q27System::DIR_M0M: velocity = (UbMath::c1o9*(-vx1 -vx3)); break; + case D3Q27System::DIR_P0M: velocity = (UbMath::c1o9*(+vx1 -vx3)); break; + case D3Q27System::DIR_M0P: velocity = (UbMath::c1o9*(-vx1 +vx3)); break; + case D3Q27System::DIR_0PP: velocity = (UbMath::c1o9*(+vx2+vx3)); break; + case D3Q27System::DIR_0MM: velocity = (UbMath::c1o9*(-vx2-vx3)); break; + case D3Q27System::DIR_0PM: velocity = (UbMath::c1o9*(+vx2-vx3)); break; + case D3Q27System::DIR_0MP: velocity = (UbMath::c1o9*(-vx2+vx3)); break; + case D3Q27System::DIR_PPP: velocity = (UbMath::c1o36*(+vx1+vx2+vx3)); break; + case D3Q27System::DIR_MMM: velocity = (UbMath::c1o36*(-vx1-vx2-vx3)); break; + case D3Q27System::DIR_PPM: velocity = (UbMath::c1o36*(+vx1+vx2-vx3)); break; + case D3Q27System::DIR_MMP: velocity = (UbMath::c1o36*(-vx1-vx2+vx3)); break; + case D3Q27System::DIR_PMP: velocity = (UbMath::c1o36*(+vx1-vx2+vx3)); break; + case D3Q27System::DIR_MPM: velocity = (UbMath::c1o36*(-vx1+vx2-vx3)); break; + case D3Q27System::DIR_PMM: velocity = (UbMath::c1o36*(+vx1-vx2-vx3)); break; + case D3Q27System::DIR_MPP: velocity = (UbMath::c1o36*(-vx1+vx2+vx3)); break; default: throw UbException(UB_EXARGS, "unknown error"); } LBMReal fReturn = ((1.0-q)/(1.0+q))*((f[invDir]-feq[invDir])/(1.0-collFactor)+feq[invDir])+((q*(f[invDir]+f[fdir])-velocity*rho)/(1.0+q)); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseVelocityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseVelocityBCAlgorithm.cpp index 70b0cceffbf3b0567cb3080c5861957a6ea2d2cb..d43d1c53444b82cf45b92052a81f1fc8e7c45dac 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseVelocityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/MultiphaseVelocityBCAlgorithm.cpp @@ -94,12 +94,12 @@ void MultiphaseVelocityBCAlgorithm::applyBC() int nx3 = x3; //flag points in direction of fluid - if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; } + if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_P00)) { nx1 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_M00)) { nx1 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_0P0)) { nx2 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_0M0)) { nx2 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_00P)) { nx3 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_00M)) { nx3 += 1; } //else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on velocity boundary...")); phiBC = bcPtr->getBoundaryPhaseField(); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/NonEqDensityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/NonEqDensityBCAlgorithm.cpp index 9c4e47354f0d90a310030d848aa0cc5415567761..cf7a627b0c649aa0e1d00a8b137225b9e65b8476 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/NonEqDensityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/NonEqDensityBCAlgorithm.cpp @@ -63,17 +63,17 @@ void NonEqDensityBCAlgorithm::applyBC() int nx3 = x3; // flag points in direction of fluid - if (bcPtr->hasDensityBoundaryFlag(D3Q27System::E)) { + if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_P00)) { nx1 -= 1; - } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::W)) { + } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_M00)) { nx1 += 1; - } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::N)) { + } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_0P0)) { nx2 -= 1; - } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::S)) { + } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_0M0)) { nx2 += 1; - } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::T)) { + } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_00P)) { nx3 -= 1; - } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::B)) { + } else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_00M)) { nx3 += 1; } else return; // UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on density boundary...")); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/NonReflectingOutflowBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/NonReflectingOutflowBCAlgorithm.cpp index bb00c7bf2686628d4000c8b43ebfb8c5fd6c18ca..6fa4c7b5d85f4b1e5135f95b48f7d75a0cdbf3a4 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/NonReflectingOutflowBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/NonReflectingOutflowBCAlgorithm.cpp @@ -69,24 +69,24 @@ void NonReflectingOutflowBCAlgorithm::applyBC() int direction = -1; // flag points in direction of fluid - if (bcPtr->hasDensityBoundaryFlag(E)) { + if (bcPtr->hasDensityBoundaryFlag(DIR_P00)) { nx1 += 1; - direction = E; - } else if (bcPtr->hasDensityBoundaryFlag(W)) { + direction = DIR_P00; + } else if (bcPtr->hasDensityBoundaryFlag(DIR_M00)) { nx1 -= 1; - direction = W; - } else if (bcPtr->hasDensityBoundaryFlag(N)) { + direction = DIR_M00; + } else if (bcPtr->hasDensityBoundaryFlag(DIR_0P0)) { nx2 += 1; - direction = N; - } else if (bcPtr->hasDensityBoundaryFlag(S)) { + direction = DIR_0P0; + } else if (bcPtr->hasDensityBoundaryFlag(DIR_0M0)) { nx2 -= 1; - direction = S; - } else if (bcPtr->hasDensityBoundaryFlag(T)) { + direction = DIR_0M0; + } else if (bcPtr->hasDensityBoundaryFlag(DIR_00P)) { nx3 += 1; - direction = T; - } else if (bcPtr->hasDensityBoundaryFlag(B)) { + direction = DIR_00P; + } else if (bcPtr->hasDensityBoundaryFlag(DIR_00M)) { nx3 -= 1; - direction = B; + direction = DIR_00M; } else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on density boundary...")); @@ -97,131 +97,131 @@ void NonReflectingOutflowBCAlgorithm::applyBC() calcMacrosFct(f, rho, vx1, vx2, vx3); switch (direction) { - case E: - f[E] = ftemp[E] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[E]; - f[NE] = ftemp[NE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[NE]; - f[SE] = ftemp[SE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[SE]; - f[TE] = ftemp[TE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[TE]; - f[BE] = ftemp[BE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[BE]; - f[TNE] = ftemp[TNE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[TNE]; - f[TSE] = ftemp[TSE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[TSE]; - f[BNE] = ftemp[BNE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[BNE]; - f[BSE] = ftemp[BSE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[BSE]; + case DIR_P00: + f[DIR_P00] = ftemp[DIR_P00] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_P00]; + f[DIR_PP0] = ftemp[DIR_PP0] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PP0]; + f[DIR_PM0] = ftemp[DIR_PM0] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PM0]; + f[DIR_P0P] = ftemp[DIR_P0P] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_P0P]; + f[DIR_P0M] = ftemp[DIR_P0M] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_P0M]; + f[DIR_PPP] = ftemp[DIR_PPP] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PPP]; + f[DIR_PMP] = ftemp[DIR_PMP] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PMP]; + f[DIR_PPM] = ftemp[DIR_PPM] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PPM]; + f[DIR_PMM] = ftemp[DIR_PMM] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PMM]; - distributions->setDistributionInvForDirection(f[E], x1 + DX1[W], x2 + DX2[W], x3 + DX3[W], W); - distributions->setDistributionInvForDirection(f[NE], x1 + DX1[SW], x2 + DX2[SW], x3 + DX3[SW], SW); - distributions->setDistributionInvForDirection(f[SE], x1 + DX1[NW], x2 + DX2[NW], x3 + DX3[NW], NW); - distributions->setDistributionInvForDirection(f[TE], x1 + DX1[BW], x2 + DX2[BW], x3 + DX3[BW], BW); - distributions->setDistributionInvForDirection(f[BE], x1 + DX1[TW], x2 + DX2[TW], x3 + DX3[TW], TW); - distributions->setDistributionInvForDirection(f[TNE], x1 + DX1[BSW], x2 + DX2[BSW], x3 + DX3[BSW], BSW); - distributions->setDistributionInvForDirection(f[TSE], x1 + DX1[BNW], x2 + DX2[BNW], x3 + DX3[BNW], BNW); - distributions->setDistributionInvForDirection(f[BNE], x1 + DX1[TSW], x2 + DX2[TSW], x3 + DX3[TSW], TSW); - distributions->setDistributionInvForDirection(f[BSE], x1 + DX1[TNW], x2 + DX2[TNW], x3 + DX3[TNW], TNW); + distributions->setDistributionInvForDirection(f[DIR_P00], x1 + DX1[DIR_M00], x2 + DX2[DIR_M00], x3 + DX3[DIR_M00], DIR_M00); + distributions->setDistributionInvForDirection(f[DIR_PP0], x1 + DX1[DIR_MM0], x2 + DX2[DIR_MM0], x3 + DX3[DIR_MM0], DIR_MM0); + distributions->setDistributionInvForDirection(f[DIR_PM0], x1 + DX1[DIR_MP0], x2 + DX2[DIR_MP0], x3 + DX3[DIR_MP0], DIR_MP0); + distributions->setDistributionInvForDirection(f[DIR_P0P], x1 + DX1[DIR_M0M], x2 + DX2[DIR_M0M], x3 + DX3[DIR_M0M], DIR_M0M); + distributions->setDistributionInvForDirection(f[DIR_P0M], x1 + DX1[DIR_M0P], x2 + DX2[DIR_M0P], x3 + DX3[DIR_M0P], DIR_M0P); + distributions->setDistributionInvForDirection(f[DIR_PPP], x1 + DX1[DIR_MMM], x2 + DX2[DIR_MMM], x3 + DX3[DIR_MMM], DIR_MMM); + distributions->setDistributionInvForDirection(f[DIR_PMP], x1 + DX1[DIR_MPM], x2 + DX2[DIR_MPM], x3 + DX3[DIR_MPM], DIR_MPM); + distributions->setDistributionInvForDirection(f[DIR_PPM], x1 + DX1[DIR_MMP], x2 + DX2[DIR_MMP], x3 + DX3[DIR_MMP], DIR_MMP); + distributions->setDistributionInvForDirection(f[DIR_PMM], x1 + DX1[DIR_MPP], x2 + DX2[DIR_MPP], x3 + DX3[DIR_MPP], DIR_MPP); break; - case W: - f[W] = ftemp[W] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[W]; - f[NW] = ftemp[NW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[NW]; - f[SW] = ftemp[SW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[SW]; - f[TW] = ftemp[TW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[TW]; - f[BW] = ftemp[BW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[BW]; - f[TNW] = ftemp[TNW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[TNW]; - f[TSW] = ftemp[TSW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[TSW]; - f[BNW] = ftemp[BNW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[BNW]; - f[BSW] = ftemp[BSW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[BSW]; + case DIR_M00: + f[DIR_M00] = ftemp[DIR_M00] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_M00]; + f[DIR_MP0] = ftemp[DIR_MP0] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MP0]; + f[DIR_MM0] = ftemp[DIR_MM0] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MM0]; + f[DIR_M0P] = ftemp[DIR_M0P] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_M0P]; + f[DIR_M0M] = ftemp[DIR_M0M] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_M0M]; + f[DIR_MPP] = ftemp[DIR_MPP] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MPP]; + f[DIR_MMP] = ftemp[DIR_MMP] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MMP]; + f[DIR_MPM] = ftemp[DIR_MPM] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MPM]; + f[DIR_MMM] = ftemp[DIR_MMM] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MMM]; - distributions->setDistributionInvForDirection(f[W], x1 + DX1[E], x2 + DX2[E], x3 + DX3[E], E); - distributions->setDistributionInvForDirection(f[NW], x1 + DX1[SE], x2 + DX2[SE], x3 + DX3[SE], SE); - distributions->setDistributionInvForDirection(f[SW], x1 + DX1[NE], x2 + DX2[NE], x3 + DX3[NE], NE); - distributions->setDistributionInvForDirection(f[TW], x1 + DX1[BE], x2 + DX2[BE], x3 + DX3[BE], BE); - distributions->setDistributionInvForDirection(f[BW], x1 + DX1[TE], x2 + DX2[TE], x3 + DX3[TE], TE); - distributions->setDistributionInvForDirection(f[TNW], x1 + DX1[BSE], x2 + DX2[BSE], x3 + DX3[BSE], BSE); - distributions->setDistributionInvForDirection(f[TSW], x1 + DX1[BNE], x2 + DX2[BNE], x3 + DX3[BNE], BNE); - distributions->setDistributionInvForDirection(f[BNW], x1 + DX1[TSE], x2 + DX2[TSE], x3 + DX3[TSE], TSE); - distributions->setDistributionInvForDirection(f[BSW], x1 + DX1[TNE], x2 + DX2[TNE], x3 + DX3[TNE], TNE); + distributions->setDistributionInvForDirection(f[DIR_M00], x1 + DX1[DIR_P00], x2 + DX2[DIR_P00], x3 + DX3[DIR_P00], DIR_P00); + distributions->setDistributionInvForDirection(f[DIR_MP0], x1 + DX1[DIR_PM0], x2 + DX2[DIR_PM0], x3 + DX3[DIR_PM0], DIR_PM0); + distributions->setDistributionInvForDirection(f[DIR_MM0], x1 + DX1[DIR_PP0], x2 + DX2[DIR_PP0], x3 + DX3[DIR_PP0], DIR_PP0); + distributions->setDistributionInvForDirection(f[DIR_M0P], x1 + DX1[DIR_P0M], x2 + DX2[DIR_P0M], x3 + DX3[DIR_P0M], DIR_P0M); + distributions->setDistributionInvForDirection(f[DIR_M0M], x1 + DX1[DIR_P0P], x2 + DX2[DIR_P0P], x3 + DX3[DIR_P0P], DIR_P0P); + distributions->setDistributionInvForDirection(f[DIR_MPP], x1 + DX1[DIR_PMM], x2 + DX2[DIR_PMM], x3 + DX3[DIR_PMM], DIR_PMM); + distributions->setDistributionInvForDirection(f[DIR_MMP], x1 + DX1[DIR_PPM], x2 + DX2[DIR_PPM], x3 + DX3[DIR_PPM], DIR_PPM); + distributions->setDistributionInvForDirection(f[DIR_MPM], x1 + DX1[DIR_PMP], x2 + DX2[DIR_PMP], x3 + DX3[DIR_PMP], DIR_PMP); + distributions->setDistributionInvForDirection(f[DIR_MMM], x1 + DX1[DIR_PPP], x2 + DX2[DIR_PPP], x3 + DX3[DIR_PPP], DIR_PPP); break; - case N: - f[N] = ftemp[N] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[N]; - f[NE] = ftemp[NE] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[NE]; - f[NW] = ftemp[NW] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[NW]; - f[TN] = ftemp[TN] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[TN]; - f[BN] = ftemp[BN] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[BN]; - f[TNE] = ftemp[TNE] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[TNE]; - f[TNW] = ftemp[TNW] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[TNW]; - f[BNE] = ftemp[BNE] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[BNE]; - f[BNW] = ftemp[BNW] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[BNW]; + case DIR_0P0: + f[DIR_0P0] = ftemp[DIR_0P0] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_0P0]; + f[DIR_PP0] = ftemp[DIR_PP0] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_PP0]; + f[DIR_MP0] = ftemp[DIR_MP0] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_MP0]; + f[DIR_0PP] = ftemp[DIR_0PP] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_0PP]; + f[DIR_0PM] = ftemp[DIR_0PM] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_0PM]; + f[DIR_PPP] = ftemp[DIR_PPP] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_PPP]; + f[DIR_MPP] = ftemp[DIR_MPP] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_MPP]; + f[DIR_PPM] = ftemp[DIR_PPM] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_PPM]; + f[DIR_MPM] = ftemp[DIR_MPM] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_MPM]; - distributions->setDistributionInvForDirection(f[N], x1 + DX1[S], x2 + DX2[S], x3 + DX3[S], S); - distributions->setDistributionInvForDirection(f[NE], x1 + DX1[SW], x2 + DX2[SW], x3 + DX3[SW], SW); - distributions->setDistributionInvForDirection(f[NW], x1 + DX1[SE], x2 + DX2[SE], x3 + DX3[SE], SE); - distributions->setDistributionInvForDirection(f[TN], x1 + DX1[BS], x2 + DX2[BS], x3 + DX3[BS], BS); - distributions->setDistributionInvForDirection(f[BN], x1 + DX1[TS], x2 + DX2[TS], x3 + DX3[TS], TS); - distributions->setDistributionInvForDirection(f[TNE], x1 + DX1[BSW], x2 + DX2[BSW], x3 + DX3[BSW], BSW); - distributions->setDistributionInvForDirection(f[TNW], x1 + DX1[BSE], x2 + DX2[BSE], x3 + DX3[BSE], BSE); - distributions->setDistributionInvForDirection(f[BNE], x1 + DX1[TSW], x2 + DX2[TSW], x3 + DX3[TSW], TSW); - distributions->setDistributionInvForDirection(f[BNW], x1 + DX1[TSE], x2 + DX2[TSE], x3 + DX3[TSE], TSE); + distributions->setDistributionInvForDirection(f[DIR_0P0], x1 + DX1[DIR_0M0], x2 + DX2[DIR_0M0], x3 + DX3[DIR_0M0], DIR_0M0); + distributions->setDistributionInvForDirection(f[DIR_PP0], x1 + DX1[DIR_MM0], x2 + DX2[DIR_MM0], x3 + DX3[DIR_MM0], DIR_MM0); + distributions->setDistributionInvForDirection(f[DIR_MP0], x1 + DX1[DIR_PM0], x2 + DX2[DIR_PM0], x3 + DX3[DIR_PM0], DIR_PM0); + distributions->setDistributionInvForDirection(f[DIR_0PP], x1 + DX1[DIR_0MM], x2 + DX2[DIR_0MM], x3 + DX3[DIR_0MM], DIR_0MM); + distributions->setDistributionInvForDirection(f[DIR_0PM], x1 + DX1[DIR_0MP], x2 + DX2[DIR_0MP], x3 + DX3[DIR_0MP], DIR_0MP); + distributions->setDistributionInvForDirection(f[DIR_PPP], x1 + DX1[DIR_MMM], x2 + DX2[DIR_MMM], x3 + DX3[DIR_MMM], DIR_MMM); + distributions->setDistributionInvForDirection(f[DIR_MPP], x1 + DX1[DIR_PMM], x2 + DX2[DIR_PMM], x3 + DX3[DIR_PMM], DIR_PMM); + distributions->setDistributionInvForDirection(f[DIR_PPM], x1 + DX1[DIR_MMP], x2 + DX2[DIR_MMP], x3 + DX3[DIR_MMP], DIR_MMP); + distributions->setDistributionInvForDirection(f[DIR_MPM], x1 + DX1[DIR_PMP], x2 + DX2[DIR_PMP], x3 + DX3[DIR_PMP], DIR_PMP); break; - case S: - f[S] = ftemp[S] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[S]; - f[SE] = ftemp[SE] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[SE]; - f[SW] = ftemp[SW] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[SW]; - f[TS] = ftemp[TS] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[TS]; - f[BS] = ftemp[BS] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[BS]; - f[TSE] = ftemp[TSE] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[TSE]; - f[TSW] = ftemp[TSW] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[TSW]; - f[BSE] = ftemp[BSE] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[BSE]; - f[BSW] = ftemp[BSW] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[BSW]; + case DIR_0M0: + f[DIR_0M0] = ftemp[DIR_0M0] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_0M0]; + f[DIR_PM0] = ftemp[DIR_PM0] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_PM0]; + f[DIR_MM0] = ftemp[DIR_MM0] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_MM0]; + f[DIR_0MP] = ftemp[DIR_0MP] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_0MP]; + f[DIR_0MM] = ftemp[DIR_0MM] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_0MM]; + f[DIR_PMP] = ftemp[DIR_PMP] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_PMP]; + f[DIR_MMP] = ftemp[DIR_MMP] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_MMP]; + f[DIR_PMM] = ftemp[DIR_PMM] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_PMM]; + f[DIR_MMM] = ftemp[DIR_MMM] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_MMM]; - distributions->setDistributionInvForDirection(f[S], x1 + DX1[N], x2 + DX2[N], x3 + DX3[N], N); - distributions->setDistributionInvForDirection(f[SE], x1 + DX1[NW], x2 + DX2[NW], x3 + DX3[NW], NW); - distributions->setDistributionInvForDirection(f[SW], x1 + DX1[NE], x2 + DX2[NE], x3 + DX3[NE], NE); - distributions->setDistributionInvForDirection(f[TS], x1 + DX1[BN], x2 + DX2[BN], x3 + DX3[BN], BN); - distributions->setDistributionInvForDirection(f[BS], x1 + DX1[TN], x2 + DX2[TN], x3 + DX3[TN], TN); - distributions->setDistributionInvForDirection(f[TSE], x1 + DX1[BNW], x2 + DX2[BNW], x3 + DX3[BNW], BNW); - distributions->setDistributionInvForDirection(f[TSW], x1 + DX1[BNE], x2 + DX2[BNE], x3 + DX3[BNE], BNE); - distributions->setDistributionInvForDirection(f[BSE], x1 + DX1[TNW], x2 + DX2[TNW], x3 + DX3[TNW], TNW); - distributions->setDistributionInvForDirection(f[BSW], x1 + DX1[TNE], x2 + DX2[TNE], x3 + DX3[TNE], TNE); + distributions->setDistributionInvForDirection(f[DIR_0M0], x1 + DX1[DIR_0P0], x2 + DX2[DIR_0P0], x3 + DX3[DIR_0P0], DIR_0P0); + distributions->setDistributionInvForDirection(f[DIR_PM0], x1 + DX1[DIR_MP0], x2 + DX2[DIR_MP0], x3 + DX3[DIR_MP0], DIR_MP0); + distributions->setDistributionInvForDirection(f[DIR_MM0], x1 + DX1[DIR_PP0], x2 + DX2[DIR_PP0], x3 + DX3[DIR_PP0], DIR_PP0); + distributions->setDistributionInvForDirection(f[DIR_0MP], x1 + DX1[DIR_0PM], x2 + DX2[DIR_0PM], x3 + DX3[DIR_0PM], DIR_0PM); + distributions->setDistributionInvForDirection(f[DIR_0MM], x1 + DX1[DIR_0PP], x2 + DX2[DIR_0PP], x3 + DX3[DIR_0PP], DIR_0PP); + distributions->setDistributionInvForDirection(f[DIR_PMP], x1 + DX1[DIR_MPM], x2 + DX2[DIR_MPM], x3 + DX3[DIR_MPM], DIR_MPM); + distributions->setDistributionInvForDirection(f[DIR_MMP], x1 + DX1[DIR_PPM], x2 + DX2[DIR_PPM], x3 + DX3[DIR_PPM], DIR_PPM); + distributions->setDistributionInvForDirection(f[DIR_PMM], x1 + DX1[DIR_MPP], x2 + DX2[DIR_MPP], x3 + DX3[DIR_MPP], DIR_MPP); + distributions->setDistributionInvForDirection(f[DIR_MMM], x1 + DX1[DIR_PPP], x2 + DX2[DIR_PPP], x3 + DX3[DIR_PPP], DIR_PPP); break; - case T: - f[T] = ftemp[T] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[T]; - f[TE] = ftemp[TE] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TE]; - f[TW] = ftemp[TW] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TW]; - f[TN] = ftemp[TN] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TN]; - f[TS] = ftemp[TS] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TS]; - f[TNE] = ftemp[TNE] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TNE]; - f[TNW] = ftemp[TNW] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TNW]; - f[TSE] = ftemp[TSE] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TSE]; - f[TSW] = ftemp[TSW] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TSW]; + case DIR_00P: + f[DIR_00P] = ftemp[DIR_00P] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_00P]; + f[DIR_P0P] = ftemp[DIR_P0P] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_P0P]; + f[DIR_M0P] = ftemp[DIR_M0P] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_M0P]; + f[DIR_0PP] = ftemp[DIR_0PP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_0PP]; + f[DIR_0MP] = ftemp[DIR_0MP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_0MP]; + f[DIR_PPP] = ftemp[DIR_PPP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_PPP]; + f[DIR_MPP] = ftemp[DIR_MPP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_MPP]; + f[DIR_PMP] = ftemp[DIR_PMP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_PMP]; + f[DIR_MMP] = ftemp[DIR_MMP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_MMP]; - distributions->setDistributionInvForDirection(f[T], x1 + DX1[B], x2 + DX2[B], x3 + DX3[B], B); - distributions->setDistributionInvForDirection(f[TE], x1 + DX1[BW], x2 + DX2[BW], x3 + DX3[BW], BW); - distributions->setDistributionInvForDirection(f[TW], x1 + DX1[BE], x2 + DX2[BE], x3 + DX3[BE], BE); - distributions->setDistributionInvForDirection(f[TN], x1 + DX1[BS], x2 + DX2[BS], x3 + DX3[BS], BS); - distributions->setDistributionInvForDirection(f[TS], x1 + DX1[BN], x2 + DX2[BN], x3 + DX3[BN], BN); - distributions->setDistributionInvForDirection(f[TNE], x1 + DX1[BSW], x2 + DX2[BSW], x3 + DX3[BSW], BSW); - distributions->setDistributionInvForDirection(f[TNW], x1 + DX1[BSE], x2 + DX2[BSE], x3 + DX3[BSE], BSE); - distributions->setDistributionInvForDirection(f[TSE], x1 + DX1[BNW], x2 + DX2[BNW], x3 + DX3[BNW], BNW); - distributions->setDistributionInvForDirection(f[TSW], x1 + DX1[BNE], x2 + DX2[BNE], x3 + DX3[BNE], BNE); + distributions->setDistributionInvForDirection(f[DIR_00P], x1 + DX1[DIR_00M], x2 + DX2[DIR_00M], x3 + DX3[DIR_00M], DIR_00M); + distributions->setDistributionInvForDirection(f[DIR_P0P], x1 + DX1[DIR_M0M], x2 + DX2[DIR_M0M], x3 + DX3[DIR_M0M], DIR_M0M); + distributions->setDistributionInvForDirection(f[DIR_M0P], x1 + DX1[DIR_P0M], x2 + DX2[DIR_P0M], x3 + DX3[DIR_P0M], DIR_P0M); + distributions->setDistributionInvForDirection(f[DIR_0PP], x1 + DX1[DIR_0MM], x2 + DX2[DIR_0MM], x3 + DX3[DIR_0MM], DIR_0MM); + distributions->setDistributionInvForDirection(f[DIR_0MP], x1 + DX1[DIR_0PM], x2 + DX2[DIR_0PM], x3 + DX3[DIR_0PM], DIR_0PM); + distributions->setDistributionInvForDirection(f[DIR_PPP], x1 + DX1[DIR_MMM], x2 + DX2[DIR_MMM], x3 + DX3[DIR_MMM], DIR_MMM); + distributions->setDistributionInvForDirection(f[DIR_MPP], x1 + DX1[DIR_PMM], x2 + DX2[DIR_PMM], x3 + DX3[DIR_PMM], DIR_PMM); + distributions->setDistributionInvForDirection(f[DIR_PMP], x1 + DX1[DIR_MPM], x2 + DX2[DIR_MPM], x3 + DX3[DIR_MPM], DIR_MPM); + distributions->setDistributionInvForDirection(f[DIR_MMP], x1 + DX1[DIR_PPM], x2 + DX2[DIR_PPM], x3 + DX3[DIR_PPM], DIR_PPM); break; - case B: - f[B] = ftemp[B] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[B]; - f[BE] = ftemp[BE] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BE]; - f[BW] = ftemp[BW] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BW]; - f[BN] = ftemp[BN] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BN]; - f[BS] = ftemp[BS] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BS]; - f[BNE] = ftemp[BNE] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BNE]; - f[BNW] = ftemp[BNW] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BNW]; - f[BSE] = ftemp[BSE] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BSE]; - f[BSW] = ftemp[BSW] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BSW]; + case DIR_00M: + f[DIR_00M] = ftemp[DIR_00M] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_00M]; + f[DIR_P0M] = ftemp[DIR_P0M] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_P0M]; + f[DIR_M0M] = ftemp[DIR_M0M] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_M0M]; + f[DIR_0PM] = ftemp[DIR_0PM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_0PM]; + f[DIR_0MM] = ftemp[DIR_0MM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_0MM]; + f[DIR_PPM] = ftemp[DIR_PPM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_PPM]; + f[DIR_MPM] = ftemp[DIR_MPM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_MPM]; + f[DIR_PMM] = ftemp[DIR_PMM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_PMM]; + f[DIR_MMM] = ftemp[DIR_MMM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_MMM]; - distributions->setDistributionInvForDirection(f[B], x1 + DX1[T], x2 + DX2[T], x3 + DX3[T], T); - distributions->setDistributionInvForDirection(f[BE], x1 + DX1[TW], x2 + DX2[TW], x3 + DX3[TW], TW); - distributions->setDistributionInvForDirection(f[BW], x1 + DX1[TE], x2 + DX2[TE], x3 + DX3[TE], TE); - distributions->setDistributionInvForDirection(f[BN], x1 + DX1[TS], x2 + DX2[TS], x3 + DX3[TS], TS); - distributions->setDistributionInvForDirection(f[BS], x1 + DX1[TN], x2 + DX2[TN], x3 + DX3[TN], TN); - distributions->setDistributionInvForDirection(f[BNE], x1 + DX1[TSW], x2 + DX2[TSW], x3 + DX3[TSW], TSW); - distributions->setDistributionInvForDirection(f[BNW], x1 + DX1[TSE], x2 + DX2[TSE], x3 + DX3[TSE], TSE); - distributions->setDistributionInvForDirection(f[BSE], x1 + DX1[TNW], x2 + DX2[TNW], x3 + DX3[TNW], TNW); - distributions->setDistributionInvForDirection(f[BSW], x1 + DX1[TNE], x2 + DX2[TNE], x3 + DX3[TNE], TNE); + distributions->setDistributionInvForDirection(f[DIR_00M], x1 + DX1[DIR_00P], x2 + DX2[DIR_00P], x3 + DX3[DIR_00P], DIR_00P); + distributions->setDistributionInvForDirection(f[DIR_P0M], x1 + DX1[DIR_M0P], x2 + DX2[DIR_M0P], x3 + DX3[DIR_M0P], DIR_M0P); + distributions->setDistributionInvForDirection(f[DIR_M0M], x1 + DX1[DIR_P0P], x2 + DX2[DIR_P0P], x3 + DX3[DIR_P0P], DIR_P0P); + distributions->setDistributionInvForDirection(f[DIR_0PM], x1 + DX1[DIR_0MP], x2 + DX2[DIR_0MP], x3 + DX3[DIR_0MP], DIR_0MP); + distributions->setDistributionInvForDirection(f[DIR_0MM], x1 + DX1[DIR_0PP], x2 + DX2[DIR_0PP], x3 + DX3[DIR_0PP], DIR_0PP); + distributions->setDistributionInvForDirection(f[DIR_PPM], x1 + DX1[DIR_MMP], x2 + DX2[DIR_MMP], x3 + DX3[DIR_MMP], DIR_MMP); + distributions->setDistributionInvForDirection(f[DIR_MPM], x1 + DX1[DIR_PMP], x2 + DX2[DIR_PMP], x3 + DX3[DIR_PMP], DIR_PMP); + distributions->setDistributionInvForDirection(f[DIR_PMM], x1 + DX1[DIR_MPP], x2 + DX2[DIR_MPP], x3 + DX3[DIR_MPP], DIR_MPP); + distributions->setDistributionInvForDirection(f[DIR_MMM], x1 + DX1[DIR_PPP], x2 + DX2[DIR_PPP], x3 + DX3[DIR_PPP], DIR_PPP); break; default: UB_THROW( diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleSlipBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleSlipBCAlgorithm.cpp index c22d843f0b3c986e32bbe0a9c6f525cf575814f7..151e10be4987e27622ce25b86c91c320c0d24406 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleSlipBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/SimpleSlipBCAlgorithm.cpp @@ -83,32 +83,32 @@ void SimpleSlipBCAlgorithm::applyBC() LBMReal velocity = 0.0; switch (invDir) { - case D3Q27System::E: velocity = (UbMath::c4o9*(+vx1)); break; //(2/cs^2)(=6)*rho_0(=1 bei imkompr)*wi*u*ei mit cs=1/sqrt(3) - case D3Q27System::W: velocity = (UbMath::c4o9*(-vx1)); break; //z.B. aus paper manfred MRT LB models in three dimensions (2002) - case D3Q27System::N: velocity = (UbMath::c4o9*(+vx2)); break; - case D3Q27System::S: velocity = (UbMath::c4o9*(-vx2)); break; - case D3Q27System::T: velocity = (UbMath::c4o9*(+vx3)); break; - case D3Q27System::B: velocity = (UbMath::c4o9*(-vx3)); break; - case D3Q27System::NE: velocity = (UbMath::c1o9*(+vx1+vx2)); break; - case D3Q27System::SW: velocity = (UbMath::c1o9*(-vx1-vx2)); break; - case D3Q27System::SE: velocity = (UbMath::c1o9*(+vx1-vx2)); break; - case D3Q27System::NW: velocity = (UbMath::c1o9*(-vx1+vx2)); break; - case D3Q27System::TE: velocity = (UbMath::c1o9*(+vx1+vx3)); break; - case D3Q27System::BW: velocity = (UbMath::c1o9*(-vx1-vx3)); break; - case D3Q27System::BE: velocity = (UbMath::c1o9*(+vx1-vx3)); break; - case D3Q27System::TW: velocity = (UbMath::c1o9*(-vx1+vx3)); break; - case D3Q27System::TN: velocity = (UbMath::c1o9*(+vx2+vx3)); break; - case D3Q27System::BS: velocity = (UbMath::c1o9*(-vx2-vx3)); break; - case D3Q27System::BN: velocity = (UbMath::c1o9*(+vx2-vx3)); break; - case D3Q27System::TS: velocity = (UbMath::c1o9*(-vx2+vx3)); break; - case D3Q27System::TNE: velocity = (UbMath::c1o36*(+vx1+vx2+vx3)); break; - case D3Q27System::BSW: velocity = (UbMath::c1o36*(-vx1-vx2-vx3)); break; - case D3Q27System::BNE: velocity = (UbMath::c1o36*(+vx1+vx2-vx3)); break; - case D3Q27System::TSW: velocity = (UbMath::c1o36*(-vx1-vx2+vx3)); break; - case D3Q27System::TSE: velocity = (UbMath::c1o36*(+vx1-vx2+vx3)); break; - case D3Q27System::BNW: velocity = (UbMath::c1o36*(-vx1+vx2-vx3)); break; - case D3Q27System::BSE: velocity = (UbMath::c1o36*(+vx1-vx2-vx3)); break; - case D3Q27System::TNW: velocity = (UbMath::c1o36*(-vx1+vx2+vx3)); break; + case D3Q27System::DIR_P00: velocity = (UbMath::c4o9*(+vx1)); break; //(2/cs^2)(=6)*rho_0(=1 bei imkompr)*wi*u*ei mit cs=1/sqrt(3) + case D3Q27System::DIR_M00: velocity = (UbMath::c4o9*(-vx1)); break; //z.B. aus paper manfred MRT LB models in three dimensions (2002) + case D3Q27System::DIR_0P0: velocity = (UbMath::c4o9*(+vx2)); break; + case D3Q27System::DIR_0M0: velocity = (UbMath::c4o9*(-vx2)); break; + case D3Q27System::DIR_00P: velocity = (UbMath::c4o9*(+vx3)); break; + case D3Q27System::DIR_00M: velocity = (UbMath::c4o9*(-vx3)); break; + case D3Q27System::DIR_PP0: velocity = (UbMath::c1o9*(+vx1+vx2)); break; + case D3Q27System::DIR_MM0: velocity = (UbMath::c1o9*(-vx1-vx2)); break; + case D3Q27System::DIR_PM0: velocity = (UbMath::c1o9*(+vx1-vx2)); break; + case D3Q27System::DIR_MP0: velocity = (UbMath::c1o9*(-vx1+vx2)); break; + case D3Q27System::DIR_P0P: velocity = (UbMath::c1o9*(+vx1+vx3)); break; + case D3Q27System::DIR_M0M: velocity = (UbMath::c1o9*(-vx1-vx3)); break; + case D3Q27System::DIR_P0M: velocity = (UbMath::c1o9*(+vx1-vx3)); break; + case D3Q27System::DIR_M0P: velocity = (UbMath::c1o9*(-vx1+vx3)); break; + case D3Q27System::DIR_0PP: velocity = (UbMath::c1o9*(+vx2+vx3)); break; + case D3Q27System::DIR_0MM: velocity = (UbMath::c1o9*(-vx2-vx3)); break; + case D3Q27System::DIR_0PM: velocity = (UbMath::c1o9*(+vx2-vx3)); break; + case D3Q27System::DIR_0MP: velocity = (UbMath::c1o9*(-vx2+vx3)); break; + case D3Q27System::DIR_PPP: velocity = (UbMath::c1o36*(+vx1+vx2+vx3)); break; + case D3Q27System::DIR_MMM: velocity = (UbMath::c1o36*(-vx1-vx2-vx3)); break; + case D3Q27System::DIR_PPM: velocity = (UbMath::c1o36*(+vx1+vx2-vx3)); break; + case D3Q27System::DIR_MMP: velocity = (UbMath::c1o36*(-vx1-vx2+vx3)); break; + case D3Q27System::DIR_PMP: velocity = (UbMath::c1o36*(+vx1-vx2+vx3)); break; + case D3Q27System::DIR_MPM: velocity = (UbMath::c1o36*(-vx1+vx2-vx3)); break; + case D3Q27System::DIR_PMM: velocity = (UbMath::c1o36*(+vx1-vx2-vx3)); break; + case D3Q27System::DIR_MPP: velocity = (UbMath::c1o36*(-vx1+vx2+vx3)); break; default: throw UbException(UB_EXARGS, "unknown error"); } LBMReal fReturn = f[invDir] - velocity * rho; diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.cpp index 8bdc284d606fa621233fe1449801f4751cfef22a..0dc2d5d66e639b3b46bc9fe12cec96eba6e6adac 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.cpp @@ -56,17 +56,17 @@ void SlipBCAdapter::adaptBC(const D3Q27Interactor &interactor, SPtr<BoundaryCond if (!geo) throw UbException(UB_EXARGS, "derzeit nur fuer Cubes valide"); - if (bc->hasSlipBoundaryFlag(D3Q27System::E)) + if (bc->hasSlipBoundaryFlag(D3Q27System::DIR_P00)) bc->setNormalVector(1.0, 0.0, 0.0); - else if (bc->hasSlipBoundaryFlag(D3Q27System::W)) + else if (bc->hasSlipBoundaryFlag(D3Q27System::DIR_M00)) bc->setNormalVector(-1.0, 0.0, 0.0); - else if (bc->hasSlipBoundaryFlag(D3Q27System::N)) + else if (bc->hasSlipBoundaryFlag(D3Q27System::DIR_0P0)) bc->setNormalVector(0.0, 1.0, 0.0); - else if (bc->hasSlipBoundaryFlag(D3Q27System::S)) + else if (bc->hasSlipBoundaryFlag(D3Q27System::DIR_0M0)) bc->setNormalVector(0.0, -1.0, 0.0); - else if (bc->hasSlipBoundaryFlag(D3Q27System::T)) + else if (bc->hasSlipBoundaryFlag(D3Q27System::DIR_00P)) bc->setNormalVector(0.0, 0.0, 1.0); - else if (bc->hasSlipBoundaryFlag(D3Q27System::B)) + else if (bc->hasSlipBoundaryFlag(D3Q27System::DIR_00M)) bc->setNormalVector(0.0, 0.0, -1.0); bc->setBcAlgorithmType(algorithmType); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAlgorithm.cpp index 825d2bc0175acb5b2c10df3a89e87512dcc2e6e3..5d9993c459b756dc1d8663907ee90bc0eabef51c 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAlgorithm.cpp @@ -47,32 +47,32 @@ void SlipBCAlgorithm::applyBC() LBMReal velocity = 0.0; switch (invDir) { - case D3Q27System::E: velocity = (UbMath::c4o9*(+vx1)); break; //(2/cs^2)(=6)*rho_0(=1 bei imkompr)*wi*u*ei mit cs=1/sqrt(3) - case D3Q27System::W: velocity = (UbMath::c4o9*(-vx1)); break; //z.B. aus paper manfred MRT LB models in three dimensions (2002) - case D3Q27System::N: velocity = (UbMath::c4o9*(+vx2)); break; - case D3Q27System::S: velocity = (UbMath::c4o9*(-vx2)); break; - case D3Q27System::T: velocity = (UbMath::c4o9*(+vx3)); break; - case D3Q27System::B: velocity = (UbMath::c4o9*(-vx3)); break; - case D3Q27System::NE: velocity = (UbMath::c1o9*(+vx1+vx2)); break; - case D3Q27System::SW: velocity = (UbMath::c1o9*(-vx1-vx2)); break; - case D3Q27System::SE: velocity = (UbMath::c1o9*(+vx1-vx2)); break; - case D3Q27System::NW: velocity = (UbMath::c1o9*(-vx1+vx2)); break; - case D3Q27System::TE: velocity = (UbMath::c1o9*(+vx1+vx3)); break; - case D3Q27System::BW: velocity = (UbMath::c1o9*(-vx1-vx3)); break; - case D3Q27System::BE: velocity = (UbMath::c1o9*(+vx1-vx3)); break; - case D3Q27System::TW: velocity = (UbMath::c1o9*(-vx1+vx3)); break; - case D3Q27System::TN: velocity = (UbMath::c1o9*(+vx2+vx3)); break; - case D3Q27System::BS: velocity = (UbMath::c1o9*(-vx2-vx3)); break; - case D3Q27System::BN: velocity = (UbMath::c1o9*(+vx2-vx3)); break; - case D3Q27System::TS: velocity = (UbMath::c1o9*(-vx2+vx3)); break; - case D3Q27System::TNE: velocity = (UbMath::c1o36*(+vx1+vx2+vx3)); break; - case D3Q27System::BSW: velocity = (UbMath::c1o36*(-vx1-vx2-vx3)); break; - case D3Q27System::BNE: velocity = (UbMath::c1o36*(+vx1+vx2-vx3)); break; - case D3Q27System::TSW: velocity = (UbMath::c1o36*(-vx1-vx2+vx3)); break; - case D3Q27System::TSE: velocity = (UbMath::c1o36*(+vx1-vx2+vx3)); break; - case D3Q27System::BNW: velocity = (UbMath::c1o36*(-vx1+vx2-vx3)); break; - case D3Q27System::BSE: velocity = (UbMath::c1o36*(+vx1-vx2-vx3)); break; - case D3Q27System::TNW: velocity = (UbMath::c1o36*(-vx1+vx2+vx3)); break; + case D3Q27System::DIR_P00: velocity = (UbMath::c4o9*(+vx1)); break; //(2/cs^2)(=6)*rho_0(=1 bei imkompr)*wi*u*ei mit cs=1/sqrt(3) + case D3Q27System::DIR_M00: velocity = (UbMath::c4o9*(-vx1)); break; //z.B. aus paper manfred MRT LB models in three dimensions (2002) + case D3Q27System::DIR_0P0: velocity = (UbMath::c4o9*(+vx2)); break; + case D3Q27System::DIR_0M0: velocity = (UbMath::c4o9*(-vx2)); break; + case D3Q27System::DIR_00P: velocity = (UbMath::c4o9*(+vx3)); break; + case D3Q27System::DIR_00M: velocity = (UbMath::c4o9*(-vx3)); break; + case D3Q27System::DIR_PP0: velocity = (UbMath::c1o9*(+vx1+vx2)); break; + case D3Q27System::DIR_MM0: velocity = (UbMath::c1o9*(-vx1-vx2)); break; + case D3Q27System::DIR_PM0: velocity = (UbMath::c1o9*(+vx1-vx2)); break; + case D3Q27System::DIR_MP0: velocity = (UbMath::c1o9*(-vx1+vx2)); break; + case D3Q27System::DIR_P0P: velocity = (UbMath::c1o9*(+vx1+vx3)); break; + case D3Q27System::DIR_M0M: velocity = (UbMath::c1o9*(-vx1-vx3)); break; + case D3Q27System::DIR_P0M: velocity = (UbMath::c1o9*(+vx1-vx3)); break; + case D3Q27System::DIR_M0P: velocity = (UbMath::c1o9*(-vx1+vx3)); break; + case D3Q27System::DIR_0PP: velocity = (UbMath::c1o9*(+vx2+vx3)); break; + case D3Q27System::DIR_0MM: velocity = (UbMath::c1o9*(-vx2-vx3)); break; + case D3Q27System::DIR_0PM: velocity = (UbMath::c1o9*(+vx2-vx3)); break; + case D3Q27System::DIR_0MP: velocity = (UbMath::c1o9*(-vx2+vx3)); break; + case D3Q27System::DIR_PPP: velocity = (UbMath::c1o36*(+vx1+vx2+vx3)); break; + case D3Q27System::DIR_MMM: velocity = (UbMath::c1o36*(-vx1-vx2-vx3)); break; + case D3Q27System::DIR_PPM: velocity = (UbMath::c1o36*(+vx1+vx2-vx3)); break; + case D3Q27System::DIR_MMP: velocity = (UbMath::c1o36*(-vx1-vx2+vx3)); break; + case D3Q27System::DIR_PMP: velocity = (UbMath::c1o36*(+vx1-vx2+vx3)); break; + case D3Q27System::DIR_MPM: velocity = (UbMath::c1o36*(-vx1+vx2-vx3)); break; + case D3Q27System::DIR_PMM: velocity = (UbMath::c1o36*(+vx1-vx2-vx3)); break; + case D3Q27System::DIR_MPP: velocity = (UbMath::c1o36*(-vx1+vx2+vx3)); break; default: throw UbException(UB_EXARGS, "unknown error"); } LBMReal fReturn = ((1.0-q)/(1.0+q))*((f[invDir]-feq[invDir])/(1.0-collFactor)+feq[invDir])+((q*(f[invDir]+f[fdir])-velocity*rho)/(1.0+q)); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyDensityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyDensityBCAlgorithm.cpp index ecfb98e67aa4c20603fd4b07e969ccb396c5e757..bec8e139e333f5fa18847ddbb5fbb11c5c5c1eac 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyDensityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyDensityBCAlgorithm.cpp @@ -95,12 +95,12 @@ void ThixotropyDensityBCAlgorithm::applyBC() int nx3 = x3; //flag points in direction of fluid - if (bcPtr->hasDensityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; } - else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::W)) { nx1 += 1; } - else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; } - else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::S)) { nx2 += 1; } - else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; } - else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::B)) { nx3 += 1; } + if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_P00)) { nx1 -= 1; } + else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_M00)) { nx1 += 1; } + else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_0P0)) { nx2 -= 1; } + else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_0M0)) { nx2 += 1; } + else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_00P)) { nx3 -= 1; } + else if (bcPtr->hasDensityBoundaryFlag(D3Q27System::DIR_00M)) { nx3 += 1; } else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on density boundary...")); LBMReal rhoBC = bcPtr->getBoundaryDensity(); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.cpp index 2750e606acff2fb7a9f906f67c0b48975a11261c..ed90cc7596e186ab9984f25e2ba0ecdb625c9135 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.cpp @@ -79,12 +79,12 @@ void ThixotropyNonReflectingOutflowBCAlgorithm::applyBC() int direction = -1; //flag points in direction of fluid - if (bcPtr->hasDensityBoundaryFlag(E)) { nx1 += 1; direction = E; } - else if (bcPtr->hasDensityBoundaryFlag(W)) { nx1 -= 1; direction = W; } - else if (bcPtr->hasDensityBoundaryFlag(N)) { nx2 += 1; direction = N; } - else if (bcPtr->hasDensityBoundaryFlag(S)) { nx2 -= 1; direction = S; } - else if (bcPtr->hasDensityBoundaryFlag(T)) { nx3 += 1; direction = T; } - else if (bcPtr->hasDensityBoundaryFlag(B)) { nx3 -= 1; direction = B; } + if (bcPtr->hasDensityBoundaryFlag(DIR_P00)) { nx1 += 1; direction = DIR_P00; } + else if (bcPtr->hasDensityBoundaryFlag(DIR_M00)) { nx1 -= 1; direction = DIR_M00; } + else if (bcPtr->hasDensityBoundaryFlag(DIR_0P0)) { nx2 += 1; direction = DIR_0P0; } + else if (bcPtr->hasDensityBoundaryFlag(DIR_0M0)) { nx2 -= 1; direction = DIR_0M0; } + else if (bcPtr->hasDensityBoundaryFlag(DIR_00P)) { nx3 += 1; direction = DIR_00P; } + else if (bcPtr->hasDensityBoundaryFlag(DIR_00M)) { nx3 -= 1; direction = DIR_00M; } else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on density boundary...")); distributions->getDistribution(f, x1, x2, x3); @@ -95,131 +95,131 @@ void ThixotropyNonReflectingOutflowBCAlgorithm::applyBC() switch (direction) { - case E: - f[E] = ftemp[E] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[E]; - f[NE] = ftemp[NE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[NE]; - f[SE] = ftemp[SE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[SE]; - f[TE] = ftemp[TE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[TE]; - f[BE] = ftemp[BE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[BE]; - f[TNE] = ftemp[TNE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[TNE]; - f[TSE] = ftemp[TSE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[TSE]; - f[BNE] = ftemp[BNE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[BNE]; - f[BSE] = ftemp[BSE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[BSE]; + case DIR_P00: + f[DIR_P00] = ftemp[DIR_P00] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_P00]; + f[DIR_PP0] = ftemp[DIR_PP0] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PP0]; + f[DIR_PM0] = ftemp[DIR_PM0] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PM0]; + f[DIR_P0P] = ftemp[DIR_P0P] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_P0P]; + f[DIR_P0M] = ftemp[DIR_P0M] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_P0M]; + f[DIR_PPP] = ftemp[DIR_PPP] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PPP]; + f[DIR_PMP] = ftemp[DIR_PMP] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PMP]; + f[DIR_PPM] = ftemp[DIR_PPM] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PPM]; + f[DIR_PMM] = ftemp[DIR_PMM] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * f[DIR_PMM]; - distributions->setDistributionInvForDirection(f[E], x1 + DX1[W], x2 + DX2[W], x3 + DX3[W], W); - distributions->setDistributionInvForDirection(f[NE], x1 + DX1[SW], x2 + DX2[SW], x3 + DX3[SW], SW); - distributions->setDistributionInvForDirection(f[SE], x1 + DX1[NW], x2 + DX2[NW], x3 + DX3[NW], NW); - distributions->setDistributionInvForDirection(f[TE], x1 + DX1[BW], x2 + DX2[BW], x3 + DX3[BW], BW); - distributions->setDistributionInvForDirection(f[BE], x1 + DX1[TW], x2 + DX2[TW], x3 + DX3[TW], TW); - distributions->setDistributionInvForDirection(f[TNE], x1 + DX1[BSW], x2 + DX2[BSW], x3 + DX3[BSW], BSW); - distributions->setDistributionInvForDirection(f[TSE], x1 + DX1[BNW], x2 + DX2[BNW], x3 + DX3[BNW], BNW); - distributions->setDistributionInvForDirection(f[BNE], x1 + DX1[TSW], x2 + DX2[TSW], x3 + DX3[TSW], TSW); - distributions->setDistributionInvForDirection(f[BSE], x1 + DX1[TNW], x2 + DX2[TNW], x3 + DX3[TNW], TNW); + distributions->setDistributionInvForDirection(f[DIR_P00], x1 + DX1[DIR_M00], x2 + DX2[DIR_M00], x3 + DX3[DIR_M00], DIR_M00); + distributions->setDistributionInvForDirection(f[DIR_PP0], x1 + DX1[DIR_MM0], x2 + DX2[DIR_MM0], x3 + DX3[DIR_MM0], DIR_MM0); + distributions->setDistributionInvForDirection(f[DIR_PM0], x1 + DX1[DIR_MP0], x2 + DX2[DIR_MP0], x3 + DX3[DIR_MP0], DIR_MP0); + distributions->setDistributionInvForDirection(f[DIR_P0P], x1 + DX1[DIR_M0M], x2 + DX2[DIR_M0M], x3 + DX3[DIR_M0M], DIR_M0M); + distributions->setDistributionInvForDirection(f[DIR_P0M], x1 + DX1[DIR_M0P], x2 + DX2[DIR_M0P], x3 + DX3[DIR_M0P], DIR_M0P); + distributions->setDistributionInvForDirection(f[DIR_PPP], x1 + DX1[DIR_MMM], x2 + DX2[DIR_MMM], x3 + DX3[DIR_MMM], DIR_MMM); + distributions->setDistributionInvForDirection(f[DIR_PMP], x1 + DX1[DIR_MPM], x2 + DX2[DIR_MPM], x3 + DX3[DIR_MPM], DIR_MPM); + distributions->setDistributionInvForDirection(f[DIR_PPM], x1 + DX1[DIR_MMP], x2 + DX2[DIR_MMP], x3 + DX3[DIR_MMP], DIR_MMP); + distributions->setDistributionInvForDirection(f[DIR_PMM], x1 + DX1[DIR_MPP], x2 + DX2[DIR_MPP], x3 + DX3[DIR_MPP], DIR_MPP); break; - case W: - f[W] = ftemp[W] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[W]; - f[NW] = ftemp[NW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[NW]; - f[SW] = ftemp[SW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[SW]; - f[TW] = ftemp[TW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[TW]; - f[BW] = ftemp[BW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[BW]; - f[TNW] = ftemp[TNW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[TNW]; - f[TSW] = ftemp[TSW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[TSW]; - f[BNW] = ftemp[BNW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[BNW]; - f[BSW] = ftemp[BSW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[BSW]; + case DIR_M00: + f[DIR_M00] = ftemp[DIR_M00] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_M00]; + f[DIR_MP0] = ftemp[DIR_MP0] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MP0]; + f[DIR_MM0] = ftemp[DIR_MM0] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MM0]; + f[DIR_M0P] = ftemp[DIR_M0P] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_M0P]; + f[DIR_M0M] = ftemp[DIR_M0M] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_M0M]; + f[DIR_MPP] = ftemp[DIR_MPP] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MPP]; + f[DIR_MMP] = ftemp[DIR_MMP] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MMP]; + f[DIR_MPM] = ftemp[DIR_MPM] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MPM]; + f[DIR_MMM] = ftemp[DIR_MMM] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * f[DIR_MMM]; - distributions->setDistributionInvForDirection(f[W], x1 + DX1[E], x2 + DX2[E], x3 + DX3[E], E); - distributions->setDistributionInvForDirection(f[NW], x1 + DX1[SE], x2 + DX2[SE], x3 + DX3[SE], SE); - distributions->setDistributionInvForDirection(f[SW], x1 + DX1[NE], x2 + DX2[NE], x3 + DX3[NE], NE); - distributions->setDistributionInvForDirection(f[TW], x1 + DX1[BE], x2 + DX2[BE], x3 + DX3[BE], BE); - distributions->setDistributionInvForDirection(f[BW], x1 + DX1[TE], x2 + DX2[TE], x3 + DX3[TE], TE); - distributions->setDistributionInvForDirection(f[TNW], x1 + DX1[BSE], x2 + DX2[BSE], x3 + DX3[BSE], BSE); - distributions->setDistributionInvForDirection(f[TSW], x1 + DX1[BNE], x2 + DX2[BNE], x3 + DX3[BNE], BNE); - distributions->setDistributionInvForDirection(f[BNW], x1 + DX1[TSE], x2 + DX2[TSE], x3 + DX3[TSE], TSE); - distributions->setDistributionInvForDirection(f[BSW], x1 + DX1[TNE], x2 + DX2[TNE], x3 + DX3[TNE], TNE); + distributions->setDistributionInvForDirection(f[DIR_M00], x1 + DX1[DIR_P00], x2 + DX2[DIR_P00], x3 + DX3[DIR_P00], DIR_P00); + distributions->setDistributionInvForDirection(f[DIR_MP0], x1 + DX1[DIR_PM0], x2 + DX2[DIR_PM0], x3 + DX3[DIR_PM0], DIR_PM0); + distributions->setDistributionInvForDirection(f[DIR_MM0], x1 + DX1[DIR_PP0], x2 + DX2[DIR_PP0], x3 + DX3[DIR_PP0], DIR_PP0); + distributions->setDistributionInvForDirection(f[DIR_M0P], x1 + DX1[DIR_P0M], x2 + DX2[DIR_P0M], x3 + DX3[DIR_P0M], DIR_P0M); + distributions->setDistributionInvForDirection(f[DIR_M0M], x1 + DX1[DIR_P0P], x2 + DX2[DIR_P0P], x3 + DX3[DIR_P0P], DIR_P0P); + distributions->setDistributionInvForDirection(f[DIR_MPP], x1 + DX1[DIR_PMM], x2 + DX2[DIR_PMM], x3 + DX3[DIR_PMM], DIR_PMM); + distributions->setDistributionInvForDirection(f[DIR_MMP], x1 + DX1[DIR_PPM], x2 + DX2[DIR_PPM], x3 + DX3[DIR_PPM], DIR_PPM); + distributions->setDistributionInvForDirection(f[DIR_MPM], x1 + DX1[DIR_PMP], x2 + DX2[DIR_PMP], x3 + DX3[DIR_PMP], DIR_PMP); + distributions->setDistributionInvForDirection(f[DIR_MMM], x1 + DX1[DIR_PPP], x2 + DX2[DIR_PPP], x3 + DX3[DIR_PPP], DIR_PPP); break; - case N: - f[N] = ftemp[N] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[N]; - f[NE] = ftemp[NE] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[NE]; - f[NW] = ftemp[NW] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[NW]; - f[TN] = ftemp[TN] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[TN]; - f[BN] = ftemp[BN] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[BN]; - f[TNE] = ftemp[TNE] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[TNE]; - f[TNW] = ftemp[TNW] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[TNW]; - f[BNE] = ftemp[BNE] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[BNE]; - f[BNW] = ftemp[BNW] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[BNW]; + case DIR_0P0: + f[DIR_0P0] = ftemp[DIR_0P0] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_0P0]; + f[DIR_PP0] = ftemp[DIR_PP0] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_PP0]; + f[DIR_MP0] = ftemp[DIR_MP0] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_MP0]; + f[DIR_0PP] = ftemp[DIR_0PP] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_0PP]; + f[DIR_0PM] = ftemp[DIR_0PM] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_0PM]; + f[DIR_PPP] = ftemp[DIR_PPP] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_PPP]; + f[DIR_MPP] = ftemp[DIR_MPP] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_MPP]; + f[DIR_PPM] = ftemp[DIR_PPM] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_PPM]; + f[DIR_MPM] = ftemp[DIR_MPM] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * f[DIR_MPM]; - distributions->setDistributionInvForDirection(f[N], x1 + DX1[S], x2 + DX2[S], x3 + DX3[S], S); - distributions->setDistributionInvForDirection(f[NE], x1 + DX1[SW], x2 + DX2[SW], x3 + DX3[SW], SW); - distributions->setDistributionInvForDirection(f[NW], x1 + DX1[SE], x2 + DX2[SE], x3 + DX3[SE], SE); - distributions->setDistributionInvForDirection(f[TN], x1 + DX1[BS], x2 + DX2[BS], x3 + DX3[BS], BS); - distributions->setDistributionInvForDirection(f[BN], x1 + DX1[TS], x2 + DX2[TS], x3 + DX3[TS], TS); - distributions->setDistributionInvForDirection(f[TNE], x1 + DX1[BSW], x2 + DX2[BSW], x3 + DX3[BSW], BSW); - distributions->setDistributionInvForDirection(f[TNW], x1 + DX1[BSE], x2 + DX2[BSE], x3 + DX3[BSE], BSE); - distributions->setDistributionInvForDirection(f[BNE], x1 + DX1[TSW], x2 + DX2[TSW], x3 + DX3[TSW], TSW); - distributions->setDistributionInvForDirection(f[BNW], x1 + DX1[TSE], x2 + DX2[TSE], x3 + DX3[TSE], TSE); + distributions->setDistributionInvForDirection(f[DIR_0P0], x1 + DX1[DIR_0M0], x2 + DX2[DIR_0M0], x3 + DX3[DIR_0M0], DIR_0M0); + distributions->setDistributionInvForDirection(f[DIR_PP0], x1 + DX1[DIR_MM0], x2 + DX2[DIR_MM0], x3 + DX3[DIR_MM0], DIR_MM0); + distributions->setDistributionInvForDirection(f[DIR_MP0], x1 + DX1[DIR_PM0], x2 + DX2[DIR_PM0], x3 + DX3[DIR_PM0], DIR_PM0); + distributions->setDistributionInvForDirection(f[DIR_0PP], x1 + DX1[DIR_0MM], x2 + DX2[DIR_0MM], x3 + DX3[DIR_0MM], DIR_0MM); + distributions->setDistributionInvForDirection(f[DIR_0PM], x1 + DX1[DIR_0MP], x2 + DX2[DIR_0MP], x3 + DX3[DIR_0MP], DIR_0MP); + distributions->setDistributionInvForDirection(f[DIR_PPP], x1 + DX1[DIR_MMM], x2 + DX2[DIR_MMM], x3 + DX3[DIR_MMM], DIR_MMM); + distributions->setDistributionInvForDirection(f[DIR_MPP], x1 + DX1[DIR_PMM], x2 + DX2[DIR_PMM], x3 + DX3[DIR_PMM], DIR_PMM); + distributions->setDistributionInvForDirection(f[DIR_PPM], x1 + DX1[DIR_MMP], x2 + DX2[DIR_MMP], x3 + DX3[DIR_MMP], DIR_MMP); + distributions->setDistributionInvForDirection(f[DIR_MPM], x1 + DX1[DIR_PMP], x2 + DX2[DIR_PMP], x3 + DX3[DIR_PMP], DIR_PMP); break; - case S: - f[S] = ftemp[S] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[S]; - f[SE] = ftemp[SE] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[SE]; - f[SW] = ftemp[SW] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[SW]; - f[TS] = ftemp[TS] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[TS]; - f[BS] = ftemp[BS] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[BS]; - f[TSE] = ftemp[TSE] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[TSE]; - f[TSW] = ftemp[TSW] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[TSW]; - f[BSE] = ftemp[BSE] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[BSE]; - f[BSW] = ftemp[BSW] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[BSW]; + case DIR_0M0: + f[DIR_0M0] = ftemp[DIR_0M0] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_0M0]; + f[DIR_PM0] = ftemp[DIR_PM0] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_PM0]; + f[DIR_MM0] = ftemp[DIR_MM0] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_MM0]; + f[DIR_0MP] = ftemp[DIR_0MP] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_0MP]; + f[DIR_0MM] = ftemp[DIR_0MM] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_0MM]; + f[DIR_PMP] = ftemp[DIR_PMP] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_PMP]; + f[DIR_MMP] = ftemp[DIR_MMP] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_MMP]; + f[DIR_PMM] = ftemp[DIR_PMM] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_PMM]; + f[DIR_MMM] = ftemp[DIR_MMM] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * f[DIR_MMM]; - distributions->setDistributionInvForDirection(f[S], x1 + DX1[N], x2 + DX2[N], x3 + DX3[N], N); - distributions->setDistributionInvForDirection(f[SE], x1 + DX1[NW], x2 + DX2[NW], x3 + DX3[NW], NW); - distributions->setDistributionInvForDirection(f[SW], x1 + DX1[NE], x2 + DX2[NE], x3 + DX3[NE], NE); - distributions->setDistributionInvForDirection(f[TS], x1 + DX1[BN], x2 + DX2[BN], x3 + DX3[BN], BN); - distributions->setDistributionInvForDirection(f[BS], x1 + DX1[TN], x2 + DX2[TN], x3 + DX3[TN], TN); - distributions->setDistributionInvForDirection(f[TSE], x1 + DX1[BNW], x2 + DX2[BNW], x3 + DX3[BNW], BNW); - distributions->setDistributionInvForDirection(f[TSW], x1 + DX1[BNE], x2 + DX2[BNE], x3 + DX3[BNE], BNE); - distributions->setDistributionInvForDirection(f[BSE], x1 + DX1[TNW], x2 + DX2[TNW], x3 + DX3[TNW], TNW); - distributions->setDistributionInvForDirection(f[BSW], x1 + DX1[TNE], x2 + DX2[TNE], x3 + DX3[TNE], TNE); + distributions->setDistributionInvForDirection(f[DIR_0M0], x1 + DX1[DIR_0P0], x2 + DX2[DIR_0P0], x3 + DX3[DIR_0P0], DIR_0P0); + distributions->setDistributionInvForDirection(f[DIR_PM0], x1 + DX1[DIR_MP0], x2 + DX2[DIR_MP0], x3 + DX3[DIR_MP0], DIR_MP0); + distributions->setDistributionInvForDirection(f[DIR_MM0], x1 + DX1[DIR_PP0], x2 + DX2[DIR_PP0], x3 + DX3[DIR_PP0], DIR_PP0); + distributions->setDistributionInvForDirection(f[DIR_0MP], x1 + DX1[DIR_0PM], x2 + DX2[DIR_0PM], x3 + DX3[DIR_0PM], DIR_0PM); + distributions->setDistributionInvForDirection(f[DIR_0MM], x1 + DX1[DIR_0PP], x2 + DX2[DIR_0PP], x3 + DX3[DIR_0PP], DIR_0PP); + distributions->setDistributionInvForDirection(f[DIR_PMP], x1 + DX1[DIR_MPM], x2 + DX2[DIR_MPM], x3 + DX3[DIR_MPM], DIR_MPM); + distributions->setDistributionInvForDirection(f[DIR_MMP], x1 + DX1[DIR_PPM], x2 + DX2[DIR_PPM], x3 + DX3[DIR_PPM], DIR_PPM); + distributions->setDistributionInvForDirection(f[DIR_PMM], x1 + DX1[DIR_MPP], x2 + DX2[DIR_MPP], x3 + DX3[DIR_MPP], DIR_MPP); + distributions->setDistributionInvForDirection(f[DIR_MMM], x1 + DX1[DIR_PPP], x2 + DX2[DIR_PPP], x3 + DX3[DIR_PPP], DIR_PPP); break; - case T: - f[T] = ftemp[T] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[T]; - f[TE] = ftemp[TE] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TE]; - f[TW] = ftemp[TW] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TW]; - f[TN] = ftemp[TN] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TN]; - f[TS] = ftemp[TS] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TS]; - f[TNE] = ftemp[TNE] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TNE]; - f[TNW] = ftemp[TNW] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TNW]; - f[TSE] = ftemp[TSE] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TSE]; - f[TSW] = ftemp[TSW] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[TSW]; + case DIR_00P: + f[DIR_00P] = ftemp[DIR_00P] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_00P]; + f[DIR_P0P] = ftemp[DIR_P0P] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_P0P]; + f[DIR_M0P] = ftemp[DIR_M0P] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_M0P]; + f[DIR_0PP] = ftemp[DIR_0PP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_0PP]; + f[DIR_0MP] = ftemp[DIR_0MP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_0MP]; + f[DIR_PPP] = ftemp[DIR_PPP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_PPP]; + f[DIR_MPP] = ftemp[DIR_MPP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_MPP]; + f[DIR_PMP] = ftemp[DIR_PMP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_PMP]; + f[DIR_MMP] = ftemp[DIR_MMP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * f[DIR_MMP]; - distributions->setDistributionInvForDirection(f[T], x1 + DX1[B], x2 + DX2[B], x3 + DX3[B], B); - distributions->setDistributionInvForDirection(f[TE], x1 + DX1[BW], x2 + DX2[BW], x3 + DX3[BW], BW); - distributions->setDistributionInvForDirection(f[TW], x1 + DX1[BE], x2 + DX2[BE], x3 + DX3[BE], BE); - distributions->setDistributionInvForDirection(f[TN], x1 + DX1[BS], x2 + DX2[BS], x3 + DX3[BS], BS); - distributions->setDistributionInvForDirection(f[TS], x1 + DX1[BN], x2 + DX2[BN], x3 + DX3[BN], BN); - distributions->setDistributionInvForDirection(f[TNE], x1 + DX1[BSW], x2 + DX2[BSW], x3 + DX3[BSW], BSW); - distributions->setDistributionInvForDirection(f[TNW], x1 + DX1[BSE], x2 + DX2[BSE], x3 + DX3[BSE], BSE); - distributions->setDistributionInvForDirection(f[TSE], x1 + DX1[BNW], x2 + DX2[BNW], x3 + DX3[BNW], BNW); - distributions->setDistributionInvForDirection(f[TSW], x1 + DX1[BNE], x2 + DX2[BNE], x3 + DX3[BNE], BNE); + distributions->setDistributionInvForDirection(f[DIR_00P], x1 + DX1[DIR_00M], x2 + DX2[DIR_00M], x3 + DX3[DIR_00M], DIR_00M); + distributions->setDistributionInvForDirection(f[DIR_P0P], x1 + DX1[DIR_M0M], x2 + DX2[DIR_M0M], x3 + DX3[DIR_M0M], DIR_M0M); + distributions->setDistributionInvForDirection(f[DIR_M0P], x1 + DX1[DIR_P0M], x2 + DX2[DIR_P0M], x3 + DX3[DIR_P0M], DIR_P0M); + distributions->setDistributionInvForDirection(f[DIR_0PP], x1 + DX1[DIR_0MM], x2 + DX2[DIR_0MM], x3 + DX3[DIR_0MM], DIR_0MM); + distributions->setDistributionInvForDirection(f[DIR_0MP], x1 + DX1[DIR_0PM], x2 + DX2[DIR_0PM], x3 + DX3[DIR_0PM], DIR_0PM); + distributions->setDistributionInvForDirection(f[DIR_PPP], x1 + DX1[DIR_MMM], x2 + DX2[DIR_MMM], x3 + DX3[DIR_MMM], DIR_MMM); + distributions->setDistributionInvForDirection(f[DIR_MPP], x1 + DX1[DIR_PMM], x2 + DX2[DIR_PMM], x3 + DX3[DIR_PMM], DIR_PMM); + distributions->setDistributionInvForDirection(f[DIR_PMP], x1 + DX1[DIR_MPM], x2 + DX2[DIR_MPM], x3 + DX3[DIR_MPM], DIR_MPM); + distributions->setDistributionInvForDirection(f[DIR_MMP], x1 + DX1[DIR_PPM], x2 + DX2[DIR_PPM], x3 + DX3[DIR_PPM], DIR_PPM); break; - case B: - f[B] = ftemp[B] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[B]; - f[BE] = ftemp[BE] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BE]; - f[BW] = ftemp[BW] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BW]; - f[BN] = ftemp[BN] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BN]; - f[BS] = ftemp[BS] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BS]; - f[BNE] = ftemp[BNE] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BNE]; - f[BNW] = ftemp[BNW] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BNW]; - f[BSE] = ftemp[BSE] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BSE]; - f[BSW] = ftemp[BSW] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[BSW]; + case DIR_00M: + f[DIR_00M] = ftemp[DIR_00M] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_00M]; + f[DIR_P0M] = ftemp[DIR_P0M] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_P0M]; + f[DIR_M0M] = ftemp[DIR_M0M] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_M0M]; + f[DIR_0PM] = ftemp[DIR_0PM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_0PM]; + f[DIR_0MM] = ftemp[DIR_0MM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_0MM]; + f[DIR_PPM] = ftemp[DIR_PPM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_PPM]; + f[DIR_MPM] = ftemp[DIR_MPM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_MPM]; + f[DIR_PMM] = ftemp[DIR_PMM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_PMM]; + f[DIR_MMM] = ftemp[DIR_MMM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * f[DIR_MMM]; - distributions->setDistributionInvForDirection(f[B], x1 + DX1[T], x2 + DX2[T], x3 + DX3[T], T); - distributions->setDistributionInvForDirection(f[BE], x1 + DX1[TW], x2 + DX2[TW], x3 + DX3[TW], TW); - distributions->setDistributionInvForDirection(f[BW], x1 + DX1[TE], x2 + DX2[TE], x3 + DX3[TE], TE); - distributions->setDistributionInvForDirection(f[BN], x1 + DX1[TS], x2 + DX2[TS], x3 + DX3[TS], TS); - distributions->setDistributionInvForDirection(f[BS], x1 + DX1[TN], x2 + DX2[TN], x3 + DX3[TN], TN); - distributions->setDistributionInvForDirection(f[BNE], x1 + DX1[TSW], x2 + DX2[TSW], x3 + DX3[TSW], TSW); - distributions->setDistributionInvForDirection(f[BNW], x1 + DX1[TSE], x2 + DX2[TSE], x3 + DX3[TSE], TSE); - distributions->setDistributionInvForDirection(f[BSE], x1 + DX1[TNW], x2 + DX2[TNW], x3 + DX3[TNW], TNW); - distributions->setDistributionInvForDirection(f[BSW], x1 + DX1[TNE], x2 + DX2[TNE], x3 + DX3[TNE], TNE); + distributions->setDistributionInvForDirection(f[DIR_00M], x1 + DX1[DIR_00P], x2 + DX2[DIR_00P], x3 + DX3[DIR_00P], DIR_00P); + distributions->setDistributionInvForDirection(f[DIR_P0M], x1 + DX1[DIR_M0P], x2 + DX2[DIR_M0P], x3 + DX3[DIR_M0P], DIR_M0P); + distributions->setDistributionInvForDirection(f[DIR_M0M], x1 + DX1[DIR_P0P], x2 + DX2[DIR_P0P], x3 + DX3[DIR_P0P], DIR_P0P); + distributions->setDistributionInvForDirection(f[DIR_0PM], x1 + DX1[DIR_0MP], x2 + DX2[DIR_0MP], x3 + DX3[DIR_0MP], DIR_0MP); + distributions->setDistributionInvForDirection(f[DIR_0MM], x1 + DX1[DIR_0PP], x2 + DX2[DIR_0PP], x3 + DX3[DIR_0PP], DIR_0PP); + distributions->setDistributionInvForDirection(f[DIR_PPM], x1 + DX1[DIR_MMP], x2 + DX2[DIR_MMP], x3 + DX3[DIR_MMP], DIR_MMP); + distributions->setDistributionInvForDirection(f[DIR_MPM], x1 + DX1[DIR_PMP], x2 + DX2[DIR_PMP], x3 + DX3[DIR_PMP], DIR_PMP); + distributions->setDistributionInvForDirection(f[DIR_PMM], x1 + DX1[DIR_MPP], x2 + DX2[DIR_MPP], x3 + DX3[DIR_MPP], DIR_MPP); + distributions->setDistributionInvForDirection(f[DIR_MMM], x1 + DX1[DIR_PPP], x2 + DX2[DIR_PPP], x3 + DX3[DIR_PPP], DIR_PPP); break; default: UB_THROW(UbException(UB_EXARGS, "It isn't implemented non reflecting density boundary for this direction!")); @@ -239,131 +239,131 @@ void ThixotropyNonReflectingOutflowBCAlgorithm::applyBC() switch (direction) { - case E: - h[E] = htemp[E] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[E]; - h[NE] = htemp[NE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[NE]; - h[SE] = htemp[SE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[SE]; - h[TE] = htemp[TE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[TE]; - h[BE] = htemp[BE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[BE]; - h[TNE] = htemp[TNE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[TNE]; - h[TSE] = htemp[TSE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[TSE]; - h[BNE] = htemp[BNE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[BNE]; - h[BSE] = htemp[BSE] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[BSE]; + case DIR_P00: + h[DIR_P00] = htemp[DIR_P00] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[DIR_P00]; + h[DIR_PP0] = htemp[DIR_PP0] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[DIR_PP0]; + h[DIR_PM0] = htemp[DIR_PM0] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[DIR_PM0]; + h[DIR_P0P] = htemp[DIR_P0P] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[DIR_P0P]; + h[DIR_P0M] = htemp[DIR_P0M] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[DIR_P0M]; + h[DIR_PPP] = htemp[DIR_PPP] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[DIR_PPP]; + h[DIR_PMP] = htemp[DIR_PMP] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[DIR_PMP]; + h[DIR_PPM] = htemp[DIR_PPM] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[DIR_PPM]; + h[DIR_PMM] = htemp[DIR_PMM] * (UbMath::one_over_sqrt3 + vx1) + (1.0 - UbMath::one_over_sqrt3 - vx1) * h[DIR_PMM]; - distributionsH->setDistributionInvForDirection(h[E], x1 + DX1[W], x2 + DX2[W], x3 + DX3[W], W); - distributionsH->setDistributionInvForDirection(h[NE], x1 + DX1[SW], x2 + DX2[SW], x3 + DX3[SW], SW); - distributionsH->setDistributionInvForDirection(h[SE], x1 + DX1[NW], x2 + DX2[NW], x3 + DX3[NW], NW); - distributionsH->setDistributionInvForDirection(h[TE], x1 + DX1[BW], x2 + DX2[BW], x3 + DX3[BW], BW); - distributionsH->setDistributionInvForDirection(h[BE], x1 + DX1[TW], x2 + DX2[TW], x3 + DX3[TW], TW); - distributionsH->setDistributionInvForDirection(h[TNE], x1 + DX1[BSW], x2 + DX2[BSW], x3 + DX3[BSW], BSW); - distributionsH->setDistributionInvForDirection(h[TSE], x1 + DX1[BNW], x2 + DX2[BNW], x3 + DX3[BNW], BNW); - distributionsH->setDistributionInvForDirection(h[BNE], x1 + DX1[TSW], x2 + DX2[TSW], x3 + DX3[TSW], TSW); - distributionsH->setDistributionInvForDirection(h[BSE], x1 + DX1[TNW], x2 + DX2[TNW], x3 + DX3[TNW], TNW); + distributionsH->setDistributionInvForDirection(h[DIR_P00], x1 + DX1[DIR_M00], x2 + DX2[DIR_M00], x3 + DX3[DIR_M00], DIR_M00); + distributionsH->setDistributionInvForDirection(h[DIR_PP0], x1 + DX1[DIR_MM0], x2 + DX2[DIR_MM0], x3 + DX3[DIR_MM0], DIR_MM0); + distributionsH->setDistributionInvForDirection(h[DIR_PM0], x1 + DX1[DIR_MP0], x2 + DX2[DIR_MP0], x3 + DX3[DIR_MP0], DIR_MP0); + distributionsH->setDistributionInvForDirection(h[DIR_P0P], x1 + DX1[DIR_M0M], x2 + DX2[DIR_M0M], x3 + DX3[DIR_M0M], DIR_M0M); + distributionsH->setDistributionInvForDirection(h[DIR_P0M], x1 + DX1[DIR_M0P], x2 + DX2[DIR_M0P], x3 + DX3[DIR_M0P], DIR_M0P); + distributionsH->setDistributionInvForDirection(h[DIR_PPP], x1 + DX1[DIR_MMM], x2 + DX2[DIR_MMM], x3 + DX3[DIR_MMM], DIR_MMM); + distributionsH->setDistributionInvForDirection(h[DIR_PMP], x1 + DX1[DIR_MPM], x2 + DX2[DIR_MPM], x3 + DX3[DIR_MPM], DIR_MPM); + distributionsH->setDistributionInvForDirection(h[DIR_PPM], x1 + DX1[DIR_MMP], x2 + DX2[DIR_MMP], x3 + DX3[DIR_MMP], DIR_MMP); + distributionsH->setDistributionInvForDirection(h[DIR_PMM], x1 + DX1[DIR_MPP], x2 + DX2[DIR_MPP], x3 + DX3[DIR_MPP], DIR_MPP); break; - case W: - h[W] = htemp[W] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[W]; - h[NW] = htemp[NW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[NW]; - h[SW] = htemp[SW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[SW]; - h[TW] = htemp[TW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[TW]; - h[BW] = htemp[BW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[BW]; - h[TNW] = htemp[TNW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[TNW]; - h[TSW] = htemp[TSW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[TSW]; - h[BNW] = htemp[BNW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[BNW]; - h[BSW] = htemp[BSW] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[BSW]; + case DIR_M00: + h[DIR_M00] = htemp[DIR_M00] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[DIR_M00]; + h[DIR_MP0] = htemp[DIR_MP0] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[DIR_MP0]; + h[DIR_MM0] = htemp[DIR_MM0] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[DIR_MM0]; + h[DIR_M0P] = htemp[DIR_M0P] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[DIR_M0P]; + h[DIR_M0M] = htemp[DIR_M0M] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[DIR_M0M]; + h[DIR_MPP] = htemp[DIR_MPP] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[DIR_MPP]; + h[DIR_MMP] = htemp[DIR_MMP] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[DIR_MMP]; + h[DIR_MPM] = htemp[DIR_MPM] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[DIR_MPM]; + h[DIR_MMM] = htemp[DIR_MMM] * (UbMath::one_over_sqrt3 - vx1) + (1.0 - UbMath::one_over_sqrt3 + vx1) * h[DIR_MMM]; - distributionsH->setDistributionInvForDirection(h[W], x1 + DX1[E], x2 + DX2[E], x3 + DX3[E], E); - distributionsH->setDistributionInvForDirection(h[NW], x1 + DX1[SE], x2 + DX2[SE], x3 + DX3[SE], SE); - distributionsH->setDistributionInvForDirection(h[SW], x1 + DX1[NE], x2 + DX2[NE], x3 + DX3[NE], NE); - distributionsH->setDistributionInvForDirection(h[TW], x1 + DX1[BE], x2 + DX2[BE], x3 + DX3[BE], BE); - distributionsH->setDistributionInvForDirection(h[BW], x1 + DX1[TE], x2 + DX2[TE], x3 + DX3[TE], TE); - distributionsH->setDistributionInvForDirection(h[TNW], x1 + DX1[BSE], x2 + DX2[BSE], x3 + DX3[BSE], BSE); - distributionsH->setDistributionInvForDirection(h[TSW], x1 + DX1[BNE], x2 + DX2[BNE], x3 + DX3[BNE], BNE); - distributionsH->setDistributionInvForDirection(h[BNW], x1 + DX1[TSE], x2 + DX2[TSE], x3 + DX3[TSE], TSE); - distributionsH->setDistributionInvForDirection(h[BSW], x1 + DX1[TNE], x2 + DX2[TNE], x3 + DX3[TNE], TNE); + distributionsH->setDistributionInvForDirection(h[DIR_M00], x1 + DX1[DIR_P00], x2 + DX2[DIR_P00], x3 + DX3[DIR_P00], DIR_P00); + distributionsH->setDistributionInvForDirection(h[DIR_MP0], x1 + DX1[DIR_PM0], x2 + DX2[DIR_PM0], x3 + DX3[DIR_PM0], DIR_PM0); + distributionsH->setDistributionInvForDirection(h[DIR_MM0], x1 + DX1[DIR_PP0], x2 + DX2[DIR_PP0], x3 + DX3[DIR_PP0], DIR_PP0); + distributionsH->setDistributionInvForDirection(h[DIR_M0P], x1 + DX1[DIR_P0M], x2 + DX2[DIR_P0M], x3 + DX3[DIR_P0M], DIR_P0M); + distributionsH->setDistributionInvForDirection(h[DIR_M0M], x1 + DX1[DIR_P0P], x2 + DX2[DIR_P0P], x3 + DX3[DIR_P0P], DIR_P0P); + distributionsH->setDistributionInvForDirection(h[DIR_MPP], x1 + DX1[DIR_PMM], x2 + DX2[DIR_PMM], x3 + DX3[DIR_PMM], DIR_PMM); + distributionsH->setDistributionInvForDirection(h[DIR_MMP], x1 + DX1[DIR_PPM], x2 + DX2[DIR_PPM], x3 + DX3[DIR_PPM], DIR_PPM); + distributionsH->setDistributionInvForDirection(h[DIR_MPM], x1 + DX1[DIR_PMP], x2 + DX2[DIR_PMP], x3 + DX3[DIR_PMP], DIR_PMP); + distributionsH->setDistributionInvForDirection(h[DIR_MMM], x1 + DX1[DIR_PPP], x2 + DX2[DIR_PPP], x3 + DX3[DIR_PPP], DIR_PPP); break; - case N: - h[N] = htemp[N] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[N]; - h[NE] = htemp[NE] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[NE]; - h[NW] = htemp[NW] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[NW]; - h[TN] = htemp[TN] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[TN]; - h[BN] = htemp[BN] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[BN]; - h[TNE] = htemp[TNE] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[TNE]; - h[TNW] = htemp[TNW] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[TNW]; - h[BNE] = htemp[BNE] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[BNE]; - h[BNW] = htemp[BNW] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[BNW]; + case DIR_0P0: + h[DIR_0P0] = htemp[DIR_0P0] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[DIR_0P0]; + h[DIR_PP0] = htemp[DIR_PP0] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[DIR_PP0]; + h[DIR_MP0] = htemp[DIR_MP0] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[DIR_MP0]; + h[DIR_0PP] = htemp[DIR_0PP] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[DIR_0PP]; + h[DIR_0PM] = htemp[DIR_0PM] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[DIR_0PM]; + h[DIR_PPP] = htemp[DIR_PPP] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[DIR_PPP]; + h[DIR_MPP] = htemp[DIR_MPP] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[DIR_MPP]; + h[DIR_PPM] = htemp[DIR_PPM] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[DIR_PPM]; + h[DIR_MPM] = htemp[DIR_MPM] * (UbMath::one_over_sqrt3 + vx2) + (1.0 - UbMath::one_over_sqrt3 - vx2) * h[DIR_MPM]; - distributionsH->setDistributionInvForDirection(h[N], x1 + DX1[S], x2 + DX2[S], x3 + DX3[S], S); - distributionsH->setDistributionInvForDirection(h[NE], x1 + DX1[SW], x2 + DX2[SW], x3 + DX3[SW], SW); - distributionsH->setDistributionInvForDirection(h[NW], x1 + DX1[SE], x2 + DX2[SE], x3 + DX3[SE], SE); - distributionsH->setDistributionInvForDirection(h[TN], x1 + DX1[BS], x2 + DX2[BS], x3 + DX3[BS], BS); - distributionsH->setDistributionInvForDirection(h[BN], x1 + DX1[TS], x2 + DX2[TS], x3 + DX3[TS], TS); - distributionsH->setDistributionInvForDirection(h[TNE], x1 + DX1[BSW], x2 + DX2[BSW], x3 + DX3[BSW], BSW); - distributionsH->setDistributionInvForDirection(h[TNW], x1 + DX1[BSE], x2 + DX2[BSE], x3 + DX3[BSE], BSE); - distributionsH->setDistributionInvForDirection(h[BNE], x1 + DX1[TSW], x2 + DX2[TSW], x3 + DX3[TSW], TSW); - distributionsH->setDistributionInvForDirection(h[BNW], x1 + DX1[TSE], x2 + DX2[TSE], x3 + DX3[TSE], TSE); + distributionsH->setDistributionInvForDirection(h[DIR_0P0], x1 + DX1[DIR_0M0], x2 + DX2[DIR_0M0], x3 + DX3[DIR_0M0], DIR_0M0); + distributionsH->setDistributionInvForDirection(h[DIR_PP0], x1 + DX1[DIR_MM0], x2 + DX2[DIR_MM0], x3 + DX3[DIR_MM0], DIR_MM0); + distributionsH->setDistributionInvForDirection(h[DIR_MP0], x1 + DX1[DIR_PM0], x2 + DX2[DIR_PM0], x3 + DX3[DIR_PM0], DIR_PM0); + distributionsH->setDistributionInvForDirection(h[DIR_0PP], x1 + DX1[DIR_0MM], x2 + DX2[DIR_0MM], x3 + DX3[DIR_0MM], DIR_0MM); + distributionsH->setDistributionInvForDirection(h[DIR_0PM], x1 + DX1[DIR_0MP], x2 + DX2[DIR_0MP], x3 + DX3[DIR_0MP], DIR_0MP); + distributionsH->setDistributionInvForDirection(h[DIR_PPP], x1 + DX1[DIR_MMM], x2 + DX2[DIR_MMM], x3 + DX3[DIR_MMM], DIR_MMM); + distributionsH->setDistributionInvForDirection(h[DIR_MPP], x1 + DX1[DIR_PMM], x2 + DX2[DIR_PMM], x3 + DX3[DIR_PMM], DIR_PMM); + distributionsH->setDistributionInvForDirection(h[DIR_PPM], x1 + DX1[DIR_MMP], x2 + DX2[DIR_MMP], x3 + DX3[DIR_MMP], DIR_MMP); + distributionsH->setDistributionInvForDirection(h[DIR_MPM], x1 + DX1[DIR_PMP], x2 + DX2[DIR_PMP], x3 + DX3[DIR_PMP], DIR_PMP); break; - case S: - h[S] = htemp[S] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[S]; - h[SE] = htemp[SE] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[SE]; - h[SW] = htemp[SW] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[SW]; - h[TS] = htemp[TS] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[TS]; - h[BS] = htemp[BS] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[BS]; - h[TSE] = htemp[TSE] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[TSE]; - h[TSW] = htemp[TSW] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[TSW]; - h[BSE] = htemp[BSE] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[BSE]; - h[BSW] = htemp[BSW] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[BSW]; + case DIR_0M0: + h[DIR_0M0] = htemp[DIR_0M0] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[DIR_0M0]; + h[DIR_PM0] = htemp[DIR_PM0] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[DIR_PM0]; + h[DIR_MM0] = htemp[DIR_MM0] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[DIR_MM0]; + h[DIR_0MP] = htemp[DIR_0MP] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[DIR_0MP]; + h[DIR_0MM] = htemp[DIR_0MM] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[DIR_0MM]; + h[DIR_PMP] = htemp[DIR_PMP] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[DIR_PMP]; + h[DIR_MMP] = htemp[DIR_MMP] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[DIR_MMP]; + h[DIR_PMM] = htemp[DIR_PMM] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[DIR_PMM]; + h[DIR_MMM] = htemp[DIR_MMM] * (UbMath::one_over_sqrt3 - vx2) + (1.0 - UbMath::one_over_sqrt3 + vx2) * h[DIR_MMM]; - distributionsH->setDistributionInvForDirection(h[S], x1 + DX1[N], x2 + DX2[N], x3 + DX3[N], N); - distributionsH->setDistributionInvForDirection(h[SE], x1 + DX1[NW], x2 + DX2[NW], x3 + DX3[NW], NW); - distributionsH->setDistributionInvForDirection(h[SW], x1 + DX1[NE], x2 + DX2[NE], x3 + DX3[NE], NE); - distributionsH->setDistributionInvForDirection(h[TS], x1 + DX1[BN], x2 + DX2[BN], x3 + DX3[BN], BN); - distributionsH->setDistributionInvForDirection(h[BS], x1 + DX1[TN], x2 + DX2[TN], x3 + DX3[TN], TN); - distributionsH->setDistributionInvForDirection(h[TSE], x1 + DX1[BNW], x2 + DX2[BNW], x3 + DX3[BNW], BNW); - distributionsH->setDistributionInvForDirection(h[TSW], x1 + DX1[BNE], x2 + DX2[BNE], x3 + DX3[BNE], BNE); - distributionsH->setDistributionInvForDirection(h[BSE], x1 + DX1[TNW], x2 + DX2[TNW], x3 + DX3[TNW], TNW); - distributionsH->setDistributionInvForDirection(h[BSW], x1 + DX1[TNE], x2 + DX2[TNE], x3 + DX3[TNE], TNE); + distributionsH->setDistributionInvForDirection(h[DIR_0M0], x1 + DX1[DIR_0P0], x2 + DX2[DIR_0P0], x3 + DX3[DIR_0P0], DIR_0P0); + distributionsH->setDistributionInvForDirection(h[DIR_PM0], x1 + DX1[DIR_MP0], x2 + DX2[DIR_MP0], x3 + DX3[DIR_MP0], DIR_MP0); + distributionsH->setDistributionInvForDirection(h[DIR_MM0], x1 + DX1[DIR_PP0], x2 + DX2[DIR_PP0], x3 + DX3[DIR_PP0], DIR_PP0); + distributionsH->setDistributionInvForDirection(h[DIR_0MP], x1 + DX1[DIR_0PM], x2 + DX2[DIR_0PM], x3 + DX3[DIR_0PM], DIR_0PM); + distributionsH->setDistributionInvForDirection(h[DIR_0MM], x1 + DX1[DIR_0PP], x2 + DX2[DIR_0PP], x3 + DX3[DIR_0PP], DIR_0PP); + distributionsH->setDistributionInvForDirection(h[DIR_PMP], x1 + DX1[DIR_MPM], x2 + DX2[DIR_MPM], x3 + DX3[DIR_MPM], DIR_MPM); + distributionsH->setDistributionInvForDirection(h[DIR_MMP], x1 + DX1[DIR_PPM], x2 + DX2[DIR_PPM], x3 + DX3[DIR_PPM], DIR_PPM); + distributionsH->setDistributionInvForDirection(h[DIR_PMM], x1 + DX1[DIR_MPP], x2 + DX2[DIR_MPP], x3 + DX3[DIR_MPP], DIR_MPP); + distributionsH->setDistributionInvForDirection(h[DIR_MMM], x1 + DX1[DIR_PPP], x2 + DX2[DIR_PPP], x3 + DX3[DIR_PPP], DIR_PPP); break; - case T: - h[T] = htemp[T] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[T]; - h[TE] = htemp[TE] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[TE]; - h[TW] = htemp[TW] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[TW]; - h[TN] = htemp[TN] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[TN]; - h[TS] = htemp[TS] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[TS]; - h[TNE] = htemp[TNE] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[TNE]; - h[TNW] = htemp[TNW] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[TNW]; - h[TSE] = htemp[TSE] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[TSE]; - h[TSW] = htemp[TSW] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[TSW]; + case DIR_00P: + h[DIR_00P] = htemp[DIR_00P] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[DIR_00P]; + h[DIR_P0P] = htemp[DIR_P0P] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[DIR_P0P]; + h[DIR_M0P] = htemp[DIR_M0P] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[DIR_M0P]; + h[DIR_0PP] = htemp[DIR_0PP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[DIR_0PP]; + h[DIR_0MP] = htemp[DIR_0MP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[DIR_0MP]; + h[DIR_PPP] = htemp[DIR_PPP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[DIR_PPP]; + h[DIR_MPP] = htemp[DIR_MPP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[DIR_MPP]; + h[DIR_PMP] = htemp[DIR_PMP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[DIR_PMP]; + h[DIR_MMP] = htemp[DIR_MMP] * (UbMath::one_over_sqrt3 + vx3) + (1.0 - UbMath::one_over_sqrt3 - vx3) * h[DIR_MMP]; - distributionsH->setDistributionInvForDirection(h[T], x1 + DX1[B], x2 + DX2[B], x3 + DX3[B], B); - distributionsH->setDistributionInvForDirection(h[TE], x1 + DX1[BW], x2 + DX2[BW], x3 + DX3[BW], BW); - distributionsH->setDistributionInvForDirection(h[TW], x1 + DX1[BE], x2 + DX2[BE], x3 + DX3[BE], BE); - distributionsH->setDistributionInvForDirection(h[TN], x1 + DX1[BS], x2 + DX2[BS], x3 + DX3[BS], BS); - distributionsH->setDistributionInvForDirection(h[TS], x1 + DX1[BN], x2 + DX2[BN], x3 + DX3[BN], BN); - distributionsH->setDistributionInvForDirection(h[TNE], x1 + DX1[BSW], x2 + DX2[BSW], x3 + DX3[BSW], BSW); - distributionsH->setDistributionInvForDirection(h[TNW], x1 + DX1[BSE], x2 + DX2[BSE], x3 + DX3[BSE], BSE); - distributionsH->setDistributionInvForDirection(h[TSE], x1 + DX1[BNW], x2 + DX2[BNW], x3 + DX3[BNW], BNW); - distributionsH->setDistributionInvForDirection(h[TSW], x1 + DX1[BNE], x2 + DX2[BNE], x3 + DX3[BNE], BNE); + distributionsH->setDistributionInvForDirection(h[DIR_00P], x1 + DX1[DIR_00M], x2 + DX2[DIR_00M], x3 + DX3[DIR_00M], DIR_00M); + distributionsH->setDistributionInvForDirection(h[DIR_P0P], x1 + DX1[DIR_M0M], x2 + DX2[DIR_M0M], x3 + DX3[DIR_M0M], DIR_M0M); + distributionsH->setDistributionInvForDirection(h[DIR_M0P], x1 + DX1[DIR_P0M], x2 + DX2[DIR_P0M], x3 + DX3[DIR_P0M], DIR_P0M); + distributionsH->setDistributionInvForDirection(h[DIR_0PP], x1 + DX1[DIR_0MM], x2 + DX2[DIR_0MM], x3 + DX3[DIR_0MM], DIR_0MM); + distributionsH->setDistributionInvForDirection(h[DIR_0MP], x1 + DX1[DIR_0PM], x2 + DX2[DIR_0PM], x3 + DX3[DIR_0PM], DIR_0PM); + distributionsH->setDistributionInvForDirection(h[DIR_PPP], x1 + DX1[DIR_MMM], x2 + DX2[DIR_MMM], x3 + DX3[DIR_MMM], DIR_MMM); + distributionsH->setDistributionInvForDirection(h[DIR_MPP], x1 + DX1[DIR_PMM], x2 + DX2[DIR_PMM], x3 + DX3[DIR_PMM], DIR_PMM); + distributionsH->setDistributionInvForDirection(h[DIR_PMP], x1 + DX1[DIR_MPM], x2 + DX2[DIR_MPM], x3 + DX3[DIR_MPM], DIR_MPM); + distributionsH->setDistributionInvForDirection(h[DIR_MMP], x1 + DX1[DIR_PPM], x2 + DX2[DIR_PPM], x3 + DX3[DIR_PPM], DIR_PPM); break; - case B: - h[B] = htemp[B] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[B]; - h[BE] = htemp[BE] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[BE]; - h[BW] = htemp[BW] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[BW]; - h[BN] = htemp[BN] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[BN]; - h[BS] = htemp[BS] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[BS]; - h[BNE] = htemp[BNE] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[BNE]; - h[BNW] = htemp[BNW] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[BNW]; - h[BSE] = htemp[BSE] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[BSE]; - h[BSW] = htemp[BSW] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[BSW]; + case DIR_00M: + h[DIR_00M] = htemp[DIR_00M] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[DIR_00M]; + h[DIR_P0M] = htemp[DIR_P0M] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[DIR_P0M]; + h[DIR_M0M] = htemp[DIR_M0M] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[DIR_M0M]; + h[DIR_0PM] = htemp[DIR_0PM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[DIR_0PM]; + h[DIR_0MM] = htemp[DIR_0MM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[DIR_0MM]; + h[DIR_PPM] = htemp[DIR_PPM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[DIR_PPM]; + h[DIR_MPM] = htemp[DIR_MPM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[DIR_MPM]; + h[DIR_PMM] = htemp[DIR_PMM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[DIR_PMM]; + h[DIR_MMM] = htemp[DIR_MMM] * (UbMath::one_over_sqrt3 - vx3) + (1.0 - UbMath::one_over_sqrt3 + vx3) * h[DIR_MMM]; - distributionsH->setDistributionInvForDirection(h[B], x1 + DX1[T], x2 + DX2[T], x3 + DX3[T], T); - distributionsH->setDistributionInvForDirection(h[BE], x1 + DX1[TW], x2 + DX2[TW], x3 + DX3[TW], TW); - distributionsH->setDistributionInvForDirection(h[BW], x1 + DX1[TE], x2 + DX2[TE], x3 + DX3[TE], TE); - distributionsH->setDistributionInvForDirection(h[BN], x1 + DX1[TS], x2 + DX2[TS], x3 + DX3[TS], TS); - distributionsH->setDistributionInvForDirection(h[BS], x1 + DX1[TN], x2 + DX2[TN], x3 + DX3[TN], TN); - distributionsH->setDistributionInvForDirection(h[BNE], x1 + DX1[TSW], x2 + DX2[TSW], x3 + DX3[TSW], TSW); - distributionsH->setDistributionInvForDirection(h[BNW], x1 + DX1[TSE], x2 + DX2[TSE], x3 + DX3[TSE], TSE); - distributionsH->setDistributionInvForDirection(h[BSE], x1 + DX1[TNW], x2 + DX2[TNW], x3 + DX3[TNW], TNW); - distributionsH->setDistributionInvForDirection(h[BSW], x1 + DX1[TNE], x2 + DX2[TNE], x3 + DX3[TNE], TNE); + distributionsH->setDistributionInvForDirection(h[DIR_00M], x1 + DX1[DIR_00P], x2 + DX2[DIR_00P], x3 + DX3[DIR_00P], DIR_00P); + distributionsH->setDistributionInvForDirection(h[DIR_P0M], x1 + DX1[DIR_M0P], x2 + DX2[DIR_M0P], x3 + DX3[DIR_M0P], DIR_M0P); + distributionsH->setDistributionInvForDirection(h[DIR_M0M], x1 + DX1[DIR_P0P], x2 + DX2[DIR_P0P], x3 + DX3[DIR_P0P], DIR_P0P); + distributionsH->setDistributionInvForDirection(h[DIR_0PM], x1 + DX1[DIR_0MP], x2 + DX2[DIR_0MP], x3 + DX3[DIR_0MP], DIR_0MP); + distributionsH->setDistributionInvForDirection(h[DIR_0MM], x1 + DX1[DIR_0PP], x2 + DX2[DIR_0PP], x3 + DX3[DIR_0PP], DIR_0PP); + distributionsH->setDistributionInvForDirection(h[DIR_PPM], x1 + DX1[DIR_MMP], x2 + DX2[DIR_MMP], x3 + DX3[DIR_MMP], DIR_MMP); + distributionsH->setDistributionInvForDirection(h[DIR_MPM], x1 + DX1[DIR_PMP], x2 + DX2[DIR_PMP], x3 + DX3[DIR_PMP], DIR_PMP); + distributionsH->setDistributionInvForDirection(h[DIR_PMM], x1 + DX1[DIR_MPP], x2 + DX2[DIR_MPP], x3 + DX3[DIR_MPP], DIR_MPP); + distributionsH->setDistributionInvForDirection(h[DIR_MMM], x1 + DX1[DIR_PPP], x2 + DX2[DIR_PPP], x3 + DX3[DIR_PPP], DIR_PPP); break; default: UB_THROW(UbException(UB_EXARGS, "It isn't implemented non reflecting density boundary for this direction!")); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityBCAlgorithm.cpp index 6db2e6230560e313abcccbb08299f1928d5c0672..4748212417600b18615a938a6c7a2696ee00eb00 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityBCAlgorithm.cpp @@ -92,12 +92,12 @@ void ThixotropyVelocityBCAlgorithm::applyBC() int nx3 = x3; //flag points in direction of fluid - if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; } + if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_P00)) { nx1 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_M00)) { nx1 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_0P0)) { nx2 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_0M0)) { nx2 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_00P)) { nx3 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_00M)) { nx3 += 1; } else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on velocity boundary...")); //lambdaBC = bcPtr->getBoundaryThixotropy(); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.cpp index 532570386462c4dd0d6d7db118a19429bc7beff0..454b29bc459045b1f61746eeb7f5f5987f1762a7 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.cpp @@ -85,12 +85,12 @@ void ThixotropyVelocityWithDensityBCAlgorithm::applyBC() int nx3 = x3; //flag points in direction of fluid - if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::E)) { nx1 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::W)) { nx1 += 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::N)) { nx2 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::S)) { nx2 += 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::T)) { nx3 -= 1; } - else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::B)) { nx3 += 1; } + if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_P00)) { nx1 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_M00)) { nx1 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_0P0)) { nx2 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_0M0)) { nx2 += 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_00P)) { nx3 -= 1; } + else if (bcPtr->hasVelocityBoundaryFlag(D3Q27System::DIR_00M)) { nx3 += 1; } else UB_THROW(UbException(UB_EXARGS, "Danger...no orthogonal BC-Flag on velocity boundary...")); for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++) diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp index b7e4d4b9a6cc3276728b5d07d89ac3c723ab027c..ea45bb14110a071724f816b3c7840ce0dfbd7327 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/MPIIORestartCoProcessor.cpp @@ -9,7 +9,7 @@ #include "D3Q27System.h" #include "DataSet3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMKernel.h" #include "UbFileInputASCII.h" #include "UbFileOutputASCII.h" diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/ShearStressCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/ShearStressCoProcessor.cpp index 3765d2a999f73c476a4f1b250daeaefde971c277..64ecc177ff38403f346a519e8d0a5515a12713e4 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/ShearStressCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/ShearStressCoProcessor.cpp @@ -172,34 +172,34 @@ void ShearStressCoProcessor::calculateShearStress(double timeStep) ////////////////////////////////////////////////////////////////////////// // compute velocity ////////////////////////////////////////////////////////////////////////// - vx = ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[BSE] - f[TNW]) + (f[BNE] - f[TSW]))) + - (((f[BE] - f[TW]) + (f[TE] - f[BW])) + ((f[SE] - f[NW]) + (f[NE] - f[SW]))) + (f[E] - f[W])); + vx = ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_PMM] - f[DIR_MPP]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_P0M] - f[DIR_M0P]) + (f[DIR_P0P] - f[DIR_M0M])) + ((f[DIR_PM0] - f[DIR_MP0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_P00] - f[DIR_M00])); - vy = ((((f[TNE] - f[BSW]) + (f[BNW] - f[TSE])) + ((f[TNW] - f[BSE]) + (f[BNE] - f[TSW]))) + - (((f[BN] - f[TS]) + (f[TN] - f[BS])) + ((f[NW] - f[SE]) + (f[NE] - f[SW]))) + (f[N] - f[S])); + vy = ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_MPM] - f[DIR_PMP])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_0PM] - f[DIR_0MP]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_MP0] - f[DIR_PM0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_0P0] - f[DIR_0M0])); - vz = ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[TNW] - f[BSE]) + (f[TSW] - f[BNE]))) + - (((f[TS] - f[BN]) + (f[TN] - f[BS])) + ((f[TW] - f[BE]) + (f[TE] - f[BW]))) + (f[T] - f[B])); + vz = ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_MMP] - f[DIR_PPM]))) + + (((f[DIR_0MP] - f[DIR_0PM]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_M0P] - f[DIR_P0M]) + (f[DIR_P0P] - f[DIR_M0M]))) + (f[DIR_00P] - f[DIR_00M])); sxy = 3.0 * collFactor / (collFactor - 1.0) * - (((f[TNE] + f[BSW]) - (f[TSE] + f[BNW])) + (-(f[BSE] + f[TNW]) + (f[TSW] + f[BNE])) + - (((f[NE] + f[SW]) - (f[SE] + f[NW]))) - vx * vy); + (((f[DIR_PPP] + f[DIR_MMM]) - (f[DIR_PMP] + f[DIR_MPM])) + (-(f[DIR_PMM] + f[DIR_MPP]) + (f[DIR_MMP] + f[DIR_PPM])) + + (((f[DIR_PP0] + f[DIR_MM0]) - (f[DIR_PM0] + f[DIR_MP0]))) - vx * vy); sxz = 3.0 * collFactor / (collFactor - 1.0) * - (((f[TNE] + f[BSW]) + (f[TSE] + f[BNW])) + (-(f[BSE] + f[TNW]) - (f[TSW] + f[BNE])) + - ((f[TE] + f[BW]) - (f[BE] + f[TW])) - vx * vz); + (((f[DIR_PPP] + f[DIR_MMM]) + (f[DIR_PMP] + f[DIR_MPM])) + (-(f[DIR_PMM] + f[DIR_MPP]) - (f[DIR_MMP] + f[DIR_PPM])) + + ((f[DIR_P0P] + f[DIR_M0M]) - (f[DIR_P0M] + f[DIR_M0P])) - vx * vz); syz = 3.0 * collFactor / (collFactor - 1.0) * - (((f[TNE] + f[BSW]) - (f[TSE] + f[BNW])) + ((f[BSE] + f[TNW]) - (f[TSW] + f[BNE])) + - (-(f[BN] + f[TS]) + (f[TN] + f[BS])) - vy * vz); + (((f[DIR_PPP] + f[DIR_MMM]) - (f[DIR_PMP] + f[DIR_MPM])) + ((f[DIR_PMM] + f[DIR_MPP]) - (f[DIR_MMP] + f[DIR_PPM])) + + (-(f[DIR_0PM] + f[DIR_0MP]) + (f[DIR_0PP] + f[DIR_0MM])) - vy * vz); LBMReal dxxMyy = 3.0 / 2.0 * collFactor / (collFactor - 1.0) * - (((f[TE] + f[BW]) + (f[BE] + f[TW])) - ((f[BN] + f[TS]) + (f[TN] + f[BS])) + - ((f[E] + f[W]) - (f[N] + f[S])) - vx * vx + vy * vy); + (((f[DIR_P0P] + f[DIR_M0M]) + (f[DIR_P0M] + f[DIR_M0P])) - ((f[DIR_0PM] + f[DIR_0MP]) + (f[DIR_0PP] + f[DIR_0MM])) + + ((f[DIR_P00] + f[DIR_M00]) - (f[DIR_0P0] + f[DIR_0M0])) - vx * vx + vy * vy); LBMReal dxxMzz = 3.0 / 2.0 * collFactor / (collFactor - 1.0) * - ((((f[NE] + f[SW]) + (f[SE] + f[NW])) - ((f[BN] + f[TS]) + (f[TN] + f[BS]))) + - ((f[E] + f[W]) - (f[T] + f[B])) - vx * vx + vz * vz); + ((((f[DIR_PP0] + f[DIR_MM0]) + (f[DIR_PM0] + f[DIR_MP0])) - ((f[DIR_0PM] + f[DIR_0MP]) + (f[DIR_0PP] + f[DIR_0MM]))) + + ((f[DIR_P00] + f[DIR_M00]) - (f[DIR_00P] + f[DIR_00M])) - vx * vx + vz * vz); // LBMReal dyyMzz =3.0/2.0 *collFactor/(collFactor-1.0)*((((f[NE] + f[SW]) + (f[SE] + // f[NW]))-((f[TE] + f[BW])+(f[BE]+ f[TW]))) @@ -562,32 +562,32 @@ void ShearStressCoProcessor::findPlane(int ix1, int ix2, int ix3, SPtr<Grid3D> g "ix2=" + UbSystem::toString(ix2) + "ix3=" + UbSystem::toString(ix3) + "GlobalID=" + UbSystem::toString(block->getGlobalID()) + "dx=" + UbSystem::toString(dx) + - "T=" + UbSystem::toString(bcPtr->getQ(D3Q27System::T)) + - "B=" + UbSystem::toString(bcPtr->getQ(D3Q27System::B)) + - "E=" + UbSystem::toString(bcPtr->getQ(D3Q27System::E)) + - "W=" + UbSystem::toString(bcPtr->getQ(D3Q27System::W)) + - "N=" + UbSystem::toString(bcPtr->getQ(D3Q27System::N)) + - "S=" + UbSystem::toString(bcPtr->getQ(D3Q27System::S)) + - "NE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::NE)) + - "SW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::SW)) + - "SE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::SE)) + - "NW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::NW)) + - "TE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TE)) + - "BW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BW)) + - "BE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BE)) + - "TW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TW)) + - "TN=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TN)) + - "BS=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BS)) + - "BN=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BN)) + - "TS=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TS)) + - "TNE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TNE)) + - "TNW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TNW)) + - "TSE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TSE)) + - "TSW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TSW)) + - "BNE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BNE)) + - "BNW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BNW)) + - "BSE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BSE)) + - "BSW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BSW) * dx))); + "T=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_00P)) + + "B=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_00M)) + + "E=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_P00)) + + "W=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_M00)) + + "N=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0P0)) + + "S=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0M0)) + + "NE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PP0)) + + "SW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MM0)) + + "SE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PM0)) + + "NW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MP0)) + + "TE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_P0P)) + + "BW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_M0M)) + + "BE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_P0M)) + + "TW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_M0P)) + + "TN=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0PP)) + + "BS=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0MM)) + + "BN=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0PM)) + + "TS=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0MP)) + + "TNE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PPP)) + + "TNW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MPP)) + + "TSE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PMP)) + + "TSW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MMP)) + + "BNE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PPM)) + + "BNW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MPM)) + + "BSE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PMM)) + + "BSW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MMM) * dx))); } } @@ -608,7 +608,7 @@ void ShearStressCoProcessor::findPlane(int ix1, int ix2, int ix3, SPtr<Grid3D> g if (ii <= 2) { LBMReal q = bcPtrIn->getQ(fdir); if (q != 999.00000) { - if (fdir == D3Q27System::E) { + if (fdir == D3Q27System::DIR_P00) { // if(!bcArray->isSolid(i, j, k))continue; if (i + q <= x + 1) { if (ii == 0) { @@ -634,7 +634,7 @@ void ShearStressCoProcessor::findPlane(int ix1, int ix2, int ix3, SPtr<Grid3D> g } } } - if (fdir == D3Q27System::W) { + if (fdir == D3Q27System::DIR_M00) { // if(!bcArray->isSolid(i, j, k))continue; if (i - q >= x) { if (ii == 0) { @@ -660,7 +660,7 @@ void ShearStressCoProcessor::findPlane(int ix1, int ix2, int ix3, SPtr<Grid3D> g } } } - if (fdir == D3Q27System::N) { + if (fdir == D3Q27System::DIR_0P0) { // if(!bcArray->isSolid(i, j, k))continue; if (j + q <= y + 1) { if (ii == 0) { @@ -686,7 +686,7 @@ void ShearStressCoProcessor::findPlane(int ix1, int ix2, int ix3, SPtr<Grid3D> g } } } - if (fdir == D3Q27System::S) { + if (fdir == D3Q27System::DIR_0M0) { // if(!bcArray->isSolid(i, j, k))continue; if (j - q >= y) { if (ii == 0) { @@ -713,7 +713,7 @@ void ShearStressCoProcessor::findPlane(int ix1, int ix2, int ix3, SPtr<Grid3D> g } } - if (fdir == D3Q27System::T) { + if (fdir == D3Q27System::DIR_00P) { // if(!bcArray->isSolid(i, j, k))continue; if (k + q <= z + 1) { if (ii == 0) { @@ -739,7 +739,7 @@ void ShearStressCoProcessor::findPlane(int ix1, int ix2, int ix3, SPtr<Grid3D> g } } } - if (fdir == D3Q27System::B) { + if (fdir == D3Q27System::DIR_00M) { // if(!bcArray->isSolid(i, j, k))continue; if (k - q >= z) { if (ii == 0) { @@ -788,32 +788,32 @@ void ShearStressCoProcessor::findPlane(int ix1, int ix2, int ix3, SPtr<Grid3D> g UB_EXARGS, "ii is=" + UbSystem::toString(ii) + " ix1=" + UbSystem::toString(ix1) + " ix2=" + UbSystem::toString(ix2) + " ix3=" + UbSystem::toString(ix3) + " Block3D::GlobalID=" + UbSystem::toString(block->getGlobalID()) + " dx=" + - UbSystem::toString(dx) + " T=" + UbSystem::toString(bcPtr->getQ(D3Q27System::T)) + - " B=" + UbSystem::toString(bcPtr->getQ(D3Q27System::B)) + - " E=" + UbSystem::toString(bcPtr->getQ(D3Q27System::E)) + - " W=" + UbSystem::toString(bcPtr->getQ(D3Q27System::W)) + - " N=" + UbSystem::toString(bcPtr->getQ(D3Q27System::N)) + - " S=" + UbSystem::toString(bcPtr->getQ(D3Q27System::S)) + - " NE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::NE)) + - " SW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::SW)) + - " SE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::SE)) + - " NW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::NW)) + - " TE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TE)) + - " BW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BW)) + - " BE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BE)) + - " TW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TW)) + - " TN=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TN)) + - " BS=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BS)) + - " BN=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BN)) + - " TS=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TS)) + - " TNE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TNE)) + - " TNW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TNW)) + - " TSE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TSE)) + - " TSW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::TSW)) + - " BNE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BNE)) + - " BNW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BNW)) + - " BSE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BSE)) + - " BSW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::BSW)))); + UbSystem::toString(dx) + " T=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_00P)) + + " B=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_00M)) + + " E=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_P00)) + + " W=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_M00)) + + " N=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0P0)) + + " S=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0M0)) + + " NE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PP0)) + + " SW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MM0)) + + " SE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PM0)) + + " NW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MP0)) + + " TE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_P0P)) + + " BW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_M0M)) + + " BE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_P0M)) + + " TW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_M0P)) + + " TN=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0PP)) + + " BS=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0MM)) + + " BN=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0PM)) + + " TS=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_0MP)) + + " TNE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PPP)) + + " TNW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MPP)) + + " TSE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PMP)) + + " TSW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MMP)) + + " BNE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PPM)) + + " BNW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MPM)) + + " BSE=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_PMM)) + + " BSW=" + UbSystem::toString(bcPtr->getQ(D3Q27System::DIR_MMM)))); } } } @@ -876,22 +876,22 @@ void ShearStressCoProcessor::initDistance() continue; int numberOfCorner = 0; - if (bc->getQ(D3Q27System::T) != 999.000) { + if (bc->getQ(D3Q27System::DIR_00P) != 999.000) { numberOfCorner++; } - if (bc->getQ(D3Q27System::B) != 999.000) { + if (bc->getQ(D3Q27System::DIR_00M) != 999.000) { numberOfCorner++; } - if (bc->getQ(D3Q27System::E) != 999.000) { + if (bc->getQ(D3Q27System::DIR_P00) != 999.000) { numberOfCorner++; } - if (bc->getQ(D3Q27System::W) != 999.000) { + if (bc->getQ(D3Q27System::DIR_M00) != 999.000) { numberOfCorner++; } - if (bc->getQ(D3Q27System::N) != 999.000) { + if (bc->getQ(D3Q27System::DIR_0P0) != 999.000) { numberOfCorner++; } - if (bc->getQ(D3Q27System::S) != 999.000) { + if (bc->getQ(D3Q27System::DIR_0M0) != 999.000) { numberOfCorner++; } // if(bc->hasVelocityBoundary()||bc->hasDensityBoundary())continue; diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp index 51be3b53a9a3bc123b15e03d0925bd619fb01fa3..6a06a20d41fc8b57c43dd219623bb2d544d7a4a9 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/TurbulenceIntensityCoProcessor.cpp @@ -215,14 +215,14 @@ void TurbulenceIntensityCoProcessor::calculateAverageValues(double timeStep) ////////////////////////////////////////////////////////////////////////// // compute velocity ////////////////////////////////////////////////////////////////////////// - vx = f[E] - f[W] + f[NE] - f[SW] + f[SE] - f[NW] + f[TE] - f[BW] + f[BE] - f[TW] + - f[TNE] - f[TSW] + f[TSE] - f[TNW] + f[BNE] - f[BSW] + f[BSE] - f[BNW]; + vx = f[DIR_P00] - f[DIR_M00] + f[DIR_PP0] - f[DIR_MM0] + f[DIR_PM0] - f[DIR_MP0] + f[DIR_P0P] - f[DIR_M0M] + f[DIR_P0M] - f[DIR_M0P] + + f[DIR_PPP] - f[DIR_MMP] + f[DIR_PMP] - f[DIR_MPP] + f[DIR_PPM] - f[DIR_MMM] + f[DIR_PMM] - f[DIR_MPM]; - vy = f[N] - f[S] + f[NE] - f[SW] - f[SE] + f[NW] + f[TN] - f[BS] + f[BN] - f[TS] + - f[TNE] - f[TSW] - f[TSE] + f[TNW] + f[BNE] - f[BSW] - f[BSE] + f[BNW]; + vy = f[DIR_0P0] - f[DIR_0M0] + f[DIR_PP0] - f[DIR_MM0] - f[DIR_PM0] + f[DIR_MP0] + f[DIR_0PP] - f[DIR_0MM] + f[DIR_0PM] - f[DIR_0MP] + + f[DIR_PPP] - f[DIR_MMP] - f[DIR_PMP] + f[DIR_MPP] + f[DIR_PPM] - f[DIR_MMM] - f[DIR_PMM] + f[DIR_MPM]; - vz = f[T] - f[B] + 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]; + vz = f[DIR_00P] - f[DIR_00M] + f[DIR_P0P] - f[DIR_M0M] - f[DIR_P0M] + f[DIR_M0P] + f[DIR_0PP] - f[DIR_0MM] - f[DIR_0PM] + f[DIR_0MP] + + f[DIR_PPP] + f[DIR_MMP] + f[DIR_PMP] + f[DIR_MPP] - f[DIR_PPM] - f[DIR_MMM] - f[DIR_PMM] - f[DIR_MPM]; ////////////////////////////////////////////////////////////////////////// // compute average values ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteBlocksCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/WriteBlocksCoProcessor.cpp index 536d2ee133517279aa2458d06aea8edcee1dd20f..523ae4ffb0ac78143e071054d8804f67bd2e12d6 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteBlocksCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteBlocksCoProcessor.cpp @@ -123,7 +123,7 @@ void WriteBlocksCoProcessor::collectData(double step) // for (std::size_t i = 0; i<connectors.size(); i++) // if (connectors[i]) // { - // if (connectors[i]->getSendDir() == D3Q27System::BS) + // if (connectors[i]->getSendDir() == D3Q27System::DIR_0MM) // { // flag = true; @@ -146,7 +146,7 @@ void WriteBlocksCoProcessor::collectData(double step) // for (std::size_t i = 0; i<connectors.size(); i++) // if (connectors[i]) // { - // if (connectors[i]->getSendDir() == D3Q27System::BS) + // if (connectors[i]->getSendDir() == D3Q27System::DIR_0MM) // { // flag = true; diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMultiphaseQuantitiesCoProcessor.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMultiphaseQuantitiesCoProcessor.cpp index fc993d95808036d1645e7b1f43fff40336f63641..0298c1dbeb1d4b4a9ed6afb0c202206d9d21c488 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/WriteMultiphaseQuantitiesCoProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/WriteMultiphaseQuantitiesCoProcessor.cpp @@ -225,17 +225,17 @@ void WriteMultiphaseQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) if (!bcArray->isUndefined(ix1, ix2, ix3) && !bcArray->isSolid(ix1, ix2, ix3)) { distributionsH->getDistribution(f, ix1, ix2, ix3); (*phaseField)(ix1, ix2, ix3) = - ((f[TNE] + f[BSW]) + (f[TSE] + f[BNW])) + ((f[BSE] + f[TNW]) + (f[TSW] + f[BNE])) + - (((f[NE] + f[SW]) + (f[SE] + f[NW])) + ((f[TE] + f[BW]) + (f[BE] + f[TW])) + - ((f[BN] + f[TS]) + (f[TN] + f[BS]))) + - ((f[E] + f[W]) + (f[N] + f[S]) + (f[T] + f[B])) + f[REST]; + ((f[DIR_PPP] + f[DIR_MMM]) + (f[DIR_PMP] + f[DIR_MPM])) + ((f[DIR_PMM] + f[DIR_MPP]) + (f[DIR_MMP] + f[DIR_PPM])) + + (((f[DIR_PP0] + f[DIR_MM0]) + (f[DIR_PM0] + f[DIR_MP0])) + ((f[DIR_P0P] + f[DIR_M0M]) + (f[DIR_P0M] + f[DIR_M0P])) + + ((f[DIR_0PM] + f[DIR_0MP]) + (f[DIR_0PP] + f[DIR_0MM]))) + + ((f[DIR_P00] + f[DIR_M00]) + (f[DIR_0P0] + f[DIR_0M0]) + (f[DIR_00P] + f[DIR_00M])) + f[DIR_000]; if (distributionsH2) { distributionsH2->getDistribution(f, ix1, ix2, ix3); (*phaseField2)(ix1, ix2, ix3) = - ((f[TNE] + f[BSW]) + (f[TSE] + f[BNW])) + ((f[BSE] + f[TNW]) + (f[TSW] + f[BNE])) + - (((f[NE] + f[SW]) + (f[SE] + f[NW])) + ((f[TE] + f[BW]) + (f[BE] + f[TW])) + - ((f[BN] + f[TS]) + (f[TN] + f[BS]))) + - ((f[E] + f[W]) + (f[N] + f[S]) + (f[T] + f[B])) + f[REST]; + ((f[DIR_PPP] + f[DIR_MMM]) + (f[DIR_PMP] + f[DIR_MPM])) + ((f[DIR_PMM] + f[DIR_MPP]) + (f[DIR_MMP] + f[DIR_PPM])) + + (((f[DIR_PP0] + f[DIR_MM0]) + (f[DIR_PM0] + f[DIR_MP0])) + ((f[DIR_P0P] + f[DIR_M0M]) + (f[DIR_P0M] + f[DIR_M0P])) + + ((f[DIR_0PM] + f[DIR_0MP]) + (f[DIR_0PP] + f[DIR_0MM]))) + + ((f[DIR_P00] + f[DIR_M00]) + (f[DIR_0P0] + f[DIR_0M0]) + (f[DIR_00P] + f[DIR_00M])) + f[DIR_000]; } else { (*phaseField2)(ix1, ix2, ix3) = 999.0; } @@ -273,8 +273,8 @@ void WriteMultiphaseQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) nodes.push_back(UbTupleFloat3(float(worldCoordinates[0]), float(worldCoordinates[1]), float(worldCoordinates[2]))); - phi[REST] = (*phaseField)(ix1, ix2, ix3); - phi2[REST] = (*phaseField2)(ix1, ix2, ix3); + phi[DIR_000] = (*phaseField)(ix1, ix2, ix3); + phi2[DIR_000] = (*phaseField2)(ix1, ix2, ix3); if ((ix1 == 0) || (ix2 == 0) || (ix3 == 0)) { dX1_phi = 0.0; @@ -285,38 +285,38 @@ void WriteMultiphaseQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) // vx2 = 0.0; // vx3 = 0.0; } else { - phi[E] = (*phaseField)(ix1 + DX1[E], ix2 + DX2[E], ix3 + DX3[E]); - phi[N] = (*phaseField)(ix1 + DX1[N], ix2 + DX2[N], ix3 + DX3[N]); - phi[T] = (*phaseField)(ix1 + DX1[T], ix2 + DX2[T], ix3 + DX3[T]); - phi[W] = (*phaseField)(ix1 + DX1[W], ix2 + DX2[W], ix3 + DX3[W]); - phi[S] = (*phaseField)(ix1 + DX1[S], ix2 + DX2[S], ix3 + DX3[S]); - phi[B] = (*phaseField)(ix1 + DX1[B], ix2 + DX2[B], ix3 + DX3[B]); - phi[NE] = (*phaseField)(ix1 + DX1[NE], ix2 + DX2[NE], ix3 + DX3[NE]); - phi[NW] = (*phaseField)(ix1 + DX1[NW], ix2 + DX2[NW], ix3 + DX3[NW]); - phi[TE] = (*phaseField)(ix1 + DX1[TE], ix2 + DX2[TE], ix3 + DX3[TE]); - phi[TW] = (*phaseField)(ix1 + DX1[TW], ix2 + DX2[TW], ix3 + DX3[TW]); - phi[TN] = (*phaseField)(ix1 + DX1[TN], ix2 + DX2[TN], ix3 + DX3[TN]); - phi[TS] = (*phaseField)(ix1 + DX1[TS], ix2 + DX2[TS], ix3 + DX3[TS]); - phi[SW] = (*phaseField)(ix1 + DX1[SW], ix2 + DX2[SW], ix3 + DX3[SW]); - phi[SE] = (*phaseField)(ix1 + DX1[SE], ix2 + DX2[SE], ix3 + DX3[SE]); - phi[BW] = (*phaseField)(ix1 + DX1[BW], ix2 + DX2[BW], ix3 + DX3[BW]); - phi[BE] = (*phaseField)(ix1 + DX1[BE], ix2 + DX2[BE], ix3 + DX3[BE]); - phi[BS] = (*phaseField)(ix1 + DX1[BS], ix2 + DX2[BS], ix3 + DX3[BS]); - phi[BN] = (*phaseField)(ix1 + DX1[BN], ix2 + DX2[BN], ix3 + DX3[BN]); - phi[BSW] = (*phaseField)(ix1 + DX1[BSW], ix2 + DX2[BSW], ix3 + DX3[BSW]); - phi[BSE] = (*phaseField)(ix1 + DX1[BSE], ix2 + DX2[BSE], ix3 + DX3[BSE]); - phi[BNW] = (*phaseField)(ix1 + DX1[BNW], ix2 + DX2[BNW], ix3 + DX3[BNW]); - phi[BNE] = (*phaseField)(ix1 + DX1[BNE], ix2 + DX2[BNE], ix3 + DX3[BNE]); - phi[TNE] = (*phaseField)(ix1 + DX1[TNE], ix2 + DX2[TNE], ix3 + DX3[TNE]); - phi[TNW] = (*phaseField)(ix1 + DX1[TNW], ix2 + DX2[TNW], ix3 + DX3[TNW]); - phi[TSE] = (*phaseField)(ix1 + DX1[TSE], ix2 + DX2[TSE], ix3 + DX3[TSE]); - phi[TSW] = (*phaseField)(ix1 + DX1[TSW], ix2 + DX2[TSW], ix3 + DX3[TSW]); + phi[DIR_P00] = (*phaseField)(ix1 + DX1[DIR_P00], ix2 + DX2[DIR_P00], ix3 + DX3[DIR_P00]); + phi[DIR_0P0] = (*phaseField)(ix1 + DX1[DIR_0P0], ix2 + DX2[DIR_0P0], ix3 + DX3[DIR_0P0]); + phi[DIR_00P] = (*phaseField)(ix1 + DX1[DIR_00P], ix2 + DX2[DIR_00P], ix3 + DX3[DIR_00P]); + phi[DIR_M00] = (*phaseField)(ix1 + DX1[DIR_M00], ix2 + DX2[DIR_M00], ix3 + DX3[DIR_M00]); + phi[DIR_0M0] = (*phaseField)(ix1 + DX1[DIR_0M0], ix2 + DX2[DIR_0M0], ix3 + DX3[DIR_0M0]); + phi[DIR_00M] = (*phaseField)(ix1 + DX1[DIR_00M], ix2 + DX2[DIR_00M], ix3 + DX3[DIR_00M]); + phi[DIR_PP0] = (*phaseField)(ix1 + DX1[DIR_PP0], ix2 + DX2[DIR_PP0], ix3 + DX3[DIR_PP0]); + phi[DIR_MP0] = (*phaseField)(ix1 + DX1[DIR_MP0], ix2 + DX2[DIR_MP0], ix3 + DX3[DIR_MP0]); + phi[DIR_P0P] = (*phaseField)(ix1 + DX1[DIR_P0P], ix2 + DX2[DIR_P0P], ix3 + DX3[DIR_P0P]); + phi[DIR_M0P] = (*phaseField)(ix1 + DX1[DIR_M0P], ix2 + DX2[DIR_M0P], ix3 + DX3[DIR_M0P]); + phi[DIR_0PP] = (*phaseField)(ix1 + DX1[DIR_0PP], ix2 + DX2[DIR_0PP], ix3 + DX3[DIR_0PP]); + phi[DIR_0MP] = (*phaseField)(ix1 + DX1[DIR_0MP], ix2 + DX2[DIR_0MP], ix3 + DX3[DIR_0MP]); + phi[DIR_MM0] = (*phaseField)(ix1 + DX1[DIR_MM0], ix2 + DX2[DIR_MM0], ix3 + DX3[DIR_MM0]); + phi[DIR_PM0] = (*phaseField)(ix1 + DX1[DIR_PM0], ix2 + DX2[DIR_PM0], ix3 + DX3[DIR_PM0]); + phi[DIR_M0M] = (*phaseField)(ix1 + DX1[DIR_M0M], ix2 + DX2[DIR_M0M], ix3 + DX3[DIR_M0M]); + phi[DIR_P0M] = (*phaseField)(ix1 + DX1[DIR_P0M], ix2 + DX2[DIR_P0M], ix3 + DX3[DIR_P0M]); + phi[DIR_0MM] = (*phaseField)(ix1 + DX1[DIR_0MM], ix2 + DX2[DIR_0MM], ix3 + DX3[DIR_0MM]); + phi[DIR_0PM] = (*phaseField)(ix1 + DX1[DIR_0PM], ix2 + DX2[DIR_0PM], ix3 + DX3[DIR_0PM]); + phi[DIR_MMM] = (*phaseField)(ix1 + DX1[DIR_MMM], ix2 + DX2[DIR_MMM], ix3 + DX3[DIR_MMM]); + phi[DIR_PMM] = (*phaseField)(ix1 + DX1[DIR_PMM], ix2 + DX2[DIR_PMM], ix3 + DX3[DIR_PMM]); + phi[DIR_MPM] = (*phaseField)(ix1 + DX1[DIR_MPM], ix2 + DX2[DIR_MPM], ix3 + DX3[DIR_MPM]); + phi[DIR_PPM] = (*phaseField)(ix1 + DX1[DIR_PPM], ix2 + DX2[DIR_PPM], ix3 + DX3[DIR_PPM]); + phi[DIR_PPP] = (*phaseField)(ix1 + DX1[DIR_PPP], ix2 + DX2[DIR_PPP], ix3 + DX3[DIR_PPP]); + phi[DIR_MPP] = (*phaseField)(ix1 + DX1[DIR_MPP], ix2 + DX2[DIR_MPP], ix3 + DX3[DIR_MPP]); + phi[DIR_PMP] = (*phaseField)(ix1 + DX1[DIR_PMP], ix2 + DX2[DIR_PMP], ix3 + DX3[DIR_PMP]); + phi[DIR_MMP] = (*phaseField)(ix1 + DX1[DIR_MMP], ix2 + DX2[DIR_MMP], ix3 + DX3[DIR_MMP]); dX1_phi = 0.0 * gradX1_phi(phi); dX2_phi = 0.0 * gradX2_phi(phi); dX3_phi = 0.0 * gradX3_phi(phi); - mu = 2 * beta * phi[REST] * (phi[REST] - 1) * (2 * phi[REST] - 1) - kappa * nabla2_phi(phi); + mu = 2 * beta * phi[DIR_000] * (phi[DIR_000] - 1) * (2 * phi[DIR_000] - 1) - kappa * nabla2_phi(phi); - //phi2[E] = (*phaseField2)(ix1 + DX1[E], ix2 + DX2[E], ix3 + DX3[E]); + //phi2[DIR_P00] = (*phaseField2)(ix1 + DX1[DIR_P00], ix2 + DX2[DIR_P00], ix3 + DX3[DIR_P00]); //phi2[N] = (*phaseField2)(ix1 + DX1[N], ix2 + DX2[N], ix3 + DX3[N]); //phi2[T] = (*phaseField2)(ix1 + DX1[T], ix2 + DX2[T], ix3 + DX3[T]); //phi2[W] = (*phaseField2)(ix1 + DX1[W], ix2 + DX2[W], ix3 + DX3[W]); @@ -358,47 +358,47 @@ void WriteMultiphaseQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) LBMReal rhoToPhi = (rhoH - rhoL) / (phiH - phiL); // rho = phi[ZERO] + (1.0 - phi[ZERO])*1.0/densityRatio; - rho = rhoH + rhoToPhi * (phi[REST] - phiH); + rho = rhoH + rhoToPhi * (phi[DIR_000] - phiH); if (pressure) { vx1 = - ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[BSE] - f[TNW]) + (f[BNE] - f[TSW]))) + - (((f[BE] - f[TW]) + (f[TE] - f[BW])) + ((f[SE] - f[NW]) + (f[NE] - f[SW]))) + (f[E] - f[W])) ; + ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_PMM] - f[DIR_MPP]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_P0M] - f[DIR_M0P]) + (f[DIR_P0P] - f[DIR_M0M])) + ((f[DIR_PM0] - f[DIR_MP0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_P00] - f[DIR_M00])) ; vx2 = - ((((f[TNE] - f[BSW]) + (f[BNW] - f[TSE])) + ((f[TNW] - f[BSE]) + (f[BNE] - f[TSW]))) + - (((f[BN] - f[TS]) + (f[TN] - f[BS])) + ((f[NW] - f[SE]) + (f[NE] - f[SW]))) + (f[N] - f[S])) ; + ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_MPM] - f[DIR_PMP])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_0PM] - f[DIR_0MP]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_MP0] - f[DIR_PM0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_0P0] - f[DIR_0M0])) ; vx3 = - ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[TNW] - f[BSE]) + (f[TSW] - f[BNE]))) + - (((f[TS] - f[BN]) + (f[TN] - f[BS])) + ((f[TW] - f[BE]) + (f[TE] - f[BW]))) + (f[T] - f[B])); + ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_MMP] - f[DIR_PPM]))) + + (((f[DIR_0MP] - f[DIR_0PM]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_M0P] - f[DIR_P0M]) + (f[DIR_P0P] - f[DIR_M0M]))) + (f[DIR_00P] - f[DIR_00M])); } else { vx1 = - ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[BSE] - f[TNW]) + (f[BNE] - f[TSW]))) + - (((f[BE] - f[TW]) + (f[TE] - f[BW])) + ((f[SE] - f[NW]) + (f[NE] - f[SW]))) + (f[E] - f[W])) / + ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_PMM] - f[DIR_MPP]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_P0M] - f[DIR_M0P]) + (f[DIR_P0P] - f[DIR_M0M])) + ((f[DIR_PM0] - f[DIR_MP0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_P00] - f[DIR_M00])) / (rho * c1o3) + mu * dX1_phi / (2 * rho); vx2 = - ((((f[TNE] - f[BSW]) + (f[BNW] - f[TSE])) + ((f[TNW] - f[BSE]) + (f[BNE] - f[TSW]))) + - (((f[BN] - f[TS]) + (f[TN] - f[BS])) + ((f[NW] - f[SE]) + (f[NE] - f[SW]))) + (f[N] - f[S])) / + ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_MPM] - f[DIR_PMP])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_0PM] - f[DIR_0MP]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_MP0] - f[DIR_PM0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_0P0] - f[DIR_0M0])) / (rho * c1o3) + mu * dX2_phi / (2 * rho); vx3 = - ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[TNW] - f[BSE]) + (f[TSW] - f[BNE]))) + - (((f[TS] - f[BN]) + (f[TN] - f[BS])) + ((f[TW] - f[BE]) + (f[TE] - f[BW]))) + (f[T] - f[B])) / + ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_MMP] - f[DIR_PPM]))) + + (((f[DIR_0MP] - f[DIR_0PM]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_M0P] - f[DIR_P0M]) + (f[DIR_P0P] - f[DIR_M0M]))) + (f[DIR_00P] - f[DIR_00M])) / (rho * c1o3) + mu * dX3_phi / (2 * rho); } - p1 = (((f[TNE] + f[BSW]) + (f[TSE] + f[BNW])) + ((f[BSE] + f[TNW]) + (f[TSW] + f[BNE])) + - (((f[NE] + f[SW]) + (f[SE] + f[NW])) + ((f[TE] + f[BW]) + (f[BE] + f[TW])) + - ((f[BN] + f[TS]) + (f[TN] + f[BS]))) + - ((f[E] + f[W]) + (f[N] + f[S]) + (f[T] + f[B])) + f[REST]) + + p1 = (((f[DIR_PPP] + f[DIR_MMM]) + (f[DIR_PMP] + f[DIR_MPM])) + ((f[DIR_PMM] + f[DIR_MPP]) + (f[DIR_MMP] + f[DIR_PPM])) + + (((f[DIR_PP0] + f[DIR_MM0]) + (f[DIR_PM0] + f[DIR_MP0])) + ((f[DIR_P0P] + f[DIR_M0M]) + (f[DIR_P0M] + f[DIR_M0P])) + + ((f[DIR_0PM] + f[DIR_0MP]) + (f[DIR_0PP] + f[DIR_0MM]))) + + ((f[DIR_P00] + f[DIR_M00]) + (f[DIR_0P0] + f[DIR_0M0]) + (f[DIR_00P] + f[DIR_00M])) + f[DIR_000]) + (vx1 * rhoToPhi * dX1_phi * c1o3 + vx2 * rhoToPhi * dX2_phi * c1o3 + vx3 * rhoToPhi * dX3_phi * c1o3) / 2.0; @@ -426,7 +426,7 @@ void WriteMultiphaseQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) block->toString() + ", node=" + UbSystem::toString(ix1) + "," + UbSystem::toString(ix2) + "," + UbSystem::toString(ix3))); - if (UbMath::isNaN(phi[REST]) || UbMath::isInfinity(phi[REST])) + if (UbMath::isNaN(phi[DIR_000]) || UbMath::isInfinity(phi[DIR_000])) UB_THROW(UbException( UB_EXARGS, "phi is not a number (nan or -1.#IND) or infinity number -1.#INF in block=" + block->toString() + ", node=" + UbSystem::toString(ix1) + "," + @@ -436,12 +436,12 @@ void WriteMultiphaseQuantitiesCoProcessor::addDataMQ(SPtr<Block3D> block) UB_THROW( UbException(UB_EXARGS,"p1 is not a number (nan or -1.#IND) or infinity number -1.#INF in block="+block->toString()+ ", node="+UbSystem::toString(ix1)+","+UbSystem::toString(ix2)+","+UbSystem::toString(ix3))); - data[index++].push_back(phi[REST]); + data[index++].push_back(phi[DIR_000]); data[index++].push_back(vx1); data[index++].push_back(vx2); data[index++].push_back(vx3); data[index++].push_back(p1); - data[index++].push_back(phi2[REST]); + data[index++].push_back(phi2[DIR_000]); if (pressure) data[index++].push_back((*pressure)(ix1, ix2, ix3)); } } @@ -502,7 +502,7 @@ LBMReal WriteMultiphaseQuantitiesCoProcessor::nabla2_phi(const LBMReal *const &h using namespace D3Q27System; LBMReal sum = 0.0; for (int k = FSTARTDIR; k <= FENDDIR; k++) { - sum += WEIGTH[k] * (h[k] - h[REST]); + sum += WEIGTH[k] * (h[k] - h[DIR_000]); } return 6.0 * sum; } \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/Connectors/CoarseToFineVectorConnector.h b/src/cpu/VirtualFluidsCore/Connectors/CoarseToFineVectorConnector.h index 7c5c4f136fc814bec2c9d782e7502668c785ab42..00ba4c4e915530a4678b7271b8f78648f267cd96 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/CoarseToFineVectorConnector.h +++ b/src/cpu/VirtualFluidsCore/Connectors/CoarseToFineVectorConnector.h @@ -156,15 +156,15 @@ CoarseToFineVectorConnector<VectorTransmitter>::CoarseToFineVectorConnector( receiverEvenOddNW(receiverEvenOddNW), receiverOddEvenSE(receiverOddEvenSE), receiverOddOddNE(receiverOddOddNE), iprocessor(iprocessor) { - if (!(sendDir == D3Q27System::E || sendDir == D3Q27System::W || sendDir == D3Q27System::N || - sendDir == D3Q27System::S || sendDir == D3Q27System::T || sendDir == D3Q27System::B || - sendDir == D3Q27System::NE || sendDir == D3Q27System::SW || sendDir == D3Q27System::SE || - sendDir == D3Q27System::NW || sendDir == D3Q27System::TE || sendDir == D3Q27System::BW || - sendDir == D3Q27System::BE || sendDir == D3Q27System::TW || sendDir == D3Q27System::TN || - sendDir == D3Q27System::BS || sendDir == D3Q27System::BN || sendDir == D3Q27System::TS || - sendDir == D3Q27System::TNE || sendDir == D3Q27System::TNW || sendDir == D3Q27System::TSE || - sendDir == D3Q27System::TSW || sendDir == D3Q27System::BNE || sendDir == D3Q27System::BNW || - sendDir == D3Q27System::BSE || sendDir == D3Q27System::BSW)) { + if (!(sendDir == D3Q27System::DIR_P00 || sendDir == D3Q27System::DIR_M00 || sendDir == D3Q27System::DIR_0P0 || + sendDir == D3Q27System::DIR_0M0 || sendDir == D3Q27System::DIR_00P || sendDir == D3Q27System::DIR_00M || + sendDir == D3Q27System::DIR_PP0 || sendDir == D3Q27System::DIR_MM0 || sendDir == D3Q27System::DIR_PM0 || + sendDir == D3Q27System::DIR_MP0 || sendDir == D3Q27System::DIR_P0P || sendDir == D3Q27System::DIR_M0M || + sendDir == D3Q27System::DIR_P0M || sendDir == D3Q27System::DIR_M0P || sendDir == D3Q27System::DIR_0PP || + sendDir == D3Q27System::DIR_0MM || sendDir == D3Q27System::DIR_0PM || sendDir == D3Q27System::DIR_0MP || + sendDir == D3Q27System::DIR_PPP || sendDir == D3Q27System::DIR_MPP || sendDir == D3Q27System::DIR_PMP || + sendDir == D3Q27System::DIR_MMP || sendDir == D3Q27System::DIR_PPM || sendDir == D3Q27System::DIR_MPM || + sendDir == D3Q27System::DIR_PMM || sendDir == D3Q27System::DIR_MMM)) { throw UbException(UB_EXARGS, "invalid constructor for this direction"); } } @@ -310,44 +310,44 @@ void CoarseToFineVectorConnector<VectorTransmitter>::init() int iCellSize = 8; // size of interpolation cell switch (this->sendDir) { - case E: - case W: + case DIR_P00: + case DIR_M00: sendSize = bMaxX2 * bMaxX3 * sendDataPerNode * iCellSize; break; - case N: - case S: + case DIR_0P0: + case DIR_0M0: sendSize = bMaxX1 * bMaxX3 * sendDataPerNode * iCellSize; break; - case T: - case B: + case DIR_00P: + case DIR_00M: sendSize = bMaxX1 * bMaxX2 * sendDataPerNode * iCellSize; break; - case NE: - case SW: - case SE: - case NW: + case DIR_PP0: + case DIR_MM0: + case DIR_PM0: + case DIR_MP0: sendSize = 2 * bMaxX3 * sendDataPerNode * iCellSize; break; - case TE: - case BW: - case BE: - case TW: + case DIR_P0P: + case DIR_M0M: + case DIR_P0M: + case DIR_M0P: sendSize = 2 * bMaxX2 * sendDataPerNode * iCellSize; break; - case TN: - case BS: - case BN: - case TS: + case DIR_0PP: + case DIR_0MM: + case DIR_0PM: + case DIR_0MP: sendSize = 2 * bMaxX1 * sendDataPerNode * iCellSize; break; - case TNE: - case TNW: - case TSE: - case TSW: - case BNE: - case BNW: - case BSE: - case BSW: + case DIR_PPP: + case DIR_MPP: + case DIR_PMP: + case DIR_MMP: + case DIR_PPM: + case DIR_MPM: + case DIR_PMM: + case DIR_MMM: sendSize = 6 * bMaxX1 * sendDataPerNode * iCellSize; break; default: @@ -408,7 +408,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() int lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3; switch (sendDir) { - case E: + case DIR_P00: lMinX1 = maxX1 - 3; lMaxX1 = lMinX1 + 1; @@ -428,7 +428,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() getLocalMinMax(minX3, maxX3, false, lMinX3, lMaxX3, false); fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); break; - case W: + case DIR_M00: lMinX1 = 1; lMaxX1 = lMinX1 + 1; @@ -448,7 +448,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() getLocalMinMax(minX3, maxX3, false, lMinX3, lMaxX3, false); fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); break; - case N: + case DIR_0P0: lMinX2 = maxX2 - 3; lMaxX2 = lMinX2 + 1; @@ -468,7 +468,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() getLocalMinMax(minX3, maxX3, false, lMinX3, lMaxX3, false); fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); break; - case S: + case DIR_0M0: lMinX2 = 1; lMaxX2 = lMinX2 + 1; @@ -488,7 +488,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() getLocalMinMax(minX3, maxX3, false, lMinX3, lMaxX3, false); fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); break; - case T: + case DIR_00P: lMinX3 = maxX3 - 3; lMaxX3 = lMinX3 + 1; @@ -508,7 +508,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() getLocalMinMax(minX2, maxX2, false, lMinX2, lMaxX2, false); fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); break; - case B: + case DIR_00M: lMinX3 = 1; lMaxX3 = lMinX3 + 1; @@ -529,7 +529,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); break; /// N-S-E-W - case NE: + case DIR_PP0: lMinX1 = maxX1 - 3; lMaxX1 = lMinX1 + 2; lMinX2 = maxX2 - 3; @@ -543,7 +543,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; - case SW: + case DIR_MM0: lMinX1 = 0; lMaxX1 = lMinX1 + 2; lMinX2 = 0; @@ -557,7 +557,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; - case SE: + case DIR_PM0: lMinX1 = maxX1 - 3; lMaxX1 = lMinX1 + 2; lMinX2 = 0; @@ -571,7 +571,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; - case NW: + case DIR_MP0: lMinX1 = 0; lMaxX1 = lMinX1 + 2; lMinX2 = maxX2 - 3; @@ -585,7 +585,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; /////T-B-E-W - case TE: + case DIR_P0P: lMinX1 = maxX1 - 3; lMaxX1 = lMinX1 + 2; lMinX3 = maxX3 - 3; @@ -599,7 +599,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; - case BW: + case DIR_M0M: lMinX1 = 0; lMaxX1 = lMinX1 + 2; lMinX3 = 0; @@ -613,7 +613,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; - case BE: + case DIR_P0M: lMinX1 = maxX1 - 3; lMaxX1 = lMinX1 + 2; lMinX3 = 0; @@ -627,7 +627,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; - case TW: + case DIR_M0P: lMinX1 = 0; lMaxX1 = lMinX1 + 2; lMinX3 = maxX3 - 3; @@ -642,7 +642,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; //// /////T-B-N-S - case TN: + case DIR_0PP: lMinX2 = maxX2 - 3; lMaxX2 = lMinX2 + 2; lMinX3 = maxX3 - 3; @@ -656,7 +656,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; - case BS: + case DIR_0MM: lMinX2 = 0; lMaxX2 = lMinX2 + 2; lMinX3 = 0; @@ -670,7 +670,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; - case BN: + case DIR_0PM: lMinX2 = maxX2 - 3; lMaxX2 = lMinX2 + 2; lMinX3 = 0; @@ -684,7 +684,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; - case TS: + case DIR_0MP: lMinX2 = 0; lMaxX2 = lMinX2 + 2; lMinX3 = maxX3 - 3; @@ -699,7 +699,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() break; // TNE - case TNE: + case DIR_PPP: lMinX1 = maxX1 - 3; lMaxX1 = maxX1 - 1; lMinX2 = maxX2 - 3; @@ -710,7 +710,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataEvEv, indexEvEv); break; // TNW - case TNW: + case DIR_MPP: lMinX1 = 0; lMaxX1 = 2; lMinX2 = maxX2 - 3; @@ -721,7 +721,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataEvEv, indexEvEv); break; // TSE - case TSE: + case DIR_PMP: lMinX1 = maxX1 - 3; lMaxX1 = maxX1 - 1; lMinX2 = 0; @@ -732,7 +732,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataEvEv, indexEvEv); break; // TSW - case TSW: + case DIR_MMP: lMinX1 = 0; lMaxX1 = 2; lMinX2 = 0; @@ -743,7 +743,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataEvEv, indexEvEv); break; // BNE - case BNE: + case DIR_PPM: lMinX1 = maxX1 - 3; lMaxX1 = maxX1 - 1; lMinX2 = maxX2 - 3; @@ -754,7 +754,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataEvEv, indexEvEv); break; // BNW - case BNW: + case DIR_MPM: lMinX1 = 0; lMaxX1 = 2; lMinX2 = maxX2 - 3; @@ -765,7 +765,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataEvEv, indexEvEv); break; // BSE - case BSE: + case DIR_PMM: lMinX1 = maxX1 - 3; lMaxX1 = maxX1 - 1; lMinX2 = 0; @@ -776,7 +776,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVectorExt(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataEvEv, indexEvEv); break; // BSW - case BSW: + case DIR_MMM: lMinX1 = 0; lMaxX1 = 2; lMinX2 = 0; @@ -912,7 +912,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() int dummy; switch (sendDir) { - case E: + case DIR_P00: lMinX1 = maxX1 - 4; lMaxX1 = lMinX1 + 1; getLocalMinMax(minX2, maxX2, true, lMinX2, lMaxX2, true); @@ -935,7 +935,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() getLocalMinMax(dummy, dummy, dummy, dummy, lMaxX2, lMaxX3); distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); break; - case W: + case DIR_M00: lMinX1 = 3; lMaxX1 = lMinX1 + 1; getLocalMinMax(minX2, maxX2, true, lMinX2, lMaxX2, true); @@ -958,7 +958,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() getLocalMinMax(dummy, dummy, dummy, dummy, lMaxX2, lMaxX3); distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); break; - case N: + case DIR_0P0: lMinX2 = maxX2 - 4; lMaxX2 = lMinX2 + 1; getLocalMinMax(minX1, maxX1, true, lMinX1, lMaxX1, true); @@ -981,7 +981,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() getLocalMinMax(dummy, dummy, dummy, lMaxX1, dummy, lMaxX3); distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); break; - case S: + case DIR_0M0: lMinX2 = 3; lMaxX2 = lMinX2 + 1; getLocalMinMax(minX1, maxX1, true, lMinX1, lMaxX1, true); @@ -1004,7 +1004,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() getLocalMinMax(dummy, dummy, dummy, lMaxX1, dummy, lMaxX3); distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); break; - case T: + case DIR_00P: lMinX3 = maxX3 - 4; lMaxX3 = lMinX3 + 1; getLocalMinMax(minX1, maxX1, true, lMinX1, lMaxX1, true); @@ -1027,7 +1027,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() getLocalMinMax(dummy, dummy, dummy, lMaxX1, lMaxX2, dummy); distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); break; - case B: + case DIR_00M: lMinX3 = 3; lMaxX3 = lMinX3 + 1; getLocalMinMax(minX1, maxX1, true, lMinX1, lMaxX1, true); @@ -1052,7 +1052,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; // /////E-W-N-S - case NE: + case DIR_PP0: lMinX1 = maxX1 - 4; lMaxX1 = lMinX1 + 3; lMinX2 = maxX2 - 4; @@ -1079,7 +1079,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; - case SW: + case DIR_MM0: lMinX1 = 1; lMaxX1 = lMinX1 + 3; lMinX2 = 3; @@ -1106,7 +1106,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; - case SE: + case DIR_PM0: lMinX1 = maxX1 - 4; lMaxX1 = lMinX1 + 3; lMinX2 = 3; @@ -1133,7 +1133,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; - case NW: + case DIR_MP0: lMinX1 = 1; lMaxX1 = lMinX1 + 3; lMinX2 = maxX2 - 4; @@ -1160,7 +1160,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; // /////T-B-E-W - case TE: + case DIR_P0P: lMinX1 = maxX1 - 4; lMaxX1 = lMinX1 + 3; lMinX3 = maxX3 - 4; @@ -1187,7 +1187,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; - case BW: + case DIR_M0M: lMinX1 = 1; lMaxX1 = lMinX1 + 3; lMinX3 = 3; @@ -1214,7 +1214,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; - case BE: + case DIR_P0M: lMinX1 = maxX1 - 4; lMaxX1 = lMinX1 + 3; lMinX3 = 3; @@ -1241,7 +1241,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; - case TW: + case DIR_M0P: lMinX1 = 1; lMaxX1 = lMinX1 + 3; lMinX3 = maxX3 - 4; @@ -1269,7 +1269,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; /////////////////////////T-N-B-S - case TN: + case DIR_0PP: lMinX2 = maxX2 - 4; lMaxX2 = lMinX2 + 3; lMinX3 = maxX3 - 4; @@ -1296,7 +1296,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; - case BS: + case DIR_0MM: lMinX2 = 1; lMaxX2 = lMinX2 + 3; lMinX3 = 3; @@ -1323,7 +1323,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; - case BN: + case DIR_0PM: lMinX2 = maxX2 - 4; lMaxX2 = lMinX2 + 3; lMinX3 = 3; @@ -1350,7 +1350,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; - case TS: + case DIR_0MP: lMinX2 = 1; lMaxX2 = lMinX2 + 3; lMinX3 = maxX3 - 4; @@ -1378,7 +1378,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; // TNE - case TNE: + case DIR_PPP: lMinX1 = maxX1 - 4; lMaxX1 = maxX1 - 3; lMinX2 = maxX2 - 4; @@ -1405,7 +1405,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; // TNW - case TNW: + case DIR_MPP: lMinX1 = 3; lMaxX1 = 4; lMinX2 = maxX2 - 4; @@ -1432,7 +1432,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; // TSE - case TSE: + case DIR_PMP: lMinX1 = maxX1 - 4; lMaxX1 = maxX1 - 3; lMinX2 = 1; @@ -1458,7 +1458,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataEvEv, indexEvEv); break; // TSW - case TSW: + case DIR_MMP: lMinX1 = 3; lMaxX1 = 4; lMinX2 = 1; @@ -1484,7 +1484,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataEvEv, indexEvEv); break; // BNE - case BNE: + case DIR_PPM: lMinX1 = maxX1 - 4; lMaxX1 = maxX1 - 3; lMinX2 = maxX2 - 4; @@ -1511,7 +1511,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; // BNW - case BNW: + case DIR_MPM: lMinX1 = 3; lMaxX1 = 4; lMinX2 = maxX2 - 4; @@ -1537,7 +1537,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataEvEv, indexEvEv); break; // BSE - case BSE: + case DIR_PMM: lMinX1 = maxX1 - 4; lMaxX1 = maxX1 - 3; lMinX2 = 1; @@ -1563,7 +1563,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataEvEv, indexEvEv); break; // BSW - case BSW: + case DIR_MMM: lMinX1 = 3; lMaxX1 = 4; lMinX2 = 1; @@ -1634,55 +1634,55 @@ void CoarseToFineVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, int TmaxX2 = maxX2; int TmaxX3 = maxX3; - if (block.lock()->hasInterpolationFlagCF(E)) { + if (block.lock()->hasInterpolationFlagCF(DIR_P00)) { if (maxX1 == TmaxX1) maxX1 -= 2; } - if (block.lock()->hasInterpolationFlagCF(W)) { + if (block.lock()->hasInterpolationFlagCF(DIR_M00)) { if (minX1 == TminX1) minX1 += 2; } - if (block.lock()->hasInterpolationFlagCF(N)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0P0)) { if (maxX2 == TmaxX2) maxX2 -= 2; } - if (block.lock()->hasInterpolationFlagCF(S)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0M0)) { if (minX2 == TminX2) minX2 += 2; } - if (block.lock()->hasInterpolationFlagCF(T)) { + if (block.lock()->hasInterpolationFlagCF(DIR_00P)) { if (maxX3 == TmaxX3) maxX3 -= 2; } - if (block.lock()->hasInterpolationFlagCF(B)) { + if (block.lock()->hasInterpolationFlagCF(DIR_00M)) { if (minX3 == TminX3) minX3 += 2; } // E-W-N-S - if (block.lock()->hasInterpolationFlagCF(NE) && !block.lock()->hasInterpolationFlagCF(N) && - !block.lock()->hasInterpolationFlagCF(E)) { + if (block.lock()->hasInterpolationFlagCF(DIR_PP0) && !block.lock()->hasInterpolationFlagCF(DIR_0P0) && + !block.lock()->hasInterpolationFlagCF(DIR_P00)) { if (maxX1 == TmaxX1) maxX1 -= 2; if (maxX2 == TmaxX2) maxX2 -= 2; } - if (block.lock()->hasInterpolationFlagCF(SW) && !block.lock()->hasInterpolationFlagCF(W) && - !block.lock()->hasInterpolationFlagCF(S)) { + if (block.lock()->hasInterpolationFlagCF(DIR_MM0) && !block.lock()->hasInterpolationFlagCF(DIR_M00) && + !block.lock()->hasInterpolationFlagCF(DIR_0M0)) { if (minX1 == TminX1) minX1 += 2; if (minX2 == TminX2) minX2 += 2; } - if (block.lock()->hasInterpolationFlagCF(SE) && !block.lock()->hasInterpolationFlagCF(E) && - !block.lock()->hasInterpolationFlagCF(S)) { + if (block.lock()->hasInterpolationFlagCF(DIR_PM0) && !block.lock()->hasInterpolationFlagCF(DIR_P00) && + !block.lock()->hasInterpolationFlagCF(DIR_0M0)) { if (maxX1 == TmaxX1) maxX1 -= 2; if (minX2 == TminX2) minX2 += 2; } - if (block.lock()->hasInterpolationFlagCF(NW) && !block.lock()->hasInterpolationFlagCF(N) && - !block.lock()->hasInterpolationFlagCF(W)) { + if (block.lock()->hasInterpolationFlagCF(DIR_MP0) && !block.lock()->hasInterpolationFlagCF(DIR_0P0) && + !block.lock()->hasInterpolationFlagCF(DIR_M00)) { if (minX1 == TminX1) minX1 += 2; if (maxX2 == TmaxX2) @@ -1690,29 +1690,29 @@ void CoarseToFineVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } // ////T-B-E-W - if (block.lock()->hasInterpolationFlagCF(TE) && !block.lock()->hasInterpolationFlagCF(E) && - !block.lock()->hasInterpolationFlagCF(T)) { + if (block.lock()->hasInterpolationFlagCF(DIR_P0P) && !block.lock()->hasInterpolationFlagCF(DIR_P00) && + !block.lock()->hasInterpolationFlagCF(DIR_00P)) { if (maxX1 == TmaxX1) maxX1 -= 2; if (maxX3 == TmaxX3) maxX3 -= 2; } - if (block.lock()->hasInterpolationFlagCF(BW) && !block.lock()->hasInterpolationFlagCF(W) && - !block.lock()->hasInterpolationFlagCF(B)) { + if (block.lock()->hasInterpolationFlagCF(DIR_M0M) && !block.lock()->hasInterpolationFlagCF(DIR_M00) && + !block.lock()->hasInterpolationFlagCF(DIR_00M)) { if (minX1 == TminX1) minX1 += 2; if (minX3 == TminX3) minX3 += 2; } - if (block.lock()->hasInterpolationFlagCF(BE) && !block.lock()->hasInterpolationFlagCF(E) && - !block.lock()->hasInterpolationFlagCF(B)) { + if (block.lock()->hasInterpolationFlagCF(DIR_P0M) && !block.lock()->hasInterpolationFlagCF(DIR_P00) && + !block.lock()->hasInterpolationFlagCF(DIR_00M)) { if (maxX1 == TmaxX1) maxX1 -= 2; if (minX3 == TminX3) minX3 += 2; } - if (block.lock()->hasInterpolationFlagCF(TW) && !block.lock()->hasInterpolationFlagCF(W) && - !block.lock()->hasInterpolationFlagCF(T)) { + if (block.lock()->hasInterpolationFlagCF(DIR_M0P) && !block.lock()->hasInterpolationFlagCF(DIR_M00) && + !block.lock()->hasInterpolationFlagCF(DIR_00P)) { if (minX1 == TminX1) minX1 += 2; if (maxX3 == TmaxX3) @@ -1720,29 +1720,29 @@ void CoarseToFineVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } ////T-B-N-S - if (block.lock()->hasInterpolationFlagCF(TN) && !block.lock()->hasInterpolationFlagCF(N) && - !block.lock()->hasInterpolationFlagCF(T)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0PP) && !block.lock()->hasInterpolationFlagCF(DIR_0P0) && + !block.lock()->hasInterpolationFlagCF(DIR_00P)) { if (maxX2 == TmaxX2) maxX2 -= 2; if (maxX3 == TmaxX3) maxX3 -= 2; } - if (block.lock()->hasInterpolationFlagCF(BS) && !block.lock()->hasInterpolationFlagCF(S) && - !block.lock()->hasInterpolationFlagCF(B)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0MM) && !block.lock()->hasInterpolationFlagCF(DIR_0M0) && + !block.lock()->hasInterpolationFlagCF(DIR_00M)) { if (minX2 == TminX2) minX2 += 2; if (minX3 == TminX3) minX3 += 2; } - if (block.lock()->hasInterpolationFlagCF(BN) && !block.lock()->hasInterpolationFlagCF(N) && - !block.lock()->hasInterpolationFlagCF(B)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0PM) && !block.lock()->hasInterpolationFlagCF(DIR_0P0) && + !block.lock()->hasInterpolationFlagCF(DIR_00M)) { if (maxX2 == TmaxX2) maxX2 -= 2; if (minX3 == TminX3) minX3 += 2; } - if (block.lock()->hasInterpolationFlagCF(TS) && !block.lock()->hasInterpolationFlagCF(S) && - !block.lock()->hasInterpolationFlagCF(T)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0MP) && !block.lock()->hasInterpolationFlagCF(DIR_0M0) && + !block.lock()->hasInterpolationFlagCF(DIR_00P)) { if (minX2 == TminX2) minX2 += 2; if (maxX3 == TmaxX3) @@ -1750,10 +1750,10 @@ void CoarseToFineVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } // if - // (block.lock()->hasInterpolationFlagCF(D3Q27System::TNE)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::TE)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::TN)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::NE)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::T)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::N) - // && !block.lock()->hasInterpolationFlagCF(D3Q27System::E)) if - // (!block.lock()->hasInterpolationFlagCF(D3Q27System::TE)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::T)&& - // !block.lock()->hasInterpolationFlagCF(D3Q27System::E)) + // (block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_PPP)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_P0P)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_0PP)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_PP0)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_00P)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_0P0) + // && !block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_P00)) if + // (!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_P0P)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_00P)&& + // !block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_P00)) //{ // if (maxX1==TmaxX1) maxX1 -= 2; // if (maxX2==TmaxX2) maxX2 -= 2; @@ -1774,55 +1774,55 @@ void CoarseToFineVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, int TmaxX2 = maxX2; int TmaxX3 = maxX3; - if (block.lock()->hasInterpolationFlagCF(E)) { + if (block.lock()->hasInterpolationFlagCF(DIR_P00)) { if (maxX1 == TmaxX1) maxX1 -= 2; } - if (block.lock()->hasInterpolationFlagCF(W)) { + if (block.lock()->hasInterpolationFlagCF(DIR_M00)) { if (minX1 == TminX1) minX1 += 2; } - if (block.lock()->hasInterpolationFlagCF(N)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0P0)) { if (maxX2 == TmaxX2) maxX2 -= 2; } - if (block.lock()->hasInterpolationFlagCF(S)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0M0)) { if (minX2 == TminX2) minX2 += 2; } - if (block.lock()->hasInterpolationFlagCF(T)) { + if (block.lock()->hasInterpolationFlagCF(DIR_00P)) { if (maxX3 == TmaxX3) maxX3 -= 2; } - if (block.lock()->hasInterpolationFlagCF(B)) { + if (block.lock()->hasInterpolationFlagCF(DIR_00M)) { if (minX3 == TminX3) minX3 += 2; } // E-W-N-S - if (block.lock()->hasInterpolationFlagCF(NE) && !block.lock()->hasInterpolationFlagCF(N) && - !block.lock()->hasInterpolationFlagCF(E)) { + if (block.lock()->hasInterpolationFlagCF(DIR_PP0) && !block.lock()->hasInterpolationFlagCF(DIR_0P0) && + !block.lock()->hasInterpolationFlagCF(DIR_P00)) { if (maxX1 == TmaxX1) maxX1 -= 2; if (maxX2 == TmaxX2) maxX2 -= 2; } - if (block.lock()->hasInterpolationFlagCF(SW) && !block.lock()->hasInterpolationFlagCF(W) && - !block.lock()->hasInterpolationFlagCF(S)) { + if (block.lock()->hasInterpolationFlagCF(DIR_MM0) && !block.lock()->hasInterpolationFlagCF(DIR_M00) && + !block.lock()->hasInterpolationFlagCF(DIR_0M0)) { if (minX1 == TminX1) minX1 += 2; if (minX2 == TminX2) minX2 += 2; } - if (block.lock()->hasInterpolationFlagCF(SE) && !block.lock()->hasInterpolationFlagCF(E) && - !block.lock()->hasInterpolationFlagCF(S)) { + if (block.lock()->hasInterpolationFlagCF(DIR_PM0) && !block.lock()->hasInterpolationFlagCF(DIR_P00) && + !block.lock()->hasInterpolationFlagCF(DIR_0M0)) { if (maxX1 == TmaxX1) maxX1 -= 2; if (minX2 == TminX2) minX2 += 2; } - if (block.lock()->hasInterpolationFlagCF(NW) && !block.lock()->hasInterpolationFlagCF(N) && - !block.lock()->hasInterpolationFlagCF(W)) { + if (block.lock()->hasInterpolationFlagCF(DIR_MP0) && !block.lock()->hasInterpolationFlagCF(DIR_0P0) && + !block.lock()->hasInterpolationFlagCF(DIR_M00)) { if (minX1 == TminX1) minX1 += 2; if (maxX2 == TmaxX2) @@ -1830,29 +1830,29 @@ void CoarseToFineVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } // ////T-B-E-W - if (block.lock()->hasInterpolationFlagCF(TE) && !block.lock()->hasInterpolationFlagCF(E) && - !block.lock()->hasInterpolationFlagCF(T)) { + if (block.lock()->hasInterpolationFlagCF(DIR_P0P) && !block.lock()->hasInterpolationFlagCF(DIR_P00) && + !block.lock()->hasInterpolationFlagCF(DIR_00P)) { if (maxX1 == TmaxX1) maxX1 -= 2; if (maxX3 == TmaxX3) maxX3 -= 2; } - if (block.lock()->hasInterpolationFlagCF(BW) && !block.lock()->hasInterpolationFlagCF(W) && - !block.lock()->hasInterpolationFlagCF(B)) { + if (block.lock()->hasInterpolationFlagCF(DIR_M0M) && !block.lock()->hasInterpolationFlagCF(DIR_M00) && + !block.lock()->hasInterpolationFlagCF(DIR_00M)) { if (minX1 == TminX1) minX1 += 2; if (minX3 == TminX3) minX3 += 2; } - if (block.lock()->hasInterpolationFlagCF(BE) && !block.lock()->hasInterpolationFlagCF(E) && - !block.lock()->hasInterpolationFlagCF(B)) { + if (block.lock()->hasInterpolationFlagCF(DIR_P0M) && !block.lock()->hasInterpolationFlagCF(DIR_P00) && + !block.lock()->hasInterpolationFlagCF(DIR_00M)) { if (maxX1 == TmaxX1) maxX1 -= 2; if (minX3 == TminX3) minX3 += 2; } - if (block.lock()->hasInterpolationFlagCF(TW) && !block.lock()->hasInterpolationFlagCF(W) && - !block.lock()->hasInterpolationFlagCF(T)) { + if (block.lock()->hasInterpolationFlagCF(DIR_M0P) && !block.lock()->hasInterpolationFlagCF(DIR_M00) && + !block.lock()->hasInterpolationFlagCF(DIR_00P)) { if (minX1 == TminX1) minX1 += 2; if (maxX3 == TmaxX3) @@ -1860,29 +1860,29 @@ void CoarseToFineVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } ////T-B-N-S - if (block.lock()->hasInterpolationFlagCF(TN) && !block.lock()->hasInterpolationFlagCF(N) && - !block.lock()->hasInterpolationFlagCF(T)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0PP) && !block.lock()->hasInterpolationFlagCF(DIR_0P0) && + !block.lock()->hasInterpolationFlagCF(DIR_00P)) { if (maxX2 == TmaxX2) maxX2 -= 2; if (maxX3 == TmaxX3) maxX3 -= 2; } - if (block.lock()->hasInterpolationFlagCF(BS) && !block.lock()->hasInterpolationFlagCF(S) && - !block.lock()->hasInterpolationFlagCF(B)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0MM) && !block.lock()->hasInterpolationFlagCF(DIR_0M0) && + !block.lock()->hasInterpolationFlagCF(DIR_00M)) { if (minX2 == TminX2) minX2 += 2; if (minX3 == TminX3) minX3 += 2; } - if (block.lock()->hasInterpolationFlagCF(BN) && !block.lock()->hasInterpolationFlagCF(N) && - !block.lock()->hasInterpolationFlagCF(B)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0PM) && !block.lock()->hasInterpolationFlagCF(DIR_0P0) && + !block.lock()->hasInterpolationFlagCF(DIR_00M)) { if (maxX2 == TmaxX2) maxX2 -= 2; if (minX3 == TminX3) minX3 += 2; } - if (block.lock()->hasInterpolationFlagCF(TS) && !block.lock()->hasInterpolationFlagCF(S) && - !block.lock()->hasInterpolationFlagCF(T)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0MP) && !block.lock()->hasInterpolationFlagCF(DIR_0M0) && + !block.lock()->hasInterpolationFlagCF(DIR_00P)) { if (minX2 == TminX2) minX2 += 2; if (maxX3 == TmaxX3) @@ -1890,8 +1890,8 @@ void CoarseToFineVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } // if - // (block.lock()->hasInterpolationFlagCF(D3Q27System::TNE)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::TE)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::TN)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::NE)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::T)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::N) - // && !block.lock()->hasInterpolationFlagCF(D3Q27System::E)) + // (block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_PPP)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_P0P)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_0PP)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_PP0)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_00P)&&!block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_0P0) + // && !block.lock()->hasInterpolationFlagCF(D3Q27System::DIR_P00)) //{ // if (maxX1==TmaxX1) maxX1 -= 2; // if (maxX2==TmaxX2) maxX2 -= 2; @@ -1923,7 +1923,7 @@ void CoarseToFineVectorConnector<VectorTransmitter>::findCFnodes() int lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3; using namespace D3Q27System; - if (block.lock()->hasInterpolationFlagCF(W)) { + if (block.lock()->hasInterpolationFlagCF(DIR_M00)) { lMinX1 = 1; lMaxX1 = lMinX1 + 1; @@ -1943,8 +1943,8 @@ void CoarseToFineVectorConnector<VectorTransmitter>::findCFnodes() getLocalMinMax(minX3, maxX3, false, lMinX3, lMaxX3, false); findCFnodes(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, dataOdOd, indexOdOd); } - if (block.lock()->hasInterpolationFlagCF(TN) && !block.lock()->hasInterpolationFlagCF(N) && - !block.lock()->hasInterpolationFlagCF(T)) { + if (block.lock()->hasInterpolationFlagCF(DIR_0PP) && !block.lock()->hasInterpolationFlagCF(DIR_0P0) && + !block.lock()->hasInterpolationFlagCF(DIR_00P)) { lMinX2 = maxX2 - 3; lMaxX2 = lMinX2 + 1; lMinX3 = maxX3 - 3; diff --git a/src/cpu/VirtualFluidsCore/Connectors/FineToCoarseVectorConnector.h b/src/cpu/VirtualFluidsCore/Connectors/FineToCoarseVectorConnector.h index e430a0ad30dd7e3d0cd647271d79dd0c61f6b1f8..f8809f17b6676148faf3a94a1b9fcabede72fe58 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/FineToCoarseVectorConnector.h +++ b/src/cpu/VirtualFluidsCore/Connectors/FineToCoarseVectorConnector.h @@ -143,16 +143,16 @@ FineToCoarseVectorConnector<VectorTransmitter>::FineToCoarseVectorConnector(SPtr : Block3DConnector(sendDir), block(block), sender(sender), receiver(receiver), iprocessor(iprocessor), connType(connType) { - if (!(sendDir == D3Q27System::E || sendDir == D3Q27System::W || sendDir == D3Q27System::N || - sendDir == D3Q27System::S || sendDir == D3Q27System::T || sendDir == D3Q27System::B || - sendDir == D3Q27System::NE || sendDir == D3Q27System::SW || sendDir == D3Q27System::SE || - sendDir == D3Q27System::NW || sendDir == D3Q27System::TE || sendDir == D3Q27System::BW || - sendDir == D3Q27System::BE || sendDir == D3Q27System::TW || sendDir == D3Q27System::TN || - sendDir == D3Q27System::BS || sendDir == D3Q27System::BN || sendDir == D3Q27System::TS + if (!(sendDir == D3Q27System::DIR_P00 || sendDir == D3Q27System::DIR_M00 || sendDir == D3Q27System::DIR_0P0 || + sendDir == D3Q27System::DIR_0M0 || sendDir == D3Q27System::DIR_00P || sendDir == D3Q27System::DIR_00M || + sendDir == D3Q27System::DIR_PP0 || sendDir == D3Q27System::DIR_MM0 || sendDir == D3Q27System::DIR_PM0 || + sendDir == D3Q27System::DIR_MP0 || sendDir == D3Q27System::DIR_P0P || sendDir == D3Q27System::DIR_M0M || + sendDir == D3Q27System::DIR_P0M || sendDir == D3Q27System::DIR_M0P || sendDir == D3Q27System::DIR_0PP || + sendDir == D3Q27System::DIR_0MM || sendDir == D3Q27System::DIR_0PM || sendDir == D3Q27System::DIR_0MP - || sendDir == D3Q27System::TNE || sendDir == D3Q27System::TNW || sendDir == D3Q27System::TSE || - sendDir == D3Q27System::TSW || sendDir == D3Q27System::BNE || sendDir == D3Q27System::BNW || - sendDir == D3Q27System::BSE || sendDir == D3Q27System::BSW + || sendDir == D3Q27System::DIR_PPP || sendDir == D3Q27System::DIR_MPP || sendDir == D3Q27System::DIR_PMP || + sendDir == D3Q27System::DIR_MMP || sendDir == D3Q27System::DIR_PPM || sendDir == D3Q27System::DIR_MPM || + sendDir == D3Q27System::DIR_PMM || sendDir == D3Q27System::DIR_MMM )) { throw UbException(UB_EXARGS, "invalid constructor for this direction"); @@ -235,44 +235,44 @@ void FineToCoarseVectorConnector<VectorTransmitter>::init() int iCellSize = 1; // size of interpolation cell switch (this->sendDir) { - case E: - case W: + case DIR_P00: + case DIR_M00: sendSize = (bMaxX2 - 1) / 2 * (bMaxX3 - 1) / 2 * sendDataPerNode * iCellSize; break; - case N: - case S: + case DIR_0P0: + case DIR_0M0: sendSize = (bMaxX1 - 1) / 2 * (bMaxX3 - 1) / 2 * sendDataPerNode * iCellSize; break; - case T: - case B: + case DIR_00P: + case DIR_00M: sendSize = (bMaxX1 - 1) / 2 * (bMaxX2 - 1) / 2 * sendDataPerNode * iCellSize; break; - case NE: - case SW: - case SE: - case NW: + case DIR_PP0: + case DIR_MM0: + case DIR_PM0: + case DIR_MP0: sendSize = (3 * bMaxX3 - 3) * sendDataPerNode * iCellSize; break; // buffer overhead, should be (3*bMaxX3-6) for even bMax3 - case TE: - case BW: - case BE: - case TW: + case DIR_P0P: + case DIR_M0M: + case DIR_P0M: + case DIR_M0P: sendSize = (3 * bMaxX2 - 3) * sendDataPerNode * iCellSize; break; - case TN: - case BS: - case BN: - case TS: + case DIR_0PP: + case DIR_0MM: + case DIR_0PM: + case DIR_0MP: sendSize = (3 * bMaxX1 - 3) * sendDataPerNode * iCellSize; break; - case TNE: - case TNW: - case TSE: - case TSW: - case BNE: - case BNW: - case BSE: - case BSW: + case DIR_PPP: + case DIR_MPP: + case DIR_PMP: + case DIR_MMP: + case DIR_PPM: + case DIR_MPM: + case DIR_PMM: + case DIR_MMM: sendSize = 3 * (3 * bMaxX1 - 3) * sendDataPerNode * iCellSize; break; default: @@ -321,42 +321,42 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() ////////////// switch (sendDir) { - case E: + case DIR_P00: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX1 = maxX1 - 7; lMaxX1 = lMinX1 + 1; fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case W: + case DIR_M00: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX1 = 5; lMaxX1 = lMinX1 + 1; fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case N: + case DIR_0P0: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX2 = maxX2 - 7; lMaxX2 = lMinX2 + 1; fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case S: + case DIR_0M0: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX2 = 5; lMaxX2 = lMinX2 + 1; fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case T: + case DIR_00P: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX3 = maxX3 - 7; lMaxX3 = lMinX3 + 1; fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case B: + case DIR_00M: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX3 = 5; @@ -365,7 +365,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() break; // ////N-S-E-W - case NE: + case DIR_PP0: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX1 = maxX1 - 7; @@ -380,7 +380,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() lMaxX2 = lMinX2 + 5; fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case SW: + case DIR_MM0: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); @@ -397,7 +397,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case SE: + case DIR_PM0: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX1 = maxX1 - 7; @@ -414,7 +414,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() break; - case NW: + case DIR_MP0: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX1 = 1; @@ -430,7 +430,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; //////T-B-E-W - case TE: + case DIR_P0P: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX1 = maxX1 - 7; @@ -446,7 +446,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case BW: + case DIR_M0M: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX1 = 1; @@ -462,7 +462,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case BE: + case DIR_P0M: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX1 = maxX1 - 7; @@ -478,7 +478,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case TW: + case DIR_M0P: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX1 = 1; @@ -495,7 +495,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() break; ///////////////T-B-N-S // - case TN: + case DIR_0PP: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX2 = maxX2 - 7; @@ -511,7 +511,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case BS: + case DIR_0MM: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX2 = 1; @@ -527,7 +527,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case BN: + case DIR_0PM: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX2 = maxX2 - 7; @@ -543,7 +543,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() fillSendVector(fFrom, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case TS: + case DIR_0MP: getLocalMinMax(lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3); getLocalMins(lMinX1, lMinX2, lMinX3, oMinX1, oMinX2, oMinX3); lMinX2 = 1; @@ -560,7 +560,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() break; // TNE - case TNE: + case DIR_PPP: lMinX1 = maxX1 - 7; lMaxX1 = maxX1 - 6; lMinX2 = maxX2 - 7; @@ -587,7 +587,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() break; // TNW - case TNW: + case DIR_MPP: lMinX1 = 5; lMaxX1 = 6; lMinX2 = maxX2 - 7; @@ -616,7 +616,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() break; // TSE - case TSE: + case DIR_PMP: lMinX1 = maxX1 - 7; lMaxX1 = maxX1 - 6; lMinX2 = 1; @@ -643,7 +643,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() break; // TSW - case TSW: + case DIR_MMP: lMinX1 = 5; lMaxX1 = 6; lMinX2 = 1; @@ -670,7 +670,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() break; // BNE - case BNE: + case DIR_PPM: lMinX1 = maxX1 - 7; lMaxX1 = maxX1 - 6; lMinX2 = maxX2 - 7; @@ -697,7 +697,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() break; // BNW - case BNW: + case DIR_MPM: lMinX1 = 5; lMaxX1 = 6; lMinX2 = maxX2 - 7; @@ -725,7 +725,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() break; // BSE - case BSE: + case DIR_PMM: lMinX1 = maxX1 - 7; lMaxX1 = maxX1 - 6; lMinX2 = 1; @@ -753,7 +753,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::fillSendVectors() break; // BSW - case BSW: + case DIR_MMM: lMinX1 = 5; lMaxX1 = 6; lMinX2 = 1; @@ -869,42 +869,42 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() lMaxX3 = maxX3 - 1; switch (sendDir) { - case E: + case DIR_P00: lMinX1 = maxX1 - 4; lMaxX1 = lMinX1 + 1; getLocalMinMaxCF(maxX2, lMinX2, lMaxX2); getLocalMinMaxCF(maxX3, lMinX3, lMaxX3); distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case W: + case DIR_M00: lMinX1 = 2; lMaxX1 = lMinX1 + 1; getLocalMinMaxCF(maxX2, lMinX2, lMaxX2); getLocalMinMaxCF(maxX3, lMinX3, lMaxX3); distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case N: + case DIR_0P0: lMinX2 = maxX2 - 4; lMaxX2 = lMinX2 + 1; getLocalMinMaxCF(maxX1, lMinX1, lMaxX1); getLocalMinMaxCF(maxX3, lMinX3, lMaxX3); distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case S: + case DIR_0M0: lMinX2 = 2; lMaxX2 = lMinX2 + 1; getLocalMinMaxCF(maxX1, lMinX1, lMaxX1); getLocalMinMaxCF(maxX3, lMinX3, lMaxX3); distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case T: + case DIR_00P: lMinX3 = maxX3 - 4; lMaxX3 = lMinX3 + 1; getLocalMinMaxCF(maxX1, lMinX1, lMaxX1); getLocalMinMaxCF(maxX2, lMinX2, lMaxX2); distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case B: + case DIR_00M: lMinX3 = 2; lMaxX3 = lMinX3 + 1; getLocalMinMaxCF(maxX1, lMinX1, lMaxX1); @@ -913,7 +913,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; /////E-W-N-S - case NE: + case DIR_PP0: lMinX1 = maxX1 - 4; lMaxX1 = lMinX1 + 3; lMinX2 = maxX2 - 4; @@ -922,7 +922,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case SW: + case DIR_MM0: lMinX1 = 0; lMaxX1 = lMinX1 + 3; lMinX2 = 0; @@ -931,7 +931,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case SE: + case DIR_PM0: lMinX1 = maxX1 - 4; lMaxX1 = lMinX1 + 3; lMinX2 = 0; @@ -940,7 +940,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case NW: + case DIR_MP0: lMinX1 = 0; lMaxX1 = lMinX1 + 3; lMinX2 = maxX2 - 4; @@ -950,7 +950,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; // // /////T-B-E-W - case TE: + case DIR_P0P: lMinX1 = maxX1 - 4; lMaxX1 = lMinX1 + 3; lMinX3 = maxX3 - 4; @@ -959,7 +959,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case BW: + case DIR_M0M: lMinX1 = 0; lMaxX1 = lMinX1 + 3; lMinX3 = 0; @@ -968,7 +968,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case BE: + case DIR_P0M: lMinX1 = maxX1 - 4; lMaxX1 = lMinX1 + 3; lMinX3 = 0; @@ -977,7 +977,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case TW: + case DIR_M0P: lMinX1 = 0; lMaxX1 = lMinX1 + 3; lMinX3 = maxX3 - 4; @@ -988,7 +988,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() // ////////////////T-B-N-S // - case TN: + case DIR_0PP: lMinX2 = maxX2 - 4; lMaxX2 = lMinX2 + 3; lMinX3 = maxX3 - 4; @@ -997,7 +997,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case BS: + case DIR_0MM: lMinX2 = 0; lMaxX2 = lMinX2 + 3; lMinX3 = 0; @@ -1006,7 +1006,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case BN: + case DIR_0PM: lMinX2 = maxX2 - 4; lMaxX2 = lMinX2 + 3; lMinX3 = 0; @@ -1015,7 +1015,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; - case TS: + case DIR_0MP: lMinX2 = 0; lMaxX2 = lMinX2 + 3; lMinX3 = maxX3 - 4; @@ -1025,7 +1025,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() break; // //TNE - case TNE: + case DIR_PPP: lMinX1 = maxX1 - 4; lMaxX1 = maxX1 - 1; lMinX2 = maxX2 - 4; @@ -1035,7 +1035,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; // TNW - case TNW: + case DIR_MPP: lMinX1 = 0; lMaxX1 = 3; lMinX2 = maxX2 - 4; @@ -1045,7 +1045,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; // TSE - case TSE: + case DIR_PMP: lMinX1 = maxX1 - 4; lMaxX1 = maxX1 - 1; lMinX2 = 0; @@ -1055,7 +1055,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; // TSW - case TSW: + case DIR_MMP: lMinX1 = 0; lMaxX1 = 3; lMinX2 = 0; @@ -1065,7 +1065,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; // BNE - case BNE: + case DIR_PPM: lMinX1 = maxX1 - 4; lMaxX1 = maxX1 - 1; lMinX2 = maxX2 - 4; @@ -1075,7 +1075,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; // BNW - case BNW: + case DIR_MPM: lMinX1 = 0; lMaxX1 = 3; lMinX2 = maxX2 - 4; @@ -1085,7 +1085,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; // BSE - case BSE: + case DIR_PMM: lMinX1 = maxX1 - 4; lMaxX1 = maxX1 - 1; lMinX2 = 0; @@ -1095,7 +1095,7 @@ void FineToCoarseVectorConnector<VectorTransmitter>::distributeReceiveVectors() distributeReceiveVector(fTo, lMinX1, lMinX2, lMinX3, lMaxX1, lMaxX2, lMaxX3, data, index); break; // BSW - case BSW: + case DIR_MMM: lMinX1 = 0; lMaxX1 = 3; lMinX2 = 0; @@ -1163,56 +1163,56 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, int TmaxX2 = maxX2; int TmaxX3 = maxX3; - if (block.lock()->hasInterpolationFlagFC(E)) { + if (block.lock()->hasInterpolationFlagFC(DIR_P00)) { if (maxX1 == TmaxX1) maxX1 -= 3; } - if (block.lock()->hasInterpolationFlagFC(W)) { + if (block.lock()->hasInterpolationFlagFC(DIR_M00)) { if (minX1 == TminX1) minX1 += 4; } - if (block.lock()->hasInterpolationFlagFC(N)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0P0)) { if (maxX2 == TmaxX2) maxX2 -= 3; } - if (block.lock()->hasInterpolationFlagFC(S)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0M0)) { if (minX2 == TminX2) minX2 += 4; } - if (block.lock()->hasInterpolationFlagFC(T)) { + if (block.lock()->hasInterpolationFlagFC(DIR_00P)) { if (maxX3 == TmaxX3) maxX3 -= 3; } - if (block.lock()->hasInterpolationFlagFC(B)) { + if (block.lock()->hasInterpolationFlagFC(DIR_00M)) { if (minX3 == TminX3) minX3 += 4; } //////////// /////E-W-N-S - if (block.lock()->hasInterpolationFlagFC(NE) && !block.lock()->hasInterpolationFlagFC(N) && - !block.lock()->hasInterpolationFlagFC(E)) { + if (block.lock()->hasInterpolationFlagFC(DIR_PP0) && !block.lock()->hasInterpolationFlagFC(DIR_0P0) && + !block.lock()->hasInterpolationFlagFC(DIR_P00)) { if (maxX1 == TmaxX1) maxX1 -= 3; if (maxX2 == TmaxX2) maxX2 -= 3; } - if (block.lock()->hasInterpolationFlagFC(SW) && !block.lock()->hasInterpolationFlagFC(W) && - !block.lock()->hasInterpolationFlagFC(S)) { + if (block.lock()->hasInterpolationFlagFC(DIR_MM0) && !block.lock()->hasInterpolationFlagFC(DIR_M00) && + !block.lock()->hasInterpolationFlagFC(DIR_0M0)) { if (minX1 == TminX1) minX1 += 4; if (minX2 == TminX2) minX2 += 4; } - if (block.lock()->hasInterpolationFlagFC(SE) && !block.lock()->hasInterpolationFlagFC(E) && - !block.lock()->hasInterpolationFlagFC(S)) { + if (block.lock()->hasInterpolationFlagFC(DIR_PM0) && !block.lock()->hasInterpolationFlagFC(DIR_P00) && + !block.lock()->hasInterpolationFlagFC(DIR_0M0)) { if (maxX1 == TmaxX1) maxX1 -= 3; if (minX2 == TminX2) minX2 += 4; } - if (block.lock()->hasInterpolationFlagFC(NW) && !block.lock()->hasInterpolationFlagFC(N) && - !block.lock()->hasInterpolationFlagFC(W)) { + if (block.lock()->hasInterpolationFlagFC(DIR_MP0) && !block.lock()->hasInterpolationFlagFC(DIR_0P0) && + !block.lock()->hasInterpolationFlagFC(DIR_M00)) { if (minX1 == TminX1) minX1 += 4; if (maxX2 == TmaxX2) @@ -1220,29 +1220,29 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } //////T-B-E-W - if (block.lock()->hasInterpolationFlagFC(TE) && !block.lock()->hasInterpolationFlagFC(E) && - !block.lock()->hasInterpolationFlagFC(T)) { + if (block.lock()->hasInterpolationFlagFC(DIR_P0P) && !block.lock()->hasInterpolationFlagFC(DIR_P00) && + !block.lock()->hasInterpolationFlagFC(DIR_00P)) { if (maxX1 == TmaxX1) maxX1 -= 3; if (maxX3 == TmaxX3) maxX3 -= 3; } - if (block.lock()->hasInterpolationFlagFC(BW) && !block.lock()->hasInterpolationFlagFC(W) && - !block.lock()->hasInterpolationFlagFC(B)) { + if (block.lock()->hasInterpolationFlagFC(DIR_M0M) && !block.lock()->hasInterpolationFlagFC(DIR_M00) && + !block.lock()->hasInterpolationFlagFC(DIR_00M)) { if (minX1 == TminX1) minX1 += 4; if (minX3 == TminX3) minX3 += 4; } - if (block.lock()->hasInterpolationFlagFC(BE) && !block.lock()->hasInterpolationFlagFC(E) && - !block.lock()->hasInterpolationFlagFC(B)) { + if (block.lock()->hasInterpolationFlagFC(DIR_P0M) && !block.lock()->hasInterpolationFlagFC(DIR_P00) && + !block.lock()->hasInterpolationFlagFC(DIR_00M)) { if (maxX1 == TmaxX1) maxX1 -= 3; if (minX3 == TminX3) minX3 += 4; } - if (block.lock()->hasInterpolationFlagFC(TW) && !block.lock()->hasInterpolationFlagFC(W) && - !block.lock()->hasInterpolationFlagFC(T)) { + if (block.lock()->hasInterpolationFlagFC(DIR_M0P) && !block.lock()->hasInterpolationFlagFC(DIR_M00) && + !block.lock()->hasInterpolationFlagFC(DIR_00P)) { if (minX1 == TminX1) minX1 += 4; if (maxX3 == TmaxX3) @@ -1250,29 +1250,29 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } ////T-B-N-S - if (block.lock()->hasInterpolationFlagFC(TN) && !block.lock()->hasInterpolationFlagFC(N) && - !block.lock()->hasInterpolationFlagFC(T)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0PP) && !block.lock()->hasInterpolationFlagFC(DIR_0P0) && + !block.lock()->hasInterpolationFlagFC(DIR_00P)) { if (maxX2 == TmaxX2) maxX2 -= 3; if (maxX3 == TmaxX3) maxX3 -= 3; } - if (block.lock()->hasInterpolationFlagFC(BS) && !block.lock()->hasInterpolationFlagFC(S) && - !block.lock()->hasInterpolationFlagFC(B)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0MM) && !block.lock()->hasInterpolationFlagFC(DIR_0M0) && + !block.lock()->hasInterpolationFlagFC(DIR_00M)) { if (minX2 == TminX2) minX2 += 4; if (minX3 == TminX3) minX3 += 4; } - if (block.lock()->hasInterpolationFlagFC(BN) && !block.lock()->hasInterpolationFlagFC(N) && - !block.lock()->hasInterpolationFlagFC(B)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0PM) && !block.lock()->hasInterpolationFlagFC(DIR_0P0) && + !block.lock()->hasInterpolationFlagFC(DIR_00M)) { if (maxX2 == TmaxX2) maxX2 -= 3; if (minX3 == TminX3) minX3 += 4; } - if (block.lock()->hasInterpolationFlagFC(TS) && !block.lock()->hasInterpolationFlagFC(S) && - !block.lock()->hasInterpolationFlagFC(T)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0MP) && !block.lock()->hasInterpolationFlagFC(DIR_0M0) && + !block.lock()->hasInterpolationFlagFC(DIR_00P)) { if (minX2 == TminX2) minX2 += 4; if (maxX3 == TmaxX3) @@ -1280,10 +1280,10 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } // if - // (block.lock()->hasInterpolationFlagFC(D3Q27System::TNE)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::TE)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::TN)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::NE)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::T)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::N) - // && !block.lock()->hasInterpolationFlagFC(D3Q27System::E)) if - // (!block.lock()->hasInterpolationFlagFC(D3Q27System::TE)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::T) && - // !block.lock()->hasInterpolationFlagFC(D3Q27System::E)) + // (block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_PPP)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_P0P)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_0PP)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_PP0)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_00P)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_0P0) + // && !block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_P00)) if + // (!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_P0P)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_00P) && + // !block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_P00)) //{ // if (maxX1==TmaxX1) maxX1 -= 3; // if (maxX2==TmaxX2) maxX2 -= 3; @@ -1304,56 +1304,56 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, int TmaxX2 = maxX2; int TmaxX3 = maxX3; - if (block.lock()->hasInterpolationFlagFC(E)) { + if (block.lock()->hasInterpolationFlagFC(DIR_P00)) { if (maxX1 == TmaxX1) maxX1 -= 3; } - if (block.lock()->hasInterpolationFlagFC(W)) { + if (block.lock()->hasInterpolationFlagFC(DIR_M00)) { if (minX1 == TminX1) minX1 += 4; } - if (block.lock()->hasInterpolationFlagFC(N)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0P0)) { if (maxX2 == TmaxX2) maxX2 -= 3; } - if (block.lock()->hasInterpolationFlagFC(S)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0M0)) { if (minX2 == TminX2) minX2 += 4; } - if (block.lock()->hasInterpolationFlagFC(T)) { + if (block.lock()->hasInterpolationFlagFC(DIR_00P)) { if (maxX3 == TmaxX3) maxX3 -= 3; } - if (block.lock()->hasInterpolationFlagFC(B)) { + if (block.lock()->hasInterpolationFlagFC(DIR_00M)) { if (minX3 == TminX3) minX3 += 4; } //////////// /////E-W-N-S - if (block.lock()->hasInterpolationFlagFC(NE) && !block.lock()->hasInterpolationFlagFC(N) && - !block.lock()->hasInterpolationFlagFC(E)) { + if (block.lock()->hasInterpolationFlagFC(DIR_PP0) && !block.lock()->hasInterpolationFlagFC(DIR_0P0) && + !block.lock()->hasInterpolationFlagFC(DIR_P00)) { if (maxX1 == TmaxX1) maxX1 -= 3; if (maxX2 == TmaxX2) maxX2 -= 3; } - if (block.lock()->hasInterpolationFlagFC(SW) && !block.lock()->hasInterpolationFlagFC(W) && - !block.lock()->hasInterpolationFlagFC(S)) { + if (block.lock()->hasInterpolationFlagFC(DIR_MM0) && !block.lock()->hasInterpolationFlagFC(DIR_M00) && + !block.lock()->hasInterpolationFlagFC(DIR_0M0)) { if (minX1 == TminX1) minX1 += 4; if (minX2 == TminX2) minX2 += 4; } - if (block.lock()->hasInterpolationFlagFC(SE) && !block.lock()->hasInterpolationFlagFC(E) && - !block.lock()->hasInterpolationFlagFC(S)) { + if (block.lock()->hasInterpolationFlagFC(DIR_PM0) && !block.lock()->hasInterpolationFlagFC(DIR_P00) && + !block.lock()->hasInterpolationFlagFC(DIR_0M0)) { if (maxX1 == TmaxX1) maxX1 -= 3; if (minX2 == TminX2) minX2 += 4; } - if (block.lock()->hasInterpolationFlagFC(NW) && !block.lock()->hasInterpolationFlagFC(N) && - !block.lock()->hasInterpolationFlagFC(W)) { + if (block.lock()->hasInterpolationFlagFC(DIR_MP0) && !block.lock()->hasInterpolationFlagFC(DIR_0P0) && + !block.lock()->hasInterpolationFlagFC(DIR_M00)) { if (minX1 == TminX1) minX1 += 4; if (maxX2 == TmaxX2) @@ -1361,29 +1361,29 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } //////T-B-E-W - if (block.lock()->hasInterpolationFlagFC(TE) && !block.lock()->hasInterpolationFlagFC(E) && - !block.lock()->hasInterpolationFlagFC(T)) { + if (block.lock()->hasInterpolationFlagFC(DIR_P0P) && !block.lock()->hasInterpolationFlagFC(DIR_P00) && + !block.lock()->hasInterpolationFlagFC(DIR_00P)) { if (maxX1 == TmaxX1) maxX1 -= 3; if (maxX3 == TmaxX3) maxX3 -= 3; } - if (block.lock()->hasInterpolationFlagFC(BW) && !block.lock()->hasInterpolationFlagFC(W) && - !block.lock()->hasInterpolationFlagFC(B)) { + if (block.lock()->hasInterpolationFlagFC(DIR_M0M) && !block.lock()->hasInterpolationFlagFC(DIR_M00) && + !block.lock()->hasInterpolationFlagFC(DIR_00M)) { if (minX1 == TminX1) minX1 += 4; if (minX3 == TminX3) minX3 += 4; } - if (block.lock()->hasInterpolationFlagFC(BE) && !block.lock()->hasInterpolationFlagFC(E) && - !block.lock()->hasInterpolationFlagFC(B)) { + if (block.lock()->hasInterpolationFlagFC(DIR_P0M) && !block.lock()->hasInterpolationFlagFC(DIR_P00) && + !block.lock()->hasInterpolationFlagFC(DIR_00M)) { if (maxX1 == TmaxX1) maxX1 -= 3; if (minX3 == TminX3) minX3 += 4; } - if (block.lock()->hasInterpolationFlagFC(TW) && !block.lock()->hasInterpolationFlagFC(W) && - !block.lock()->hasInterpolationFlagFC(T)) { + if (block.lock()->hasInterpolationFlagFC(DIR_M0P) && !block.lock()->hasInterpolationFlagFC(DIR_M00) && + !block.lock()->hasInterpolationFlagFC(DIR_00P)) { if (minX1 == TminX1) minX1 += 4; if (maxX3 == TmaxX3) @@ -1391,29 +1391,29 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } ////T-B-N-S - if (block.lock()->hasInterpolationFlagFC(TN) && !block.lock()->hasInterpolationFlagFC(N) && - !block.lock()->hasInterpolationFlagFC(T)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0PP) && !block.lock()->hasInterpolationFlagFC(DIR_0P0) && + !block.lock()->hasInterpolationFlagFC(DIR_00P)) { if (maxX2 == TmaxX2) maxX2 -= 3; if (maxX3 == TmaxX3) maxX3 -= 3; } - if (block.lock()->hasInterpolationFlagFC(BS) && !block.lock()->hasInterpolationFlagFC(S) && - !block.lock()->hasInterpolationFlagFC(B)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0MM) && !block.lock()->hasInterpolationFlagFC(DIR_0M0) && + !block.lock()->hasInterpolationFlagFC(DIR_00M)) { if (minX2 == TminX2) minX2 += 4; if (minX3 == TminX3) minX3 += 4; } - if (block.lock()->hasInterpolationFlagFC(BN) && !block.lock()->hasInterpolationFlagFC(N) && - !block.lock()->hasInterpolationFlagFC(B)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0PM) && !block.lock()->hasInterpolationFlagFC(DIR_0P0) && + !block.lock()->hasInterpolationFlagFC(DIR_00M)) { if (maxX2 == TmaxX2) maxX2 -= 3; if (minX3 == TminX3) minX3 += 4; } - if (block.lock()->hasInterpolationFlagFC(TS) && !block.lock()->hasInterpolationFlagFC(S) && - !block.lock()->hasInterpolationFlagFC(T)) { + if (block.lock()->hasInterpolationFlagFC(DIR_0MP) && !block.lock()->hasInterpolationFlagFC(DIR_0M0) && + !block.lock()->hasInterpolationFlagFC(DIR_00P)) { if (minX2 == TminX2) minX2 += 4; if (maxX3 == TmaxX3) @@ -1421,8 +1421,8 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMinMax(int &minX1, } // if - // (block.lock()->hasInterpolationFlagFC(D3Q27System::TNE)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::TE)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::TN)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::NE)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::T)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::N) - // && !block.lock()->hasInterpolationFlagFC(D3Q27System::E)) + // (block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_PPP)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_P0P)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_0PP)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_PP0)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_00P)&&!block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_0P0) + // && !block.lock()->hasInterpolationFlagFC(D3Q27System::DIR_P00)) //{ // if (maxX1==TmaxX1) maxX1 -= 3; // if (maxX2==TmaxX2) maxX2 -= 3; @@ -1448,8 +1448,8 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMins(int &minX1, in using namespace D3Q27System; switch (sendDir) { - case E: - case W: + case DIR_P00: + case DIR_M00: if (connType == OddEvenSE) minX2 += oMinX2; if (connType == OddOddNE) { @@ -1459,8 +1459,8 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMins(int &minX1, in if (connType == EvenOddNW) minX3 += oMinX3; break; - case N: - case S: + case DIR_0P0: + case DIR_0M0: if (connType == OddEvenSE) minX1 += oMinX1; if (connType == OddOddNE) { @@ -1470,8 +1470,8 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMins(int &minX1, in if (connType == EvenOddNW) minX3 += oMinX3; break; - case T: - case B: + case DIR_00P: + case DIR_00M: if (connType == OddEvenSE) minX1 += oMinX1; if (connType == OddOddNE) { @@ -1483,10 +1483,10 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMins(int &minX1, in break; ///// - case NE: - case SW: - case SE: - case NW: + case DIR_PP0: + case DIR_MM0: + case DIR_PM0: + case DIR_MP0: // case SW: if (connType == OddEvenSE) // minX2 += oMinX2; @@ -1499,10 +1499,10 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMins(int &minX1, in break; ////// - case TE: - case BW: - case BE: - case TW: + case DIR_P0P: + case DIR_M0M: + case DIR_P0M: + case DIR_M0P: if (connType == OddEvenSE) // minX1 += oMinX1; if (connType == OddOddNE) { @@ -1514,10 +1514,10 @@ void FineToCoarseVectorConnector<VectorTransmitter>::getLocalMins(int &minX1, in break; // ////// - case TN: - case BS: - case BN: - case TS: + case DIR_0PP: + case DIR_0MM: + case DIR_0PM: + case DIR_0MP: if (connType == OddEvenSE) minX1 += oMinX1; if (connType == OddOddNE) { diff --git a/src/cpu/VirtualFluidsCore/Connectors/FullDirectConnector.cpp b/src/cpu/VirtualFluidsCore/Connectors/FullDirectConnector.cpp index 858921de452937158c620011889707f9560f09b9..18a8319589cde954b7c2202e10f3eda61b435671 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/FullDirectConnector.cpp +++ b/src/cpu/VirtualFluidsCore/Connectors/FullDirectConnector.cpp @@ -60,7 +60,7 @@ void FullDirectConnector::sendVectors() void FullDirectConnector::exchangeData() { // EAST - if (sendDir == D3Q27System::E) { + if (sendDir == D3Q27System::DIR_P00) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x2 = 1; x2 < maxX2; x2++) { exchangeData(maxX1 - 1, x2, x3, 0, x2, x3); @@ -68,7 +68,7 @@ void FullDirectConnector::exchangeData() } } // WEST - else if (sendDir == D3Q27System::W) { + else if (sendDir == D3Q27System::DIR_M00) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x2 = 1; x2 < maxX2; x2++) { exchangeData(1, x2, x3, maxX1, x2, x3); @@ -76,7 +76,7 @@ void FullDirectConnector::exchangeData() } } // NORTH - else if (sendDir == D3Q27System::N) { + else if (sendDir == D3Q27System::DIR_0P0) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x1 = 1; x1 < maxX1; x1++) { exchangeData(x1, maxX2 - 1, x3, x1, 0, x3); @@ -84,7 +84,7 @@ void FullDirectConnector::exchangeData() } } // SOUTH - else if (sendDir == D3Q27System::S) { + else if (sendDir == D3Q27System::DIR_0M0) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x1 = 1; x1 < maxX1; x1++) { exchangeData(x1, 1, x3, x1, maxX2, x3); @@ -93,7 +93,7 @@ void FullDirectConnector::exchangeData() } // TOP - else if (sendDir == D3Q27System::T) { + else if (sendDir == D3Q27System::DIR_00P) { for (int x2 = 1; x2 < maxX2; x2++) { for (int x1 = 1; x1 < maxX1; x1++) { exchangeData(x1, x2, maxX3 - 1, x1, x2, 0); @@ -101,7 +101,7 @@ void FullDirectConnector::exchangeData() } } // BOTTOM - else if (sendDir == D3Q27System::B) { + else if (sendDir == D3Q27System::DIR_00M) { for (int x2 = 1; x2 < maxX2; x2++) { for (int x1 = 1; x1 < maxX1; x1++) { exchangeData(x1, x2, 1, x1, x2, maxX3); @@ -109,77 +109,77 @@ void FullDirectConnector::exchangeData() } } // NORTHEAST - else if (sendDir == D3Q27System::NE) { + else if (sendDir == D3Q27System::DIR_PP0) { for (int x3 = 1; x3 < maxX3; x3++) { exchangeData(maxX1 - 1, maxX2 - 1, x3, 0, 0, x3); } } // NORTHWEST - else if (sendDir == D3Q27System::NW) { + else if (sendDir == D3Q27System::DIR_MP0) { for (int x3 = 1; x3 < maxX3; x3++) { exchangeData(1, maxX2 - 1, x3, maxX1, 0, x3); } } // SOUTHWEST - else if (sendDir == D3Q27System::SW) { + else if (sendDir == D3Q27System::DIR_MM0) { for (int x3 = 1; x3 < maxX3; x3++) { exchangeData(1, 1, x3, maxX1, maxX2, x3); } } // SOUTHEAST - else if (sendDir == D3Q27System::SE) { + else if (sendDir == D3Q27System::DIR_PM0) { for (int x3 = 1; x3 < maxX3; x3++) { exchangeData(maxX1 - 1, 1, x3, 0, maxX2, x3); } - } else if (sendDir == D3Q27System::TE) + } else if (sendDir == D3Q27System::DIR_P0P) for (int x2 = 1; x2 < maxX2; x2++) { exchangeData(maxX1 - 1, x2, maxX3 - 1, 0, x2, 0); } - else if (sendDir == D3Q27System::BW) + else if (sendDir == D3Q27System::DIR_M0M) for (int x2 = 1; x2 < maxX2; x2++) { exchangeData(1, x2, 1, maxX1, x2, maxX3); } - else if (sendDir == D3Q27System::BE) + else if (sendDir == D3Q27System::DIR_P0M) for (int x2 = 1; x2 < maxX2; x2++) { exchangeData(maxX1 - 1, x2, 1, 0, x2, maxX3); } - else if (sendDir == D3Q27System::TW) + else if (sendDir == D3Q27System::DIR_M0P) for (int x2 = 1; x2 < maxX2; x2++) { exchangeData(1, x2, maxX3 - 1, maxX1, x2, 0); } - else if (sendDir == D3Q27System::TN) + else if (sendDir == D3Q27System::DIR_0PP) for (int x1 = 1; x1 < maxX1; x1++) { exchangeData(x1, maxX2 - 1, maxX3 - 1, x1, 0, 0); } - else if (sendDir == D3Q27System::BS) + else if (sendDir == D3Q27System::DIR_0MM) for (int x1 = 1; x1 < maxX1; x1++) { exchangeData(x1, 1, 1, x1, maxX2, maxX3); } - else if (sendDir == D3Q27System::BN) + else if (sendDir == D3Q27System::DIR_0PM) for (int x1 = 1; x1 < maxX1; x1++) { exchangeData(x1, maxX2 - 1, 1, x1, 0, maxX3); } - else if (sendDir == D3Q27System::TS) + else if (sendDir == D3Q27System::DIR_0MP) for (int x1 = 1; x1 < maxX1; x1++) { exchangeData(x1, 1, maxX3 - 1, x1, maxX2, 0); } - else if (sendDir == D3Q27System::TSW) { + else if (sendDir == D3Q27System::DIR_MMP) { exchangeData(1, 1, maxX3 - 1, maxX1, maxX2, 0); - } else if (sendDir == D3Q27System::TSE) { + } else if (sendDir == D3Q27System::DIR_PMP) { exchangeData(maxX1 - 1, 1, maxX3 - 1, 0, maxX2, 0); - } else if (sendDir == D3Q27System::TNW) { + } else if (sendDir == D3Q27System::DIR_MPP) { exchangeData(1, maxX2 - 1, maxX3 - 1, maxX1, 0, 0); - } else if (sendDir == D3Q27System::TNE) { + } else if (sendDir == D3Q27System::DIR_PPP) { exchangeData(maxX1 - 1, maxX2 - 1, maxX3 - 1, 0, 0, 0); - } else if (sendDir == D3Q27System::BSW) { + } else if (sendDir == D3Q27System::DIR_MMM) { exchangeData(1, 1, 1, maxX1, maxX2, maxX3); - } else if (sendDir == D3Q27System::BSE) { + } else if (sendDir == D3Q27System::DIR_PMM) { exchangeData(maxX1 - 1, 1, 1, 0, maxX2, maxX3); - } else if (sendDir == D3Q27System::BNW) { + } else if (sendDir == D3Q27System::DIR_MPM) { exchangeData(1, maxX2 - 1, 1, maxX1, 0, maxX3); - } else if (sendDir == D3Q27System::BNE) { + } else if (sendDir == D3Q27System::DIR_PPM) { exchangeData(maxX1 - 1, maxX2 - 1, 1, 0, 0, maxX3); } else UB_THROW(UbException(UB_EXARGS, "unknown dir")); diff --git a/src/cpu/VirtualFluidsCore/Connectors/FullVectorConnector.cpp b/src/cpu/VirtualFluidsCore/Connectors/FullVectorConnector.cpp index ccbd62c2ff247bb2b02f478974c40592b693ce20..d5b810015abc1172699b7489df4ea0aee8b02fe2 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/FullVectorConnector.cpp +++ b/src/cpu/VirtualFluidsCore/Connectors/FullVectorConnector.cpp @@ -63,7 +63,7 @@ void FullVectorConnector::fillData() int index = 0; // EAST - if (sendDir == D3Q27System::E) { + if (sendDir == D3Q27System::DIR_P00) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x2 = 1; x2 < maxX2; x2++) { fillData(sdata, index, maxX1 - 1, x2, x3); @@ -71,7 +71,7 @@ void FullVectorConnector::fillData() } } // WEST - else if (sendDir == D3Q27System::W) { + else if (sendDir == D3Q27System::DIR_M00) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x2 = 1; x2 < maxX2; x2++) { fillData(sdata, index, 1, x2, x3); @@ -79,7 +79,7 @@ void FullVectorConnector::fillData() } } // NORTH - else if (sendDir == D3Q27System::N) { + else if (sendDir == D3Q27System::DIR_0P0) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x1 = 1; x1 < maxX1; x1++) { fillData(sdata, index, x1, maxX2 - 1, x3); @@ -87,7 +87,7 @@ void FullVectorConnector::fillData() } } // SOUTH - else if (sendDir == D3Q27System::S) { + else if (sendDir == D3Q27System::DIR_0M0) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x1 = 1; x1 < maxX1; x1++) { fillData(sdata, index, x1, 1, x3); @@ -95,7 +95,7 @@ void FullVectorConnector::fillData() } } // TOP - else if (sendDir == D3Q27System::T) { + else if (sendDir == D3Q27System::DIR_00P) { for (int x2 = 1; x2 < maxX2; x2++) { for (int x1 = 1; x1 < maxX1; x1++) { fillData(sdata, index, x1, x2, maxX3 - 1); @@ -103,7 +103,7 @@ void FullVectorConnector::fillData() } } // BOTTOM - else if (sendDir == D3Q27System::B) { + else if (sendDir == D3Q27System::DIR_00M) { for (int x2 = 1; x2 < maxX2; x2++) { for (int x1 = 1; x1 < maxX1; x1++) { fillData(sdata, index, x1, x2, 1); @@ -111,24 +111,24 @@ void FullVectorConnector::fillData() } } // NE NW SW SE - else if (sendDir == D3Q27System::NE || sendDir == D3Q27System::NW || sendDir == D3Q27System::SW || - sendDir == D3Q27System::SE) { + else if (sendDir == D3Q27System::DIR_PP0 || sendDir == D3Q27System::DIR_MP0 || sendDir == D3Q27System::DIR_MM0 || + sendDir == D3Q27System::DIR_PM0) { int x1 = 0; int x2 = 0; switch (sendDir) { - case D3Q27System::NE: + case D3Q27System::DIR_PP0: x1 = maxX1 - 1; x2 = maxX2 - 1; break; - case D3Q27System::NW: + case D3Q27System::DIR_MP0: x1 = 1; x2 = maxX2 - 1; break; - case D3Q27System::SW: + case D3Q27System::DIR_MM0: x1 = 1; x2 = 1; break; - case D3Q27System::SE: + case D3Q27System::DIR_PM0: x1 = maxX1 - 1; x2 = 1; break; @@ -138,24 +138,24 @@ void FullVectorConnector::fillData() } } // TE TW BW BE - else if (sendDir == D3Q27System::TE || sendDir == D3Q27System::TW || sendDir == D3Q27System::BW || - sendDir == D3Q27System::BE) { + else if (sendDir == D3Q27System::DIR_P0P || sendDir == D3Q27System::DIR_M0P || sendDir == D3Q27System::DIR_M0M || + sendDir == D3Q27System::DIR_P0M) { int x1 = 0; int x3 = 0; switch (sendDir) { - case D3Q27System::TE: + case D3Q27System::DIR_P0P: x1 = maxX1 - 1; x3 = maxX3 - 1; break; - case D3Q27System::TW: + case D3Q27System::DIR_M0P: x1 = 1; x3 = maxX3 - 1; break; - case D3Q27System::BW: + case D3Q27System::DIR_M0M: x1 = 1; x3 = 1; break; - case D3Q27System::BE: + case D3Q27System::DIR_P0M: x1 = maxX1 - 1; x3 = 1; break; @@ -165,24 +165,24 @@ void FullVectorConnector::fillData() } } // TN BN BS TS - else if (sendDir == D3Q27System::TN || sendDir == D3Q27System::BN || sendDir == D3Q27System::BS || - sendDir == D3Q27System::TS) { + else if (sendDir == D3Q27System::DIR_0PP || sendDir == D3Q27System::DIR_0PM || sendDir == D3Q27System::DIR_0MM || + sendDir == D3Q27System::DIR_0MP) { int x2 = 0; int x3 = 0; switch (sendDir) { - case D3Q27System::TN: + case D3Q27System::DIR_0PP: x3 = maxX3 - 1; x2 = maxX2 - 1; break; - case D3Q27System::BN: + case D3Q27System::DIR_0PM: x3 = 1; x2 = maxX2 - 1; break; - case D3Q27System::BS: + case D3Q27System::DIR_0MM: x3 = 1; x2 = 1; break; - case D3Q27System::TS: + case D3Q27System::DIR_0MP: x3 = maxX3 - 1; x2 = 1; break; @@ -192,49 +192,49 @@ void FullVectorConnector::fillData() } } // TNE TNW TSW TSE BNE BNW BSW BSE - else if (sendDir == D3Q27System::TNE || sendDir == D3Q27System::TNW || sendDir == D3Q27System::TSW || - sendDir == D3Q27System::TSE || sendDir == D3Q27System::BNE || sendDir == D3Q27System::BNW || - sendDir == D3Q27System::BSW || sendDir == D3Q27System::BSE) { + else if (sendDir == D3Q27System::DIR_PPP || sendDir == D3Q27System::DIR_MPP || sendDir == D3Q27System::DIR_MMP || + sendDir == D3Q27System::DIR_PMP || sendDir == D3Q27System::DIR_PPM || sendDir == D3Q27System::DIR_MPM || + sendDir == D3Q27System::DIR_MMM || sendDir == D3Q27System::DIR_PMM) { int x1 = 0; int x2 = 0; int x3 = 0; switch (sendDir) { - case D3Q27System::TNE: + case D3Q27System::DIR_PPP: x1 = maxX1 - 1; x2 = maxX2 - 1; x3 = maxX3 - 1; break; - case D3Q27System::TNW: + case D3Q27System::DIR_MPP: x1 = 1; x2 = maxX2 - 1; x3 = maxX3 - 1; break; - case D3Q27System::TSW: + case D3Q27System::DIR_MMP: x1 = 1; x2 = 1; x3 = maxX3 - 1; break; - case D3Q27System::TSE: + case D3Q27System::DIR_PMP: x1 = maxX1 - 1; x2 = 1; x3 = maxX3 - 1; break; - case D3Q27System::BNE: + case D3Q27System::DIR_PPM: x1 = maxX1 - 1; x2 = maxX2 - 1; x3 = 1; break; - case D3Q27System::BNW: + case D3Q27System::DIR_MPM: x1 = 1; x2 = maxX2 - 1; x3 = 1; break; - case D3Q27System::BSW: + case D3Q27System::DIR_MMM: x1 = 1; x2 = 1; x3 = 1; break; - case D3Q27System::BSE: + case D3Q27System::DIR_PMM: x1 = maxX1 - 1; x2 = 1; x3 = 1; @@ -257,37 +257,37 @@ void FullVectorConnector::distributeData() int index = 0; - if (sendDir == D3Q27System::W) { + if (sendDir == D3Q27System::DIR_M00) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x2 = 1; x2 < maxX2; x2++) { distributeData(rdata, index, 0, x2, x3); } } - } else if (sendDir == D3Q27System::E) { + } else if (sendDir == D3Q27System::DIR_P00) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x2 = 1; x2 < maxX2; x2++) { distributeData(rdata, index, maxX1, x2, x3); } } - } else if (sendDir == D3Q27System::S) { + } else if (sendDir == D3Q27System::DIR_0M0) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x1 = 1; x1 < maxX1; x1++) { distributeData(rdata, index, x1, 0, x3); } } - } else if (sendDir == D3Q27System::N) { + } else if (sendDir == D3Q27System::DIR_0P0) { for (int x3 = 1; x3 < maxX3; x3++) { for (int x1 = 1; x1 < maxX1; x1++) { distributeData(rdata, index, x1, maxX2, x3); } } - } else if (sendDir == D3Q27System::B) { + } else if (sendDir == D3Q27System::DIR_00M) { for (int x2 = 1; x2 < maxX2; x2++) { for (int x1 = 1; x1 < maxX1; x1++) { distributeData(rdata, index, x1, x2, 0); } } - } else if (sendDir == D3Q27System::T) { + } else if (sendDir == D3Q27System::DIR_00P) { for (int x2 = 1; x2 < maxX2; x2++) { for (int x1 = 1; x1 < maxX1; x1++) { distributeData(rdata, index, x1, x2, maxX3); @@ -295,25 +295,25 @@ void FullVectorConnector::distributeData() } } // NE NW SW SE - else if (sendDir == D3Q27System::NE || sendDir == D3Q27System::NW || sendDir == D3Q27System::SW || - sendDir == D3Q27System::SE) { + else if (sendDir == D3Q27System::DIR_PP0 || sendDir == D3Q27System::DIR_MP0 || sendDir == D3Q27System::DIR_MM0 || + sendDir == D3Q27System::DIR_PM0) { int x1 = 0; int x2 = 0; switch (sendDir) // wenn sendir NE dann kommen werte von SW { - case D3Q27System::NE: + case D3Q27System::DIR_PP0: x1 = maxX1; x2 = maxX2; break; - case D3Q27System::NW: + case D3Q27System::DIR_MP0: x1 = 0; x2 = maxX2; break; - case D3Q27System::SW: + case D3Q27System::DIR_MM0: x1 = 0; x2 = 0; break; - case D3Q27System::SE: + case D3Q27System::DIR_PM0: x1 = maxX1; x2 = 0; break; @@ -324,27 +324,27 @@ void FullVectorConnector::distributeData() } // TE TW BW BE - else if (sendDir == D3Q27System::TE || sendDir == D3Q27System::TW || sendDir == D3Q27System::BW || - sendDir == D3Q27System::BE) + else if (sendDir == D3Q27System::DIR_P0P || sendDir == D3Q27System::DIR_M0P || sendDir == D3Q27System::DIR_M0M || + sendDir == D3Q27System::DIR_P0M) { int x1 = 0; int x3 = 0; switch (sendDir) // wenn sendir NE dann kommen werte von SW { - case D3Q27System::TE: + case D3Q27System::DIR_P0P: x1 = maxX1; x3 = maxX3; break; - case D3Q27System::TW: + case D3Q27System::DIR_M0P: x1 = 0; x3 = maxX3; break; - case D3Q27System::BW: + case D3Q27System::DIR_M0M: x1 = 0; x3 = 0; break; - case D3Q27System::BE: + case D3Q27System::DIR_P0M: x1 = maxX1; x3 = 0; break; @@ -354,24 +354,24 @@ void FullVectorConnector::distributeData() } } // TN BN BS TS - else if (sendDir == D3Q27System::TN || sendDir == D3Q27System::BN || sendDir == D3Q27System::BS || - sendDir == D3Q27System::TS) { + else if (sendDir == D3Q27System::DIR_0PP || sendDir == D3Q27System::DIR_0PM || sendDir == D3Q27System::DIR_0MM || + sendDir == D3Q27System::DIR_0MP) { int x2 = 0; int x3 = 0; switch (sendDir) { - case D3Q27System::TN: + case D3Q27System::DIR_0PP: x3 = maxX3; x2 = maxX2; break; - case D3Q27System::BN: + case D3Q27System::DIR_0PM: x3 = 0; x2 = maxX2; break; - case D3Q27System::BS: + case D3Q27System::DIR_0MM: x3 = 0; x2 = 0; break; - case D3Q27System::TS: + case D3Q27System::DIR_0MP: x3 = maxX3; x2 = 0; break; @@ -381,50 +381,50 @@ void FullVectorConnector::distributeData() } } // TNE TNW TSW TSE BNE BNW BSW BSE - else if (sendDir == D3Q27System::TNE || sendDir == D3Q27System::TNW || sendDir == D3Q27System::TSW || - sendDir == D3Q27System::TSE || sendDir == D3Q27System::BNE || sendDir == D3Q27System::BNW || - sendDir == D3Q27System::BSW || sendDir == D3Q27System::BSE) { + else if (sendDir == D3Q27System::DIR_PPP || sendDir == D3Q27System::DIR_MPP || sendDir == D3Q27System::DIR_MMP || + sendDir == D3Q27System::DIR_PMP || sendDir == D3Q27System::DIR_PPM || sendDir == D3Q27System::DIR_MPM || + sendDir == D3Q27System::DIR_MMM || sendDir == D3Q27System::DIR_PMM) { int x1 = 0; int x2 = 0; int x3 = 0; switch (sendDir) { - case D3Q27System::TNE: + case D3Q27System::DIR_PPP: x1 = maxX1; x2 = maxX2; x3 = maxX3; break; - case D3Q27System::TNW: + case D3Q27System::DIR_MPP: x1 = 0; x2 = maxX2; x3 = maxX3; break; - case D3Q27System::TSW: + case D3Q27System::DIR_MMP: x1 = 0; x2 = 0; x3 = maxX3; break; - case D3Q27System::TSE: + case D3Q27System::DIR_PMP: x1 = maxX1; x2 = 0; x3 = maxX3; break; - case D3Q27System::BNE: + case D3Q27System::DIR_PPM: x1 = maxX1; x2 = maxX2; x3 = 0; break; - case D3Q27System::BNW: + case D3Q27System::DIR_MPM: x1 = 0; x2 = maxX2; x3 = 0; break; - case D3Q27System::BSW: + case D3Q27System::DIR_MMM: x1 = 0; x2 = 0; x3 = 0; break; - case D3Q27System::BSE: + case D3Q27System::DIR_PMM: x1 = maxX1; x2 = 0; x3 = 0; diff --git a/src/cpu/VirtualFluidsCore/Connectors/OneDistributionFullVectorConnector.cpp b/src/cpu/VirtualFluidsCore/Connectors/OneDistributionFullVectorConnector.cpp index 739efcddb9ceea5c0951df83833d64ad90bb02c5..72f43858ae7e64538b4b9bdb7028a8c895e2e84d 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/OneDistributionFullVectorConnector.cpp +++ b/src/cpu/VirtualFluidsCore/Connectors/OneDistributionFullVectorConnector.cpp @@ -18,51 +18,51 @@ void OneDistributionFullVectorConnector::init() int anz = 27; switch (sendDir) { - case D3Q27System::REST: + case D3Q27System::DIR_000: UB_THROW(UbException(UB_EXARGS, "ZERO not allowed")); break; - case D3Q27System::E: - case D3Q27System::W: + case D3Q27System::DIR_P00: + case D3Q27System::DIR_M00: sender->getData().resize(maxX2 * maxX3 * anz, 0.0); break; - case D3Q27System::N: - case D3Q27System::S: + case D3Q27System::DIR_0P0: + case D3Q27System::DIR_0M0: sender->getData().resize(maxX1 * maxX3 * anz, 0.0); break; - case D3Q27System::T: - case D3Q27System::B: + case D3Q27System::DIR_00P: + case D3Q27System::DIR_00M: sender->getData().resize(maxX1 * maxX2 * anz, 0.0); break; - case D3Q27System::NE: - case D3Q27System::SW: - case D3Q27System::SE: - case D3Q27System::NW: + case D3Q27System::DIR_PP0: + case D3Q27System::DIR_MM0: + case D3Q27System::DIR_PM0: + case D3Q27System::DIR_MP0: sender->getData().resize(maxX3 * anz, 0.0); break; - case D3Q27System::TE: - case D3Q27System::BW: - case D3Q27System::BE: - case D3Q27System::TW: + case D3Q27System::DIR_P0P: + case D3Q27System::DIR_M0M: + case D3Q27System::DIR_P0M: + case D3Q27System::DIR_M0P: sender->getData().resize(maxX2 * anz, 0.0); break; - case D3Q27System::TN: - case D3Q27System::BS: - case D3Q27System::BN: - case D3Q27System::TS: + case D3Q27System::DIR_0PP: + case D3Q27System::DIR_0MM: + case D3Q27System::DIR_0PM: + case D3Q27System::DIR_0MP: sender->getData().resize(maxX1 * anz, 0.0); break; - case D3Q27System::TNE: - case D3Q27System::BSW: - case D3Q27System::BNE: - case D3Q27System::TSW: - case D3Q27System::TSE: - case D3Q27System::BNW: - case D3Q27System::BSE: - case D3Q27System::TNW: + case D3Q27System::DIR_PPP: + case D3Q27System::DIR_MMM: + case D3Q27System::DIR_PPM: + case D3Q27System::DIR_MMP: + case D3Q27System::DIR_PMP: + case D3Q27System::DIR_MPM: + case D3Q27System::DIR_PMM: + case D3Q27System::DIR_MPP: sender->getData().resize(anz, 0.0); break; diff --git a/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsDoubleGhostLayerFullDirectConnector.cpp b/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsDoubleGhostLayerFullDirectConnector.cpp index d0ff594f75efa3bfd12f1cbee9629f41e6f86dc3..782b0f27d4b0cd006a27c89def02dad11ff558c5 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsDoubleGhostLayerFullDirectConnector.cpp +++ b/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsDoubleGhostLayerFullDirectConnector.cpp @@ -94,7 +94,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() int maxX3m3 = maxX3 - 3; // EAST - if (sendDir == D3Q27System::E) { + if (sendDir == D3Q27System::DIR_P00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(maxX1m3, x2, x3, minX1, x2, x3); @@ -103,7 +103,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // WEST - else if (sendDir == D3Q27System::W) { + else if (sendDir == D3Q27System::DIR_M00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(minX1p3, x2, x3, maxX1, x2, x3); @@ -112,7 +112,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // NORTH - else if (sendDir == D3Q27System::N) { + else if (sendDir == D3Q27System::DIR_0P0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, maxX2m3, x3, x1, minX2, x3); @@ -121,7 +121,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // SOUTH - else if (sendDir == D3Q27System::S) { + else if (sendDir == D3Q27System::DIR_0M0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, minX2p3, x3, x1, maxX2, x3); @@ -131,7 +131,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } // TOP - else if (sendDir == D3Q27System::T) { + else if (sendDir == D3Q27System::DIR_00P) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, x2, maxX3m3, x1, x2, minX3); @@ -140,7 +140,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // BOTTOM - else if (sendDir == D3Q27System::B) { + else if (sendDir == D3Q27System::DIR_00M) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, x2, minX3p3, x1, x2, maxX3); @@ -149,7 +149,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // NORTHEAST - else if (sendDir == D3Q27System::NE) { + else if (sendDir == D3Q27System::DIR_PP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { exchangeData(maxX1m3, maxX2m3, x3, minX1, minX2, x3); exchangeData(maxX1m2, maxX2m2, x3, minX1p1, minX2p1, x3); @@ -158,7 +158,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // NORTHWEST - else if (sendDir == D3Q27System::NW) { + else if (sendDir == D3Q27System::DIR_MP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { exchangeData(minX1p3, maxX2m3, x3, maxX1, minX2, x3); exchangeData(minX1p2, maxX2m2, x3, maxX1m1, minX2p1, x3); @@ -167,7 +167,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // SOUTHWEST - else if (sendDir == D3Q27System::SW) { + else if (sendDir == D3Q27System::DIR_MM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { exchangeData(minX1p3, minX2p3, x3, maxX1, maxX2, x3); exchangeData(minX1p2, minX2p2, x3, maxX1m1, maxX2m1, x3); @@ -176,70 +176,70 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // SOUTHEAST - else if (sendDir == D3Q27System::SE) { + else if (sendDir == D3Q27System::DIR_PM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { exchangeData(maxX1m3, minX2p3, x3, minX1, maxX2, x3); exchangeData(maxX1m2, minX2p2, x3, minX1p1, maxX2m1, x3); exchangeData(maxX1m3, minX2p2, x3, minX1, maxX2m1, x3); exchangeData(maxX1m2, minX2p3, x3, minX1p1, maxX2, x3); } - } else if (sendDir == D3Q27System::TE) + } else if (sendDir == D3Q27System::DIR_P0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(maxX1m3, x2, maxX3m3, minX1, x2, minX3); exchangeData(maxX1m2, x2, maxX3m2, minX1p1, x2, minX3p1); exchangeData(maxX1m3, x2, maxX3m2, minX1, x2, minX3p1); exchangeData(maxX1m2, x2, maxX3m3, minX1p1, x2, minX3); } - else if (sendDir == D3Q27System::BW) + else if (sendDir == D3Q27System::DIR_M0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(minX1p3, x2, minX3p3, maxX1, x2, maxX3); exchangeData(minX1p2, x2, minX3p2, maxX1m1, x2, maxX3m1); exchangeData(minX1p3, x2, minX3p2, maxX1, x2, maxX3m1); exchangeData(minX1p2, x2, minX3p3, maxX1m1, x2, maxX3); } - else if (sendDir == D3Q27System::BE) + else if (sendDir == D3Q27System::DIR_P0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(maxX1m3, x2, minX3p3, minX1, x2, maxX3); exchangeData(maxX1m2, x2, minX3p2, minX1p1, x2, maxX3m1); exchangeData(maxX1m3, x2, minX3p2, minX1, x2, maxX3m1); exchangeData(maxX1m2, x2, minX3p3, minX1p1, x2, maxX3); } - else if (sendDir == D3Q27System::TW) + else if (sendDir == D3Q27System::DIR_M0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(minX1p3, x2, maxX3m3, maxX1, x2, minX3); exchangeData(minX1p2, x2, maxX3m2, maxX1m1, x2, minX3p1); exchangeData(minX1p3, x2, maxX3m2, maxX1, x2, minX3p1); exchangeData(minX1p2, x2, maxX3m3, maxX1m1, x2, minX3); } - else if (sendDir == D3Q27System::TN) + else if (sendDir == D3Q27System::DIR_0PP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, maxX2m3, maxX3m3, x1, minX2, minX3); exchangeData(x1, maxX2m2, maxX3m2, x1, minX2p1, minX3p1); exchangeData(x1, maxX2m3, maxX3m2, x1, minX2, minX3p1); exchangeData(x1, maxX2m2, maxX3m3, x1, minX2p1, minX3); } - else if (sendDir == D3Q27System::BS) + else if (sendDir == D3Q27System::DIR_0MM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, minX2p3, minX3p3, x1, maxX2, maxX3); exchangeData(x1, minX2p2, minX3p2, x1, maxX2m1, maxX3m1); exchangeData(x1, minX2p3, minX3p2, x1, maxX2, maxX3m1); exchangeData(x1, minX2p2, minX3p3, x1, maxX2m1, maxX3); } - else if (sendDir == D3Q27System::BN) + else if (sendDir == D3Q27System::DIR_0PM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, maxX2m3, minX3p3, x1, minX2, maxX3); exchangeData(x1, maxX2m2, minX3p2, x1, minX2p1, maxX3m1); exchangeData(x1, maxX2m3, minX3p2, x1, minX2, maxX3m1); exchangeData(x1, maxX2m2, minX3p3, x1, minX2p1, maxX3); } - else if (sendDir == D3Q27System::TS) + else if (sendDir == D3Q27System::DIR_0MP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, minX2p3, maxX3m3, x1, maxX2, minX3); exchangeData(x1, minX2p2, maxX3m2, x1, maxX2m1, minX3p1); exchangeData(x1, minX2p3, maxX3m2, x1, maxX2, minX3p1); exchangeData(x1, minX2p2, maxX3m3, x1, maxX2m1, minX3); } - else if (sendDir == D3Q27System::TSW) { + else if (sendDir == D3Q27System::DIR_MMP) { exchangeData(minX1p3, minX2p3, maxX3m3, maxX1, maxX2, minX3); exchangeData(minX1p2, minX2p2, maxX3m2, maxX1m1, maxX2m1, minX3p1); exchangeData(minX1p3, minX2p2, maxX3m2, maxX1, maxX2m1, minX3p1); @@ -248,7 +248,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(minX1p3, minX2p3, maxX3m2, maxX1, maxX2, minX3p1); exchangeData(minX1p3, minX2p2, maxX3m3, maxX1, maxX2m1, minX3); exchangeData(minX1p2, minX2p3, maxX3m3, maxX1m1, maxX2, minX3); - } else if (sendDir == D3Q27System::TSE) { + } else if (sendDir == D3Q27System::DIR_PMP) { exchangeData(maxX1m3, minX1p3, maxX3m3, minX1, maxX2, minX3); exchangeData(maxX1m2, minX1p2, maxX3m2, minX1p1, maxX2m1, minX3p1); exchangeData(maxX1m3, minX1p2, maxX3m2, minX1, maxX2m1, minX3p1); @@ -257,7 +257,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(maxX1m3, minX1p3, maxX3m2, minX1, maxX2, minX3p1); exchangeData(maxX1m3, minX1p2, maxX3m3, minX1, maxX2m1, minX3); exchangeData(maxX1m2, minX1p3, maxX3m3, minX1p1, maxX2, minX3); - } else if (sendDir == D3Q27System::TNW) { + } else if (sendDir == D3Q27System::DIR_MPP) { exchangeData(minX1p3, maxX2m3, maxX3m3, maxX1, minX2, minX3); exchangeData(minX1p2, maxX2m2, maxX3m2, maxX1m1, minX2p1, minX3p1); exchangeData(minX1p3, maxX2m2, maxX3m2, maxX1, minX2p1, minX3p1); @@ -266,7 +266,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(minX1p3, maxX2m3, maxX3m2, maxX1, minX2, minX3p1); exchangeData(minX1p3, maxX2m2, maxX3m3, maxX1, minX2p1, minX3); exchangeData(minX1p2, maxX2m3, maxX3m3, maxX1m1, minX2, minX3); - } else if (sendDir == D3Q27System::TNE) { + } else if (sendDir == D3Q27System::DIR_PPP) { exchangeData(maxX1m3, maxX2m3, maxX3m3, minX1, minX2, minX3); exchangeData(maxX1m2, maxX2m2, maxX3m2, minX1p1, minX2p1, minX3p1); exchangeData(maxX1m3, maxX2m2, maxX3m2, minX1, minX2p1, minX3p1); @@ -275,7 +275,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(maxX1m3, maxX2m3, maxX3m2, minX1, minX2, minX3p1); exchangeData(maxX1m3, maxX2m2, maxX3m3, minX1, minX2p1, minX3); exchangeData(maxX1m2, maxX2m3, maxX3m3, minX1p1, minX2, minX3); - } else if (sendDir == D3Q27System::BSW) { + } else if (sendDir == D3Q27System::DIR_MMM) { exchangeData(minX1p3, minX2p3, minX3p3, maxX1, maxX2, maxX3); exchangeData(minX1p2, minX2p2, minX3p2, maxX1m1, maxX2m1, maxX3m1); exchangeData(minX1p3, minX2p2, minX3p2, maxX1, maxX2m1, maxX3m1); @@ -284,7 +284,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(minX1p3, minX2p3, minX3p2, maxX1, maxX2, maxX3m1); exchangeData(minX1p3, minX2p2, minX3p3, maxX1, maxX2m1, maxX3); exchangeData(minX1p2, minX2p3, minX3p3, maxX1m1, maxX2, maxX3); - } else if (sendDir == D3Q27System::BSE) { + } else if (sendDir == D3Q27System::DIR_PMM) { exchangeData(maxX1m3, minX2p3, minX3p3, minX1, maxX2, maxX3); exchangeData(maxX1m2, minX2p2, minX3p2, minX1p1, maxX2m1, maxX3m1); exchangeData(maxX1m3, minX2p2, minX3p2, minX1, maxX2m1, maxX3m1); @@ -293,7 +293,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(maxX1m3, minX2p3, minX3p2, minX1, maxX2, maxX3m1); exchangeData(maxX1m3, minX2p2, minX3p3, minX1, maxX2m1, maxX3); exchangeData(maxX1m2, minX2p3, minX3p3, minX1p1, maxX2, maxX3); - } else if (sendDir == D3Q27System::BNW) { + } else if (sendDir == D3Q27System::DIR_MPM) { exchangeData(minX1p3, maxX2m3, minX3p3, maxX1, minX2, maxX3); exchangeData(minX1p2, maxX2m2, minX3p2, maxX1m1, minX2p1, maxX3m1); exchangeData(minX1p3, maxX2m2, minX3p2, maxX1, minX2p1, maxX3m1); @@ -302,7 +302,7 @@ void ThreeDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(minX1p3, maxX2m3, minX3p2, maxX1, minX2, maxX3m1); exchangeData(minX1p3, maxX2m2, minX3p3, maxX1, minX2p1, maxX3); exchangeData(minX1p2, maxX2m3, minX3p3, maxX1m1, minX2, maxX3); - } else if (sendDir == D3Q27System::BNE) { + } else if (sendDir == D3Q27System::DIR_PPM) { exchangeData(maxX1m3, maxX2m3, minX3p3, minX1, minX2, maxX3); exchangeData(maxX1m2, maxX2m2, minX3p2, minX1p1, minX2p1, maxX3m1); exchangeData(maxX1m3, maxX2m2, minX3p2, minX1, minX2p1, maxX3m1); diff --git a/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.cpp b/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.cpp index 3e314fbce45e8d29affa09777a7cbeb1b92ca2ac..0b94f7b4a971462517db6dd07050942f4b8595c0 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.cpp +++ b/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsDoubleGhostLayerFullVectorConnector.cpp @@ -60,37 +60,37 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::init() int anz = 3*27+1; switch (sendDir) { - case D3Q27System::REST: UB_THROW(UbException(UB_EXARGS, "ZERO not allowed")); break; - case D3Q27System::E: - case D3Q27System::W: sender->getData().resize(maxX2*maxX3*anz*2, 0.0); break; - case D3Q27System::N: - case D3Q27System::S: sender->getData().resize(maxX1*maxX3*anz*2, 0.0); break; - case D3Q27System::T: - case D3Q27System::B: sender->getData().resize(maxX1*maxX2*anz*2, 0.0); break; + case D3Q27System::DIR_000: UB_THROW(UbException(UB_EXARGS, "ZERO not allowed")); break; + case D3Q27System::DIR_P00: + case D3Q27System::DIR_M00: sender->getData().resize(maxX2*maxX3*anz*2, 0.0); break; + case D3Q27System::DIR_0P0: + case D3Q27System::DIR_0M0: sender->getData().resize(maxX1*maxX3*anz*2, 0.0); break; + case D3Q27System::DIR_00P: + case D3Q27System::DIR_00M: sender->getData().resize(maxX1*maxX2*anz*2, 0.0); break; - case D3Q27System::NE: - case D3Q27System::SW: - case D3Q27System::SE: - case D3Q27System::NW: sender->getData().resize(maxX3*anz*4, 0.0); break; + case D3Q27System::DIR_PP0: + case D3Q27System::DIR_MM0: + case D3Q27System::DIR_PM0: + case D3Q27System::DIR_MP0: sender->getData().resize(maxX3*anz*4, 0.0); break; - case D3Q27System::TE: - case D3Q27System::BW: - case D3Q27System::BE: - case D3Q27System::TW: sender->getData().resize(maxX2*anz*4, 0.0); break; + case D3Q27System::DIR_P0P: + case D3Q27System::DIR_M0M: + case D3Q27System::DIR_P0M: + case D3Q27System::DIR_M0P: sender->getData().resize(maxX2*anz*4, 0.0); break; - case D3Q27System::TN: - case D3Q27System::BS: - case D3Q27System::BN: - case D3Q27System::TS: sender->getData().resize(maxX1*anz*4, 0.0); break; + case D3Q27System::DIR_0PP: + case D3Q27System::DIR_0MM: + case D3Q27System::DIR_0PM: + case D3Q27System::DIR_0MP: sender->getData().resize(maxX1*anz*4, 0.0); break; - case D3Q27System::TNE: - case D3Q27System::BSW: - case D3Q27System::BNE: - case D3Q27System::TSW: - case D3Q27System::TSE: - case D3Q27System::BNW: - case D3Q27System::BSE: - case D3Q27System::TNW: sender->getData().resize(anz*8, 0.0); break; + case D3Q27System::DIR_PPP: + case D3Q27System::DIR_MMM: + case D3Q27System::DIR_PPM: + case D3Q27System::DIR_MMP: + case D3Q27System::DIR_PMP: + case D3Q27System::DIR_MPM: + case D3Q27System::DIR_PMM: + case D3Q27System::DIR_MPP: sender->getData().resize(anz*8, 0.0); break; default: UB_THROW(UbException(UB_EXARGS, "unknown sendDir")); } @@ -138,7 +138,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() int index = 0; // EAST - if (sendDir == D3Q27System::E) { + if (sendDir == D3Q27System::DIR_P00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, maxX1m3, x2, x3); @@ -147,7 +147,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // WEST - else if (sendDir == D3Q27System::W) { + else if (sendDir == D3Q27System::DIR_M00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, minX1p3, x2, x3); @@ -156,7 +156,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // NORTH - else if (sendDir == D3Q27System::N) { + else if (sendDir == D3Q27System::DIR_0P0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, maxX2m3, x3); @@ -165,7 +165,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // SOUTH - else if (sendDir == D3Q27System::S) { + else if (sendDir == D3Q27System::DIR_0M0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, minX2p3, x3); @@ -175,7 +175,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() } // TOP - else if (sendDir == D3Q27System::T) { + else if (sendDir == D3Q27System::DIR_00P) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, x2, maxX3m3); @@ -184,7 +184,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // BOTTOM - else if (sendDir == D3Q27System::B) { + else if (sendDir == D3Q27System::DIR_00M) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, x2, minX3p3); @@ -193,7 +193,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // NORTHEAST - else if (sendDir == D3Q27System::NE) { + else if (sendDir == D3Q27System::DIR_PP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { fillData(sdata, index, maxX1m3, maxX2m3, x3); fillData(sdata, index, maxX1m2, maxX2m2, x3); @@ -202,7 +202,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // NORTHWEST - else if (sendDir == D3Q27System::NW) { + else if (sendDir == D3Q27System::DIR_MP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { fillData(sdata, index, minX1p3, maxX2m3, x3); fillData(sdata, index, minX1p2, maxX2m2, x3); @@ -211,7 +211,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // SOUTHWEST - else if (sendDir == D3Q27System::SW) { + else if (sendDir == D3Q27System::DIR_MM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { fillData(sdata, index, minX1p3, minX2p3, x3); fillData(sdata, index, minX1p2, minX2p2, x3); @@ -220,70 +220,70 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // SOUTHEAST - else if (sendDir == D3Q27System::SE) { + else if (sendDir == D3Q27System::DIR_PM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { fillData(sdata, index, maxX1m3, minX2p3, x3); fillData(sdata, index, maxX1m2, minX2p2, x3); fillData(sdata, index, maxX1m3, minX2p2, x3); fillData(sdata, index, maxX1m2, minX2p3, x3); } - } else if (sendDir == D3Q27System::TE) + } else if (sendDir == D3Q27System::DIR_P0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, maxX1m3, x2, maxX3m3); fillData(sdata, index, maxX1m2, x2, maxX3m2); fillData(sdata, index, maxX1m3, x2, maxX3m2); fillData(sdata, index, maxX1m2, x2, maxX3m3); } - else if (sendDir == D3Q27System::BW) + else if (sendDir == D3Q27System::DIR_M0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, minX1p3, x2, minX3p3); fillData(sdata, index, minX1p2, x2, minX3p2); fillData(sdata, index, minX1p3, x2, minX3p2); fillData(sdata, index, minX1p2, x2, minX3p3); } - else if (sendDir == D3Q27System::BE) + else if (sendDir == D3Q27System::DIR_P0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, maxX1m3, x2, minX3p3); fillData(sdata, index, maxX1m2, x2, minX3p2); fillData(sdata, index, maxX1m3, x2, minX3p2); fillData(sdata, index, maxX1m2, x2, minX3p3); } - else if (sendDir == D3Q27System::TW) + else if (sendDir == D3Q27System::DIR_M0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, minX1p3, x2, maxX3m3); fillData(sdata, index, minX1p2, x2, maxX3m2); fillData(sdata, index, minX1p3, x2, maxX3m2); fillData(sdata, index, minX1p2, x2, maxX3m3); } - else if (sendDir == D3Q27System::TN) + else if (sendDir == D3Q27System::DIR_0PP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, maxX2m3, maxX3m3); fillData(sdata, index, x1, maxX2m2, maxX3m2); fillData(sdata, index, x1, maxX2m3, maxX3m2); fillData(sdata, index, x1, maxX2m2, maxX3m3); } - else if (sendDir == D3Q27System::BS) + else if (sendDir == D3Q27System::DIR_0MM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, minX2p3, minX3p3); fillData(sdata, index, x1, minX2p2, minX3p2); fillData(sdata, index, x1, minX2p3, minX3p2); fillData(sdata, index, x1, minX2p2, minX3p3); } - else if (sendDir == D3Q27System::BN) + else if (sendDir == D3Q27System::DIR_0PM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, maxX2m3, minX3p3); fillData(sdata, index, x1, maxX2m2, minX3p2); fillData(sdata, index, x1, maxX2m3, minX3p2); fillData(sdata, index, x1, maxX2m2, minX3p3); } - else if (sendDir == D3Q27System::TS) + else if (sendDir == D3Q27System::DIR_0MP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, minX2p3, maxX3m3); fillData(sdata, index, x1, minX2p2, maxX3m2); fillData(sdata, index, x1, minX2p3, maxX3m2); fillData(sdata, index, x1, minX2p2, maxX3m3); } - else if (sendDir == D3Q27System::TSW) { + else if (sendDir == D3Q27System::DIR_MMP) { fillData(sdata, index, minX1p3, minX2p3, maxX3m3); fillData(sdata, index, minX1p2, minX2p2, maxX3m2); fillData(sdata, index, minX1p3, minX2p2, maxX3m2); @@ -292,7 +292,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, minX1p3, minX2p3, maxX3m2); fillData(sdata, index, minX1p3, minX2p2, maxX3m3); fillData(sdata, index, minX1p2, minX2p3, maxX3m3); - } else if (sendDir == D3Q27System::TSE) { + } else if (sendDir == D3Q27System::DIR_PMP) { fillData(sdata, index, maxX1m3, minX1p3, maxX3m3); fillData(sdata, index, maxX1m2, minX1p2, maxX3m2); fillData(sdata, index, maxX1m3, minX1p2, maxX3m2); @@ -301,7 +301,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, maxX1m3, minX1p3, maxX3m2); fillData(sdata, index, maxX1m3, minX1p2, maxX3m3); fillData(sdata, index, maxX1m2, minX1p3, maxX3m3); - } else if (sendDir == D3Q27System::TNW) { + } else if (sendDir == D3Q27System::DIR_MPP) { fillData(sdata, index, minX1p3, maxX2m3, maxX3m3); fillData(sdata, index, minX1p2, maxX2m2, maxX3m2); fillData(sdata, index, minX1p3, maxX2m2, maxX3m2); @@ -310,7 +310,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, minX1p3, maxX2m3, maxX3m2); fillData(sdata, index, minX1p3, maxX2m2, maxX3m3); fillData(sdata, index, minX1p2, maxX2m3, maxX3m3); - } else if (sendDir == D3Q27System::TNE) { + } else if (sendDir == D3Q27System::DIR_PPP) { fillData(sdata, index, maxX1m3, maxX2m3, maxX3m3); fillData(sdata, index, maxX1m2, maxX2m2, maxX3m2); fillData(sdata, index, maxX1m3, maxX2m2, maxX3m2); @@ -319,7 +319,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, maxX1m3, maxX2m3, maxX3m2); fillData(sdata, index, maxX1m3, maxX2m2, maxX3m3); fillData(sdata, index, maxX1m2, maxX2m3, maxX3m3); - } else if (sendDir == D3Q27System::BSW) { + } else if (sendDir == D3Q27System::DIR_MMM) { fillData(sdata, index, minX1p3, minX2p3, minX3p3); fillData(sdata, index, minX1p2, minX2p2, minX3p2); fillData(sdata, index, minX1p3, minX2p2, minX3p2); @@ -328,7 +328,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, minX1p3, minX2p3, minX3p2); fillData(sdata, index, minX1p3, minX2p2, minX3p3); fillData(sdata, index, minX1p2, minX2p3, minX3p3); - } else if (sendDir == D3Q27System::BSE) { + } else if (sendDir == D3Q27System::DIR_PMM) { fillData(sdata, index, maxX1m3, minX2p3, minX3p3); fillData(sdata, index, maxX1m2, minX2p2, minX3p2); fillData(sdata, index, maxX1m3, minX2p2, minX3p2); @@ -337,7 +337,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, maxX1m3, minX2p3, minX3p2); fillData(sdata, index, maxX1m3, minX2p2, minX3p3); fillData(sdata, index, maxX1m2, minX2p3, minX3p3); - } else if (sendDir == D3Q27System::BNW) { + } else if (sendDir == D3Q27System::DIR_MPM) { fillData(sdata, index, minX1p3, maxX2m3, minX3p3); fillData(sdata, index, minX1p2, maxX2m2, minX3p2); fillData(sdata, index, minX1p3, maxX2m2, minX3p2); @@ -346,7 +346,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, minX1p3, maxX2m3, minX3p2); fillData(sdata, index, minX1p3, maxX2m2, minX3p3); fillData(sdata, index, minX1p2, maxX2m3, minX3p3); - } else if (sendDir == D3Q27System::BNE) { + } else if (sendDir == D3Q27System::DIR_PPM) { fillData(sdata, index, maxX1m3, maxX2m3, minX3p3); fillData(sdata, index, maxX1m2, maxX2m2, minX3p2); fillData(sdata, index, maxX1m3, maxX2m2, minX3p2); @@ -400,7 +400,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() int maxX3m2 = maxX3 - 2; //int maxX3m3 = maxX3 - 3; - if (sendDir == D3Q27System::W) { + if (sendDir == D3Q27System::DIR_M00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, minX1, x2, x3); @@ -408,7 +408,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::E) { + else if (sendDir == D3Q27System::DIR_P00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, maxX1, x2, x3); @@ -416,7 +416,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::S) { + else if (sendDir == D3Q27System::DIR_0M0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, minX2, x3); @@ -424,7 +424,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::N) { + else if (sendDir == D3Q27System::DIR_0P0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, maxX2, x3); @@ -432,7 +432,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::B) { + else if (sendDir == D3Q27System::DIR_00M) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, x2, minX3); @@ -440,7 +440,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::T) { + else if (sendDir == D3Q27System::DIR_00P) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, x2, maxX3); @@ -448,7 +448,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::SW) { + else if (sendDir == D3Q27System::DIR_MM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { distributeData(rdata, index, minX1, minX2, x3); distributeData(rdata, index, minX1p1, minX2p1, x3); @@ -456,7 +456,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, minX1p1, minX2, x3); } } - else if (sendDir == D3Q27System::SE) { + else if (sendDir == D3Q27System::DIR_PM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { distributeData(rdata, index, maxX1, minX2, x3); distributeData(rdata, index, maxX1m1, minX2p1, x3); @@ -464,7 +464,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1m1, minX2, x3); } } - else if (sendDir == D3Q27System::NE) { + else if (sendDir == D3Q27System::DIR_PP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { distributeData(rdata, index, maxX1, maxX2, x3); distributeData(rdata, index, maxX1m1, maxX2m1, x3); @@ -472,70 +472,70 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1m1, maxX2, x3); } } - else if (sendDir == D3Q27System::NW) { + else if (sendDir == D3Q27System::DIR_MP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { distributeData(rdata, index, minX1, maxX2, x3); distributeData(rdata, index, minX1p1, maxX2m1, x3); distributeData(rdata, index, minX1, maxX2m1, x3); distributeData(rdata, index, minX1p1, maxX2, x3); } - } else if (sendDir == D3Q27System::BW) + } else if (sendDir == D3Q27System::DIR_M0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, minX1, x2, minX3); distributeData(rdata, index, minX1p1, x2, minX3p1); distributeData(rdata, index, minX1, x2, minX3p1); distributeData(rdata, index, minX1p1, x2, minX3); } - else if (sendDir == D3Q27System::TE) + else if (sendDir == D3Q27System::DIR_P0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, maxX1, x2, maxX3); distributeData(rdata, index, maxX1m1, x2, maxX3m1); distributeData(rdata, index, maxX1, x2, maxX3m1); distributeData(rdata, index, maxX1m1, x2, maxX3); } - else if (sendDir == D3Q27System::TW) + else if (sendDir == D3Q27System::DIR_M0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, minX1, x2, maxX3); distributeData(rdata, index, minX1p1, x2, maxX3m1); distributeData(rdata, index, minX1, x2, maxX3m1); distributeData(rdata, index, minX1p1, x2, maxX3); } - else if (sendDir == D3Q27System::BE) + else if (sendDir == D3Q27System::DIR_P0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, maxX1, x2, minX3); distributeData(rdata, index, maxX1m1, x2, minX3p1); distributeData(rdata, index, maxX1, x2, minX3p1); distributeData(rdata, index, maxX1m1, x2, minX3); } - else if (sendDir == D3Q27System::BS) + else if (sendDir == D3Q27System::DIR_0MM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, minX2, minX3); distributeData(rdata, index, x1, minX2p1, minX3p1); distributeData(rdata, index, x1, minX2, minX3p1); distributeData(rdata, index, x1, minX2p1, minX3); } - else if (sendDir == D3Q27System::TN) + else if (sendDir == D3Q27System::DIR_0PP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, maxX2, maxX3); distributeData(rdata, index, x1, maxX2m1, maxX3m1); distributeData(rdata, index, x1, maxX2, maxX3m1); distributeData(rdata, index, x1, maxX2m1, maxX3); } - else if (sendDir == D3Q27System::TS) + else if (sendDir == D3Q27System::DIR_0MP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, minX2, maxX3); distributeData(rdata, index, x1, minX2p1, maxX3m1); distributeData(rdata, index, x1, minX2, maxX3m1); distributeData(rdata, index, x1, minX2p1, maxX3); } - else if (sendDir == D3Q27System::BN) + else if (sendDir == D3Q27System::DIR_0PM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, maxX2, minX3); distributeData(rdata, index, x1, maxX2m1, minX3p1); distributeData(rdata, index, x1, maxX2, minX3p1); distributeData(rdata, index, x1, maxX2m1, minX3); } - else if (sendDir == D3Q27System::BNE) { + else if (sendDir == D3Q27System::DIR_PPM) { distributeData(rdata, index, maxX1, maxX2, minX3); distributeData(rdata, index, maxX1m1, maxX2m1, minX3p1); distributeData(rdata, index, maxX1, maxX2m1, minX3p1); @@ -544,7 +544,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1, maxX2, minX3p1); distributeData(rdata, index, maxX1, maxX2m1, minX3); distributeData(rdata, index, maxX1m1, maxX2, minX3); - } else if (sendDir == D3Q27System::BNW) { + } else if (sendDir == D3Q27System::DIR_MPM) { distributeData(rdata, index, minX1, maxX2, minX3); distributeData(rdata, index, minX1p1, maxX2m1, minX3p1); distributeData(rdata, index, minX1, maxX2m1, minX3p1); @@ -553,7 +553,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, minX1, maxX2, minX3p1); distributeData(rdata, index, minX1, maxX2m1, minX3); distributeData(rdata, index, minX1p1, maxX2, minX3); - } else if (sendDir == D3Q27System::BSE) { + } else if (sendDir == D3Q27System::DIR_PMM) { distributeData(rdata, index, maxX1, minX2, minX3); distributeData(rdata, index, maxX1m1, minX2p1, minX3p1); distributeData(rdata, index, maxX1, minX2p1, minX3p1); @@ -562,7 +562,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1, minX2, minX3p1); distributeData(rdata, index, maxX1, minX2p1, minX3); distributeData(rdata, index, maxX1m1, minX2, minX3); - } else if (sendDir == D3Q27System::BSW) { + } else if (sendDir == D3Q27System::DIR_MMM) { distributeData(rdata, index, minX1, minX2, minX3); distributeData(rdata, index, minX1p1, minX2p1, minX3p1); distributeData(rdata, index, minX1, minX2p1, minX3p1); @@ -571,7 +571,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, minX1, minX2, minX3p1); distributeData(rdata, index, minX1, minX2p1, minX3); distributeData(rdata, index, minX1p1, minX2, minX3); - } else if (sendDir == D3Q27System::TNE) { + } else if (sendDir == D3Q27System::DIR_PPP) { distributeData(rdata, index, maxX1, maxX2, maxX3); distributeData(rdata, index, maxX1m1, maxX2m1, maxX3m1); distributeData(rdata, index, maxX1, maxX2m1, maxX3m1); @@ -580,7 +580,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1, maxX2, maxX3m1); distributeData(rdata, index, maxX1, maxX2m1, maxX3); distributeData(rdata, index, maxX1m1, maxX2, maxX3); - } else if (sendDir == D3Q27System::TNW) { + } else if (sendDir == D3Q27System::DIR_MPP) { distributeData(rdata, index, minX1, maxX2, maxX3); distributeData(rdata, index, minX1p1, maxX2m1, maxX3m1); distributeData(rdata, index, minX1, maxX2m1, maxX3m1); @@ -589,7 +589,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, minX1, maxX2, maxX3m1); distributeData(rdata, index, minX1, maxX2m1, maxX3); distributeData(rdata, index, minX1p1, maxX2, maxX3); - } else if (sendDir == D3Q27System::TSE) { + } else if (sendDir == D3Q27System::DIR_PMP) { distributeData(rdata, index, maxX1, minX2, maxX3); distributeData(rdata, index, maxX1m1, minX2p1, maxX3m1); distributeData(rdata, index, maxX1, minX2p1, maxX3m1); @@ -598,7 +598,7 @@ void ThreeDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1, minX2, maxX3m1); distributeData(rdata, index, maxX1, minX2p1, maxX3); distributeData(rdata, index, maxX1m1, minX2, maxX3); - } else if (sendDir == D3Q27System::TSW) { + } else if (sendDir == D3Q27System::DIR_MMP) { distributeData(rdata, index, minX1, minX2, maxX3); distributeData(rdata, index, minX1p1, minX2p1, maxX3m1); distributeData(rdata, index, minX1, minX2p1, maxX3m1); diff --git a/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsFullVectorConnector.cpp b/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsFullVectorConnector.cpp index 2e726fc7b88c9ef229e503924eadcf53a9b06dfd..534076b7bfcb63386c75d6d8619b4b56bbd5c5ee 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsFullVectorConnector.cpp +++ b/src/cpu/VirtualFluidsCore/Connectors/ThreeDistributionsFullVectorConnector.cpp @@ -59,37 +59,37 @@ void ThreeDistributionsFullVectorConnector::init() int anz = 3*27; switch (sendDir) { - case D3Q27System::REST: UB_THROW(UbException(UB_EXARGS, "ZERO not allowed")); break; - case D3Q27System::E: - case D3Q27System::W: sender->getData().resize(maxX2*maxX3*anz, 0.0); break; - case D3Q27System::N: - case D3Q27System::S: sender->getData().resize(maxX1*maxX3*anz, 0.0); break; - case D3Q27System::T: - case D3Q27System::B: sender->getData().resize(maxX1*maxX2*anz, 0.0); break; + case D3Q27System::DIR_000: UB_THROW(UbException(UB_EXARGS, "ZERO not allowed")); break; + case D3Q27System::DIR_P00: + case D3Q27System::DIR_M00: sender->getData().resize(maxX2*maxX3*anz, 0.0); break; + case D3Q27System::DIR_0P0: + case D3Q27System::DIR_0M0: sender->getData().resize(maxX1*maxX3*anz, 0.0); break; + case D3Q27System::DIR_00P: + case D3Q27System::DIR_00M: sender->getData().resize(maxX1*maxX2*anz, 0.0); break; - case D3Q27System::NE: - case D3Q27System::SW: - case D3Q27System::SE: - case D3Q27System::NW: sender->getData().resize(maxX3*anz, 0.0); break; + case D3Q27System::DIR_PP0: + case D3Q27System::DIR_MM0: + case D3Q27System::DIR_PM0: + case D3Q27System::DIR_MP0: sender->getData().resize(maxX3*anz, 0.0); break; - case D3Q27System::TE: - case D3Q27System::BW: - case D3Q27System::BE: - case D3Q27System::TW: sender->getData().resize(maxX2*anz, 0.0); break; + case D3Q27System::DIR_P0P: + case D3Q27System::DIR_M0M: + case D3Q27System::DIR_P0M: + case D3Q27System::DIR_M0P: sender->getData().resize(maxX2*anz, 0.0); break; - case D3Q27System::TN: - case D3Q27System::BS: - case D3Q27System::BN: - case D3Q27System::TS: sender->getData().resize(maxX1*anz, 0.0); break; + case D3Q27System::DIR_0PP: + case D3Q27System::DIR_0MM: + case D3Q27System::DIR_0PM: + case D3Q27System::DIR_0MP: sender->getData().resize(maxX1*anz, 0.0); break; - case D3Q27System::TNE: - case D3Q27System::BSW: - case D3Q27System::BNE: - case D3Q27System::TSW: - case D3Q27System::TSE: - case D3Q27System::BNW: - case D3Q27System::BSE: - case D3Q27System::TNW: sender->getData().resize(anz, 0.0); break; + case D3Q27System::DIR_PPP: + case D3Q27System::DIR_MMM: + case D3Q27System::DIR_PPM: + case D3Q27System::DIR_MMP: + case D3Q27System::DIR_PMP: + case D3Q27System::DIR_MPM: + case D3Q27System::DIR_PMM: + case D3Q27System::DIR_MPP: sender->getData().resize(anz, 0.0); break; default: UB_THROW(UbException(UB_EXARGS, "unknown sendDir")); } diff --git a/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsDoubleGhostLayerFullDirectConnector.cpp b/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsDoubleGhostLayerFullDirectConnector.cpp index 3d0ca3f043225faf0d2831b47ffa35fa27c4d89f..b46ffebeb144569311272050893118f34e862398 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsDoubleGhostLayerFullDirectConnector.cpp +++ b/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsDoubleGhostLayerFullDirectConnector.cpp @@ -92,7 +92,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() int maxX3m3 = maxX3 - 3; // EAST - if (sendDir == D3Q27System::E) { + if (sendDir == D3Q27System::DIR_P00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(maxX1m3, x2, x3, minX1, x2, x3); @@ -101,7 +101,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // WEST - else if (sendDir == D3Q27System::W) { + else if (sendDir == D3Q27System::DIR_M00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(minX1p3, x2, x3, maxX1, x2, x3); @@ -110,7 +110,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // NORTH - else if (sendDir == D3Q27System::N) { + else if (sendDir == D3Q27System::DIR_0P0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, maxX2m3, x3, x1, minX2, x3); @@ -119,7 +119,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // SOUTH - else if (sendDir == D3Q27System::S) { + else if (sendDir == D3Q27System::DIR_0M0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, minX2p3, x3, x1, maxX2, x3); @@ -129,7 +129,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } // TOP - else if (sendDir == D3Q27System::T) { + else if (sendDir == D3Q27System::DIR_00P) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, x2, maxX3m3, x1, x2, minX3); @@ -138,7 +138,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // BOTTOM - else if (sendDir == D3Q27System::B) { + else if (sendDir == D3Q27System::DIR_00M) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, x2, minX3p3, x1, x2, maxX3); @@ -147,7 +147,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // NORTHEAST - else if (sendDir == D3Q27System::NE) { + else if (sendDir == D3Q27System::DIR_PP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { exchangeData(maxX1m3, maxX2m3, x3, minX1, minX2, x3); exchangeData(maxX1m2, maxX2m2, x3, minX1p1, minX2p1, x3); @@ -156,7 +156,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // NORTHWEST - else if (sendDir == D3Q27System::NW) { + else if (sendDir == D3Q27System::DIR_MP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { exchangeData(minX1p3, maxX2m3, x3, maxX1, minX2, x3); exchangeData(minX1p2, maxX2m2, x3, maxX1m1, minX2p1, x3); @@ -165,7 +165,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // SOUTHWEST - else if (sendDir == D3Q27System::SW) { + else if (sendDir == D3Q27System::DIR_MM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { exchangeData(minX1p3, minX2p3, x3, maxX1, maxX2, x3); exchangeData(minX1p2, minX2p2, x3, maxX1m1, maxX2m1, x3); @@ -174,70 +174,70 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() } } // SOUTHEAST - else if (sendDir == D3Q27System::SE) { + else if (sendDir == D3Q27System::DIR_PM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { exchangeData(maxX1m3, minX2p3, x3, minX1, maxX2, x3); exchangeData(maxX1m2, minX2p2, x3, minX1p1, maxX2m1, x3); exchangeData(maxX1m3, minX2p2, x3, minX1, maxX2m1, x3); exchangeData(maxX1m2, minX2p3, x3, minX1p1, maxX2, x3); } - } else if (sendDir == D3Q27System::TE) + } else if (sendDir == D3Q27System::DIR_P0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(maxX1m3, x2, maxX3m3, minX1, x2, minX3); exchangeData(maxX1m2, x2, maxX3m2, minX1p1, x2, minX3p1); exchangeData(maxX1m3, x2, maxX3m2, minX1, x2, minX3p1); exchangeData(maxX1m2, x2, maxX3m3, minX1p1, x2, minX3); } - else if (sendDir == D3Q27System::BW) + else if (sendDir == D3Q27System::DIR_M0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(minX1p3, x2, minX3p3, maxX1, x2, maxX3); exchangeData(minX1p2, x2, minX3p2, maxX1m1, x2, maxX3m1); exchangeData(minX1p3, x2, minX3p2, maxX1, x2, maxX3m1); exchangeData(minX1p2, x2, minX3p3, maxX1m1, x2, maxX3); } - else if (sendDir == D3Q27System::BE) + else if (sendDir == D3Q27System::DIR_P0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(maxX1m3, x2, minX3p3, minX1, x2, maxX3); exchangeData(maxX1m2, x2, minX3p2, minX1p1, x2, maxX3m1); exchangeData(maxX1m3, x2, minX3p2, minX1, x2, maxX3m1); exchangeData(maxX1m2, x2, minX3p3, minX1p1, x2, maxX3); } - else if (sendDir == D3Q27System::TW) + else if (sendDir == D3Q27System::DIR_M0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { exchangeData(minX1p3, x2, maxX3m3, maxX1, x2, minX3); exchangeData(minX1p2, x2, maxX3m2, maxX1m1, x2, minX3p1); exchangeData(minX1p3, x2, maxX3m2, maxX1, x2, minX3p1); exchangeData(minX1p2, x2, maxX3m3, maxX1m1, x2, minX3); } - else if (sendDir == D3Q27System::TN) + else if (sendDir == D3Q27System::DIR_0PP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, maxX2m3, maxX3m3, x1, minX2, minX3); exchangeData(x1, maxX2m2, maxX3m2, x1, minX2p1, minX3p1); exchangeData(x1, maxX2m3, maxX3m2, x1, minX2, minX3p1); exchangeData(x1, maxX2m2, maxX3m3, x1, minX2p1, minX3); } - else if (sendDir == D3Q27System::BS) + else if (sendDir == D3Q27System::DIR_0MM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, minX2p3, minX3p3, x1, maxX2, maxX3); exchangeData(x1, minX2p2, minX3p2, x1, maxX2m1, maxX3m1); exchangeData(x1, minX2p3, minX3p2, x1, maxX2, maxX3m1); exchangeData(x1, minX2p2, minX3p3, x1, maxX2m1, maxX3); } - else if (sendDir == D3Q27System::BN) + else if (sendDir == D3Q27System::DIR_0PM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, maxX2m3, minX3p3, x1, minX2, maxX3); exchangeData(x1, maxX2m2, minX3p2, x1, minX2p1, maxX3m1); exchangeData(x1, maxX2m3, minX3p2, x1, minX2, maxX3m1); exchangeData(x1, maxX2m2, minX3p3, x1, minX2p1, maxX3); } - else if (sendDir == D3Q27System::TS) + else if (sendDir == D3Q27System::DIR_0MP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { exchangeData(x1, minX2p3, maxX3m3, x1, maxX2, minX3); exchangeData(x1, minX2p2, maxX3m2, x1, maxX2m1, minX3p1); exchangeData(x1, minX2p3, maxX3m2, x1, maxX2, minX3p1); exchangeData(x1, minX2p2, maxX3m3, x1, maxX2m1, minX3); } - else if (sendDir == D3Q27System::TSW) { + else if (sendDir == D3Q27System::DIR_MMP) { exchangeData(minX1p3, minX2p3, maxX3m3, maxX1, maxX2, minX3); exchangeData(minX1p2, minX2p2, maxX3m2, maxX1m1, maxX2m1, minX3p1); exchangeData(minX1p3, minX2p2, maxX3m2, maxX1, maxX2m1, minX3p1); @@ -246,7 +246,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(minX1p3, minX2p3, maxX3m2, maxX1, maxX2, minX3p1); exchangeData(minX1p3, minX2p2, maxX3m3, maxX1, maxX2m1, minX3); exchangeData(minX1p2, minX2p3, maxX3m3, maxX1m1, maxX2, minX3); - } else if (sendDir == D3Q27System::TSE) { + } else if (sendDir == D3Q27System::DIR_PMP) { exchangeData(maxX1m3, minX1p3, maxX3m3, minX1, maxX2, minX3); exchangeData(maxX1m2, minX1p2, maxX3m2, minX1p1, maxX2m1, minX3p1); exchangeData(maxX1m3, minX1p2, maxX3m2, minX1, maxX2m1, minX3p1); @@ -255,7 +255,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(maxX1m3, minX1p3, maxX3m2, minX1, maxX2, minX3p1); exchangeData(maxX1m3, minX1p2, maxX3m3, minX1, maxX2m1, minX3); exchangeData(maxX1m2, minX1p3, maxX3m3, minX1p1, maxX2, minX3); - } else if (sendDir == D3Q27System::TNW) { + } else if (sendDir == D3Q27System::DIR_MPP) { exchangeData(minX1p3, maxX2m3, maxX3m3, maxX1, minX2, minX3); exchangeData(minX1p2, maxX2m2, maxX3m2, maxX1m1, minX2p1, minX3p1); exchangeData(minX1p3, maxX2m2, maxX3m2, maxX1, minX2p1, minX3p1); @@ -264,7 +264,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(minX1p3, maxX2m3, maxX3m2, maxX1, minX2, minX3p1); exchangeData(minX1p3, maxX2m2, maxX3m3, maxX1, minX2p1, minX3); exchangeData(minX1p2, maxX2m3, maxX3m3, maxX1m1, minX2, minX3); - } else if (sendDir == D3Q27System::TNE) { + } else if (sendDir == D3Q27System::DIR_PPP) { exchangeData(maxX1m3, maxX2m3, maxX3m3, minX1, minX2, minX3); exchangeData(maxX1m2, maxX2m2, maxX3m2, minX1p1, minX2p1, minX3p1); exchangeData(maxX1m3, maxX2m2, maxX3m2, minX1, minX2p1, minX3p1); @@ -273,7 +273,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(maxX1m3, maxX2m3, maxX3m2, minX1, minX2, minX3p1); exchangeData(maxX1m3, maxX2m2, maxX3m3, minX1, minX2p1, minX3); exchangeData(maxX1m2, maxX2m3, maxX3m3, minX1p1, minX2, minX3); - } else if (sendDir == D3Q27System::BSW) { + } else if (sendDir == D3Q27System::DIR_MMM) { exchangeData(minX1p3, minX2p3, minX3p3, maxX1, maxX2, maxX3); exchangeData(minX1p2, minX2p2, minX3p2, maxX1m1, maxX2m1, maxX3m1); exchangeData(minX1p3, minX2p2, minX3p2, maxX1, maxX2m1, maxX3m1); @@ -282,7 +282,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(minX1p3, minX2p3, minX3p2, maxX1, maxX2, maxX3m1); exchangeData(minX1p3, minX2p2, minX3p3, maxX1, maxX2m1, maxX3); exchangeData(minX1p2, minX2p3, minX3p3, maxX1m1, maxX2, maxX3); - } else if (sendDir == D3Q27System::BSE) { + } else if (sendDir == D3Q27System::DIR_PMM) { exchangeData(maxX1m3, minX2p3, minX3p3, minX1, maxX2, maxX3); exchangeData(maxX1m2, minX2p2, minX3p2, minX1p1, maxX2m1, maxX3m1); exchangeData(maxX1m3, minX2p2, minX3p2, minX1, maxX2m1, maxX3m1); @@ -291,7 +291,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(maxX1m3, minX2p3, minX3p2, minX1, maxX2, maxX3m1); exchangeData(maxX1m3, minX2p2, minX3p3, minX1, maxX2m1, maxX3); exchangeData(maxX1m2, minX2p3, minX3p3, minX1p1, maxX2, maxX3); - } else if (sendDir == D3Q27System::BNW) { + } else if (sendDir == D3Q27System::DIR_MPM) { exchangeData(minX1p3, maxX2m3, minX3p3, maxX1, minX2, maxX3); exchangeData(minX1p2, maxX2m2, minX3p2, maxX1m1, minX2p1, maxX3m1); exchangeData(minX1p3, maxX2m2, minX3p2, maxX1, minX2p1, maxX3m1); @@ -300,7 +300,7 @@ void TwoDistributionsDoubleGhostLayerFullDirectConnector::exchangeData() exchangeData(minX1p3, maxX2m3, minX3p2, maxX1, minX2, maxX3m1); exchangeData(minX1p3, maxX2m2, minX3p3, maxX1, minX2p1, maxX3); exchangeData(minX1p2, maxX2m3, minX3p3, maxX1m1, minX2, maxX3); - } else if (sendDir == D3Q27System::BNE) { + } else if (sendDir == D3Q27System::DIR_PPM) { exchangeData(maxX1m3, maxX2m3, minX3p3, minX1, minX2, maxX3); exchangeData(maxX1m2, maxX2m2, minX3p2, minX1p1, minX2p1, maxX3m1); exchangeData(maxX1m3, maxX2m2, minX3p2, minX1, minX2p1, maxX3m1); diff --git a/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.cpp b/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.cpp index b831cb840b3de012c1df35efd237e3e0c3f81056..9dc8a99deb20f8f49f40f7d2e7c8a0c66b687fcb 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.cpp +++ b/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsDoubleGhostLayerFullVectorConnector.cpp @@ -59,37 +59,37 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::init() int anz = 2*27+1; switch (sendDir) { - case D3Q27System::REST: UB_THROW(UbException(UB_EXARGS, "ZERO not allowed")); break; - case D3Q27System::E: - case D3Q27System::W: sender->getData().resize(maxX2*maxX3*anz*2, 0.0); break; - case D3Q27System::N: - case D3Q27System::S: sender->getData().resize(maxX1*maxX3*anz*2, 0.0); break; - case D3Q27System::T: - case D3Q27System::B: sender->getData().resize(maxX1*maxX2*anz*2, 0.0); break; + case D3Q27System::DIR_000: UB_THROW(UbException(UB_EXARGS, "ZERO not allowed")); break; + case D3Q27System::DIR_P00: + case D3Q27System::DIR_M00: sender->getData().resize(maxX2*maxX3*anz*2, 0.0); break; + case D3Q27System::DIR_0P0: + case D3Q27System::DIR_0M0: sender->getData().resize(maxX1*maxX3*anz*2, 0.0); break; + case D3Q27System::DIR_00P: + case D3Q27System::DIR_00M: sender->getData().resize(maxX1*maxX2*anz*2, 0.0); break; - case D3Q27System::NE: - case D3Q27System::SW: - case D3Q27System::SE: - case D3Q27System::NW: sender->getData().resize(maxX3*anz*4, 0.0); break; + case D3Q27System::DIR_PP0: + case D3Q27System::DIR_MM0: + case D3Q27System::DIR_PM0: + case D3Q27System::DIR_MP0: sender->getData().resize(maxX3*anz*4, 0.0); break; - case D3Q27System::TE: - case D3Q27System::BW: - case D3Q27System::BE: - case D3Q27System::TW: sender->getData().resize(maxX2*anz*4, 0.0); break; + case D3Q27System::DIR_P0P: + case D3Q27System::DIR_M0M: + case D3Q27System::DIR_P0M: + case D3Q27System::DIR_M0P: sender->getData().resize(maxX2*anz*4, 0.0); break; - case D3Q27System::TN: - case D3Q27System::BS: - case D3Q27System::BN: - case D3Q27System::TS: sender->getData().resize(maxX1*anz*4, 0.0); break; + case D3Q27System::DIR_0PP: + case D3Q27System::DIR_0MM: + case D3Q27System::DIR_0PM: + case D3Q27System::DIR_0MP: sender->getData().resize(maxX1*anz*4, 0.0); break; - case D3Q27System::TNE: - case D3Q27System::BSW: - case D3Q27System::BNE: - case D3Q27System::TSW: - case D3Q27System::TSE: - case D3Q27System::BNW: - case D3Q27System::BSE: - case D3Q27System::TNW: sender->getData().resize(anz*8, 0.0); break; + case D3Q27System::DIR_PPP: + case D3Q27System::DIR_MMM: + case D3Q27System::DIR_PPM: + case D3Q27System::DIR_MMP: + case D3Q27System::DIR_PMP: + case D3Q27System::DIR_MPM: + case D3Q27System::DIR_PMM: + case D3Q27System::DIR_MPP: sender->getData().resize(anz*8, 0.0); break; default: UB_THROW(UbException(UB_EXARGS, "unknown sendDir")); } @@ -137,7 +137,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() int index = 0; // EAST - if (sendDir == D3Q27System::E) { + if (sendDir == D3Q27System::DIR_P00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, maxX1m3, x2, x3); @@ -146,7 +146,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // WEST - else if (sendDir == D3Q27System::W) { + else if (sendDir == D3Q27System::DIR_M00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, minX1p3, x2, x3); @@ -155,7 +155,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // NORTH - else if (sendDir == D3Q27System::N) { + else if (sendDir == D3Q27System::DIR_0P0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, maxX2m3, x3); @@ -164,7 +164,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // SOUTH - else if (sendDir == D3Q27System::S) { + else if (sendDir == D3Q27System::DIR_0M0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, minX2p3, x3); @@ -174,7 +174,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() } // TOP - else if (sendDir == D3Q27System::T) { + else if (sendDir == D3Q27System::DIR_00P) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, x2, maxX3m3); @@ -183,7 +183,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // BOTTOM - else if (sendDir == D3Q27System::B) { + else if (sendDir == D3Q27System::DIR_00M) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, x2, minX3p3); @@ -192,7 +192,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // NORTHEAST - else if (sendDir == D3Q27System::NE) { + else if (sendDir == D3Q27System::DIR_PP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { fillData(sdata, index, maxX1m3, maxX2m3, x3); fillData(sdata, index, maxX1m2, maxX2m2, x3); @@ -201,7 +201,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // NORTHWEST - else if (sendDir == D3Q27System::NW) { + else if (sendDir == D3Q27System::DIR_MP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { fillData(sdata, index, minX1p3, maxX2m3, x3); fillData(sdata, index, minX1p2, maxX2m2, x3); @@ -210,7 +210,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // SOUTHWEST - else if (sendDir == D3Q27System::SW) { + else if (sendDir == D3Q27System::DIR_MM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { fillData(sdata, index, minX1p3, minX2p3, x3); fillData(sdata, index, minX1p2, minX2p2, x3); @@ -219,70 +219,70 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() } } // SOUTHEAST - else if (sendDir == D3Q27System::SE) { + else if (sendDir == D3Q27System::DIR_PM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { fillData(sdata, index, maxX1m3, minX2p3, x3); fillData(sdata, index, maxX1m2, minX2p2, x3); fillData(sdata, index, maxX1m3, minX2p2, x3); fillData(sdata, index, maxX1m2, minX2p3, x3); } - } else if (sendDir == D3Q27System::TE) + } else if (sendDir == D3Q27System::DIR_P0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, maxX1m3, x2, maxX3m3); fillData(sdata, index, maxX1m2, x2, maxX3m2); fillData(sdata, index, maxX1m3, x2, maxX3m2); fillData(sdata, index, maxX1m2, x2, maxX3m3); } - else if (sendDir == D3Q27System::BW) + else if (sendDir == D3Q27System::DIR_M0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, minX1p3, x2, minX3p3); fillData(sdata, index, minX1p2, x2, minX3p2); fillData(sdata, index, minX1p3, x2, minX3p2); fillData(sdata, index, minX1p2, x2, minX3p3); } - else if (sendDir == D3Q27System::BE) + else if (sendDir == D3Q27System::DIR_P0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, maxX1m3, x2, minX3p3); fillData(sdata, index, maxX1m2, x2, minX3p2); fillData(sdata, index, maxX1m3, x2, minX3p2); fillData(sdata, index, maxX1m2, x2, minX3p3); } - else if (sendDir == D3Q27System::TW) + else if (sendDir == D3Q27System::DIR_M0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { fillData(sdata, index, minX1p3, x2, maxX3m3); fillData(sdata, index, minX1p2, x2, maxX3m2); fillData(sdata, index, minX1p3, x2, maxX3m2); fillData(sdata, index, minX1p2, x2, maxX3m3); } - else if (sendDir == D3Q27System::TN) + else if (sendDir == D3Q27System::DIR_0PP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, maxX2m3, maxX3m3); fillData(sdata, index, x1, maxX2m2, maxX3m2); fillData(sdata, index, x1, maxX2m3, maxX3m2); fillData(sdata, index, x1, maxX2m2, maxX3m3); } - else if (sendDir == D3Q27System::BS) + else if (sendDir == D3Q27System::DIR_0MM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, minX2p3, minX3p3); fillData(sdata, index, x1, minX2p2, minX3p2); fillData(sdata, index, x1, minX2p3, minX3p2); fillData(sdata, index, x1, minX2p2, minX3p3); } - else if (sendDir == D3Q27System::BN) + else if (sendDir == D3Q27System::DIR_0PM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, maxX2m3, minX3p3); fillData(sdata, index, x1, maxX2m2, minX3p2); fillData(sdata, index, x1, maxX2m3, minX3p2); fillData(sdata, index, x1, maxX2m2, minX3p3); } - else if (sendDir == D3Q27System::TS) + else if (sendDir == D3Q27System::DIR_0MP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { fillData(sdata, index, x1, minX2p3, maxX3m3); fillData(sdata, index, x1, minX2p2, maxX3m2); fillData(sdata, index, x1, minX2p3, maxX3m2); fillData(sdata, index, x1, minX2p2, maxX3m3); } - else if (sendDir == D3Q27System::TSW) { + else if (sendDir == D3Q27System::DIR_MMP) { fillData(sdata, index, minX1p3, minX2p3, maxX3m3); fillData(sdata, index, minX1p2, minX2p2, maxX3m2); fillData(sdata, index, minX1p3, minX2p2, maxX3m2); @@ -291,7 +291,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, minX1p3, minX2p3, maxX3m2); fillData(sdata, index, minX1p3, minX2p2, maxX3m3); fillData(sdata, index, minX1p2, minX2p3, maxX3m3); - } else if (sendDir == D3Q27System::TSE) { + } else if (sendDir == D3Q27System::DIR_PMP) { fillData(sdata, index, maxX1m3, minX1p3, maxX3m3); fillData(sdata, index, maxX1m2, minX1p2, maxX3m2); fillData(sdata, index, maxX1m3, minX1p2, maxX3m2); @@ -300,7 +300,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, maxX1m3, minX1p3, maxX3m2); fillData(sdata, index, maxX1m3, minX1p2, maxX3m3); fillData(sdata, index, maxX1m2, minX1p3, maxX3m3); - } else if (sendDir == D3Q27System::TNW) { + } else if (sendDir == D3Q27System::DIR_MPP) { fillData(sdata, index, minX1p3, maxX2m3, maxX3m3); fillData(sdata, index, minX1p2, maxX2m2, maxX3m2); fillData(sdata, index, minX1p3, maxX2m2, maxX3m2); @@ -309,7 +309,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, minX1p3, maxX2m3, maxX3m2); fillData(sdata, index, minX1p3, maxX2m2, maxX3m3); fillData(sdata, index, minX1p2, maxX2m3, maxX3m3); - } else if (sendDir == D3Q27System::TNE) { + } else if (sendDir == D3Q27System::DIR_PPP) { fillData(sdata, index, maxX1m3, maxX2m3, maxX3m3); fillData(sdata, index, maxX1m2, maxX2m2, maxX3m2); fillData(sdata, index, maxX1m3, maxX2m2, maxX3m2); @@ -318,7 +318,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, maxX1m3, maxX2m3, maxX3m2); fillData(sdata, index, maxX1m3, maxX2m2, maxX3m3); fillData(sdata, index, maxX1m2, maxX2m3, maxX3m3); - } else if (sendDir == D3Q27System::BSW) { + } else if (sendDir == D3Q27System::DIR_MMM) { fillData(sdata, index, minX1p3, minX2p3, minX3p3); fillData(sdata, index, minX1p2, minX2p2, minX3p2); fillData(sdata, index, minX1p3, minX2p2, minX3p2); @@ -327,7 +327,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, minX1p3, minX2p3, minX3p2); fillData(sdata, index, minX1p3, minX2p2, minX3p3); fillData(sdata, index, minX1p2, minX2p3, minX3p3); - } else if (sendDir == D3Q27System::BSE) { + } else if (sendDir == D3Q27System::DIR_PMM) { fillData(sdata, index, maxX1m3, minX2p3, minX3p3); fillData(sdata, index, maxX1m2, minX2p2, minX3p2); fillData(sdata, index, maxX1m3, minX2p2, minX3p2); @@ -336,7 +336,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, maxX1m3, minX2p3, minX3p2); fillData(sdata, index, maxX1m3, minX2p2, minX3p3); fillData(sdata, index, maxX1m2, minX2p3, minX3p3); - } else if (sendDir == D3Q27System::BNW) { + } else if (sendDir == D3Q27System::DIR_MPM) { fillData(sdata, index, minX1p3, maxX2m3, minX3p3); fillData(sdata, index, minX1p2, maxX2m2, minX3p2); fillData(sdata, index, minX1p3, maxX2m2, minX3p2); @@ -345,7 +345,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::fillData() fillData(sdata, index, minX1p3, maxX2m3, minX3p2); fillData(sdata, index, minX1p3, maxX2m2, minX3p3); fillData(sdata, index, minX1p2, maxX2m3, minX3p3); - } else if (sendDir == D3Q27System::BNE) { + } else if (sendDir == D3Q27System::DIR_PPM) { fillData(sdata, index, maxX1m3, maxX2m3, minX3p3); fillData(sdata, index, maxX1m2, maxX2m2, minX3p2); fillData(sdata, index, maxX1m3, maxX2m2, minX3p2); @@ -399,7 +399,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() int maxX3m2 = maxX3 - 2; //int maxX3m3 = maxX3 - 3; - if (sendDir == D3Q27System::W) { + if (sendDir == D3Q27System::DIR_M00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, minX1, x2, x3); @@ -407,7 +407,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::E) { + else if (sendDir == D3Q27System::DIR_P00) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, maxX1, x2, x3); @@ -415,7 +415,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::S) { + else if (sendDir == D3Q27System::DIR_0M0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, minX2, x3); @@ -423,7 +423,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::N) { + else if (sendDir == D3Q27System::DIR_0P0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, maxX2, x3); @@ -431,7 +431,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::B) { + else if (sendDir == D3Q27System::DIR_00M) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, x2, minX3); @@ -439,7 +439,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::T) { + else if (sendDir == D3Q27System::DIR_00P) { for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, x2, maxX3); @@ -447,7 +447,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() } } } - else if (sendDir == D3Q27System::SW) { + else if (sendDir == D3Q27System::DIR_MM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { distributeData(rdata, index, minX1, minX2, x3); distributeData(rdata, index, minX1p1, minX2p1, x3); @@ -455,7 +455,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, minX1p1, minX2, x3); } } - else if (sendDir == D3Q27System::SE) { + else if (sendDir == D3Q27System::DIR_PM0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { distributeData(rdata, index, maxX1, minX2, x3); distributeData(rdata, index, maxX1m1, minX2p1, x3); @@ -463,7 +463,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1m1, minX2, x3); } } - else if (sendDir == D3Q27System::NE) { + else if (sendDir == D3Q27System::DIR_PP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { distributeData(rdata, index, maxX1, maxX2, x3); distributeData(rdata, index, maxX1m1, maxX2m1, x3); @@ -471,70 +471,70 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1m1, maxX2, x3); } } - else if (sendDir == D3Q27System::NW) { + else if (sendDir == D3Q27System::DIR_MP0) { for (int x3 = minX3p2; x3 <= maxX3m2; x3++) { distributeData(rdata, index, minX1, maxX2, x3); distributeData(rdata, index, minX1p1, maxX2m1, x3); distributeData(rdata, index, minX1, maxX2m1, x3); distributeData(rdata, index, minX1p1, maxX2, x3); } - } else if (sendDir == D3Q27System::BW) + } else if (sendDir == D3Q27System::DIR_M0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, minX1, x2, minX3); distributeData(rdata, index, minX1p1, x2, minX3p1); distributeData(rdata, index, minX1, x2, minX3p1); distributeData(rdata, index, minX1p1, x2, minX3); } - else if (sendDir == D3Q27System::TE) + else if (sendDir == D3Q27System::DIR_P0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, maxX1, x2, maxX3); distributeData(rdata, index, maxX1m1, x2, maxX3m1); distributeData(rdata, index, maxX1, x2, maxX3m1); distributeData(rdata, index, maxX1m1, x2, maxX3); } - else if (sendDir == D3Q27System::TW) + else if (sendDir == D3Q27System::DIR_M0P) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, minX1, x2, maxX3); distributeData(rdata, index, minX1p1, x2, maxX3m1); distributeData(rdata, index, minX1, x2, maxX3m1); distributeData(rdata, index, minX1p1, x2, maxX3); } - else if (sendDir == D3Q27System::BE) + else if (sendDir == D3Q27System::DIR_P0M) for (int x2 = minX2p2; x2 <= maxX2m2; x2++) { distributeData(rdata, index, maxX1, x2, minX3); distributeData(rdata, index, maxX1m1, x2, minX3p1); distributeData(rdata, index, maxX1, x2, minX3p1); distributeData(rdata, index, maxX1m1, x2, minX3); } - else if (sendDir == D3Q27System::BS) + else if (sendDir == D3Q27System::DIR_0MM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, minX2, minX3); distributeData(rdata, index, x1, minX2p1, minX3p1); distributeData(rdata, index, x1, minX2, minX3p1); distributeData(rdata, index, x1, minX2p1, minX3); } - else if (sendDir == D3Q27System::TN) + else if (sendDir == D3Q27System::DIR_0PP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, maxX2, maxX3); distributeData(rdata, index, x1, maxX2m1, maxX3m1); distributeData(rdata, index, x1, maxX2, maxX3m1); distributeData(rdata, index, x1, maxX2m1, maxX3); } - else if (sendDir == D3Q27System::TS) + else if (sendDir == D3Q27System::DIR_0MP) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, minX2, maxX3); distributeData(rdata, index, x1, minX2p1, maxX3m1); distributeData(rdata, index, x1, minX2, maxX3m1); distributeData(rdata, index, x1, minX2p1, maxX3); } - else if (sendDir == D3Q27System::BN) + else if (sendDir == D3Q27System::DIR_0PM) for (int x1 = minX1p2; x1 <= maxX1m2; x1++) { distributeData(rdata, index, x1, maxX2, minX3); distributeData(rdata, index, x1, maxX2m1, minX3p1); distributeData(rdata, index, x1, maxX2, minX3p1); distributeData(rdata, index, x1, maxX2m1, minX3); } - else if (sendDir == D3Q27System::BNE) { + else if (sendDir == D3Q27System::DIR_PPM) { distributeData(rdata, index, maxX1, maxX2, minX3); distributeData(rdata, index, maxX1m1, maxX2m1, minX3p1); distributeData(rdata, index, maxX1, maxX2m1, minX3p1); @@ -543,7 +543,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1, maxX2, minX3p1); distributeData(rdata, index, maxX1, maxX2m1, minX3); distributeData(rdata, index, maxX1m1, maxX2, minX3); - } else if (sendDir == D3Q27System::BNW) { + } else if (sendDir == D3Q27System::DIR_MPM) { distributeData(rdata, index, minX1, maxX2, minX3); distributeData(rdata, index, minX1p1, maxX2m1, minX3p1); distributeData(rdata, index, minX1, maxX2m1, minX3p1); @@ -552,7 +552,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, minX1, maxX2, minX3p1); distributeData(rdata, index, minX1, maxX2m1, minX3); distributeData(rdata, index, minX1p1, maxX2, minX3); - } else if (sendDir == D3Q27System::BSE) { + } else if (sendDir == D3Q27System::DIR_PMM) { distributeData(rdata, index, maxX1, minX2, minX3); distributeData(rdata, index, maxX1m1, minX2p1, minX3p1); distributeData(rdata, index, maxX1, minX2p1, minX3p1); @@ -561,7 +561,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1, minX2, minX3p1); distributeData(rdata, index, maxX1, minX2p1, minX3); distributeData(rdata, index, maxX1m1, minX2, minX3); - } else if (sendDir == D3Q27System::BSW) { + } else if (sendDir == D3Q27System::DIR_MMM) { distributeData(rdata, index, minX1, minX2, minX3); distributeData(rdata, index, minX1p1, minX2p1, minX3p1); distributeData(rdata, index, minX1, minX2p1, minX3p1); @@ -570,7 +570,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, minX1, minX2, minX3p1); distributeData(rdata, index, minX1, minX2p1, minX3); distributeData(rdata, index, minX1p1, minX2, minX3); - } else if (sendDir == D3Q27System::TNE) { + } else if (sendDir == D3Q27System::DIR_PPP) { distributeData(rdata, index, maxX1, maxX2, maxX3); distributeData(rdata, index, maxX1m1, maxX2m1, maxX3m1); distributeData(rdata, index, maxX1, maxX2m1, maxX3m1); @@ -579,7 +579,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1, maxX2, maxX3m1); distributeData(rdata, index, maxX1, maxX2m1, maxX3); distributeData(rdata, index, maxX1m1, maxX2, maxX3); - } else if (sendDir == D3Q27System::TNW) { + } else if (sendDir == D3Q27System::DIR_MPP) { distributeData(rdata, index, minX1, maxX2, maxX3); distributeData(rdata, index, minX1p1, maxX2m1, maxX3m1); distributeData(rdata, index, minX1, maxX2m1, maxX3m1); @@ -588,7 +588,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, minX1, maxX2, maxX3m1); distributeData(rdata, index, minX1, maxX2m1, maxX3); distributeData(rdata, index, minX1p1, maxX2, maxX3); - } else if (sendDir == D3Q27System::TSE) { + } else if (sendDir == D3Q27System::DIR_PMP) { distributeData(rdata, index, maxX1, minX2, maxX3); distributeData(rdata, index, maxX1m1, minX2p1, maxX3m1); distributeData(rdata, index, maxX1, minX2p1, maxX3m1); @@ -597,7 +597,7 @@ void TwoDistributionsDoubleGhostLayerFullVectorConnector::distributeData() distributeData(rdata, index, maxX1, minX2, maxX3m1); distributeData(rdata, index, maxX1, minX2p1, maxX3); distributeData(rdata, index, maxX1m1, minX2, maxX3); - } else if (sendDir == D3Q27System::TSW) { + } else if (sendDir == D3Q27System::DIR_MMP) { distributeData(rdata, index, minX1, minX2, maxX3); distributeData(rdata, index, minX1p1, minX2p1, maxX3m1); distributeData(rdata, index, minX1, minX2p1, maxX3m1); diff --git a/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsFullVectorConnector.cpp b/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsFullVectorConnector.cpp index 7fe8bc3643c337323ef25ee35c260597744e6191..bab931d93dd99cf89f4517159cef1d6efc000eff 100644 --- a/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsFullVectorConnector.cpp +++ b/src/cpu/VirtualFluidsCore/Connectors/TwoDistributionsFullVectorConnector.cpp @@ -58,37 +58,37 @@ void TwoDistributionsFullVectorConnector::init() int anz = 2*27; switch (sendDir) { - case D3Q27System::REST: UB_THROW(UbException(UB_EXARGS, "ZERO not allowed")); break; - case D3Q27System::E: - case D3Q27System::W: sender->getData().resize(maxX2*maxX3*anz, 0.0); break; - case D3Q27System::N: - case D3Q27System::S: sender->getData().resize(maxX1*maxX3*anz, 0.0); break; - case D3Q27System::T: - case D3Q27System::B: sender->getData().resize(maxX1*maxX2*anz, 0.0); break; + case D3Q27System::DIR_000: UB_THROW(UbException(UB_EXARGS, "ZERO not allowed")); break; + case D3Q27System::DIR_P00: + case D3Q27System::DIR_M00: sender->getData().resize(maxX2*maxX3*anz, 0.0); break; + case D3Q27System::DIR_0P0: + case D3Q27System::DIR_0M0: sender->getData().resize(maxX1*maxX3*anz, 0.0); break; + case D3Q27System::DIR_00P: + case D3Q27System::DIR_00M: sender->getData().resize(maxX1*maxX2*anz, 0.0); break; - case D3Q27System::NE: - case D3Q27System::SW: - case D3Q27System::SE: - case D3Q27System::NW: sender->getData().resize(maxX3*anz, 0.0); break; + case D3Q27System::DIR_PP0: + case D3Q27System::DIR_MM0: + case D3Q27System::DIR_PM0: + case D3Q27System::DIR_MP0: sender->getData().resize(maxX3*anz, 0.0); break; - case D3Q27System::TE: - case D3Q27System::BW: - case D3Q27System::BE: - case D3Q27System::TW: sender->getData().resize(maxX2*anz, 0.0); break; + case D3Q27System::DIR_P0P: + case D3Q27System::DIR_M0M: + case D3Q27System::DIR_P0M: + case D3Q27System::DIR_M0P: sender->getData().resize(maxX2*anz, 0.0); break; - case D3Q27System::TN: - case D3Q27System::BS: - case D3Q27System::BN: - case D3Q27System::TS: sender->getData().resize(maxX1*anz, 0.0); break; + case D3Q27System::DIR_0PP: + case D3Q27System::DIR_0MM: + case D3Q27System::DIR_0PM: + case D3Q27System::DIR_0MP: sender->getData().resize(maxX1*anz, 0.0); break; - case D3Q27System::TNE: - case D3Q27System::BSW: - case D3Q27System::BNE: - case D3Q27System::TSW: - case D3Q27System::TSE: - case D3Q27System::BNW: - case D3Q27System::BSE: - case D3Q27System::TNW: sender->getData().resize(anz, 0.0); break; + case D3Q27System::DIR_PPP: + case D3Q27System::DIR_MMM: + case D3Q27System::DIR_PPM: + case D3Q27System::DIR_MMP: + case D3Q27System::DIR_PMP: + case D3Q27System::DIR_MPM: + case D3Q27System::DIR_PMM: + case D3Q27System::DIR_MPP: sender->getData().resize(anz, 0.0); break; default: UB_THROW(UbException(UB_EXARGS, "unknown sendDir")); } diff --git a/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSoA.cpp b/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSoA.cpp index bd6d46c2bdaeb72244578b4e3f3625cd2dfe7ff1..0585947928e4fdc626659ed1a1d0e956fdd62de6 100644 --- a/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSoA.cpp +++ b/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSoA.cpp @@ -91,35 +91,35 @@ void D3Q27EsoTwist3DSoA::getDistribution(LBMReal *const f, size_t x1, size_t x2, size_t x2p = x2 + 1; size_t x3p = x3 + 1; - f[D3Q27System::E] = (*d.E)(x1, x2, x3); - f[D3Q27System::N] = (*d.N)(x1, x2, x3); - f[D3Q27System::T] = (*d.T)(x1, x2, x3); - f[D3Q27System::NE] = (*d.NE)(x1, x2, x3); - f[D3Q27System::NW] = (*d.NW)(x1p, x2, x3); - f[D3Q27System::TE] = (*d.TE)(x1, x2, x3); - f[D3Q27System::TW] = (*d.TW)(x1p, x2, x3); - f[D3Q27System::TN] = (*d.TN)(x1, x2, x3); - f[D3Q27System::TS] = (*d.TS)(x1, x2p, x3); - f[D3Q27System::TNE] = (*d.TNE)(x1, x2, x3); - f[D3Q27System::TNW] = (*d.TNW)(x1p, x2, x3); - f[D3Q27System::TSE] = (*d.TSE)(x1, x2p, x3); - f[D3Q27System::TSW] = (*d.TSW)(x1p, x2p, x3); + f[D3Q27System::DIR_P00] = (*d.E)(x1, x2, x3); + f[D3Q27System::DIR_0P0] = (*d.N)(x1, x2, x3); + f[D3Q27System::DIR_00P] = (*d.T)(x1, x2, x3); + f[D3Q27System::DIR_PP0] = (*d.NE)(x1, x2, x3); + f[D3Q27System::DIR_MP0] = (*d.NW)(x1p, x2, x3); + f[D3Q27System::DIR_P0P] = (*d.TE)(x1, x2, x3); + f[D3Q27System::DIR_M0P] = (*d.TW)(x1p, x2, x3); + f[D3Q27System::DIR_0PP] = (*d.TN)(x1, x2, x3); + f[D3Q27System::DIR_0MP] = (*d.TS)(x1, x2p, x3); + f[D3Q27System::DIR_PPP] = (*d.TNE)(x1, x2, x3); + f[D3Q27System::DIR_MPP] = (*d.TNW)(x1p, x2, x3); + f[D3Q27System::DIR_PMP] = (*d.TSE)(x1, x2p, x3); + f[D3Q27System::DIR_MMP] = (*d.TSW)(x1p, x2p, x3); - f[D3Q27System::W] = (*d.W)(x1p, x2, x3); - f[D3Q27System::S] = (*d.S)(x1, x2p, x3); - f[D3Q27System::B] = (*d.B)(x1, x2, x3p); - f[D3Q27System::SW] = (*d.SW)(x1p, x2p, x3); - f[D3Q27System::SE] = (*d.SE)(x1, x2p, x3); - f[D3Q27System::BW] = (*d.BW)(x1p, x2, x3p); - f[D3Q27System::BE] = (*d.BE)(x1, x2, x3p); - f[D3Q27System::BS] = (*d.BS)(x1, x2p, x3p); - f[D3Q27System::BN] = (*d.BN)(x1, x2, x3p); - f[D3Q27System::BSW] = (*d.BSW)(x1p, x2p, x3p); - f[D3Q27System::BSE] = (*d.BSE)(x1, x2p, x3p); - f[D3Q27System::BNW] = (*d.BNW)(x1p, x2, x3p); - f[D3Q27System::BNE] = (*d.BNE)(x1, x2, x3p); + f[D3Q27System::DIR_M00] = (*d.W)(x1p, x2, x3); + f[D3Q27System::DIR_0M0] = (*d.S)(x1, x2p, x3); + f[D3Q27System::DIR_00M] = (*d.B)(x1, x2, x3p); + f[D3Q27System::DIR_MM0] = (*d.SW)(x1p, x2p, x3); + f[D3Q27System::DIR_PM0] = (*d.SE)(x1, x2p, x3); + f[D3Q27System::DIR_M0M] = (*d.BW)(x1p, x2, x3p); + f[D3Q27System::DIR_P0M] = (*d.BE)(x1, x2, x3p); + f[D3Q27System::DIR_0MM] = (*d.BS)(x1, x2p, x3p); + f[D3Q27System::DIR_0PM] = (*d.BN)(x1, x2, x3p); + f[D3Q27System::DIR_MMM] = (*d.BSW)(x1p, x2p, x3p); + f[D3Q27System::DIR_PMM] = (*d.BSE)(x1, x2p, x3p); + f[D3Q27System::DIR_MPM] = (*d.BNW)(x1p, x2, x3p); + f[D3Q27System::DIR_PPM] = (*d.BNE)(x1, x2, x3p); - f[D3Q27System::REST] = (*d.REST)(x1, x2, x3); + f[D3Q27System::DIR_000] = (*d.REST)(x1, x2, x3); } ////////////////////////////////////////////////////////////////////////// void D3Q27EsoTwist3DSoA::setDistribution(const LBMReal *const f, size_t x1, size_t x2, size_t x3) @@ -128,99 +128,99 @@ void D3Q27EsoTwist3DSoA::setDistribution(const LBMReal *const f, size_t x1, size size_t x2p = x2 + 1; size_t x3p = x3 + 1; - (*d.E)(x1, x2, x3) = f[D3Q27System::INV_E]; - (*d.N)(x1, x2, x3) = f[D3Q27System::INV_N]; - (*d.T)(x1, x2, x3) = f[D3Q27System::INV_T]; - (*d.NE)(x1, x2, x3) = f[D3Q27System::INV_NE]; - (*d.NW)(x1p, x2, x3) = f[D3Q27System::INV_NW]; - (*d.TE)(x1, x2, x3) = f[D3Q27System::INV_TE]; - (*d.TW)(x1p, x2, x3) = f[D3Q27System::INV_TW]; - (*d.TN)(x1, x2, x3) = f[D3Q27System::INV_TN]; - (*d.TS)(x1, x2p, x3) = f[D3Q27System::INV_TS]; - (*d.TNE)(x1, x2, x3) = f[D3Q27System::INV_TNE]; - (*d.TNW)(x1p, x2, x3) = f[D3Q27System::INV_TNW]; - (*d.TSE)(x1, x2p, x3) = f[D3Q27System::INV_TSE]; - (*d.TSW)(x1p, x2p, x3) = f[D3Q27System::INV_TSW]; + (*d.E)(x1, x2, x3) = f[D3Q27System::INV_P00]; + (*d.N)(x1, x2, x3) = f[D3Q27System::INV_0P0]; + (*d.T)(x1, x2, x3) = f[D3Q27System::INV_00P]; + (*d.NE)(x1, x2, x3) = f[D3Q27System::INV_PP0]; + (*d.NW)(x1p, x2, x3) = f[D3Q27System::INV_MP0]; + (*d.TE)(x1, x2, x3) = f[D3Q27System::INV_P0P]; + (*d.TW)(x1p, x2, x3) = f[D3Q27System::INV_M0P]; + (*d.TN)(x1, x2, x3) = f[D3Q27System::INV_0PP]; + (*d.TS)(x1, x2p, x3) = f[D3Q27System::INV_0MP]; + (*d.TNE)(x1, x2, x3) = f[D3Q27System::INV_PPP]; + (*d.TNW)(x1p, x2, x3) = f[D3Q27System::INV_MPP]; + (*d.TSE)(x1, x2p, x3) = f[D3Q27System::INV_PMP]; + (*d.TSW)(x1p, x2p, x3) = f[D3Q27System::INV_MMP]; - (*d.W)(x1p, x2, x3) = f[D3Q27System::INV_W]; - (*d.S)(x1, x2p, x3) = f[D3Q27System::INV_S]; - (*d.B)(x1, x2, x3p) = f[D3Q27System::INV_B]; - (*d.SW)(x1p, x2p, x3) = f[D3Q27System::INV_SW]; - (*d.SE)(x1, x2p, x3) = f[D3Q27System::INV_SE]; - (*d.BW)(x1p, x2, x3p) = f[D3Q27System::INV_BW]; - (*d.BE)(x1, x2, x3p) = f[D3Q27System::INV_BE]; - (*d.BS)(x1, x2p, x3p) = f[D3Q27System::INV_BS]; - (*d.BN)(x1, x2, x3p) = f[D3Q27System::INV_BN]; - (*d.BSW)(x1p, x2p, x3p) = f[D3Q27System::INV_BSW]; - (*d.BSE)(x1, x2p, x3p) = f[D3Q27System::INV_BSE]; - (*d.BNW)(x1p, x2, x3p) = f[D3Q27System::INV_BNW]; - (*d.BNE)(x1, x2, x3p) = f[D3Q27System::INV_BNE]; + (*d.W)(x1p, x2, x3) = f[D3Q27System::INV_M00]; + (*d.S)(x1, x2p, x3) = f[D3Q27System::INV_0M0]; + (*d.B)(x1, x2, x3p) = f[D3Q27System::INV_00M]; + (*d.SW)(x1p, x2p, x3) = f[D3Q27System::INV_MM0]; + (*d.SE)(x1, x2p, x3) = f[D3Q27System::INV_PM0]; + (*d.BW)(x1p, x2, x3p) = f[D3Q27System::INV_M0M]; + (*d.BE)(x1, x2, x3p) = f[D3Q27System::INV_P0M]; + (*d.BS)(x1, x2p, x3p) = f[D3Q27System::INV_0MM]; + (*d.BN)(x1, x2, x3p) = f[D3Q27System::INV_0PM]; + (*d.BSW)(x1p, x2p, x3p) = f[D3Q27System::INV_MMM]; + (*d.BSE)(x1, x2p, x3p) = f[D3Q27System::INV_PMM]; + (*d.BNW)(x1p, x2, x3p) = f[D3Q27System::INV_MPM]; + (*d.BNE)(x1, x2, x3p) = f[D3Q27System::INV_PPM]; - (*d.REST)(x1, x2, x3) = f[D3Q27System::REST]; + (*d.REST)(x1, x2, x3) = f[D3Q27System::DIR_000]; } ////////////////////////////////////////////////////////////////////////// void D3Q27EsoTwist3DSoA::getDistributionInv(LBMReal *const f, size_t x1, size_t x2, size_t x3) { - f[D3Q27System::INV_E] = (*d.E)(x1, x2, x3); - f[D3Q27System::INV_N] = (*d.N)(x1, x2, x3); - f[D3Q27System::INV_T] = (*d.T)(x1, x2, x3); - f[D3Q27System::INV_NE] = (*d.NE)(x1, x2, x3); - f[D3Q27System::INV_NW] = (*d.NW)(x1 + 1, x2, x3); - f[D3Q27System::INV_TE] = (*d.TE)(x1, x2, x3); - f[D3Q27System::INV_TW] = (*d.TW)(x1 + 1, x2, x3); - f[D3Q27System::INV_TN] = (*d.TN)(x1, x2, x3); - f[D3Q27System::INV_TS] = (*d.TS)(x1, x2 + 1, x3); - f[D3Q27System::INV_TNE] = (*d.TNE)(x1, x2, x3); - f[D3Q27System::INV_TNW] = (*d.TNW)(x1 + 1, x2, x3); - f[D3Q27System::INV_TSE] = (*d.TSE)(x1, x2 + 1, x3); - f[D3Q27System::INV_TSW] = (*d.TSW)(x1 + 1, x2 + 1, x3); + f[D3Q27System::INV_P00] = (*d.E)(x1, x2, x3); + f[D3Q27System::INV_0P0] = (*d.N)(x1, x2, x3); + f[D3Q27System::INV_00P] = (*d.T)(x1, x2, x3); + f[D3Q27System::INV_PP0] = (*d.NE)(x1, x2, x3); + f[D3Q27System::INV_MP0] = (*d.NW)(x1 + 1, x2, x3); + f[D3Q27System::INV_P0P] = (*d.TE)(x1, x2, x3); + f[D3Q27System::INV_M0P] = (*d.TW)(x1 + 1, x2, x3); + f[D3Q27System::INV_0PP] = (*d.TN)(x1, x2, x3); + f[D3Q27System::INV_0MP] = (*d.TS)(x1, x2 + 1, x3); + f[D3Q27System::INV_PPP] = (*d.TNE)(x1, x2, x3); + f[D3Q27System::INV_MPP] = (*d.TNW)(x1 + 1, x2, x3); + f[D3Q27System::INV_PMP] = (*d.TSE)(x1, x2 + 1, x3); + f[D3Q27System::INV_MMP] = (*d.TSW)(x1 + 1, x2 + 1, x3); - f[D3Q27System::INV_W] = (*d.W)(x1 + 1, x2, x3); - f[D3Q27System::INV_S] = (*d.S)(x1, x2 + 1, x3); - f[D3Q27System::INV_B] = (*d.B)(x1, x2, x3 + 1); - f[D3Q27System::INV_SW] = (*d.SW)(x1 + 1, x2 + 1, x3); - f[D3Q27System::INV_SE] = (*d.SE)(x1, x2 + 1, x3); - f[D3Q27System::INV_BW] = (*d.BW)(x1 + 1, x2, x3 + 1); - f[D3Q27System::INV_BE] = (*d.BE)(x1, x2, x3 + 1); - f[D3Q27System::INV_BS] = (*d.BS)(x1, x2 + 1, x3 + 1); - f[D3Q27System::INV_BN] = (*d.BN)(x1, x2, x3 + 1); - f[D3Q27System::INV_BSW] = (*d.BSW)(x1 + 1, x2 + 1, x3 + 1); - f[D3Q27System::INV_BSE] = (*d.BSE)(x1, x2 + 1, x3 + 1); - f[D3Q27System::INV_BNW] = (*d.BNW)(x1 + 1, x2, x3 + 1); - f[D3Q27System::INV_BNE] = (*d.BNE)(x1, x2, x3 + 1); + f[D3Q27System::INV_M00] = (*d.W)(x1 + 1, x2, x3); + f[D3Q27System::INV_0M0] = (*d.S)(x1, x2 + 1, x3); + f[D3Q27System::INV_00M] = (*d.B)(x1, x2, x3 + 1); + f[D3Q27System::INV_MM0] = (*d.SW)(x1 + 1, x2 + 1, x3); + f[D3Q27System::INV_PM0] = (*d.SE)(x1, x2 + 1, x3); + f[D3Q27System::INV_M0M] = (*d.BW)(x1 + 1, x2, x3 + 1); + f[D3Q27System::INV_P0M] = (*d.BE)(x1, x2, x3 + 1); + f[D3Q27System::INV_0MM] = (*d.BS)(x1, x2 + 1, x3 + 1); + f[D3Q27System::INV_0PM] = (*d.BN)(x1, x2, x3 + 1); + f[D3Q27System::INV_MMM] = (*d.BSW)(x1 + 1, x2 + 1, x3 + 1); + f[D3Q27System::INV_PMM] = (*d.BSE)(x1, x2 + 1, x3 + 1); + f[D3Q27System::INV_MPM] = (*d.BNW)(x1 + 1, x2, x3 + 1); + f[D3Q27System::INV_PPM] = (*d.BNE)(x1, x2, x3 + 1); - f[D3Q27System::REST] = (*d.REST)(x1, x2, x3); + f[D3Q27System::DIR_000] = (*d.REST)(x1, x2, x3); } ////////////////////////////////////////////////////////////////////////// void D3Q27EsoTwist3DSoA::setDistributionInv(const LBMReal *const f, size_t x1, size_t x2, size_t x3) { - //(*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f[D3Q27System::E]; - //(*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f[D3Q27System::N]; - //(*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f[D3Q27System::T]; - //(*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f[D3Q27System::NE]; - //(*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f[D3Q27System::NW]; - //(*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f[D3Q27System::TE]; - //(*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f[D3Q27System::TW]; - //(*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f[D3Q27System::TN]; - //(*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f[D3Q27System::TS]; - //(*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f[D3Q27System::TNE]; - //(*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f[D3Q27System::TNW]; - //(*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f[D3Q27System::TSE]; - //(*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f[D3Q27System::TSW]; + //(*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f[D3Q27System::DIR_P00]; + //(*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f[D3Q27System::DIR_0P0]; + //(*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f[D3Q27System::DIR_00P]; + //(*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f[D3Q27System::DIR_PP0]; + //(*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f[D3Q27System::DIR_MP0]; + //(*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f[D3Q27System::DIR_P0P]; + //(*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f[D3Q27System::DIR_M0P]; + //(*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f[D3Q27System::DIR_0PP]; + //(*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f[D3Q27System::DIR_0MP]; + //(*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f[D3Q27System::DIR_PPP]; + //(*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f[D3Q27System::DIR_MPP]; + //(*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f[D3Q27System::DIR_PMP]; + //(*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f[D3Q27System::DIR_MMP]; - //(*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f[D3Q27System::W ]; - //(*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f[D3Q27System::S ]; - //(*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f[D3Q27System::B ]; - //(*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f[D3Q27System::SW]; - //(*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f[D3Q27System::SE]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f[D3Q27System::BW]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f[D3Q27System::BE]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f[D3Q27System::BS]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f[D3Q27System::BN]; + //(*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f[D3Q27System::DIR_M00 ]; + //(*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f[D3Q27System::DIR_0M0 ]; + //(*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f[D3Q27System::DIR_00M ]; + //(*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f[D3Q27System::DIR_MM0]; + //(*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f[D3Q27System::DIR_PM0]; + //(*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f[D3Q27System::DIR_M0M]; + //(*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f[D3Q27System::DIR_P0M]; + //(*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f[D3Q27System::DIR_0MM]; + //(*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f[D3Q27System::DIR_0PM]; //(*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1) = f[D3Q27System::BSW]; //(*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1) = f[D3Q27System::BSE]; //(*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1) = f[D3Q27System::BNW]; - //(*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1) = f[D3Q27System::BNE]; + //(*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1) = f[D3Q27System::DIR_DIR_PPM]; //(*this->zeroDistributions)(x1,x2,x3) = f[D3Q27System::REST]; } @@ -230,57 +230,57 @@ void D3Q27EsoTwist3DSoA::setDistributionForDirection(const LBMReal *const f, siz { // bool directionFlag = false; // if ((direction & EsoTwistD3Q27System::etE) == EsoTwistD3Q27System::etE) - // (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f[D3Q27System::E]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f[D3Q27System::DIR_P00]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etW) == EsoTwistD3Q27System::etW) - // (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f[D3Q27System::W]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f[D3Q27System::DIR_M00]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etS) == EsoTwistD3Q27System::etS) - // (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f[D3Q27System::S]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f[D3Q27System::DIR_0M0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etN) == EsoTwistD3Q27System::etN) - // (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f[D3Q27System::N]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f[D3Q27System::DIR_0P0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etB) == EsoTwistD3Q27System::etB) - // (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f[D3Q27System::B]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f[D3Q27System::DIR_00M]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etT) == EsoTwistD3Q27System::etT) - // (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f[D3Q27System::T]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f[D3Q27System::DIR_00P]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etSW) == EsoTwistD3Q27System::etSW) - // (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f[D3Q27System::SW]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f[D3Q27System::DIR_MM0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etNE) == EsoTwistD3Q27System::etNE) - // (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f[D3Q27System::NE]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f[D3Q27System::DIR_PP0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etNW) == EsoTwistD3Q27System::etNW) - // (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f[D3Q27System::NW]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f[D3Q27System::DIR_MP0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etSE) == EsoTwistD3Q27System::etSE) - // (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f[D3Q27System::SE]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f[D3Q27System::DIR_PM0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBW) == EsoTwistD3Q27System::etBW) - // (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f[D3Q27System::BW]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f[D3Q27System::DIR_M0M]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTE) == EsoTwistD3Q27System::etTE) - // (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f[D3Q27System::TE]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f[D3Q27System::DIR_P0P]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTW) == EsoTwistD3Q27System::etTW) - // (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f[D3Q27System::TW]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f[D3Q27System::DIR_M0P]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBE) == EsoTwistD3Q27System::etBE) - // (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f[D3Q27System::BE]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f[D3Q27System::DIR_P0M]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBS) == EsoTwistD3Q27System::etBS) - // (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f[D3Q27System::BS]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f[D3Q27System::DIR_0MM]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTN) == EsoTwistD3Q27System::etTN) - // (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f[D3Q27System::TN]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f[D3Q27System::DIR_0PP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTS) == EsoTwistD3Q27System::etTS) - // (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f[D3Q27System::TS]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f[D3Q27System::DIR_0MP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBN) == EsoTwistD3Q27System::etBN) - // (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f[D3Q27System::BN]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f[D3Q27System::DIR_0PM]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBSW) == EsoTwistD3Q27System::etBSW) // (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f[D3Q27System::BSW]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTNE) == EsoTwistD3Q27System::etTNE) - // (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1) = f[D3Q27System::TNE]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1) = f[D3Q27System::DIR_PPP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBSE) == EsoTwistD3Q27System::etBSE) // (*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f[D3Q27System::BSE]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTNW) == EsoTwistD3Q27System::etTNW) - // (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1) = f[D3Q27System::TNW]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1) = f[D3Q27System::DIR_MPP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBNW) == EsoTwistD3Q27System::etBNW) // (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f[D3Q27System::BNW]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTSE) == EsoTwistD3Q27System::etTSE) - // (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1) = f[D3Q27System::TSE]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1) = f[D3Q27System::DIR_PMP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBNE) == EsoTwistD3Q27System::etBNE) - // (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f[D3Q27System::BNE]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f[D3Q27System::DIR_DIR_PPM]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTSW) == EsoTwistD3Q27System::etTSW) - // (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1) = f[D3Q27System::TSW]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1) = f[D3Q27System::DIR_MMP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::REST) == EsoTwistD3Q27System::REST) // (*this->zeroDistributions)(x1,x2,x3) = f[D3Q27System::REST]; directionFlag=true; //#ifdef _DEBUG @@ -292,82 +292,82 @@ void D3Q27EsoTwist3DSoA::setDistributionForDirection(LBMReal f, size_t x1, size_ { // switch (direction) //{ - // case D3Q27System::E : + // case D3Q27System::DIR_P00 : // (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f; // break; - // case D3Q27System::W : + // case D3Q27System::DIR_M00 : // (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f; // break; - // case D3Q27System::S : + // case D3Q27System::DIR_0M0 : // (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f; // break; - // case D3Q27System::N : + // case D3Q27System::DIR_0P0 : // (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f; // break; - // case D3Q27System::B : + // case D3Q27System::DIR_00M : // (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f; // break; - // case D3Q27System::T : + // case D3Q27System::DIR_00P : // (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f; // break; - // case D3Q27System::SW : + // case D3Q27System::DIR_MM0 : // (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f; // break; - // case D3Q27System::NE : + // case D3Q27System::DIR_PP0 : // (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f; // break; - // case D3Q27System::NW : + // case D3Q27System::DIR_MP0 : // (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f; // break; - // case D3Q27System::SE : + // case D3Q27System::DIR_PM0 : // (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f; // break; - // case D3Q27System::BW : + // case D3Q27System::DIR_M0M : // (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f; // break; - // case D3Q27System::TE : + // case D3Q27System::DIR_P0P : // (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f; // break; - // case D3Q27System::TW : + // case D3Q27System::DIR_M0P : // (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f; // break; - // case D3Q27System::BE : + // case D3Q27System::DIR_P0M : // (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f; // break; - // case D3Q27System::BS : + // case D3Q27System::DIR_0MM : // (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f; // break; - // case D3Q27System::TN : + // case D3Q27System::DIR_0PP : // (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f; // break; - // case D3Q27System::TS : + // case D3Q27System::DIR_0MP : // (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f; // break; - // case D3Q27System::BN : + // case D3Q27System::DIR_0PM : // (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f; // break; // case D3Q27System::BSW : // (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f; // break; - // case D3Q27System::TNE : + // case D3Q27System::DIR_PPP : // (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1) = f; // break; // case D3Q27System::BSE : // (*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f; // break; - // case D3Q27System::TNW : + // case D3Q27System::DIR_MPP : // (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1) = f; // break; // case D3Q27System::BNW : // (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f; // break; - // case D3Q27System::TSE : + // case D3Q27System::DIR_PMP : // (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1) = f; // break; - // case D3Q27System::BNE : + // case D3Q27System::DIR_DIR_PPM : // (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f; // break; - // case D3Q27System::TSW : + // case D3Q27System::DIR_MMP : // (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1) = f; // break; // case D3Q27System::REST : @@ -383,60 +383,60 @@ void D3Q27EsoTwist3DSoA::setDistributionInvForDirection(const LBMReal *const f, { // bool directionFlag = false; // if ((direction & EsoTwistD3Q27System::etE) == EsoTwistD3Q27System::etE) - // (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f[D3Q27System::E]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f[D3Q27System::DIR_P00]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etW) == EsoTwistD3Q27System::etW) - // (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f[D3Q27System::W]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f[D3Q27System::DIR_M00]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etS) == EsoTwistD3Q27System::etS) - // (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f[D3Q27System::S]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f[D3Q27System::DIR_0M0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etN) == EsoTwistD3Q27System::etN) - // (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f[D3Q27System::N]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f[D3Q27System::DIR_0P0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etB) == EsoTwistD3Q27System::etB) - // (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f[D3Q27System::B]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f[D3Q27System::DIR_00M]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etT) == EsoTwistD3Q27System::etT) - // (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f[D3Q27System::T]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f[D3Q27System::DIR_00P]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etSW) == EsoTwistD3Q27System::etSW) - // (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f[D3Q27System::SW]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f[D3Q27System::DIR_MM0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etNE) == EsoTwistD3Q27System::etNE) - // (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f[D3Q27System::NE]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f[D3Q27System::DIR_PP0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etNW) == EsoTwistD3Q27System::etNW) - // (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f[D3Q27System::NW]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f[D3Q27System::DIR_MP0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etSE) == EsoTwistD3Q27System::etSE) - // (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f[D3Q27System::SE]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f[D3Q27System::DIR_PM0]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBW) == EsoTwistD3Q27System::etBW) - // (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f[D3Q27System::BW]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f[D3Q27System::DIR_M0M]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTE) == EsoTwistD3Q27System::etTE) - // (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f[D3Q27System::TE]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f[D3Q27System::DIR_P0P]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTW) == EsoTwistD3Q27System::etTW) - // (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f[D3Q27System::TW]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f[D3Q27System::DIR_M0P]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBE) == EsoTwistD3Q27System::etBE) - // (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f[D3Q27System::BE]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f[D3Q27System::DIR_P0M]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBS) == EsoTwistD3Q27System::etBS) - // (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f[D3Q27System::BS]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f[D3Q27System::DIR_0MM]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTN) == EsoTwistD3Q27System::etTN) - // (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f[D3Q27System::TN]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f[D3Q27System::DIR_0PP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTS) == EsoTwistD3Q27System::etTS) - // (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f[D3Q27System::TS]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f[D3Q27System::DIR_0MP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBN) == EsoTwistD3Q27System::etBN) - // (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f[D3Q27System::BN]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f[D3Q27System::DIR_0PM]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBSW) == EsoTwistD3Q27System::etBSW) // (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1) = f[D3Q27System::BSW]; // directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTNE) == EsoTwistD3Q27System::etTNE) - // (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f[D3Q27System::TNE]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f[D3Q27System::DIR_PPP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBSE) == EsoTwistD3Q27System::etBSE) // (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1) = f[D3Q27System::BSE]; // directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTNW) == EsoTwistD3Q27System::etTNW) - // (*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f[D3Q27System::TNW]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f[D3Q27System::DIR_MPP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBNW) == EsoTwistD3Q27System::etBNW) // (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1) = f[D3Q27System::BNW]; // directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTSE) == EsoTwistD3Q27System::etTSE) - // (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f[D3Q27System::TSE]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f[D3Q27System::DIR_PMP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etBNE) == EsoTwistD3Q27System::etBNE) - // (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1)= f[D3Q27System::BNE]; directionFlag=true; + // (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1)= f[D3Q27System::DIR_DIR_PPM]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::etTSW) == EsoTwistD3Q27System::etTSW) - // (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f[D3Q27System::TSW]; directionFlag=true; + // (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f[D3Q27System::DIR_MMP]; directionFlag=true; // if ((direction & EsoTwistD3Q27System::REST) == EsoTwistD3Q27System::REST) // (*this->zeroDistributions)(x1,x2,x3) = f[D3Q27System::REST]; directionFlag=true; //#ifdef _DEBUG @@ -449,82 +449,82 @@ void D3Q27EsoTwist3DSoA::setDistributionInvForDirection(LBMReal f, size_t x1, si { // switch (direction) //{ - // case D3Q27System::E : + // case D3Q27System::DIR_P00 : // (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f; // break; - // case D3Q27System::W : + // case D3Q27System::DIR_M00 : // (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ) = f; // break; - // case D3Q27System::S : + // case D3Q27System::DIR_0M0 : // (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ) = f; // break; - // case D3Q27System::N : + // case D3Q27System::DIR_0P0 : // (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f; // break; - // case D3Q27System::B : + // case D3Q27System::DIR_00M : // (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ) = f; // break; - // case D3Q27System::T : + // case D3Q27System::DIR_00P : // (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f; // break; - // case D3Q27System::SW : + // case D3Q27System::DIR_MM0 : // (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ) = f; // break; - // case D3Q27System::NE : + // case D3Q27System::DIR_PP0 : // (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f; // break; - // case D3Q27System::NW : + // case D3Q27System::DIR_MP0 : // (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3) = f; // break; - // case D3Q27System::SE : + // case D3Q27System::DIR_PM0 : // (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ) = f; // break; - // case D3Q27System::BW : + // case D3Q27System::DIR_M0M : // (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ) = f; // break; - // case D3Q27System::TE : + // case D3Q27System::DIR_P0P : // (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f; // break; - // case D3Q27System::TW : + // case D3Q27System::DIR_M0P : // (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3) = f; // break; - // case D3Q27System::BE : + // case D3Q27System::DIR_P0M : // (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ) = f; // break; - // case D3Q27System::BS : + // case D3Q27System::DIR_0MM : // (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ) = f; // break; - // case D3Q27System::TN : + // case D3Q27System::DIR_0PP : // (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f; // break; - // case D3Q27System::TS : + // case D3Q27System::DIR_0MP : // (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3) = f; // break; - // case D3Q27System::BN : + // case D3Q27System::DIR_0PM : // (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ) = f; // break; // case D3Q27System::BSW : // (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1) = f; // break; - // case D3Q27System::TNE : + // case D3Q27System::DIR_PPP : // (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f; // break; // case D3Q27System::BSE : // (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1) = f; // break; - // case D3Q27System::TNW : + // case D3Q27System::DIR_MPP : // (*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3) = f; // break; // case D3Q27System::BNW : // (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1) = f; // break; - // case D3Q27System::TSE : + // case D3Q27System::DIR_PMP : // (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3) = f; // break; - // case D3Q27System::BNE : + // case D3Q27System::DIR_DIR_PPM : // (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1) = f; // break; - // case D3Q27System::TSW : + // case D3Q27System::DIR_MMP : // (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3) = f; // break; // case D3Q27System::REST : @@ -540,57 +540,57 @@ LBMReal D3Q27EsoTwist3DSoA::getDistributionInvForDirection(size_t /*x1*/, size_t { // switch (direction) //{ - // case D3Q27System::E : + // case D3Q27System::DIR_P00 : // return (*this->nonLocalDistributions)(D3Q27System::ET_W,x1+1,x2, x3 ); - // case D3Q27System::W : + // case D3Q27System::DIR_M00 : // return (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3); - // case D3Q27System::S : + // case D3Q27System::DIR_0M0 : // return (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3); - // case D3Q27System::N : + // case D3Q27System::DIR_0P0 : // return (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2+1,x3 ); - // case D3Q27System::B : + // case D3Q27System::DIR_00M : // return (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3); - // case D3Q27System::T : + // case D3Q27System::DIR_00P : // return (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3+1 ); - // case D3Q27System::SW : + // case D3Q27System::DIR_MM0 : // return (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3); - // case D3Q27System::NE : + // case D3Q27System::DIR_PP0 : // return (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1+1,x2+1,x3 ); - // case D3Q27System::NW : + // case D3Q27System::DIR_MP0 : // return (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2+1,x3 ); - // case D3Q27System::SE : + // case D3Q27System::DIR_PM0 : // return (*this->localDistributions)(D3Q27System::ET_NW,x1+1,x2, x3); - // case D3Q27System::BW : + // case D3Q27System::DIR_M0M : // return (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3); - // case D3Q27System::TE : + // case D3Q27System::DIR_P0P : // return (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1+1,x2, x3+1 ); - // case D3Q27System::TW : + // case D3Q27System::DIR_M0P : // return (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3+1 ); - // case D3Q27System::BE : + // case D3Q27System::DIR_P0M : // return (*this->localDistributions)(D3Q27System::ET_TW,x1+1,x2, x3); - // case D3Q27System::BS : + // case D3Q27System::DIR_0MM : // return (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3); - // case D3Q27System::TN : + // case D3Q27System::DIR_0PP : // return (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2+1,x3+1 ); - // case D3Q27System::TS : + // case D3Q27System::DIR_0MP : // return (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3+1 ); - // case D3Q27System::BN : + // case D3Q27System::DIR_0PM : // return (*this->localDistributions)(D3Q27System::ET_TS,x1, x2+1,x3); // case D3Q27System::BSW : // return (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3); - // case D3Q27System::TNE : + // case D3Q27System::DIR_PPP : // return (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1+1,x2+1,x3+1); // case D3Q27System::BSE : // return (*this->localDistributions)(D3Q27System::ET_TNW,x1+1,x2, x3); - // case D3Q27System::TNW : + // case D3Q27System::DIR_MPP : // return (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2+1,x3+1); // case D3Q27System::BNW : // return (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2+1,x3); - // case D3Q27System::TSE : + // case D3Q27System::DIR_PMP : // return (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1+1,x2, x3+1); - // case D3Q27System::BNE : + // case D3Q27System::DIR_DIR_PPM : // return (*this->localDistributions)(D3Q27System::ET_TSW,x1+1,x2+1,x3); - // case D3Q27System::TSW : + // case D3Q27System::DIR_MMP : // return (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3+1); // case D3Q27System::REST : // return (*this->zeroDistributions)(x1,x2,x3); diff --git a/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSplittedVector.cpp b/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSplittedVector.cpp index 5e762c68bab806ee7c892c000869bce8c76431af..684238baad1752ab3fad051666da459fd8e11095 100644 --- a/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSplittedVector.cpp +++ b/src/cpu/VirtualFluidsCore/Data/D3Q27EsoTwist3DSplittedVector.cpp @@ -56,278 +56,278 @@ void D3Q27EsoTwist3DSplittedVector::swap() { std::swap(this->localDistributions, ////////////////////////////////////////////////////////////////////////// void D3Q27EsoTwist3DSplittedVector::getDistribution(LBMReal *const f, size_t x1, size_t x2, size_t x3) { - f[D3Q27System::E] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - f[D3Q27System::N] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - f[D3Q27System::T] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - f[D3Q27System::NE] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - f[D3Q27System::NW] = (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - f[D3Q27System::TE] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - f[D3Q27System::TW] = (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - f[D3Q27System::TN] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - f[D3Q27System::TS] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - f[D3Q27System::TNE] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - f[D3Q27System::TNW] = (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - f[D3Q27System::TSE] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - f[D3Q27System::TSW] = (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); + f[D3Q27System::DIR_P00] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); + f[D3Q27System::DIR_0P0] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); + f[D3Q27System::DIR_00P] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); + f[D3Q27System::DIR_PP0] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); + f[D3Q27System::DIR_MP0] = (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); + f[D3Q27System::DIR_P0P] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); + f[D3Q27System::DIR_M0P] = (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); + f[D3Q27System::DIR_0PP] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); + f[D3Q27System::DIR_0MP] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); + f[D3Q27System::DIR_PPP] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); + f[D3Q27System::DIR_MPP] = (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); + f[D3Q27System::DIR_PMP] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); + f[D3Q27System::DIR_MMP] = (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - f[D3Q27System::W] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - f[D3Q27System::S] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - f[D3Q27System::B] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - f[D3Q27System::SW] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - f[D3Q27System::SE] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - f[D3Q27System::BW] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - f[D3Q27System::BE] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - f[D3Q27System::BS] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - f[D3Q27System::BN] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - f[D3Q27System::BSW] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - f[D3Q27System::BSE] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - f[D3Q27System::BNW] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - f[D3Q27System::BNE] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + f[D3Q27System::DIR_M00] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); + f[D3Q27System::DIR_0M0] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); + f[D3Q27System::DIR_00M] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); + f[D3Q27System::DIR_MM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); + f[D3Q27System::DIR_PM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); + f[D3Q27System::DIR_M0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); + f[D3Q27System::DIR_P0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); + f[D3Q27System::DIR_0MM] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); + f[D3Q27System::DIR_0PM] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); + f[D3Q27System::DIR_MMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); + f[D3Q27System::DIR_PMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); + f[D3Q27System::DIR_MPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); + f[D3Q27System::DIR_PPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); - f[D3Q27System::REST] = (*this->zeroDistributions)(x1, x2, x3); + f[D3Q27System::DIR_000] = (*this->zeroDistributions)(x1, x2, x3); } ////////////////////////////////////////////////////////////////////////// void D3Q27EsoTwist3DSplittedVector::setDistribution(const LBMReal *const f, size_t x1, size_t x2, size_t x3) { - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::INV_E]; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::INV_N]; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::INV_T]; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::INV_NE]; - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f[D3Q27System::INV_NW]; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::INV_TE]; - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f[D3Q27System::INV_TW]; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::INV_TN]; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f[D3Q27System::INV_TS]; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::INV_TNE]; - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f[D3Q27System::INV_TNW]; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f[D3Q27System::INV_TSE]; - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f[D3Q27System::INV_TSW]; + (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::INV_P00]; + (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::INV_0P0]; + (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::INV_00P]; + (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::INV_PP0]; + (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f[D3Q27System::INV_MP0]; + (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::INV_P0P]; + (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f[D3Q27System::INV_M0P]; + (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::INV_0PP]; + (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f[D3Q27System::INV_0MP]; + (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::INV_PPP]; + (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f[D3Q27System::INV_MPP]; + (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f[D3Q27System::INV_PMP]; + (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f[D3Q27System::INV_MMP]; - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f[D3Q27System::INV_W]; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f[D3Q27System::INV_S]; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f[D3Q27System::INV_B]; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f[D3Q27System::INV_SW]; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f[D3Q27System::INV_SE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f[D3Q27System::INV_BW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f[D3Q27System::INV_BE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f[D3Q27System::INV_BS]; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f[D3Q27System::INV_BN]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f[D3Q27System::INV_BSW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f[D3Q27System::INV_BSE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f[D3Q27System::INV_BNW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f[D3Q27System::INV_BNE]; + (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f[D3Q27System::INV_M00]; + (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f[D3Q27System::INV_0M0]; + (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f[D3Q27System::INV_00M]; + (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f[D3Q27System::INV_MM0]; + (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f[D3Q27System::INV_PM0]; + (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f[D3Q27System::INV_M0M]; + (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f[D3Q27System::INV_P0M]; + (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f[D3Q27System::INV_0MM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f[D3Q27System::INV_0PM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f[D3Q27System::INV_MMM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f[D3Q27System::INV_PMM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f[D3Q27System::INV_MPM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f[D3Q27System::INV_PPM]; - (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::REST]; + (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::DIR_000]; } ////////////////////////////////////////////////////////////////////////// void D3Q27EsoTwist3DSplittedVector::getDistributionInv(LBMReal *const f, size_t x1, size_t x2, size_t x3) { - f[D3Q27System::INV_E] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - f[D3Q27System::INV_N] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - f[D3Q27System::INV_T] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - f[D3Q27System::INV_NE] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - f[D3Q27System::INV_NW] = (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - f[D3Q27System::INV_TE] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - f[D3Q27System::INV_TW] = (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - f[D3Q27System::INV_TN] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - f[D3Q27System::INV_TS] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - f[D3Q27System::INV_TNE] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - f[D3Q27System::INV_TNW] = (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - f[D3Q27System::INV_TSE] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - f[D3Q27System::INV_TSW] = (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); + f[D3Q27System::INV_P00] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); + f[D3Q27System::INV_0P0] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); + f[D3Q27System::INV_00P] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); + f[D3Q27System::INV_PP0] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); + f[D3Q27System::INV_MP0] = (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); + f[D3Q27System::INV_P0P] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); + f[D3Q27System::INV_M0P] = (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); + f[D3Q27System::INV_0PP] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); + f[D3Q27System::INV_0MP] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); + f[D3Q27System::INV_PPP] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); + f[D3Q27System::INV_MPP] = (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); + f[D3Q27System::INV_PMP] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); + f[D3Q27System::INV_MMP] = (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - f[D3Q27System::INV_W] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - f[D3Q27System::INV_S] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - f[D3Q27System::INV_B] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - f[D3Q27System::INV_SW] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - f[D3Q27System::INV_SE] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - f[D3Q27System::INV_BW] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - f[D3Q27System::INV_BE] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - f[D3Q27System::INV_BS] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - f[D3Q27System::INV_BN] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - f[D3Q27System::INV_BSW] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - f[D3Q27System::INV_BSE] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - f[D3Q27System::INV_BNW] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - f[D3Q27System::INV_BNE] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); + f[D3Q27System::INV_M00] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); + f[D3Q27System::INV_0M0] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); + f[D3Q27System::INV_00M] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); + f[D3Q27System::INV_MM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); + f[D3Q27System::INV_PM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); + f[D3Q27System::INV_M0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); + f[D3Q27System::INV_P0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); + f[D3Q27System::INV_0MM] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); + f[D3Q27System::INV_0PM] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); + f[D3Q27System::INV_MMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); + f[D3Q27System::INV_PMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); + f[D3Q27System::INV_MPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); + f[D3Q27System::INV_PPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); - f[D3Q27System::REST] = (*this->zeroDistributions)(x1, x2, x3); + f[D3Q27System::DIR_000] = (*this->zeroDistributions)(x1, x2, x3); } ////////////////////////////////////////////////////////////////////////// void D3Q27EsoTwist3DSplittedVector::setDistributionInv(const LBMReal *const f, size_t x1, size_t x2, size_t x3) { - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::E]; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::N]; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::T]; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::NE]; - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f[D3Q27System::NW]; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::TE]; - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f[D3Q27System::TW]; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::TN]; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f[D3Q27System::TS]; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::TNE]; - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f[D3Q27System::TNW]; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f[D3Q27System::TSE]; - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f[D3Q27System::TSW]; + (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::DIR_P00]; + (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::DIR_0P0]; + (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::DIR_00P]; + (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::DIR_PP0]; + (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f[D3Q27System::DIR_MP0]; + (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::DIR_P0P]; + (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f[D3Q27System::DIR_M0P]; + (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::DIR_0PP]; + (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f[D3Q27System::DIR_0MP]; + (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::DIR_PPP]; + (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f[D3Q27System::DIR_MPP]; + (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f[D3Q27System::DIR_PMP]; + (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f[D3Q27System::DIR_MMP]; - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f[D3Q27System::W]; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f[D3Q27System::S]; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f[D3Q27System::B]; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f[D3Q27System::SW]; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f[D3Q27System::SE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f[D3Q27System::BW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f[D3Q27System::BE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f[D3Q27System::BS]; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f[D3Q27System::BN]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f[D3Q27System::BSW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f[D3Q27System::BSE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f[D3Q27System::BNW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f[D3Q27System::BNE]; + (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f[D3Q27System::DIR_M00]; + (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f[D3Q27System::DIR_0M0]; + (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f[D3Q27System::DIR_00M]; + (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f[D3Q27System::DIR_MM0]; + (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f[D3Q27System::DIR_PM0]; + (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f[D3Q27System::DIR_M0M]; + (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f[D3Q27System::DIR_P0M]; + (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f[D3Q27System::DIR_0MM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f[D3Q27System::DIR_0PM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f[D3Q27System::DIR_MMM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f[D3Q27System::DIR_PMM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f[D3Q27System::DIR_MPM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f[D3Q27System::DIR_PPM]; - (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::REST]; + (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::DIR_000]; } ////////////////////////////////////////////////////////////////////////// void D3Q27EsoTwist3DSplittedVector::setDistributionForDirection(const LBMReal *const f, size_t x1, size_t x2, size_t x3, unsigned long int direction) { if ((direction & EsoTwistD3Q27System::etE) == EsoTwistD3Q27System::etE) - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f[D3Q27System::E]; + (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f[D3Q27System::DIR_P00]; if ((direction & EsoTwistD3Q27System::etW) == EsoTwistD3Q27System::etW) - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::W]; + (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::DIR_M00]; if ((direction & EsoTwistD3Q27System::etS) == EsoTwistD3Q27System::etS) - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::S]; + (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::DIR_0M0]; if ((direction & EsoTwistD3Q27System::etN) == EsoTwistD3Q27System::etN) - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f[D3Q27System::N]; + (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f[D3Q27System::DIR_0P0]; if ((direction & EsoTwistD3Q27System::etB) == EsoTwistD3Q27System::etB) - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::B]; + (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::DIR_00M]; if ((direction & EsoTwistD3Q27System::etT) == EsoTwistD3Q27System::etT) - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f[D3Q27System::T]; + (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f[D3Q27System::DIR_00P]; if ((direction & EsoTwistD3Q27System::etSW) == EsoTwistD3Q27System::etSW) - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::SW]; + (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::DIR_MM0]; if ((direction & EsoTwistD3Q27System::etNE) == EsoTwistD3Q27System::etNE) - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f[D3Q27System::NE]; + (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f[D3Q27System::DIR_PP0]; if ((direction & EsoTwistD3Q27System::etNW) == EsoTwistD3Q27System::etNW) - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f[D3Q27System::NW]; + (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f[D3Q27System::DIR_MP0]; if ((direction & EsoTwistD3Q27System::etSE) == EsoTwistD3Q27System::etSE) - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f[D3Q27System::SE]; + (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f[D3Q27System::DIR_PM0]; if ((direction & EsoTwistD3Q27System::etBW) == EsoTwistD3Q27System::etBW) - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::BW]; + (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::DIR_M0M]; if ((direction & EsoTwistD3Q27System::etTE) == EsoTwistD3Q27System::etTE) - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f[D3Q27System::TE]; + (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f[D3Q27System::DIR_P0P]; if ((direction & EsoTwistD3Q27System::etTW) == EsoTwistD3Q27System::etTW) - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f[D3Q27System::TW]; + (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f[D3Q27System::DIR_M0P]; if ((direction & EsoTwistD3Q27System::etBE) == EsoTwistD3Q27System::etBE) - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f[D3Q27System::BE]; + (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f[D3Q27System::DIR_P0M]; if ((direction & EsoTwistD3Q27System::etBS) == EsoTwistD3Q27System::etBS) - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::BS]; + (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::DIR_0MM]; if ((direction & EsoTwistD3Q27System::etTN) == EsoTwistD3Q27System::etTN) - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f[D3Q27System::TN]; + (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f[D3Q27System::DIR_0PP]; if ((direction & EsoTwistD3Q27System::etTS) == EsoTwistD3Q27System::etTS) - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f[D3Q27System::TS]; + (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f[D3Q27System::DIR_0MP]; if ((direction & EsoTwistD3Q27System::etBN) == EsoTwistD3Q27System::etBN) - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f[D3Q27System::BN]; + (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f[D3Q27System::DIR_0PM]; if ((direction & EsoTwistD3Q27System::etBSW) == EsoTwistD3Q27System::etBSW) - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::BSW]; + (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::DIR_MMM]; if ((direction & EsoTwistD3Q27System::etTNE) == EsoTwistD3Q27System::etTNE) - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f[D3Q27System::TNE]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f[D3Q27System::DIR_PPP]; if ((direction & EsoTwistD3Q27System::etBSE) == EsoTwistD3Q27System::etBSE) - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f[D3Q27System::BSE]; + (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f[D3Q27System::DIR_PMM]; if ((direction & EsoTwistD3Q27System::etTNW) == EsoTwistD3Q27System::etTNW) - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f[D3Q27System::TNW]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f[D3Q27System::DIR_MPP]; if ((direction & EsoTwistD3Q27System::etBNW) == EsoTwistD3Q27System::etBNW) - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f[D3Q27System::BNW]; + (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f[D3Q27System::DIR_MPM]; if ((direction & EsoTwistD3Q27System::etTSE) == EsoTwistD3Q27System::etTSE) - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f[D3Q27System::TSE]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f[D3Q27System::DIR_PMP]; if ((direction & EsoTwistD3Q27System::etBNE) == EsoTwistD3Q27System::etBNE) - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f[D3Q27System::BNE]; + (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f[D3Q27System::DIR_PPM]; if ((direction & EsoTwistD3Q27System::etTSW) == EsoTwistD3Q27System::etTSW) - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f[D3Q27System::TSW]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f[D3Q27System::DIR_MMP]; if ((direction & EsoTwistD3Q27System::REST) == EsoTwistD3Q27System::REST) - (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::REST]; + (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::DIR_000]; } ////////////////////////////////////////////////////////////////////////// void D3Q27EsoTwist3DSplittedVector::setDistributionForDirection(LBMReal f, size_t x1, size_t x2, size_t x3, int direction) { switch (direction) { - case D3Q27System::E: + case D3Q27System::DIR_P00: (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f; break; - case D3Q27System::W: + case D3Q27System::DIR_M00: (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f; break; - case D3Q27System::S: + case D3Q27System::DIR_0M0: (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f; break; - case D3Q27System::N: + case D3Q27System::DIR_0P0: (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f; break; - case D3Q27System::B: + case D3Q27System::DIR_00M: (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f; break; - case D3Q27System::T: + case D3Q27System::DIR_00P: (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f; break; - case D3Q27System::SW: + case D3Q27System::DIR_MM0: (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f; break; - case D3Q27System::NE: + case D3Q27System::DIR_PP0: (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f; break; - case D3Q27System::NW: + case D3Q27System::DIR_MP0: (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f; break; - case D3Q27System::SE: + case D3Q27System::DIR_PM0: (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f; break; - case D3Q27System::BW: + case D3Q27System::DIR_M0M: (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f; break; - case D3Q27System::TE: + case D3Q27System::DIR_P0P: (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f; break; - case D3Q27System::TW: + case D3Q27System::DIR_M0P: (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f; break; - case D3Q27System::BE: + case D3Q27System::DIR_P0M: (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f; break; - case D3Q27System::BS: + case D3Q27System::DIR_0MM: (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f; break; - case D3Q27System::TN: + case D3Q27System::DIR_0PP: (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f; break; - case D3Q27System::TS: + case D3Q27System::DIR_0MP: (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f; break; - case D3Q27System::BN: + case D3Q27System::DIR_0PM: (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f; break; - case D3Q27System::BSW: + case D3Q27System::DIR_MMM: (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f; break; - case D3Q27System::TNE: + case D3Q27System::DIR_PPP: (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f; break; - case D3Q27System::BSE: + case D3Q27System::DIR_PMM: (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f; break; - case D3Q27System::TNW: + case D3Q27System::DIR_MPP: (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f; break; - case D3Q27System::BNW: + case D3Q27System::DIR_MPM: (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f; break; - case D3Q27System::TSE: + case D3Q27System::DIR_PMP: (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f; break; - case D3Q27System::BNE: + case D3Q27System::DIR_PPM: (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f; break; - case D3Q27System::TSW: + case D3Q27System::DIR_MMP: (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f; break; - case D3Q27System::REST: + case D3Q27System::DIR_000: (*this->zeroDistributions)(x1, x2, x3) = f; break; default: @@ -339,144 +339,144 @@ void D3Q27EsoTwist3DSplittedVector::setDistributionInvForDirection(const LBMReal size_t x3, unsigned long int direction) { if ((direction & EsoTwistD3Q27System::etE) == EsoTwistD3Q27System::etE) - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::E]; + (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::DIR_P00]; if ((direction & EsoTwistD3Q27System::etW) == EsoTwistD3Q27System::etW) - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f[D3Q27System::W]; + (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f[D3Q27System::DIR_M00]; if ((direction & EsoTwistD3Q27System::etS) == EsoTwistD3Q27System::etS) - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f[D3Q27System::S]; + (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f[D3Q27System::DIR_0M0]; if ((direction & EsoTwistD3Q27System::etN) == EsoTwistD3Q27System::etN) - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::N]; + (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::DIR_0P0]; if ((direction & EsoTwistD3Q27System::etB) == EsoTwistD3Q27System::etB) - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f[D3Q27System::B]; + (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f[D3Q27System::DIR_00M]; if ((direction & EsoTwistD3Q27System::etT) == EsoTwistD3Q27System::etT) - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::T]; + (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::DIR_00P]; if ((direction & EsoTwistD3Q27System::etSW) == EsoTwistD3Q27System::etSW) - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f[D3Q27System::SW]; + (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f[D3Q27System::DIR_MM0]; if ((direction & EsoTwistD3Q27System::etNE) == EsoTwistD3Q27System::etNE) - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::NE]; + (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::DIR_PP0]; if ((direction & EsoTwistD3Q27System::etNW) == EsoTwistD3Q27System::etNW) - (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f[D3Q27System::NW]; + (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f[D3Q27System::DIR_MP0]; if ((direction & EsoTwistD3Q27System::etSE) == EsoTwistD3Q27System::etSE) - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f[D3Q27System::SE]; + (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f[D3Q27System::DIR_PM0]; if ((direction & EsoTwistD3Q27System::etBW) == EsoTwistD3Q27System::etBW) - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f[D3Q27System::BW]; + (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f[D3Q27System::DIR_M0M]; if ((direction & EsoTwistD3Q27System::etTE) == EsoTwistD3Q27System::etTE) - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::TE]; + (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::DIR_P0P]; if ((direction & EsoTwistD3Q27System::etTW) == EsoTwistD3Q27System::etTW) - (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f[D3Q27System::TW]; + (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f[D3Q27System::DIR_M0P]; if ((direction & EsoTwistD3Q27System::etBE) == EsoTwistD3Q27System::etBE) - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f[D3Q27System::BE]; + (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f[D3Q27System::DIR_P0M]; if ((direction & EsoTwistD3Q27System::etBS) == EsoTwistD3Q27System::etBS) - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f[D3Q27System::BS]; + (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f[D3Q27System::DIR_0MM]; if ((direction & EsoTwistD3Q27System::etTN) == EsoTwistD3Q27System::etTN) - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::TN]; + (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::DIR_0PP]; if ((direction & EsoTwistD3Q27System::etTS) == EsoTwistD3Q27System::etTS) - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f[D3Q27System::TS]; + (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f[D3Q27System::DIR_0MP]; if ((direction & EsoTwistD3Q27System::etBN) == EsoTwistD3Q27System::etBN) - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f[D3Q27System::BN]; + (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f[D3Q27System::DIR_0PM]; if ((direction & EsoTwistD3Q27System::etBSW) == EsoTwistD3Q27System::etBSW) - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f[D3Q27System::BSW]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f[D3Q27System::DIR_MMM]; if ((direction & EsoTwistD3Q27System::etTNE) == EsoTwistD3Q27System::etTNE) - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::TNE]; + (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::DIR_PPP]; if ((direction & EsoTwistD3Q27System::etBSE) == EsoTwistD3Q27System::etBSE) - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f[D3Q27System::BSE]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f[D3Q27System::DIR_PMM]; if ((direction & EsoTwistD3Q27System::etTNW) == EsoTwistD3Q27System::etTNW) - (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f[D3Q27System::TNW]; + (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f[D3Q27System::DIR_MPP]; if ((direction & EsoTwistD3Q27System::etBNW) == EsoTwistD3Q27System::etBNW) - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f[D3Q27System::BNW]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f[D3Q27System::DIR_MPM]; if ((direction & EsoTwistD3Q27System::etTSE) == EsoTwistD3Q27System::etTSE) - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f[D3Q27System::TSE]; + (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f[D3Q27System::DIR_PMP]; if ((direction & EsoTwistD3Q27System::etBNE) == EsoTwistD3Q27System::etBNE) - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f[D3Q27System::BNE]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f[D3Q27System::DIR_PPM]; if ((direction & EsoTwistD3Q27System::etTSW) == EsoTwistD3Q27System::etTSW) - (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f[D3Q27System::TSW]; + (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f[D3Q27System::DIR_MMP]; if ((direction & EsoTwistD3Q27System::REST) == EsoTwistD3Q27System::REST) - (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::REST]; + (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::DIR_000]; } ////////////////////////////////////////////////////////////////////////// void D3Q27EsoTwist3DSplittedVector::setDistributionInvForDirection(LBMReal f, size_t x1, size_t x2, size_t x3, unsigned long int direction) { switch (direction) { - case D3Q27System::E: + case D3Q27System::DIR_P00: (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f; break; - case D3Q27System::W: + case D3Q27System::DIR_M00: (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3) = f; break; - case D3Q27System::S: + case D3Q27System::DIR_0M0: (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3) = f; break; - case D3Q27System::N: + case D3Q27System::DIR_0P0: (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f; break; - case D3Q27System::B: + case D3Q27System::DIR_00M: (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1) = f; break; - case D3Q27System::T: + case D3Q27System::DIR_00P: (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f; break; - case D3Q27System::SW: + case D3Q27System::DIR_MM0: (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3) = f; break; - case D3Q27System::NE: + case D3Q27System::DIR_PP0: (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f; break; - case D3Q27System::NW: + case D3Q27System::DIR_MP0: (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3) = f; break; - case D3Q27System::SE: + case D3Q27System::DIR_PM0: (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3) = f; break; - case D3Q27System::BW: + case D3Q27System::DIR_M0M: (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1) = f; break; - case D3Q27System::TE: + case D3Q27System::DIR_P0P: (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f; break; - case D3Q27System::TW: + case D3Q27System::DIR_M0P: (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3) = f; break; - case D3Q27System::BE: + case D3Q27System::DIR_P0M: (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1) = f; break; - case D3Q27System::BS: + case D3Q27System::DIR_0MM: (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1) = f; break; - case D3Q27System::TN: + case D3Q27System::DIR_0PP: (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f; break; - case D3Q27System::TS: + case D3Q27System::DIR_0MP: (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3) = f; break; - case D3Q27System::BN: + case D3Q27System::DIR_0PM: (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1) = f; break; - case D3Q27System::BSW: + case D3Q27System::DIR_MMM: (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1) = f; break; - case D3Q27System::TNE: + case D3Q27System::DIR_PPP: (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f; break; - case D3Q27System::BSE: + case D3Q27System::DIR_PMM: (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1) = f; break; - case D3Q27System::TNW: + case D3Q27System::DIR_MPP: (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3) = f; break; - case D3Q27System::BNW: + case D3Q27System::DIR_MPM: (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1) = f; break; - case D3Q27System::TSE: + case D3Q27System::DIR_PMP: (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3) = f; break; - case D3Q27System::BNE: + case D3Q27System::DIR_PPM: (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1) = f; break; - case D3Q27System::TSW: + case D3Q27System::DIR_MMP: (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3) = f; break; - case D3Q27System::REST: + case D3Q27System::DIR_000: (*this->zeroDistributions)(x1, x2, x3) = f; break; default: @@ -487,59 +487,59 @@ void D3Q27EsoTwist3DSplittedVector::setDistributionInvForDirection(LBMReal f, si LBMReal D3Q27EsoTwist3DSplittedVector::getDistributionForDirection(size_t x1, size_t x2, size_t x3, int direction) { switch (direction) { - case D3Q27System::W: + case D3Q27System::DIR_M00: return (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - case D3Q27System::E: + case D3Q27System::DIR_P00: return (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - case D3Q27System::N: + case D3Q27System::DIR_0P0: return (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - case D3Q27System::S: + case D3Q27System::DIR_0M0: return (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - case D3Q27System::T: + case D3Q27System::DIR_00P: return (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - case D3Q27System::B: + case D3Q27System::DIR_00M: return (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - case D3Q27System::NE: + case D3Q27System::DIR_PP0: return (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - case D3Q27System::SW: + case D3Q27System::DIR_MM0: return (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - case D3Q27System::SE: + case D3Q27System::DIR_PM0: return (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - case D3Q27System::NW: + case D3Q27System::DIR_MP0: return (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - case D3Q27System::TE: + case D3Q27System::DIR_P0P: return (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - case D3Q27System::BW: + case D3Q27System::DIR_M0M: return (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - case D3Q27System::BE: + case D3Q27System::DIR_P0M: return (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - case D3Q27System::TW: + case D3Q27System::DIR_M0P: return (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - case D3Q27System::TN: + case D3Q27System::DIR_0PP: return (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - case D3Q27System::BS: + case D3Q27System::DIR_0MM: return (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - case D3Q27System::BN: + case D3Q27System::DIR_0PM: return (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - case D3Q27System::TS: + case D3Q27System::DIR_0MP: return (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - case D3Q27System::TNE: + case D3Q27System::DIR_PPP: return (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - case D3Q27System::BSW: + case D3Q27System::DIR_MMM: return (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - case D3Q27System::TNW: + case D3Q27System::DIR_MPP: return (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - case D3Q27System::BSE: + case D3Q27System::DIR_PMM: return (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - case D3Q27System::TSE: + case D3Q27System::DIR_PMP: return (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - case D3Q27System::BNW: + case D3Q27System::DIR_MPM: return (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - case D3Q27System::TSW: + case D3Q27System::DIR_MMP: return (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - case D3Q27System::BNE: + case D3Q27System::DIR_PPM: return (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); - case D3Q27System::REST: + case D3Q27System::DIR_000: return (*this->zeroDistributions)(x1, x2, x3); default: UB_THROW(UbException(UB_EXARGS, "Direction didn't find")); @@ -549,59 +549,59 @@ LBMReal D3Q27EsoTwist3DSplittedVector::getDistributionForDirection(size_t x1, si LBMReal D3Q27EsoTwist3DSplittedVector::getDistributionInvForDirection(size_t x1, size_t x2, size_t x3, int direction) { switch (direction) { - case D3Q27System::E: + case D3Q27System::DIR_P00: return (*this->nonLocalDistributions)(D3Q27System::ET_W, x1 + 1, x2, x3); - case D3Q27System::W: + case D3Q27System::DIR_M00: return (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - case D3Q27System::S: + case D3Q27System::DIR_0M0: return (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - case D3Q27System::N: + case D3Q27System::DIR_0P0: return (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2 + 1, x3); - case D3Q27System::B: + case D3Q27System::DIR_00M: return (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - case D3Q27System::T: + case D3Q27System::DIR_00P: return (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3 + 1); - case D3Q27System::SW: + case D3Q27System::DIR_MM0: return (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - case D3Q27System::NE: + case D3Q27System::DIR_PP0: return (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1 + 1, x2 + 1, x3); - case D3Q27System::NW: + case D3Q27System::DIR_MP0: return (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2 + 1, x3); - case D3Q27System::SE: + case D3Q27System::DIR_PM0: return (*this->localDistributions)(D3Q27System::ET_NW, x1 + 1, x2, x3); - case D3Q27System::BW: + case D3Q27System::DIR_M0M: return (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - case D3Q27System::TE: + case D3Q27System::DIR_P0P: return (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1 + 1, x2, x3 + 1); - case D3Q27System::TW: + case D3Q27System::DIR_M0P: return (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3 + 1); - case D3Q27System::BE: + case D3Q27System::DIR_P0M: return (*this->localDistributions)(D3Q27System::ET_TW, x1 + 1, x2, x3); - case D3Q27System::BS: + case D3Q27System::DIR_0MM: return (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - case D3Q27System::TN: + case D3Q27System::DIR_0PP: return (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2 + 1, x3 + 1); - case D3Q27System::TS: + case D3Q27System::DIR_0MP: return (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3 + 1); - case D3Q27System::BN: + case D3Q27System::DIR_0PM: return (*this->localDistributions)(D3Q27System::ET_TS, x1, x2 + 1, x3); - case D3Q27System::BSW: + case D3Q27System::DIR_MMM: return (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - case D3Q27System::TNE: + case D3Q27System::DIR_PPP: return (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1 + 1, x2 + 1, x3 + 1); - case D3Q27System::BSE: + case D3Q27System::DIR_PMM: return (*this->localDistributions)(D3Q27System::ET_TNW, x1 + 1, x2, x3); - case D3Q27System::TNW: + case D3Q27System::DIR_MPP: return (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2 + 1, x3 + 1); - case D3Q27System::BNW: + case D3Q27System::DIR_MPM: return (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2 + 1, x3); - case D3Q27System::TSE: + case D3Q27System::DIR_PMP: return (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1 + 1, x2, x3 + 1); - case D3Q27System::BNE: + case D3Q27System::DIR_PPM: return (*this->localDistributions)(D3Q27System::ET_TSW, x1 + 1, x2 + 1, x3); - case D3Q27System::TSW: + case D3Q27System::DIR_MMP: return (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3 + 1); - case D3Q27System::REST: + case D3Q27System::DIR_000: return (*this->zeroDistributions)(x1, x2, x3); default: UB_THROW(UbException(UB_EXARGS, "Direction didn't find")); diff --git a/src/cpu/VirtualFluidsCore/Data/EsoTwistD3Q27System.cpp b/src/cpu/VirtualFluidsCore/Data/EsoTwistD3Q27System.cpp index c456be678449744475a0ac6932850dceb0ee6f1c..b9a2e069edea6fa3e514b64e4e4174f0964a3a20 100644 --- a/src/cpu/VirtualFluidsCore/Data/EsoTwistD3Q27System.cpp +++ b/src/cpu/VirtualFluidsCore/Data/EsoTwistD3Q27System.cpp @@ -44,12 +44,12 @@ const int EsoTwistD3Q27System::ETX3[EsoTwistD3Q27System::ENDF + 1] = { 0, 0, 0, 0, 1, 1, 0, 0, -1, 0, -1, 0, 1, 0, 1, 0 }; const int EsoTwistD3Q27System::etINVDIR[EsoTwistD3Q27System::ENDF + 1] = { - D3Q27System::INV_E, D3Q27System::INV_W, D3Q27System::INV_N, D3Q27System::INV_S, D3Q27System::INV_T, - D3Q27System::INV_B, D3Q27System::INV_NE, D3Q27System::INV_SW, D3Q27System::INV_SE, D3Q27System::INV_NW, - D3Q27System::INV_TE, D3Q27System::INV_BW, D3Q27System::INV_BE, D3Q27System::INV_TW, D3Q27System::INV_TN, - D3Q27System::INV_BS, D3Q27System::INV_BN, D3Q27System::INV_TS, D3Q27System::INV_TNE, D3Q27System::INV_TNW, - D3Q27System::INV_TSE, D3Q27System::INV_TSW, D3Q27System::INV_BNE, D3Q27System::INV_BNW, D3Q27System::INV_BSE, - D3Q27System::INV_BSW, D3Q27System::REST + D3Q27System::INV_P00, D3Q27System::INV_M00, D3Q27System::INV_0P0, D3Q27System::INV_0M0, D3Q27System::INV_00P, + D3Q27System::INV_00M, D3Q27System::INV_PP0, D3Q27System::INV_MM0, D3Q27System::INV_PM0, D3Q27System::INV_MP0, + D3Q27System::INV_P0P, D3Q27System::INV_M0M, D3Q27System::INV_P0M, D3Q27System::INV_M0P, D3Q27System::INV_0PP, + D3Q27System::INV_0MM, D3Q27System::INV_0PM, D3Q27System::INV_0MP, D3Q27System::INV_PPP, D3Q27System::INV_MPP, + D3Q27System::INV_PMP, D3Q27System::INV_MMP, D3Q27System::INV_PPM, D3Q27System::INV_MPM, D3Q27System::INV_PMM, + D3Q27System::INV_MMM, D3Q27System::DIR_000 }; const unsigned long int EsoTwistD3Q27System::etDIR[EsoTwistD3Q27System::ENDF + 1] = { diff --git a/src/cpu/VirtualFluidsCore/Data/EsoTwistD3Q27System.h b/src/cpu/VirtualFluidsCore/Data/EsoTwistD3Q27System.h index 21752cc48a84b02bc24cb7efe9e3c5912f476dfd..7ccd413c662206ab3a12b3a1c88fcc81450f7a75 100644 --- a/src/cpu/VirtualFluidsCore/Data/EsoTwistD3Q27System.h +++ b/src/cpu/VirtualFluidsCore/Data/EsoTwistD3Q27System.h @@ -47,60 +47,60 @@ struct EsoTwistD3Q27System { const static int STARTDIR = D3Q27System::STARTDIR; const static int ENDDIR = D3Q27System::ENDDIR; - static const int REST = D3Q27System::REST; /*f0 */ - static const int E = D3Q27System::E; /*f1 */ - static const int W = D3Q27System::W; /*f2 */ - static const int N = D3Q27System::N; /*f3 */ - static const int S = D3Q27System::S; /*f4 */ - static const int T = D3Q27System::T; /*f5 */ - static const int B = D3Q27System::B; /*f6 */ - static const int NE = D3Q27System::NE; /*f7 */ - static const int SW = D3Q27System::SW; /*f8 */ - static const int SE = D3Q27System::SE; /*f9 */ - static const int NW = D3Q27System::NW; /*f10*/ - static const int TE = D3Q27System::TE; /*f11*/ - static const int BW = D3Q27System::BW; /*f12*/ - static const int BE = D3Q27System::BE; /*f13*/ - static const int TW = D3Q27System::TW; /*f14*/ - static const int TN = D3Q27System::TN; /*f15*/ - static const int BS = D3Q27System::BS; /*f16*/ - static const int BN = D3Q27System::BN; /*f17*/ - static const int TS = D3Q27System::TS; /*f18*/ - static const int TNE = D3Q27System::TNE; - static const int TNW = D3Q27System::TNW; - static const int TSE = D3Q27System::TSE; - static const int TSW = D3Q27System::TSW; - static const int BNE = D3Q27System::BNE; - static const int BNW = D3Q27System::BNW; - static const int BSE = D3Q27System::BSE; - static const int BSW = D3Q27System::BSW; + static const int REST = D3Q27System::DIR_000; /*f0 */ + static const int E = D3Q27System::DIR_P00; /*f1 */ + static const int W = D3Q27System::DIR_M00; /*f2 */ + static const int N = D3Q27System::DIR_0P0; /*f3 */ + static const int S = D3Q27System::DIR_0M0; /*f4 */ + static const int T = D3Q27System::DIR_00P; /*f5 */ + static const int B = D3Q27System::DIR_00M; /*f6 */ + static const int NE = D3Q27System::DIR_PP0; /*f7 */ + static const int SW = D3Q27System::DIR_MM0; /*f8 */ + static const int SE = D3Q27System::DIR_PM0; /*f9 */ + static const int NW = D3Q27System::DIR_MP0; /*f10*/ + static const int TE = D3Q27System::DIR_P0P; /*f11*/ + static const int BW = D3Q27System::DIR_M0M; /*f12*/ + static const int BE = D3Q27System::DIR_P0M; /*f13*/ + static const int TW = D3Q27System::DIR_M0P; /*f14*/ + static const int TN = D3Q27System::DIR_0PP; /*f15*/ + static const int BS = D3Q27System::DIR_0MM; /*f16*/ + static const int BN = D3Q27System::DIR_0PM; /*f17*/ + static const int TS = D3Q27System::DIR_0MP; /*f18*/ + static const int TNE = D3Q27System::DIR_PPP; + static const int TNW = D3Q27System::DIR_MPP; + static const int TSE = D3Q27System::DIR_PMP; + static const int TSW = D3Q27System::DIR_MMP; + static const int BNE = D3Q27System::DIR_PPM; + static const int BNW = D3Q27System::DIR_MPM; + static const int BSE = D3Q27System::DIR_PMM; + static const int BSW = D3Q27System::DIR_MMM; - static const int INV_E = D3Q27System::W; - static const int INV_W = D3Q27System::E; - static const int INV_N = D3Q27System::S; - static const int INV_S = D3Q27System::N; - static const int INV_T = D3Q27System::B; - static const int INV_B = D3Q27System::T; - static const int INV_NE = D3Q27System::SW; - static const int INV_SW = D3Q27System::NE; - static const int INV_SE = D3Q27System::NW; - static const int INV_NW = D3Q27System::SE; - static const int INV_TE = D3Q27System::BW; - static const int INV_BW = D3Q27System::TE; - static const int INV_BE = D3Q27System::TW; - static const int INV_TW = D3Q27System::BE; - static const int INV_TN = D3Q27System::BS; - static const int INV_BS = D3Q27System::TN; - static const int INV_BN = D3Q27System::TS; - static const int INV_TS = D3Q27System::BN; - static const int INV_TNE = D3Q27System::BSW; - static const int INV_TNW = D3Q27System::BSE; - static const int INV_TSE = D3Q27System::BNW; - static const int INV_TSW = D3Q27System::BNE; - static const int INV_BNE = D3Q27System::TSW; - static const int INV_BNW = D3Q27System::TSE; - static const int INV_BSE = D3Q27System::TNW; - static const int INV_BSW = D3Q27System::TNE; + static const int INV_E = D3Q27System::DIR_M00; + static const int INV_W = D3Q27System::DIR_P00; + static const int INV_N = D3Q27System::DIR_0M0; + static const int INV_S = D3Q27System::DIR_0P0; + static const int INV_T = D3Q27System::DIR_00M; + static const int INV_B = D3Q27System::DIR_00P; + static const int INV_NE = D3Q27System::DIR_MM0; + static const int INV_SW = D3Q27System::DIR_PP0; + static const int INV_SE = D3Q27System::DIR_MP0; + static const int INV_NW = D3Q27System::DIR_PM0; + static const int INV_TE = D3Q27System::DIR_M0M; + static const int INV_BW = D3Q27System::DIR_P0P; + static const int INV_BE = D3Q27System::DIR_M0P; + static const int INV_TW = D3Q27System::DIR_P0M; + static const int INV_TN = D3Q27System::DIR_0MM; + static const int INV_BS = D3Q27System::DIR_0PP; + static const int INV_BN = D3Q27System::DIR_0MP; + static const int INV_TS = D3Q27System::DIR_0PM; + static const int INV_TNE = D3Q27System::DIR_MMM; + static const int INV_TNW = D3Q27System::DIR_PMM; + static const int INV_TSE = D3Q27System::DIR_MPM; + static const int INV_TSW = D3Q27System::DIR_PPM; + static const int INV_BNE = D3Q27System::DIR_MMP; + static const int INV_BNW = D3Q27System::DIR_PMP; + static const int INV_BSE = D3Q27System::DIR_MPP; + static const int INV_BSW = D3Q27System::DIR_PPP; static const unsigned long int etZERO; // 1;/*f0 */ static const unsigned long int etE; // 2; /*f1 */ diff --git a/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp b/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp index 79753c144f5cfff831f1d0415e9434c50b11bcea..3a55c6ad7d4faecfd8d058f8d044c7da1247f962 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/Block3D.cpp @@ -34,7 +34,7 @@ #include "Block3D.h" #include "Block3DConnector.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMKernel.h" int Block3D::counter = 0; @@ -335,13 +335,13 @@ std::string Block3D::toString() for (std::size_t i = 0; i < connectors.size(); i++) if (connectors[i]) { if (connectors[i]->isLocalConnector()) - ss << "l." << Grid3DSystem::getDirectionString(connectors[i]->getSendDir()) << ", "; + ss << "l." << D3Q27System::getDirectionString(connectors[i]->getSendDir()) << ", "; if (connectors[i]->isRemoteConnector()) - ss << "r." << Grid3DSystem::getDirectionString(connectors[i]->getSendDir()) << ", "; + ss << "r." << D3Q27System::getDirectionString(connectors[i]->getSendDir()) << ", "; if (connectors[i]->isInterpolationConnectorCF()) - ss << "cf." << Grid3DSystem::getDirectionString(connectors[i]->getSendDir()) << ", "; + ss << "cf." << D3Q27System::getDirectionString(connectors[i]->getSendDir()) << ", "; if (connectors[i]->isInterpolationConnectorFC()) - ss << "fc." << Grid3DSystem::getDirectionString(connectors[i]->getSendDir()) << ", "; + ss << "fc." << D3Q27System::getDirectionString(connectors[i]->getSendDir()) << ", "; } return ss.str(); } diff --git a/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp b/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp index 41235087e4d48f81c1581e39dd8c0a3a54a7779a..c8e5c24d5951e1cbfed64f5a59ba2d35f777b0d5 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp @@ -39,21 +39,21 @@ #include <geometry3d/CoordinateTransformation3D.h> #include "Block3DVisitor.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "Grid3DVisitor.h" #include "Interactor3D.h" -#include "LBMSystem.h" +#include "D3Q27System.h" #include <Block3D.h> #include <Communicator.h> using namespace std; -Grid3D::Grid3D() { levelSet.resize(Grid3DSystem::MAXLEVEL + 1); } +Grid3D::Grid3D() { levelSet.resize(D3Q27System::MAXLEVEL + 1); } ////////////////////////////////////////////////////////////////////////// Grid3D::Grid3D(std::shared_ptr<vf::mpi::Communicator> comm) { - levelSet.resize(Grid3DSystem::MAXLEVEL + 1); + levelSet.resize(D3Q27System::MAXLEVEL + 1); bundle = comm->getBundleID(); rank = comm->getProcessID(); } @@ -63,7 +63,7 @@ Grid3D::Grid3D(std::shared_ptr<vf::mpi::Communicator> comm, int blockNx1, int bl blockNx1(blockNx1), blockNx2(blockNx2), blockNx3(blockNx2), nx1(gridNx1), nx2(gridNx2), nx3(gridNx3) { - levelSet.resize(Grid3DSystem::MAXLEVEL + 1); + levelSet.resize(D3Q27System::MAXLEVEL + 1); bundle = comm->getBundleID(); rank = comm->getProcessID(); trafo = std::make_shared<CoordinateTransformation3D>(0.0, 0.0, 0.0, (double)blockNx1, (double)blockNx2, @@ -88,7 +88,7 @@ void Grid3D::accept(Block3DVisitor &blockVisitor) int startLevel = blockVisitor.getStartLevel(); int stopLevel = blockVisitor.getStopLevel(); - if (startLevel < 0 || stopLevel < 0 || startLevel > Grid3DSystem::MAXLEVEL || stopLevel > Grid3DSystem::MAXLEVEL) + if (startLevel < 0 || stopLevel < 0 || startLevel > D3Q27System::MAXLEVEL || stopLevel > D3Q27System::MAXLEVEL) throw UbException(UB_EXARGS, "not valid level!"); bool dir = startLevel < stopLevel; @@ -158,8 +158,8 @@ bool Grid3D::deleteBlock(int ix1, int ix2, int ix3, int level) void Grid3D::deleteBlocks() { std::vector<std::vector<SPtr<Block3D>>> blocksVector(25); - int minInitLevel = Grid3DSystem::MINLEVEL; - int maxInitLevel = Grid3DSystem::MAXLEVEL; + int minInitLevel = D3Q27System::MINLEVEL; + int maxInitLevel = D3Q27System::MAXLEVEL; for (int level = minInitLevel; level < maxInitLevel; level++) { getBlocks(level, blocksVector[level]); for (SPtr<Block3D> block : blocksVector[level]) // blocks of the current level @@ -265,7 +265,7 @@ void Grid3D::getSubBlocks(int ix1, int ix2, int ix3, int level, int levelDepth, return; if (level > 0 && !this->getSuperBlock(ix1, ix2, ix3, level)) return; - if (level >= Grid3DSystem::MAXLEVEL) + if (level >= D3Q27System::MAXLEVEL) throw UbException(UB_EXARGS, "Level bigger then MAXLEVEL"); int x1[] = { ix1 << 1, (ix1 << 1) + 1 }; @@ -300,7 +300,7 @@ bool Grid3D::expandBlock(int ix1, int ix2, int ix3, int level) ix3 = block->getX3(); int l = level + 1; - if (l > Grid3DSystem::MAXLEVEL) + if (l > D3Q27System::MAXLEVEL) throw UbException(UB_EXARGS, "level > Grid3D::MAXLEVEL"); int west = ix1 << 1; @@ -584,7 +584,7 @@ void Grid3D::checkLevel(int level) if (level < 0) { throw UbException(UB_EXARGS, "l(" + UbSystem::toString(level) + (string) ")<0"); } - if (level > Grid3DSystem::MAXLEVEL) { + if (level > D3Q27System::MAXLEVEL) { throw UbException(UB_EXARGS, "l(" + UbSystem::toString(level) + (string) ")>MAXLEVEL"); } if (this->levelSet[level].size() == 0) { @@ -596,7 +596,7 @@ bool Grid3D::hasLevel(int level) const { if (level < 0) return false; - if (level > Grid3DSystem::MAXLEVEL) + if (level > D3Q27System::MAXLEVEL) return false; if (this->levelSet[level].size() == 0) return false; @@ -616,7 +616,7 @@ UbTupleInt3 Grid3D::getBlockNX() const { return makeUbTuple(blockNx1, blockNx2, SPtr<Block3D> Grid3D::getNeighborBlock(int dir, int ix1, int ix2, int ix3, int level) const { - return this->getBlock(ix1 + Grid3DSystem::EX1[dir], ix2 + Grid3DSystem::EX2[dir], ix3 + Grid3DSystem::EX3[dir], + return this->getBlock(ix1 + D3Q27System::DX1[dir], ix2 + D3Q27System::DX2[dir], ix3 + D3Q27System::DX3[dir], level); } ////////////////////////////////////////////////////////////////////////// @@ -631,8 +631,8 @@ SPtr<Block3D> Grid3D::getNeighborBlock(int dir, SPtr<Block3D> block) const ////////////////////////////////////////////////////////////////////////// void Grid3D::getAllNeighbors(int ix1, int ix2, int ix3, int level, int levelDepth, std::vector<SPtr<Block3D>> &blocks) { - for (int dir = Grid3DSystem::STARTDIR; dir <= Grid3DSystem::ENDDIR; dir++) - // for (int dir = Grid3DSystem::STARTDIR; dir<=Grid3DSystem::TS; dir++) + for (int dir = D3Q27System::STARTDIR; dir <= D3Q27System::ENDDIR; dir++) + // for (int dir = D3Q27System::STARTDIR; dir<=D3Q27System::DIR_0MP; dir++) { this->getNeighborBlocksForDirection(dir, ix1, ix2, ix3, level, levelDepth, blocks); } @@ -1100,82 +1100,82 @@ void Grid3D::getNeighborBlocksForDirection(int dir, int ix1, int ix2, int ix3, i std::vector<SPtr<Block3D>> &blocks) { switch (dir) { - case Grid3DSystem::E: + case D3Q27System::DIR_P00: this->getNeighborsEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::W: + case D3Q27System::DIR_M00: this->getNeighborsWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::N: + case D3Q27System::DIR_0P0: this->getNeighborsNorth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::S: + case D3Q27System::DIR_0M0: this->getNeighborsSouth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::T: + case D3Q27System::DIR_00P: this->getNeighborsTop(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::B: + case D3Q27System::DIR_00M: this->getNeighborsBottom(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::NE: + case D3Q27System::DIR_PP0: this->getNeighborsNorthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::SW: + case D3Q27System::DIR_MM0: this->getNeighborsSouthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::SE: + case D3Q27System::DIR_PM0: this->getNeighborsSouthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::NW: + case D3Q27System::DIR_MP0: this->getNeighborsNorthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TE: + case D3Q27System::DIR_P0P: this->getNeighborsTopEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BW: + case D3Q27System::DIR_M0M: this->getNeighborsBottomWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BE: + case D3Q27System::DIR_P0M: this->getNeighborsBottomEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TW: + case D3Q27System::DIR_M0P: this->getNeighborsTopWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TN: + case D3Q27System::DIR_0PP: this->getNeighborsTopNorth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BS: + case D3Q27System::DIR_0MM: this->getNeighborsBottomSouth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BN: + case D3Q27System::DIR_0PM: this->getNeighborsBottomNorth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TS: + case D3Q27System::DIR_0MP: this->getNeighborsTopSouth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TNE: + case D3Q27System::DIR_PPP: this->getNeighborsTopNorthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TNW: + case D3Q27System::DIR_MPP: this->getNeighborsTopNorthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TSE: + case D3Q27System::DIR_PMP: this->getNeighborsTopSouthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TSW: + case D3Q27System::DIR_MMP: this->getNeighborsTopSouthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BNE: + case D3Q27System::DIR_PPM: this->getNeighborsBottomNorthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BNW: + case D3Q27System::DIR_MPM: this->getNeighborsBottomNorthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BSE: + case D3Q27System::DIR_PMM: this->getNeighborsBottomSouthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BSW: + case D3Q27System::DIR_MMM: this->getNeighborsBottomSouthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; default: @@ -1263,85 +1263,85 @@ void Grid3D::getNeighborBlocksForDirectionWithDirZero(int dir, int ix1, int ix2, std::vector<SPtr<Block3D>> &blocks) { switch (dir) { - case Grid3DSystem::E: + case D3Q27System::DIR_P00: this->getNeighborsEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::W: + case D3Q27System::DIR_M00: this->getNeighborsWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::N: + case D3Q27System::DIR_0P0: this->getNeighborsNorth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::S: + case D3Q27System::DIR_0M0: this->getNeighborsSouth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::T: + case D3Q27System::DIR_00P: this->getNeighborsTop(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::B: + case D3Q27System::DIR_00M: this->getNeighborsBottom(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::NE: + case D3Q27System::DIR_PP0: this->getNeighborsNorthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::SW: + case D3Q27System::DIR_MM0: this->getNeighborsSouthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::SE: + case D3Q27System::DIR_PM0: this->getNeighborsSouthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::NW: + case D3Q27System::DIR_MP0: this->getNeighborsNorthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TE: + case D3Q27System::DIR_P0P: this->getNeighborsTopEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BW: + case D3Q27System::DIR_M0M: this->getNeighborsBottomWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BE: + case D3Q27System::DIR_P0M: this->getNeighborsBottomEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TW: + case D3Q27System::DIR_M0P: this->getNeighborsTopWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TN: + case D3Q27System::DIR_0PP: this->getNeighborsTopNorth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BS: + case D3Q27System::DIR_0MM: this->getNeighborsBottomSouth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BN: + case D3Q27System::DIR_0PM: this->getNeighborsBottomNorth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TS: + case D3Q27System::DIR_0MP: this->getNeighborsTopSouth(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TNE: + case D3Q27System::DIR_PPP: this->getNeighborsTopNorthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TNW: + case D3Q27System::DIR_MPP: this->getNeighborsTopNorthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TSE: + case D3Q27System::DIR_PMP: this->getNeighborsTopSouthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::TSW: + case D3Q27System::DIR_MMP: this->getNeighborsTopSouthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BNE: + case D3Q27System::DIR_PPM: this->getNeighborsBottomNorthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BNW: + case D3Q27System::DIR_MPM: this->getNeighborsBottomNorthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BSE: + case D3Q27System::DIR_PMM: this->getNeighborsBottomSouthEast(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::BSW: + case D3Q27System::DIR_MMM: this->getNeighborsBottomSouthWest(ix1, ix2, ix3, level, levelDepth, blocks); break; - case Grid3DSystem::REST: + case D3Q27System::DIR_000: this->getNeighborsZero(ix1, ix2, ix3, level, levelDepth, blocks); break; default: @@ -1980,7 +1980,7 @@ void Grid3D::getBlocks(int level, int rank, bool active, std::vector<SPtr<Block3 ////////////////////////////////////////////////////////////////////////// int Grid3D::getFinestInitializedLevel() { - for (int i = Grid3DSystem::MAXLEVEL; i >= 0; i--) + for (int i = D3Q27System::MAXLEVEL; i >= 0; i--) if (this->levelSet[i].size() > 0) return (i); return (-1); @@ -1988,7 +1988,7 @@ int Grid3D::getFinestInitializedLevel() ////////////////////////////////////////////////////////////////////////// int Grid3D::getCoarsestInitializedLevel() { - for (int i = 0; i <= Grid3DSystem::MAXLEVEL; i++) + for (int i = 0; i <= D3Q27System::MAXLEVEL; i++) if (this->levelSet[i].size() > 0) return (i); return (-1); @@ -2343,7 +2343,7 @@ void Grid3D::updateDistributedBlocks(std::shared_ptr<vf::mpi::Communicator> comm levelSet[l].clear(); } this->levelSet.clear(); - levelSet.resize(Grid3DSystem::MAXLEVEL + 1); + levelSet.resize(D3Q27System::MAXLEVEL + 1); int rsize = (int)blocks.size(); for (int i = 0; i < rsize; i += 5) { diff --git a/src/cpu/VirtualFluidsCore/Grid/Grid3DSystem.cpp b/src/cpu/VirtualFluidsCore/Grid/Grid3DSystem.cpp deleted file mode 100644 index 33db1b0cf0fd07e5ac1db313ace368a3da0c7aed..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/Grid/Grid3DSystem.cpp +++ /dev/null @@ -1,58 +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 Grid3DSystem.cpp -//! \ingroup Grid -//! \author Konstantin Kutscher -//======================================================================================= - -#include <Grid3DSystem.h> - -namespace Grid3DSystem -{ -const int INVDIR[] = { INV_E, INV_W, INV_N, INV_S, INV_T, INV_B, INV_NE, INV_NW, INV_SE, - INV_SW, INV_TE, INV_TW, INV_BE, INV_BW, INV_TN, INV_TS, INV_BN, INV_BS, - INV_TNE, INV_TNW, INV_TSE, INV_TSW, INV_BNE, INV_BNW, INV_BSE, INV_BSW }; - -// 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[] = { 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, 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, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1 }; -} // namespace Grid3DSystem - -////////////////////////////////////////////////////////////////////////// -const int &Grid3DSystem::getInvertDirection(const int &direction) -{ -#ifdef _DEBUG - if (direction < STARTDIR || direction > ENDDIR) - throw UbException(UB_EXARGS, "unknown direction"); -#endif - return INVDIR[direction]; -} diff --git a/src/cpu/VirtualFluidsCore/Grid/Grid3DSystem.h b/src/cpu/VirtualFluidsCore/Grid/Grid3DSystem.h deleted file mode 100644 index 94c3bf2a75bf8e7137b08c113c1caa878d8c0896..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/Grid/Grid3DSystem.h +++ /dev/null @@ -1,291 +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 Grid3DSystem.h -//! \ingroup Grid -//! \author Konstantin Kutscher -//======================================================================================= - -#ifndef Grid3DSystem_H -#define Grid3DSystem_H - -#include <cmath> -#include <iostream> -#include <string> - -#include <basics/utilities/UbException.h> -#include <basics/utilities/UbMath.h> - -namespace Grid3DSystem -{ -static const int STARTDIR = 0; - -static const int E /*f1 */ = 0; -static const int W /*f2 */ = 1; -static const int N /*f3 */ = 2; -static const int S /*f4 */ = 3; -static const int T /*f5 */ = 4; -static const int B /*f6 */ = 5; -static const int NE /*f7 */ = 6; -static const int SW /*f8 */ = 7; -static const int SE /*f9 */ = 8; -static const int NW /*f10*/ = 9; -static const int TE /*f11*/ = 10; -static const int BW /*f12*/ = 11; -static const int BE /*f13*/ = 12; -static const int TW /*f14*/ = 13; -static const int TN /*f15*/ = 14; -static const int BS /*f16*/ = 15; -static const int BN /*f17*/ = 16; -static const int TS /*f18*/ = 17; -static const int TNE = 18; -static const int TNW = 19; -static const int TSE = 20; -static const int TSW = 21; -static const int BNE = 22; -static const int BNW = 23; -static const int BSE = 24; -static const int BSW = 25; -static const int REST /*f0 */ = 26; - -static const int ENDDIR = 25; - -static const int INV_E = W; -static const int INV_W = E; -static const int INV_N = S; -static const int INV_S = N; -static const int INV_T = B; -static const int INV_B = T; -static const int INV_NE = SW; -static const int INV_NW = SE; -static const int INV_SE = NW; -static const int INV_SW = NE; -static const int INV_TE = BW; -static const int INV_TW = BE; -static const int INV_BE = TW; -static const int INV_BW = TE; -static const int INV_TN = BS; -static const int INV_TS = BN; -static const int INV_BN = TS; -static const int INV_BS = TN; -static const int INV_TNE = BSW; -static const int INV_TNW = BSE; -static const int INV_TSE = BNW; -static const int INV_TSW = BNE; -static const int INV_BNE = TSW; -static const int INV_BNW = TSE; -static const int INV_BSE = TNW; -static const int INV_BSW = TNE; - -extern const int INVDIR[ENDDIR + 1]; - -static const int MINLEVEL = 0; -static const int MAXLEVEL = 25; - -extern const int EX1[ENDDIR + 1]; -extern const int EX2[ENDDIR + 1]; -extern const int EX3[ENDDIR + 1]; - -inline std::string getDirectionString(int direction) -{ - switch (direction) { - case E: - return "E"; - case W: - return "W"; - case N: - return "N"; - case S: - return "S"; - case T: - return "T"; - case B: - return "B"; - case NE: - return "NE"; - case NW: - return "NW"; - case SE: - return "SE"; - case SW: - return "SW"; - case TE: - return "TE"; - case TW: - return "TW"; - case BE: - return "BE"; - case BW: - return "BW"; - case TN: - return "TN"; - case TS: - return "TS"; - case BN: - return "BN"; - case BS: - return "BS"; - case TNE: - return "TNE"; - case TNW: - return "TNW"; - case TSE: - return "TSE"; - case TSW: - return "TSW"; - case BNE: - return "BNE"; - case BNW: - return "BNW"; - case BSE: - return "BSE"; - case BSW: - return "BSW"; - default: - return "Cell3DSystem::getDrectionString(...) - unknown dir"; - } -} -static const int &getInvertDirection(const int &direction); - -////////////////////////////////////////////////////////////////////////// -static inline void setNeighborCoordinatesForDirection(int &x1, int &x2, int &x3, const int &direction) -{ - switch (direction) { - case Grid3DSystem::E: - x1++; - break; - case Grid3DSystem::N: - x2++; - break; - case Grid3DSystem::T: - x3++; - break; - case Grid3DSystem::W: - x1--; - break; - case Grid3DSystem::S: - x2--; - break; - case Grid3DSystem::B: - x3--; - break; - case Grid3DSystem::NE: - x1++; - x2++; - break; - case Grid3DSystem::NW: - x1--; - x2++; - break; - case Grid3DSystem::SW: - x1--; - x2--; - break; - case Grid3DSystem::SE: - x1++; - x2--; - break; - case Grid3DSystem::TE: - x1++; - x3++; - break; - case Grid3DSystem::BW: - x1--; - x3--; - break; - case Grid3DSystem::BE: - x1++; - x3--; - break; - case Grid3DSystem::TW: - x1--; - x3++; - break; - case Grid3DSystem::TN: - x2++; - x3++; - break; - case Grid3DSystem::BS: - x2--; - x3--; - break; - case Grid3DSystem::BN: - x2++; - x3--; - break; - case Grid3DSystem::TS: - x2--; - x3++; - break; - case Grid3DSystem::TNE: - x1++; - x2++; - x3++; - break; - case Grid3DSystem::TNW: - x1--; - x2++; - x3++; - break; - case Grid3DSystem::TSE: - x1++; - x2--; - x3++; - break; - case Grid3DSystem::TSW: - x1--; - x2--; - x3++; - break; - case Grid3DSystem::BNE: - x1++; - x2++; - x3--; - break; - case Grid3DSystem::BNW: - x1--; - x2++; - x3--; - break; - case Grid3DSystem::BSE: - x1++; - x2--; - x3--; - break; - case Grid3DSystem::BSW: - x1--; - x2--; - x3--; - break; - default: - throw UbException(UB_EXARGS, "no direction ..."); - } -} -} // namespace Grid3DSystem - -#endif diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp index bf1895b930f1c61d36d537319b53fe4b0abcd960..a834466f85b85890bf7c1a5a264807e6a0b13ee1 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp +++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp @@ -90,108 +90,108 @@ void D3Q27Interactor::initRayVectors() int fdir; double c1oS2 = UbMath::one_over_sqrt2; double c1oS3 = UbMath::one_over_sqrt3; - fdir = D3Q27System::E; + fdir = D3Q27System::DIR_P00; rayX1[fdir] = 1.0; rayX2[fdir] = 0.0; rayX3[fdir] = 0.0; - fdir = D3Q27System::W; + fdir = D3Q27System::DIR_M00; rayX1[fdir] = -1.0; rayX2[fdir] = 0.0; rayX3[fdir] = 0.0; - fdir = D3Q27System::N; + fdir = D3Q27System::DIR_0P0; rayX1[fdir] = 0.0; rayX2[fdir] = 1.0; rayX3[fdir] = 0.0; - fdir = D3Q27System::S; + fdir = D3Q27System::DIR_0M0; rayX1[fdir] = 0.0; rayX2[fdir] = -1.0; rayX3[fdir] = 0.0; - fdir = D3Q27System::T; + fdir = D3Q27System::DIR_00P; rayX1[fdir] = 0.0; rayX2[fdir] = 0.0; rayX3[fdir] = 1.0; - fdir = D3Q27System::B; + fdir = D3Q27System::DIR_00M; rayX1[fdir] = 0.0; rayX2[fdir] = 0.0; rayX3[fdir] = -1.0; - fdir = D3Q27System::NE; + fdir = D3Q27System::DIR_PP0; rayX1[fdir] = c1oS2; rayX2[fdir] = c1oS2; rayX3[fdir] = 0.0; - fdir = D3Q27System::SW; + fdir = D3Q27System::DIR_MM0; rayX1[fdir] = -c1oS2; rayX2[fdir] = -c1oS2; rayX3[fdir] = 0.0; - fdir = D3Q27System::SE; + fdir = D3Q27System::DIR_PM0; rayX1[fdir] = c1oS2; rayX2[fdir] = -c1oS2; rayX3[fdir] = 0.0; - fdir = D3Q27System::NW; + fdir = D3Q27System::DIR_MP0; rayX1[fdir] = -c1oS2; rayX2[fdir] = c1oS2; rayX3[fdir] = 0.0; - fdir = D3Q27System::TE; + fdir = D3Q27System::DIR_P0P; rayX1[fdir] = c1oS2; rayX2[fdir] = 0.0; rayX3[fdir] = c1oS2; - fdir = D3Q27System::BW; + fdir = D3Q27System::DIR_M0M; rayX1[fdir] = -c1oS2; rayX2[fdir] = 0.0; rayX3[fdir] = -c1oS2; - fdir = D3Q27System::BE; + fdir = D3Q27System::DIR_P0M; rayX1[fdir] = c1oS2; rayX2[fdir] = 0.0; rayX3[fdir] = -c1oS2; - fdir = D3Q27System::TW; + fdir = D3Q27System::DIR_M0P; rayX1[fdir] = -c1oS2; rayX2[fdir] = 0.0; rayX3[fdir] = c1oS2; - fdir = D3Q27System::TN; + fdir = D3Q27System::DIR_0PP; rayX1[fdir] = 0.0; rayX2[fdir] = c1oS2; rayX3[fdir] = c1oS2; - fdir = D3Q27System::BS; + fdir = D3Q27System::DIR_0MM; rayX1[fdir] = 0.0; rayX2[fdir] = -c1oS2; rayX3[fdir] = -c1oS2; - fdir = D3Q27System::BN; + fdir = D3Q27System::DIR_0PM; rayX1[fdir] = 0.0; rayX2[fdir] = c1oS2; rayX3[fdir] = -c1oS2; - fdir = D3Q27System::TS; + fdir = D3Q27System::DIR_0MP; rayX1[fdir] = 0.0; rayX2[fdir] = -c1oS2; rayX3[fdir] = c1oS2; - fdir = D3Q27System::TNW; + fdir = D3Q27System::DIR_MPP; rayX1[fdir] = -c1oS3; rayX2[fdir] = c1oS3; rayX3[fdir] = c1oS3; - fdir = D3Q27System::TNE; + fdir = D3Q27System::DIR_PPP; rayX1[fdir] = c1oS3; rayX2[fdir] = c1oS3; rayX3[fdir] = c1oS3; - fdir = D3Q27System::TSW; + fdir = D3Q27System::DIR_MMP; rayX1[fdir] = -c1oS3; rayX2[fdir] = -c1oS3; rayX3[fdir] = c1oS3; - fdir = D3Q27System::TSE; + fdir = D3Q27System::DIR_PMP; rayX1[fdir] = c1oS3; rayX2[fdir] = -c1oS3; rayX3[fdir] = c1oS3; - fdir = D3Q27System::BNW; + fdir = D3Q27System::DIR_MPM; rayX1[fdir] = -c1oS3; rayX2[fdir] = c1oS3; rayX3[fdir] = -c1oS3; - fdir = D3Q27System::BNE; + fdir = D3Q27System::DIR_PPM; rayX1[fdir] = c1oS3; rayX2[fdir] = c1oS3; rayX3[fdir] = -c1oS3; - fdir = D3Q27System::BSW; + fdir = D3Q27System::DIR_MMM; rayX1[fdir] = -c1oS3; rayX2[fdir] = -c1oS3; rayX3[fdir] = -c1oS3; - fdir = D3Q27System::BSE; + fdir = D3Q27System::DIR_PMM; rayX1[fdir] = c1oS3; rayX2[fdir] = -c1oS3; rayX3[fdir] = -c1oS3; @@ -327,18 +327,18 @@ bool D3Q27Interactor::setDifferencesToGbObject3D(const SPtr<Block3D> block) UB_EXARGS, "fuer den bei LB nicht vorkommenden Fall deltaX1!=deltaX2!=deltaX3 nicht implementiert "); vector<double> distNeigh(D3Q27System::FENDDIR + 1, UbMath::sqrt2 * deltaX1); - distNeigh[D3Q27System::E] = distNeigh[D3Q27System::W] = distNeigh[D3Q27System::N] = deltaX1; - distNeigh[D3Q27System::S] = distNeigh[D3Q27System::T] = distNeigh[D3Q27System::B] = deltaX1; - distNeigh[D3Q27System::NE] = distNeigh[D3Q27System::NW] = distNeigh[D3Q27System::SW] = - distNeigh[D3Q27System::SE] = UbMath::sqrt2 * deltaX1; - distNeigh[D3Q27System::TE] = distNeigh[D3Q27System::TN] = distNeigh[D3Q27System::TW] = - distNeigh[D3Q27System::TS] = UbMath::sqrt2 * deltaX1; - distNeigh[D3Q27System::BE] = distNeigh[D3Q27System::BN] = distNeigh[D3Q27System::BW] = - distNeigh[D3Q27System::BS] = UbMath::sqrt2 * deltaX1; - distNeigh[D3Q27System::TNE] = distNeigh[D3Q27System::TNW] = distNeigh[D3Q27System::TSE] = - distNeigh[D3Q27System::TSW] = UbMath::sqrt3 * deltaX1; - distNeigh[D3Q27System::BNE] = distNeigh[D3Q27System::BNW] = distNeigh[D3Q27System::BSE] = - distNeigh[D3Q27System::BSW] = UbMath::sqrt3 * deltaX1; + distNeigh[D3Q27System::DIR_P00] = distNeigh[D3Q27System::DIR_M00] = distNeigh[D3Q27System::DIR_0P0] = deltaX1; + distNeigh[D3Q27System::DIR_0M0] = distNeigh[D3Q27System::DIR_00P] = distNeigh[D3Q27System::DIR_00M] = deltaX1; + distNeigh[D3Q27System::DIR_PP0] = distNeigh[D3Q27System::DIR_MP0] = distNeigh[D3Q27System::DIR_MM0] = + distNeigh[D3Q27System::DIR_PM0] = UbMath::sqrt2 * deltaX1; + distNeigh[D3Q27System::DIR_P0P] = distNeigh[D3Q27System::DIR_0PP] = distNeigh[D3Q27System::DIR_M0P] = + distNeigh[D3Q27System::DIR_0MP] = UbMath::sqrt2 * deltaX1; + distNeigh[D3Q27System::DIR_P0M] = distNeigh[D3Q27System::DIR_0PM] = distNeigh[D3Q27System::DIR_M0M] = + distNeigh[D3Q27System::DIR_0MM] = UbMath::sqrt2 * deltaX1; + distNeigh[D3Q27System::DIR_PPP] = distNeigh[D3Q27System::DIR_MPP] = distNeigh[D3Q27System::DIR_PMP] = + distNeigh[D3Q27System::DIR_MMP] = UbMath::sqrt3 * deltaX1; + distNeigh[D3Q27System::DIR_PPM] = distNeigh[D3Q27System::DIR_MPM] = distNeigh[D3Q27System::DIR_PMM] = + distNeigh[D3Q27System::DIR_MMM] = UbMath::sqrt3 * deltaX1; double q; bool pointOnBoundary = false; @@ -613,132 +613,132 @@ void D3Q27Interactor::addQsLineSet(std::vector<UbTupleFloat3> &nodes, std::vecto if (bc->hasBoundaryConditionFlag(D3Q27System::INVDIR[dir])) { double x1b, x2b, x3b, q = bc->getQ(dir); switch (dir) { - case D3Q27System::E: + case D3Q27System::DIR_P00: x1b = x1a + q * dx; x2b = x2a; x3b = x3a; break; - case D3Q27System::N: + case D3Q27System::DIR_0P0: x1b = x1a; x2b = x2a + q * dx; x3b = x3a; break; - case D3Q27System::W: + case D3Q27System::DIR_M00: x1b = x1a - q * dx; x2b = x2a; x3b = x3a; break; - case D3Q27System::S: + case D3Q27System::DIR_0M0: x1b = x1a; x2b = x2a - q * dx; x3b = x3a; break; - case D3Q27System::NE: + case D3Q27System::DIR_PP0: x1b = x1a + q * dx; x2b = x2a + q * dx; x3b = x3a; break; - case D3Q27System::NW: + case D3Q27System::DIR_MP0: x1b = x1a - q * dx; x2b = x2a + q * dx; x3b = x3a; break; - case D3Q27System::SW: + case D3Q27System::DIR_MM0: x1b = x1a - q * dx; x2b = x2a - q * dx; x3b = x3a; break; - case D3Q27System::SE: + case D3Q27System::DIR_PM0: x1b = x1a + q * dx; x2b = x2a - q * dx; x3b = x3a; break; - case D3Q27System::T: + case D3Q27System::DIR_00P: x1b = x1a; x2b = x2a; x3b = x3a + q * dx; break; - case D3Q27System::TE: + case D3Q27System::DIR_P0P: x1b = x1a + q * dx; x2b = x2a; x3b = x3a + q * dx; break; - case D3Q27System::TN: + case D3Q27System::DIR_0PP: x1b = x1a; x2b = x2a + q * dx; x3b = x3a + q * dx; break; - case D3Q27System::TW: + case D3Q27System::DIR_M0P: x1b = x1a - q * dx; x2b = x2a; x3b = x3a + q * dx; break; - case D3Q27System::TS: + case D3Q27System::DIR_0MP: x1b = x1a; x2b = x2a - q * dx; x3b = x3a + q * dx; break; - case D3Q27System::B: + case D3Q27System::DIR_00M: x1b = x1a; x2b = x2a; x3b = x3a - q * dx; break; - case D3Q27System::BE: + case D3Q27System::DIR_P0M: x1b = x1a + q * dx; x2b = x2a; x3b = x3a - q * dx; break; - case D3Q27System::BN: + case D3Q27System::DIR_0PM: x1b = x1a; x2b = x2a + q * dx; x3b = x3a - q * dx; break; - case D3Q27System::BW: + case D3Q27System::DIR_M0M: x1b = x1a - q * dx; x2b = x2a; x3b = x3a - q * dx; break; - case D3Q27System::BS: + case D3Q27System::DIR_0MM: x1b = x1a; x2b = x2a - q * dx; x3b = x3a - q * dx; break; - case D3Q27System::TNE: + case D3Q27System::DIR_PPP: x1b = x1a + q * dx; x2b = x2a + q * dx; x3b = x3a + q * dx; break; - case D3Q27System::BSW: + case D3Q27System::DIR_MMM: x1b = x1a - q * dx; x2b = x2a - q * dx; x3b = x3a - q * dx; break; - case D3Q27System::BNE: + case D3Q27System::DIR_PPM: x1b = x1a + q * dx; x2b = x2a + q * dx; x3b = x3a - q * dx; break; - case D3Q27System::TSW: + case D3Q27System::DIR_MMP: x1b = x1a - q * dx; x2b = x2a - q * dx; x3b = x3a + q * dx; break; - case D3Q27System::TSE: + case D3Q27System::DIR_PMP: x1b = x1a + q * dx; x2b = x2a - q * dx; x3b = x3a + q * dx; break; - case D3Q27System::BNW: + case D3Q27System::DIR_MPM: x1b = x1a - q * dx; x2b = x2a + q * dx; x3b = x3a - q * dx; break; - case D3Q27System::BSE: + case D3Q27System::DIR_PMM: x1b = x1a + q * dx; x2b = x2a - q * dx; x3b = x3a - q * dx; break; - case D3Q27System::TNW: + case D3Q27System::DIR_MPP: x1b = x1a - q * dx; x2b = x2a + q * dx; x3b = x3a + q * dx; @@ -782,17 +782,17 @@ vector<pair<GbPoint3D, GbPoint3D>> D3Q27Interactor::getQsLineSet() bool include_TN_Edge = false; //(x1/x2/x3)=([0..blocknx1[/blocknx2/blocknx1) bool include_TE_Edge = false; //(x1/x2/x3)=(blocknx1/[0..blocknx2[/blocknx2) if (block) { - if (!block->getConnector(D3Q27System::N)) + if (!block->getConnector(D3Q27System::DIR_0P0)) include_N_Face = true; - if (!block->getConnector(D3Q27System::E)) + if (!block->getConnector(D3Q27System::DIR_P00)) include_E_Face = true; - if (!block->getConnector(D3Q27System::T)) + if (!block->getConnector(D3Q27System::DIR_00P)) include_T_Face = true; - if (!block->getConnector(D3Q27System::NE) && include_N_Face && include_E_Face) + if (!block->getConnector(D3Q27System::DIR_PP0) && include_N_Face && include_E_Face) include_NE_Edge = true; - if (!block->getConnector(D3Q27System::TN) && include_T_Face && include_N_Face) + if (!block->getConnector(D3Q27System::DIR_0PP) && include_T_Face && include_N_Face) include_TN_Edge = true; - if (!block->getConnector(D3Q27System::TE) && include_T_Face && include_E_Face) + if (!block->getConnector(D3Q27System::DIR_P0P) && include_T_Face && include_E_Face) include_TE_Edge = true; } @@ -834,132 +834,132 @@ vector<pair<GbPoint3D, GbPoint3D>> D3Q27Interactor::getQsLineSet() if (bc->hasBoundaryConditionFlag(D3Q27System::INVDIR[dir])) { double x1b, x2b, x3b, q = bc->getQ(dir); switch (dir) { - case D3Q27System::E: + case D3Q27System::DIR_P00: x1b = x1a + q * dx; x2b = x2a; x3b = x3a; break; - case D3Q27System::N: + case D3Q27System::DIR_0P0: x1b = x1a; x2b = x2a + q * dx; x3b = x3a; break; - case D3Q27System::W: + case D3Q27System::DIR_M00: x1b = x1a - q * dx; x2b = x2a; x3b = x3a; break; - case D3Q27System::S: + case D3Q27System::DIR_0M0: x1b = x1a; x2b = x2a - q * dx; x3b = x3a; break; - case D3Q27System::NE: + case D3Q27System::DIR_PP0: x1b = x1a + q * dx; x2b = x2a + q * dx; x3b = x3a; break; - case D3Q27System::NW: + case D3Q27System::DIR_MP0: x1b = x1a - q * dx; x2b = x2a + q * dx; x3b = x3a; break; - case D3Q27System::SW: + case D3Q27System::DIR_MM0: x1b = x1a - q * dx; x2b = x2a - q * dx; x3b = x3a; break; - case D3Q27System::SE: + case D3Q27System::DIR_PM0: x1b = x1a + q * dx; x2b = x2a - q * dx; x3b = x3a; break; - case D3Q27System::T: + case D3Q27System::DIR_00P: x1b = x1a; x2b = x2a; x3b = x3a + q * dx; break; - case D3Q27System::TE: + case D3Q27System::DIR_P0P: x1b = x1a + q * dx; x2b = x2a; x3b = x3a + q * dx; break; - case D3Q27System::TN: + case D3Q27System::DIR_0PP: x1b = x1a; x2b = x2a + q * dx; x3b = x3a + q * dx; break; - case D3Q27System::TW: + case D3Q27System::DIR_M0P: x1b = x1a - q * dx; x2b = x2a; x3b = x3a + q * dx; break; - case D3Q27System::TS: + case D3Q27System::DIR_0MP: x1b = x1a; x2b = x2a - q * dx; x3b = x3a + q * dx; break; - case D3Q27System::B: + case D3Q27System::DIR_00M: x1b = x1a; x2b = x2a; x3b = x3a - q * dx; break; - case D3Q27System::BE: + case D3Q27System::DIR_P0M: x1b = x1a + q * dx; x2b = x2a; x3b = x3a - q * dx; break; - case D3Q27System::BN: + case D3Q27System::DIR_0PM: x1b = x1a; x2b = x2a + q * dx; x3b = x3a - q * dx; break; - case D3Q27System::BW: + case D3Q27System::DIR_M0M: x1b = x1a - q * dx; x2b = x2a; x3b = x3a - q * dx; break; - case D3Q27System::BS: + case D3Q27System::DIR_0MM: x1b = x1a; x2b = x2a - q * dx; x3b = x3a - q * dx; break; - case D3Q27System::TNE: + case D3Q27System::DIR_PPP: x1b = x1a + q * dx; x2b = x2a + q * dx; x3b = x3a + q * dx; break; - case D3Q27System::BSW: + case D3Q27System::DIR_MMM: x1b = x1a - q * dx; x2b = x2a - q * dx; x3b = x3a - q * dx; break; - case D3Q27System::BNE: + case D3Q27System::DIR_PPM: x1b = x1a + q * dx; x2b = x2a + q * dx; x3b = x3a - q * dx; break; - case D3Q27System::TSW: + case D3Q27System::DIR_MMP: x1b = x1a - q * dx; x2b = x2a - q * dx; x3b = x3a + q * dx; break; - case D3Q27System::TSE: + case D3Q27System::DIR_PMP: x1b = x1a + q * dx; x2b = x2a - q * dx; x3b = x3a + q * dx; break; - case D3Q27System::BNW: + case D3Q27System::DIR_MPM: x1b = x1a - q * dx; x2b = x2a + q * dx; x3b = x3a - q * dx; break; - case D3Q27System::BSE: + case D3Q27System::DIR_PMM: x1b = x1a + q * dx; x2b = x2a - q * dx; x3b = x3a - q * dx; break; - case D3Q27System::TNW: + case D3Q27System::DIR_MPP: x1b = x1a - q * dx; x2b = x2a + q * dx; x3b = x3a + q * dx; diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp b/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp index 45204279182e80bb6551a1a96ed7c550e1aa6781..c7b13d3834a6bb822b945f9425ba21b8d5be399d 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp +++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp @@ -364,9 +364,9 @@ void D3Q27TriFaceMeshInteractor::setQs(const double &timeStep) // tmpSolidNodesFromOtherInteractors[block]; double q, distance; - double &nodeDx1 = nodeDeltaToNeigh[level][D3Q27System::E]; - double &nodeDx2 = nodeDeltaToNeigh[level][D3Q27System::N]; - double &nodeDx3 = nodeDeltaToNeigh[level][D3Q27System::T]; + double &nodeDx1 = nodeDeltaToNeigh[level][D3Q27System::DIR_P00]; + double &nodeDx2 = nodeDeltaToNeigh[level][D3Q27System::DIR_0P0]; + double &nodeDx3 = nodeDeltaToNeigh[level][D3Q27System::DIR_00P]; // fuer OBB-Test double qEinflussDelta = 1.1 * sqrt(nodeDx1 * nodeDx1 + nodeDx2 * nodeDx2 + nodeDx3 * nodeDx3); @@ -880,9 +880,9 @@ void D3Q27TriFaceMeshInteractor::initInteractor2(const double &timeStep) std::set<std::vector<int>> &solidsFromOtherInteractors = tmpSolidNodesFromOtherInteractors[block]; double q, internX1, internX2, internX3, distance; - double &nodeDx1 = nodeDeltaToNeigh[level][D3Q27System::E]; - double &nodeDx2 = nodeDeltaToNeigh[level][D3Q27System::N]; - double &nodeDx3 = nodeDeltaToNeigh[level][D3Q27System::T]; + double &nodeDx1 = nodeDeltaToNeigh[level][D3Q27System::DIR_P00]; + double &nodeDx2 = nodeDeltaToNeigh[level][D3Q27System::DIR_0P0]; + double &nodeDx3 = nodeDeltaToNeigh[level][D3Q27System::DIR_00P]; // fuer OBB-Test double qEinflussDelta = 1.1 * sqrt(nodeDx1 * nodeDx1 + nodeDx2 * nodeDx2 + nodeDx3 * nodeDx3); @@ -1181,9 +1181,9 @@ void D3Q27TriFaceMeshInteractor::initInteractor2(const double &timeStep) std::set<UbTupleInt3> &solidNodeIndices = this->solidNodeIndicesMap[block]; - float nodeDeltaX1 = (float)nodeDeltaToNeigh[level][D3Q27System::E]; - float nodeDeltaX2 = (float)nodeDeltaToNeigh[level][D3Q27System::N]; - float nodeDeltaX3 = (float)nodeDeltaToNeigh[level][D3Q27System::T]; + float nodeDeltaX1 = (float)nodeDeltaToNeigh[level][D3Q27System::DIR_P00]; + float nodeDeltaX2 = (float)nodeDeltaToNeigh[level][D3Q27System::DIR_0P0]; + float nodeDeltaX3 = (float)nodeDeltaToNeigh[level][D3Q27System::DIR_00P]; // flagfield matrix initialisieren CbArray3D<FLAGS> flagField(blocknx1, blocknx2, blocknx3, UNDEF_FLAG); diff --git a/src/cpu/VirtualFluidsCore/LBM/BGKLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/BGKLBMKernel.cpp index 20851b019a3a0abd2c8865c7c40530e73bcf6245..50a5339ea01d70ff0076ef81bda16db22e56ffe7 100644 --- a/src/cpu/VirtualFluidsCore/LBM/BGKLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/BGKLBMKernel.cpp @@ -91,117 +91,117 @@ void BGKLBMKernel::calculate(int step) ////////////////////////////////////////////////////////////////////////// // read distribution //////////////////////////////////////////////////////////////////////////// - f[REST] = (*this->zeroDistributions)(x1, x2, x3); + f[DIR_000] = (*this->zeroDistributions)(x1, x2, x3); - f[E] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - f[N] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - f[T] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - f[NE] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - f[NW] = (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3); - f[TE] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - f[TW] = (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3); - f[TN] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - f[TS] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3); - f[TNE] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - f[TNW] = (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3); - f[TSE] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3); - f[TSW] = (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3); + f[DIR_P00] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); + f[DIR_0P0] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); + f[DIR_00P] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); + f[DIR_PP0] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); + f[DIR_MP0] = (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3); + f[DIR_P0P] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); + f[DIR_M0P] = (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3); + f[DIR_0PP] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); + f[DIR_0MP] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3); + f[DIR_PPP] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); + f[DIR_MPP] = (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3); + f[DIR_PMP] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3); + f[DIR_MMP] = (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3); - f[W] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3); - f[S] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3); - f[B] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p); - f[SW] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3); - f[SE] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3); - f[BW] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p); - f[BE] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p); - f[BS] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p); - f[BN] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p); - f[BSW] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p); - f[BSE] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p); - f[BNW] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p); - f[BNE] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p); + f[DIR_M00] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3); + f[DIR_0M0] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3); + f[DIR_00M] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p); + f[DIR_MM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3); + f[DIR_PM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3); + f[DIR_M0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p); + f[DIR_P0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p); + f[DIR_0MM] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p); + f[DIR_0PM] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p); + f[DIR_MMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p); + f[DIR_PMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p); + f[DIR_MPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p); + f[DIR_PPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p); ////////////////////////////////////////////////////////////////////////// - drho = f[REST] + 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]; + drho = f[DIR_000] + f[DIR_P00] + f[DIR_M00] + f[DIR_0P0] + f[DIR_0M0] + f[DIR_00P] + f[DIR_00M] + f[DIR_PP0] + f[DIR_MM0] + f[DIR_PM0] + f[DIR_MP0] + f[DIR_P0P] + + f[DIR_M0M] + f[DIR_P0M] + f[DIR_M0P] + f[DIR_0PP] + f[DIR_0MM] + f[DIR_0PM] + f[DIR_0MP] + f[DIR_PPP] + f[DIR_MMP] + f[DIR_PMP] + f[DIR_MPP] + + f[DIR_PPM] + f[DIR_MMM] + f[DIR_PMM] + f[DIR_MPM]; - vx1 = f[E] - f[W] + f[NE] - f[SW] + f[SE] - f[NW] + f[TE] - f[BW] + f[BE] - f[TW] + f[TNE] - - f[TSW] + f[TSE] - f[TNW] + f[BNE] - f[BSW] + f[BSE] - f[BNW]; + vx1 = f[DIR_P00] - f[DIR_M00] + f[DIR_PP0] - f[DIR_MM0] + f[DIR_PM0] - f[DIR_MP0] + f[DIR_P0P] - f[DIR_M0M] + f[DIR_P0M] - f[DIR_M0P] + f[DIR_PPP] - + f[DIR_MMP] + f[DIR_PMP] - f[DIR_MPP] + f[DIR_PPM] - f[DIR_MMM] + f[DIR_PMM] - f[DIR_MPM]; - vx2 = f[N] - f[S] + f[NE] - f[SW] - f[SE] + f[NW] + f[TN] - f[BS] + f[BN] - f[TS] + f[TNE] - - f[TSW] - f[TSE] + f[TNW] + f[BNE] - f[BSW] - f[BSE] + f[BNW]; + vx2 = f[DIR_0P0] - f[DIR_0M0] + f[DIR_PP0] - f[DIR_MM0] - f[DIR_PM0] + f[DIR_MP0] + f[DIR_0PP] - f[DIR_0MM] + f[DIR_0PM] - f[DIR_0MP] + f[DIR_PPP] - + f[DIR_MMP] - f[DIR_PMP] + f[DIR_MPP] + f[DIR_PPM] - f[DIR_MMM] - f[DIR_PMM] + f[DIR_MPM]; - vx3 = f[T] - f[B] + 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]; + vx3 = f[DIR_00P] - f[DIR_00M] + f[DIR_P0P] - f[DIR_M0M] - f[DIR_P0M] + f[DIR_M0P] + f[DIR_0PP] - f[DIR_0MM] - f[DIR_0PM] + f[DIR_0MP] + f[DIR_PPP] + + f[DIR_MMP] + f[DIR_PMP] + f[DIR_MPP] - f[DIR_PPM] - f[DIR_MMM] - f[DIR_PMM] - f[DIR_MPM]; LBMReal cu_sq = 1.5 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3); - feq[REST] = c8o27 * (drho - cu_sq); - feq[E] = c2o27 * (drho + 3.0 * (vx1) + c9o2 * (vx1) * (vx1)-cu_sq); - feq[W] = c2o27 * (drho + 3.0 * (-vx1) + c9o2 * (-vx1) * (-vx1) - cu_sq); - feq[N] = c2o27 * (drho + 3.0 * (vx2) + c9o2 * (vx2) * (vx2)-cu_sq); - feq[S] = c2o27 * (drho + 3.0 * (-vx2) + c9o2 * (-vx2) * (-vx2) - cu_sq); - feq[T] = c2o27 * (drho + 3.0 * (vx3) + c9o2 * (vx3) * (vx3)-cu_sq); - feq[B] = c2o27 * (drho + 3.0 * (-vx3) + c9o2 * (-vx3) * (-vx3) - cu_sq); - feq[NE] = c1o54 * (drho + 3.0 * (vx1 + vx2) + c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq); - feq[SW] = c1o54 * (drho + 3.0 * (-vx1 - vx2) + c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq); - feq[SE] = c1o54 * (drho + 3.0 * (vx1 - vx2) + c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq); - feq[NW] = c1o54 * (drho + 3.0 * (-vx1 + vx2) + c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq); - feq[TE] = c1o54 * (drho + 3.0 * (vx1 + vx3) + c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq); - feq[BW] = c1o54 * (drho + 3.0 * (-vx1 - vx3) + c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq); - feq[BE] = c1o54 * (drho + 3.0 * (vx1 - vx3) + c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq); - feq[TW] = c1o54 * (drho + 3.0 * (-vx1 + vx3) + c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq); - feq[TN] = c1o54 * (drho + 3.0 * (vx2 + vx3) + c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq); - feq[BS] = c1o54 * (drho + 3.0 * (-vx2 - vx3) + c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq); - feq[BN] = c1o54 * (drho + 3.0 * (vx2 - vx3) + c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq); - feq[TS] = c1o54 * (drho + 3.0 * (-vx2 + vx3) + c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq); - feq[TNE] = c1o216 * + feq[DIR_000] = c8o27 * (drho - cu_sq); + feq[DIR_P00] = c2o27 * (drho + 3.0 * (vx1) + c9o2 * (vx1) * (vx1)-cu_sq); + feq[DIR_M00] = c2o27 * (drho + 3.0 * (-vx1) + c9o2 * (-vx1) * (-vx1) - cu_sq); + feq[DIR_0P0] = c2o27 * (drho + 3.0 * (vx2) + c9o2 * (vx2) * (vx2)-cu_sq); + feq[DIR_0M0] = c2o27 * (drho + 3.0 * (-vx2) + c9o2 * (-vx2) * (-vx2) - cu_sq); + feq[DIR_00P] = c2o27 * (drho + 3.0 * (vx3) + c9o2 * (vx3) * (vx3)-cu_sq); + feq[DIR_00M] = c2o27 * (drho + 3.0 * (-vx3) + c9o2 * (-vx3) * (-vx3) - cu_sq); + feq[DIR_PP0] = c1o54 * (drho + 3.0 * (vx1 + vx2) + c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq); + feq[DIR_MM0] = c1o54 * (drho + 3.0 * (-vx1 - vx2) + c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq); + feq[DIR_PM0] = c1o54 * (drho + 3.0 * (vx1 - vx2) + c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq); + feq[DIR_MP0] = c1o54 * (drho + 3.0 * (-vx1 + vx2) + c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq); + feq[DIR_P0P] = c1o54 * (drho + 3.0 * (vx1 + vx3) + c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq); + feq[DIR_M0M] = c1o54 * (drho + 3.0 * (-vx1 - vx3) + c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq); + feq[DIR_P0M] = c1o54 * (drho + 3.0 * (vx1 - vx3) + c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq); + feq[DIR_M0P] = c1o54 * (drho + 3.0 * (-vx1 + vx3) + c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq); + feq[DIR_0PP] = c1o54 * (drho + 3.0 * (vx2 + vx3) + c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq); + feq[DIR_0MM] = c1o54 * (drho + 3.0 * (-vx2 - vx3) + c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq); + feq[DIR_0PM] = c1o54 * (drho + 3.0 * (vx2 - vx3) + c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq); + feq[DIR_0MP] = c1o54 * (drho + 3.0 * (-vx2 + vx3) + c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq); + feq[DIR_PPP] = c1o216 * (drho + 3.0 * (vx1 + vx2 + vx3) + c9o2 * (vx1 + vx2 + vx3) * (vx1 + vx2 + vx3) - cu_sq); - feq[BSW] = c1o216 * (drho + 3.0 * (-vx1 - vx2 - vx3) + + feq[DIR_MMM] = c1o216 * (drho + 3.0 * (-vx1 - vx2 - vx3) + c9o2 * (-vx1 - vx2 - vx3) * (-vx1 - vx2 - vx3) - cu_sq); - feq[BNE] = c1o216 * + feq[DIR_PPM] = c1o216 * (drho + 3.0 * (vx1 + vx2 - vx3) + c9o2 * (vx1 + vx2 - vx3) * (vx1 + vx2 - vx3) - cu_sq); - feq[TSW] = c1o216 * (drho + 3.0 * (-vx1 - vx2 + vx3) + + feq[DIR_MMP] = c1o216 * (drho + 3.0 * (-vx1 - vx2 + vx3) + c9o2 * (-vx1 - vx2 + vx3) * (-vx1 - vx2 + vx3) - cu_sq); - feq[TSE] = c1o216 * + feq[DIR_PMP] = c1o216 * (drho + 3.0 * (vx1 - vx2 + vx3) + c9o2 * (vx1 - vx2 + vx3) * (vx1 - vx2 + vx3) - cu_sq); - feq[BNW] = c1o216 * (drho + 3.0 * (-vx1 + vx2 - vx3) + + feq[DIR_MPM] = c1o216 * (drho + 3.0 * (-vx1 + vx2 - vx3) + c9o2 * (-vx1 + vx2 - vx3) * (-vx1 + vx2 - vx3) - cu_sq); - feq[BSE] = c1o216 * + feq[DIR_PMM] = c1o216 * (drho + 3.0 * (vx1 - vx2 - vx3) + c9o2 * (vx1 - vx2 - vx3) * (vx1 - vx2 - vx3) - cu_sq); - feq[TNW] = c1o216 * (drho + 3.0 * (-vx1 + vx2 + vx3) + + feq[DIR_MPP] = c1o216 * (drho + 3.0 * (-vx1 + vx2 + vx3) + c9o2 * (-vx1 + vx2 + vx3) * (-vx1 + vx2 + vx3) - cu_sq); // Relaxation - f[REST] += (feq[REST] - f[REST]) * collFactor; - f[E] += (feq[E] - f[E]) * collFactor; - f[W] += (feq[W] - f[W]) * collFactor; - f[N] += (feq[N] - f[N]) * collFactor; - f[S] += (feq[S] - f[S]) * collFactor; - f[T] += (feq[T] - f[T]) * collFactor; - f[B] += (feq[B] - f[B]) * collFactor; - f[NE] += (feq[NE] - f[NE]) * collFactor; - f[SW] += (feq[SW] - f[SW]) * collFactor; - f[SE] += (feq[SE] - f[SE]) * collFactor; - f[NW] += (feq[NW] - f[NW]) * collFactor; - f[TE] += (feq[TE] - f[TE]) * collFactor; - f[BW] += (feq[BW] - f[BW]) * collFactor; - f[BE] += (feq[BE] - f[BE]) * collFactor; - f[TW] += (feq[TW] - f[TW]) * collFactor; - f[TN] += (feq[TN] - f[TN]) * collFactor; - f[BS] += (feq[BS] - f[BS]) * collFactor; - f[BN] += (feq[BN] - f[BN]) * collFactor; - f[TS] += (feq[TS] - f[TS]) * collFactor; + f[DIR_000] += (feq[DIR_000] - f[DIR_000]) * collFactor; + f[DIR_P00] += (feq[DIR_P00] - f[DIR_P00]) * collFactor; + f[DIR_M00] += (feq[DIR_M00] - f[DIR_M00]) * collFactor; + f[DIR_0P0] += (feq[DIR_0P0] - f[DIR_0P0]) * collFactor; + f[DIR_0M0] += (feq[DIR_0M0] - f[DIR_0M0]) * collFactor; + f[DIR_00P] += (feq[DIR_00P] - f[DIR_00P]) * collFactor; + f[DIR_00M] += (feq[DIR_00M] - f[DIR_00M]) * collFactor; + f[DIR_PP0] += (feq[DIR_PP0] - f[DIR_PP0]) * collFactor; + f[DIR_MM0] += (feq[DIR_MM0] - f[DIR_MM0]) * collFactor; + f[DIR_PM0] += (feq[DIR_PM0] - f[DIR_PM0]) * collFactor; + f[DIR_MP0] += (feq[DIR_MP0] - f[DIR_MP0]) * collFactor; + f[DIR_P0P] += (feq[DIR_P0P] - f[DIR_P0P]) * collFactor; + f[DIR_M0M] += (feq[DIR_M0M] - f[DIR_M0M]) * collFactor; + f[DIR_P0M] += (feq[DIR_P0M] - f[DIR_P0M]) * collFactor; + f[DIR_M0P] += (feq[DIR_M0P] - f[DIR_M0P]) * collFactor; + f[DIR_0PP] += (feq[DIR_0PP] - f[DIR_0PP]) * collFactor; + f[DIR_0MM] += (feq[DIR_0MM] - f[DIR_0MM]) * collFactor; + f[DIR_0PM] += (feq[DIR_0PM] - f[DIR_0PM]) * collFactor; + f[DIR_0MP] += (feq[DIR_0MP] - f[DIR_0MP]) * collFactor; - f[TNE] += (feq[TNE] - f[TNE]) * collFactor; - f[BSW] += (feq[BSW] - f[BSW]) * collFactor; - f[BNE] += (feq[BNE] - f[BNE]) * collFactor; - f[TSW] += (feq[TSW] - f[TSW]) * collFactor; - f[TSE] += (feq[TSE] - f[TSE]) * collFactor; - f[BNW] += (feq[BNW] - f[BNW]) * collFactor; - f[BSE] += (feq[BSE] - f[BSE]) * collFactor; - f[TNW] += (feq[TNW] - f[TNW]) * collFactor; + f[DIR_PPP] += (feq[DIR_PPP] - f[DIR_PPP]) * collFactor; + f[DIR_MMM] += (feq[DIR_MMM] - f[DIR_MMM]) * collFactor; + f[DIR_PPM] += (feq[DIR_PPM] - f[DIR_PPM]) * collFactor; + f[DIR_MMP] += (feq[DIR_MMP] - f[DIR_MMP]) * collFactor; + f[DIR_PMP] += (feq[DIR_PMP] - f[DIR_PMP]) * collFactor; + f[DIR_MPM] += (feq[DIR_MPM] - f[DIR_MPM]) * collFactor; + f[DIR_PMM] += (feq[DIR_PMM] - f[DIR_PMM]) * collFactor; + f[DIR_MPP] += (feq[DIR_MPP] - f[DIR_MPP]) * collFactor; ////////////////////////////////////////////////////////////////////////// // forcing @@ -214,39 +214,39 @@ void BGKLBMKernel::calculate(int step) forcingX2 = muForcingX2.Eval(); forcingX3 = muForcingX3.Eval(); - f[REST] += 0.0; - f[E] += 3.0 * c2o27 * (forcingX1); - f[W] += 3.0 * c2o27 * (-forcingX1); - f[N] += 3.0 * c2o27 * (forcingX2); - f[S] += 3.0 * c2o27 * (-forcingX2); - f[T] += 3.0 * c2o27 * (forcingX3); - f[B] += 3.0 * c2o27 * (-forcingX3); - f[NE] += 3.0 * c1o54 * (forcingX1 + forcingX2); - f[SW] += 3.0 * c1o54 * (-forcingX1 - forcingX2); - f[SE] += 3.0 * c1o54 * (forcingX1 - forcingX2); - f[NW] += 3.0 * c1o54 * (-forcingX1 + forcingX2); - f[TE] += 3.0 * c1o54 * (forcingX1 + forcingX3); - f[BW] += 3.0 * c1o54 * (-forcingX1 - forcingX3); - f[BE] += 3.0 * c1o54 * (forcingX1 - forcingX3); - f[TW] += 3.0 * c1o54 * (-forcingX1 + forcingX3); - f[TN] += 3.0 * c1o54 * (forcingX2 + forcingX3); - f[BS] += 3.0 * c1o54 * (-forcingX2 - forcingX3); - f[BN] += 3.0 * c1o54 * (forcingX2 - forcingX3); - f[TS] += 3.0 * c1o54 * (-forcingX2 + forcingX3); - f[TNE] += 3.0 * c1o216 * (forcingX1 + forcingX2 + forcingX3); - f[BSW] += 3.0 * c1o216 * (-forcingX1 - forcingX2 - forcingX3); - f[BNE] += 3.0 * c1o216 * (forcingX1 + forcingX2 - forcingX3); - f[TSW] += 3.0 * c1o216 * (-forcingX1 - forcingX2 + forcingX3); - f[TSE] += 3.0 * c1o216 * (forcingX1 - forcingX2 + forcingX3); - f[BNW] += 3.0 * c1o216 * (-forcingX1 + forcingX2 - forcingX3); - f[BSE] += 3.0 * c1o216 * (forcingX1 - forcingX2 - forcingX3); - f[TNW] += 3.0 * c1o216 * (-forcingX1 + forcingX2 + forcingX3); + f[DIR_000] += 0.0; + f[DIR_P00] += 3.0 * c2o27 * (forcingX1); + f[DIR_M00] += 3.0 * c2o27 * (-forcingX1); + f[DIR_0P0] += 3.0 * c2o27 * (forcingX2); + f[DIR_0M0] += 3.0 * c2o27 * (-forcingX2); + f[DIR_00P] += 3.0 * c2o27 * (forcingX3); + f[DIR_00M] += 3.0 * c2o27 * (-forcingX3); + f[DIR_PP0] += 3.0 * c1o54 * (forcingX1 + forcingX2); + f[DIR_MM0] += 3.0 * c1o54 * (-forcingX1 - forcingX2); + f[DIR_PM0] += 3.0 * c1o54 * (forcingX1 - forcingX2); + f[DIR_MP0] += 3.0 * c1o54 * (-forcingX1 + forcingX2); + f[DIR_P0P] += 3.0 * c1o54 * (forcingX1 + forcingX3); + f[DIR_M0M] += 3.0 * c1o54 * (-forcingX1 - forcingX3); + f[DIR_P0M] += 3.0 * c1o54 * (forcingX1 - forcingX3); + f[DIR_M0P] += 3.0 * c1o54 * (-forcingX1 + forcingX3); + f[DIR_0PP] += 3.0 * c1o54 * (forcingX2 + forcingX3); + f[DIR_0MM] += 3.0 * c1o54 * (-forcingX2 - forcingX3); + f[DIR_0PM] += 3.0 * c1o54 * (forcingX2 - forcingX3); + f[DIR_0MP] += 3.0 * c1o54 * (-forcingX2 + forcingX3); + f[DIR_PPP] += 3.0 * c1o216 * (forcingX1 + forcingX2 + forcingX3); + f[DIR_MMM] += 3.0 * c1o216 * (-forcingX1 - forcingX2 - forcingX3); + f[DIR_PPM] += 3.0 * c1o216 * (forcingX1 + forcingX2 - forcingX3); + f[DIR_MMP] += 3.0 * c1o216 * (-forcingX1 - forcingX2 + forcingX3); + f[DIR_PMP] += 3.0 * c1o216 * (forcingX1 - forcingX2 + forcingX3); + f[DIR_MPM] += 3.0 * c1o216 * (-forcingX1 + forcingX2 - forcingX3); + f[DIR_PMM] += 3.0 * c1o216 * (forcingX1 - forcingX2 - forcingX3); + f[DIR_MPP] += 3.0 * c1o216 * (-forcingX1 + forcingX2 + forcingX3); } ////////////////////////////////////////////////////////////////////////// #ifdef PROOF_CORRECTNESS - LBMReal rho_post = f[REST] + 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]; + LBMReal rho_post = f[DIR_000] + f[DIR_P00] + f[DIR_M00] + f[DIR_0P0] + f[DIR_0M0] + f[DIR_00P] + f[DIR_00M] + f[DIR_PP0] + f[DIR_MM0] + f[DIR_PM0] + + f[DIR_MP0] + f[DIR_P0P] + f[DIR_M0M] + f[DIR_P0M] + f[DIR_M0P] + f[DIR_0PP] + f[DIR_0MM] + f[DIR_0PM] + f[DIR_0MP] + f[DIR_PPP] + + f[DIR_MMP] + f[DIR_PMP] + f[DIR_MPP] + f[DIR_PPM] + f[DIR_MMM] + f[DIR_PMM] + f[DIR_MPM]; LBMReal dif = drho - rho_post; #ifdef SINGLEPRECISION if (dif > 10.0E-7 || dif < -10.0E-7) @@ -263,35 +263,35 @@ void BGKLBMKernel::calculate(int step) ////////////////////////////////////////////////////////////////////////// // write distribution ////////////////////////////////////////////////////////////////////////// - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::INV_E]; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::INV_N]; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::INV_T]; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::INV_NE]; - (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3) = f[D3Q27System::INV_NW]; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::INV_TE]; - (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3) = f[D3Q27System::INV_TW]; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::INV_TN]; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3) = f[D3Q27System::INV_TS]; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::INV_TNE]; - (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3) = f[D3Q27System::INV_TNW]; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3) = f[D3Q27System::INV_TSE]; - (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3) = f[D3Q27System::INV_TSW]; + (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::INV_P00]; + (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::INV_0P0]; + (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::INV_00P]; + (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::INV_PP0]; + (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3) = f[D3Q27System::INV_MP0]; + (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::INV_P0P]; + (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3) = f[D3Q27System::INV_M0P]; + (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::INV_0PP]; + (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3) = f[D3Q27System::INV_0MP]; + (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::INV_PPP]; + (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3) = f[D3Q27System::INV_MPP]; + (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3) = f[D3Q27System::INV_PMP]; + (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3) = f[D3Q27System::INV_MMP]; - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3) = f[D3Q27System::INV_W]; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3) = f[D3Q27System::INV_S]; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p) = f[D3Q27System::INV_B]; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3) = f[D3Q27System::INV_SW]; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3) = f[D3Q27System::INV_SE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p) = f[D3Q27System::INV_BW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p) = f[D3Q27System::INV_BE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p) = f[D3Q27System::INV_BS]; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p) = f[D3Q27System::INV_BN]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p) = f[D3Q27System::INV_BSW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p) = f[D3Q27System::INV_BSE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p) = f[D3Q27System::INV_BNW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p) = f[D3Q27System::INV_BNE]; + (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3) = f[D3Q27System::INV_M00]; + (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3) = f[D3Q27System::INV_0M0]; + (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p) = f[D3Q27System::INV_00M]; + (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3) = f[D3Q27System::INV_MM0]; + (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3) = f[D3Q27System::INV_PM0]; + (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p) = f[D3Q27System::INV_M0M]; + (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p) = f[D3Q27System::INV_P0M]; + (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p) = f[D3Q27System::INV_0MM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p) = f[D3Q27System::INV_0PM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p) = f[D3Q27System::INV_MMM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p) = f[D3Q27System::INV_PMM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p) = f[D3Q27System::INV_MPM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p) = f[D3Q27System::INV_PPM]; - (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::REST]; + (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::DIR_000]; ////////////////////////////////////////////////////////////////////////// } } diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp index 94635f85810d81563efafb4a560a230ac3bc3056..b1e48abd9ed3c0a2b4bff26090c20512d94eff7f 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleCumulant4thOrderViscosityLBMKernel.cpp @@ -117,7 +117,7 @@ void CompressibleCumulant4thOrderViscosityLBMKernel::calculate(int step) //LBMReal B = (four + twentyeight*omega - fourteen*omega*omega) / (six - twentyone*omega + fiveteen*omega*omega); LBMReal A = (4.0*omega*omega+2.0*omega*OxxPyyPzz*(omega-6.0)+OxxPyyPzz*OxxPyyPzz*(omega*(10.0-3.0*omega)-4.0))/((omega-OxxPyyPzz)*(OxxPyyPzz*(2.0+3.0*omega)-8.0*omega)); - //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::B' ) + //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::DIR_00M' ) LBMReal B = (4.0*omega*OxxPyyPzz*(9.0*omega-16.0)-4.0*omega*omega-2.0*OxxPyyPzz*OxxPyyPzz*(2.0+9.0*omega*(omega-2.0)))/(3.0*(omega-OxxPyyPzz)*(OxxPyyPzz*(2.0+3.0*omega)-8.0*omega)); for (int x3 = minX3; x3 < maxX3; x3++) diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.cpp b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.cpp index 036b35379ec218585a43a67d03f2a03deb79d6e5..a359db9cd61ef3042130f5148abdc4cf1488617a 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetInterpolationProcessor.cpp @@ -66,11 +66,11 @@ void CompressibleOffsetInterpolationProcessor::calcMoments(const LBMReal* const press = drho; //interpolate rho! - kxy = -3.*omega*((((f[TSW]+f[BNE])-(f[TNW]+f[BSE]))+((f[BSW]+f[TNE])-(f[BNW]+f[TSE])))+((f[SW]+f[NE])-(f[NW]+f[SE]))/(one + drho)-(vx1*vx2));// might not be optimal MG 25.2.13 - kyz = -3.*omega*((((f[BSW]+f[TNE])-(f[TSE]+f[BNW]))+((f[BSE]+f[TNW])-(f[TSW]+f[BNE])))+((f[BS]+f[TN])-(f[TS]+f[BN]))/(one + drho)-(vx2*vx3)); - kxz = -3.*omega*((((f[BNW]+f[TSE])-(f[TSW]+f[BNE]))+((f[BSW]+f[TNE])-(f[BSE]+f[TNW])))+((f[BW]+f[TE])-(f[TW]+f[BE]))/(one + drho)-(vx1*vx3)); - kxxMyy = -3./2.*omega*((((f[BW]+f[TE])-(f[BS]+f[TN]))+((f[TW]+f[BE])-(f[TS]+f[BN])))+((f[W]+f[E])-(f[S]+f[N]))/(one + drho)-(vx1*vx1-vx2*vx2)); - kxxMzz = -3./2.*omega*((((f[NW]+f[SE])-(f[BS]+f[TN]))+((f[SW]+f[NE])-(f[TS]+f[BN])))+((f[W]+f[E])-(f[B]+f[T]))/(one + drho)-(vx1*vx1-vx3*vx3)); + kxy = -3.*omega*((((f[DIR_MMP]+f[DIR_PPM])-(f[DIR_MPP]+f[DIR_PMM]))+((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_MPM]+f[DIR_PMP])))+((f[DIR_MM0]+f[DIR_PP0])-(f[DIR_MP0]+f[DIR_PM0]))/(one + drho)-(vx1*vx2));// might not be optimal MG 25.2.13 + kyz = -3.*omega*((((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_PMP]+f[DIR_MPM]))+((f[DIR_PMM]+f[DIR_MPP])-(f[DIR_MMP]+f[DIR_PPM])))+((f[DIR_0MM]+f[DIR_0PP])-(f[DIR_0MP]+f[DIR_0PM]))/(one + drho)-(vx2*vx3)); + kxz = -3.*omega*((((f[DIR_MPM]+f[DIR_PMP])-(f[DIR_MMP]+f[DIR_PPM]))+((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_PMM]+f[DIR_MPP])))+((f[DIR_M0M]+f[DIR_P0P])-(f[DIR_M0P]+f[DIR_P0M]))/(one + drho)-(vx1*vx3)); + kxxMyy = -3./2.*omega*((((f[DIR_M0M]+f[DIR_P0P])-(f[DIR_0MM]+f[DIR_0PP]))+((f[DIR_M0P]+f[DIR_P0M])-(f[DIR_0MP]+f[DIR_0PM])))+((f[DIR_M00]+f[DIR_P00])-(f[DIR_0M0]+f[DIR_0P0]))/(one + drho)-(vx1*vx1-vx2*vx2)); + kxxMzz = -3./2.*omega*((((f[DIR_MP0]+f[DIR_PM0])-(f[DIR_0MM]+f[DIR_0PP]))+((f[DIR_MM0]+f[DIR_PP0])-(f[DIR_0MP]+f[DIR_0PM])))+((f[DIR_M00]+f[DIR_P00])-(f[DIR_00M]+f[DIR_00P]))/(one + drho)-(vx1*vx1-vx3*vx3)); } ////////////////////////////////////////////////////////////////////////// void CompressibleOffsetInterpolationProcessor::calcInterpolatedCoefficiets(const D3Q27ICell& icell, LBMReal omega, LBMReal eps_new) @@ -471,33 +471,33 @@ void CompressibleOffsetInterpolationProcessor::calcInterpolatedNodeCF(LBMReal* f LBMReal feq[ENDF+1]; D3Q27System::calcCompFeq(feq,rho,vx1,vx2,vx3); - f[E] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[E]; - f[W] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[W]; - f[N] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[N]; - f[S] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[S]; - f[T] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[T]; - f[B] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[B]; - f[NE] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[NE]; - f[SW] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[SW]; - f[SE] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[SE]; - f[NW] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[NW]; - f[TE] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[TE]; - f[BW] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[BW]; - f[BE] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[BE]; - f[TW] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[TW]; - f[TN] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[TN]; - f[BS] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[BS]; - f[BN] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[BN]; - f[TS] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[TS]; - f[TNE] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[TNE]; - f[TSW] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[TSW]; - f[TSE] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[TSE]; - f[TNW] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[TNW]; - f[BNE] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[BNE]; - f[BSW] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[BSW]; - f[BSE] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[BSE]; - f[BNW] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[BNW]; - f[REST] = f_ZERO + xs*x_ZERO + ys*y_ZERO + zs*z_ZERO + feq[REST]; + f[DIR_P00] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[DIR_P00]; + f[DIR_M00] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[DIR_M00]; + f[DIR_0P0] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[DIR_0P0]; + f[DIR_0M0] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[DIR_0M0]; + f[DIR_00P] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[DIR_00P]; + f[DIR_00M] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[DIR_00M]; + f[DIR_PP0] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[DIR_PP0]; + f[DIR_MM0] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[DIR_MM0]; + f[DIR_PM0] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[DIR_PM0]; + f[DIR_MP0] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[DIR_MP0]; + f[DIR_P0P] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[DIR_P0P]; + f[DIR_M0M] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[DIR_M0M]; + f[DIR_P0M] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[DIR_P0M]; + f[DIR_M0P] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[DIR_M0P]; + f[DIR_0PP] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[DIR_0PP]; + f[DIR_0MM] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[DIR_0MM]; + f[DIR_0PM] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[DIR_0PM]; + f[DIR_0MP] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[DIR_0MP]; + f[DIR_PPP] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[DIR_PPP]; + f[DIR_MMP] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[DIR_MMP]; + f[DIR_PMP] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[DIR_PMP]; + f[DIR_MPP] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[DIR_MPP]; + f[DIR_PPM] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[DIR_PPM]; + f[DIR_MMM] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[DIR_MMM]; + f[DIR_PMM] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[DIR_PMM]; + f[DIR_MPM] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[DIR_MPM]; + f[DIR_000] = f_ZERO + xs*x_ZERO + ys*y_ZERO + zs*z_ZERO + feq[DIR_000]; } ////////////////////////////////////////////////////////////////////////// //Position SWB -0.25, -0.25, -0.25 @@ -665,33 +665,33 @@ void CompressibleOffsetInterpolationProcessor::calcInterpolatedNodeFC(LBMReal* f f_TSE = eps_new*((ay - az + bx + bz - cx + cy+kxyAverage-kxzAverage+kyzAverage)/(72.*o)); f_TNW = eps_new*((ay + az + bx - bz + cx - cy+kxyAverage+kxzAverage-kyzAverage)/(72.*o)); - f[E] = f_E + feq[E]; - 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]; + f[DIR_P00] = f_E + feq[DIR_P00]; + f[DIR_M00] = f_E + feq[DIR_M00]; + f[DIR_0P0] = f_N + feq[DIR_0P0]; + f[DIR_0M0] = f_N + feq[DIR_0M0]; + f[DIR_00P] = f_T + feq[DIR_00P]; + f[DIR_00M] = f_T + feq[DIR_00M]; + f[DIR_PP0] = f_NE + feq[DIR_PP0]; + f[DIR_MM0] = f_NE + feq[DIR_MM0]; + f[DIR_PM0] = f_SE + feq[DIR_PM0]; + f[DIR_MP0] = f_SE + feq[DIR_MP0]; + f[DIR_P0P] = f_TE + feq[DIR_P0P]; + f[DIR_M0M] = f_TE + feq[DIR_M0M]; + f[DIR_P0M] = f_BE + feq[DIR_P0M]; + f[DIR_M0P] = f_BE + feq[DIR_M0P]; + f[DIR_0PP] = f_TN + feq[DIR_0PP]; + f[DIR_0MM] = f_TN + feq[DIR_0MM]; + f[DIR_0PM] = f_BN + feq[DIR_0PM]; + f[DIR_0MP] = f_BN + feq[DIR_0MP]; + f[DIR_PPP] = f_TNE + feq[DIR_PPP]; + f[DIR_MPP] = f_TNW + feq[DIR_MPP]; + f[DIR_PMP] = f_TSE + feq[DIR_PMP]; + f[DIR_MMP] = f_TSW + feq[DIR_MMP]; + f[DIR_PPM] = f_TSW + feq[DIR_PPM]; + f[DIR_MPM] = f_TSE + feq[DIR_MPM]; + f[DIR_PMM] = f_TNW + feq[DIR_PMM]; + f[DIR_MMM] = f_TNE + feq[DIR_MMM]; + f[DIR_000] = f_ZERO + feq[DIR_000]; } ////////////////////////////////////////////////////////////////////////// void CompressibleOffsetInterpolationProcessor::calcInterpolatedVelocity(LBMReal x, LBMReal y, LBMReal z, LBMReal& vx1, LBMReal& vx2, LBMReal& vx3) diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.cpp b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.cpp index 4dec637580458cfa77d151b810df04a853116de8..3df8aa6bb0a2cc1c7f24b2143d5e8e467ec160c6 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetMomentsInterpolationProcessor.cpp @@ -95,11 +95,11 @@ void CompressibleOffsetMomentsInterpolationProcessor::calcMoments(const LBMReal* press = drho; //interpolate rho! - kxy = -3.*omega*((((f[TSW]+f[BNE])-(f[TNW]+f[BSE]))+((f[BSW]+f[TNE])-(f[BNW]+f[TSE])))+((f[SW]+f[NE])-(f[NW]+f[SE]))/(one + drho)-(vx1*vx2));// might not be optimal MG 25.2.13 - kyz = -3.*omega*((((f[BSW]+f[TNE])-(f[TSE]+f[BNW]))+((f[BSE]+f[TNW])-(f[TSW]+f[BNE])))+((f[BS]+f[TN])-(f[TS]+f[BN]))/(one + drho)-(vx2*vx3)); - kxz = -3.*omega*((((f[BNW]+f[TSE])-(f[TSW]+f[BNE]))+((f[BSW]+f[TNE])-(f[BSE]+f[TNW])))+((f[BW]+f[TE])-(f[TW]+f[BE]))/(one + drho)-(vx1*vx3)); - kxxMyy = -3./2.*omega*((((f[BW]+f[TE])-(f[BS]+f[TN]))+((f[TW]+f[BE])-(f[TS]+f[BN])))+((f[W]+f[E])-(f[S]+f[N]))/(one + drho)-(vx1*vx1-vx2*vx2)); - kxxMzz = -3./2.*omega*((((f[NW]+f[SE])-(f[BS]+f[TN]))+((f[SW]+f[NE])-(f[TS]+f[BN])))+((f[W]+f[E])-(f[B]+f[T]))/(one + drho)-(vx1*vx1-vx3*vx3)); + kxy = -3.*omega*((((f[DIR_MMP]+f[DIR_PPM])-(f[DIR_MPP]+f[DIR_PMM]))+((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_MPM]+f[DIR_PMP])))+((f[DIR_MM0]+f[DIR_PP0])-(f[DIR_MP0]+f[DIR_PM0]))/(one + drho)-(vx1*vx2));// might not be optimal MG 25.2.13 + kyz = -3.*omega*((((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_PMP]+f[DIR_MPM]))+((f[DIR_PMM]+f[DIR_MPP])-(f[DIR_MMP]+f[DIR_PPM])))+((f[DIR_0MM]+f[DIR_0PP])-(f[DIR_0MP]+f[DIR_0PM]))/(one + drho)-(vx2*vx3)); + kxz = -3.*omega*((((f[DIR_MPM]+f[DIR_PMP])-(f[DIR_MMP]+f[DIR_PPM]))+((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_PMM]+f[DIR_MPP])))+((f[DIR_M0M]+f[DIR_P0P])-(f[DIR_M0P]+f[DIR_P0M]))/(one + drho)-(vx1*vx3)); + kxxMyy = -3./2.*omega*((((f[DIR_M0M]+f[DIR_P0P])-(f[DIR_0MM]+f[DIR_0PP]))+((f[DIR_M0P]+f[DIR_P0M])-(f[DIR_0MP]+f[DIR_0PM])))+((f[DIR_M00]+f[DIR_P00])-(f[DIR_0M0]+f[DIR_0P0]))/(one + drho)-(vx1*vx1-vx2*vx2)); + kxxMzz = -3./2.*omega*((((f[DIR_MP0]+f[DIR_PM0])-(f[DIR_0MM]+f[DIR_0PP]))+((f[DIR_MM0]+f[DIR_PP0])-(f[DIR_0MP]+f[DIR_0PM])))+((f[DIR_M00]+f[DIR_P00])-(f[DIR_00M]+f[DIR_00P]))/(one + drho)-(vx1*vx1-vx3*vx3)); } ////////////////////////////////////////////////////////////////////////// void CompressibleOffsetMomentsInterpolationProcessor::calcInterpolatedCoefficiets(const D3Q27ICell& icell, LBMReal omega, LBMReal eps_new) @@ -785,33 +785,33 @@ void CompressibleOffsetMomentsInterpolationProcessor::calcInterpolatedNodeCF(LBM mfccc = m2; //////////////////////////////////////////////////////////////////////////////////// - f[E] = mfcbb; - f[W] = mfabb; - f[N] = mfbcb; - f[S] = mfbab; - f[T] = mfbbc; - f[B] = mfbba; - f[NE] = mfccb; - f[SW] = mfaab; - f[SE] = mfcab; - f[NW] = mfacb; - f[TE] = mfcbc; - f[BW] = mfaba; - f[BE] = mfcba; - f[TW] = mfabc; - f[TN] = mfbcc; - f[BS] = mfbaa; - f[BN] = mfbca; - f[TS] = mfbac; - f[REST] = mfbbb; - f[TNE] = mfccc; - f[TSE] = mfcac; - f[BNE] = mfcca; - f[BSE] = mfcaa; - f[TNW] = mfacc; - f[TSW] = mfaac; - f[BNW] = mfaca; - f[BSW] = mfaaa; + f[DIR_P00] = mfcbb; + f[DIR_M00] = mfabb; + f[DIR_0P0] = mfbcb; + f[DIR_0M0] = mfbab; + f[DIR_00P] = mfbbc; + f[DIR_00M] = mfbba; + f[DIR_PP0] = mfccb; + f[DIR_MM0] = mfaab; + f[DIR_PM0] = mfcab; + f[DIR_MP0] = mfacb; + f[DIR_P0P] = mfcbc; + f[DIR_M0M] = mfaba; + f[DIR_P0M] = mfcba; + f[DIR_M0P] = mfabc; + f[DIR_0PP] = mfbcc; + f[DIR_0MM] = mfbaa; + f[DIR_0PM] = mfbca; + f[DIR_0MP] = mfbac; + f[DIR_000] = mfbbb; + f[DIR_PPP] = mfccc; + f[DIR_PMP] = mfcac; + f[DIR_PPM] = mfcca; + f[DIR_PMM] = mfcaa; + f[DIR_MPP] = mfacc; + f[DIR_MMP] = mfaac; + f[DIR_MPM] = mfaca; + f[DIR_MMM] = mfaaa; } ////////////////////////////////////////////////////////////////////////// //Position SWB -0.25, -0.25, -0.25 @@ -1233,33 +1233,33 @@ void CompressibleOffsetMomentsInterpolationProcessor::calcInterpolatedNodeFC(LBM mfccc = m2; //////////////////////////////////////////////////////////////////////////////////// - f[E] = mfcbb; - f[W] = mfabb; - f[N] = mfbcb; - f[S] = mfbab; - f[T] = mfbbc; - f[B] = mfbba; - f[NE] = mfccb; - f[SW] = mfaab; - f[SE] = mfcab; - f[NW] = mfacb; - f[TE] = mfcbc; - f[BW] = mfaba; - f[BE] = mfcba; - f[TW] = mfabc; - f[TN] = mfbcc; - f[BS] = mfbaa; - f[BN] = mfbca; - f[TS] = mfbac; - f[REST] = mfbbb; - f[TNE] = mfccc; - f[TSE] = mfcac; - f[BNE] = mfcca; - f[BSE] = mfcaa; - f[TNW] = mfacc; - f[TSW] = mfaac; - f[BNW] = mfaca; - f[BSW] = mfaaa; + f[DIR_P00] = mfcbb; + f[DIR_M00] = mfabb; + f[DIR_0P0] = mfbcb; + f[DIR_0M0] = mfbab; + f[DIR_00P] = mfbbc; + f[DIR_00M] = mfbba; + f[DIR_PP0] = mfccb; + f[DIR_MM0] = mfaab; + f[DIR_PM0] = mfcab; + f[DIR_MP0] = mfacb; + f[DIR_P0P] = mfcbc; + f[DIR_M0M] = mfaba; + f[DIR_P0M] = mfcba; + f[DIR_M0P] = mfabc; + f[DIR_0PP] = mfbcc; + f[DIR_0MM] = mfbaa; + f[DIR_0PM] = mfbca; + f[DIR_0MP] = mfbac; + f[DIR_000] = mfbbb; + f[DIR_PPP] = mfccc; + f[DIR_PMP] = mfcac; + f[DIR_PPM] = mfcca; + f[DIR_PMM] = mfcaa; + f[DIR_MPP] = mfacc; + f[DIR_MMP] = mfaac; + f[DIR_MPM] = mfaca; + f[DIR_MMM] = mfaaa; } ////////////////////////////////////////////////////////////////////////// void CompressibleOffsetMomentsInterpolationProcessor::calcInterpolatedVelocity(LBMReal x, LBMReal y, LBMReal z, LBMReal& vx1, LBMReal& vx2, LBMReal& vx3) diff --git a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetSquarePressureInterpolationProcessor.cpp b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetSquarePressureInterpolationProcessor.cpp index 7a19f156e4447acd9d4451ce4c1a1de7bf5c990d..c9cc8138dcf1d4ce11ee4e2aa7b733f2174f367d 100644 --- a/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetSquarePressureInterpolationProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/CompressibleOffsetSquarePressureInterpolationProcessor.cpp @@ -85,11 +85,11 @@ void CompressibleOffsetSquarePressureInterpolationProcessor::calcMoments(const L press = drho; //interpolate rho! - kxy = -3.*omega*((((f[TSW]+f[BNE])-(f[TNW]+f[BSE]))+((f[BSW]+f[TNE])-(f[BNW]+f[TSE])))+((f[SW]+f[NE])-(f[NW]+f[SE]))/(one + drho)-(vx1*vx2));// might not be optimal MG 25.2.13 - kyz = -3.*omega*((((f[BSW]+f[TNE])-(f[TSE]+f[BNW]))+((f[BSE]+f[TNW])-(f[TSW]+f[BNE])))+((f[BS]+f[TN])-(f[TS]+f[BN]))/(one + drho)-(vx2*vx3)); - kxz = -3.*omega*((((f[BNW]+f[TSE])-(f[TSW]+f[BNE]))+((f[BSW]+f[TNE])-(f[BSE]+f[TNW])))+((f[BW]+f[TE])-(f[TW]+f[BE]))/(one + drho)-(vx1*vx3)); - kxxMyy = -3./2.*omega*((((f[BW]+f[TE])-(f[BS]+f[TN]))+((f[TW]+f[BE])-(f[TS]+f[BN])))+((f[W]+f[E])-(f[S]+f[N]))/(one + drho)-(vx1*vx1-vx2*vx2)); - kxxMzz = -3./2.*omega*((((f[NW]+f[SE])-(f[BS]+f[TN]))+((f[SW]+f[NE])-(f[TS]+f[BN])))+((f[W]+f[E])-(f[B]+f[T]))/(one + drho)-(vx1*vx1-vx3*vx3)); + kxy = -3.*omega*((((f[DIR_MMP]+f[DIR_PPM])-(f[DIR_MPP]+f[DIR_PMM]))+((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_MPM]+f[DIR_PMP])))+((f[DIR_MM0]+f[DIR_PP0])-(f[DIR_MP0]+f[DIR_PM0]))/(one + drho)-(vx1*vx2));// might not be optimal MG 25.2.13 + kyz = -3.*omega*((((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_PMP]+f[DIR_MPM]))+((f[DIR_PMM]+f[DIR_MPP])-(f[DIR_MMP]+f[DIR_PPM])))+((f[DIR_0MM]+f[DIR_0PP])-(f[DIR_0MP]+f[DIR_0PM]))/(one + drho)-(vx2*vx3)); + kxz = -3.*omega*((((f[DIR_MPM]+f[DIR_PMP])-(f[DIR_MMP]+f[DIR_PPM]))+((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_PMM]+f[DIR_MPP])))+((f[DIR_M0M]+f[DIR_P0P])-(f[DIR_M0P]+f[DIR_P0M]))/(one + drho)-(vx1*vx3)); + kxxMyy = -3./2.*omega*((((f[DIR_M0M]+f[DIR_P0P])-(f[DIR_0MM]+f[DIR_0PP]))+((f[DIR_M0P]+f[DIR_P0M])-(f[DIR_0MP]+f[DIR_0PM])))+((f[DIR_M00]+f[DIR_P00])-(f[DIR_0M0]+f[DIR_0P0]))/(one + drho)-(vx1*vx1-vx2*vx2)); + kxxMzz = -3./2.*omega*((((f[DIR_MP0]+f[DIR_PM0])-(f[DIR_0MM]+f[DIR_0PP]))+((f[DIR_MM0]+f[DIR_PP0])-(f[DIR_0MP]+f[DIR_0PM])))+((f[DIR_M00]+f[DIR_P00])-(f[DIR_00M]+f[DIR_00P]))/(one + drho)-(vx1*vx1-vx3*vx3)); } ////////////////////////////////////////////////////////////////////////// void CompressibleOffsetSquarePressureInterpolationProcessor::calcInterpolatedCoefficiets(const D3Q27ICell& icell, LBMReal omega, LBMReal eps_new) @@ -780,33 +780,33 @@ void CompressibleOffsetSquarePressureInterpolationProcessor::calcInterpolatedNod mfccc = m2; //////////////////////////////////////////////////////////////////////////////////// - f[E] = mfcbb; - f[W] = mfabb; - f[N] = mfbcb; - f[S] = mfbab; - f[T] = mfbbc; - f[B] = mfbba; - f[NE] = mfccb; - f[SW] = mfaab; - f[SE] = mfcab; - f[NW] = mfacb; - f[TE] = mfcbc; - f[BW] = mfaba; - f[BE] = mfcba; - f[TW] = mfabc; - f[TN] = mfbcc; - f[BS] = mfbaa; - f[BN] = mfbca; - f[TS] = mfbac; - f[REST] = mfbbb; - f[TNE] = mfccc; - f[TSE] = mfcac; - f[BNE] = mfcca; - f[BSE] = mfcaa; - f[TNW] = mfacc; - f[TSW] = mfaac; - f[BNW] = mfaca; - f[BSW] = mfaaa; + f[DIR_P00] = mfcbb; + f[DIR_M00] = mfabb; + f[DIR_0P0] = mfbcb; + f[DIR_0M0] = mfbab; + f[DIR_00P] = mfbbc; + f[DIR_00M] = mfbba; + f[DIR_PP0] = mfccb; + f[DIR_MM0] = mfaab; + f[DIR_PM0] = mfcab; + f[DIR_MP0] = mfacb; + f[DIR_P0P] = mfcbc; + f[DIR_M0M] = mfaba; + f[DIR_P0M] = mfcba; + f[DIR_M0P] = mfabc; + f[DIR_0PP] = mfbcc; + f[DIR_0MM] = mfbaa; + f[DIR_0PM] = mfbca; + f[DIR_0MP] = mfbac; + f[DIR_000] = mfbbb; + f[DIR_PPP] = mfccc; + f[DIR_PMP] = mfcac; + f[DIR_PPM] = mfcca; + f[DIR_PMM] = mfcaa; + f[DIR_MPP] = mfacc; + f[DIR_MMP] = mfaac; + f[DIR_MPM] = mfaca; + f[DIR_MMM] = mfaaa; } ////////////////////////////////////////////////////////////////////////// //Position SWB -0.25, -0.25, -0.25 @@ -1233,33 +1233,33 @@ void CompressibleOffsetSquarePressureInterpolationProcessor::calcInterpolatedNod mfccc = m2; //////////////////////////////////////////////////////////////////////////////////// - f[E] = mfcbb; - f[W] = mfabb; - f[N] = mfbcb; - f[S] = mfbab; - f[T] = mfbbc; - f[B] = mfbba; - f[NE] = mfccb; - f[SW] = mfaab; - f[SE] = mfcab; - f[NW] = mfacb; - f[TE] = mfcbc; - f[BW] = mfaba; - f[BE] = mfcba; - f[TW] = mfabc; - f[TN] = mfbcc; - f[BS] = mfbaa; - f[BN] = mfbca; - f[TS] = mfbac; - f[REST] = mfbbb; - f[TNE] = mfccc; - f[TSE] = mfcac; - f[BNE] = mfcca; - f[BSE] = mfcaa; - f[TNW] = mfacc; - f[TSW] = mfaac; - f[BNW] = mfaca; - f[BSW] = mfaaa; + f[DIR_P00] = mfcbb; + f[DIR_M00] = mfabb; + f[DIR_0P0] = mfbcb; + f[DIR_0M0] = mfbab; + f[DIR_00P] = mfbbc; + f[DIR_00M] = mfbba; + f[DIR_PP0] = mfccb; + f[DIR_MM0] = mfaab; + f[DIR_PM0] = mfcab; + f[DIR_MP0] = mfacb; + f[DIR_P0P] = mfcbc; + f[DIR_M0M] = mfaba; + f[DIR_P0M] = mfcba; + f[DIR_M0P] = mfabc; + f[DIR_0PP] = mfbcc; + f[DIR_0MM] = mfbaa; + f[DIR_0PM] = mfbca; + f[DIR_0MP] = mfbac; + f[DIR_000] = mfbbb; + f[DIR_PPP] = mfccc; + f[DIR_PMP] = mfcac; + f[DIR_PPM] = mfcca; + f[DIR_PMM] = mfcaa; + f[DIR_MPP] = mfacc; + f[DIR_MMP] = mfaac; + f[DIR_MPM] = mfaca; + f[DIR_MMM] = mfaaa; } ////////////////////////////////////////////////////////////////////////// void CompressibleOffsetSquarePressureInterpolationProcessor::calcInterpolatedVelocity(LBMReal x, LBMReal y, LBMReal z, LBMReal& vx1, LBMReal& vx2, LBMReal& vx3) diff --git a/src/cpu/VirtualFluidsCore/LBM/D3Q27System.cpp b/src/cpu/VirtualFluidsCore/LBM/D3Q27System.cpp index 105603b35d043799672a58fda83ba503af70b703..7e2fd17c0577ea4606f4b38530985411764b5bdb 100644 --- a/src/cpu/VirtualFluidsCore/LBM/D3Q27System.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/D3Q27System.cpp @@ -6,20 +6,35 @@ namespace D3Q27System { using namespace UbMath; -// index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21 22 23 24 25 26 +// 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 }; - -const double WEIGTH[] = { c2o27, c2o27, c2o27, c2o27, c2o27, c2o27, c1o54, c1o54, c1o54, - c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, - c1o216, c1o216, c1o216, c1o216, c1o216, c1o216, c1o216, c1o216, c8o27 }; - -const int INVDIR[] = { INV_E, INV_W, INV_N, INV_S, INV_T, INV_B, INV_NE, INV_SW, INV_SE, - INV_NW, INV_TE, INV_BW, INV_BE, INV_TW, INV_TN, INV_BS, INV_BN, INV_TS, - INV_TNE, INV_TNW, INV_TSE, INV_TSW, INV_BNE, INV_BNW, INV_BSE, INV_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 }; + +const double WEIGTH[] = { c8o27, + c2o27, c2o27, c2o27, c2o27, c2o27, c2o27, + c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, c1o54, + c1o216, c1o216, c1o216, c1o216, c1o216, c1o216, c1o216, c1o216 }; + +const int INVDIR[] = { DIR_000, INV_P00, INV_M00, INV_0P0, INV_0M0, INV_00P, INV_00M, INV_PP0, INV_MM0, INV_PM0, + INV_MP0, INV_P0P, INV_M0M, INV_P0M, INV_M0P, INV_0PP, INV_0MM, INV_0PM, INV_0MP, + INV_PPP, INV_MPP, INV_PMP, INV_MMP, INV_PPM, INV_MPM, INV_PMM, INV_MMM }; + +// 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/VirtualFluidsCore/LBM/D3Q27System.h b/src/cpu/VirtualFluidsCore/LBM/D3Q27System.h index 04fe8a819b143db8cc935fc893faa514805060a6..773e8b6950806fcdc1ecce51cbc547203528ab29 100644 --- a/src/cpu/VirtualFluidsCore/LBM/D3Q27System.h +++ b/src/cpu/VirtualFluidsCore/LBM/D3Q27System.h @@ -48,14 +48,14 @@ namespace D3Q27System { ////////////////////////////////////////////////////////////////////////// // DIRECTION STUFF -static const int FSTARTDIR = 0; -static const int FENDDIR = 25; // D3Q27 +static const int FSTARTDIR = 1; +static const int FENDDIR = 26; // D3Q27 static const int STARTF = 0; static const int ENDF = 26; // D3Q27 -static const int STARTDIR = 0; -static const int ENDDIR = 26; // all geometric directions +static const int STARTDIR = 1; //0 +static const int ENDDIR = 27;//26 // all geometric directions extern const int DX1[ENDDIR + 1]; extern const int DX2[ENDDIR + 1]; @@ -64,60 +64,123 @@ extern const double WEIGTH[ENDDIR + 1]; extern const double cNorm[3][ENDDIR]; -static const int E = 0; -static const int W = 1; -static const int N = 2; -static const int S = 3; -static const int T = 4; -static const int B = 5; -static const int NE = 6; -static const int SW = 7; -static const int SE = 8; -static const int NW = 9; -static const int TE = 10; -static const int BW = 11; -static const int BE = 12; -static const int TW = 13; -static const int TN = 14; -static const int BS = 15; -static const int BN = 16; -static const int TS = 17; -static const int TNE = 18; -static const int TNW = 19; -static const int TSE = 20; -static const int TSW = 21; -static const int BNE = 22; -static const int BNW = 23; -static const int BSE = 24; -static const int BSW = 25; -static const int REST = 26; +static const int MINLEVEL = 0; +static const int MAXLEVEL = 25; -static const int INV_E = W; -static const int INV_W = E; -static const int INV_N = S; -static const int INV_S = N; -static const int INV_T = B; -static const int INV_B = T; -static const int INV_NE = SW; -static const int INV_SW = NE; -static const int INV_SE = NW; -static const int INV_NW = SE; -static const int INV_TE = BW; -static const int INV_BW = TE; -static const int INV_BE = TW; -static const int INV_TW = BE; -static const int INV_TN = BS; -static const int INV_BS = TN; -static const int INV_BN = TS; -static const int INV_TS = BN; -static const int INV_TNE = BSW; -static const int INV_TNW = BSE; -static const int INV_TSE = BNW; -static const int INV_TSW = BNE; -static const int INV_BNE = TSW; -static const int INV_BNW = TSE; -static const int INV_BSE = TNW; -static const int INV_BSW = TNE; +extern const int EX1[ENDDIR + 1]; +extern const int EX2[ENDDIR + 1]; +extern const int EX3[ENDDIR + 1]; + +//static const int E = 0; +//static const int W = 1; +//static const int N = 2; +//static const int S = 3; +//static const int T = 4; +//static const int B = 5; +//static const int NE = 6; +//static const int SW = 7; +//static const int SE = 8; +//static const int NW = 9; +//static const int TE = 10; +//static const int BW = 11; +//static const int BE = 12; +//static const int TW = 13; +//static const int TN = 14; +//static const int BS = 15; +//static const int BN = 16; +//static const int TS = 17; +//static const int TNE = 18; +//static const int TNW = 19; +//static const int TSE = 20; +//static const int TSW = 21; +//static const int BNE = 22; +//static const int BNW = 23; +//static const int BSE = 24; +//static const int BSW = 25; +//static const int REST = 26; + +//static constexpr int REST = 0; +//static constexpr int E = 1; +//static constexpr int W = 2; +//static constexpr int N = 3; +//static constexpr int S = 4; +//static constexpr int T = 5; +//static constexpr int B = 6; +//static constexpr int NE = 7; +//static constexpr int SW = 8; +//static constexpr int SE = 9; +//static constexpr int NW = 10; +//static constexpr int TE = 11; +//static constexpr int BW = 12; +//static constexpr int BE = 13; +//static constexpr int TW = 14; +//static constexpr int TN = 15; +//static constexpr int BS = 16; +//static constexpr int BN = 17; +//static constexpr int TS = 18; +//static constexpr int TNE = 19; +//static constexpr int TNW = 20; +//static constexpr int TSE = 21; +//static constexpr int TSW = 22; +//static constexpr int BNE = 23; +//static constexpr int BNW = 24; +//static constexpr int BSE = 25; +//static constexpr int BSW = 26; + +static constexpr int DIR_000 = 0; +static constexpr int DIR_P00 = 1; +static constexpr int DIR_M00 = 2; +static constexpr int DIR_0P0 = 3; +static constexpr int DIR_0M0 = 4; +static constexpr int DIR_00P = 5; +static constexpr int DIR_00M = 6; +static constexpr int DIR_PP0 = 7; +static constexpr int DIR_MM0 = 8; +static constexpr int DIR_PM0 = 9; +static constexpr int DIR_MP0 = 10; +static constexpr int DIR_P0P = 11; +static constexpr int DIR_M0M = 12; +static constexpr int DIR_P0M = 13; +static constexpr int DIR_M0P = 14; +static constexpr int DIR_0PP = 15; +static constexpr int DIR_0MM = 16; +static constexpr int DIR_0PM = 17; +static constexpr int DIR_0MP = 18; +static constexpr int DIR_PPP = 19; +static constexpr int DIR_MPP = 20; +static constexpr int DIR_PMP = 21; +static constexpr int DIR_MMP = 22; +static constexpr int DIR_PPM = 23; +static constexpr int DIR_MPM = 24; +static constexpr int DIR_PMM = 25; +static constexpr int DIR_MMM = 26; + +static constexpr int INV_P00 = DIR_M00; +static constexpr int INV_M00 = DIR_P00; +static constexpr int INV_0P0 = DIR_0M0; +static constexpr int INV_0M0 = DIR_0P0; +static constexpr int INV_00P = DIR_00M; +static constexpr int INV_00M = DIR_00P; +static constexpr int INV_PP0 = DIR_MM0; +static constexpr int INV_MM0 = DIR_PP0; +static constexpr int INV_PM0 = DIR_MP0; +static constexpr int INV_MP0 = DIR_PM0; +static constexpr int INV_P0P = DIR_M0M; +static constexpr int INV_M0M = DIR_P0P; +static constexpr int INV_P0M = DIR_M0P; +static constexpr int INV_M0P = DIR_P0M; +static constexpr int INV_0PP = DIR_0MM; +static constexpr int INV_0MM = DIR_0PP; +static constexpr int INV_0PM = DIR_0MP; +static constexpr int INV_0MP = DIR_0PM; +static constexpr int INV_PPP = DIR_MMM; +static constexpr int INV_MPP = DIR_PMM; +static constexpr int INV_PMP = DIR_MPM; +static constexpr int INV_MMP = DIR_PPM; +static constexpr int INV_PPM = DIR_MMP; +static constexpr int INV_MPM = DIR_PMP; +static constexpr int INV_PMM = DIR_MPP; +static constexpr int INV_MMM = DIR_PPP; extern const int INVDIR[ENDDIR + 1]; @@ -148,6 +211,180 @@ static const int ET_BNW = 11; static const int ET_TSW = 12; static const int ET_BNE = 12; +////////////////////////////////////////////////////////////////////////// +inline std::string getDirectionString(int direction) +{ + switch (direction) { + case DIR_P00: + return "E"; + case DIR_M00: + return "W"; + case DIR_0P0: + return "N"; + case DIR_0M0: + return "S"; + case DIR_00P: + return "T"; + case DIR_00M: + return "B"; + case DIR_PP0: + return "NE"; + case DIR_MP0: + return "NW"; + case DIR_PM0: + return "SE"; + case DIR_MM0: + return "SW"; + case DIR_P0P: + return "TE"; + case DIR_M0P: + return "TW"; + case DIR_P0M: + return "BE"; + case DIR_M0M: + return "BW"; + case DIR_0PP: + return "TN"; + case DIR_0MP: + return "TS"; + case DIR_0PM: + return "BN"; + case DIR_0MM: + return "BS"; + case DIR_PPP: + return "TNE"; + case DIR_MPP: + return "TNW"; + case DIR_PMP: + return "TSE"; + case DIR_MMP: + return "TSW"; + case DIR_PPM: + return "BNE"; + case DIR_MPM: + return "BNW"; + case DIR_PMM: + return "BSE"; + case DIR_MMM: + return "BSW"; + default: + return "Cell3DSystem::getDrectionString(...) - unknown dir"; + } +} +////////////////////////////////////////////////////////////////////////// +static inline void setNeighborCoordinatesForDirection(int &x1, int &x2, int &x3, const int &direction) +{ + switch (direction) { + case D3Q27System::DIR_P00: + x1++; + break; + case D3Q27System::DIR_0P0: + x2++; + break; + case D3Q27System::DIR_00P: + x3++; + break; + case D3Q27System::DIR_M00: + x1--; + break; + case D3Q27System::DIR_0M0: + x2--; + break; + case D3Q27System::DIR_00M: + x3--; + break; + case D3Q27System::DIR_PP0: + x1++; + x2++; + break; + case D3Q27System::DIR_MP0: + x1--; + x2++; + break; + case D3Q27System::DIR_MM0: + x1--; + x2--; + break; + case D3Q27System::DIR_PM0: + x1++; + x2--; + break; + case D3Q27System::DIR_P0P: + x1++; + x3++; + break; + case D3Q27System::DIR_M0M: + x1--; + x3--; + break; + case D3Q27System::DIR_P0M: + x1++; + x3--; + break; + case D3Q27System::DIR_M0P: + x1--; + x3++; + break; + case D3Q27System::DIR_0PP: + x2++; + x3++; + break; + case D3Q27System::DIR_0MM: + x2--; + x3--; + break; + case D3Q27System::DIR_0PM: + x2++; + x3--; + break; + case D3Q27System::DIR_0MP: + x2--; + x3++; + break; + case D3Q27System::DIR_PPP: + x1++; + x2++; + x3++; + break; + case D3Q27System::DIR_MPP: + x1--; + x2++; + x3++; + break; + case D3Q27System::DIR_PMP: + x1++; + x2--; + x3++; + break; + case D3Q27System::DIR_MMP: + x1--; + x2--; + x3++; + break; + case D3Q27System::DIR_PPM: + x1++; + x2++; + x3--; + break; + case D3Q27System::DIR_MPM: + x1--; + x2++; + x3--; + break; + case D3Q27System::DIR_PMM: + x1++; + x2--; + x3--; + break; + case D3Q27System::DIR_MMM: + x1--; + x2--; + x3--; + break; + default: + throw UbException(UB_EXARGS, "no direction ..."); + } +} ////////////////////////////////////////////////////////////////////////// // MACROSCOPIC VALUES @@ -166,69 +403,69 @@ LBMReal getIncompVelocityX3(const LBMReal *const &f /*[27]*/); /*=====================================================================*/ static void calcDensity(const LBMReal *const &f /*[27]*/, LBMReal &rho) { - rho = ((f[TNE] + f[BSW]) + (f[TSE] + f[BNW])) + ((f[BSE] + f[TNW]) + (f[TSW] + f[BNE])) + - (((f[NE] + f[SW]) + (f[SE] + f[NW])) + ((f[TE] + f[BW]) + (f[BE] + f[TW])) + - ((f[BN] + f[TS]) + (f[TN] + f[BS]))) + - ((f[E] + f[W]) + (f[N] + f[S]) + (f[T] + f[B])) + f[REST]; + rho = ((f[DIR_PPP] + f[DIR_MMM]) + (f[DIR_PMP] + f[DIR_MPM])) + ((f[DIR_PMM] + f[DIR_MPP]) + (f[DIR_MMP] + f[DIR_PPM])) + + (((f[DIR_PP0] + f[DIR_MM0]) + (f[DIR_PM0] + f[DIR_MP0])) + ((f[DIR_P0P] + f[DIR_M0M]) + (f[DIR_P0M] + f[DIR_M0P])) + + ((f[DIR_0PM] + f[DIR_0MP]) + (f[DIR_0PP] + f[DIR_0MM]))) + + ((f[DIR_P00] + f[DIR_M00]) + (f[DIR_0P0] + f[DIR_0M0]) + (f[DIR_00P] + f[DIR_00M])) + f[DIR_000]; } /*=====================================================================*/ static void calcIncompVelocityX1(const LBMReal *const &f /*[27]*/, LBMReal &vx1) { - vx1 = ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[BSE] - f[TNW]) + (f[BNE] - f[TSW]))) + - (((f[BE] - f[TW]) + (f[TE] - f[BW])) + ((f[SE] - f[NW]) + (f[NE] - f[SW]))) + (f[E] - f[W])); + vx1 = ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_PMM] - f[DIR_MPP]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_P0M] - f[DIR_M0P]) + (f[DIR_P0P] - f[DIR_M0M])) + ((f[DIR_PM0] - f[DIR_MP0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_P00] - f[DIR_M00])); } /*=====================================================================*/ static void calcIncompVelocityX2(const LBMReal *const &f /*[27]*/, LBMReal &vx2) { - vx2 = ((((f[TNE] - f[BSW]) + (f[BNW] - f[TSE])) + ((f[TNW] - f[BSE]) + (f[BNE] - f[TSW]))) + - (((f[BN] - f[TS]) + (f[TN] - f[BS])) + ((f[NW] - f[SE]) + (f[NE] - f[SW]))) + (f[N] - f[S])); + vx2 = ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_MPM] - f[DIR_PMP])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_0PM] - f[DIR_0MP]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_MP0] - f[DIR_PM0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_0P0] - f[DIR_0M0])); } /*=====================================================================*/ static void calcIncompVelocityX3(const LBMReal *const &f /*[27]*/, LBMReal &vx3) { - vx3 = ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[TNW] - f[BSE]) + (f[TSW] - f[BNE]))) + - (((f[TS] - f[BN]) + (f[TN] - f[BS])) + ((f[TW] - f[BE]) + (f[TE] - f[BW]))) + (f[T] - f[B])); + vx3 = ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_MMP] - f[DIR_PPM]))) + + (((f[DIR_0MP] - f[DIR_0PM]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_M0P] - f[DIR_P0M]) + (f[DIR_P0P] - f[DIR_M0M]))) + (f[DIR_00P] - f[DIR_00M])); } /*=====================================================================*/ static LBMReal getCompVelocityX1(const LBMReal *const &f /*[27]*/) { - return ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[BSE] - f[TNW]) + (f[BNE] - f[TSW]))) + - (((f[BE] - f[TW]) + (f[TE] - f[BW])) + ((f[SE] - f[NW]) + (f[NE] - f[SW]))) + (f[E] - f[W])) / + return ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_PMM] - f[DIR_MPP]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_P0M] - f[DIR_M0P]) + (f[DIR_P0P] - f[DIR_M0M])) + ((f[DIR_PM0] - f[DIR_MP0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_P00] - f[DIR_M00])) / getDensity(f); } /*=====================================================================*/ static LBMReal getCompVelocityX2(const LBMReal *const &f /*[27]*/) { - return ((((f[TNE] - f[BSW]) + (f[BNW] - f[TSE])) + ((f[TNW] - f[BSE]) + (f[BNE] - f[TSW]))) + - (((f[BN] - f[TS]) + (f[TN] - f[BS])) + ((f[NW] - f[SE]) + (f[NE] - f[SW]))) + (f[N] - f[S])) / + return ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_MPM] - f[DIR_PMP])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_0PM] - f[DIR_0MP]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_MP0] - f[DIR_PM0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_0P0] - f[DIR_0M0])) / getDensity(f); } /*=====================================================================*/ static LBMReal getCompVelocityX3(const LBMReal *const &f /*[27]*/) { - return ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[TNW] - f[BSE]) + (f[TSW] - f[BNE]))) + - (((f[TS] - f[BN]) + (f[TN] - f[BS])) + ((f[TW] - f[BE]) + (f[TE] - f[BW]))) + (f[T] - f[B])) / + return ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_MMP] - f[DIR_PPM]))) + + (((f[DIR_0MP] - f[DIR_0PM]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_M0P] - f[DIR_P0M]) + (f[DIR_P0P] - f[DIR_M0M]))) + (f[DIR_00P] - f[DIR_00M])) / getDensity(f); } /*=====================================================================*/ static void calcCompVelocityX1(const LBMReal *const &f /*[27]*/, LBMReal &vx1) { - vx1 = ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[BSE] - f[TNW]) + (f[BNE] - f[TSW]))) + - (((f[BE] - f[TW]) + (f[TE] - f[BW])) + ((f[SE] - f[NW]) + (f[NE] - f[SW]))) + (f[E] - f[W])) / + vx1 = ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_PMM] - f[DIR_MPP]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_P0M] - f[DIR_M0P]) + (f[DIR_P0P] - f[DIR_M0M])) + ((f[DIR_PM0] - f[DIR_MP0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_P00] - f[DIR_M00])) / getDensity(f); } /*=====================================================================*/ static void calcCompVelocityX2(const LBMReal *const &f /*[27]*/, LBMReal &vx2) { - vx2 = ((((f[TNE] - f[BSW]) + (f[BNW] - f[TSE])) + ((f[TNW] - f[BSE]) + (f[BNE] - f[TSW]))) + - (((f[BN] - f[TS]) + (f[TN] - f[BS])) + ((f[NW] - f[SE]) + (f[NE] - f[SW]))) + (f[N] - f[S])) / + vx2 = ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_MPM] - f[DIR_PMP])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_PPM] - f[DIR_MMP]))) + + (((f[DIR_0PM] - f[DIR_0MP]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_MP0] - f[DIR_PM0]) + (f[DIR_PP0] - f[DIR_MM0]))) + (f[DIR_0P0] - f[DIR_0M0])) / getDensity(f); } /*=====================================================================*/ static void calcCompVelocityX3(const LBMReal *const &f /*[27]*/, LBMReal &vx3) { - vx3 = ((((f[TNE] - f[BSW]) + (f[TSE] - f[BNW])) + ((f[TNW] - f[BSE]) + (f[TSW] - f[BNE]))) + - (((f[TS] - f[BN]) + (f[TN] - f[BS])) + ((f[TW] - f[BE]) + (f[TE] - f[BW]))) + (f[T] - f[B])) / + vx3 = ((((f[DIR_PPP] - f[DIR_MMM]) + (f[DIR_PMP] - f[DIR_MPM])) + ((f[DIR_MPP] - f[DIR_PMM]) + (f[DIR_MMP] - f[DIR_PPM]))) + + (((f[DIR_0MP] - f[DIR_0PM]) + (f[DIR_0PP] - f[DIR_0MM])) + ((f[DIR_M0P] - f[DIR_P0M]) + (f[DIR_P0P] - f[DIR_M0M]))) + (f[DIR_00P] - f[DIR_00M])) / getDensity(f); } /*=====================================================================*/ @@ -261,85 +498,85 @@ static LBMReal getCompFeqForDirection(const int &direction, const LBMReal &drho, LBMReal cu_sq = 1.5 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3); LBMReal rho = drho + UbMath::one; switch (direction) { - case REST: + case DIR_000: return REAL_CAST(UbMath::c8o27 * (drho + rho * (-cu_sq))); - case E: + case DIR_P00: return REAL_CAST(UbMath::c2o27 * (drho + rho * (3.0 * (vx1) + UbMath::c9o2 * (vx1) * (vx1)-cu_sq))); - case W: + case DIR_M00: return REAL_CAST(UbMath::c2o27 * (drho + rho * (3.0 * (-vx1) + UbMath::c9o2 * (-vx1) * (-vx1) - cu_sq))); - case N: + case DIR_0P0: return REAL_CAST(UbMath::c2o27 * (drho + rho * (3.0 * (vx2) + UbMath::c9o2 * (vx2) * (vx2)-cu_sq))); - case S: + case DIR_0M0: return REAL_CAST(UbMath::c2o27 * (drho + rho * (3.0 * (-vx2) + UbMath::c9o2 * (-vx2) * (-vx2) - cu_sq))); - case T: + case DIR_00P: return REAL_CAST(UbMath::c2o27 * (drho + rho * (3.0 * (vx3) + UbMath::c9o2 * (vx3) * (vx3)-cu_sq))); - case B: + case DIR_00M: return REAL_CAST(UbMath::c2o27 * (drho + rho * (3.0 * (-vx3) + UbMath::c9o2 * (-vx3) * (-vx3) - cu_sq))); - case NE: + case DIR_PP0: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (vx1 + vx2) + UbMath::c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq))); - case SW: + case DIR_MM0: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 - vx2) + UbMath::c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq))); - case SE: + case DIR_PM0: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (vx1 - vx2) + UbMath::c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq))); - case NW: + case DIR_MP0: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 + vx2) + UbMath::c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq))); - case TE: + case DIR_P0P: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (vx1 + vx3) + UbMath::c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq))); - case BW: + case DIR_M0M: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 - vx3) + UbMath::c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq))); - case BE: + case DIR_P0M: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (vx1 - vx3) + UbMath::c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq))); - case TW: + case DIR_M0P: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 + vx3) + UbMath::c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq))); - case TN: + case DIR_0PP: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (vx2 + vx3) + UbMath::c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq))); - case BS: + case DIR_0MM: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (-vx2 - vx3) + UbMath::c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq))); - case BN: + case DIR_0PM: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (vx2 - vx3) + UbMath::c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq))); - case TS: + case DIR_0MP: return REAL_CAST(UbMath::c1o54 * (drho + rho * (3.0 * (-vx2 + vx3) + UbMath::c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq))); - case TNE: + case DIR_PPP: return REAL_CAST(UbMath::c1o216 * (drho + rho * (3.0 * (vx1 + vx2 + vx3) + UbMath::c9o2 * (vx1 + vx2 + vx3) * (vx1 + vx2 + vx3) - cu_sq))); - case BSW: + case DIR_MMM: return REAL_CAST(UbMath::c1o216 * (drho + rho * (3.0 * (-vx1 - vx2 - vx3) + UbMath::c9o2 * (-vx1 - vx2 - vx3) * (-vx1 - vx2 - vx3) - cu_sq))); - case BNE: + case DIR_PPM: return REAL_CAST(UbMath::c1o216 * (drho + rho * (3.0 * (vx1 + vx2 - vx3) + UbMath::c9o2 * (vx1 + vx2 - vx3) * (vx1 + vx2 - vx3) - cu_sq))); - case TSW: + case DIR_MMP: return REAL_CAST(UbMath::c1o216 * (drho + rho * (3.0 * (-vx1 - vx2 + vx3) + UbMath::c9o2 * (-vx1 - vx2 + vx3) * (-vx1 - vx2 + vx3) - cu_sq))); - case TSE: + case DIR_PMP: return REAL_CAST(UbMath::c1o216 * (drho + rho * (3.0 * (vx1 - vx2 + vx3) + UbMath::c9o2 * (vx1 - vx2 + vx3) * (vx1 - vx2 + vx3) - cu_sq))); - case BNW: + case DIR_MPM: return REAL_CAST(UbMath::c1o216 * (drho + rho * (3.0 * (-vx1 + vx2 - vx3) + UbMath::c9o2 * (-vx1 + vx2 - vx3) * (-vx1 + vx2 - vx3) - cu_sq))); - case BSE: + case DIR_PMM: return REAL_CAST(UbMath::c1o216 * (drho + rho * (3.0 * (vx1 - vx2 - vx3) + UbMath::c9o2 * (vx1 - vx2 - vx3) * (vx1 - vx2 - vx3) - cu_sq))); - case TNW: + case DIR_MPP: return REAL_CAST(UbMath::c1o216 * (drho + rho * (3.0 * (-vx1 + vx2 + vx3) + UbMath::c9o2 * (-vx1 + vx2 + vx3) * (-vx1 + vx2 + vx3) - cu_sq))); @@ -354,43 +591,43 @@ static void calcCompFeq(LBMReal *const &feq /*[27]*/, const LBMReal &drho, const LBMReal cu_sq = 1.5 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3); LBMReal rho = drho + UbMath::one; - feq[REST] = UbMath::c8o27 * (drho + rho * (-cu_sq)); - feq[E] = UbMath::c2o27 * (drho + rho * (3.0 * (vx1) + UbMath::c9o2 * (vx1) * (vx1)-cu_sq)); - feq[W] = UbMath::c2o27 * (drho + rho * (3.0 * (-vx1) + UbMath::c9o2 * (-vx1) * (-vx1) - cu_sq)); - feq[N] = UbMath::c2o27 * (drho + rho * (3.0 * (vx2) + UbMath::c9o2 * (vx2) * (vx2)-cu_sq)); - feq[S] = UbMath::c2o27 * (drho + rho * (3.0 * (-vx2) + UbMath::c9o2 * (-vx2) * (-vx2) - cu_sq)); - feq[T] = UbMath::c2o27 * (drho + rho * (3.0 * (vx3) + UbMath::c9o2 * (vx3) * (vx3)-cu_sq)); - feq[B] = UbMath::c2o27 * (drho + rho * (3.0 * (-vx3) + UbMath::c9o2 * (-vx3) * (-vx3) - cu_sq)); - feq[NE] = UbMath::c1o54 * (drho + rho * (3.0 * (vx1 + vx2) + UbMath::c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq)); - feq[SW] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 - vx2) + UbMath::c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq)); - feq[SE] = UbMath::c1o54 * (drho + rho * (3.0 * (vx1 - vx2) + UbMath::c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq)); - feq[NW] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 + vx2) + UbMath::c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq)); - feq[TE] = UbMath::c1o54 * (drho + rho * (3.0 * (vx1 + vx3) + UbMath::c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq)); - feq[BW] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 - vx3) + UbMath::c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq)); - feq[BE] = UbMath::c1o54 * (drho + rho * (3.0 * (vx1 - vx3) + UbMath::c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq)); - feq[TW] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 + vx3) + UbMath::c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq)); - feq[TN] = UbMath::c1o54 * (drho + rho * (3.0 * (vx2 + vx3) + UbMath::c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq)); - feq[BS] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx2 - vx3) + UbMath::c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq)); - feq[BN] = UbMath::c1o54 * (drho + rho * (3.0 * (vx2 - vx3) + UbMath::c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq)); - feq[TS] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx2 + vx3) + UbMath::c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq)); - feq[TNE] = UbMath::c1o216 * + feq[DIR_000] = UbMath::c8o27 * (drho + rho * (-cu_sq)); + feq[DIR_P00] = UbMath::c2o27 * (drho + rho * (3.0 * (vx1) + UbMath::c9o2 * (vx1) * (vx1)-cu_sq)); + feq[DIR_M00] = UbMath::c2o27 * (drho + rho * (3.0 * (-vx1) + UbMath::c9o2 * (-vx1) * (-vx1) - cu_sq)); + feq[DIR_0P0] = UbMath::c2o27 * (drho + rho * (3.0 * (vx2) + UbMath::c9o2 * (vx2) * (vx2)-cu_sq)); + feq[DIR_0M0] = UbMath::c2o27 * (drho + rho * (3.0 * (-vx2) + UbMath::c9o2 * (-vx2) * (-vx2) - cu_sq)); + feq[DIR_00P] = UbMath::c2o27 * (drho + rho * (3.0 * (vx3) + UbMath::c9o2 * (vx3) * (vx3)-cu_sq)); + feq[DIR_00M] = UbMath::c2o27 * (drho + rho * (3.0 * (-vx3) + UbMath::c9o2 * (-vx3) * (-vx3) - cu_sq)); + feq[DIR_PP0] = UbMath::c1o54 * (drho + rho * (3.0 * (vx1 + vx2) + UbMath::c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq)); + feq[DIR_MM0] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 - vx2) + UbMath::c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq)); + feq[DIR_PM0] = UbMath::c1o54 * (drho + rho * (3.0 * (vx1 - vx2) + UbMath::c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq)); + feq[DIR_MP0] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 + vx2) + UbMath::c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq)); + feq[DIR_P0P] = UbMath::c1o54 * (drho + rho * (3.0 * (vx1 + vx3) + UbMath::c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq)); + feq[DIR_M0M] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 - vx3) + UbMath::c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq)); + feq[DIR_P0M] = UbMath::c1o54 * (drho + rho * (3.0 * (vx1 - vx3) + UbMath::c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq)); + feq[DIR_M0P] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx1 + vx3) + UbMath::c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq)); + feq[DIR_0PP] = UbMath::c1o54 * (drho + rho * (3.0 * (vx2 + vx3) + UbMath::c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq)); + feq[DIR_0MM] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx2 - vx3) + UbMath::c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq)); + feq[DIR_0PM] = UbMath::c1o54 * (drho + rho * (3.0 * (vx2 - vx3) + UbMath::c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq)); + feq[DIR_0MP] = UbMath::c1o54 * (drho + rho * (3.0 * (-vx2 + vx3) + UbMath::c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq)); + feq[DIR_PPP] = UbMath::c1o216 * (drho + rho * (3.0 * (vx1 + vx2 + vx3) + UbMath::c9o2 * (vx1 + vx2 + vx3) * (vx1 + vx2 + vx3) - cu_sq)); - feq[BSW] = + feq[DIR_MMM] = UbMath::c1o216 * (drho + rho * (3.0 * (-vx1 - vx2 - vx3) + UbMath::c9o2 * (-vx1 - vx2 - vx3) * (-vx1 - vx2 - vx3) - cu_sq)); - feq[BNE] = UbMath::c1o216 * + feq[DIR_PPM] = UbMath::c1o216 * (drho + rho * (3.0 * (vx1 + vx2 - vx3) + UbMath::c9o2 * (vx1 + vx2 - vx3) * (vx1 + vx2 - vx3) - cu_sq)); - feq[TSW] = + feq[DIR_MMP] = UbMath::c1o216 * (drho + rho * (3.0 * (-vx1 - vx2 + vx3) + UbMath::c9o2 * (-vx1 - vx2 + vx3) * (-vx1 - vx2 + vx3) - cu_sq)); - feq[TSE] = UbMath::c1o216 * + feq[DIR_PMP] = UbMath::c1o216 * (drho + rho * (3.0 * (vx1 - vx2 + vx3) + UbMath::c9o2 * (vx1 - vx2 + vx3) * (vx1 - vx2 + vx3) - cu_sq)); - feq[BNW] = + feq[DIR_MPM] = UbMath::c1o216 * (drho + rho * (3.0 * (-vx1 + vx2 - vx3) + UbMath::c9o2 * (-vx1 + vx2 - vx3) * (-vx1 + vx2 - vx3) - cu_sq)); - feq[BSE] = UbMath::c1o216 * + feq[DIR_PMM] = UbMath::c1o216 * (drho + rho * (3.0 * (vx1 - vx2 - vx3) + UbMath::c9o2 * (vx1 - vx2 - vx3) * (vx1 - vx2 - vx3) - cu_sq)); - feq[TNW] = + feq[DIR_MPP] = UbMath::c1o216 * (drho + rho * (3.0 * (-vx1 + vx2 + vx3) + UbMath::c9o2 * (-vx1 + vx2 + vx3) * (-vx1 + vx2 + vx3) - cu_sq)); } @@ -401,78 +638,78 @@ static LBMReal getIncompFeqForDirection(const int &direction, const LBMReal &drh LBMReal cu_sq = 1.5f * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3); switch (direction) { - case REST: + case DIR_000: return REAL_CAST(UbMath::c8o27 * (drho - cu_sq)); - case E: + case DIR_P00: return REAL_CAST(UbMath::c2o27 * (drho + 3.0 * (vx1) + UbMath::c9o2 * (vx1) * (vx1)-cu_sq)); - case W: + case DIR_M00: return REAL_CAST(UbMath::c2o27 * (drho + 3.0 * (-vx1) + UbMath::c9o2 * (-vx1) * (-vx1) - cu_sq)); - case N: + case DIR_0P0: return REAL_CAST(UbMath::c2o27 * (drho + 3.0 * (vx2) + UbMath::c9o2 * (vx2) * (vx2)-cu_sq)); - case S: + case DIR_0M0: return REAL_CAST(UbMath::c2o27 * (drho + 3.0 * (-vx2) + UbMath::c9o2 * (-vx2) * (-vx2) - cu_sq)); - case T: + case DIR_00P: return REAL_CAST(UbMath::c2o27 * (drho + 3.0 * (vx3) + UbMath::c9o2 * (vx3) * (vx3)-cu_sq)); - case B: + case DIR_00M: return REAL_CAST(UbMath::c2o27 * (drho + 3.0 * (-vx3) + UbMath::c9o2 * (-vx3) * (-vx3) - cu_sq)); - case NE: + case DIR_PP0: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (vx1 + vx2) + UbMath::c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq)); - case SW: + case DIR_MM0: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (-vx1 - vx2) + UbMath::c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq)); - case SE: + case DIR_PM0: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (vx1 - vx2) + UbMath::c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq)); - case NW: + case DIR_MP0: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (-vx1 + vx2) + UbMath::c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq)); - case TE: + case DIR_P0P: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (vx1 + vx3) + UbMath::c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq)); - case BW: + case DIR_M0M: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (-vx1 - vx3) + UbMath::c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq)); - case BE: + case DIR_P0M: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (vx1 - vx3) + UbMath::c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq)); - case TW: + case DIR_M0P: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (-vx1 + vx3) + UbMath::c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq)); - case TN: + case DIR_0PP: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (vx2 + vx3) + UbMath::c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq)); - case BS: + case DIR_0MM: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (-vx2 - vx3) + UbMath::c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq)); - case BN: + case DIR_0PM: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (vx2 - vx3) + UbMath::c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq)); - case TS: + case DIR_0MP: return REAL_CAST(UbMath::c1o54 * (drho + 3.0 * (-vx2 + vx3) + UbMath::c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq)); - case TNE: + case DIR_PPP: return REAL_CAST(UbMath::c1o216 * (drho + 3.0 * (vx1 + vx2 + vx3) + UbMath::c9o2 * (vx1 + vx2 + vx3) * (vx1 + vx2 + vx3) - cu_sq)); - case BSW: + case DIR_MMM: return REAL_CAST(UbMath::c1o216 * (drho + 3.0 * (-vx1 - vx2 - vx3) + UbMath::c9o2 * (-vx1 - vx2 - vx3) * (-vx1 - vx2 - vx3) - cu_sq)); - case BNE: + case DIR_PPM: return REAL_CAST(UbMath::c1o216 * (drho + 3.0 * (vx1 + vx2 - vx3) + UbMath::c9o2 * (vx1 + vx2 - vx3) * (vx1 + vx2 - vx3) - cu_sq)); - case TSW: + case DIR_MMP: return REAL_CAST(UbMath::c1o216 * (drho + 3.0 * (-vx1 - vx2 + vx3) + UbMath::c9o2 * (-vx1 - vx2 + vx3) * (-vx1 - vx2 + vx3) - cu_sq)); - case TSE: + case DIR_PMP: return REAL_CAST(UbMath::c1o216 * (drho + 3.0 * (vx1 - vx2 + vx3) + UbMath::c9o2 * (vx1 - vx2 + vx3) * (vx1 - vx2 + vx3) - cu_sq)); - case BNW: + case DIR_MPM: return REAL_CAST(UbMath::c1o216 * (drho + 3.0 * (-vx1 + vx2 - vx3) + UbMath::c9o2 * (-vx1 + vx2 - vx3) * (-vx1 + vx2 - vx3) - cu_sq)); - case BSE: + case DIR_PMM: return REAL_CAST(UbMath::c1o216 * (drho + 3.0 * (vx1 - vx2 - vx3) + UbMath::c9o2 * (vx1 - vx2 - vx3) * (vx1 - vx2 - vx3) - cu_sq)); - case TNW: + case DIR_MPP: return REAL_CAST(UbMath::c1o216 * (drho + 3.0 * (-vx1 + vx2 + vx3) + UbMath::c9o2 * (-vx1 + vx2 + vx3) * (-vx1 + vx2 + vx3) - cu_sq)); default: @@ -485,40 +722,40 @@ static void calcIncompFeq(LBMReal *const &feq /*[27]*/, const LBMReal &drho, con { LBMReal cu_sq = 1.5 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3); - feq[REST] = UbMath::c8o27 * (drho - cu_sq); - feq[E] = UbMath::c2o27 * (drho + 3.0 * (vx1) + UbMath::c9o2 * (vx1) * (vx1)-cu_sq); - feq[W] = UbMath::c2o27 * (drho + 3.0 * (-vx1) + UbMath::c9o2 * (-vx1) * (-vx1) - cu_sq); - feq[N] = UbMath::c2o27 * (drho + 3.0 * (vx2) + UbMath::c9o2 * (vx2) * (vx2)-cu_sq); - feq[S] = UbMath::c2o27 * (drho + 3.0 * (-vx2) + UbMath::c9o2 * (-vx2) * (-vx2) - cu_sq); - feq[T] = UbMath::c2o27 * (drho + 3.0 * (vx3) + UbMath::c9o2 * (vx3) * (vx3)-cu_sq); - feq[B] = UbMath::c2o27 * (drho + 3.0 * (-vx3) + UbMath::c9o2 * (-vx3) * (-vx3) - cu_sq); - feq[NE] = UbMath::c1o54 * (drho + 3.0 * (vx1 + vx2) + UbMath::c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq); - feq[SW] = UbMath::c1o54 * (drho + 3.0 * (-vx1 - vx2) + UbMath::c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq); - feq[SE] = UbMath::c1o54 * (drho + 3.0 * (vx1 - vx2) + UbMath::c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq); - feq[NW] = UbMath::c1o54 * (drho + 3.0 * (-vx1 + vx2) + UbMath::c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq); - feq[TE] = UbMath::c1o54 * (drho + 3.0 * (vx1 + vx3) + UbMath::c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq); - feq[BW] = UbMath::c1o54 * (drho + 3.0 * (-vx1 - vx3) + UbMath::c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq); - feq[BE] = UbMath::c1o54 * (drho + 3.0 * (vx1 - vx3) + UbMath::c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq); - feq[TW] = UbMath::c1o54 * (drho + 3.0 * (-vx1 + vx3) + UbMath::c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq); - feq[TN] = UbMath::c1o54 * (drho + 3.0 * (vx2 + vx3) + UbMath::c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq); - feq[BS] = UbMath::c1o54 * (drho + 3.0 * (-vx2 - vx3) + UbMath::c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq); - feq[BN] = UbMath::c1o54 * (drho + 3.0 * (vx2 - vx3) + UbMath::c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq); - feq[TS] = UbMath::c1o54 * (drho + 3.0 * (-vx2 + vx3) + UbMath::c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq); - feq[TNE] = UbMath::c1o216 * + feq[DIR_000] = UbMath::c8o27 * (drho - cu_sq); + feq[DIR_P00] = UbMath::c2o27 * (drho + 3.0 * (vx1) + UbMath::c9o2 * (vx1) * (vx1)-cu_sq); + feq[DIR_M00] = UbMath::c2o27 * (drho + 3.0 * (-vx1) + UbMath::c9o2 * (-vx1) * (-vx1) - cu_sq); + feq[DIR_0P0] = UbMath::c2o27 * (drho + 3.0 * (vx2) + UbMath::c9o2 * (vx2) * (vx2)-cu_sq); + feq[DIR_0M0] = UbMath::c2o27 * (drho + 3.0 * (-vx2) + UbMath::c9o2 * (-vx2) * (-vx2) - cu_sq); + feq[DIR_00P] = UbMath::c2o27 * (drho + 3.0 * (vx3) + UbMath::c9o2 * (vx3) * (vx3)-cu_sq); + feq[DIR_00M] = UbMath::c2o27 * (drho + 3.0 * (-vx3) + UbMath::c9o2 * (-vx3) * (-vx3) - cu_sq); + feq[DIR_PP0] = UbMath::c1o54 * (drho + 3.0 * (vx1 + vx2) + UbMath::c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq); + feq[DIR_MM0] = UbMath::c1o54 * (drho + 3.0 * (-vx1 - vx2) + UbMath::c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq); + feq[DIR_PM0] = UbMath::c1o54 * (drho + 3.0 * (vx1 - vx2) + UbMath::c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq); + feq[DIR_MP0] = UbMath::c1o54 * (drho + 3.0 * (-vx1 + vx2) + UbMath::c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq); + feq[DIR_P0P] = UbMath::c1o54 * (drho + 3.0 * (vx1 + vx3) + UbMath::c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq); + feq[DIR_M0M] = UbMath::c1o54 * (drho + 3.0 * (-vx1 - vx3) + UbMath::c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq); + feq[DIR_P0M] = UbMath::c1o54 * (drho + 3.0 * (vx1 - vx3) + UbMath::c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq); + feq[DIR_M0P] = UbMath::c1o54 * (drho + 3.0 * (-vx1 + vx3) + UbMath::c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq); + feq[DIR_0PP] = UbMath::c1o54 * (drho + 3.0 * (vx2 + vx3) + UbMath::c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq); + feq[DIR_0MM] = UbMath::c1o54 * (drho + 3.0 * (-vx2 - vx3) + UbMath::c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq); + feq[DIR_0PM] = UbMath::c1o54 * (drho + 3.0 * (vx2 - vx3) + UbMath::c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq); + feq[DIR_0MP] = UbMath::c1o54 * (drho + 3.0 * (-vx2 + vx3) + UbMath::c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq); + feq[DIR_PPP] = UbMath::c1o216 * (drho + 3.0 * (vx1 + vx2 + vx3) + UbMath::c9o2 * (vx1 + vx2 + vx3) * (vx1 + vx2 + vx3) - cu_sq); - feq[BSW] = UbMath::c1o216 * + feq[DIR_MMM] = UbMath::c1o216 * (drho + 3.0 * (-vx1 - vx2 - vx3) + UbMath::c9o2 * (-vx1 - vx2 - vx3) * (-vx1 - vx2 - vx3) - cu_sq); - feq[BNE] = UbMath::c1o216 * + feq[DIR_PPM] = UbMath::c1o216 * (drho + 3.0 * (vx1 + vx2 - vx3) + UbMath::c9o2 * (vx1 + vx2 - vx3) * (vx1 + vx2 - vx3) - cu_sq); - feq[TSW] = UbMath::c1o216 * + feq[DIR_MMP] = UbMath::c1o216 * (drho + 3.0 * (-vx1 - vx2 + vx3) + UbMath::c9o2 * (-vx1 - vx2 + vx3) * (-vx1 - vx2 + vx3) - cu_sq); - feq[TSE] = UbMath::c1o216 * + feq[DIR_PMP] = UbMath::c1o216 * (drho + 3.0 * (vx1 - vx2 + vx3) + UbMath::c9o2 * (vx1 - vx2 + vx3) * (vx1 - vx2 + vx3) - cu_sq); - feq[BNW] = UbMath::c1o216 * + feq[DIR_MPM] = UbMath::c1o216 * (drho + 3.0 * (-vx1 + vx2 - vx3) + UbMath::c9o2 * (-vx1 + vx2 - vx3) * (-vx1 + vx2 - vx3) - cu_sq); - feq[BSE] = UbMath::c1o216 * + feq[DIR_PMM] = UbMath::c1o216 * (drho + 3.0 * (vx1 - vx2 - vx3) + UbMath::c9o2 * (vx1 - vx2 - vx3) * (vx1 - vx2 - vx3) - cu_sq); - feq[TNW] = UbMath::c1o216 * + feq[DIR_MPP] = UbMath::c1o216 * (drho + 3.0 * (-vx1 + vx2 + vx3) + UbMath::c9o2 * (-vx1 + vx2 + vx3) * (-vx1 + vx2 + vx3) - cu_sq); } ////////////////////////////////////////////////////////////////////////// @@ -526,57 +763,57 @@ static inline float getBoundaryVelocityForDirection(const int &direction, const const float &bcVelocityX2, const float &bcVelocityX3) { switch (direction) { - case E: + case DIR_P00: return (float)(UbMath::c4o9 * (+bcVelocityX1)); - case W: + case DIR_M00: return (float)(UbMath::c4o9 * (-bcVelocityX1)); - case N: + case DIR_0P0: return (float)(UbMath::c4o9 * (+bcVelocityX2)); - case S: + case DIR_0M0: return (float)(UbMath::c4o9 * (-bcVelocityX2)); - case T: + case DIR_00P: return (float)(UbMath::c4o9 * (+bcVelocityX3)); - case B: + case DIR_00M: return (float)(UbMath::c4o9 * (-bcVelocityX3)); - case NE: + case DIR_PP0: return (float)(UbMath::c1o9 * (+bcVelocityX1 + bcVelocityX2)); - case SW: + case DIR_MM0: return (float)(UbMath::c1o9 * (-bcVelocityX1 - bcVelocityX2)); - case SE: + case DIR_PM0: return (float)(UbMath::c1o9 * (+bcVelocityX1 - bcVelocityX2)); - case NW: + case DIR_MP0: return (float)(UbMath::c1o9 * (-bcVelocityX1 + bcVelocityX2)); - case TE: + case DIR_P0P: return (float)(UbMath::c1o9 * (+bcVelocityX1 + bcVelocityX3)); - case BW: + case DIR_M0M: return (float)(UbMath::c1o9 * (-bcVelocityX1 - bcVelocityX3)); - case BE: + case DIR_P0M: return (float)(UbMath::c1o9 * (+bcVelocityX1 - bcVelocityX3)); - case TW: + case DIR_M0P: return (float)(UbMath::c1o9 * (-bcVelocityX1 + bcVelocityX3)); - case TN: + case DIR_0PP: return (float)(UbMath::c1o9 * (+bcVelocityX2 + bcVelocityX3)); - case BS: + case DIR_0MM: return (float)(UbMath::c1o9 * (-bcVelocityX2 - bcVelocityX3)); - case BN: + case DIR_0PM: return (float)(UbMath::c1o9 * (+bcVelocityX2 - bcVelocityX3)); - case TS: + case DIR_0MP: return (float)(UbMath::c1o9 * (-bcVelocityX2 + bcVelocityX3)); - case TNE: + case DIR_PPP: return (float)(UbMath::c1o36 * (+bcVelocityX1 + bcVelocityX2 + bcVelocityX3)); - case BSW: + case DIR_MMM: return (float)(UbMath::c1o36 * (-bcVelocityX1 - bcVelocityX2 - bcVelocityX3)); - case BNE: + case DIR_PPM: return (float)(UbMath::c1o36 * (+bcVelocityX1 + bcVelocityX2 - bcVelocityX3)); - case TSW: + case DIR_MMP: return (float)(UbMath::c1o36 * (-bcVelocityX1 - bcVelocityX2 + bcVelocityX3)); - case TSE: + case DIR_PMP: return (float)(UbMath::c1o36 * (+bcVelocityX1 - bcVelocityX2 + bcVelocityX3)); - case BNW: + case DIR_MPM: return (float)(UbMath::c1o36 * (-bcVelocityX1 + bcVelocityX2 - bcVelocityX3)); - case BSE: + case DIR_PMM: return (float)(UbMath::c1o36 * (+bcVelocityX1 - bcVelocityX2 - bcVelocityX3)); - case TNW: + case DIR_MPP: return (float)(UbMath::c1o36 * (-bcVelocityX1 + bcVelocityX2 + bcVelocityX3)); default: throw UbException(UB_EXARGS, "unknown direction"); @@ -633,28 +870,28 @@ static inline void calcDistanceToNeighbors(std::vector<double> &distNeigh, const { // distNeigh.resize(FENDDIR+1, UbMath::sqrt2*deltaX1); - distNeigh[E] = distNeigh[W] = distNeigh[N] = deltaX1; - distNeigh[S] = distNeigh[T] = distNeigh[B] = deltaX1; - distNeigh[NE] = distNeigh[NW] = distNeigh[SW] = distNeigh[SE] = UbMath::sqrt2 * deltaX1; - distNeigh[TE] = distNeigh[TN] = distNeigh[TW] = distNeigh[TS] = UbMath::sqrt2 * deltaX1; - distNeigh[BE] = distNeigh[BN] = distNeigh[BW] = distNeigh[BS] = UbMath::sqrt2 * deltaX1; - distNeigh[TNE] = distNeigh[TNW] = distNeigh[TSE] = distNeigh[TSW] = UbMath::sqrt3 * deltaX1; - distNeigh[BNE] = distNeigh[BNW] = distNeigh[BSE] = distNeigh[BSW] = UbMath::sqrt3 * deltaX1; + distNeigh[DIR_P00] = distNeigh[DIR_M00] = distNeigh[DIR_0P0] = deltaX1; + distNeigh[DIR_0M0] = distNeigh[DIR_00P] = distNeigh[DIR_00M] = deltaX1; + distNeigh[DIR_PP0] = distNeigh[DIR_MP0] = distNeigh[DIR_MM0] = distNeigh[DIR_PM0] = UbMath::sqrt2 * deltaX1; + distNeigh[DIR_P0P] = distNeigh[DIR_0PP] = distNeigh[DIR_M0P] = distNeigh[DIR_0MP] = UbMath::sqrt2 * deltaX1; + distNeigh[DIR_P0M] = distNeigh[DIR_0PM] = distNeigh[DIR_M0M] = distNeigh[DIR_0MM] = UbMath::sqrt2 * deltaX1; + distNeigh[DIR_PPP] = distNeigh[DIR_MPP] = distNeigh[DIR_PMP] = distNeigh[DIR_MMP] = UbMath::sqrt3 * deltaX1; + distNeigh[DIR_PPM] = distNeigh[DIR_MPM] = distNeigh[DIR_PMM] = distNeigh[DIR_MMM] = UbMath::sqrt3 * deltaX1; } ////////////////////////////////////////////////////////////////////////// static inline void calcDistanceToNeighbors(std::vector<double> &distNeigh, const double &deltaX1, const double &deltaX2, const double &deltaX3) { // distNeigh.resize(FENDDIR+1, UbMath::sqrt2*deltaX1); - distNeigh[E] = distNeigh[W] = deltaX1; - distNeigh[N] = distNeigh[S] = deltaX2; - distNeigh[T] = distNeigh[B] = deltaX3; - distNeigh[NE] = distNeigh[NW] = distNeigh[SW] = distNeigh[SE] = sqrt(deltaX1 * deltaX1 + deltaX2 * deltaX2); - distNeigh[TE] = distNeigh[TN] = distNeigh[TW] = distNeigh[TS] = sqrt(deltaX1 * deltaX1 + deltaX3 * deltaX3); - distNeigh[BE] = distNeigh[BN] = distNeigh[BW] = distNeigh[BS] = sqrt(deltaX2 * deltaX2 + deltaX3 * deltaX3); - distNeigh[TNE] = distNeigh[TNW] = distNeigh[TSE] = distNeigh[TSW] = + distNeigh[DIR_P00] = distNeigh[DIR_M00] = deltaX1; + distNeigh[DIR_0P0] = distNeigh[DIR_0M0] = deltaX2; + distNeigh[DIR_00P] = distNeigh[DIR_00M] = deltaX3; + distNeigh[DIR_PP0] = distNeigh[DIR_MP0] = distNeigh[DIR_MM0] = distNeigh[DIR_PM0] = sqrt(deltaX1 * deltaX1 + deltaX2 * deltaX2); + distNeigh[DIR_P0P] = distNeigh[DIR_0PP] = distNeigh[DIR_M0P] = distNeigh[DIR_0MP] = sqrt(deltaX1 * deltaX1 + deltaX3 * deltaX3); + distNeigh[DIR_P0M] = distNeigh[DIR_0PM] = distNeigh[DIR_M0M] = distNeigh[DIR_0MM] = sqrt(deltaX2 * deltaX2 + deltaX3 * deltaX3); + distNeigh[DIR_PPP] = distNeigh[DIR_MPP] = distNeigh[DIR_PMP] = distNeigh[DIR_MMP] = sqrt(deltaX1 * deltaX1 + deltaX2 * deltaX2 + deltaX3 * deltaX3); - distNeigh[BNE] = distNeigh[BNW] = distNeigh[BSE] = distNeigh[BSW] = + distNeigh[DIR_PPM] = distNeigh[DIR_MPM] = distNeigh[DIR_PMM] = distNeigh[DIR_MMM] = sqrt(deltaX1 * deltaX1 + deltaX2 * deltaX2 + deltaX3 * deltaX3); } ////////////////////////////////////////////////////////////////////////// @@ -663,107 +900,107 @@ static inline void initRayVectors(double *const &rayX1, double *const &rayX2, do int fdir; double c1oS2 = UbMath::one_over_sqrt2; double c1oS3 = UbMath::one_over_sqrt3; - fdir = E; + fdir = DIR_P00; rayX1[fdir] = 1.0; rayX2[fdir] = 0.0; rayX3[fdir] = 0.0; - fdir = W; + fdir = DIR_M00; rayX1[fdir] = -1.0; rayX2[fdir] = 0.0; rayX3[fdir] = 0.0; - fdir = N; + fdir = DIR_0P0; rayX1[fdir] = 0.0; rayX2[fdir] = 1.0; rayX3[fdir] = 0.0; - fdir = S; + fdir = DIR_0M0; rayX1[fdir] = 0.0; rayX2[fdir] = -1.0; rayX3[fdir] = 0.0; - fdir = T; + fdir = DIR_00P; rayX1[fdir] = 0.0; rayX2[fdir] = 0.0; rayX3[fdir] = 1.0; - fdir = B; + fdir = DIR_00M; rayX1[fdir] = 0.0; rayX2[fdir] = 0.0; rayX3[fdir] = -1.0; - fdir = NE; + fdir = DIR_PP0; rayX1[fdir] = c1oS2; rayX2[fdir] = c1oS2; rayX3[fdir] = 0.0; - fdir = SW; + fdir = DIR_MM0; rayX1[fdir] = -c1oS2; rayX2[fdir] = -c1oS2; rayX3[fdir] = 0.0; - fdir = SE; + fdir = DIR_PM0; rayX1[fdir] = c1oS2; rayX2[fdir] = -c1oS2; rayX3[fdir] = 0.0; - fdir = NW; + fdir = DIR_MP0; rayX1[fdir] = -c1oS2; rayX2[fdir] = c1oS2; rayX3[fdir] = 0.0; - fdir = TE; + fdir = DIR_P0P; rayX1[fdir] = c1oS2; rayX2[fdir] = 0.0; rayX3[fdir] = c1oS2; - fdir = BW; + fdir = DIR_M0M; rayX1[fdir] = -c1oS2; rayX2[fdir] = 0.0; rayX3[fdir] = -c1oS2; - fdir = BE; + fdir = DIR_P0M; rayX1[fdir] = c1oS2; rayX2[fdir] = 0.0; rayX3[fdir] = -c1oS2; - fdir = TW; + fdir = DIR_M0P; rayX1[fdir] = -c1oS2; rayX2[fdir] = 0.0; rayX3[fdir] = c1oS2; - fdir = TN; + fdir = DIR_0PP; rayX1[fdir] = 0.0; rayX2[fdir] = c1oS2; rayX3[fdir] = c1oS2; - fdir = BS; + fdir = DIR_0MM; rayX1[fdir] = 0.0; rayX2[fdir] = -c1oS2; rayX3[fdir] = -c1oS2; - fdir = BN; + fdir = DIR_0PM; rayX1[fdir] = 0.0; rayX2[fdir] = c1oS2; rayX3[fdir] = -c1oS2; - fdir = TS; + fdir = DIR_0MP; rayX1[fdir] = 0.0; rayX2[fdir] = -c1oS2; rayX3[fdir] = c1oS2; - fdir = TNE; + fdir = DIR_PPP; rayX1[fdir] = c1oS3; rayX2[fdir] = c1oS3; rayX3[fdir] = c1oS3; - fdir = TNW; + fdir = DIR_MPP; rayX1[fdir] = -c1oS3; rayX2[fdir] = c1oS3; rayX3[fdir] = c1oS3; - fdir = TSE; + fdir = DIR_PMP; rayX1[fdir] = c1oS3; rayX2[fdir] = -c1oS3; rayX3[fdir] = c1oS3; - fdir = TSW; + fdir = DIR_MMP; rayX1[fdir] = -c1oS3; rayX2[fdir] = -c1oS3; rayX3[fdir] = c1oS3; - fdir = BNE; + fdir = DIR_PPM; rayX1[fdir] = c1oS3; rayX2[fdir] = c1oS3; rayX3[fdir] = -c1oS3; - fdir = BNW; + fdir = DIR_MPM; rayX1[fdir] = -c1oS3; rayX2[fdir] = c1oS3; rayX3[fdir] = -c1oS3; - fdir = BSE; + fdir = DIR_PMM; rayX1[fdir] = c1oS3; rayX2[fdir] = -c1oS3; rayX3[fdir] = -c1oS3; - fdir = BSW; + fdir = DIR_MMM; rayX1[fdir] = -c1oS3; rayX2[fdir] = -c1oS3; rayX3[fdir] = -c1oS3; @@ -772,9 +1009,9 @@ static inline void initRayVectors(double *const &rayX1, double *const &rayX2, do static inline LBMReal calcPress(const LBMReal *const f, LBMReal rho, LBMReal vx1, LBMReal vx2, LBMReal vx3) { LBMReal op = 1.0; - return ((f[E] + f[W] + f[N] + f[S] + f[T] + f[B] + - 2. * (f[NE] + f[SW] + f[SE] + f[NW] + f[TE] + f[BW] + f[BE] + f[TW] + f[TN] + f[BS] + f[BN] + f[TS]) + - 3. * (f[TNE] + f[TSW] + f[TSE] + f[TNW] + f[BNE] + f[BSW] + f[BSE] + f[BNW]) - + return ((f[DIR_P00] + f[DIR_M00] + f[DIR_0P0] + f[DIR_0M0] + f[DIR_00P] + f[DIR_00M] + + 2. * (f[DIR_PP0] + f[DIR_MM0] + f[DIR_PM0] + f[DIR_MP0] + f[DIR_P0P] + f[DIR_M0M] + f[DIR_P0M] + f[DIR_M0P] + f[DIR_0PP] + f[DIR_0MM] + f[DIR_0PM] + f[DIR_0MP]) + + 3. * (f[DIR_PPP] + f[DIR_MMP] + f[DIR_PMP] + f[DIR_MPP] + f[DIR_PPM] + f[DIR_MMM] + f[DIR_PMM] + f[DIR_MPM]) - (vx1 * vx1 + vx2 * vx2 + vx3 * vx3)) * (1 - 0.5 * op) + op * 0.5 * (rho)) * @@ -783,35 +1020,35 @@ static inline LBMReal calcPress(const LBMReal *const f, LBMReal rho, LBMReal vx1 ////////////////////////////////////////////////////////////////////////// static inline LBMReal getShearRate(const LBMReal *const f, LBMReal collFactorF) { - LBMReal mfcbb = f[E]; - LBMReal mfbcb = f[N]; - LBMReal mfbbc = f[T]; - LBMReal mfccb = f[NE]; - LBMReal mfacb = f[NW]; - LBMReal mfcbc = f[TE]; - LBMReal mfabc = f[TW]; - LBMReal mfbcc = f[TN]; - LBMReal mfbac = f[TS]; - LBMReal mfccc = f[TNE]; - LBMReal mfacc = f[TNW]; - LBMReal mfcac = f[TSE]; - LBMReal mfaac = f[TSW]; + LBMReal mfcbb = f[DIR_P00]; + LBMReal mfbcb = f[DIR_0P0]; + LBMReal mfbbc = f[DIR_00P]; + LBMReal mfccb = f[DIR_PP0]; + LBMReal mfacb = f[DIR_MP0]; + LBMReal mfcbc = f[DIR_P0P]; + LBMReal mfabc = f[DIR_M0P]; + LBMReal mfbcc = f[DIR_0PP]; + LBMReal mfbac = f[DIR_0MP]; + LBMReal mfccc = f[DIR_PPP]; + LBMReal mfacc = f[DIR_MPP]; + LBMReal mfcac = f[DIR_PMP]; + LBMReal mfaac = f[DIR_MMP]; - LBMReal mfabb = f[W]; - LBMReal mfbab = f[S]; - LBMReal mfbba = f[B]; - LBMReal mfaab = f[SW]; - LBMReal mfcab = f[SE]; - LBMReal mfaba = f[BW]; - LBMReal mfcba = f[BE]; - LBMReal mfbaa = f[BS]; - LBMReal mfbca = f[BN]; - LBMReal mfaaa = f[BSW]; - LBMReal mfcaa = f[BSE]; - LBMReal mfaca = f[BNW]; - LBMReal mfcca = f[BNE]; + LBMReal mfabb = f[DIR_M00]; + LBMReal mfbab = f[DIR_0M0]; + LBMReal mfbba = f[DIR_00M]; + LBMReal mfaab = f[DIR_MM0]; + LBMReal mfcab = f[DIR_PM0]; + LBMReal mfaba = f[DIR_M0M]; + LBMReal mfcba = f[DIR_P0M]; + LBMReal mfbaa = f[DIR_0MM]; + LBMReal mfbca = f[DIR_0PM]; + LBMReal mfaaa = f[DIR_MMM]; + LBMReal mfcaa = f[DIR_PMM]; + LBMReal mfaca = f[DIR_MPM]; + LBMReal mfcca = f[DIR_PPM]; - LBMReal mfbbb = f[REST]; + LBMReal mfbbb = f[DIR_000]; LBMReal m0, m1, m2; @@ -1115,40 +1352,40 @@ static void calcMultiphaseFeq(LBMReal *const &feq /*[27]*/, const LBMReal &rho, using namespace UbMath; LBMReal cu_sq = 1.5 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3); - feq[REST] = c8o27 * (p1 + rho * c1o3 * (-cu_sq)); - feq[E] = c2o27 * (p1 + rho * c1o3 * (3.0 * (vx1) + c9o2 * (vx1) * (vx1)-cu_sq)); - feq[W] = c2o27 * (p1 + rho * c1o3 * (3.0 * (-vx1) + c9o2 * (-vx1) * (-vx1) - cu_sq)); - feq[N] = c2o27 * (p1 + rho * c1o3 * (3.0 * (vx2) + c9o2 * (vx2) * (vx2)-cu_sq)); - feq[S] = c2o27 * (p1 + rho * c1o3 * (3.0 * (-vx2) + c9o2 * (-vx2) * (-vx2) - cu_sq)); - feq[T] = c2o27 * (p1 + rho * c1o3 * (3.0 * (vx3) + c9o2 * (vx3) * (vx3)-cu_sq)); - feq[B] = c2o27 * (p1 + rho * c1o3 * (3.0 * (-vx3) + c9o2 * (-vx3) * (-vx3) - cu_sq)); - feq[NE] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx1 + vx2) + c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq)); - feq[SW] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx1 - vx2) + c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq)); - feq[SE] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx1 - vx2) + c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq)); - feq[NW] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx1 + vx2) + c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq)); - feq[TE] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx1 + vx3) + c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq)); - feq[BW] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx1 - vx3) + c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq)); - feq[BE] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx1 - vx3) + c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq)); - feq[TW] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx1 + vx3) + c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq)); - feq[TN] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx2 + vx3) + c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq)); - feq[BS] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx2 - vx3) + c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq)); - feq[BN] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx2 - vx3) + c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq)); - feq[TS] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx2 + vx3) + c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq)); - feq[TNE] = + feq[DIR_000] = c8o27 * (p1 + rho * c1o3 * (-cu_sq)); + feq[DIR_P00] = c2o27 * (p1 + rho * c1o3 * (3.0 * (vx1) + c9o2 * (vx1) * (vx1)-cu_sq)); + feq[DIR_M00] = c2o27 * (p1 + rho * c1o3 * (3.0 * (-vx1) + c9o2 * (-vx1) * (-vx1) - cu_sq)); + feq[DIR_0P0] = c2o27 * (p1 + rho * c1o3 * (3.0 * (vx2) + c9o2 * (vx2) * (vx2)-cu_sq)); + feq[DIR_0M0] = c2o27 * (p1 + rho * c1o3 * (3.0 * (-vx2) + c9o2 * (-vx2) * (-vx2) - cu_sq)); + feq[DIR_00P] = c2o27 * (p1 + rho * c1o3 * (3.0 * (vx3) + c9o2 * (vx3) * (vx3)-cu_sq)); + feq[DIR_00M] = c2o27 * (p1 + rho * c1o3 * (3.0 * (-vx3) + c9o2 * (-vx3) * (-vx3) - cu_sq)); + feq[DIR_PP0] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx1 + vx2) + c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq)); + feq[DIR_MM0] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx1 - vx2) + c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq)); + feq[DIR_PM0] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx1 - vx2) + c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq)); + feq[DIR_MP0] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx1 + vx2) + c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq)); + feq[DIR_P0P] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx1 + vx3) + c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq)); + feq[DIR_M0M] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx1 - vx3) + c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq)); + feq[DIR_P0M] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx1 - vx3) + c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq)); + feq[DIR_M0P] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx1 + vx3) + c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq)); + feq[DIR_0PP] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx2 + vx3) + c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq)); + feq[DIR_0MM] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx2 - vx3) + c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq)); + feq[DIR_0PM] = c1o54 * (p1 + rho * c1o3 * (3.0 * (vx2 - vx3) + c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq)); + feq[DIR_0MP] = c1o54 * (p1 + rho * c1o3 * (3.0 * (-vx2 + vx3) + c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq)); + feq[DIR_PPP] = c1o216 * (p1 + rho * c1o3 * (3.0 * (vx1 + vx2 + vx3) + c9o2 * (vx1 + vx2 + vx3) * (vx1 + vx2 + vx3) - cu_sq)); - feq[BSW] = c1o216 * + feq[DIR_MMM] = c1o216 * (p1 + rho * c1o3 * (3.0 * (-vx1 - vx2 - vx3) + c9o2 * (-vx1 - vx2 - vx3) * (-vx1 - vx2 - vx3) - cu_sq)); - feq[BNE] = + feq[DIR_PPM] = c1o216 * (p1 + rho * c1o3 * (3.0 * (vx1 + vx2 - vx3) + c9o2 * (vx1 + vx2 - vx3) * (vx1 + vx2 - vx3) - cu_sq)); - feq[TSW] = c1o216 * + feq[DIR_MMP] = c1o216 * (p1 + rho * c1o3 * (3.0 * (-vx1 - vx2 + vx3) + c9o2 * (-vx1 - vx2 + vx3) * (-vx1 - vx2 + vx3) - cu_sq)); - feq[TSE] = + feq[DIR_PMP] = c1o216 * (p1 + rho * c1o3 * (3.0 * (vx1 - vx2 + vx3) + c9o2 * (vx1 - vx2 + vx3) * (vx1 - vx2 + vx3) - cu_sq)); - feq[BNW] = c1o216 * + feq[DIR_MPM] = c1o216 * (p1 + rho * c1o3 * (3.0 * (-vx1 + vx2 - vx3) + c9o2 * (-vx1 + vx2 - vx3) * (-vx1 + vx2 - vx3) - cu_sq)); - feq[BSE] = + feq[DIR_PMM] = c1o216 * (p1 + rho * c1o3 * (3.0 * (vx1 - vx2 - vx3) + c9o2 * (vx1 - vx2 - vx3) * (vx1 - vx2 - vx3) - cu_sq)); - feq[TNW] = c1o216 * + feq[DIR_MPP] = c1o216 * (p1 + rho * c1o3 * (3.0 * (-vx1 + vx2 + vx3) + c9o2 * (-vx1 + vx2 + vx3) * (-vx1 + vx2 + vx3) - cu_sq)); } ////////////////////////////////////////////////////////////////////////// @@ -1158,33 +1395,33 @@ static void calcMultiphaseFeqVB(LBMReal *const &feq /*[27]*/, const LBMReal &p1, using namespace UbMath; LBMReal cu_sq = 1.5 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3); - feq[REST] = p1 + c8o27 * (-cu_sq); - feq[E] = c2o27 * ((3.0 * (vx1) + c9o2 * (vx1) * (vx1)-cu_sq)); - feq[W] = c2o27 * ((3.0 * (-vx1) + c9o2 * (-vx1) * (-vx1) - cu_sq)); - feq[N] = c2o27 * ((3.0 * (vx2) + c9o2 * (vx2) * (vx2)-cu_sq)); - feq[S] = c2o27 * ((3.0 * (-vx2) + c9o2 * (-vx2) * (-vx2) - cu_sq)); - feq[T] = c2o27 * ((3.0 * (vx3) + c9o2 * (vx3) * (vx3)-cu_sq)); - feq[B] = c2o27 * ((3.0 * (-vx3) + c9o2 * (-vx3) * (-vx3) - cu_sq)); - feq[NE] = c1o54 * ((3.0 * (vx1 + vx2) + c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq)); - feq[SW] = c1o54 * ((3.0 * (-vx1 - vx2) + c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq)); - feq[SE] = c1o54 * ((3.0 * (vx1 - vx2) + c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq)); - feq[NW] = c1o54 * ((3.0 * (-vx1 + vx2) + c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq)); - feq[TE] = c1o54 * ((3.0 * (vx1 + vx3) + c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq)); - feq[BW] = c1o54 * ((3.0 * (-vx1 - vx3) + c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq)); - feq[BE] = c1o54 * ((3.0 * (vx1 - vx3) + c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq)); - feq[TW] = c1o54 * ((3.0 * (-vx1 + vx3) + c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq)); - feq[TN] = c1o54 * ((3.0 * (vx2 + vx3) + c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq)); - feq[BS] = c1o54 * ((3.0 * (-vx2 - vx3) + c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq)); - feq[BN] = c1o54 * ((3.0 * (vx2 - vx3) + c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq)); - feq[TS] = c1o54 * ((3.0 * (-vx2 + vx3) + c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq)); - feq[TNE] = c1o216 * ((3.0 * (vx1 + vx2 + vx3) + c9o2 * (vx1 + vx2 + vx3) * (vx1 + vx2 + vx3) - cu_sq)); - feq[BSW] = c1o216 * ((3.0 * (-vx1 - vx2 - vx3) + c9o2 * (-vx1 - vx2 - vx3) * (-vx1 - vx2 - vx3) - cu_sq)); - feq[BNE] = c1o216 * ((3.0 * (vx1 + vx2 - vx3) + c9o2 * (vx1 + vx2 - vx3) * (vx1 + vx2 - vx3) - cu_sq)); - feq[TSW] = c1o216 * ((3.0 * (-vx1 - vx2 + vx3) + c9o2 * (-vx1 - vx2 + vx3) * (-vx1 - vx2 + vx3) - cu_sq)); - feq[TSE] = c1o216 * ((3.0 * (vx1 - vx2 + vx3) + c9o2 * (vx1 - vx2 + vx3) * (vx1 - vx2 + vx3) - cu_sq)); - feq[BNW] = c1o216 * ((3.0 * (-vx1 + vx2 - vx3) + c9o2 * (-vx1 + vx2 - vx3) * (-vx1 + vx2 - vx3) - cu_sq)); - feq[BSE] = c1o216 * ((3.0 * (vx1 - vx2 - vx3) + c9o2 * (vx1 - vx2 - vx3) * (vx1 - vx2 - vx3) - cu_sq)); - feq[TNW] = c1o216 * ((3.0 * (-vx1 + vx2 + vx3) + c9o2 * (-vx1 + vx2 + vx3) * (-vx1 + vx2 + vx3) - cu_sq)); + feq[DIR_000] = p1 + c8o27 * (-cu_sq); + feq[DIR_P00] = c2o27 * ((3.0 * (vx1) + c9o2 * (vx1) * (vx1)-cu_sq)); + feq[DIR_M00] = c2o27 * ((3.0 * (-vx1) + c9o2 * (-vx1) * (-vx1) - cu_sq)); + feq[DIR_0P0] = c2o27 * ((3.0 * (vx2) + c9o2 * (vx2) * (vx2)-cu_sq)); + feq[DIR_0M0] = c2o27 * ((3.0 * (-vx2) + c9o2 * (-vx2) * (-vx2) - cu_sq)); + feq[DIR_00P] = c2o27 * ((3.0 * (vx3) + c9o2 * (vx3) * (vx3)-cu_sq)); + feq[DIR_00M] = c2o27 * ((3.0 * (-vx3) + c9o2 * (-vx3) * (-vx3) - cu_sq)); + feq[DIR_PP0] = c1o54 * ((3.0 * (vx1 + vx2) + c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq)); + feq[DIR_MM0] = c1o54 * ((3.0 * (-vx1 - vx2) + c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq)); + feq[DIR_PM0] = c1o54 * ((3.0 * (vx1 - vx2) + c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq)); + feq[DIR_MP0] = c1o54 * ((3.0 * (-vx1 + vx2) + c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq)); + feq[DIR_P0P] = c1o54 * ((3.0 * (vx1 + vx3) + c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq)); + feq[DIR_M0M] = c1o54 * ((3.0 * (-vx1 - vx3) + c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq)); + feq[DIR_P0M] = c1o54 * ((3.0 * (vx1 - vx3) + c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq)); + feq[DIR_M0P] = c1o54 * ((3.0 * (-vx1 + vx3) + c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq)); + feq[DIR_0PP] = c1o54 * ((3.0 * (vx2 + vx3) + c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq)); + feq[DIR_0MM] = c1o54 * ((3.0 * (-vx2 - vx3) + c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq)); + feq[DIR_0PM] = c1o54 * ((3.0 * (vx2 - vx3) + c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq)); + feq[DIR_0MP] = c1o54 * ((3.0 * (-vx2 + vx3) + c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq)); + feq[DIR_PPP] = c1o216 * ((3.0 * (vx1 + vx2 + vx3) + c9o2 * (vx1 + vx2 + vx3) * (vx1 + vx2 + vx3) - cu_sq)); + feq[DIR_MMM] = c1o216 * ((3.0 * (-vx1 - vx2 - vx3) + c9o2 * (-vx1 - vx2 - vx3) * (-vx1 - vx2 - vx3) - cu_sq)); + feq[DIR_PPM] = c1o216 * ((3.0 * (vx1 + vx2 - vx3) + c9o2 * (vx1 + vx2 - vx3) * (vx1 + vx2 - vx3) - cu_sq)); + feq[DIR_MMP] = c1o216 * ((3.0 * (-vx1 - vx2 + vx3) + c9o2 * (-vx1 - vx2 + vx3) * (-vx1 - vx2 + vx3) - cu_sq)); + feq[DIR_PMP] = c1o216 * ((3.0 * (vx1 - vx2 + vx3) + c9o2 * (vx1 - vx2 + vx3) * (vx1 - vx2 + vx3) - cu_sq)); + feq[DIR_MPM] = c1o216 * ((3.0 * (-vx1 + vx2 - vx3) + c9o2 * (-vx1 + vx2 - vx3) * (-vx1 + vx2 - vx3) - cu_sq)); + feq[DIR_PMM] = c1o216 * ((3.0 * (vx1 - vx2 - vx3) + c9o2 * (vx1 - vx2 - vx3) * (vx1 - vx2 - vx3) - cu_sq)); + feq[DIR_MPP] = c1o216 * ((3.0 * (-vx1 + vx2 + vx3) + c9o2 * (-vx1 + vx2 + vx3) * (-vx1 + vx2 + vx3) - cu_sq)); } ////////////////////////////////////////////////////////////////////////// static void calcMultiphaseHeq(LBMReal *const &heq /*[27]*/, const LBMReal &phi, const LBMReal &vx1, const LBMReal &vx2, @@ -1193,35 +1430,34 @@ static void calcMultiphaseHeq(LBMReal *const &heq /*[27]*/, const LBMReal &phi, using namespace UbMath; LBMReal cu_sq = 1.5 * (vx1 * vx1 + vx2 * vx2 + vx3 * vx3); - heq[REST] = c8o27 * phi * (1.0 - cu_sq); - heq[E] = c2o27 * phi * (1.0 + 3.0 * (vx1) + c9o2 * (vx1) * (vx1)-cu_sq); - heq[W] = c2o27 * phi * (1.0 + 3.0 * (-vx1) + c9o2 * (-vx1) * (-vx1) - cu_sq); - heq[N] = c2o27 * phi * (1.0 + 3.0 * (vx2) + c9o2 * (vx2) * (vx2)-cu_sq); - heq[S] = c2o27 * phi * (1.0 + 3.0 * (-vx2) + c9o2 * (-vx2) * (-vx2) - cu_sq); - heq[T] = c2o27 * phi * (1.0 + 3.0 * (vx3) + c9o2 * (vx3) * (vx3)-cu_sq); - heq[B] = c2o27 * phi * (1.0 + 3.0 * (-vx3) + c9o2 * (-vx3) * (-vx3) - cu_sq); - heq[NE] = c1o54 * phi * (1.0 + 3.0 * (vx1 + vx2) + c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq); - heq[SW] = c1o54 * phi * (1.0 + 3.0 * (-vx1 - vx2) + c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq); - heq[SE] = c1o54 * phi * (1.0 + 3.0 * (vx1 - vx2) + c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq); - heq[NW] = c1o54 * phi * (1.0 + 3.0 * (-vx1 + vx2) + c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq); - heq[TE] = c1o54 * phi * (1.0 + 3.0 * (vx1 + vx3) + c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq); - heq[BW] = c1o54 * phi * (1.0 + 3.0 * (-vx1 - vx3) + c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq); - heq[BE] = c1o54 * phi * (1.0 + 3.0 * (vx1 - vx3) + c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq); - heq[TW] = c1o54 * phi * (1.0 + 3.0 * (-vx1 + vx3) + c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq); - heq[TN] = c1o54 * phi * (1.0 + 3.0 * (vx2 + vx3) + c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq); - heq[BS] = c1o54 * phi * (1.0 + 3.0 * (-vx2 - vx3) + c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq); - heq[BN] = c1o54 * phi * (1.0 + 3.0 * (vx2 - vx3) + c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq); - heq[TS] = c1o54 * phi * (1.0 + 3.0 * (-vx2 + vx3) + c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq); - heq[TNE] = c1o216 * phi * (1.0 + 3.0 * (vx1 + vx2 + vx3) + c9o2 * (vx1 + vx2 + vx3) * (vx1 + vx2 + vx3) - cu_sq); - heq[BSW] = c1o216 * phi * (1.0 + 3.0 * (-vx1 - vx2 - vx3) + c9o2 * (-vx1 - vx2 - vx3) * (-vx1 - vx2 - vx3) - cu_sq); - heq[BNE] = c1o216 * phi * (1.0 + 3.0 * (vx1 + vx2 - vx3) + c9o2 * (vx1 + vx2 - vx3) * (vx1 + vx2 - vx3) - cu_sq); - heq[TSW] = c1o216 * phi * (1.0 + 3.0 * (-vx1 - vx2 + vx3) + c9o2 * (-vx1 - vx2 + vx3) * (-vx1 - vx2 + vx3) - cu_sq); - heq[TSE] = c1o216 * phi * (1.0 + 3.0 * (vx1 - vx2 + vx3) + c9o2 * (vx1 - vx2 + vx3) * (vx1 - vx2 + vx3) - cu_sq); - heq[BNW] = c1o216 * phi * (1.0 + 3.0 * (-vx1 + vx2 - vx3) + c9o2 * (-vx1 + vx2 - vx3) * (-vx1 + vx2 - vx3) - cu_sq); - heq[BSE] = c1o216 * phi * (1.0 + 3.0 * (vx1 - vx2 - vx3) + c9o2 * (vx1 - vx2 - vx3) * (vx1 - vx2 - vx3) - cu_sq); - heq[TNW] = c1o216 * phi * (1.0 + 3.0 * (-vx1 + vx2 + vx3) + c9o2 * (-vx1 + vx2 + vx3) * (-vx1 + vx2 + vx3) - cu_sq); + heq[DIR_000] = c8o27 * phi * (1.0 - cu_sq); + heq[DIR_P00] = c2o27 * phi * (1.0 + 3.0 * (vx1) + c9o2 * (vx1) * (vx1)-cu_sq); + heq[DIR_M00] = c2o27 * phi * (1.0 + 3.0 * (-vx1) + c9o2 * (-vx1) * (-vx1) - cu_sq); + heq[DIR_0P0] = c2o27 * phi * (1.0 + 3.0 * (vx2) + c9o2 * (vx2) * (vx2)-cu_sq); + heq[DIR_0M0] = c2o27 * phi * (1.0 + 3.0 * (-vx2) + c9o2 * (-vx2) * (-vx2) - cu_sq); + heq[DIR_00P] = c2o27 * phi * (1.0 + 3.0 * (vx3) + c9o2 * (vx3) * (vx3)-cu_sq); + heq[DIR_00M] = c2o27 * phi * (1.0 + 3.0 * (-vx3) + c9o2 * (-vx3) * (-vx3) - cu_sq); + heq[DIR_PP0] = c1o54 * phi * (1.0 + 3.0 * (vx1 + vx2) + c9o2 * (vx1 + vx2) * (vx1 + vx2) - cu_sq); + heq[DIR_MM0] = c1o54 * phi * (1.0 + 3.0 * (-vx1 - vx2) + c9o2 * (-vx1 - vx2) * (-vx1 - vx2) - cu_sq); + heq[DIR_PM0] = c1o54 * phi * (1.0 + 3.0 * (vx1 - vx2) + c9o2 * (vx1 - vx2) * (vx1 - vx2) - cu_sq); + heq[DIR_MP0] = c1o54 * phi * (1.0 + 3.0 * (-vx1 + vx2) + c9o2 * (-vx1 + vx2) * (-vx1 + vx2) - cu_sq); + heq[DIR_P0P] = c1o54 * phi * (1.0 + 3.0 * (vx1 + vx3) + c9o2 * (vx1 + vx3) * (vx1 + vx3) - cu_sq); + heq[DIR_M0M] = c1o54 * phi * (1.0 + 3.0 * (-vx1 - vx3) + c9o2 * (-vx1 - vx3) * (-vx1 - vx3) - cu_sq); + heq[DIR_P0M] = c1o54 * phi * (1.0 + 3.0 * (vx1 - vx3) + c9o2 * (vx1 - vx3) * (vx1 - vx3) - cu_sq); + heq[DIR_M0P] = c1o54 * phi * (1.0 + 3.0 * (-vx1 + vx3) + c9o2 * (-vx1 + vx3) * (-vx1 + vx3) - cu_sq); + heq[DIR_0PP] = c1o54 * phi * (1.0 + 3.0 * (vx2 + vx3) + c9o2 * (vx2 + vx3) * (vx2 + vx3) - cu_sq); + heq[DIR_0MM] = c1o54 * phi * (1.0 + 3.0 * (-vx2 - vx3) + c9o2 * (-vx2 - vx3) * (-vx2 - vx3) - cu_sq); + heq[DIR_0PM] = c1o54 * phi * (1.0 + 3.0 * (vx2 - vx3) + c9o2 * (vx2 - vx3) * (vx2 - vx3) - cu_sq); + heq[DIR_0MP] = c1o54 * phi * (1.0 + 3.0 * (-vx2 + vx3) + c9o2 * (-vx2 + vx3) * (-vx2 + vx3) - cu_sq); + heq[DIR_PPP] = c1o216 * phi * (1.0 + 3.0 * (vx1 + vx2 + vx3) + c9o2 * (vx1 + vx2 + vx3) * (vx1 + vx2 + vx3) - cu_sq); + heq[DIR_MMM] = c1o216 * phi * (1.0 + 3.0 * (-vx1 - vx2 - vx3) + c9o2 * (-vx1 - vx2 - vx3) * (-vx1 - vx2 - vx3) - cu_sq); + heq[DIR_PPM] = c1o216 * phi * (1.0 + 3.0 * (vx1 + vx2 - vx3) + c9o2 * (vx1 + vx2 - vx3) * (vx1 + vx2 - vx3) - cu_sq); + heq[DIR_MMP] = c1o216 * phi * (1.0 + 3.0 * (-vx1 - vx2 + vx3) + c9o2 * (-vx1 - vx2 + vx3) * (-vx1 - vx2 + vx3) - cu_sq); + heq[DIR_PMP] = c1o216 * phi * (1.0 + 3.0 * (vx1 - vx2 + vx3) + c9o2 * (vx1 - vx2 + vx3) * (vx1 - vx2 + vx3) - cu_sq); + heq[DIR_MPM] = c1o216 * phi * (1.0 + 3.0 * (-vx1 + vx2 - vx3) + c9o2 * (-vx1 + vx2 - vx3) * (-vx1 + vx2 - vx3) - cu_sq); + heq[DIR_PMM] = c1o216 * phi * (1.0 + 3.0 * (vx1 - vx2 - vx3) + c9o2 * (vx1 - vx2 - vx3) * (vx1 - vx2 - vx3) - cu_sq); + heq[DIR_MPP] = c1o216 * phi * (1.0 + 3.0 * (-vx1 + vx2 + vx3) + c9o2 * (-vx1 + vx2 + vx3) * (-vx1 + vx2 + vx3) - cu_sq); } -////////////////////////////////////////////////////////////////////////// } // namespace D3Q27System #endif diff --git a/src/cpu/VirtualFluidsCore/LBM/IncompressibleCumulantWithSpongeLayerLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/IncompressibleCumulantWithSpongeLayerLBMKernel.cpp index 089b505a5f5d357e378c1e556caeffc3e51bc411..90bc1998454e980c86054934222b251699f1412a 100644 --- a/src/cpu/VirtualFluidsCore/LBM/IncompressibleCumulantWithSpongeLayerLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/IncompressibleCumulantWithSpongeLayerLBMKernel.cpp @@ -68,37 +68,37 @@ void IncompressibleCumulantWithSpongeLayerLBMKernel::initRelaxFactor(int vdir, d { switch (direction) { - case D3Q27System::E: + case D3Q27System::DIR_P00: muX1 = (double)(x1 + ix1 * maxX1); if (muX1 >= (sizeX - sizeSP) / deltaT) spongeFactor = (sizeX - (muX1 * deltaT + 1)) / sizeSP / 2.0 + 0.5; else spongeFactor = 1.0; break; - case D3Q27System::W: + case D3Q27System::DIR_M00: muX1 = (double)(x1 + ix1 * maxX1); if (muX1 <= sizeSP / deltaT) spongeFactor = (sizeSP - (muX1 * deltaT + 1)) / sizeSP / 2.0 + 0.5; else spongeFactor = 1.0; break; - case D3Q27System::N: + case D3Q27System::DIR_0P0: muX2 = (double)(x2 + ix2 * maxX2); if (muX2 >= (sizeX - sizeSP) / deltaT) spongeFactor = (sizeX - (muX2 * deltaT + 1)) / sizeSP / 2.0 + 0.5; else spongeFactor = 1.0; break; - case D3Q27System::S: + case D3Q27System::DIR_0M0: muX2 = (double)(x2 + ix2 * maxX2); if (muX2 <= sizeSP / deltaT) spongeFactor = (sizeSP - (muX2 * deltaT + 1)) / sizeSP / 2.0 + 0.5; else spongeFactor = 1.0; break; - case D3Q27System::T: + case D3Q27System::DIR_00P: muX3 = (double)(x3 + ix3 * maxX3); if (muX3 >= (sizeX - sizeSP) / deltaT) spongeFactor = (sizeX - (muX3 * deltaT + 1)) / sizeSP / 2.0 + 0.5; else spongeFactor = 1.0; break; - case D3Q27System::B: + case D3Q27System::DIR_00M: muX3 = (double)(x3 + ix3 * maxX3); if (muX3 <= sizeSP / deltaT) spongeFactor = (sizeSP - (muX3 * deltaT + 1)) / sizeSP / 2.0 + 0.5; diff --git a/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.cpp b/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.cpp index 15e6f1dddb88f31e7bf57e2d3235e04b48da1080..39b83f72a835ade4f903910a502383c6e3cd2323 100644 --- a/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/IncompressibleOffsetInterpolationProcessor.cpp @@ -61,7 +61,7 @@ void IncompressibleOffsetInterpolationProcessor::calcMoments(const LBMReal* cons { using namespace D3Q27System; - //UBLOG(logINFO,"D3Q27System::BW = " << D3Q27System::BW); + //UBLOG(logINFO,"D3Q27System::DIR_M0M = " << D3Q27System::DIR_M0M); //UBLOG(logINFO,"BW = " << BW); LBMReal rho = 0.0; @@ -82,14 +82,14 @@ void IncompressibleOffsetInterpolationProcessor::calcMoments(const LBMReal* cons //press = D3Q27System::calcPress(f,rho,vx1,vx2,vx3); press = rho; //interpolate rho! - kxy = -3.*omega*((((f[TSW]+f[BNE])-(f[TNW]+f[BSE]))+((f[BSW]+f[TNE])-(f[BNW]+f[TSE])))+((f[SW]+f[NE])-(f[NW]+f[SE]))-(vx1*vx2));// might not be optimal MG 25.2.13 - kyz = -3.*omega*((((f[BSW]+f[TNE])-(f[TSE]+f[BNW]))+((f[BSE]+f[TNW])-(f[TSW]+f[BNE])))+((f[BS]+f[TN])-(f[TS]+f[BN]))-(vx2*vx3)); - kxz = -3.*omega*((((f[BNW]+f[TSE])-(f[TSW]+f[BNE]))+((f[BSW]+f[TNE])-(f[BSE]+f[TNW])))+((f[BW]+f[TE])-(f[TW]+f[BE]))-(vx1*vx3)); - kxxMyy = -3./2.*omega*((((f[D3Q27System::BW]+f[TE])-(f[BS]+f[TN]))+((f[TW]+f[BE])-(f[TS]+f[BN])))+((f[W]+f[E])-(f[S]+f[N]))-(vx1*vx1-vx2*vx2)); - kxxMzz = -3./2.*omega*((((f[NW]+f[SE])-(f[BS]+f[TN]))+((f[SW]+f[NE])-(f[TS]+f[BN])))+((f[W]+f[E])-(f[B]+f[T]))-(vx1*vx1-vx3*vx3)); - //kxxMzz = -3./2.*omega*(((((f[NW]+f[SE])-(f[BS]+f[TN]))+((f[SW]+f[NE])-(f[17]+f[BN])))+((f[W]+f[E])-(f[B]+f[T])))-(vx1*vx1-vx3*vx3)); + kxy = -3.*omega*((((f[DIR_MMP]+f[DIR_PPM])-(f[DIR_MPP]+f[DIR_PMM]))+((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_MPM]+f[DIR_PMP])))+((f[DIR_MM0]+f[DIR_PP0])-(f[DIR_MP0]+f[DIR_PM0]))-(vx1*vx2));// might not be optimal MG 25.2.13 + kyz = -3.*omega*((((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_PMP]+f[DIR_MPM]))+((f[DIR_PMM]+f[DIR_MPP])-(f[DIR_MMP]+f[DIR_PPM])))+((f[DIR_0MM]+f[DIR_0PP])-(f[DIR_0MP]+f[DIR_0PM]))-(vx2*vx3)); + kxz = -3.*omega*((((f[DIR_MPM]+f[DIR_PMP])-(f[DIR_MMP]+f[DIR_PPM]))+((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_PMM]+f[DIR_MPP])))+((f[DIR_M0M]+f[DIR_P0P])-(f[DIR_M0P]+f[DIR_P0M]))-(vx1*vx3)); + kxxMyy = -3./2.*omega*((((f[D3Q27System::DIR_M0M]+f[DIR_P0P])-(f[DIR_0MM]+f[DIR_0PP]))+((f[DIR_M0P]+f[DIR_P0M])-(f[DIR_0MP]+f[DIR_0PM])))+((f[DIR_M00]+f[DIR_P00])-(f[DIR_0M0]+f[DIR_0P0]))-(vx1*vx1-vx2*vx2)); + kxxMzz = -3./2.*omega*((((f[DIR_MP0]+f[DIR_PM0])-(f[DIR_0MM]+f[DIR_0PP]))+((f[DIR_MM0]+f[DIR_PP0])-(f[DIR_0MP]+f[DIR_0PM])))+((f[DIR_M00]+f[DIR_P00])-(f[DIR_00M]+f[DIR_00P]))-(vx1*vx1-vx3*vx3)); + //kxxMzz = -3./2.*omega*(((((f[NW]+f[SE])-(f[BS]+f[TN]))+((f[SW]+f[NE])-(f[17]+f[BN])))+((f[W]+f[DIR_P00])-(f[B]+f[T])))-(vx1*vx1-vx3*vx3)); - //UBLOG(logINFO, "t1 = "<<(((f[NW]+f[SE])-(f[BS]+f[TN]))+((f[SW]+f[NE])-(f[17]+f[BN])))+((f[W]+f[E])-(f[B]+f[T]))); + //UBLOG(logINFO, "t1 = "<<(((f[NW]+f[SE])-(f[BS]+f[TN]))+((f[SW]+f[NE])-(f[17]+f[BN])))+((f[W]+f[DIR_P00])-(f[B]+f[T]))); //UBLOG(logINFO, "kxxMzz = "<<kxxMzz); //UBLOG(logINFO,"f[BW] = " << f[BW] << " BW = " << BW); @@ -543,33 +543,33 @@ void IncompressibleOffsetInterpolationProcessor::calcInterpolatedNode(LBMReal* f LBMReal feq[ENDF+1]; D3Q27System::calcIncompFeq(feq,rho,vx1,vx2,vx3); - f[E] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[E]; - f[W] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[W]; - f[N] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[N]; - f[S] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[S]; - f[T] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[T]; - f[B] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[B]; - f[NE] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[NE]; - f[SW] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[SW]; - f[SE] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[SE]; - f[NW] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[NW]; - f[TE] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[TE]; - f[BW] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[BW]; - f[BE] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[BE]; - f[TW] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[TW]; - f[TN] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[TN]; - f[BS] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[BS]; - f[BN] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[BN]; - f[TS] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[TS]; - f[TNE] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[TNE]; - f[TSW] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[TSW]; - f[TSE] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[TSE]; - f[TNW] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[TNW]; - f[BNE] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[BNE]; - f[BSW] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[BSW]; - f[BSE] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[BSE]; - f[BNW] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[BNW]; - f[REST] = f_ZERO + xs*x_ZERO + ys*y_ZERO + zs*z_ZERO + feq[REST]; + f[DIR_P00] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[DIR_P00]; + f[DIR_M00] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[DIR_M00]; + f[DIR_0P0] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[DIR_0P0]; + f[DIR_0M0] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[DIR_0M0]; + f[DIR_00P] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[DIR_00P]; + f[DIR_00M] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[DIR_00M]; + f[DIR_PP0] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[DIR_PP0]; + f[DIR_MM0] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[DIR_MM0]; + f[DIR_PM0] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[DIR_PM0]; + f[DIR_MP0] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[DIR_MP0]; + f[DIR_P0P] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[DIR_P0P]; + f[DIR_M0M] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[DIR_M0M]; + f[DIR_P0M] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[DIR_P0M]; + f[DIR_M0P] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[DIR_M0P]; + f[DIR_0PP] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[DIR_0PP]; + f[DIR_0MM] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[DIR_0MM]; + f[DIR_0PM] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[DIR_0PM]; + f[DIR_0MP] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[DIR_0MP]; + f[DIR_PPP] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[DIR_PPP]; + f[DIR_MMP] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[DIR_MMP]; + f[DIR_PMP] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[DIR_PMP]; + f[DIR_MPP] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[DIR_MPP]; + f[DIR_PPM] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[DIR_PPM]; + f[DIR_MMM] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[DIR_MMM]; + f[DIR_PMM] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[DIR_PMM]; + f[DIR_MPM] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[DIR_MPM]; + f[DIR_000] = f_ZERO + xs*x_ZERO + ys*y_ZERO + zs*z_ZERO + feq[DIR_000]; } ////////////////////////////////////////////////////////////////////////// //Position SWB -0.25, -0.25, -0.25 @@ -737,33 +737,33 @@ void IncompressibleOffsetInterpolationProcessor::calcInterpolatedNodeFC(LBMReal* f_TSE = eps_new*((ay - az + bx + bz - cx + cy+kxyAverage-kxzAverage+kyzAverage)/(72.*o)); f_TNW = eps_new*((ay + az + bx - bz + cx - cy+kxyAverage+kxzAverage-kyzAverage)/(72.*o)); - f[E] = f_E + feq[E]; - 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]; + f[DIR_P00] = f_E + feq[DIR_P00]; + f[DIR_M00] = f_E + feq[DIR_M00]; + f[DIR_0P0] = f_N + feq[DIR_0P0]; + f[DIR_0M0] = f_N + feq[DIR_0M0]; + f[DIR_00P] = f_T + feq[DIR_00P]; + f[DIR_00M] = f_T + feq[DIR_00M]; + f[DIR_PP0] = f_NE + feq[DIR_PP0]; + f[DIR_MM0] = f_NE + feq[DIR_MM0]; + f[DIR_PM0] = f_SE + feq[DIR_PM0]; + f[DIR_MP0] = f_SE + feq[DIR_MP0]; + f[DIR_P0P] = f_TE + feq[DIR_P0P]; + f[DIR_M0M] = f_TE + feq[DIR_M0M]; + f[DIR_P0M] = f_BE + feq[DIR_P0M]; + f[DIR_M0P] = f_BE + feq[DIR_M0P]; + f[DIR_0PP] = f_TN + feq[DIR_0PP]; + f[DIR_0MM] = f_TN + feq[DIR_0MM]; + f[DIR_0PM] = f_BN + feq[DIR_0PM]; + f[DIR_0MP] = f_BN + feq[DIR_0MP]; + f[DIR_PPP] = f_TNE + feq[DIR_PPP]; + f[DIR_MPP] = f_TNW + feq[DIR_MPP]; + f[DIR_PMP] = f_TSE + feq[DIR_PMP]; + f[DIR_MMP] = f_TSW + feq[DIR_MMP]; + f[DIR_PPM] = f_TSW + feq[DIR_PPM]; + f[DIR_MPM] = f_TSE + feq[DIR_MPM]; + f[DIR_PMM] = f_TNW + feq[DIR_PMM]; + f[DIR_MMM] = f_TNE + feq[DIR_MMM]; + f[DIR_000] = f_ZERO + feq[DIR_000]; } ////////////////////////////////////////////////////////////////////////// void IncompressibleOffsetInterpolationProcessor::calcInterpolatedVelocity(LBMReal x, LBMReal y, LBMReal z, LBMReal& vx1, LBMReal& vx2, LBMReal& vx3) diff --git a/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.cpp index 554fc6614c11e2e8b96f5829d81d1c27e9365870..c37571337e537c324b557ac6c76680a63fc89b00 100644 --- a/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/InitDensityLBMKernel.cpp @@ -894,45 +894,45 @@ void InitDensityLBMKernel::calculate(int /*step*/) ////////////////////////////////////////////////////////////////////////// //read distribution //////////////////////////////////////////////////////////////////////////// - f[REST] = (*this->zeroDistributions)(x1, x2, x3); + f[DIR_000] = (*this->zeroDistributions)(x1, x2, x3); - f[E] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); - f[N] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); - f[T] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); - f[NE] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); - f[NW] = (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3); - f[TE] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); - f[TW] = (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3); - f[TN] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); - f[TS] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3); - f[TNE] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); - f[TNW] = (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3); - f[TSE] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3); - f[TSW] = (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3); + f[DIR_P00] = (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3); + f[DIR_0P0] = (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3); + f[DIR_00P] = (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3); + f[DIR_PP0] = (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3); + f[DIR_MP0] = (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3); + f[DIR_P0P] = (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3); + f[DIR_M0P] = (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3); + f[DIR_0PP] = (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3); + f[DIR_0MP] = (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3); + f[DIR_PPP] = (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3); + f[DIR_MPP] = (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3); + f[DIR_PMP] = (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3); + f[DIR_MMP] = (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3); - f[W] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3); - f[S] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3); - f[B] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p); - f[SW] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3); - f[SE] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3); - f[BW] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p); - f[BE] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p); - f[BS] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p); - f[BN] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p); - f[BSW] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p); - f[BSE] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p); - f[BNW] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p); - f[BNE] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p); + f[DIR_M00] = (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3); + f[DIR_0M0] = (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3); + f[DIR_00M] = (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p); + f[DIR_MM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3); + f[DIR_PM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3); + f[DIR_M0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p); + f[DIR_P0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p); + f[DIR_0MM] = (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p); + f[DIR_0PM] = (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p); + f[DIR_MMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p); + f[DIR_PMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p); + f[DIR_MPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p); + f[DIR_PPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p); ////////////////////////////////////////////////////////////////////////// - drho = ((f[TNE]+f[BSW])+(f[TSE]+f[BNW]))+((f[BSE]+f[TNW])+(f[TSW]+f[BNE])) - +(((f[NE]+f[SW])+(f[SE]+f[NW]))+((f[TE]+f[BW])+(f[BE]+f[TW])) - +((f[BN]+f[TS])+(f[TN]+f[BS])))+((f[E]+f[W])+(f[N]+f[S]) - +(f[T]+f[B]))+f[REST]; + drho = ((f[DIR_PPP]+f[DIR_MMM])+(f[DIR_PMP]+f[DIR_MPM]))+((f[DIR_PMM]+f[DIR_MPP])+(f[DIR_MMP]+f[DIR_PPM])) + +(((f[DIR_PP0]+f[DIR_MM0])+(f[DIR_PM0]+f[DIR_MP0]))+((f[DIR_P0P]+f[DIR_M0M])+(f[DIR_P0M]+f[DIR_M0P])) + +((f[DIR_0PM]+f[DIR_0MP])+(f[DIR_0PP]+f[DIR_0MM])))+((f[DIR_P00]+f[DIR_M00])+(f[DIR_0P0]+f[DIR_0M0]) + +(f[DIR_00P]+f[DIR_00M]))+f[DIR_000]; //vx1 = ((((f[TNE]-f[BSW])+(f[TSE]-f[BNW]))+((f[BSE]-f[TNW])+(f[BNE]-f[TSW])))+ // (((f[BE]-f[TW])+(f[TE]-f[BW]))+((f[SE]-f[NW])+(f[NE]-f[SW])))+ - // (f[E]-f[W])); + // (f[DIR_P00]-f[W])); //vx2 = ((((f[TNE]-f[BSW])+(f[BNW]-f[TSE]))+((f[TNW]-f[BSE])+(f[BNE]-f[TSW])))+ // (((f[BN]-f[TS])+(f[TN]-f[BS]))+((f[NW]-f[SE])+(f[NE]-f[SW])))+ @@ -956,67 +956,67 @@ void InitDensityLBMKernel::calculate(int /*step*/) LBMReal cu_sq = 1.5*(vx1*vx1+vx2*vx2+vx3*vx3); - feq[REST] = c8o27*(drho-cu_sq); - feq[E] = c2o27*(drho+3.0*(vx1)+c9o2*(vx1)*(vx1)-cu_sq); - feq[W] = c2o27*(drho+3.0*(-vx1)+c9o2*(-vx1)*(-vx1)-cu_sq); - feq[N] = c2o27*(drho+3.0*(vx2)+c9o2*(vx2)*(vx2)-cu_sq); - feq[S] = c2o27*(drho+3.0*(-vx2)+c9o2*(-vx2)*(-vx2)-cu_sq); - feq[T] = c2o27*(drho+3.0*(vx3)+c9o2*(vx3)*(vx3)-cu_sq); - feq[B] = c2o27*(drho+3.0*(-vx3)+c9o2*(-vx3)*(-vx3)-cu_sq); - feq[NE] = c1o54*(drho+3.0*(vx1+vx2)+c9o2*(vx1+vx2)*(vx1+vx2)-cu_sq); - feq[SW] = c1o54*(drho+3.0*(-vx1-vx2)+c9o2*(-vx1-vx2)*(-vx1-vx2)-cu_sq); - feq[SE] = c1o54*(drho+3.0*(vx1-vx2)+c9o2*(vx1-vx2)*(vx1-vx2)-cu_sq); - feq[NW] = c1o54*(drho+3.0*(-vx1+vx2)+c9o2*(-vx1+vx2)*(-vx1+vx2)-cu_sq); - feq[TE] = c1o54*(drho+3.0*(vx1+vx3)+c9o2*(vx1+vx3)*(vx1+vx3)-cu_sq); - feq[BW] = c1o54*(drho+3.0*(-vx1-vx3)+c9o2*(-vx1-vx3)*(-vx1-vx3)-cu_sq); - feq[BE] = c1o54*(drho+3.0*(vx1-vx3)+c9o2*(vx1-vx3)*(vx1-vx3)-cu_sq); - feq[TW] = c1o54*(drho+3.0*(-vx1+vx3)+c9o2*(-vx1+vx3)*(-vx1+vx3)-cu_sq); - feq[TN] = c1o54*(drho+3.0*(vx2+vx3)+c9o2*(vx2+vx3)*(vx2+vx3)-cu_sq); - feq[BS] = c1o54*(drho+3.0*(-vx2-vx3)+c9o2*(-vx2-vx3)*(-vx2-vx3)-cu_sq); - feq[BN] = c1o54*(drho+3.0*(vx2-vx3)+c9o2*(vx2-vx3)*(vx2-vx3)-cu_sq); - feq[TS] = c1o54*(drho+3.0*(-vx2+vx3)+c9o2*(-vx2+vx3)*(-vx2+vx3)-cu_sq); - feq[TNE] = c1o216*(drho+3.0*(vx1+vx2+vx3)+c9o2*(vx1+vx2+vx3)*(vx1+vx2+vx3)-cu_sq); - feq[BSW] = c1o216*(drho+3.0*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); - feq[BNE] = c1o216*(drho+3.0*(vx1+vx2-vx3)+c9o2*(vx1+vx2-vx3)*(vx1+vx2-vx3)-cu_sq); - feq[TSW] = c1o216*(drho+3.0*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); - feq[TSE] = c1o216*(drho+3.0*(vx1-vx2+vx3)+c9o2*(vx1-vx2+vx3)*(vx1-vx2+vx3)-cu_sq); - feq[BNW] = c1o216*(drho+3.0*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); - feq[BSE] = c1o216*(drho+3.0*(vx1-vx2-vx3)+c9o2*(vx1-vx2-vx3)*(vx1-vx2-vx3)-cu_sq); - feq[TNW] = c1o216*(drho+3.0*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); + feq[DIR_000] = c8o27*(drho-cu_sq); + feq[DIR_P00] = c2o27*(drho+3.0*(vx1)+c9o2*(vx1)*(vx1)-cu_sq); + feq[DIR_M00] = c2o27*(drho+3.0*(-vx1)+c9o2*(-vx1)*(-vx1)-cu_sq); + feq[DIR_0P0] = c2o27*(drho+3.0*(vx2)+c9o2*(vx2)*(vx2)-cu_sq); + feq[DIR_0M0] = c2o27*(drho+3.0*(-vx2)+c9o2*(-vx2)*(-vx2)-cu_sq); + feq[DIR_00P] = c2o27*(drho+3.0*(vx3)+c9o2*(vx3)*(vx3)-cu_sq); + feq[DIR_00M] = c2o27*(drho+3.0*(-vx3)+c9o2*(-vx3)*(-vx3)-cu_sq); + feq[DIR_PP0] = c1o54*(drho+3.0*(vx1+vx2)+c9o2*(vx1+vx2)*(vx1+vx2)-cu_sq); + feq[DIR_MM0] = c1o54*(drho+3.0*(-vx1-vx2)+c9o2*(-vx1-vx2)*(-vx1-vx2)-cu_sq); + feq[DIR_PM0] = c1o54*(drho+3.0*(vx1-vx2)+c9o2*(vx1-vx2)*(vx1-vx2)-cu_sq); + feq[DIR_MP0] = c1o54*(drho+3.0*(-vx1+vx2)+c9o2*(-vx1+vx2)*(-vx1+vx2)-cu_sq); + feq[DIR_P0P] = c1o54*(drho+3.0*(vx1+vx3)+c9o2*(vx1+vx3)*(vx1+vx3)-cu_sq); + feq[DIR_M0M] = c1o54*(drho+3.0*(-vx1-vx3)+c9o2*(-vx1-vx3)*(-vx1-vx3)-cu_sq); + feq[DIR_P0M] = c1o54*(drho+3.0*(vx1-vx3)+c9o2*(vx1-vx3)*(vx1-vx3)-cu_sq); + feq[DIR_M0P] = c1o54*(drho+3.0*(-vx1+vx3)+c9o2*(-vx1+vx3)*(-vx1+vx3)-cu_sq); + feq[DIR_0PP] = c1o54*(drho+3.0*(vx2+vx3)+c9o2*(vx2+vx3)*(vx2+vx3)-cu_sq); + feq[DIR_0MM] = c1o54*(drho+3.0*(-vx2-vx3)+c9o2*(-vx2-vx3)*(-vx2-vx3)-cu_sq); + feq[DIR_0PM] = c1o54*(drho+3.0*(vx2-vx3)+c9o2*(vx2-vx3)*(vx2-vx3)-cu_sq); + feq[DIR_0MP] = c1o54*(drho+3.0*(-vx2+vx3)+c9o2*(-vx2+vx3)*(-vx2+vx3)-cu_sq); + feq[DIR_PPP] = c1o216*(drho+3.0*(vx1+vx2+vx3)+c9o2*(vx1+vx2+vx3)*(vx1+vx2+vx3)-cu_sq); + feq[DIR_MMM] = c1o216*(drho+3.0*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); + feq[DIR_PPM] = c1o216*(drho+3.0*(vx1+vx2-vx3)+c9o2*(vx1+vx2-vx3)*(vx1+vx2-vx3)-cu_sq); + feq[DIR_MMP] = c1o216*(drho+3.0*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); + feq[DIR_PMP] = c1o216*(drho+3.0*(vx1-vx2+vx3)+c9o2*(vx1-vx2+vx3)*(vx1-vx2+vx3)-cu_sq); + feq[DIR_MPM] = c1o216*(drho+3.0*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); + feq[DIR_PMM] = c1o216*(drho+3.0*(vx1-vx2-vx3)+c9o2*(vx1-vx2-vx3)*(vx1-vx2-vx3)-cu_sq); + feq[DIR_MPP] = c1o216*(drho+3.0*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); //Relaxation - f[REST] += (feq[REST]-f[REST])*collFactor; - f[E] += (feq[E]-f[E])*collFactor; - f[W] += (feq[W]-f[W])*collFactor; - f[N] += (feq[N]-f[N])*collFactor; - f[S] += (feq[S]-f[S])*collFactor; - f[T] += (feq[T]-f[T])*collFactor; - f[B] += (feq[B]-f[B])*collFactor; - f[NE] += (feq[NE]-f[NE])*collFactor; - f[SW] += (feq[SW]-f[SW])*collFactor; - f[SE] += (feq[SE]-f[SE])*collFactor; - f[NW] += (feq[NW]-f[NW])*collFactor; - f[TE] += (feq[TE]-f[TE])*collFactor; - f[BW] += (feq[BW]-f[BW])*collFactor; - f[BE] += (feq[BE]-f[BE])*collFactor; - f[TW] += (feq[TW]-f[TW])*collFactor; - f[TN] += (feq[TN]-f[TN])*collFactor; - f[BS] += (feq[BS]-f[BS])*collFactor; - f[BN] += (feq[BN]-f[BN])*collFactor; - f[TS] += (feq[TS]-f[TS])*collFactor; + f[DIR_000] += (feq[DIR_000]-f[DIR_000])*collFactor; + f[DIR_P00] += (feq[DIR_P00]-f[DIR_P00])*collFactor; + f[DIR_M00] += (feq[DIR_M00]-f[DIR_M00])*collFactor; + f[DIR_0P0] += (feq[DIR_0P0]-f[DIR_0P0])*collFactor; + f[DIR_0M0] += (feq[DIR_0M0]-f[DIR_0M0])*collFactor; + f[DIR_00P] += (feq[DIR_00P]-f[DIR_00P])*collFactor; + f[DIR_00M] += (feq[DIR_00M]-f[DIR_00M])*collFactor; + f[DIR_PP0] += (feq[DIR_PP0]-f[DIR_PP0])*collFactor; + f[DIR_MM0] += (feq[DIR_MM0]-f[DIR_MM0])*collFactor; + f[DIR_PM0] += (feq[DIR_PM0]-f[DIR_PM0])*collFactor; + f[DIR_MP0] += (feq[DIR_MP0]-f[DIR_MP0])*collFactor; + f[DIR_P0P] += (feq[DIR_P0P]-f[DIR_P0P])*collFactor; + f[DIR_M0M] += (feq[DIR_M0M]-f[DIR_M0M])*collFactor; + f[DIR_P0M] += (feq[DIR_P0M]-f[DIR_P0M])*collFactor; + f[DIR_M0P] += (feq[DIR_M0P]-f[DIR_M0P])*collFactor; + f[DIR_0PP] += (feq[DIR_0PP]-f[DIR_0PP])*collFactor; + f[DIR_0MM] += (feq[DIR_0MM]-f[DIR_0MM])*collFactor; + f[DIR_0PM] += (feq[DIR_0PM]-f[DIR_0PM])*collFactor; + f[DIR_0MP] += (feq[DIR_0MP]-f[DIR_0MP])*collFactor; - f[TNE] += (feq[TNE]-f[TNE])*collFactor; - f[BSW] += (feq[BSW]-f[BSW])*collFactor; - f[BNE] += (feq[BNE]-f[BNE])*collFactor; - f[TSW] += (feq[TSW]-f[TSW])*collFactor; - f[TSE] += (feq[TSE]-f[TSE])*collFactor; - f[BNW] += (feq[BNW]-f[BNW])*collFactor; - f[BSE] += (feq[BSE]-f[BSE])*collFactor; - f[TNW] += (feq[TNW]-f[TNW])*collFactor; + f[DIR_PPP] += (feq[DIR_PPP]-f[DIR_PPP])*collFactor; + f[DIR_MMM] += (feq[DIR_MMM]-f[DIR_MMM])*collFactor; + f[DIR_PPM] += (feq[DIR_PPM]-f[DIR_PPM])*collFactor; + f[DIR_MMP] += (feq[DIR_MMP]-f[DIR_MMP])*collFactor; + f[DIR_PMP] += (feq[DIR_PMP]-f[DIR_PMP])*collFactor; + f[DIR_MPM] += (feq[DIR_MPM]-f[DIR_MPM])*collFactor; + f[DIR_PMM] += (feq[DIR_PMM]-f[DIR_PMM])*collFactor; + f[DIR_MPP] += (feq[DIR_MPP]-f[DIR_MPP])*collFactor; ////////////////////////////////////////////////////////////////////////// #ifdef PROOF_CORRECTNESS - LBMReal rho_post = f[REST]+f[E]+f[W]+f[N]+f[S]+f[T]+f[B] + LBMReal rho_post = f[REST]+f[DIR_P00]+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]; @@ -1033,35 +1033,35 @@ void InitDensityLBMKernel::calculate(int /*step*/) ////////////////////////////////////////////////////////////////////////// //write distribution ////////////////////////////////////////////////////////////////////////// - (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::INV_E]; - (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::INV_N]; - (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::INV_T]; - (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::INV_NE]; - (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3) = f[D3Q27System::INV_NW]; - (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::INV_TE]; - (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3) = f[D3Q27System::INV_TW]; - (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::INV_TN]; - (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3) = f[D3Q27System::INV_TS]; - (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::INV_TNE]; - (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3) = f[D3Q27System::INV_TNW]; - (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3) = f[D3Q27System::INV_TSE]; - (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3) = f[D3Q27System::INV_TSW]; + (*this->localDistributions)(D3Q27System::ET_E, x1, x2, x3) = f[D3Q27System::INV_P00]; + (*this->localDistributions)(D3Q27System::ET_N, x1, x2, x3) = f[D3Q27System::INV_0P0]; + (*this->localDistributions)(D3Q27System::ET_T, x1, x2, x3) = f[D3Q27System::INV_00P]; + (*this->localDistributions)(D3Q27System::ET_NE, x1, x2, x3) = f[D3Q27System::INV_PP0]; + (*this->localDistributions)(D3Q27System::ET_NW, x1p, x2, x3) = f[D3Q27System::INV_MP0]; + (*this->localDistributions)(D3Q27System::ET_TE, x1, x2, x3) = f[D3Q27System::INV_P0P]; + (*this->localDistributions)(D3Q27System::ET_TW, x1p, x2, x3) = f[D3Q27System::INV_M0P]; + (*this->localDistributions)(D3Q27System::ET_TN, x1, x2, x3) = f[D3Q27System::INV_0PP]; + (*this->localDistributions)(D3Q27System::ET_TS, x1, x2p, x3) = f[D3Q27System::INV_0MP]; + (*this->localDistributions)(D3Q27System::ET_TNE, x1, x2, x3) = f[D3Q27System::INV_PPP]; + (*this->localDistributions)(D3Q27System::ET_TNW, x1p, x2, x3) = f[D3Q27System::INV_MPP]; + (*this->localDistributions)(D3Q27System::ET_TSE, x1, x2p, x3) = f[D3Q27System::INV_PMP]; + (*this->localDistributions)(D3Q27System::ET_TSW, x1p, x2p, x3) = f[D3Q27System::INV_MMP]; - (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3) = f[D3Q27System::INV_W]; - (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3) = f[D3Q27System::INV_S]; - (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p) = f[D3Q27System::INV_B]; - (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3) = f[D3Q27System::INV_SW]; - (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3) = f[D3Q27System::INV_SE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p) = f[D3Q27System::INV_BW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p) = f[D3Q27System::INV_BE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p) = f[D3Q27System::INV_BS]; - (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p) = f[D3Q27System::INV_BN]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p) = f[D3Q27System::INV_BSW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p) = f[D3Q27System::INV_BSE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p) = f[D3Q27System::INV_BNW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p) = f[D3Q27System::INV_BNE]; + (*this->nonLocalDistributions)(D3Q27System::ET_W, x1p, x2, x3) = f[D3Q27System::INV_M00]; + (*this->nonLocalDistributions)(D3Q27System::ET_S, x1, x2p, x3) = f[D3Q27System::INV_0M0]; + (*this->nonLocalDistributions)(D3Q27System::ET_B, x1, x2, x3p) = f[D3Q27System::INV_00M]; + (*this->nonLocalDistributions)(D3Q27System::ET_SW, x1p, x2p, x3) = f[D3Q27System::INV_MM0]; + (*this->nonLocalDistributions)(D3Q27System::ET_SE, x1, x2p, x3) = f[D3Q27System::INV_PM0]; + (*this->nonLocalDistributions)(D3Q27System::ET_BW, x1p, x2, x3p) = f[D3Q27System::INV_M0M]; + (*this->nonLocalDistributions)(D3Q27System::ET_BE, x1, x2, x3p) = f[D3Q27System::INV_P0M]; + (*this->nonLocalDistributions)(D3Q27System::ET_BS, x1, x2p, x3p) = f[D3Q27System::INV_0MM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BN, x1, x2, x3p) = f[D3Q27System::INV_0PM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSW, x1p, x2p, x3p) = f[D3Q27System::INV_MMM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSE, x1, x2p, x3p) = f[D3Q27System::INV_PMM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNW, x1p, x2, x3p) = f[D3Q27System::INV_MPM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNE, x1, x2, x3p) = f[D3Q27System::INV_PPM]; - (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::REST]; + (*this->zeroDistributions)(x1, x2, x3) = f[D3Q27System::DIR_000]; ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/LBM/LBMKernelETD3Q27BGK.cpp b/src/cpu/VirtualFluidsCore/LBM/LBMKernelETD3Q27BGK.cpp index 6076eb018097dc77afcf37af2d14206325be463c..1fcdf118fa920d648b511c60ebbc48542e164be0 100644 --- a/src/cpu/VirtualFluidsCore/LBM/LBMKernelETD3Q27BGK.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/LBMKernelETD3Q27BGK.cpp @@ -88,113 +88,113 @@ void LBMKernelETD3Q27BGK::calculate(int /*step*/) ////////////////////////////////////////////////////////////////////////// //read distribution //////////////////////////////////////////////////////////////////////////// - f[REST] = (*this->zeroDistributions)(x1,x2,x3); + f[DIR_000] = (*this->zeroDistributions)(x1,x2,x3); - f[E] = (*this->localDistributions)(D3Q27System::ET_E, x1,x2,x3); - f[N] = (*this->localDistributions)(D3Q27System::ET_N,x1,x2,x3); - f[T] = (*this->localDistributions)(D3Q27System::ET_T,x1,x2,x3); - f[NE] = (*this->localDistributions)(D3Q27System::ET_NE,x1,x2,x3); - f[NW] = (*this->localDistributions)(D3Q27System::ET_NW,x1p,x2,x3); - f[TE] = (*this->localDistributions)(D3Q27System::ET_TE,x1,x2,x3); - f[TW] = (*this->localDistributions)(D3Q27System::ET_TW, x1p,x2,x3); - f[TN] = (*this->localDistributions)(D3Q27System::ET_TN,x1,x2,x3); - f[TS] = (*this->localDistributions)(D3Q27System::ET_TS,x1,x2p,x3); - f[TNE] = (*this->localDistributions)(D3Q27System::ET_TNE,x1,x2,x3); - f[TNW] = (*this->localDistributions)(D3Q27System::ET_TNW,x1p,x2,x3); - f[TSE] = (*this->localDistributions)(D3Q27System::ET_TSE,x1,x2p,x3); - f[TSW] = (*this->localDistributions)(D3Q27System::ET_TSW,x1p,x2p,x3); + f[DIR_P00] = (*this->localDistributions)(D3Q27System::ET_E, x1,x2,x3); + f[DIR_0P0] = (*this->localDistributions)(D3Q27System::ET_N,x1,x2,x3); + f[DIR_00P] = (*this->localDistributions)(D3Q27System::ET_T,x1,x2,x3); + f[DIR_PP0] = (*this->localDistributions)(D3Q27System::ET_NE,x1,x2,x3); + f[DIR_MP0] = (*this->localDistributions)(D3Q27System::ET_NW,x1p,x2,x3); + f[DIR_P0P] = (*this->localDistributions)(D3Q27System::ET_TE,x1,x2,x3); + f[DIR_M0P] = (*this->localDistributions)(D3Q27System::ET_TW, x1p,x2,x3); + f[DIR_0PP] = (*this->localDistributions)(D3Q27System::ET_TN,x1,x2,x3); + f[DIR_0MP] = (*this->localDistributions)(D3Q27System::ET_TS,x1,x2p,x3); + f[DIR_PPP] = (*this->localDistributions)(D3Q27System::ET_TNE,x1,x2,x3); + f[DIR_MPP] = (*this->localDistributions)(D3Q27System::ET_TNW,x1p,x2,x3); + f[DIR_PMP] = (*this->localDistributions)(D3Q27System::ET_TSE,x1,x2p,x3); + f[DIR_MMP] = (*this->localDistributions)(D3Q27System::ET_TSW,x1p,x2p,x3); - f[W ] = (*this->nonLocalDistributions)(D3Q27System::ET_W,x1p,x2,x3 ); - f[S ] = (*this->nonLocalDistributions)(D3Q27System::ET_S,x1,x2p,x3 ); - f[B ] = (*this->nonLocalDistributions)(D3Q27System::ET_B,x1,x2,x3p ); - f[SW] = (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1p,x2p,x3 ); - f[SE] = (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1,x2p,x3 ); - f[BW] = (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1p,x2,x3p ); - f[BE] = (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1,x2,x3p ); - f[BS] = (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1,x2p,x3p ); - f[BN] = (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1,x2,x3p ); - f[BSW] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1p,x2p,x3p); - f[BSE] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1,x2p,x3p); - f[BNW] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1p,x2,x3p); - f[BNE] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1,x2,x3p); + f[DIR_M00] = (*this->nonLocalDistributions)(D3Q27System::ET_W,x1p,x2,x3 ); + f[DIR_0M0] = (*this->nonLocalDistributions)(D3Q27System::ET_S,x1,x2p,x3 ); + f[DIR_00M] = (*this->nonLocalDistributions)(D3Q27System::ET_B,x1,x2,x3p ); + f[DIR_MM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1p,x2p,x3 ); + f[DIR_PM0] = (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1,x2p,x3 ); + f[DIR_M0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1p,x2,x3p ); + f[DIR_P0M] = (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1,x2,x3p ); + f[DIR_0MM] = (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1,x2p,x3p ); + f[DIR_0PM] = (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1,x2,x3p ); + f[DIR_MMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1p,x2p,x3p); + f[DIR_PMM] = (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1,x2p,x3p); + f[DIR_MPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1p,x2,x3p); + f[DIR_PPM] = (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1,x2,x3p); ////////////////////////////////////////////////////////////////////////// - drho = f[REST] + 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]; + drho = f[DIR_000] + f[DIR_P00] + f[DIR_M00] + f[DIR_0P0] + f[DIR_0M0] + f[DIR_00P] + f[DIR_00M] + + f[DIR_PP0] + f[DIR_MM0] + f[DIR_PM0] + f[DIR_MP0] + f[DIR_P0P] + f[DIR_M0M] + f[DIR_P0M] + + f[DIR_M0P] + f[DIR_0PP] + f[DIR_0MM] + f[DIR_0PM] + f[DIR_0MP] + f[DIR_PPP] + f[DIR_MMP] + + f[DIR_PMP] + f[DIR_MPP] + f[DIR_PPM] + f[DIR_MMM] + f[DIR_PMM] + f[DIR_MPM]; - vx1 = f[E] - f[W] + f[NE] - f[SW] + f[SE] - f[NW] + f[TE] - f[BW] - + f[BE] - f[TW] + f[TNE] - f[TSW] + f[TSE] - f[TNW] + f[BNE] - f[BSW] - + f[BSE] - f[BNW]; + vx1 = f[DIR_P00] - f[DIR_M00] + f[DIR_PP0] - f[DIR_MM0] + f[DIR_PM0] - f[DIR_MP0] + f[DIR_P0P] - f[DIR_M0M] + + f[DIR_P0M] - f[DIR_M0P] + f[DIR_PPP] - f[DIR_MMP] + f[DIR_PMP] - f[DIR_MPP] + f[DIR_PPM] - f[DIR_MMM] + + f[DIR_PMM] - f[DIR_MPM]; - vx2 = f[N] - f[S] + f[NE] - f[SW] - f[SE] + f[NW] + f[TN] - f[BS] + f[BN] - - f[TS] + f[TNE] - f[TSW] - f[TSE] + f[TNW] + f[BNE] - f[BSW] - f[BSE] - + f[BNW]; + vx2 = f[DIR_0P0] - f[DIR_0M0] + f[DIR_PP0] - f[DIR_MM0] - f[DIR_PM0] + f[DIR_MP0] + f[DIR_0PP] - f[DIR_0MM] + f[DIR_0PM] + - f[DIR_0MP] + f[DIR_PPP] - f[DIR_MMP] - f[DIR_PMP] + f[DIR_MPP] + f[DIR_PPM] - f[DIR_MMM] - f[DIR_PMM] + + f[DIR_MPM]; - vx3 = f[T] - f[B] + 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]; + vx3 = f[DIR_00P] - f[DIR_00M] + f[DIR_P0P] - f[DIR_M0M] - f[DIR_P0M] + f[DIR_M0P] + f[DIR_0PP] - f[DIR_0MM] - f[DIR_0PM] + + f[DIR_0MP] + f[DIR_PPP] + f[DIR_MMP] + f[DIR_PMP] + f[DIR_MPP] - f[DIR_PPM] - f[DIR_MMM] - f[DIR_PMM] + - f[DIR_MPM]; LBMReal cu_sq=1.5*(vx1*vx1+vx2*vx2+vx3*vx3); - feq[REST] = c8o27*(drho-cu_sq); - feq[E] = c2o27*(drho+3.0*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); - feq[W] = c2o27*(drho+3.0*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); - feq[N] = c2o27*(drho+3.0*( vx2)+c9o2*( vx2)*( vx2)-cu_sq); - feq[S] = c2o27*(drho+3.0*( -vx2)+c9o2*( -vx2)*( -vx2)-cu_sq); - feq[T] = c2o27*(drho+3.0*( vx3 )+c9o2*( vx3)*( vx3)-cu_sq); - feq[B] = c2o27*(drho+3.0*( -vx3)+c9o2*( -vx3)*( -vx3)-cu_sq); - feq[NE] = c1o54*(drho+3.0*( vx1+vx2)+c9o2*( vx1+vx2)*( vx1+vx2)-cu_sq); - feq[SW] = c1o54*(drho+3.0*(-vx1-vx2)+c9o2*(-vx1-vx2)*(-vx1-vx2)-cu_sq); - feq[SE] = c1o54*(drho+3.0*( vx1-vx2)+c9o2*( vx1-vx2)*( vx1-vx2)-cu_sq); - feq[NW] = c1o54*(drho+3.0*(-vx1+vx2)+c9o2*(-vx1+vx2)*(-vx1+vx2)-cu_sq); - feq[TE] = c1o54*(drho+3.0*( vx1+vx3)+c9o2*( vx1+vx3)*( vx1+vx3)-cu_sq); - feq[BW] = c1o54*(drho+3.0*(-vx1-vx3)+c9o2*(-vx1-vx3)*(-vx1-vx3)-cu_sq); - feq[BE] = c1o54*(drho+3.0*( vx1-vx3)+c9o2*( vx1-vx3)*( vx1-vx3)-cu_sq); - feq[TW] = c1o54*(drho+3.0*(-vx1+vx3)+c9o2*(-vx1+vx3)*(-vx1+vx3)-cu_sq); - feq[TN] = c1o54*(drho+3.0*( vx2+vx3)+c9o2*( vx2+vx3)*( vx2+vx3)-cu_sq); - feq[BS] = c1o54*(drho+3.0*(-vx2-vx3)+c9o2*(-vx2-vx3)*(-vx2-vx3)-cu_sq); - feq[BN] = c1o54*(drho+3.0*( vx2-vx3)+c9o2*( vx2-vx3)*( vx2-vx3)-cu_sq); - feq[TS] = c1o54*(drho+3.0*(-vx2+vx3)+c9o2*(-vx2+vx3)*(-vx2+vx3)-cu_sq); - feq[TNE]= c1o216*(drho+3.0*( vx1+vx2+vx3)+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); - feq[BSW]= c1o216*(drho+3.0*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); - feq[BNE]= c1o216*(drho+3.0*( vx1+vx2-vx3)+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); - feq[TSW]= c1o216*(drho+3.0*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); - feq[TSE]= c1o216*(drho+3.0*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); - feq[BNW]= c1o216*(drho+3.0*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); - feq[BSE]= c1o216*(drho+3.0*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); - feq[TNW]= c1o216*(drho+3.0*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); + feq[DIR_000] = c8o27*(drho-cu_sq); + feq[DIR_P00] = c2o27*(drho+3.0*( vx1 )+c9o2*( vx1 )*( vx1 )-cu_sq); + feq[DIR_M00] = c2o27*(drho+3.0*(-vx1 )+c9o2*(-vx1 )*(-vx1 )-cu_sq); + feq[DIR_0P0] = c2o27*(drho+3.0*( vx2)+c9o2*( vx2)*( vx2)-cu_sq); + feq[DIR_0M0] = c2o27*(drho+3.0*( -vx2)+c9o2*( -vx2)*( -vx2)-cu_sq); + feq[DIR_00P] = c2o27*(drho+3.0*( vx3 )+c9o2*( vx3)*( vx3)-cu_sq); + feq[DIR_00M] = c2o27*(drho+3.0*( -vx3)+c9o2*( -vx3)*( -vx3)-cu_sq); + feq[DIR_PP0] = c1o54*(drho+3.0*( vx1+vx2)+c9o2*( vx1+vx2)*( vx1+vx2)-cu_sq); + feq[DIR_MM0] = c1o54*(drho+3.0*(-vx1-vx2)+c9o2*(-vx1-vx2)*(-vx1-vx2)-cu_sq); + feq[DIR_PM0] = c1o54*(drho+3.0*( vx1-vx2)+c9o2*( vx1-vx2)*( vx1-vx2)-cu_sq); + feq[DIR_MP0] = c1o54*(drho+3.0*(-vx1+vx2)+c9o2*(-vx1+vx2)*(-vx1+vx2)-cu_sq); + feq[DIR_P0P] = c1o54*(drho+3.0*( vx1+vx3)+c9o2*( vx1+vx3)*( vx1+vx3)-cu_sq); + feq[DIR_M0M] = c1o54*(drho+3.0*(-vx1-vx3)+c9o2*(-vx1-vx3)*(-vx1-vx3)-cu_sq); + feq[DIR_P0M] = c1o54*(drho+3.0*( vx1-vx3)+c9o2*( vx1-vx3)*( vx1-vx3)-cu_sq); + feq[DIR_M0P] = c1o54*(drho+3.0*(-vx1+vx3)+c9o2*(-vx1+vx3)*(-vx1+vx3)-cu_sq); + feq[DIR_0PP] = c1o54*(drho+3.0*( vx2+vx3)+c9o2*( vx2+vx3)*( vx2+vx3)-cu_sq); + feq[DIR_0MM] = c1o54*(drho+3.0*(-vx2-vx3)+c9o2*(-vx2-vx3)*(-vx2-vx3)-cu_sq); + feq[DIR_0PM] = c1o54*(drho+3.0*( vx2-vx3)+c9o2*( vx2-vx3)*( vx2-vx3)-cu_sq); + feq[DIR_0MP] = c1o54*(drho+3.0*(-vx2+vx3)+c9o2*(-vx2+vx3)*(-vx2+vx3)-cu_sq); + feq[DIR_PPP]= c1o216*(drho+3.0*( vx1+vx2+vx3)+c9o2*( vx1+vx2+vx3)*( vx1+vx2+vx3)-cu_sq); + feq[DIR_MMM]= c1o216*(drho+3.0*(-vx1-vx2-vx3)+c9o2*(-vx1-vx2-vx3)*(-vx1-vx2-vx3)-cu_sq); + feq[DIR_PPM]= c1o216*(drho+3.0*( vx1+vx2-vx3)+c9o2*( vx1+vx2-vx3)*( vx1+vx2-vx3)-cu_sq); + feq[DIR_MMP]= c1o216*(drho+3.0*(-vx1-vx2+vx3)+c9o2*(-vx1-vx2+vx3)*(-vx1-vx2+vx3)-cu_sq); + feq[DIR_PMP]= c1o216*(drho+3.0*( vx1-vx2+vx3)+c9o2*( vx1-vx2+vx3)*( vx1-vx2+vx3)-cu_sq); + feq[DIR_MPM]= c1o216*(drho+3.0*(-vx1+vx2-vx3)+c9o2*(-vx1+vx2-vx3)*(-vx1+vx2-vx3)-cu_sq); + feq[DIR_PMM]= c1o216*(drho+3.0*( vx1-vx2-vx3)+c9o2*( vx1-vx2-vx3)*( vx1-vx2-vx3)-cu_sq); + feq[DIR_MPP]= c1o216*(drho+3.0*(-vx1+vx2+vx3)+c9o2*(-vx1+vx2+vx3)*(-vx1+vx2+vx3)-cu_sq); //Relaxation - f[REST] += (feq[REST]-f[REST])*collFactor; - f[E] += (feq[E]-f[E])*collFactor; - f[W] += (feq[W]-f[W])*collFactor; - f[N] += (feq[N]-f[N])*collFactor; - f[S] += (feq[S]-f[S])*collFactor; - f[T] += (feq[T]-f[T])*collFactor; - f[B] += (feq[B]-f[B])*collFactor; - f[NE] += (feq[NE]-f[NE])*collFactor; - f[SW] += (feq[SW]-f[SW])*collFactor; - f[SE] += (feq[SE]-f[SE])*collFactor; - f[NW] += (feq[NW]-f[NW])*collFactor; - f[TE] += (feq[TE]-f[TE])*collFactor; - f[BW] += (feq[BW]-f[BW])*collFactor; - f[BE] += (feq[BE]-f[BE])*collFactor; - f[TW] += (feq[TW]-f[TW])*collFactor; - f[TN] += (feq[TN]-f[TN])*collFactor; - f[BS] += (feq[BS]-f[BS])*collFactor; - f[BN] += (feq[BN]-f[BN])*collFactor; - f[TS] += (feq[TS]-f[TS])*collFactor; + f[DIR_000] += (feq[DIR_000]-f[DIR_000])*collFactor; + f[DIR_P00] += (feq[DIR_P00]-f[DIR_P00])*collFactor; + f[DIR_M00] += (feq[DIR_M00]-f[DIR_M00])*collFactor; + f[DIR_0P0] += (feq[DIR_0P0]-f[DIR_0P0])*collFactor; + f[DIR_0M0] += (feq[DIR_0M0]-f[DIR_0M0])*collFactor; + f[DIR_00P] += (feq[DIR_00P]-f[DIR_00P])*collFactor; + f[DIR_00M] += (feq[DIR_00M]-f[DIR_00M])*collFactor; + f[DIR_PP0] += (feq[DIR_PP0]-f[DIR_PP0])*collFactor; + f[DIR_MM0] += (feq[DIR_MM0]-f[DIR_MM0])*collFactor; + f[DIR_PM0] += (feq[DIR_PM0]-f[DIR_PM0])*collFactor; + f[DIR_MP0] += (feq[DIR_MP0]-f[DIR_MP0])*collFactor; + f[DIR_P0P] += (feq[DIR_P0P]-f[DIR_P0P])*collFactor; + f[DIR_M0M] += (feq[DIR_M0M]-f[DIR_M0M])*collFactor; + f[DIR_P0M] += (feq[DIR_P0M]-f[DIR_P0M])*collFactor; + f[DIR_M0P] += (feq[DIR_M0P]-f[DIR_M0P])*collFactor; + f[DIR_0PP] += (feq[DIR_0PP]-f[DIR_0PP])*collFactor; + f[DIR_0MM] += (feq[DIR_0MM]-f[DIR_0MM])*collFactor; + f[DIR_0PM] += (feq[DIR_0PM]-f[DIR_0PM])*collFactor; + f[DIR_0MP] += (feq[DIR_0MP]-f[DIR_0MP])*collFactor; - f[TNE] += (feq[TNE]-f[TNE])*collFactor; - f[BSW] += (feq[BSW]-f[BSW])*collFactor; - f[BNE] += (feq[BNE]-f[BNE])*collFactor; - f[TSW] += (feq[TSW]-f[TSW])*collFactor; - f[TSE] += (feq[TSE]-f[TSE])*collFactor; - f[BNW] += (feq[BNW]-f[BNW])*collFactor; - f[BSE] += (feq[BSE]-f[BSE])*collFactor; - f[TNW] += (feq[TNW]-f[TNW])*collFactor; + f[DIR_PPP] += (feq[DIR_PPP]-f[DIR_PPP])*collFactor; + f[DIR_MMM] += (feq[DIR_MMM]-f[DIR_MMM])*collFactor; + f[DIR_PPM] += (feq[DIR_PPM]-f[DIR_PPM])*collFactor; + f[DIR_MMP] += (feq[DIR_MMP]-f[DIR_MMP])*collFactor; + f[DIR_PMP] += (feq[DIR_PMP]-f[DIR_PMP])*collFactor; + f[DIR_MPM] += (feq[DIR_MPM]-f[DIR_MPM])*collFactor; + f[DIR_PMM] += (feq[DIR_PMM]-f[DIR_PMM])*collFactor; + f[DIR_MPP] += (feq[DIR_MPP]-f[DIR_MPP])*collFactor; ////////////////////////////////////////////////////////////////////////// //forcing @@ -208,37 +208,37 @@ void LBMKernelETD3Q27BGK::calculate(int /*step*/) forcingX2 = muForcingX2.Eval(); forcingX3 = muForcingX3.Eval(); - f[REST] += 0.0 ; - f[E ] += 3.0*c2o27 * (forcingX1) ; - f[W ] += 3.0*c2o27 * (-forcingX1) ; - f[N ] += 3.0*c2o27 * (forcingX2) ; - f[S ] += 3.0*c2o27 * (-forcingX2) ; - f[T ] += 3.0*c2o27 * (forcingX3) ; - f[B ] += 3.0*c2o27 * (-forcingX3); - f[NE ] += 3.0*c1o54 * ( forcingX1+forcingX2 ) ; - f[SW ] += 3.0*c1o54 * (-forcingX1-forcingX2 ) ; - f[SE ] += 3.0*c1o54 * ( forcingX1-forcingX2 ) ; - f[NW ] += 3.0*c1o54 * (-forcingX1+forcingX2 ) ; - f[TE ] += 3.0*c1o54 * ( forcingX1 +forcingX3) ; - f[BW ] += 3.0*c1o54 * (-forcingX1 -forcingX3) ; - f[BE ] += 3.0*c1o54 * ( forcingX1 -forcingX3) ; - f[TW ] += 3.0*c1o54 * (-forcingX1 +forcingX3) ; - f[TN ] += 3.0*c1o54 * ( forcingX2+forcingX3) ; - f[BS ] += 3.0*c1o54 * ( -forcingX2-forcingX3) ; - f[BN ] += 3.0*c1o54 * ( forcingX2-forcingX3) ; - f[TS ] += 3.0*c1o54 * ( -forcingX2+forcingX3) ; - f[TNE] += 3.0*c1o216* ( forcingX1+forcingX2+forcingX3) ; - f[BSW] += 3.0*c1o216* (-forcingX1-forcingX2-forcingX3) ; - f[BNE] += 3.0*c1o216* ( forcingX1+forcingX2-forcingX3) ; - f[TSW] += 3.0*c1o216* (-forcingX1-forcingX2+forcingX3) ; - f[TSE] += 3.0*c1o216* ( forcingX1-forcingX2+forcingX3) ; - f[BNW] += 3.0*c1o216* (-forcingX1+forcingX2-forcingX3) ; - f[BSE] += 3.0*c1o216* ( forcingX1-forcingX2-forcingX3) ; - f[TNW] += 3.0*c1o216* (-forcingX1+forcingX2+forcingX3) ; + f[DIR_000] += 0.0 ; + f[DIR_P00] += 3.0*c2o27 * (forcingX1) ; + f[DIR_M00] += 3.0*c2o27 * (-forcingX1) ; + f[DIR_0P0] += 3.0*c2o27 * (forcingX2) ; + f[DIR_0M0] += 3.0*c2o27 * (-forcingX2) ; + f[DIR_00P] += 3.0*c2o27 * (forcingX3) ; + f[DIR_00M] += 3.0*c2o27 * (-forcingX3); + f[DIR_PP0] += 3.0*c1o54 * ( forcingX1+forcingX2 ) ; + f[DIR_MM0 ] += 3.0*c1o54 * (-forcingX1-forcingX2 ) ; + f[DIR_PM0 ] += 3.0*c1o54 * ( forcingX1-forcingX2 ) ; + f[DIR_MP0 ] += 3.0*c1o54 * (-forcingX1+forcingX2 ) ; + f[DIR_P0P ] += 3.0*c1o54 * ( forcingX1 +forcingX3) ; + f[DIR_M0M ] += 3.0*c1o54 * (-forcingX1 -forcingX3) ; + f[DIR_P0M ] += 3.0*c1o54 * ( forcingX1 -forcingX3) ; + f[DIR_M0P ] += 3.0*c1o54 * (-forcingX1 +forcingX3) ; + f[DIR_0PP ] += 3.0*c1o54 * ( forcingX2+forcingX3) ; + f[DIR_0MM ] += 3.0*c1o54 * ( -forcingX2-forcingX3) ; + f[DIR_0PM ] += 3.0*c1o54 * ( forcingX2-forcingX3) ; + f[DIR_0MP ] += 3.0*c1o54 * ( -forcingX2+forcingX3) ; + f[DIR_PPP] += 3.0*c1o216* ( forcingX1+forcingX2+forcingX3) ; + f[DIR_MMM] += 3.0*c1o216* (-forcingX1-forcingX2-forcingX3) ; + f[DIR_PPM] += 3.0*c1o216* ( forcingX1+forcingX2-forcingX3) ; + f[DIR_MMP] += 3.0*c1o216* (-forcingX1-forcingX2+forcingX3) ; + f[DIR_PMP] += 3.0*c1o216* ( forcingX1-forcingX2+forcingX3) ; + f[DIR_MPM] += 3.0*c1o216* (-forcingX1+forcingX2-forcingX3) ; + f[DIR_PMM] += 3.0*c1o216* ( forcingX1-forcingX2-forcingX3) ; + f[DIR_MPP] += 3.0*c1o216* (-forcingX1+forcingX2+forcingX3) ; } ////////////////////////////////////////////////////////////////////////// #ifdef PROOF_CORRECTNESS - LBMReal rho_post = f[REST] + f[E] + f[W] + f[N] + f[S] + f[T] + f[B] + LBMReal rho_post = f[REST] + f[DIR_P00] + 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]; @@ -255,35 +255,35 @@ void LBMKernelETD3Q27BGK::calculate(int /*step*/) ////////////////////////////////////////////////////////////////////////// //write distribution ////////////////////////////////////////////////////////////////////////// - (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f[D3Q27System::INV_E]; - (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f[D3Q27System::INV_N]; - (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f[D3Q27System::INV_T]; - (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f[D3Q27System::INV_NE]; - (*this->localDistributions)(D3Q27System::ET_NW,x1p,x2, x3) = f[D3Q27System::INV_NW]; - (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f[D3Q27System::INV_TE]; - (*this->localDistributions)(D3Q27System::ET_TW,x1p,x2, x3) = f[D3Q27System::INV_TW]; - (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f[D3Q27System::INV_TN]; - (*this->localDistributions)(D3Q27System::ET_TS,x1, x2p,x3) = f[D3Q27System::INV_TS]; - (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f[D3Q27System::INV_TNE]; - (*this->localDistributions)(D3Q27System::ET_TNW,x1p,x2, x3) = f[D3Q27System::INV_TNW]; - (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2p,x3) = f[D3Q27System::INV_TSE]; - (*this->localDistributions)(D3Q27System::ET_TSW,x1p,x2p,x3) = f[D3Q27System::INV_TSW]; + (*this->localDistributions)(D3Q27System::ET_E,x1, x2, x3) = f[D3Q27System::INV_P00]; + (*this->localDistributions)(D3Q27System::ET_N,x1, x2, x3) = f[D3Q27System::INV_0P0]; + (*this->localDistributions)(D3Q27System::ET_T,x1, x2, x3) = f[D3Q27System::INV_00P]; + (*this->localDistributions)(D3Q27System::ET_NE,x1, x2, x3) = f[D3Q27System::INV_PP0]; + (*this->localDistributions)(D3Q27System::ET_NW,x1p,x2, x3) = f[D3Q27System::INV_MP0]; + (*this->localDistributions)(D3Q27System::ET_TE,x1, x2, x3) = f[D3Q27System::INV_P0P]; + (*this->localDistributions)(D3Q27System::ET_TW,x1p,x2, x3) = f[D3Q27System::INV_M0P]; + (*this->localDistributions)(D3Q27System::ET_TN,x1, x2, x3) = f[D3Q27System::INV_0PP]; + (*this->localDistributions)(D3Q27System::ET_TS,x1, x2p,x3) = f[D3Q27System::INV_0MP]; + (*this->localDistributions)(D3Q27System::ET_TNE,x1, x2, x3) = f[D3Q27System::INV_PPP]; + (*this->localDistributions)(D3Q27System::ET_TNW,x1p,x2, x3) = f[D3Q27System::INV_MPP]; + (*this->localDistributions)(D3Q27System::ET_TSE,x1, x2p,x3) = f[D3Q27System::INV_PMP]; + (*this->localDistributions)(D3Q27System::ET_TSW,x1p,x2p,x3) = f[D3Q27System::INV_MMP]; - (*this->nonLocalDistributions)(D3Q27System::ET_W,x1p,x2, x3 ) = f[D3Q27System::INV_W ]; - (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2p,x3 ) = f[D3Q27System::INV_S ]; - (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3p ) = f[D3Q27System::INV_B ]; - (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1p,x2p,x3 ) = f[D3Q27System::INV_SW]; - (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2p,x3 ) = f[D3Q27System::INV_SE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1p,x2, x3p ) = f[D3Q27System::INV_BW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3p ) = f[D3Q27System::INV_BE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2p,x3p ) = f[D3Q27System::INV_BS]; - (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3p ) = f[D3Q27System::INV_BN]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1p,x2p,x3p) = f[D3Q27System::INV_BSW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2p,x3p) = f[D3Q27System::INV_BSE]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1p,x2, x3p) = f[D3Q27System::INV_BNW]; - (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3p) = f[D3Q27System::INV_BNE]; + (*this->nonLocalDistributions)(D3Q27System::ET_W,x1p,x2, x3 ) = f[D3Q27System::INV_M00 ]; + (*this->nonLocalDistributions)(D3Q27System::ET_S,x1, x2p,x3 ) = f[D3Q27System::INV_0M0 ]; + (*this->nonLocalDistributions)(D3Q27System::ET_B,x1, x2, x3p ) = f[D3Q27System::INV_00M ]; + (*this->nonLocalDistributions)(D3Q27System::ET_SW,x1p,x2p,x3 ) = f[D3Q27System::INV_MM0]; + (*this->nonLocalDistributions)(D3Q27System::ET_SE,x1, x2p,x3 ) = f[D3Q27System::INV_PM0]; + (*this->nonLocalDistributions)(D3Q27System::ET_BW,x1p,x2, x3p ) = f[D3Q27System::INV_M0M]; + (*this->nonLocalDistributions)(D3Q27System::ET_BE,x1, x2, x3p ) = f[D3Q27System::INV_P0M]; + (*this->nonLocalDistributions)(D3Q27System::ET_BS,x1, x2p,x3p ) = f[D3Q27System::INV_0MM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BN,x1, x2, x3p ) = f[D3Q27System::INV_0PM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSW,x1p,x2p,x3p) = f[D3Q27System::INV_MMM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BSE,x1, x2p,x3p) = f[D3Q27System::INV_PMM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNW,x1p,x2, x3p) = f[D3Q27System::INV_MPM]; + (*this->nonLocalDistributions)(D3Q27System::ET_BNE,x1, x2, x3p) = f[D3Q27System::INV_PPM]; - (*this->zeroDistributions)(x1,x2,x3) = f[D3Q27System::REST]; + (*this->zeroDistributions)(x1,x2,x3) = f[D3Q27System::DIR_000]; ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/LBM/MultiphaseCumulantLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/MultiphaseCumulantLBMKernel.cpp index 5cfee04e4a26129d0c27bc0d98c70a5ae64c3825..10f1e395d82c55eb32c82e42576c64927626392d 100644 --- a/src/cpu/VirtualFluidsCore/LBM/MultiphaseCumulantLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/MultiphaseCumulantLBMKernel.cpp @@ -235,13 +235,13 @@ void MultiphaseCumulantLBMKernel::calculate(int step) LBMReal dX3_phi = gradX3_phi(); LBMReal denom = sqrt(dX1_phi * dX1_phi + dX2_phi * dX2_phi + dX3_phi * dX3_phi) + 1e-9; - collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[REST] - phiH) / (phiH - phiL); + collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[DIR_000] - phiH) / (phiH - phiL); - LBMReal mu = 2 * beta * phi[REST] * (phi[REST] - 1) * (2 * phi[REST] - 1) - kappa * nabla2_phi(); + LBMReal mu = 2 * beta * phi[DIR_000] * (phi[DIR_000] - 1) * (2 * phi[DIR_000] - 1) - kappa * nabla2_phi(); //----------- Calculating Macroscopic Values ------------- - LBMReal rho = rhoH + rhoToPhi * (phi[REST] - phiH); + LBMReal rho = rhoH + rhoToPhi * (phi[DIR_000] - phiH); if (withForcing) { // muX1 = static_cast<double>(x1-1+ix1*maxX1); @@ -308,41 +308,41 @@ void MultiphaseCumulantLBMKernel::calculate(int step) (DX3[dir]) * (fac1 * dX3_phi + gamma * (mu * dX3_phi + forcingX3)); } - LBMReal gamma = WEIGTH[REST] * (1.0 - 1.5 * (ux2 + uy2 + uz2)); - LBMReal fac1 = (gamma - WEIGTH[REST]) * c1o3 * rhoToPhi; - forcingTerm[REST] = (-ux) * (fac1 * dX1_phi + gamma * (mu * dX1_phi + forcingX1)) + + LBMReal gamma = WEIGTH[DIR_000] * (1.0 - 1.5 * (ux2 + uy2 + uz2)); + LBMReal fac1 = (gamma - WEIGTH[DIR_000]) * c1o3 * rhoToPhi; + forcingTerm[DIR_000] = (-ux) * (fac1 * dX1_phi + gamma * (mu * dX1_phi + forcingX1)) + (-uy) * (fac1 * dX2_phi + gamma * (mu * dX2_phi + forcingX2)) + (-uz) * (fac1 * dX3_phi + gamma * (mu * dX3_phi + forcingX3)); //-------------------------------------------------------- - mfcbb = 3.0 * (mfcbb + 0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; - mfbcb = 3.0 * (mfbcb + 0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; - mfbbc = 3.0 * (mfbbc + 0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; - mfccb = 3.0 * (mfccb + 0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; - mfacb = 3.0 * (mfacb + 0.5 * forcingTerm[NW]) / rho; //-(3.0*p1 - rho)*WEIGTH[NW ]; - mfcbc = 3.0 * (mfcbc + 0.5 * forcingTerm[TE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TE ]; - mfabc = 3.0 * (mfabc + 0.5 * forcingTerm[TW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TW ]; - mfbcc = 3.0 * (mfbcc + 0.5 * forcingTerm[TN]) / rho; //-(3.0*p1 - rho)*WEIGTH[TN ]; - mfbac = 3.0 * (mfbac + 0.5 * forcingTerm[TS]) / rho; //-(3.0*p1 - rho)*WEIGTH[TS ]; - mfccc = 3.0 * (mfccc + 0.5 * forcingTerm[TNE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNE]; - mfacc = 3.0 * (mfacc + 0.5 * forcingTerm[TNW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNW]; - mfcac = 3.0 * (mfcac + 0.5 * forcingTerm[TSE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSE]; - mfaac = 3.0 * (mfaac + 0.5 * forcingTerm[TSW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSW]; - mfabb = 3.0 * (mfabb + 0.5 * forcingTerm[W]) / rho; //-(3.0*p1 - rho)*WEIGTH[W ]; - mfbab = 3.0 * (mfbab + 0.5 * forcingTerm[S]) / rho; //-(3.0*p1 - rho)*WEIGTH[S ]; - mfbba = 3.0 * (mfbba + 0.5 * forcingTerm[B]) / rho; //-(3.0*p1 - rho)*WEIGTH[B ]; - mfaab = 3.0 * (mfaab + 0.5 * forcingTerm[SW]) / rho; //-(3.0*p1 - rho)*WEIGTH[SW ]; - mfcab = 3.0 * (mfcab + 0.5 * forcingTerm[SE]) / rho; //-(3.0*p1 - rho)*WEIGTH[SE ]; - mfaba = 3.0 * (mfaba + 0.5 * forcingTerm[BW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BW ]; - mfcba = 3.0 * (mfcba + 0.5 * forcingTerm[BE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BE ]; - mfbaa = 3.0 * (mfbaa + 0.5 * forcingTerm[BS]) / rho; //-(3.0*p1 - rho)*WEIGTH[BS ]; - mfbca = 3.0 * (mfbca + 0.5 * forcingTerm[BN]) / rho; //-(3.0*p1 - rho)*WEIGTH[BN ]; - mfaaa = 3.0 * (mfaaa + 0.5 * forcingTerm[BSW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSW]; - mfcaa = 3.0 * (mfcaa + 0.5 * forcingTerm[BSE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSE]; - mfaca = 3.0 * (mfaca + 0.5 * forcingTerm[BNW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNW]; - mfcca = 3.0 * (mfcca + 0.5 * forcingTerm[BNE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNE]; - mfbbb = 3.0 * (mfbbb + 0.5 * forcingTerm[REST]) / rho; //- (3.0*p1 - rho)*WEIGTH[REST]; + mfcbb = 3.0 * (mfcbb + 0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; + mfbcb = 3.0 * (mfbcb + 0.5 * forcingTerm[DIR_0P0]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; + mfbbc = 3.0 * (mfbbc + 0.5 * forcingTerm[DIR_00P]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; + mfccb = 3.0 * (mfccb + 0.5 * forcingTerm[DIR_PP0]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; + mfacb = 3.0 * (mfacb + 0.5 * forcingTerm[DIR_MP0]) / rho; //-(3.0*p1 - rho)*WEIGTH[NW ]; + mfcbc = 3.0 * (mfcbc + 0.5 * forcingTerm[DIR_P0P]) / rho; //-(3.0*p1 - rho)*WEIGTH[TE ]; + mfabc = 3.0 * (mfabc + 0.5 * forcingTerm[DIR_M0P]) / rho; //-(3.0*p1 - rho)*WEIGTH[TW ]; + mfbcc = 3.0 * (mfbcc + 0.5 * forcingTerm[DIR_0PP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TN ]; + mfbac = 3.0 * (mfbac + 0.5 * forcingTerm[DIR_0MP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TS ]; + mfccc = 3.0 * (mfccc + 0.5 * forcingTerm[DIR_PPP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNE]; + mfacc = 3.0 * (mfacc + 0.5 * forcingTerm[DIR_MPP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNW]; + mfcac = 3.0 * (mfcac + 0.5 * forcingTerm[DIR_PMP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSE]; + mfaac = 3.0 * (mfaac + 0.5 * forcingTerm[DIR_MMP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSW]; + mfabb = 3.0 * (mfabb + 0.5 * forcingTerm[DIR_M00]) / rho; //-(3.0*p1 - rho)*WEIGTH[W ]; + mfbab = 3.0 * (mfbab + 0.5 * forcingTerm[DIR_0M0]) / rho; //-(3.0*p1 - rho)*WEIGTH[S ]; + mfbba = 3.0 * (mfbba + 0.5 * forcingTerm[DIR_00M]) / rho; //-(3.0*p1 - rho)*WEIGTH[B ]; + mfaab = 3.0 * (mfaab + 0.5 * forcingTerm[DIR_MM0]) / rho; //-(3.0*p1 - rho)*WEIGTH[SW ]; + mfcab = 3.0 * (mfcab + 0.5 * forcingTerm[DIR_PM0]) / rho; //-(3.0*p1 - rho)*WEIGTH[SE ]; + mfaba = 3.0 * (mfaba + 0.5 * forcingTerm[DIR_M0M]) / rho; //-(3.0*p1 - rho)*WEIGTH[BW ]; + mfcba = 3.0 * (mfcba + 0.5 * forcingTerm[DIR_P0M]) / rho; //-(3.0*p1 - rho)*WEIGTH[BE ]; + mfbaa = 3.0 * (mfbaa + 0.5 * forcingTerm[DIR_0MM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BS ]; + mfbca = 3.0 * (mfbca + 0.5 * forcingTerm[DIR_0PM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BN ]; + mfaaa = 3.0 * (mfaaa + 0.5 * forcingTerm[DIR_MMM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSW]; + mfcaa = 3.0 * (mfcaa + 0.5 * forcingTerm[DIR_PMM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSE]; + mfaca = 3.0 * (mfaca + 0.5 * forcingTerm[DIR_MPM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNW]; + mfcca = 3.0 * (mfcca + 0.5 * forcingTerm[DIR_PPM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNE]; + mfbbb = 3.0 * (mfbbb + 0.5 * forcingTerm[DIR_000]) / rho; //- (3.0*p1 - rho)*WEIGTH[REST]; LBMReal rho1 = (mfaaa + mfaac + mfaca + mfcaa + mfacc + mfcac + mfccc + mfcca) + (mfaab + mfacb + mfcab + mfccb) + (mfaba + mfabc + mfcba + mfcbc) + @@ -1024,33 +1024,33 @@ void MultiphaseCumulantLBMKernel::calculate(int step) } #endif - mfcbb = rho * c1o3 * (mfcbb) + 0.5 * forcingTerm[E]; - mfbcb = rho * c1o3 * (mfbcb) + 0.5 * forcingTerm[N]; - mfbbc = rho * c1o3 * (mfbbc) + 0.5 * forcingTerm[T]; - mfccb = rho * c1o3 * (mfccb) + 0.5 * forcingTerm[NE]; - mfacb = rho * c1o3 * (mfacb) + 0.5 * forcingTerm[NW]; - mfcbc = rho * c1o3 * (mfcbc) + 0.5 * forcingTerm[TE]; - mfabc = rho * c1o3 * (mfabc) + 0.5 * forcingTerm[TW]; - mfbcc = rho * c1o3 * (mfbcc) + 0.5 * forcingTerm[TN]; - mfbac = rho * c1o3 * (mfbac) + 0.5 * forcingTerm[TS]; - mfccc = rho * c1o3 * (mfccc) + 0.5 * forcingTerm[TNE]; - mfacc = rho * c1o3 * (mfacc) + 0.5 * forcingTerm[TNW]; - mfcac = rho * c1o3 * (mfcac) + 0.5 * forcingTerm[TSE]; - mfaac = rho * c1o3 * (mfaac) + 0.5 * forcingTerm[TSW]; - mfabb = rho * c1o3 * (mfabb) + 0.5 * forcingTerm[W]; - mfbab = rho * c1o3 * (mfbab) + 0.5 * forcingTerm[S]; - mfbba = rho * c1o3 * (mfbba) + 0.5 * forcingTerm[B]; - mfaab = rho * c1o3 * (mfaab) + 0.5 * forcingTerm[SW]; - mfcab = rho * c1o3 * (mfcab) + 0.5 * forcingTerm[SE]; - mfaba = rho * c1o3 * (mfaba) + 0.5 * forcingTerm[BW]; - mfcba = rho * c1o3 * (mfcba) + 0.5 * forcingTerm[BE]; - mfbaa = rho * c1o3 * (mfbaa) + 0.5 * forcingTerm[BS]; - mfbca = rho * c1o3 * (mfbca) + 0.5 * forcingTerm[BN]; - mfaaa = rho * c1o3 * (mfaaa) + 0.5 * forcingTerm[BSW]; - mfcaa = rho * c1o3 * (mfcaa) + 0.5 * forcingTerm[BSE]; - mfaca = rho * c1o3 * (mfaca) + 0.5 * forcingTerm[BNW]; - mfcca = rho * c1o3 * (mfcca) + 0.5 * forcingTerm[BNE]; - mfbbb = rho * c1o3 * (mfbbb) + 0.5 * forcingTerm[REST]; + mfcbb = rho * c1o3 * (mfcbb) + 0.5 * forcingTerm[DIR_P00]; + mfbcb = rho * c1o3 * (mfbcb) + 0.5 * forcingTerm[DIR_0P0]; + mfbbc = rho * c1o3 * (mfbbc) + 0.5 * forcingTerm[DIR_00P]; + mfccb = rho * c1o3 * (mfccb) + 0.5 * forcingTerm[DIR_PP0]; + mfacb = rho * c1o3 * (mfacb) + 0.5 * forcingTerm[DIR_MP0]; + mfcbc = rho * c1o3 * (mfcbc) + 0.5 * forcingTerm[DIR_P0P]; + mfabc = rho * c1o3 * (mfabc) + 0.5 * forcingTerm[DIR_M0P]; + mfbcc = rho * c1o3 * (mfbcc) + 0.5 * forcingTerm[DIR_0PP]; + mfbac = rho * c1o3 * (mfbac) + 0.5 * forcingTerm[DIR_0MP]; + mfccc = rho * c1o3 * (mfccc) + 0.5 * forcingTerm[DIR_PPP]; + mfacc = rho * c1o3 * (mfacc) + 0.5 * forcingTerm[DIR_MPP]; + mfcac = rho * c1o3 * (mfcac) + 0.5 * forcingTerm[DIR_PMP]; + mfaac = rho * c1o3 * (mfaac) + 0.5 * forcingTerm[DIR_MMP]; + mfabb = rho * c1o3 * (mfabb) + 0.5 * forcingTerm[DIR_M00]; + mfbab = rho * c1o3 * (mfbab) + 0.5 * forcingTerm[DIR_0M0]; + mfbba = rho * c1o3 * (mfbba) + 0.5 * forcingTerm[DIR_00M]; + mfaab = rho * c1o3 * (mfaab) + 0.5 * forcingTerm[DIR_MM0]; + mfcab = rho * c1o3 * (mfcab) + 0.5 * forcingTerm[DIR_PM0]; + mfaba = rho * c1o3 * (mfaba) + 0.5 * forcingTerm[DIR_M0M]; + mfcba = rho * c1o3 * (mfcba) + 0.5 * forcingTerm[DIR_P0M]; + mfbaa = rho * c1o3 * (mfbaa) + 0.5 * forcingTerm[DIR_0MM]; + mfbca = rho * c1o3 * (mfbca) + 0.5 * forcingTerm[DIR_0PM]; + mfaaa = rho * c1o3 * (mfaaa) + 0.5 * forcingTerm[DIR_MMM]; + mfcaa = rho * c1o3 * (mfcaa) + 0.5 * forcingTerm[DIR_PMM]; + mfaca = rho * c1o3 * (mfaca) + 0.5 * forcingTerm[DIR_MPM]; + mfcca = rho * c1o3 * (mfcca) + 0.5 * forcingTerm[DIR_PPM]; + mfbbb = rho * c1o3 * (mfbbb) + 0.5 * forcingTerm[DIR_000]; ////////////////////////////////////////////////////////////////////////// // write distribution for F @@ -1091,84 +1091,84 @@ void MultiphaseCumulantLBMKernel::calculate(int step) ///////////////////// PHASE-FIELD BGK SOLVER /////////////////////////////// - h[E] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); - h[N] = (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3); - h[T] = (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3); - h[NE] = (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3); - h[NW] = (*this->localDistributionsH)(D3Q27System::ET_NW, x1p, x2, x3); - h[TE] = (*this->localDistributionsH)(D3Q27System::ET_TE, x1, x2, x3); - h[TW] = (*this->localDistributionsH)(D3Q27System::ET_TW, x1p, x2, x3); - h[TN] = (*this->localDistributionsH)(D3Q27System::ET_TN, x1, x2, x3); - h[TS] = (*this->localDistributionsH)(D3Q27System::ET_TS, x1, x2p, x3); - h[TNE] = (*this->localDistributionsH)(D3Q27System::ET_TNE, x1, x2, x3); - h[TNW] = (*this->localDistributionsH)(D3Q27System::ET_TNW, x1p, x2, x3); - h[TSE] = (*this->localDistributionsH)(D3Q27System::ET_TSE, x1, x2p, x3); - h[TSW] = (*this->localDistributionsH)(D3Q27System::ET_TSW, x1p, x2p, x3); - - h[W] = (*this->nonLocalDistributionsH)(D3Q27System::ET_W, x1p, x2, x3); - h[S] = (*this->nonLocalDistributionsH)(D3Q27System::ET_S, x1, x2p, x3); - h[B] = (*this->nonLocalDistributionsH)(D3Q27System::ET_B, x1, x2, x3p); - h[SW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SW, x1p, x2p, x3); - h[SE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SE, x1, x2p, x3); - h[BW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BW, x1p, x2, x3p); - h[BE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BE, x1, x2, x3p); - h[BS] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BS, x1, x2p, x3p); - h[BN] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BN, x1, x2, x3p); - h[BSW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSW, x1p, x2p, x3p); - h[BSE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSE, x1, x2p, x3p); - h[BNW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNW, x1p, x2, x3p); - h[BNE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNE, x1, x2, x3p); - - h[REST] = (*this->zeroDistributionsH)(x1, x2, x3); + h[DIR_P00] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); + h[DIR_0P0] = (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3); + h[DIR_00P] = (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3); + h[DIR_PP0] = (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3); + h[DIR_MP0] = (*this->localDistributionsH)(D3Q27System::ET_NW, x1p, x2, x3); + h[DIR_P0P] = (*this->localDistributionsH)(D3Q27System::ET_TE, x1, x2, x3); + h[DIR_M0P] = (*this->localDistributionsH)(D3Q27System::ET_TW, x1p, x2, x3); + h[DIR_0PP] = (*this->localDistributionsH)(D3Q27System::ET_TN, x1, x2, x3); + h[DIR_0MP] = (*this->localDistributionsH)(D3Q27System::ET_TS, x1, x2p, x3); + h[DIR_PPP] = (*this->localDistributionsH)(D3Q27System::ET_TNE, x1, x2, x3); + h[DIR_MPP] = (*this->localDistributionsH)(D3Q27System::ET_TNW, x1p, x2, x3); + h[DIR_PMP] = (*this->localDistributionsH)(D3Q27System::ET_TSE, x1, x2p, x3); + h[DIR_MMP] = (*this->localDistributionsH)(D3Q27System::ET_TSW, x1p, x2p, x3); + + h[DIR_M00] = (*this->nonLocalDistributionsH)(D3Q27System::ET_W, x1p, x2, x3); + h[DIR_0M0] = (*this->nonLocalDistributionsH)(D3Q27System::ET_S, x1, x2p, x3); + h[DIR_00M] = (*this->nonLocalDistributionsH)(D3Q27System::ET_B, x1, x2, x3p); + h[DIR_MM0] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SW, x1p, x2p, x3); + h[DIR_PM0] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SE, x1, x2p, x3); + h[DIR_M0M] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BW, x1p, x2, x3p); + h[DIR_P0M] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BE, x1, x2, x3p); + h[DIR_0MM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BS, x1, x2p, x3p); + h[DIR_0PM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BN, x1, x2, x3p); + h[DIR_MMM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSW, x1p, x2p, x3p); + h[DIR_PMM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSE, x1, x2p, x3p); + h[DIR_MPM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNW, x1p, x2, x3p); + h[DIR_PPM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNE, x1, x2, x3p); + + h[DIR_000] = (*this->zeroDistributionsH)(x1, x2, x3); for (int dir = STARTF; dir < (ENDF + 1); dir++) { LBMReal velProd = DX1[dir] * ux + DX2[dir] * uy + DX3[dir] * uz; LBMReal velSq1 = velProd * velProd; LBMReal hEq; //, gEq; - if (dir != REST) { + if (dir != DIR_000) { LBMReal dirGrad_phi = (phi[dir] - phi[INVDIR[dir]]) / 2.0; - LBMReal hSource = (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST]) * (dirGrad_phi) / denom; - hEq = phi[REST] * WEIGTH[dir] * (1.0 + 3.0 * velProd + 4.5 * velSq1 - 1.5 * (ux2 + uy2 + uz2)) + hSource * WEIGTH[dir]; + LBMReal hSource = (tauH - 0.5) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * (dirGrad_phi) / denom; + hEq = phi[DIR_000] * WEIGTH[dir] * (1.0 + 3.0 * velProd + 4.5 * velSq1 - 1.5 * (ux2 + uy2 + uz2)) + hSource * WEIGTH[dir]; // This corresponds with the collision factor of 1.0 which equals (tauH + 0.5). h[dir] = h[dir] - (h[dir] - hEq) / (tauH); } else { - hEq = phi[REST] * WEIGTH[REST] * (1.0 - 1.5 * (ux2 + uy2 + uz2)); - h[REST] = h[REST] - (h[REST] - hEq) / (tauH); + hEq = phi[DIR_000] * WEIGTH[DIR_000] * (1.0 - 1.5 * (ux2 + uy2 + uz2)); + h[DIR_000] = h[DIR_000] - (h[DIR_000] - hEq) / (tauH); } } - (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3) = h[D3Q27System::INV_E]; - (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3) = h[D3Q27System::INV_N]; - (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3) = h[D3Q27System::INV_T]; - (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3) = h[D3Q27System::INV_NE]; - (*this->localDistributionsH)(D3Q27System::ET_NW, x1p, x2, x3) = h[D3Q27System::INV_NW]; - (*this->localDistributionsH)(D3Q27System::ET_TE, x1, x2, x3) = h[D3Q27System::INV_TE]; - (*this->localDistributionsH)(D3Q27System::ET_TW, x1p, x2, x3) = h[D3Q27System::INV_TW]; - (*this->localDistributionsH)(D3Q27System::ET_TN, x1, x2, x3) = h[D3Q27System::INV_TN]; - (*this->localDistributionsH)(D3Q27System::ET_TS, x1, x2p, x3) = h[D3Q27System::INV_TS]; - (*this->localDistributionsH)(D3Q27System::ET_TNE, x1, x2, x3) = h[D3Q27System::INV_TNE]; - (*this->localDistributionsH)(D3Q27System::ET_TNW, x1p, x2, x3) = h[D3Q27System::INV_TNW]; - (*this->localDistributionsH)(D3Q27System::ET_TSE, x1, x2p, x3) = h[D3Q27System::INV_TSE]; - (*this->localDistributionsH)(D3Q27System::ET_TSW, x1p, x2p, x3) = h[D3Q27System::INV_TSW]; - - (*this->nonLocalDistributionsH)(D3Q27System::ET_W, x1p, x2, x3) = h[D3Q27System::INV_W]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_S, x1, x2p, x3) = h[D3Q27System::INV_S]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_B, x1, x2, x3p) = h[D3Q27System::INV_B]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_SW, x1p, x2p, x3) = h[D3Q27System::INV_SW]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_SE, x1, x2p, x3) = h[D3Q27System::INV_SE]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_BW, x1p, x2, x3p) = h[D3Q27System::INV_BW]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_BE, x1, x2, x3p) = h[D3Q27System::INV_BE]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_BS, x1, x2p, x3p) = h[D3Q27System::INV_BS]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_BN, x1, x2, x3p) = h[D3Q27System::INV_BN]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_BSW, x1p, x2p, x3p) = h[D3Q27System::INV_BSW]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_BSE, x1, x2p, x3p) = h[D3Q27System::INV_BSE]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_BNW, x1p, x2, x3p) = h[D3Q27System::INV_BNW]; - (*this->nonLocalDistributionsH)(D3Q27System::ET_BNE, x1, x2, x3p) = h[D3Q27System::INV_BNE]; - - (*this->zeroDistributionsH)(x1, x2, x3) = h[D3Q27System::REST]; + (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3) = h[D3Q27System::INV_P00]; + (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3) = h[D3Q27System::INV_0P0]; + (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3) = h[D3Q27System::INV_00P]; + (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3) = h[D3Q27System::INV_PP0]; + (*this->localDistributionsH)(D3Q27System::ET_NW, x1p, x2, x3) = h[D3Q27System::INV_MP0]; + (*this->localDistributionsH)(D3Q27System::ET_TE, x1, x2, x3) = h[D3Q27System::INV_P0P]; + (*this->localDistributionsH)(D3Q27System::ET_TW, x1p, x2, x3) = h[D3Q27System::INV_M0P]; + (*this->localDistributionsH)(D3Q27System::ET_TN, x1, x2, x3) = h[D3Q27System::INV_0PP]; + (*this->localDistributionsH)(D3Q27System::ET_TS, x1, x2p, x3) = h[D3Q27System::INV_0MP]; + (*this->localDistributionsH)(D3Q27System::ET_TNE, x1, x2, x3) = h[D3Q27System::INV_PPP]; + (*this->localDistributionsH)(D3Q27System::ET_TNW, x1p, x2, x3) = h[D3Q27System::INV_MPP]; + (*this->localDistributionsH)(D3Q27System::ET_TSE, x1, x2p, x3) = h[D3Q27System::INV_PMP]; + (*this->localDistributionsH)(D3Q27System::ET_TSW, x1p, x2p, x3) = h[D3Q27System::INV_MMP]; + + (*this->nonLocalDistributionsH)(D3Q27System::ET_W, x1p, x2, x3) = h[D3Q27System::INV_M00]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_S, x1, x2p, x3) = h[D3Q27System::INV_0M0]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_B, x1, x2, x3p) = h[D3Q27System::INV_00M]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_SW, x1p, x2p, x3) = h[D3Q27System::INV_MM0]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_SE, x1, x2p, x3) = h[D3Q27System::INV_PM0]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_BW, x1p, x2, x3p) = h[D3Q27System::INV_M0M]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_BE, x1, x2, x3p) = h[D3Q27System::INV_P0M]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_BS, x1, x2p, x3p) = h[D3Q27System::INV_0MM]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_BN, x1, x2, x3p) = h[D3Q27System::INV_0PM]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_BSW, x1p, x2p, x3p) = h[D3Q27System::INV_MMM]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_BSE, x1, x2p, x3p) = h[D3Q27System::INV_PMM]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_BNW, x1p, x2, x3p) = h[D3Q27System::INV_MPM]; + (*this->nonLocalDistributionsH)(D3Q27System::ET_BNE, x1, x2, x3p) = h[D3Q27System::INV_PPM]; + + (*this->zeroDistributionsH)(x1, x2, x3) = h[D3Q27System::DIR_000]; ///////////////////// END OF OLD BGK SOLVER /////////////////////////////// } @@ -1215,7 +1215,7 @@ LBMReal MultiphaseCumulantLBMKernel::nabla2_phi() using namespace D3Q27System; LBMReal sum = 0.0; for (int k = FSTARTDIR; k <= FENDDIR; k++) { - sum += WEIGTH[k] * (phi[k] - phi[REST]); + sum += WEIGTH[k] * (phi[k] - phi[DIR_000]); } return 6.0 * sum; } @@ -1242,35 +1242,35 @@ void MultiphaseCumulantLBMKernel::computePhasefield() int x2p = x2 + 1; int x3p = x3 + 1; - h[E] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); - h[N] = (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3); - h[T] = (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3); - h[NE] = (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3); - h[NW] = (*this->localDistributionsH)(D3Q27System::ET_NW, x1p, x2, x3); - h[TE] = (*this->localDistributionsH)(D3Q27System::ET_TE, x1, x2, x3); - h[TW] = (*this->localDistributionsH)(D3Q27System::ET_TW, x1p, x2, x3); - h[TN] = (*this->localDistributionsH)(D3Q27System::ET_TN, x1, x2, x3); - h[TS] = (*this->localDistributionsH)(D3Q27System::ET_TS, x1, x2p, x3); - h[TNE] = (*this->localDistributionsH)(D3Q27System::ET_TNE, x1, x2, x3); - h[TNW] = (*this->localDistributionsH)(D3Q27System::ET_TNW, x1p, x2, x3); - h[TSE] = (*this->localDistributionsH)(D3Q27System::ET_TSE, x1, x2p, x3); - h[TSW] = (*this->localDistributionsH)(D3Q27System::ET_TSW, x1p, x2p, x3); - - h[W] = (*this->nonLocalDistributionsH)(D3Q27System::ET_W, x1p, x2, x3); - h[S] = (*this->nonLocalDistributionsH)(D3Q27System::ET_S, x1, x2p, x3); - h[B] = (*this->nonLocalDistributionsH)(D3Q27System::ET_B, x1, x2, x3p); - h[SW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SW, x1p, x2p, x3); - h[SE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SE, x1, x2p, x3); - h[BW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BW, x1p, x2, x3p); - h[BE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BE, x1, x2, x3p); - h[BS] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BS, x1, x2p, x3p); - h[BN] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BN, x1, x2, x3p); - h[BSW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSW, x1p, x2p, x3p); - h[BSE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSE, x1, x2p, x3p); - h[BNW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNW, x1p, x2, x3p); - h[BNE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNE, x1, x2, x3p); - - h[REST] = (*this->zeroDistributionsH)(x1, x2, x3); + h[DIR_P00] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); + h[DIR_0P0] = (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3); + h[DIR_00P] = (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3); + h[DIR_PP0] = (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3); + h[DIR_MP0] = (*this->localDistributionsH)(D3Q27System::ET_NW, x1p, x2, x3); + h[DIR_P0P] = (*this->localDistributionsH)(D3Q27System::ET_TE, x1, x2, x3); + h[DIR_M0P] = (*this->localDistributionsH)(D3Q27System::ET_TW, x1p, x2, x3); + h[DIR_0PP] = (*this->localDistributionsH)(D3Q27System::ET_TN, x1, x2, x3); + h[DIR_0MP] = (*this->localDistributionsH)(D3Q27System::ET_TS, x1, x2p, x3); + h[DIR_PPP] = (*this->localDistributionsH)(D3Q27System::ET_TNE, x1, x2, x3); + h[DIR_MPP] = (*this->localDistributionsH)(D3Q27System::ET_TNW, x1p, x2, x3); + h[DIR_PMP] = (*this->localDistributionsH)(D3Q27System::ET_TSE, x1, x2p, x3); + h[DIR_MMP] = (*this->localDistributionsH)(D3Q27System::ET_TSW, x1p, x2p, x3); + + h[DIR_M00] = (*this->nonLocalDistributionsH)(D3Q27System::ET_W, x1p, x2, x3); + h[DIR_0M0] = (*this->nonLocalDistributionsH)(D3Q27System::ET_S, x1, x2p, x3); + h[DIR_00M] = (*this->nonLocalDistributionsH)(D3Q27System::ET_B, x1, x2, x3p); + h[DIR_MM0] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SW, x1p, x2p, x3); + h[DIR_PM0] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SE, x1, x2p, x3); + h[DIR_M0M] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BW, x1p, x2, x3p); + h[DIR_P0M] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BE, x1, x2, x3p); + h[DIR_0MM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BS, x1, x2p, x3p); + h[DIR_0PM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BN, x1, x2, x3p); + h[DIR_MMM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSW, x1p, x2p, x3p); + h[DIR_PMM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSE, x1, x2p, x3p); + h[DIR_MPM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNW, x1p, x2, x3p); + h[DIR_PPM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNE, x1, x2, x3p); + + h[DIR_000] = (*this->zeroDistributionsH)(x1, x2, x3); } } } @@ -1284,7 +1284,7 @@ void MultiphaseCumulantLBMKernel::findNeighbors(CbArray3D<LBMReal, IndexerX3X2X1 SPtr<BCArray3D> bcArray = this->getBCProcessor()->getBCArray(); - phi[REST] = (*ph)(x1, x2, x3); + phi[DIR_000] = (*ph)(x1, x2, x3); for (int k = FSTARTDIR; k <= FENDDIR; k++) { diff --git a/src/cpu/VirtualFluidsCore/LBM/MultiphasePressureFilterCompressibleAirLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/MultiphasePressureFilterCompressibleAirLBMKernel.cpp index 01fb23625afbf4700c337cf6ee7194a46f0bc895..bd4df8aea33d26b3db75af3e00df564b7ded3efe 100644 --- a/src/cpu/VirtualFluidsCore/LBM/MultiphasePressureFilterCompressibleAirLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/MultiphasePressureFilterCompressibleAirLBMKernel.cpp @@ -383,13 +383,13 @@ void MultiphasePressureFilterCompressibleAirLBMKernel::calculate(int step) - collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[REST] - phiH) / (phiH - phiL); + collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[DIR_000] - phiH) / (phiH - phiL); - LBMReal mu = 2 * beta * phi[REST] * (phi[REST] - 1) * (2 * phi[REST] - 1) - kappa * nabla2_phi(); + LBMReal mu = 2 * beta * phi[DIR_000] * (phi[DIR_000] - 1) * (2 * phi[DIR_000] - 1) - kappa * nabla2_phi(); //----------- Calculating Macroscopic Values ------------- - LBMReal rho = rhoH + rhoToPhi * (phi[REST] - phiH); //Incompressible + LBMReal rho = rhoH + rhoToPhi * (phi[DIR_000] - phiH); //Incompressible //LBMReal rho = rhoL + (rhoH - rhoL) * phi[REST] + (one - phi[REST]) * (*pressure)(x1, x2, x3) * three; //compressible LBMReal m0, m1, m2; @@ -457,7 +457,7 @@ void MultiphasePressureFilterCompressibleAirLBMKernel::calculate(int step) } //Viscosity increase by pressure gradient - LBMReal errPhi = (((1.0 - phi[REST]) * (phi[REST]) * oneOverInterfaceScale)- denom); + LBMReal errPhi = (((1.0 - phi[DIR_000]) * (phi[DIR_000]) * oneOverInterfaceScale)- denom); //LBMReal limVis = 0.0000001*10;//0.01; // collFactorM =collFactorM/(c1+limVis*(errPhi*errPhi)*collFactorM); // collFactorM = (collFactorM < 1.8) ? 1.8 : collFactorM; @@ -767,7 +767,7 @@ void MultiphasePressureFilterCompressibleAirLBMKernel::calculate(int step) LBMReal OxyyMxzz = 8.0 * (collFactorM - 2.0) * (collFactorM + OxxPyyPzz * (3.0 * collFactorM - 7.0)) / (OxxPyyPzz * (56.0 - 42.0 * collFactorM + 9.0 * collFactorM * collFactorM) - 8.0 * collFactorM); // LBMReal Oxyz = 24.0 * (collFactorM - 2.0) * (4.0 * collFactorM * collFactorM + collFactorM * OxxPyyPzz * (18.0 - 13.0 * collFactorM) + OxxPyyPzz * OxxPyyPzz * (2.0 + collFactorM * (6.0 * collFactorM - 11.0))) / (16.0 * collFactorM * collFactorM * (collFactorM - 6.0) - 2.0 * collFactorM * OxxPyyPzz * (216.0 + 5.0 * collFactorM * (9.0 * collFactorM - 46.0)) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (3.0 * collFactorM - 10.0) * (15.0 * collFactorM - 28.0) - 48.0)); LBMReal A = (4.0 * collFactorM * collFactorM + 2.0 * collFactorM * OxxPyyPzz * (collFactorM - 6.0) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (10.0 - 3.0 * collFactorM) - 4.0)) / ((collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); - //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::B' ) + //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::DIR_00M' ) LBMReal BB = (4.0 * collFactorM * OxxPyyPzz * (9.0 * collFactorM - 16.0) - 4.0 * collFactorM * collFactorM - 2.0 * OxxPyyPzz * OxxPyyPzz * (2.0 + 9.0 * collFactorM * (collFactorM - 2.0))) / (3.0 * (collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); @@ -1333,11 +1333,11 @@ void MultiphasePressureFilterCompressibleAirLBMKernel::calculate(int step) // collision of 1st order moments cx = cx * (c1 - omegaD) + omegaD * vvx * concentration + - normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cy = cy * (c1 - omegaD) + omegaD * vvy * concentration + - normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cz = cz * (c1 - omegaD) + omegaD * vvz * concentration + - normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cx2 = cx * cx; cy2 = cy * cy; @@ -1475,66 +1475,66 @@ void MultiphasePressureFilterCompressibleAirLBMKernel::calculate(int step) LBMReal MultiphasePressureFilterCompressibleAirLBMKernel::gradX1_phi() { using namespace D3Q27System; - return 3.0* ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) + (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) + (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) + (phi[BE] - phi[TW])) + ((phi[SE] - phi[NW]) + (phi[NE] - phi[SW])))) + - +WEIGTH[N] * (phi[E] - phi[W])); + return 3.0* ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) + (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) + (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) + (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_PM0] - phi[DIR_MP0]) + (phi[DIR_PP0] - phi[DIR_MM0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_P00] - phi[DIR_M00])); } LBMReal MultiphasePressureFilterCompressibleAirLBMKernel::gradX2_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[BNE] - phi[TSW])- (phi[TSE] - phi[BNW]))) - + WEIGTH[NE] * (((phi[TN] - phi[BS]) + (phi[BN] - phi[TS])) + ((phi[NE] - phi[SW])- (phi[SE] - phi[NW])))) + - +WEIGTH[N] * (phi[N] - phi[S])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PPM] - phi[DIR_MMP])- (phi[DIR_PMP] - phi[DIR_MPM]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_0PP] - phi[DIR_0MM]) + (phi[DIR_0PM] - phi[DIR_0MP])) + ((phi[DIR_PP0] - phi[DIR_MM0])- (phi[DIR_PM0] - phi[DIR_MP0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_0P0] - phi[DIR_0M0])); } LBMReal MultiphasePressureFilterCompressibleAirLBMKernel::gradX3_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) - (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) - (phi[BE] - phi[TW])) + ((phi[TS] - phi[BN]) + (phi[TN] - phi[BS])))) + - +WEIGTH[N] * (phi[T] - phi[B])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) - (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) - (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_0MP] - phi[DIR_0PM]) + (phi[DIR_0PP] - phi[DIR_0MM])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_00P] - phi[DIR_00M])); } LBMReal MultiphasePressureFilterCompressibleAirLBMKernel::gradX1_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) + (phi2[BSE] - phi2[TNW])) + ((phi2[TSE] - phi2[BNW]) + (phi2[BNE] - phi2[TSW]))) - + WEIGTH[NE] * (((phi2[TE] - phi2[BW]) + (phi2[BE] - phi2[TW])) + ((phi2[SE] - phi2[NW]) + (phi2[NE] - phi2[SW])))) + - +WEIGTH[N] * (phi2[E] - phi2[W])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) + (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PMP] - phi2[DIR_MPM]) + (phi2[DIR_PPM] - phi2[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_P0P] - phi2[DIR_M0M]) + (phi2[DIR_P0M] - phi2[DIR_M0P])) + ((phi2[DIR_PM0] - phi2[DIR_MP0]) + (phi2[DIR_PP0] - phi2[DIR_MM0])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_P00] - phi2[DIR_M00])); } LBMReal MultiphasePressureFilterCompressibleAirLBMKernel::gradX2_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) - (phi2[BSE] - phi2[TNW])) + ((phi2[BNE] - phi2[TSW]) - (phi2[TSE] - phi2[BNW]))) - + WEIGTH[NE] * (((phi2[TN] - phi2[BS]) + (phi2[BN] - phi2[TS])) + ((phi2[NE] - phi2[SW]) - (phi2[SE] - phi2[NW])))) + - +WEIGTH[N] * (phi2[N] - phi2[S])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) - (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PPM] - phi2[DIR_MMP]) - (phi2[DIR_PMP] - phi2[DIR_MPM]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_0PP] - phi2[DIR_0MM]) + (phi2[DIR_0PM] - phi2[DIR_0MP])) + ((phi2[DIR_PP0] - phi2[DIR_MM0]) - (phi2[DIR_PM0] - phi2[DIR_MP0])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_0P0] - phi2[DIR_0M0])); } LBMReal MultiphasePressureFilterCompressibleAirLBMKernel::gradX3_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) - (phi2[BSE] - phi2[TNW])) + ((phi2[TSE] - phi2[BNW]) - (phi2[BNE] - phi2[TSW]))) - + WEIGTH[NE] * (((phi2[TE] - phi2[BW]) - (phi2[BE] - phi2[TW])) + ((phi2[TS] - phi2[BN]) + (phi2[TN] - phi2[BS])))) + - +WEIGTH[N] * (phi2[T] - phi2[B])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) - (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PMP] - phi2[DIR_MPM]) - (phi2[DIR_PPM] - phi2[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_P0P] - phi2[DIR_M0M]) - (phi2[DIR_P0M] - phi2[DIR_M0P])) + ((phi2[DIR_0MP] - phi2[DIR_0PM]) + (phi2[DIR_0PP] - phi2[DIR_0MM])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_00P] - phi2[DIR_00M])); } LBMReal MultiphasePressureFilterCompressibleAirLBMKernel::nabla2_phi() { using namespace D3Q27System; LBMReal sum = 0.0; - sum += WEIGTH[TNE] * ((((phi[TNE] - phi[REST]) + (phi[BSW] - phi[REST])) + ((phi[TSW] - phi[REST]) + (phi[BNE] - phi[REST]))) - + (((phi[TNW] - phi[REST]) + (phi[BSE] - phi[REST])) + ((phi[TSE] - phi[REST]) + (phi[BNW] - phi[REST])))); - sum += WEIGTH[TN] * ( - (((phi[TN] - phi[REST]) + (phi[BS] - phi[REST])) + ((phi[TS] - phi[REST]) + (phi[BN] - phi[REST]))) - + (((phi[TE] - phi[REST]) + (phi[BW] - phi[REST])) + ((phi[TW] - phi[REST]) + (phi[BE] - phi[REST]))) - + (((phi[NE] - phi[REST]) + (phi[SW] - phi[REST])) + ((phi[NW] - phi[REST]) + (phi[SE] - phi[REST]))) + sum += WEIGTH[DIR_PPP] * ((((phi[DIR_PPP] - phi[DIR_000]) + (phi[DIR_MMM] - phi[DIR_000])) + ((phi[DIR_MMP] - phi[DIR_000]) + (phi[DIR_PPM] - phi[DIR_000]))) + + (((phi[DIR_MPP] - phi[DIR_000]) + (phi[DIR_PMM] - phi[DIR_000])) + ((phi[DIR_PMP] - phi[DIR_000]) + (phi[DIR_MPM] - phi[DIR_000])))); + sum += WEIGTH[DIR_0PP] * ( + (((phi[DIR_0PP] - phi[DIR_000]) + (phi[DIR_0MM] - phi[DIR_000])) + ((phi[DIR_0MP] - phi[DIR_000]) + (phi[DIR_0PM] - phi[DIR_000]))) + + (((phi[DIR_P0P] - phi[DIR_000]) + (phi[DIR_M0M] - phi[DIR_000])) + ((phi[DIR_M0P] - phi[DIR_000]) + (phi[DIR_P0M] - phi[DIR_000]))) + + (((phi[DIR_PP0] - phi[DIR_000]) + (phi[DIR_MM0] - phi[DIR_000])) + ((phi[DIR_MP0] - phi[DIR_000]) + (phi[DIR_PM0] - phi[DIR_000]))) ); - sum += WEIGTH[T] * ( - ((phi[T] - phi[REST]) + (phi[B] - phi[REST])) - + ((phi[N] - phi[REST]) + (phi[S] - phi[REST])) - + ((phi[E] - phi[REST]) + (phi[W] - phi[REST])) + sum += WEIGTH[DIR_00P] * ( + ((phi[DIR_00P] - phi[DIR_000]) + (phi[DIR_00M] - phi[DIR_000])) + + ((phi[DIR_0P0] - phi[DIR_000]) + (phi[DIR_0M0] - phi[DIR_000])) + + ((phi[DIR_P00] - phi[DIR_000]) + (phi[DIR_M00] - phi[DIR_000])) ); return 6.0 * sum; @@ -1562,35 +1562,35 @@ void MultiphasePressureFilterCompressibleAirLBMKernel::computePhasefield() int x2p = x2 + 1; int x3p = x3 + 1; - h[E] = (*this->localDistributionsH1)(D3Q27System::ET_E, x1, x2, x3); - h[N] = (*this->localDistributionsH1)(D3Q27System::ET_N, x1, x2, x3); - h[T] = (*this->localDistributionsH1)(D3Q27System::ET_T, x1, x2, x3); - h[NE] = (*this->localDistributionsH1)(D3Q27System::ET_NE, x1, x2, x3); - h[NW] = (*this->localDistributionsH1)(D3Q27System::ET_NW, x1p, x2, x3); - h[TE] = (*this->localDistributionsH1)(D3Q27System::ET_TE, x1, x2, x3); - h[TW] = (*this->localDistributionsH1)(D3Q27System::ET_TW, x1p, x2, x3); - h[TN] = (*this->localDistributionsH1)(D3Q27System::ET_TN, x1, x2, x3); - h[TS] = (*this->localDistributionsH1)(D3Q27System::ET_TS, x1, x2p, x3); - h[TNE] = (*this->localDistributionsH1)(D3Q27System::ET_TNE, x1, x2, x3); - h[TNW] = (*this->localDistributionsH1)(D3Q27System::ET_TNW, x1p, x2, x3); - h[TSE] = (*this->localDistributionsH1)(D3Q27System::ET_TSE, x1, x2p, x3); - h[TSW] = (*this->localDistributionsH1)(D3Q27System::ET_TSW, x1p, x2p, x3); - - h[W] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_W, x1p, x2, x3); - h[S] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_S, x1, x2p, x3); - h[B] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_B, x1, x2, x3p); - h[SW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SW, x1p, x2p, x3); - h[SE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SE, x1, x2p, x3); - h[BW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BW, x1p, x2, x3p); - h[BE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BE, x1, x2, x3p); - h[BS] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BS, x1, x2p, x3p); - h[BN] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BN, x1, x2, x3p); - h[BSW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSW, x1p, x2p, x3p); - h[BSE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSE, x1, x2p, x3p); - h[BNW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNW, x1p, x2, x3p); - h[BNE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNE, x1, x2, x3p); - - h[REST] = (*this->zeroDistributionsH1)(x1, x2, x3); + h[DIR_P00] = (*this->localDistributionsH1)(D3Q27System::ET_E, x1, x2, x3); + h[DIR_0P0] = (*this->localDistributionsH1)(D3Q27System::ET_N, x1, x2, x3); + h[DIR_00P] = (*this->localDistributionsH1)(D3Q27System::ET_T, x1, x2, x3); + h[DIR_PP0] = (*this->localDistributionsH1)(D3Q27System::ET_NE, x1, x2, x3); + h[DIR_MP0] = (*this->localDistributionsH1)(D3Q27System::ET_NW, x1p, x2, x3); + h[DIR_P0P] = (*this->localDistributionsH1)(D3Q27System::ET_TE, x1, x2, x3); + h[DIR_M0P] = (*this->localDistributionsH1)(D3Q27System::ET_TW, x1p, x2, x3); + h[DIR_0PP] = (*this->localDistributionsH1)(D3Q27System::ET_TN, x1, x2, x3); + h[DIR_0MP] = (*this->localDistributionsH1)(D3Q27System::ET_TS, x1, x2p, x3); + h[DIR_PPP] = (*this->localDistributionsH1)(D3Q27System::ET_TNE, x1, x2, x3); + h[DIR_MPP] = (*this->localDistributionsH1)(D3Q27System::ET_TNW, x1p, x2, x3); + h[DIR_PMP] = (*this->localDistributionsH1)(D3Q27System::ET_TSE, x1, x2p, x3); + h[DIR_MMP] = (*this->localDistributionsH1)(D3Q27System::ET_TSW, x1p, x2p, x3); + + h[DIR_M00] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_W, x1p, x2, x3); + h[DIR_0M0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_S, x1, x2p, x3); + h[DIR_00M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_B, x1, x2, x3p); + h[DIR_MM0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SW, x1p, x2p, x3); + h[DIR_PM0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SE, x1, x2p, x3); + h[DIR_M0M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BW, x1p, x2, x3p); + h[DIR_P0M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BE, x1, x2, x3p); + h[DIR_0MM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BS, x1, x2p, x3p); + h[DIR_0PM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BN, x1, x2, x3p); + h[DIR_MMM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSW, x1p, x2p, x3p); + h[DIR_PMM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSE, x1, x2p, x3p); + h[DIR_MPM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNW, x1p, x2, x3p); + h[DIR_PPM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNE, x1, x2, x3p); + + h[DIR_000] = (*this->zeroDistributionsH1)(x1, x2, x3); } } } @@ -1604,7 +1604,7 @@ void MultiphasePressureFilterCompressibleAirLBMKernel::findNeighbors(CbArray3D<L SPtr<BCArray3D> bcArray = this->getBCProcessor()->getBCArray(); - phi[REST] = (*ph)(x1, x2, x3); + phi[DIR_000] = (*ph)(x1, x2, x3); for (int k = FSTARTDIR; k <= FENDDIR; k++) { @@ -1624,7 +1624,7 @@ void MultiphasePressureFilterCompressibleAirLBMKernel::findNeighbors2(CbArray3D< SPtr<BCArray3D> bcArray = this->getBCProcessor()->getBCArray(); - phi2[REST] = (*ph)(x1, x2, x3); + phi2[DIR_000] = (*ph)(x1, x2, x3); for (int k = FSTARTDIR; k <= FENDDIR; k++) { diff --git a/src/cpu/VirtualFluidsCore/LBM/MultiphasePressureFilterLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/MultiphasePressureFilterLBMKernel.cpp index 64b3cf1685561f3ef04ffc2662268eea83694fbf..918a162e312437fabf9bfdea7adf8dc2be92fe08 100644 --- a/src/cpu/VirtualFluidsCore/LBM/MultiphasePressureFilterLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/MultiphasePressureFilterLBMKernel.cpp @@ -375,17 +375,17 @@ void MultiphasePressureFilterLBMKernel::calculate(int step) LBMReal normX2 = dX2_phi / denom; LBMReal normX3 = dX3_phi / denom; - dX1_phi = normX1 * (1.0 - phi[REST]) * (phi[REST]) * oneOverInterfaceScale; - dX2_phi = normX2 * (1.0 - phi[REST]) * (phi[REST]) * oneOverInterfaceScale; - dX3_phi = normX3 * (1.0 - phi[REST]) * (phi[REST]) * oneOverInterfaceScale; + dX1_phi = normX1 * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * oneOverInterfaceScale; + dX2_phi = normX2 * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * oneOverInterfaceScale; + dX3_phi = normX3 * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * oneOverInterfaceScale; - collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[REST] - phiH) / (phiH - phiL); + collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[DIR_000] - phiH) / (phiH - phiL); - LBMReal mu = 2 * beta * phi[REST] * (phi[REST] - 1) * (2 * phi[REST] - 1) - kappa * nabla2_phi(); + LBMReal mu = 2 * beta * phi[DIR_000] * (phi[DIR_000] - 1) * (2 * phi[DIR_000] - 1) - kappa * nabla2_phi(); //----------- Calculating Macroscopic Values ------------- - LBMReal rho = rhoH + rhoToPhi * (phi[REST] - phiH); + LBMReal rho = rhoH + rhoToPhi * (phi[DIR_000] - phiH); LBMReal m0, m1, m2; LBMReal rhoRef=c1; @@ -452,7 +452,7 @@ void MultiphasePressureFilterLBMKernel::calculate(int step) } //Viscosity increase by pressure gradient - LBMReal errPhi = (((1.0 - phi[REST]) * (phi[REST]) * oneOverInterfaceScale)- denom); + LBMReal errPhi = (((1.0 - phi[DIR_000]) * (phi[DIR_000]) * oneOverInterfaceScale)- denom); //LBMReal limVis = 0.0000001*10;//0.01; // collFactorM =collFactorM/(c1+limVis*(errPhi*errPhi)*collFactorM); // collFactorM = (collFactorM < 1.8) ? 1.8 : collFactorM; @@ -884,7 +884,7 @@ void MultiphasePressureFilterLBMKernel::calculate(int step) LBMReal OxyyMxzz = 8.0 * (collFactorM - 2.0) * (collFactorM + OxxPyyPzz * (3.0 * collFactorM - 7.0)) / (OxxPyyPzz * (56.0 - 42.0 * collFactorM + 9.0 * collFactorM * collFactorM) - 8.0 * collFactorM); LBMReal Oxyz = 24.0 * (collFactorM - 2.0) * (4.0 * collFactorM * collFactorM + collFactorM * OxxPyyPzz * (18.0 - 13.0 * collFactorM) + OxxPyyPzz * OxxPyyPzz * (2.0 + collFactorM * (6.0 * collFactorM - 11.0))) / (16.0 * collFactorM * collFactorM * (collFactorM - 6.0) - 2.0 * collFactorM * OxxPyyPzz * (216.0 + 5.0 * collFactorM * (9.0 * collFactorM - 46.0)) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (3.0 * collFactorM - 10.0) * (15.0 * collFactorM - 28.0) - 48.0)); LBMReal A = (4.0 * collFactorM * collFactorM + 2.0 * collFactorM * OxxPyyPzz * (collFactorM - 6.0) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (10.0 - 3.0 * collFactorM) - 4.0)) / ((collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); - //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::B' ) + //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::DIR_00M' ) LBMReal BB = (4.0 * collFactorM * OxxPyyPzz * (9.0 * collFactorM - 16.0) - 4.0 * collFactorM * collFactorM - 2.0 * OxxPyyPzz * OxxPyyPzz * (2.0 + 9.0 * collFactorM * (collFactorM - 2.0))) / (3.0 * (collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); @@ -1482,11 +1482,11 @@ void MultiphasePressureFilterLBMKernel::calculate(int step) // collision of 1st order moments cx = cx * (c1 - omegaD) + omegaD * vvx * concentration + - normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cy = cy * (c1 - omegaD) + omegaD * vvy * concentration + - normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cz = cz * (c1 - omegaD) + omegaD * vvz * concentration + - normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cx2 = cx * cx; cy2 = cy * cy; @@ -1624,42 +1624,42 @@ void MultiphasePressureFilterLBMKernel::calculate(int step) LBMReal MultiphasePressureFilterLBMKernel::gradX1_phi() { using namespace D3Q27System; - return 3.0* ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) + (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) + (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) + (phi[BE] - phi[TW])) + ((phi[SE] - phi[NW]) + (phi[NE] - phi[SW])))) + - +WEIGTH[N] * (phi[E] - phi[W])); + return 3.0* ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) + (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) + (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) + (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_PM0] - phi[DIR_MP0]) + (phi[DIR_PP0] - phi[DIR_MM0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_P00] - phi[DIR_M00])); } LBMReal MultiphasePressureFilterLBMKernel::gradX2_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[BNE] - phi[TSW])- (phi[TSE] - phi[BNW]))) - + WEIGTH[NE] * (((phi[TN] - phi[BS]) + (phi[BN] - phi[TS])) + ((phi[NE] - phi[SW])- (phi[SE] - phi[NW])))) + - +WEIGTH[N] * (phi[N] - phi[S])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PPM] - phi[DIR_MMP])- (phi[DIR_PMP] - phi[DIR_MPM]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_0PP] - phi[DIR_0MM]) + (phi[DIR_0PM] - phi[DIR_0MP])) + ((phi[DIR_PP0] - phi[DIR_MM0])- (phi[DIR_PM0] - phi[DIR_MP0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_0P0] - phi[DIR_0M0])); } LBMReal MultiphasePressureFilterLBMKernel::gradX3_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) - (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) - (phi[BE] - phi[TW])) + ((phi[TS] - phi[BN]) + (phi[TN] - phi[BS])))) + - +WEIGTH[N] * (phi[T] - phi[B])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) - (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) - (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_0MP] - phi[DIR_0PM]) + (phi[DIR_0PP] - phi[DIR_0MM])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_00P] - phi[DIR_00M])); } LBMReal MultiphasePressureFilterLBMKernel::nabla2_phi() { using namespace D3Q27System; LBMReal sum = 0.0; - sum += WEIGTH[TNE] * ((((phi[TNE] - phi[REST]) + (phi[BSW] - phi[REST])) + ((phi[TSW] - phi[REST]) + (phi[BNE] - phi[REST]))) - + (((phi[TNW] - phi[REST]) + (phi[BSE] - phi[REST])) + ((phi[TSE] - phi[REST]) + (phi[BNW] - phi[REST])))); - sum += WEIGTH[TN] * ( - (((phi[TN] - phi[REST]) + (phi[BS] - phi[REST])) + ((phi[TS] - phi[REST]) + (phi[BN] - phi[REST]))) - + (((phi[TE] - phi[REST]) + (phi[BW] - phi[REST])) + ((phi[TW] - phi[REST]) + (phi[BE] - phi[REST]))) - + (((phi[NE] - phi[REST]) + (phi[SW] - phi[REST])) + ((phi[NW] - phi[REST]) + (phi[SE] - phi[REST]))) + sum += WEIGTH[DIR_PPP] * ((((phi[DIR_PPP] - phi[DIR_000]) + (phi[DIR_MMM] - phi[DIR_000])) + ((phi[DIR_MMP] - phi[DIR_000]) + (phi[DIR_PPM] - phi[DIR_000]))) + + (((phi[DIR_MPP] - phi[DIR_000]) + (phi[DIR_PMM] - phi[DIR_000])) + ((phi[DIR_PMP] - phi[DIR_000]) + (phi[DIR_MPM] - phi[DIR_000])))); + sum += WEIGTH[DIR_0PP] * ( + (((phi[DIR_0PP] - phi[DIR_000]) + (phi[DIR_0MM] - phi[DIR_000])) + ((phi[DIR_0MP] - phi[DIR_000]) + (phi[DIR_0PM] - phi[DIR_000]))) + + (((phi[DIR_P0P] - phi[DIR_000]) + (phi[DIR_M0M] - phi[DIR_000])) + ((phi[DIR_M0P] - phi[DIR_000]) + (phi[DIR_P0M] - phi[DIR_000]))) + + (((phi[DIR_PP0] - phi[DIR_000]) + (phi[DIR_MM0] - phi[DIR_000])) + ((phi[DIR_MP0] - phi[DIR_000]) + (phi[DIR_PM0] - phi[DIR_000]))) ); - sum += WEIGTH[T] * ( - ((phi[T] - phi[REST]) + (phi[B] - phi[REST])) - + ((phi[N] - phi[REST]) + (phi[S] - phi[REST])) - + ((phi[E] - phi[REST]) + (phi[W] - phi[REST])) + sum += WEIGTH[DIR_00P] * ( + ((phi[DIR_00P] - phi[DIR_000]) + (phi[DIR_00M] - phi[DIR_000])) + + ((phi[DIR_0P0] - phi[DIR_000]) + (phi[DIR_0M0] - phi[DIR_000])) + + ((phi[DIR_P00] - phi[DIR_000]) + (phi[DIR_M00] - phi[DIR_000])) ); return 6.0 * sum; @@ -1687,35 +1687,35 @@ void MultiphasePressureFilterLBMKernel::computePhasefield() int x2p = x2 + 1; int x3p = x3 + 1; - h[E] = (*this->localDistributionsH1)(D3Q27System::ET_E, x1, x2, x3); - h[N] = (*this->localDistributionsH1)(D3Q27System::ET_N, x1, x2, x3); - h[T] = (*this->localDistributionsH1)(D3Q27System::ET_T, x1, x2, x3); - h[NE] = (*this->localDistributionsH1)(D3Q27System::ET_NE, x1, x2, x3); - h[NW] = (*this->localDistributionsH1)(D3Q27System::ET_NW, x1p, x2, x3); - h[TE] = (*this->localDistributionsH1)(D3Q27System::ET_TE, x1, x2, x3); - h[TW] = (*this->localDistributionsH1)(D3Q27System::ET_TW, x1p, x2, x3); - h[TN] = (*this->localDistributionsH1)(D3Q27System::ET_TN, x1, x2, x3); - h[TS] = (*this->localDistributionsH1)(D3Q27System::ET_TS, x1, x2p, x3); - h[TNE] = (*this->localDistributionsH1)(D3Q27System::ET_TNE, x1, x2, x3); - h[TNW] = (*this->localDistributionsH1)(D3Q27System::ET_TNW, x1p, x2, x3); - h[TSE] = (*this->localDistributionsH1)(D3Q27System::ET_TSE, x1, x2p, x3); - h[TSW] = (*this->localDistributionsH1)(D3Q27System::ET_TSW, x1p, x2p, x3); - - h[W] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_W, x1p, x2, x3); - h[S] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_S, x1, x2p, x3); - h[B] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_B, x1, x2, x3p); - h[SW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SW, x1p, x2p, x3); - h[SE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SE, x1, x2p, x3); - h[BW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BW, x1p, x2, x3p); - h[BE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BE, x1, x2, x3p); - h[BS] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BS, x1, x2p, x3p); - h[BN] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BN, x1, x2, x3p); - h[BSW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSW, x1p, x2p, x3p); - h[BSE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSE, x1, x2p, x3p); - h[BNW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNW, x1p, x2, x3p); - h[BNE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNE, x1, x2, x3p); - - h[REST] = (*this->zeroDistributionsH1)(x1, x2, x3); + h[DIR_P00] = (*this->localDistributionsH1)(D3Q27System::ET_E, x1, x2, x3); + h[DIR_0P0] = (*this->localDistributionsH1)(D3Q27System::ET_N, x1, x2, x3); + h[DIR_00P] = (*this->localDistributionsH1)(D3Q27System::ET_T, x1, x2, x3); + h[DIR_PP0] = (*this->localDistributionsH1)(D3Q27System::ET_NE, x1, x2, x3); + h[DIR_MP0] = (*this->localDistributionsH1)(D3Q27System::ET_NW, x1p, x2, x3); + h[DIR_P0P] = (*this->localDistributionsH1)(D3Q27System::ET_TE, x1, x2, x3); + h[DIR_M0P] = (*this->localDistributionsH1)(D3Q27System::ET_TW, x1p, x2, x3); + h[DIR_0PP] = (*this->localDistributionsH1)(D3Q27System::ET_TN, x1, x2, x3); + h[DIR_0MP] = (*this->localDistributionsH1)(D3Q27System::ET_TS, x1, x2p, x3); + h[DIR_PPP] = (*this->localDistributionsH1)(D3Q27System::ET_TNE, x1, x2, x3); + h[DIR_MPP] = (*this->localDistributionsH1)(D3Q27System::ET_TNW, x1p, x2, x3); + h[DIR_PMP] = (*this->localDistributionsH1)(D3Q27System::ET_TSE, x1, x2p, x3); + h[DIR_MMP] = (*this->localDistributionsH1)(D3Q27System::ET_TSW, x1p, x2p, x3); + + h[DIR_M00] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_W, x1p, x2, x3); + h[DIR_0M0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_S, x1, x2p, x3); + h[DIR_00M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_B, x1, x2, x3p); + h[DIR_MM0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SW, x1p, x2p, x3); + h[DIR_PM0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SE, x1, x2p, x3); + h[DIR_M0M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BW, x1p, x2, x3p); + h[DIR_P0M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BE, x1, x2, x3p); + h[DIR_0MM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BS, x1, x2p, x3p); + h[DIR_0PM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BN, x1, x2, x3p); + h[DIR_MMM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSW, x1p, x2p, x3p); + h[DIR_PMM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSE, x1, x2p, x3p); + h[DIR_MPM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNW, x1p, x2, x3p); + h[DIR_PPM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNE, x1, x2, x3p); + + h[DIR_000] = (*this->zeroDistributionsH1)(x1, x2, x3); } } } @@ -1729,7 +1729,7 @@ void MultiphasePressureFilterLBMKernel::findNeighbors(CbArray3D<LBMReal, Indexer SPtr<BCArray3D> bcArray = this->getBCProcessor()->getBCArray(); - phi[REST] = (*ph)(x1, x2, x3); + phi[DIR_000] = (*ph)(x1, x2, x3); for (int k = FSTARTDIR; k <= FENDDIR; k++) { diff --git a/src/cpu/VirtualFluidsCore/LBM/MultiphaseScratchCumulantLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/MultiphaseScratchCumulantLBMKernel.cpp index 77695179c9d3750eed80f0bf56e57103a691df9c..c1c2010e14f840965f60d5e9e8c0e7218bbe4ea7 100644 --- a/src/cpu/VirtualFluidsCore/LBM/MultiphaseScratchCumulantLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/MultiphaseScratchCumulantLBMKernel.cpp @@ -431,13 +431,13 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) ///!test - collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[REST] - phiH) / (phiH - phiL); + collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[DIR_000] - phiH) / (phiH - phiL); //collFactorM = phi[REST] - phiL < (phiH - phiL) * 0.05 ? collFactorG : collFactorL; - LBMReal mu = 2 * beta * phi[REST] * (phi[REST] - 1) * (2 * phi[REST] - 1) - kappa * nabla2_phi(); + LBMReal mu = 2 * beta * phi[DIR_000] * (phi[DIR_000] - 1) * (2 * phi[DIR_000] - 1) - kappa * nabla2_phi(); //----------- Calculating Macroscopic Values ------------- - LBMReal rho = rhoH + rhoToPhi * (phi[REST] - phiH); + LBMReal rho = rhoH + rhoToPhi * (phi[DIR_000] - phiH); if (withForcing) { // muX1 = static_cast<double>(x1-1+ix1*maxX1); @@ -588,9 +588,9 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) // vvxF = vvxF; //} LBMReal weightGrad = 1.0-denom*denom/(denom*denom+0.0001*0.001); - LBMReal dX1_phiF = dX1_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[REST]) * (phi[REST]) * normX1; - LBMReal dX2_phiF = dX2_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[REST]) * (phi[REST]) * normX2; - LBMReal dX3_phiF = dX3_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[REST]) * (phi[REST]) * normX3; + LBMReal dX1_phiF = dX1_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * normX1; + LBMReal dX2_phiF = dX2_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * normX2; + LBMReal dX3_phiF = dX3_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * normX3; //dX1_phiF *= 1.2; //dX2_phiF *= 1.2; @@ -646,15 +646,15 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) } - LBMReal gamma = WEIGTH[REST] * (1.0 - 1.5 * (ux2 + uy2 + uz2)); - LBMReal fac1 = (gamma - WEIGTH[REST]) * c1o3 * rhoToPhi; - forcingTerm[REST] = (-vvxF) * (fac1 * dX1_phiF ) + + LBMReal gamma = WEIGTH[DIR_000] * (1.0 - 1.5 * (ux2 + uy2 + uz2)); + LBMReal fac1 = (gamma - WEIGTH[DIR_000]) * c1o3 * rhoToPhi; + forcingTerm[DIR_000] = (-vvxF) * (fac1 * dX1_phiF ) + (-vvyF) * (fac1 * dX2_phiF ) + (-vvzF) * (fac1 * dX3_phiF ); //////// // LBMReal divAfterSource= - //( mfcbb + 3.0 * (0.5 * forcingTerm[E]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF) *(vvyF) +(vvzF) *(vvzF)-1)+ + //( mfcbb + 3.0 * (0.5 * forcingTerm[DIR_P00]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF) *(vvyF) +(vvzF) *(vvzF)-1)+ //( mfbcb + 3.0 * (0.5 * forcingTerm[N]) / rho ) *((vvxF) *(vvxF) +(vvyF-1)*(vvyF-1)+(vvzF) *(vvzF)-1)+ //( mfbbc + 3.0 * (0.5 * forcingTerm[T]) / rho ) *((vvxF) *(vvxF) +(vvyF) *(vvyF) +(vvzF-1)*(vvzF-1)-1)+ //( mfccb + 3.0 * (0.5 * forcingTerm[NE]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF-1)*(vvyF-1)+(vvzF) *(vvzF)-1)+ @@ -717,7 +717,7 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) //if (fabs(divAfterSource - divBeforeSource)/(fabs(divAfterSource) + fabs(divBeforeSource)+1e-10) > 1e-5) { // LBMReal scaleDiv =0.95+(1-0.95)* (divBeforeSource) / (divBeforeSource - divAfterSource); - // forcingTerm[E] *=scaleDiv; + // forcingTerm[DIR_P00] *=scaleDiv; // forcingTerm[N] *=scaleDiv; // forcingTerm[T] *=scaleDiv; // forcingTerm[NE] *=scaleDiv; @@ -748,33 +748,33 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) //////// - mfcbb +=3.0 * ( 0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; - mfbcb +=3.0 * ( 0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; - mfbbc +=3.0 * ( 0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; - mfccb +=3.0 * ( 0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; - mfacb +=3.0 * ( 0.5 * forcingTerm[NW]) / rho; //-(3.0*p1 - rho)*WEIGTH[NW ]; - mfcbc +=3.0 * ( 0.5 * forcingTerm[TE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TE ]; - mfabc +=3.0 * ( 0.5 * forcingTerm[TW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TW ]; - mfbcc +=3.0 * ( 0.5 * forcingTerm[TN]) / rho; //-(3.0*p1 - rho)*WEIGTH[TN ]; - mfbac +=3.0 * ( 0.5 * forcingTerm[TS]) / rho; //-(3.0*p1 - rho)*WEIGTH[TS ]; - mfccc +=3.0 * ( 0.5 * forcingTerm[TNE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNE]; - mfacc +=3.0 * ( 0.5 * forcingTerm[TNW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNW]; - mfcac +=3.0 * ( 0.5 * forcingTerm[TSE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSE]; - mfaac +=3.0 * ( 0.5 * forcingTerm[TSW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSW]; - mfabb +=3.0 * ( 0.5 * forcingTerm[W]) / rho; //-(3.0*p1 - rho)*WEIGTH[W ]; - mfbab +=3.0 * ( 0.5 * forcingTerm[S]) / rho; //-(3.0*p1 - rho)*WEIGTH[S ]; - mfbba +=3.0 * ( 0.5 * forcingTerm[B]) / rho; //-(3.0*p1 - rho)*WEIGTH[B ]; - mfaab +=3.0 * ( 0.5 * forcingTerm[SW]) / rho; //-(3.0*p1 - rho)*WEIGTH[SW ]; - mfcab +=3.0 * ( 0.5 * forcingTerm[SE]) / rho; //-(3.0*p1 - rho)*WEIGTH[SE ]; - mfaba +=3.0 * ( 0.5 * forcingTerm[BW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BW ]; - mfcba +=3.0 * ( 0.5 * forcingTerm[BE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BE ]; - mfbaa +=3.0 * ( 0.5 * forcingTerm[BS]) / rho; //-(3.0*p1 - rho)*WEIGTH[BS ]; - mfbca +=3.0 * ( 0.5 * forcingTerm[BN]) / rho; //-(3.0*p1 - rho)*WEIGTH[BN ]; - mfaaa +=3.0 * ( 0.5 * forcingTerm[BSW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSW]; - mfcaa +=3.0 * ( 0.5 * forcingTerm[BSE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSE]; - mfaca +=3.0 * ( 0.5 * forcingTerm[BNW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNW]; - mfcca +=3.0 * ( 0.5 * forcingTerm[BNE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNE]; - mfbbb +=3.0 * ( 0.5 * forcingTerm[REST]) / rho; //- (3.0*p1 - rho)*WEIGTH[REST] + mfcbb +=3.0 * ( 0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; + mfbcb +=3.0 * ( 0.5 * forcingTerm[DIR_0P0]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; + mfbbc +=3.0 * ( 0.5 * forcingTerm[DIR_00P]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; + mfccb +=3.0 * ( 0.5 * forcingTerm[DIR_PP0]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; + mfacb +=3.0 * ( 0.5 * forcingTerm[DIR_MP0]) / rho; //-(3.0*p1 - rho)*WEIGTH[NW ]; + mfcbc +=3.0 * ( 0.5 * forcingTerm[DIR_P0P]) / rho; //-(3.0*p1 - rho)*WEIGTH[TE ]; + mfabc +=3.0 * ( 0.5 * forcingTerm[DIR_M0P]) / rho; //-(3.0*p1 - rho)*WEIGTH[TW ]; + mfbcc +=3.0 * ( 0.5 * forcingTerm[DIR_0PP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TN ]; + mfbac +=3.0 * ( 0.5 * forcingTerm[DIR_0MP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TS ]; + mfccc +=3.0 * ( 0.5 * forcingTerm[DIR_PPP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNE]; + mfacc +=3.0 * ( 0.5 * forcingTerm[DIR_MPP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNW]; + mfcac +=3.0 * ( 0.5 * forcingTerm[DIR_PMP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSE]; + mfaac +=3.0 * ( 0.5 * forcingTerm[DIR_MMP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSW]; + mfabb +=3.0 * ( 0.5 * forcingTerm[DIR_M00]) / rho; //-(3.0*p1 - rho)*WEIGTH[W ]; + mfbab +=3.0 * ( 0.5 * forcingTerm[DIR_0M0]) / rho; //-(3.0*p1 - rho)*WEIGTH[S ]; + mfbba +=3.0 * ( 0.5 * forcingTerm[DIR_00M]) / rho; //-(3.0*p1 - rho)*WEIGTH[B ]; + mfaab +=3.0 * ( 0.5 * forcingTerm[DIR_MM0]) / rho; //-(3.0*p1 - rho)*WEIGTH[SW ]; + mfcab +=3.0 * ( 0.5 * forcingTerm[DIR_PM0]) / rho; //-(3.0*p1 - rho)*WEIGTH[SE ]; + mfaba +=3.0 * ( 0.5 * forcingTerm[DIR_M0M]) / rho; //-(3.0*p1 - rho)*WEIGTH[BW ]; + mfcba +=3.0 * ( 0.5 * forcingTerm[DIR_P0M]) / rho; //-(3.0*p1 - rho)*WEIGTH[BE ]; + mfbaa +=3.0 * ( 0.5 * forcingTerm[DIR_0MM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BS ]; + mfbca +=3.0 * ( 0.5 * forcingTerm[DIR_0PM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BN ]; + mfaaa +=3.0 * ( 0.5 * forcingTerm[DIR_MMM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSW]; + mfcaa +=3.0 * ( 0.5 * forcingTerm[DIR_PMM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSE]; + mfaca +=3.0 * ( 0.5 * forcingTerm[DIR_MPM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNW]; + mfcca +=3.0 * ( 0.5 * forcingTerm[DIR_PPM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNE]; + mfbbb +=3.0 * ( 0.5 * forcingTerm[DIR_000]) / rho; //- (3.0*p1 - rho)*WEIGTH[REST] //-------------------------------------------------------- @@ -1086,7 +1086,7 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) LBMReal OxyyMxzz = 8.0 * (collFactorM - 2.0) * (collFactorM + OxxPyyPzz * (3.0 * collFactorM - 7.0)) / (OxxPyyPzz * (56.0 - 42.0 * collFactorM + 9.0 * collFactorM * collFactorM) - 8.0 * collFactorM); LBMReal Oxyz = 24.0 * (collFactorM - 2.0) * (4.0 * collFactorM * collFactorM + collFactorM * OxxPyyPzz * (18.0 - 13.0 * collFactorM) + OxxPyyPzz * OxxPyyPzz * (2.0 + collFactorM * (6.0 * collFactorM - 11.0))) / (16.0 * collFactorM * collFactorM * (collFactorM - 6.0) - 2.0 * collFactorM * OxxPyyPzz * (216.0 + 5.0 * collFactorM * (9.0 * collFactorM - 46.0)) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (3.0 * collFactorM - 10.0) * (15.0 * collFactorM - 28.0) - 48.0)); LBMReal A = (4.0 * collFactorM * collFactorM + 2.0 * collFactorM * OxxPyyPzz * (collFactorM - 6.0) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (10.0 - 3.0 * collFactorM) - 4.0)) / ((collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); - //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::B' ) + //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::DIR_00M' ) LBMReal BB = (4.0 * collFactorM * OxxPyyPzz * (9.0 * collFactorM - 16.0) - 4.0 * collFactorM * collFactorM - 2.0 * OxxPyyPzz * OxxPyyPzz * (2.0 + 9.0 * collFactorM * (collFactorM - 2.0))) / (3.0 * (collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); @@ -1162,7 +1162,7 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) ////relax unfiltered //! divergenceFilter 10.05.2021 - LBMReal divMag= (1.0 - phi[REST]) * (phi[REST])*10*5*sqrt(fabs((OxxPyyPzz * (/*mfaaa*/ -mxxPyyPzz) - 3. * (1. - c1o2 * OxxPyyPzz) * (vx2 * dxux + vy2 * dyuy + vz2 * dzuz)))); + LBMReal divMag= (1.0 - phi[DIR_000]) * (phi[DIR_000])*10*5*sqrt(fabs((OxxPyyPzz * (/*mfaaa*/ -mxxPyyPzz) - 3. * (1. - c1o2 * OxxPyyPzz) * (vx2 * dxux + vy2 * dyuy + vz2 * dzuz)))); // LBMReal divMag = 500 *500* 50*(fabs((OxxPyyPzz * (/*mfaaa*/ -mxxPyyPzz) - 3. * (1. - c1o2 * OxxPyyPzz) * (vx2 * dxux + vy2 * dyuy + vz2 * dzuz))))* (fabs((OxxPyyPzz * (/*mfaaa*/ -mxxPyyPzz) - 3. * (1. - c1o2 * OxxPyyPzz) * (vx2 * dxux + vy2 * dyuy + vz2 * dzuz)))); //LBMReal divMag = (dX1_phi * dxux) > 0 ? (dX1_phi * dxux) : 0; //divMag += (dX2_phi * dyuy) > 0 ? (dX2_phi * dyuy) : 0; @@ -1619,33 +1619,33 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) /////classical source term 8.4.2021 - mfcbb += 3.0 * (0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; - mfbcb += 3.0 * (0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; - mfbbc += 3.0 * (0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; - mfccb += 3.0 * (0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; - mfacb += 3.0 * (0.5 * forcingTerm[NW]) / rho; //-(3.0*p1 - rho)*WEIGTH[NW ]; - mfcbc += 3.0 * (0.5 * forcingTerm[TE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TE ]; - mfabc += 3.0 * (0.5 * forcingTerm[TW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TW ]; - mfbcc += 3.0 * (0.5 * forcingTerm[TN]) / rho; //-(3.0*p1 - rho)*WEIGTH[TN ]; - mfbac += 3.0 * (0.5 * forcingTerm[TS]) / rho; //-(3.0*p1 - rho)*WEIGTH[TS ]; - mfccc += 3.0 * (0.5 * forcingTerm[TNE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNE]; - mfacc += 3.0 * (0.5 * forcingTerm[TNW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNW]; - mfcac += 3.0 * (0.5 * forcingTerm[TSE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSE]; - mfaac += 3.0 * (0.5 * forcingTerm[TSW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSW]; - mfabb += 3.0 * (0.5 * forcingTerm[W]) / rho; //-(3.0*p1 - rho)*WEIGTH[W ]; - mfbab += 3.0 * (0.5 * forcingTerm[S]) / rho; //-(3.0*p1 - rho)*WEIGTH[S ]; - mfbba += 3.0 * (0.5 * forcingTerm[B]) / rho; //-(3.0*p1 - rho)*WEIGTH[B ]; - mfaab += 3.0 * (0.5 * forcingTerm[SW]) / rho; //-(3.0*p1 - rho)*WEIGTH[SW ]; - mfcab += 3.0 * (0.5 * forcingTerm[SE]) / rho; //-(3.0*p1 - rho)*WEIGTH[SE ]; - mfaba += 3.0 * (0.5 * forcingTerm[BW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BW ]; - mfcba += 3.0 * (0.5 * forcingTerm[BE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BE ]; - mfbaa += 3.0 * (0.5 * forcingTerm[BS]) / rho; //-(3.0*p1 - rho)*WEIGTH[BS ]; - mfbca += 3.0 * (0.5 * forcingTerm[BN]) / rho; //-(3.0*p1 - rho)*WEIGTH[BN ]; - mfaaa += 3.0 * (0.5 * forcingTerm[BSW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSW]; - mfcaa += 3.0 * (0.5 * forcingTerm[BSE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSE]; - mfaca += 3.0 * (0.5 * forcingTerm[BNW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNW]; - mfcca += 3.0 * (0.5 * forcingTerm[BNE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNE]; - mfbbb += 3.0 * (0.5 * forcingTerm[REST]) / rho; //- (3.0*p1 - rho)*WEIGTH[REST] + mfcbb += 3.0 * (0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; + mfbcb += 3.0 * (0.5 * forcingTerm[DIR_0P0]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; + mfbbc += 3.0 * (0.5 * forcingTerm[DIR_00P]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; + mfccb += 3.0 * (0.5 * forcingTerm[DIR_PP0]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; + mfacb += 3.0 * (0.5 * forcingTerm[DIR_MP0]) / rho; //-(3.0*p1 - rho)*WEIGTH[NW ]; + mfcbc += 3.0 * (0.5 * forcingTerm[DIR_P0P]) / rho; //-(3.0*p1 - rho)*WEIGTH[TE ]; + mfabc += 3.0 * (0.5 * forcingTerm[DIR_M0P]) / rho; //-(3.0*p1 - rho)*WEIGTH[TW ]; + mfbcc += 3.0 * (0.5 * forcingTerm[DIR_0PP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TN ]; + mfbac += 3.0 * (0.5 * forcingTerm[DIR_0MP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TS ]; + mfccc += 3.0 * (0.5 * forcingTerm[DIR_PPP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNE]; + mfacc += 3.0 * (0.5 * forcingTerm[DIR_MPP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNW]; + mfcac += 3.0 * (0.5 * forcingTerm[DIR_PMP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSE]; + mfaac += 3.0 * (0.5 * forcingTerm[DIR_MMP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSW]; + mfabb += 3.0 * (0.5 * forcingTerm[DIR_M00]) / rho; //-(3.0*p1 - rho)*WEIGTH[W ]; + mfbab += 3.0 * (0.5 * forcingTerm[DIR_0M0]) / rho; //-(3.0*p1 - rho)*WEIGTH[S ]; + mfbba += 3.0 * (0.5 * forcingTerm[DIR_00M]) / rho; //-(3.0*p1 - rho)*WEIGTH[B ]; + mfaab += 3.0 * (0.5 * forcingTerm[DIR_MM0]) / rho; //-(3.0*p1 - rho)*WEIGTH[SW ]; + mfcab += 3.0 * (0.5 * forcingTerm[DIR_PM0]) / rho; //-(3.0*p1 - rho)*WEIGTH[SE ]; + mfaba += 3.0 * (0.5 * forcingTerm[DIR_M0M]) / rho; //-(3.0*p1 - rho)*WEIGTH[BW ]; + mfcba += 3.0 * (0.5 * forcingTerm[DIR_P0M]) / rho; //-(3.0*p1 - rho)*WEIGTH[BE ]; + mfbaa += 3.0 * (0.5 * forcingTerm[DIR_0MM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BS ]; + mfbca += 3.0 * (0.5 * forcingTerm[DIR_0PM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BN ]; + mfaaa += 3.0 * (0.5 * forcingTerm[DIR_MMM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSW]; + mfcaa += 3.0 * (0.5 * forcingTerm[DIR_PMM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSE]; + mfaca += 3.0 * (0.5 * forcingTerm[DIR_MPM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNW]; + mfcca += 3.0 * (0.5 * forcingTerm[DIR_PPM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNE]; + mfbbb += 3.0 * (0.5 * forcingTerm[DIR_000]) / rho; //- (3.0*p1 - rho)*WEIGTH[REST] @@ -1740,7 +1740,7 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) // // //-------------------------------------------------------- // -// mfcbb = 3.0 * (mfcbb + 0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; +// mfcbb = 3.0 * (mfcbb + 0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; // mfbcb = 3.0 * (mfbcb + 0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; // mfbbc = 3.0 * (mfbbc + 0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; // mfccb = 3.0 * (mfccb + 0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; @@ -2448,7 +2448,7 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) // } //#endif // -// mfcbb = rho * c1o3 * (mfcbb) + 0.5 * forcingTerm[E]; +// mfcbb = rho * c1o3 * (mfcbb) + 0.5 * forcingTerm[DIR_P00]; // mfbcb = rho * c1o3 * (mfbcb) + 0.5 * forcingTerm[N]; // mfbbc = rho * c1o3 * (mfbbc) + 0.5 * forcingTerm[T]; // mfccb = rho * c1o3 * (mfccb) + 0.5 * forcingTerm[NE]; @@ -2671,9 +2671,9 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) LBMReal Mccb = mfccb - mfaab * c1o9; // collision of 1st order moments - cx = cx * (c1 - omegaD) + omegaD * vvx * concentration + normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; - cy = cy * (c1 - omegaD) + omegaD * vvy * concentration + normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; - cz = cz * (c1 - omegaD) + omegaD * vvz * concentration + normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + cx = cx * (c1 - omegaD) + omegaD * vvx * concentration + normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; + cy = cy * (c1 - omegaD) + omegaD * vvy * concentration + normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; + cz = cz * (c1 - omegaD) + omegaD * vvz * concentration + normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; //mhx = (ux * phi[REST] + normX1 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhx; //mhy = (uy * phi[REST] + normX2 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhy; @@ -2823,7 +2823,7 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) /////////////////// PHASE-FIELD BGK SOLVER /////////////////////////////// //using namespace D3Q27System; - // h[E] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); + // h[DIR_P00] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); // h[N] = (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3); // h[T] = (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3); // h[NE] = (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3); @@ -2921,9 +2921,9 @@ void MultiphaseScratchCumulantLBMKernel::calculate(int step) LBMReal MultiphaseScratchCumulantLBMKernel::gradX1_phi() { using namespace D3Q27System; - return 3.0* ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) + (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) + (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) + (phi[BE] - phi[TW])) + ((phi[SE] - phi[NW]) + (phi[NE] - phi[SW])))) + - +WEIGTH[N] * (phi[E] - phi[W])); + return 3.0* ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) + (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) + (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) + (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_PM0] - phi[DIR_MP0]) + (phi[DIR_PP0] - phi[DIR_MM0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_P00] - phi[DIR_M00])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX1[k] * phi[k]; @@ -2934,9 +2934,9 @@ LBMReal MultiphaseScratchCumulantLBMKernel::gradX1_phi() LBMReal MultiphaseScratchCumulantLBMKernel::gradX2_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[BNE] - phi[TSW])- (phi[TSE] - phi[BNW]))) - + WEIGTH[NE] * (((phi[TN] - phi[BS]) + (phi[BN] - phi[TS])) + ((phi[NE] - phi[SW])- (phi[SE] - phi[NW])))) + - +WEIGTH[N] * (phi[N] - phi[S])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PPM] - phi[DIR_MMP])- (phi[DIR_PMP] - phi[DIR_MPM]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_0PP] - phi[DIR_0MM]) + (phi[DIR_0PM] - phi[DIR_0MP])) + ((phi[DIR_PP0] - phi[DIR_MM0])- (phi[DIR_PM0] - phi[DIR_MP0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_0P0] - phi[DIR_0M0])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX2[k] * phi[k]; @@ -2947,9 +2947,9 @@ LBMReal MultiphaseScratchCumulantLBMKernel::gradX2_phi() LBMReal MultiphaseScratchCumulantLBMKernel::gradX3_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) - (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) - (phi[BE] - phi[TW])) + ((phi[TS] - phi[BN]) + (phi[TN] - phi[BS])))) + - +WEIGTH[N] * (phi[T] - phi[B])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) - (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) - (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_0MP] - phi[DIR_0PM]) + (phi[DIR_0PP] - phi[DIR_0MM])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_00P] - phi[DIR_00M])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX3[k] * phi[k]; @@ -2961,17 +2961,17 @@ LBMReal MultiphaseScratchCumulantLBMKernel::nabla2_phi() { using namespace D3Q27System; LBMReal sum = 0.0; - sum += WEIGTH[TNE] * ((((phi[TNE] - phi[REST]) + (phi[BSW] - phi[REST])) + ((phi[TSW] - phi[REST]) + (phi[BNE] - phi[REST]))) - + (((phi[TNW] - phi[REST]) + (phi[BSE] - phi[REST])) + ((phi[TSE] - phi[REST]) + (phi[BNW] - phi[REST])))); - sum += WEIGTH[TN] * ( - (((phi[TN] - phi[REST]) + (phi[BS] - phi[REST])) + ((phi[TS] - phi[REST]) + (phi[BN] - phi[REST]))) - + (((phi[TE] - phi[REST]) + (phi[BW] - phi[REST])) + ((phi[TW] - phi[REST]) + (phi[BE] - phi[REST]))) - + (((phi[NE] - phi[REST]) + (phi[SW] - phi[REST])) + ((phi[NW] - phi[REST]) + (phi[SE] - phi[REST]))) + sum += WEIGTH[DIR_PPP] * ((((phi[DIR_PPP] - phi[DIR_000]) + (phi[DIR_MMM] - phi[DIR_000])) + ((phi[DIR_MMP] - phi[DIR_000]) + (phi[DIR_PPM] - phi[DIR_000]))) + + (((phi[DIR_MPP] - phi[DIR_000]) + (phi[DIR_PMM] - phi[DIR_000])) + ((phi[DIR_PMP] - phi[DIR_000]) + (phi[DIR_MPM] - phi[DIR_000])))); + sum += WEIGTH[DIR_0PP] * ( + (((phi[DIR_0PP] - phi[DIR_000]) + (phi[DIR_0MM] - phi[DIR_000])) + ((phi[DIR_0MP] - phi[DIR_000]) + (phi[DIR_0PM] - phi[DIR_000]))) + + (((phi[DIR_P0P] - phi[DIR_000]) + (phi[DIR_M0M] - phi[DIR_000])) + ((phi[DIR_M0P] - phi[DIR_000]) + (phi[DIR_P0M] - phi[DIR_000]))) + + (((phi[DIR_PP0] - phi[DIR_000]) + (phi[DIR_MM0] - phi[DIR_000])) + ((phi[DIR_MP0] - phi[DIR_000]) + (phi[DIR_PM0] - phi[DIR_000]))) ); - sum += WEIGTH[T] * ( - ((phi[T] - phi[REST]) + (phi[B] - phi[REST])) - + ((phi[N] - phi[REST]) + (phi[S] - phi[REST])) - + ((phi[E] - phi[REST]) + (phi[W] - phi[REST])) + sum += WEIGTH[DIR_00P] * ( + ((phi[DIR_00P] - phi[DIR_000]) + (phi[DIR_00M] - phi[DIR_000])) + + ((phi[DIR_0P0] - phi[DIR_000]) + (phi[DIR_0M0] - phi[DIR_000])) + + ((phi[DIR_P00] - phi[DIR_000]) + (phi[DIR_M00] - phi[DIR_000])) ); //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * (phi[k] - phi[REST]); @@ -3001,35 +3001,35 @@ void MultiphaseScratchCumulantLBMKernel::computePhasefield() int x2p = x2 + 1; int x3p = x3 + 1; - h[E] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); - h[N] = (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3); - h[T] = (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3); - h[NE] = (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3); - h[NW] = (*this->localDistributionsH)(D3Q27System::ET_NW, x1p, x2, x3); - h[TE] = (*this->localDistributionsH)(D3Q27System::ET_TE, x1, x2, x3); - h[TW] = (*this->localDistributionsH)(D3Q27System::ET_TW, x1p, x2, x3); - h[TN] = (*this->localDistributionsH)(D3Q27System::ET_TN, x1, x2, x3); - h[TS] = (*this->localDistributionsH)(D3Q27System::ET_TS, x1, x2p, x3); - h[TNE] = (*this->localDistributionsH)(D3Q27System::ET_TNE, x1, x2, x3); - h[TNW] = (*this->localDistributionsH)(D3Q27System::ET_TNW, x1p, x2, x3); - h[TSE] = (*this->localDistributionsH)(D3Q27System::ET_TSE, x1, x2p, x3); - h[TSW] = (*this->localDistributionsH)(D3Q27System::ET_TSW, x1p, x2p, x3); - - h[W] = (*this->nonLocalDistributionsH)(D3Q27System::ET_W, x1p, x2, x3); - h[S] = (*this->nonLocalDistributionsH)(D3Q27System::ET_S, x1, x2p, x3); - h[B] = (*this->nonLocalDistributionsH)(D3Q27System::ET_B, x1, x2, x3p); - h[SW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SW, x1p, x2p, x3); - h[SE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SE, x1, x2p, x3); - h[BW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BW, x1p, x2, x3p); - h[BE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BE, x1, x2, x3p); - h[BS] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BS, x1, x2p, x3p); - h[BN] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BN, x1, x2, x3p); - h[BSW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSW, x1p, x2p, x3p); - h[BSE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSE, x1, x2p, x3p); - h[BNW] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNW, x1p, x2, x3p); - h[BNE] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNE, x1, x2, x3p); - - h[REST] = (*this->zeroDistributionsH)(x1, x2, x3); + h[DIR_P00] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); + h[DIR_0P0] = (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3); + h[DIR_00P] = (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3); + h[DIR_PP0] = (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3); + h[DIR_MP0] = (*this->localDistributionsH)(D3Q27System::ET_NW, x1p, x2, x3); + h[DIR_P0P] = (*this->localDistributionsH)(D3Q27System::ET_TE, x1, x2, x3); + h[DIR_M0P] = (*this->localDistributionsH)(D3Q27System::ET_TW, x1p, x2, x3); + h[DIR_0PP] = (*this->localDistributionsH)(D3Q27System::ET_TN, x1, x2, x3); + h[DIR_0MP] = (*this->localDistributionsH)(D3Q27System::ET_TS, x1, x2p, x3); + h[DIR_PPP] = (*this->localDistributionsH)(D3Q27System::ET_TNE, x1, x2, x3); + h[DIR_MPP] = (*this->localDistributionsH)(D3Q27System::ET_TNW, x1p, x2, x3); + h[DIR_PMP] = (*this->localDistributionsH)(D3Q27System::ET_TSE, x1, x2p, x3); + h[DIR_MMP] = (*this->localDistributionsH)(D3Q27System::ET_TSW, x1p, x2p, x3); + + h[DIR_M00] = (*this->nonLocalDistributionsH)(D3Q27System::ET_W, x1p, x2, x3); + h[DIR_0M0] = (*this->nonLocalDistributionsH)(D3Q27System::ET_S, x1, x2p, x3); + h[DIR_00M] = (*this->nonLocalDistributionsH)(D3Q27System::ET_B, x1, x2, x3p); + h[DIR_MM0] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SW, x1p, x2p, x3); + h[DIR_PM0] = (*this->nonLocalDistributionsH)(D3Q27System::ET_SE, x1, x2p, x3); + h[DIR_M0M] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BW, x1p, x2, x3p); + h[DIR_P0M] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BE, x1, x2, x3p); + h[DIR_0MM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BS, x1, x2p, x3p); + h[DIR_0PM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BN, x1, x2, x3p); + h[DIR_MMM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSW, x1p, x2p, x3p); + h[DIR_PMM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BSE, x1, x2p, x3p); + h[DIR_MPM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNW, x1p, x2, x3p); + h[DIR_PPM] = (*this->nonLocalDistributionsH)(D3Q27System::ET_BNE, x1, x2, x3p); + + h[DIR_000] = (*this->zeroDistributionsH)(x1, x2, x3); } } } @@ -3043,7 +3043,7 @@ void MultiphaseScratchCumulantLBMKernel::findNeighbors(CbArray3D<LBMReal, Indexe SPtr<BCArray3D> bcArray = this->getBCProcessor()->getBCArray(); - phi[REST] = (*ph)(x1, x2, x3); + phi[DIR_000] = (*ph)(x1, x2, x3); for (int k = FSTARTDIR; k <= FENDDIR; k++) { diff --git a/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsCumulantLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsCumulantLBMKernel.cpp index f226b8ecfa3c5654801561248f09e0251d2fa2ac..229ff921a69f9238b7c9d45596c21b7ec4a2264a 100644 --- a/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsCumulantLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsCumulantLBMKernel.cpp @@ -346,13 +346,13 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) - collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[REST] - phiH) / (phiH - phiL); + collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[DIR_000] - phiH) / (phiH - phiL); - LBMReal mu = 2 * beta * phi[REST] * (phi[REST] - 1) * (2 * phi[REST] - 1) - kappa * nabla2_phi(); + LBMReal mu = 2 * beta * phi[DIR_000] * (phi[DIR_000] - 1) * (2 * phi[DIR_000] - 1) - kappa * nabla2_phi(); //----------- Calculating Macroscopic Values ------------- - LBMReal rho = rhoH + rhoToPhi * (phi[REST] - phiH); + LBMReal rho = rhoH + rhoToPhi * (phi[DIR_000] - phiH); ////Incompressible Kernal @@ -446,9 +446,9 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) // vvxF = vvxF; //} LBMReal weightGrad = 1.0;// -denom * denom / (denom * denom + 0.0001 * 0.001); - LBMReal dX1_phiF = dX1_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[REST]) * (phi[REST]) * normX1; - LBMReal dX2_phiF = dX2_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[REST]) * (phi[REST]) * normX2; - LBMReal dX3_phiF = dX3_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[REST]) * (phi[REST]) * normX3; + LBMReal dX1_phiF = dX1_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * normX1; + LBMReal dX2_phiF = dX2_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * normX2; + LBMReal dX3_phiF = dX3_phi * weightGrad + (1.0 - weightGrad) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * normX3; //dX1_phiF *= 1.2; //dX2_phiF *= 1.2; @@ -498,15 +498,15 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) } - LBMReal gamma = WEIGTH[REST] * (1.0 - 1.5 * (ux2 + uy2 + uz2)); - LBMReal fac1 = (gamma - WEIGTH[REST]) * c1o3 * rhoToPhi; - forcingTerm[REST] = (-vvxF) * (fac1 * (dX1_phiF * rhoH + dX2_phi2 * rhoL)) + + LBMReal gamma = WEIGTH[DIR_000] * (1.0 - 1.5 * (ux2 + uy2 + uz2)); + LBMReal fac1 = (gamma - WEIGTH[DIR_000]) * c1o3 * rhoToPhi; + forcingTerm[DIR_000] = (-vvxF) * (fac1 * (dX1_phiF * rhoH + dX2_phi2 * rhoL)) + (-vvyF) * (fac1 * (dX2_phiF * rhoH + dX2_phi2 * rhoL)) + (-vvzF) * (fac1 * (dX3_phiF * rhoH + dX3_phi2 * rhoL)); //////// // LBMReal divAfterSource= - //( mfcbb + 3.0 * (0.5 * forcingTerm[E]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF) *(vvyF) +(vvzF) *(vvzF)-1)+ + //( mfcbb + 3.0 * (0.5 * forcingTerm[DIR_P00]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF) *(vvyF) +(vvzF) *(vvzF)-1)+ //( mfbcb + 3.0 * (0.5 * forcingTerm[N]) / rho ) *((vvxF) *(vvxF) +(vvyF-1)*(vvyF-1)+(vvzF) *(vvzF)-1)+ //( mfbbc + 3.0 * (0.5 * forcingTerm[T]) / rho ) *((vvxF) *(vvxF) +(vvyF) *(vvyF) +(vvzF-1)*(vvzF-1)-1)+ //( mfccb + 3.0 * (0.5 * forcingTerm[NE]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF-1)*(vvyF-1)+(vvzF) *(vvzF)-1)+ @@ -569,7 +569,7 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) //if (fabs(divAfterSource - divBeforeSource)/(fabs(divAfterSource) + fabs(divBeforeSource)+1e-10) > 1e-5) { // LBMReal scaleDiv =0.95+(1-0.95)* (divBeforeSource) / (divBeforeSource - divAfterSource); - // forcingTerm[E] *=scaleDiv; + // forcingTerm[DIR_P00] *=scaleDiv; // forcingTerm[N] *=scaleDiv; // forcingTerm[T] *=scaleDiv; // forcingTerm[NE] *=scaleDiv; @@ -600,33 +600,33 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) //////// - mfcbb += 3.0 * (0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; - mfbcb += 3.0 * (0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; - mfbbc += 3.0 * (0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; - mfccb += 3.0 * (0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; - mfacb += 3.0 * (0.5 * forcingTerm[NW]) / rho; //-(3.0*p1 - rho)*WEIGTH[NW ]; - mfcbc += 3.0 * (0.5 * forcingTerm[TE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TE ]; - mfabc += 3.0 * (0.5 * forcingTerm[TW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TW ]; - mfbcc += 3.0 * (0.5 * forcingTerm[TN]) / rho; //-(3.0*p1 - rho)*WEIGTH[TN ]; - mfbac += 3.0 * (0.5 * forcingTerm[TS]) / rho; //-(3.0*p1 - rho)*WEIGTH[TS ]; - mfccc += 3.0 * (0.5 * forcingTerm[TNE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNE]; - mfacc += 3.0 * (0.5 * forcingTerm[TNW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNW]; - mfcac += 3.0 * (0.5 * forcingTerm[TSE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSE]; - mfaac += 3.0 * (0.5 * forcingTerm[TSW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSW]; - mfabb += 3.0 * (0.5 * forcingTerm[W]) / rho; //-(3.0*p1 - rho)*WEIGTH[W ]; - mfbab += 3.0 * (0.5 * forcingTerm[S]) / rho; //-(3.0*p1 - rho)*WEIGTH[S ]; - mfbba += 3.0 * (0.5 * forcingTerm[B]) / rho; //-(3.0*p1 - rho)*WEIGTH[B ]; - mfaab += 3.0 * (0.5 * forcingTerm[SW]) / rho; //-(3.0*p1 - rho)*WEIGTH[SW ]; - mfcab += 3.0 * (0.5 * forcingTerm[SE]) / rho; //-(3.0*p1 - rho)*WEIGTH[SE ]; - mfaba += 3.0 * (0.5 * forcingTerm[BW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BW ]; - mfcba += 3.0 * (0.5 * forcingTerm[BE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BE ]; - mfbaa += 3.0 * (0.5 * forcingTerm[BS]) / rho; //-(3.0*p1 - rho)*WEIGTH[BS ]; - mfbca += 3.0 * (0.5 * forcingTerm[BN]) / rho; //-(3.0*p1 - rho)*WEIGTH[BN ]; - mfaaa += 3.0 * (0.5 * forcingTerm[BSW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSW]; - mfcaa += 3.0 * (0.5 * forcingTerm[BSE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSE]; - mfaca += 3.0 * (0.5 * forcingTerm[BNW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNW]; - mfcca += 3.0 * (0.5 * forcingTerm[BNE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNE]; - mfbbb += 3.0 * (0.5 * forcingTerm[REST]) / rho; //- (3.0*p1 - rho)*WEIGTH[REST] + mfcbb += 3.0 * (0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; + mfbcb += 3.0 * (0.5 * forcingTerm[DIR_0P0]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; + mfbbc += 3.0 * (0.5 * forcingTerm[DIR_00P]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; + mfccb += 3.0 * (0.5 * forcingTerm[DIR_PP0]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; + mfacb += 3.0 * (0.5 * forcingTerm[DIR_MP0]) / rho; //-(3.0*p1 - rho)*WEIGTH[NW ]; + mfcbc += 3.0 * (0.5 * forcingTerm[DIR_P0P]) / rho; //-(3.0*p1 - rho)*WEIGTH[TE ]; + mfabc += 3.0 * (0.5 * forcingTerm[DIR_M0P]) / rho; //-(3.0*p1 - rho)*WEIGTH[TW ]; + mfbcc += 3.0 * (0.5 * forcingTerm[DIR_0PP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TN ]; + mfbac += 3.0 * (0.5 * forcingTerm[DIR_0MP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TS ]; + mfccc += 3.0 * (0.5 * forcingTerm[DIR_PPP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNE]; + mfacc += 3.0 * (0.5 * forcingTerm[DIR_MPP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNW]; + mfcac += 3.0 * (0.5 * forcingTerm[DIR_PMP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSE]; + mfaac += 3.0 * (0.5 * forcingTerm[DIR_MMP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSW]; + mfabb += 3.0 * (0.5 * forcingTerm[DIR_M00]) / rho; //-(3.0*p1 - rho)*WEIGTH[W ]; + mfbab += 3.0 * (0.5 * forcingTerm[DIR_0M0]) / rho; //-(3.0*p1 - rho)*WEIGTH[S ]; + mfbba += 3.0 * (0.5 * forcingTerm[DIR_00M]) / rho; //-(3.0*p1 - rho)*WEIGTH[B ]; + mfaab += 3.0 * (0.5 * forcingTerm[DIR_MM0]) / rho; //-(3.0*p1 - rho)*WEIGTH[SW ]; + mfcab += 3.0 * (0.5 * forcingTerm[DIR_PM0]) / rho; //-(3.0*p1 - rho)*WEIGTH[SE ]; + mfaba += 3.0 * (0.5 * forcingTerm[DIR_M0M]) / rho; //-(3.0*p1 - rho)*WEIGTH[BW ]; + mfcba += 3.0 * (0.5 * forcingTerm[DIR_P0M]) / rho; //-(3.0*p1 - rho)*WEIGTH[BE ]; + mfbaa += 3.0 * (0.5 * forcingTerm[DIR_0MM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BS ]; + mfbca += 3.0 * (0.5 * forcingTerm[DIR_0PM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BN ]; + mfaaa += 3.0 * (0.5 * forcingTerm[DIR_MMM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSW]; + mfcaa += 3.0 * (0.5 * forcingTerm[DIR_PMM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSE]; + mfaca += 3.0 * (0.5 * forcingTerm[DIR_MPM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNW]; + mfcca += 3.0 * (0.5 * forcingTerm[DIR_PPM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNE]; + mfbbb += 3.0 * (0.5 * forcingTerm[DIR_000]) / rho; //- (3.0*p1 - rho)*WEIGTH[REST] //-------------------------------------------------------- @@ -940,7 +940,7 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) LBMReal OxyyMxzz = 8.0 * (collFactorM - 2.0) * (collFactorM + OxxPyyPzz * (3.0 * collFactorM - 7.0)) / (OxxPyyPzz * (56.0 - 42.0 * collFactorM + 9.0 * collFactorM * collFactorM) - 8.0 * collFactorM); // LBMReal Oxyz = 24.0 * (collFactorM - 2.0) * (4.0 * collFactorM * collFactorM + collFactorM * OxxPyyPzz * (18.0 - 13.0 * collFactorM) + OxxPyyPzz * OxxPyyPzz * (2.0 + collFactorM * (6.0 * collFactorM - 11.0))) / (16.0 * collFactorM * collFactorM * (collFactorM - 6.0) - 2.0 * collFactorM * OxxPyyPzz * (216.0 + 5.0 * collFactorM * (9.0 * collFactorM - 46.0)) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (3.0 * collFactorM - 10.0) * (15.0 * collFactorM - 28.0) - 48.0)); LBMReal A = (4.0 * collFactorM * collFactorM + 2.0 * collFactorM * OxxPyyPzz * (collFactorM - 6.0) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (10.0 - 3.0 * collFactorM) - 4.0)) / ((collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); - //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::B' ) + //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::DIR_00M' ) LBMReal BB = (4.0 * collFactorM * OxxPyyPzz * (9.0 * collFactorM - 16.0) - 4.0 * collFactorM * collFactorM - 2.0 * OxxPyyPzz * OxxPyyPzz * (2.0 + 9.0 * collFactorM * (collFactorM - 2.0))) / (3.0 * (collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); @@ -1344,33 +1344,33 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) /////classical source term 8.4.2021 - mfcbb += 3.0 * (0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; - mfbcb += 3.0 * (0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; - mfbbc += 3.0 * (0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; - mfccb += 3.0 * (0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; - mfacb += 3.0 * (0.5 * forcingTerm[NW]) / rho; //-(3.0*p1 - rho)*WEIGTH[NW ]; - mfcbc += 3.0 * (0.5 * forcingTerm[TE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TE ]; - mfabc += 3.0 * (0.5 * forcingTerm[TW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TW ]; - mfbcc += 3.0 * (0.5 * forcingTerm[TN]) / rho; //-(3.0*p1 - rho)*WEIGTH[TN ]; - mfbac += 3.0 * (0.5 * forcingTerm[TS]) / rho; //-(3.0*p1 - rho)*WEIGTH[TS ]; - mfccc += 3.0 * (0.5 * forcingTerm[TNE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNE]; - mfacc += 3.0 * (0.5 * forcingTerm[TNW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNW]; - mfcac += 3.0 * (0.5 * forcingTerm[TSE]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSE]; - mfaac += 3.0 * (0.5 * forcingTerm[TSW]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSW]; - mfabb += 3.0 * (0.5 * forcingTerm[W]) / rho; //-(3.0*p1 - rho)*WEIGTH[W ]; - mfbab += 3.0 * (0.5 * forcingTerm[S]) / rho; //-(3.0*p1 - rho)*WEIGTH[S ]; - mfbba += 3.0 * (0.5 * forcingTerm[B]) / rho; //-(3.0*p1 - rho)*WEIGTH[B ]; - mfaab += 3.0 * (0.5 * forcingTerm[SW]) / rho; //-(3.0*p1 - rho)*WEIGTH[SW ]; - mfcab += 3.0 * (0.5 * forcingTerm[SE]) / rho; //-(3.0*p1 - rho)*WEIGTH[SE ]; - mfaba += 3.0 * (0.5 * forcingTerm[BW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BW ]; - mfcba += 3.0 * (0.5 * forcingTerm[BE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BE ]; - mfbaa += 3.0 * (0.5 * forcingTerm[BS]) / rho; //-(3.0*p1 - rho)*WEIGTH[BS ]; - mfbca += 3.0 * (0.5 * forcingTerm[BN]) / rho; //-(3.0*p1 - rho)*WEIGTH[BN ]; - mfaaa += 3.0 * (0.5 * forcingTerm[BSW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSW]; - mfcaa += 3.0 * (0.5 * forcingTerm[BSE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSE]; - mfaca += 3.0 * (0.5 * forcingTerm[BNW]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNW]; - mfcca += 3.0 * (0.5 * forcingTerm[BNE]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNE]; - mfbbb += 3.0 * (0.5 * forcingTerm[REST]) / rho; //- (3.0*p1 - rho)*WEIGTH[REST] + mfcbb += 3.0 * (0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; + mfbcb += 3.0 * (0.5 * forcingTerm[DIR_0P0]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; + mfbbc += 3.0 * (0.5 * forcingTerm[DIR_00P]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; + mfccb += 3.0 * (0.5 * forcingTerm[DIR_PP0]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; + mfacb += 3.0 * (0.5 * forcingTerm[DIR_MP0]) / rho; //-(3.0*p1 - rho)*WEIGTH[NW ]; + mfcbc += 3.0 * (0.5 * forcingTerm[DIR_P0P]) / rho; //-(3.0*p1 - rho)*WEIGTH[TE ]; + mfabc += 3.0 * (0.5 * forcingTerm[DIR_M0P]) / rho; //-(3.0*p1 - rho)*WEIGTH[TW ]; + mfbcc += 3.0 * (0.5 * forcingTerm[DIR_0PP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TN ]; + mfbac += 3.0 * (0.5 * forcingTerm[DIR_0MP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TS ]; + mfccc += 3.0 * (0.5 * forcingTerm[DIR_PPP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNE]; + mfacc += 3.0 * (0.5 * forcingTerm[DIR_MPP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TNW]; + mfcac += 3.0 * (0.5 * forcingTerm[DIR_PMP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSE]; + mfaac += 3.0 * (0.5 * forcingTerm[DIR_MMP]) / rho; //-(3.0*p1 - rho)*WEIGTH[TSW]; + mfabb += 3.0 * (0.5 * forcingTerm[DIR_M00]) / rho; //-(3.0*p1 - rho)*WEIGTH[W ]; + mfbab += 3.0 * (0.5 * forcingTerm[DIR_0M0]) / rho; //-(3.0*p1 - rho)*WEIGTH[S ]; + mfbba += 3.0 * (0.5 * forcingTerm[DIR_00M]) / rho; //-(3.0*p1 - rho)*WEIGTH[B ]; + mfaab += 3.0 * (0.5 * forcingTerm[DIR_MM0]) / rho; //-(3.0*p1 - rho)*WEIGTH[SW ]; + mfcab += 3.0 * (0.5 * forcingTerm[DIR_PM0]) / rho; //-(3.0*p1 - rho)*WEIGTH[SE ]; + mfaba += 3.0 * (0.5 * forcingTerm[DIR_M0M]) / rho; //-(3.0*p1 - rho)*WEIGTH[BW ]; + mfcba += 3.0 * (0.5 * forcingTerm[DIR_P0M]) / rho; //-(3.0*p1 - rho)*WEIGTH[BE ]; + mfbaa += 3.0 * (0.5 * forcingTerm[DIR_0MM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BS ]; + mfbca += 3.0 * (0.5 * forcingTerm[DIR_0PM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BN ]; + mfaaa += 3.0 * (0.5 * forcingTerm[DIR_MMM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSW]; + mfcaa += 3.0 * (0.5 * forcingTerm[DIR_PMM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BSE]; + mfaca += 3.0 * (0.5 * forcingTerm[DIR_MPM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNW]; + mfcca += 3.0 * (0.5 * forcingTerm[DIR_PPM]) / rho; //-(3.0*p1 - rho)*WEIGTH[BNE]; + mfbbb += 3.0 * (0.5 * forcingTerm[DIR_000]) / rho; //- (3.0*p1 - rho)*WEIGTH[REST] @@ -1487,7 +1487,7 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) // // //-------------------------------------------------------- // -// mfcbb = 3.0 * (mfcbb + 0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; +// mfcbb = 3.0 * (mfcbb + 0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; // mfbcb = 3.0 * (mfbcb + 0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; // mfbbc = 3.0 * (mfbbc + 0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; // mfccb = 3.0 * (mfccb + 0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; @@ -2195,7 +2195,7 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) // } //#endif // -// mfcbb = rho * c1o3 * (mfcbb) + 0.5 * forcingTerm[E]; +// mfcbb = rho * c1o3 * (mfcbb) + 0.5 * forcingTerm[DIR_P00]; // mfbcb = rho * c1o3 * (mfbcb) + 0.5 * forcingTerm[N]; // mfbbc = rho * c1o3 * (mfbbc) + 0.5 * forcingTerm[T]; // mfccb = rho * c1o3 * (mfccb) + 0.5 * forcingTerm[NE]; @@ -2422,11 +2422,11 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) cx = cx * (c1 - omegaD) + omegaD * vvx * concentration + - normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cy = cy * (c1 - omegaD) + omegaD * vvy * concentration + - normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cz = cz * (c1 - omegaD) + omegaD * vvz * concentration + - normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; //mhx = (ux * phi[REST] + normX1 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhx; //mhy = (uy * phi[REST] + normX2 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhy; @@ -2735,11 +2735,11 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) // collision of 1st order moments cx = cx * (c1 - omegaD) + omegaD * vvx * concentration + - normX1 * (c1 - 0.5 * omegaD) * ( phi[REST]) * (phi2[REST]) * c1o3 * oneOverInterfaceScale; + normX1 * (c1 - 0.5 * omegaD) * ( phi[DIR_000]) * (phi2[DIR_000]) * c1o3 * oneOverInterfaceScale; cy = cy * (c1 - omegaD) + omegaD * vvy * concentration + - normX2 * (c1 - 0.5 * omegaD) * ( phi[REST]) * (phi2[REST]) * c1o3 * oneOverInterfaceScale; + normX2 * (c1 - 0.5 * omegaD) * ( phi[DIR_000]) * (phi2[DIR_000]) * c1o3 * oneOverInterfaceScale; cz = cz * (c1 - omegaD) + omegaD * vvz * concentration + - normX3 * (c1 - 0.5 * omegaD) * ( phi[REST]) * (phi2[REST]) * c1o3 * oneOverInterfaceScale; + normX3 * (c1 - 0.5 * omegaD) * ( phi[DIR_000]) * (phi2[DIR_000]) * c1o3 * oneOverInterfaceScale; //mhx = (ux * phi[REST] + normX1 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhx; //mhy = (uy * phi[REST] + normX2 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhy; @@ -2892,7 +2892,7 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) ///////////////////// PHASE-FIELD BGK SOLVER /////////////////////////////// - //h[E] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); + //h[DIR_P00] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); //h[N] = (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3); //h[T] = (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3); //h[NE] = (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3); @@ -2984,9 +2984,9 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::calculate(int step) LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::gradX1_phi() { using namespace D3Q27System; - return 3.0* ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) + (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) + (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) + (phi[BE] - phi[TW])) + ((phi[SE] - phi[NW]) + (phi[NE] - phi[SW])))) + - +WEIGTH[N] * (phi[E] - phi[W])); + return 3.0* ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) + (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) + (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) + (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_PM0] - phi[DIR_MP0]) + (phi[DIR_PP0] - phi[DIR_MM0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_P00] - phi[DIR_M00])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX1[k] * phi[k]; @@ -2997,9 +2997,9 @@ LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::gradX1_phi() LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::gradX2_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[BNE] - phi[TSW])- (phi[TSE] - phi[BNW]))) - + WEIGTH[NE] * (((phi[TN] - phi[BS]) + (phi[BN] - phi[TS])) + ((phi[NE] - phi[SW])- (phi[SE] - phi[NW])))) + - +WEIGTH[N] * (phi[N] - phi[S])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PPM] - phi[DIR_MMP])- (phi[DIR_PMP] - phi[DIR_MPM]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_0PP] - phi[DIR_0MM]) + (phi[DIR_0PM] - phi[DIR_0MP])) + ((phi[DIR_PP0] - phi[DIR_MM0])- (phi[DIR_PM0] - phi[DIR_MP0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_0P0] - phi[DIR_0M0])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX2[k] * phi[k]; @@ -3010,9 +3010,9 @@ LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::gradX2_phi() LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::gradX3_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) - (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) - (phi[BE] - phi[TW])) + ((phi[TS] - phi[BN]) + (phi[TN] - phi[BS])))) + - +WEIGTH[N] * (phi[T] - phi[B])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) - (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) - (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_0MP] - phi[DIR_0PM]) + (phi[DIR_0PP] - phi[DIR_0MM])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_00P] - phi[DIR_00M])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX3[k] * phi[k]; @@ -3023,9 +3023,9 @@ LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::gradX3_phi() LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::gradX1_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) + (phi2[BSE] - phi2[TNW])) + ((phi2[TSE] - phi2[BNW]) + (phi2[BNE] - phi2[TSW]))) - + WEIGTH[NE] * (((phi2[TE] - phi2[BW]) + (phi2[BE] - phi2[TW])) + ((phi2[SE] - phi2[NW]) + (phi2[NE] - phi2[SW])))) + - +WEIGTH[N] * (phi2[E] - phi2[W])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) + (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PMP] - phi2[DIR_MPM]) + (phi2[DIR_PPM] - phi2[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_P0P] - phi2[DIR_M0M]) + (phi2[DIR_P0M] - phi2[DIR_M0P])) + ((phi2[DIR_PM0] - phi2[DIR_MP0]) + (phi2[DIR_PP0] - phi2[DIR_MM0])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_P00] - phi2[DIR_M00])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX1[k] * phi2[k]; @@ -3036,9 +3036,9 @@ LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::gradX1_phi2() LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::gradX2_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) - (phi2[BSE] - phi2[TNW])) + ((phi2[BNE] - phi2[TSW]) - (phi2[TSE] - phi2[BNW]))) - + WEIGTH[NE] * (((phi2[TN] - phi2[BS]) + (phi2[BN] - phi2[TS])) + ((phi2[NE] - phi2[SW]) - (phi2[SE] - phi2[NW])))) + - +WEIGTH[N] * (phi2[N] - phi2[S])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) - (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PPM] - phi2[DIR_MMP]) - (phi2[DIR_PMP] - phi2[DIR_MPM]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_0PP] - phi2[DIR_0MM]) + (phi2[DIR_0PM] - phi2[DIR_0MP])) + ((phi2[DIR_PP0] - phi2[DIR_MM0]) - (phi2[DIR_PM0] - phi2[DIR_MP0])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_0P0] - phi2[DIR_0M0])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX2[k] * phi2[k]; @@ -3049,9 +3049,9 @@ LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::gradX2_phi2() LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::gradX3_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) - (phi2[BSE] - phi2[TNW])) + ((phi2[TSE] - phi2[BNW]) - (phi2[BNE] - phi2[TSW]))) - + WEIGTH[NE] * (((phi2[TE] - phi2[BW]) - (phi2[BE] - phi2[TW])) + ((phi2[TS] - phi2[BN]) + (phi2[TN] - phi2[BS])))) + - +WEIGTH[N] * (phi2[T] - phi2[B])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) - (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PMP] - phi2[DIR_MPM]) - (phi2[DIR_PPM] - phi2[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_P0P] - phi2[DIR_M0M]) - (phi2[DIR_P0M] - phi2[DIR_M0P])) + ((phi2[DIR_0MP] - phi2[DIR_0PM]) + (phi2[DIR_0PP] - phi2[DIR_0MM])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_00P] - phi2[DIR_00M])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX3[k] * phi2[k]; @@ -3067,17 +3067,17 @@ LBMReal MultiphaseTwoPhaseFieldsCumulantLBMKernel::nabla2_phi() { using namespace D3Q27System; LBMReal sum = 0.0; - sum += WEIGTH[TNE] * ((((phi[TNE] - phi[REST]) + (phi[BSW] - phi[REST])) + ((phi[TSW] - phi[REST]) + (phi[BNE] - phi[REST]))) - + (((phi[TNW] - phi[REST]) + (phi[BSE] - phi[REST])) + ((phi[TSE] - phi[REST]) + (phi[BNW] - phi[REST])))); - sum += WEIGTH[TN] * ( - (((phi[TN] - phi[REST]) + (phi[BS] - phi[REST])) + ((phi[TS] - phi[REST]) + (phi[BN] - phi[REST]))) - + (((phi[TE] - phi[REST]) + (phi[BW] - phi[REST])) + ((phi[TW] - phi[REST]) + (phi[BE] - phi[REST]))) - + (((phi[NE] - phi[REST]) + (phi[SW] - phi[REST])) + ((phi[NW] - phi[REST]) + (phi[SE] - phi[REST]))) + sum += WEIGTH[DIR_PPP] * ((((phi[DIR_PPP] - phi[DIR_000]) + (phi[DIR_MMM] - phi[DIR_000])) + ((phi[DIR_MMP] - phi[DIR_000]) + (phi[DIR_PPM] - phi[DIR_000]))) + + (((phi[DIR_MPP] - phi[DIR_000]) + (phi[DIR_PMM] - phi[DIR_000])) + ((phi[DIR_PMP] - phi[DIR_000]) + (phi[DIR_MPM] - phi[DIR_000])))); + sum += WEIGTH[DIR_0PP] * ( + (((phi[DIR_0PP] - phi[DIR_000]) + (phi[DIR_0MM] - phi[DIR_000])) + ((phi[DIR_0MP] - phi[DIR_000]) + (phi[DIR_0PM] - phi[DIR_000]))) + + (((phi[DIR_P0P] - phi[DIR_000]) + (phi[DIR_M0M] - phi[DIR_000])) + ((phi[DIR_M0P] - phi[DIR_000]) + (phi[DIR_P0M] - phi[DIR_000]))) + + (((phi[DIR_PP0] - phi[DIR_000]) + (phi[DIR_MM0] - phi[DIR_000])) + ((phi[DIR_MP0] - phi[DIR_000]) + (phi[DIR_PM0] - phi[DIR_000]))) ); - sum += WEIGTH[T] * ( - ((phi[T] - phi[REST]) + (phi[B] - phi[REST])) - + ((phi[N] - phi[REST]) + (phi[S] - phi[REST])) - + ((phi[E] - phi[REST]) + (phi[W] - phi[REST])) + sum += WEIGTH[DIR_00P] * ( + ((phi[DIR_00P] - phi[DIR_000]) + (phi[DIR_00M] - phi[DIR_000])) + + ((phi[DIR_0P0] - phi[DIR_000]) + (phi[DIR_0M0] - phi[DIR_000])) + + ((phi[DIR_P00] - phi[DIR_000]) + (phi[DIR_M00] - phi[DIR_000])) ); //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * (phi[k] - phi[REST]); @@ -3107,35 +3107,35 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::computePhasefield() int x2p = x2 + 1; int x3p = x3 + 1; - h[E] = (*this->localDistributionsH1)(D3Q27System::ET_E, x1, x2, x3); - h[N] = (*this->localDistributionsH1)(D3Q27System::ET_N, x1, x2, x3); - h[T] = (*this->localDistributionsH1)(D3Q27System::ET_T, x1, x2, x3); - h[NE] = (*this->localDistributionsH1)(D3Q27System::ET_NE, x1, x2, x3); - h[NW] = (*this->localDistributionsH1)(D3Q27System::ET_NW, x1p, x2, x3); - h[TE] = (*this->localDistributionsH1)(D3Q27System::ET_TE, x1, x2, x3); - h[TW] = (*this->localDistributionsH1)(D3Q27System::ET_TW, x1p, x2, x3); - h[TN] = (*this->localDistributionsH1)(D3Q27System::ET_TN, x1, x2, x3); - h[TS] = (*this->localDistributionsH1)(D3Q27System::ET_TS, x1, x2p, x3); - h[TNE] = (*this->localDistributionsH1)(D3Q27System::ET_TNE, x1, x2, x3); - h[TNW] = (*this->localDistributionsH1)(D3Q27System::ET_TNW, x1p, x2, x3); - h[TSE] = (*this->localDistributionsH1)(D3Q27System::ET_TSE, x1, x2p, x3); - h[TSW] = (*this->localDistributionsH1)(D3Q27System::ET_TSW, x1p, x2p, x3); - - h[W] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_W, x1p, x2, x3); - h[S] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_S, x1, x2p, x3); - h[B] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_B, x1, x2, x3p); - h[SW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SW, x1p, x2p, x3); - h[SE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SE, x1, x2p, x3); - h[BW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BW, x1p, x2, x3p); - h[BE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BE, x1, x2, x3p); - h[BS] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BS, x1, x2p, x3p); - h[BN] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BN, x1, x2, x3p); - h[BSW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSW, x1p, x2p, x3p); - h[BSE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSE, x1, x2p, x3p); - h[BNW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNW, x1p, x2, x3p); - h[BNE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNE, x1, x2, x3p); - - h[REST] = (*this->zeroDistributionsH1)(x1, x2, x3); + h[DIR_P00] = (*this->localDistributionsH1)(D3Q27System::ET_E, x1, x2, x3); + h[DIR_0P0] = (*this->localDistributionsH1)(D3Q27System::ET_N, x1, x2, x3); + h[DIR_00P] = (*this->localDistributionsH1)(D3Q27System::ET_T, x1, x2, x3); + h[DIR_PP0] = (*this->localDistributionsH1)(D3Q27System::ET_NE, x1, x2, x3); + h[DIR_MP0] = (*this->localDistributionsH1)(D3Q27System::ET_NW, x1p, x2, x3); + h[DIR_P0P] = (*this->localDistributionsH1)(D3Q27System::ET_TE, x1, x2, x3); + h[DIR_M0P] = (*this->localDistributionsH1)(D3Q27System::ET_TW, x1p, x2, x3); + h[DIR_0PP] = (*this->localDistributionsH1)(D3Q27System::ET_TN, x1, x2, x3); + h[DIR_0MP] = (*this->localDistributionsH1)(D3Q27System::ET_TS, x1, x2p, x3); + h[DIR_PPP] = (*this->localDistributionsH1)(D3Q27System::ET_TNE, x1, x2, x3); + h[DIR_MPP] = (*this->localDistributionsH1)(D3Q27System::ET_TNW, x1p, x2, x3); + h[DIR_PMP] = (*this->localDistributionsH1)(D3Q27System::ET_TSE, x1, x2p, x3); + h[DIR_MMP] = (*this->localDistributionsH1)(D3Q27System::ET_TSW, x1p, x2p, x3); + + h[DIR_M00] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_W, x1p, x2, x3); + h[DIR_0M0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_S, x1, x2p, x3); + h[DIR_00M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_B, x1, x2, x3p); + h[DIR_MM0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SW, x1p, x2p, x3); + h[DIR_PM0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SE, x1, x2p, x3); + h[DIR_M0M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BW, x1p, x2, x3p); + h[DIR_P0M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BE, x1, x2, x3p); + h[DIR_0MM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BS, x1, x2p, x3p); + h[DIR_0PM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BN, x1, x2, x3p); + h[DIR_MMM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSW, x1p, x2p, x3p); + h[DIR_PMM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSE, x1, x2p, x3p); + h[DIR_MPM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNW, x1p, x2, x3p); + h[DIR_PPM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNE, x1, x2, x3p); + + h[DIR_000] = (*this->zeroDistributionsH1)(x1, x2, x3); } } } @@ -3149,7 +3149,7 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::findNeighbors(CbArray3D<LBMReal, SPtr<BCArray3D> bcArray = this->getBCProcessor()->getBCArray(); - phi[REST] = (*ph)(x1, x2, x3); + phi[DIR_000] = (*ph)(x1, x2, x3); for (int k = FSTARTDIR; k <= FENDDIR; k++) { @@ -3169,7 +3169,7 @@ void MultiphaseTwoPhaseFieldsCumulantLBMKernel::findNeighbors2(CbArray3D<LBMReal SPtr<BCArray3D> bcArray = this->getBCProcessor()->getBCArray(); - phi2[REST] = (*ph)(x1, x2, x3); + phi2[DIR_000] = (*ph)(x1, x2, x3); for (int k = FSTARTDIR; k <= FENDDIR; k++) { diff --git a/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsPressureFilterLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsPressureFilterLBMKernel.cpp index 179fc6f4d398be89481336af0c753b699828d2ee..3baddc4fef5447c83b242727276fd0ec7b64c206 100644 --- a/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsPressureFilterLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsPressureFilterLBMKernel.cpp @@ -567,13 +567,13 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) - collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[REST] - phiH) / (phiH - phiL); + collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[DIR_000] - phiH) / (phiH - phiL); - LBMReal mu = 2 * beta * phi[REST] * (phi[REST] - 1) * (2 * phi[REST] - 1) - kappa * nabla2_phi(); + LBMReal mu = 2 * beta * phi[DIR_000] * (phi[DIR_000] - 1) * (2 * phi[DIR_000] - 1) - kappa * nabla2_phi(); //----------- Calculating Macroscopic Values ------------- - LBMReal rho = rhoH + rhoToPhi * (phi[REST] - phiH); + LBMReal rho = rhoH + rhoToPhi * (phi[DIR_000] - phiH); //! variable density -> TRANSFER! //LBMReal rho = rhoH * ((*phaseField)(x1, x2, x3)) + rhoL * ((*phaseField2)(x1, x2, x3)); @@ -641,7 +641,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) // + WEIGTH[NE] * ( // (((*pressure)(x1 + 1, x2 + 1, x3) - (*pressure)(x1 - 1, x2 - 1, x3)) + ((*pressure)(x1 + 1, x2 - 1, x3) - (*pressure)(x1 - 1, x2 + 1, x3))) // + (((*pressure)(x1 + 1, x2, x3 - 1) - (*pressure)(x1 - 1, x2, x3 + 1)) + ((*pressure)(x1 + 1, x2, x3 + 1) - (*pressure)(x1 - 1, x2, x3 - 1)))) - // + WEIGTH[E] * ((*pressure)(x1 + 1, x2, x3) - (*pressure)(x1 - 1, x2, x3))); + // + WEIGTH[DIR_P00] * ((*pressure)(x1 + 1, x2, x3) - (*pressure)(x1 - 1, x2, x3))); //LBMReal gradPy = 3.0 * (WEIGTH[TNE] * ( // (((*pressure)(x1 + 1, x2 + 1, x3 + 1) - (*pressure)(x1 - 1, x2 - 1, x3 - 1)) + ((*pressure)(x1 - 1, x2 + 1, x3 + 1) - (*pressure)(x1 + 1, x2 - 1, x3 - 1))) @@ -649,7 +649,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) // + WEIGTH[NE] * ( // (((*pressure)(x1 + 1, x2 + 1, x3) - (*pressure)(x1 - 1, x2 - 1, x3)) + ((*pressure)(x1 - 1, x2 + 1, x3) - (*pressure)(x1 + 1, x2 - 1, x3))) // + (((*pressure)(x1, x2+1, x3 - 1) - (*pressure)(x1, x2-1, x3 + 1)) + ((*pressure)(x1, x2+1, x3 + 1) - (*pressure)(x1, x2-1, x3 - 1)))) - // + WEIGTH[E] * ((*pressure)(x1, x2+1, x3) - (*pressure)(x1, x2-1, x3))); + // + WEIGTH[DIR_P00] * ((*pressure)(x1, x2+1, x3) - (*pressure)(x1, x2-1, x3))); //LBMReal gradPz = 3.0 * (WEIGTH[TNE] * ( // (((*pressure)(x1 + 1, x2 + 1, x3 + 1) - (*pressure)(x1 - 1, x2 - 1, x3 - 1)) + ((*pressure)(x1 - 1, x2 + 1, x3 + 1) - (*pressure)(x1 + 1, x2 - 1, x3 - 1))) @@ -657,7 +657,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) // + WEIGTH[NE] * ( // (((*pressure)(x1 + 1, x2, x3+1) - (*pressure)(x1 - 1, x2, x3-1)) + ((*pressure)(x1 - 1, x2, x3+1) - (*pressure)(x1 + 1, x2, x3-1))) // + (((*pressure)(x1, x2 - 1, x3 + 1) - (*pressure)(x1, x2 + 1, x3 - 1)) + ((*pressure)(x1, x2 + 1, x3 + 1) - (*pressure)(x1, x2 - 1, x3 - 1)))) - // + WEIGTH[E] * ((*pressure)(x1, x2, x3+1) - (*pressure)(x1, x2, x3-1))); + // + WEIGTH[DIR_P00] * ((*pressure)(x1, x2, x3+1) - (*pressure)(x1, x2, x3-1))); LBMReal gradPx = 0.0; @@ -712,7 +712,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) } //Viscosity increase by pressure gradient - LBMReal errPhi = (((1.0 - phi[REST]) * (phi[REST]) * oneOverInterfaceScale)- denom); + LBMReal errPhi = (((1.0 - phi[DIR_000]) * (phi[DIR_000]) * oneOverInterfaceScale)- denom); //LBMReal limVis = 0.0000001*10;//0.01; // collFactorM =collFactorM/(c1+limVis*(errPhi*errPhi)*collFactorM); // collFactorM = (collFactorM < 1.8) ? 1.8 : collFactorM; @@ -835,7 +835,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) //////// // LBMReal divAfterSource= - //( mfcbb + 3.0 * (0.5 * forcingTerm[E]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF) *(vvyF) +(vvzF) *(vvzF)-1)+ + //( mfcbb + 3.0 * (0.5 * forcingTerm[DIR_P00]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF) *(vvyF) +(vvzF) *(vvzF)-1)+ //( mfbcb + 3.0 * (0.5 * forcingTerm[N]) / rho ) *((vvxF) *(vvxF) +(vvyF-1)*(vvyF-1)+(vvzF) *(vvzF)-1)+ //( mfbbc + 3.0 * (0.5 * forcingTerm[T]) / rho ) *((vvxF) *(vvxF) +(vvyF) *(vvyF) +(vvzF-1)*(vvzF-1)-1)+ //( mfccb + 3.0 * (0.5 * forcingTerm[NE]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF-1)*(vvyF-1)+(vvzF) *(vvzF)-1)+ @@ -898,7 +898,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) //if (fabs(divAfterSource - divBeforeSource)/(fabs(divAfterSource) + fabs(divBeforeSource)+1e-10) > 1e-5) { // LBMReal scaleDiv =0.95+(1-0.95)* (divBeforeSource) / (divBeforeSource - divAfterSource); - // forcingTerm[E] *=scaleDiv; + // forcingTerm[DIR_P00] *=scaleDiv; // forcingTerm[N] *=scaleDiv; // forcingTerm[T] *=scaleDiv; // forcingTerm[NE] *=scaleDiv; @@ -929,7 +929,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) //////// - //mfcbb += 3.0 * (0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; + //mfcbb += 3.0 * (0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; //mfbcb += 3.0 * (0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; //mfbbc += 3.0 * (0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; //mfccb += 3.0 * (0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; @@ -1272,7 +1272,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) LBMReal OxyyMxzz = 8.0 * (collFactorM - 2.0) * (collFactorM + OxxPyyPzz * (3.0 * collFactorM - 7.0)) / (OxxPyyPzz * (56.0 - 42.0 * collFactorM + 9.0 * collFactorM * collFactorM) - 8.0 * collFactorM); // LBMReal Oxyz = 24.0 * (collFactorM - 2.0) * (4.0 * collFactorM * collFactorM + collFactorM * OxxPyyPzz * (18.0 - 13.0 * collFactorM) + OxxPyyPzz * OxxPyyPzz * (2.0 + collFactorM * (6.0 * collFactorM - 11.0))) / (16.0 * collFactorM * collFactorM * (collFactorM - 6.0) - 2.0 * collFactorM * OxxPyyPzz * (216.0 + 5.0 * collFactorM * (9.0 * collFactorM - 46.0)) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (3.0 * collFactorM - 10.0) * (15.0 * collFactorM - 28.0) - 48.0)); LBMReal A = (4.0 * collFactorM * collFactorM + 2.0 * collFactorM * OxxPyyPzz * (collFactorM - 6.0) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (10.0 - 3.0 * collFactorM) - 4.0)) / ((collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); - //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::B' ) + //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::DIR_00M' ) LBMReal BB = (4.0 * collFactorM * OxxPyyPzz * (9.0 * collFactorM - 16.0) - 4.0 * collFactorM * collFactorM - 2.0 * OxxPyyPzz * OxxPyyPzz * (2.0 + 9.0 * collFactorM * (collFactorM - 2.0))) / (3.0 * (collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); @@ -1697,7 +1697,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) /////classical source term 8.4.2021 - //mfcbb += 3.0 * (0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; + //mfcbb += 3.0 * (0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; //mfbcb += 3.0 * (0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; //mfbbc += 3.0 * (0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; //mfccb += 3.0 * (0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; @@ -1845,7 +1845,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) // // //-------------------------------------------------------- // -// mfcbb = 3.0 * (mfcbb + 0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; +// mfcbb = 3.0 * (mfcbb + 0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; // mfbcb = 3.0 * (mfbcb + 0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; // mfbbc = 3.0 * (mfbbc + 0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; // mfccb = 3.0 * (mfccb + 0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; @@ -2553,7 +2553,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) // } //#endif // -// mfcbb = rho * c1o3 * (mfcbb) + 0.5 * forcingTerm[E]; +// mfcbb = rho * c1o3 * (mfcbb) + 0.5 * forcingTerm[DIR_P00]; // mfbcb = rho * c1o3 * (mfbcb) + 0.5 * forcingTerm[N]; // mfbbc = rho * c1o3 * (mfbbc) + 0.5 * forcingTerm[T]; // mfccb = rho * c1o3 * (mfccb) + 0.5 * forcingTerm[NE]; @@ -2780,11 +2780,11 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) cx = cx * (c1 - omegaD) + omegaD * vvx * concentration + - normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cy = cy * (c1 - omegaD) + omegaD * vvy * concentration + - normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cz = cz * (c1 - omegaD) + omegaD * vvz * concentration + - normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; //cx = cx * (c1 - omegaD) + omegaD * vvx * concentration + // normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST])*(phi[REST]+phi2[REST]) * c1o3 * oneOverInterfaceScale; @@ -3100,11 +3100,11 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) // collision of 1st order moments cx = cx * (c1 - omegaD) + omegaD * vvx * concentration + - normX1 * (c1 - 0.5 * omegaD) * ( phi[REST]) * (phi2[REST]) * c1o3 * oneOverInterfaceScale; + normX1 * (c1 - 0.5 * omegaD) * ( phi[DIR_000]) * (phi2[DIR_000]) * c1o3 * oneOverInterfaceScale; cy = cy * (c1 - omegaD) + omegaD * vvy * concentration + - normX2 * (c1 - 0.5 * omegaD) * ( phi[REST]) * (phi2[REST]) * c1o3 * oneOverInterfaceScale; + normX2 * (c1 - 0.5 * omegaD) * ( phi[DIR_000]) * (phi2[DIR_000]) * c1o3 * oneOverInterfaceScale; cz = cz * (c1 - omegaD) + omegaD * vvz * concentration + - normX3 * (c1 - 0.5 * omegaD) * ( phi[REST]) * (phi2[REST]) * c1o3 * oneOverInterfaceScale; + normX3 * (c1 - 0.5 * omegaD) * ( phi[DIR_000]) * (phi2[DIR_000]) * c1o3 * oneOverInterfaceScale; //mhx = (ux * phi[REST] + normX1 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhx; //mhy = (uy * phi[REST] + normX2 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhy; @@ -3257,7 +3257,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) ///////////////////// PHASE-FIELD BGK SOLVER /////////////////////////////// - //h[E] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); + //h[DIR_P00] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); //h[N] = (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3); //h[T] = (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3); //h[NE] = (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3); @@ -3349,9 +3349,9 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step) LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::gradX1_phi() { using namespace D3Q27System; - return 3.0* ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) + (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) + (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) + (phi[BE] - phi[TW])) + ((phi[SE] - phi[NW]) + (phi[NE] - phi[SW])))) + - +WEIGTH[N] * (phi[E] - phi[W])); + return 3.0* ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) + (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) + (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) + (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_PM0] - phi[DIR_MP0]) + (phi[DIR_PP0] - phi[DIR_MM0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_P00] - phi[DIR_M00])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX1[k] * phi[k]; @@ -3362,9 +3362,9 @@ LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::gradX1_phi() LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::gradX2_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[BNE] - phi[TSW])- (phi[TSE] - phi[BNW]))) - + WEIGTH[NE] * (((phi[TN] - phi[BS]) + (phi[BN] - phi[TS])) + ((phi[NE] - phi[SW])- (phi[SE] - phi[NW])))) + - +WEIGTH[N] * (phi[N] - phi[S])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PPM] - phi[DIR_MMP])- (phi[DIR_PMP] - phi[DIR_MPM]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_0PP] - phi[DIR_0MM]) + (phi[DIR_0PM] - phi[DIR_0MP])) + ((phi[DIR_PP0] - phi[DIR_MM0])- (phi[DIR_PM0] - phi[DIR_MP0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_0P0] - phi[DIR_0M0])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX2[k] * phi[k]; @@ -3375,9 +3375,9 @@ LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::gradX2_phi() LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::gradX3_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) - (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) - (phi[BE] - phi[TW])) + ((phi[TS] - phi[BN]) + (phi[TN] - phi[BS])))) + - +WEIGTH[N] * (phi[T] - phi[B])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) - (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) - (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_0MP] - phi[DIR_0PM]) + (phi[DIR_0PP] - phi[DIR_0MM])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_00P] - phi[DIR_00M])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX3[k] * phi[k]; @@ -3388,9 +3388,9 @@ LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::gradX3_phi() LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::gradX1_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) + (phi2[BSE] - phi2[TNW])) + ((phi2[TSE] - phi2[BNW]) + (phi2[BNE] - phi2[TSW]))) - + WEIGTH[NE] * (((phi2[TE] - phi2[BW]) + (phi2[BE] - phi2[TW])) + ((phi2[SE] - phi2[NW]) + (phi2[NE] - phi2[SW])))) + - +WEIGTH[N] * (phi2[E] - phi2[W])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) + (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PMP] - phi2[DIR_MPM]) + (phi2[DIR_PPM] - phi2[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_P0P] - phi2[DIR_M0M]) + (phi2[DIR_P0M] - phi2[DIR_M0P])) + ((phi2[DIR_PM0] - phi2[DIR_MP0]) + (phi2[DIR_PP0] - phi2[DIR_MM0])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_P00] - phi2[DIR_M00])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX1[k] * phi2[k]; @@ -3401,9 +3401,9 @@ LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::gradX1_phi2() LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::gradX2_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) - (phi2[BSE] - phi2[TNW])) + ((phi2[BNE] - phi2[TSW]) - (phi2[TSE] - phi2[BNW]))) - + WEIGTH[NE] * (((phi2[TN] - phi2[BS]) + (phi2[BN] - phi2[TS])) + ((phi2[NE] - phi2[SW]) - (phi2[SE] - phi2[NW])))) + - +WEIGTH[N] * (phi2[N] - phi2[S])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) - (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PPM] - phi2[DIR_MMP]) - (phi2[DIR_PMP] - phi2[DIR_MPM]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_0PP] - phi2[DIR_0MM]) + (phi2[DIR_0PM] - phi2[DIR_0MP])) + ((phi2[DIR_PP0] - phi2[DIR_MM0]) - (phi2[DIR_PM0] - phi2[DIR_MP0])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_0P0] - phi2[DIR_0M0])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX2[k] * phi2[k]; @@ -3414,9 +3414,9 @@ LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::gradX2_phi2() LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::gradX3_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) - (phi2[BSE] - phi2[TNW])) + ((phi2[TSE] - phi2[BNW]) - (phi2[BNE] - phi2[TSW]))) - + WEIGTH[NE] * (((phi2[TE] - phi2[BW]) - (phi2[BE] - phi2[TW])) + ((phi2[TS] - phi2[BN]) + (phi2[TN] - phi2[BS])))) + - +WEIGTH[N] * (phi2[T] - phi2[B])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) - (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PMP] - phi2[DIR_MPM]) - (phi2[DIR_PPM] - phi2[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_P0P] - phi2[DIR_M0M]) - (phi2[DIR_P0M] - phi2[DIR_M0P])) + ((phi2[DIR_0MP] - phi2[DIR_0PM]) + (phi2[DIR_0PP] - phi2[DIR_0MM])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_00P] - phi2[DIR_00M])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX3[k] * phi2[k]; @@ -3432,17 +3432,17 @@ LBMReal MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::nabla2_phi() { using namespace D3Q27System; LBMReal sum = 0.0; - sum += WEIGTH[TNE] * ((((phi[TNE] - phi[REST]) + (phi[BSW] - phi[REST])) + ((phi[TSW] - phi[REST]) + (phi[BNE] - phi[REST]))) - + (((phi[TNW] - phi[REST]) + (phi[BSE] - phi[REST])) + ((phi[TSE] - phi[REST]) + (phi[BNW] - phi[REST])))); - sum += WEIGTH[TN] * ( - (((phi[TN] - phi[REST]) + (phi[BS] - phi[REST])) + ((phi[TS] - phi[REST]) + (phi[BN] - phi[REST]))) - + (((phi[TE] - phi[REST]) + (phi[BW] - phi[REST])) + ((phi[TW] - phi[REST]) + (phi[BE] - phi[REST]))) - + (((phi[NE] - phi[REST]) + (phi[SW] - phi[REST])) + ((phi[NW] - phi[REST]) + (phi[SE] - phi[REST]))) + sum += WEIGTH[DIR_PPP] * ((((phi[DIR_PPP] - phi[DIR_000]) + (phi[DIR_MMM] - phi[DIR_000])) + ((phi[DIR_MMP] - phi[DIR_000]) + (phi[DIR_PPM] - phi[DIR_000]))) + + (((phi[DIR_MPP] - phi[DIR_000]) + (phi[DIR_PMM] - phi[DIR_000])) + ((phi[DIR_PMP] - phi[DIR_000]) + (phi[DIR_MPM] - phi[DIR_000])))); + sum += WEIGTH[DIR_0PP] * ( + (((phi[DIR_0PP] - phi[DIR_000]) + (phi[DIR_0MM] - phi[DIR_000])) + ((phi[DIR_0MP] - phi[DIR_000]) + (phi[DIR_0PM] - phi[DIR_000]))) + + (((phi[DIR_P0P] - phi[DIR_000]) + (phi[DIR_M0M] - phi[DIR_000])) + ((phi[DIR_M0P] - phi[DIR_000]) + (phi[DIR_P0M] - phi[DIR_000]))) + + (((phi[DIR_PP0] - phi[DIR_000]) + (phi[DIR_MM0] - phi[DIR_000])) + ((phi[DIR_MP0] - phi[DIR_000]) + (phi[DIR_PM0] - phi[DIR_000]))) ); - sum += WEIGTH[T] * ( - ((phi[T] - phi[REST]) + (phi[B] - phi[REST])) - + ((phi[N] - phi[REST]) + (phi[S] - phi[REST])) - + ((phi[E] - phi[REST]) + (phi[W] - phi[REST])) + sum += WEIGTH[DIR_00P] * ( + ((phi[DIR_00P] - phi[DIR_000]) + (phi[DIR_00M] - phi[DIR_000])) + + ((phi[DIR_0P0] - phi[DIR_000]) + (phi[DIR_0M0] - phi[DIR_000])) + + ((phi[DIR_P00] - phi[DIR_000]) + (phi[DIR_M00] - phi[DIR_000])) ); //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * (phi[k] - phi[REST]); @@ -3472,35 +3472,35 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::computePhasefield() int x2p = x2 + 1; int x3p = x3 + 1; - h[E] = (*this->localDistributionsH1)(D3Q27System::ET_E, x1, x2, x3); - h[N] = (*this->localDistributionsH1)(D3Q27System::ET_N, x1, x2, x3); - h[T] = (*this->localDistributionsH1)(D3Q27System::ET_T, x1, x2, x3); - h[NE] = (*this->localDistributionsH1)(D3Q27System::ET_NE, x1, x2, x3); - h[NW] = (*this->localDistributionsH1)(D3Q27System::ET_NW, x1p, x2, x3); - h[TE] = (*this->localDistributionsH1)(D3Q27System::ET_TE, x1, x2, x3); - h[TW] = (*this->localDistributionsH1)(D3Q27System::ET_TW, x1p, x2, x3); - h[TN] = (*this->localDistributionsH1)(D3Q27System::ET_TN, x1, x2, x3); - h[TS] = (*this->localDistributionsH1)(D3Q27System::ET_TS, x1, x2p, x3); - h[TNE] = (*this->localDistributionsH1)(D3Q27System::ET_TNE, x1, x2, x3); - h[TNW] = (*this->localDistributionsH1)(D3Q27System::ET_TNW, x1p, x2, x3); - h[TSE] = (*this->localDistributionsH1)(D3Q27System::ET_TSE, x1, x2p, x3); - h[TSW] = (*this->localDistributionsH1)(D3Q27System::ET_TSW, x1p, x2p, x3); - - h[W] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_W, x1p, x2, x3); - h[S] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_S, x1, x2p, x3); - h[B] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_B, x1, x2, x3p); - h[SW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SW, x1p, x2p, x3); - h[SE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SE, x1, x2p, x3); - h[BW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BW, x1p, x2, x3p); - h[BE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BE, x1, x2, x3p); - h[BS] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BS, x1, x2p, x3p); - h[BN] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BN, x1, x2, x3p); - h[BSW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSW, x1p, x2p, x3p); - h[BSE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSE, x1, x2p, x3p); - h[BNW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNW, x1p, x2, x3p); - h[BNE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNE, x1, x2, x3p); - - h[REST] = (*this->zeroDistributionsH1)(x1, x2, x3); + h[DIR_P00] = (*this->localDistributionsH1)(D3Q27System::ET_E, x1, x2, x3); + h[DIR_0P0] = (*this->localDistributionsH1)(D3Q27System::ET_N, x1, x2, x3); + h[DIR_00P] = (*this->localDistributionsH1)(D3Q27System::ET_T, x1, x2, x3); + h[DIR_PP0] = (*this->localDistributionsH1)(D3Q27System::ET_NE, x1, x2, x3); + h[DIR_MP0] = (*this->localDistributionsH1)(D3Q27System::ET_NW, x1p, x2, x3); + h[DIR_P0P] = (*this->localDistributionsH1)(D3Q27System::ET_TE, x1, x2, x3); + h[DIR_M0P] = (*this->localDistributionsH1)(D3Q27System::ET_TW, x1p, x2, x3); + h[DIR_0PP] = (*this->localDistributionsH1)(D3Q27System::ET_TN, x1, x2, x3); + h[DIR_0MP] = (*this->localDistributionsH1)(D3Q27System::ET_TS, x1, x2p, x3); + h[DIR_PPP] = (*this->localDistributionsH1)(D3Q27System::ET_TNE, x1, x2, x3); + h[DIR_MPP] = (*this->localDistributionsH1)(D3Q27System::ET_TNW, x1p, x2, x3); + h[DIR_PMP] = (*this->localDistributionsH1)(D3Q27System::ET_TSE, x1, x2p, x3); + h[DIR_MMP] = (*this->localDistributionsH1)(D3Q27System::ET_TSW, x1p, x2p, x3); + + h[DIR_M00] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_W, x1p, x2, x3); + h[DIR_0M0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_S, x1, x2p, x3); + h[DIR_00M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_B, x1, x2, x3p); + h[DIR_MM0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SW, x1p, x2p, x3); + h[DIR_PM0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SE, x1, x2p, x3); + h[DIR_M0M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BW, x1p, x2, x3p); + h[DIR_P0M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BE, x1, x2, x3p); + h[DIR_0MM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BS, x1, x2p, x3p); + h[DIR_0PM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BN, x1, x2, x3p); + h[DIR_MMM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSW, x1p, x2p, x3p); + h[DIR_PMM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSE, x1, x2p, x3p); + h[DIR_MPM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNW, x1p, x2, x3p); + h[DIR_PPM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNE, x1, x2, x3p); + + h[DIR_000] = (*this->zeroDistributionsH1)(x1, x2, x3); } } } @@ -3514,7 +3514,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::findNeighbors(CbArray3D<LB SPtr<BCArray3D> bcArray = this->getBCProcessor()->getBCArray(); - phi[REST] = (*ph)(x1, x2, x3); + phi[DIR_000] = (*ph)(x1, x2, x3); for (int k = FSTARTDIR; k <= FENDDIR; k++) { @@ -3534,7 +3534,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::findNeighbors2(CbArray3D<L SPtr<BCArray3D> bcArray = this->getBCProcessor()->getBCArray(); - phi2[REST] = (*ph)(x1, x2, x3); + phi2[DIR_000] = (*ph)(x1, x2, x3); for (int k = FSTARTDIR; k <= FENDDIR; k++) { diff --git a/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel.cpp b/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel.cpp index 294568b4f8b845e3c510e77e50eb780c1a739e4b..ffed1483ca63e674b26023aca87cb63986644813 100644 --- a/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel.cpp @@ -295,7 +295,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) + (mfaab + mfacb + mfcab + mfccb) + (mfaba + mfabc + mfcba + mfcbc) + (mfbaa + mfbac + mfbca + mfbcc) + (mfabb + mfcbb) + (mfbab + mfbcb) + (mfbba + mfbbc) + mfbbb; - LBMReal rho = rhoH + rhoToPhi * (phi[REST] - phiH); + LBMReal rho = rhoH + rhoToPhi * (phi[DIR_000] - phiH); (*pressure)(x1, x2, x3) = (*pressure)(x1, x2, x3) + rho * c1o3 * drho; ////!!!!!! relplace by pointer swap! @@ -545,13 +545,13 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) - collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[REST] - phiH) / (phiH - phiL); + collFactorM = collFactorL + (collFactorL - collFactorG) * (phi[DIR_000] - phiH) / (phiH - phiL); - LBMReal mu = 2 * beta * phi[REST] * (phi[REST] - 1) * (2 * phi[REST] - 1) - kappa * nabla2_phi(); + LBMReal mu = 2 * beta * phi[DIR_000] * (phi[DIR_000] - 1) * (2 * phi[DIR_000] - 1) - kappa * nabla2_phi(); //----------- Calculating Macroscopic Values ------------- - LBMReal rho = rhoH + rhoToPhi * (phi[REST] - phiH); + LBMReal rho = rhoH + rhoToPhi * (phi[DIR_000] - phiH); ////Incompressible Kernal @@ -615,7 +615,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) // + WEIGTH[NE] * ( // (((*pressure)(x1 + 1, x2 + 1, x3) - (*pressure)(x1 - 1, x2 - 1, x3)) + ((*pressure)(x1 + 1, x2 - 1, x3) - (*pressure)(x1 - 1, x2 + 1, x3))) // + (((*pressure)(x1 + 1, x2, x3 - 1) - (*pressure)(x1 - 1, x2, x3 + 1)) + ((*pressure)(x1 + 1, x2, x3 + 1) - (*pressure)(x1 - 1, x2, x3 - 1)))) - // + WEIGTH[E] * ((*pressure)(x1 + 1, x2, x3) - (*pressure)(x1 - 1, x2, x3))); + // + WEIGTH[DIR_P00] * ((*pressure)(x1 + 1, x2, x3) - (*pressure)(x1 - 1, x2, x3))); //LBMReal gradPy = 3.0 * (WEIGTH[TNE] * ( // (((*pressure)(x1 + 1, x2 + 1, x3 + 1) - (*pressure)(x1 - 1, x2 - 1, x3 - 1)) + ((*pressure)(x1 - 1, x2 + 1, x3 + 1) - (*pressure)(x1 + 1, x2 - 1, x3 - 1))) @@ -623,7 +623,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) // + WEIGTH[NE] * ( // (((*pressure)(x1 + 1, x2 + 1, x3) - (*pressure)(x1 - 1, x2 - 1, x3)) + ((*pressure)(x1 - 1, x2 + 1, x3) - (*pressure)(x1 + 1, x2 - 1, x3))) // + (((*pressure)(x1, x2+1, x3 - 1) - (*pressure)(x1, x2-1, x3 + 1)) + ((*pressure)(x1, x2+1, x3 + 1) - (*pressure)(x1, x2-1, x3 - 1)))) - // + WEIGTH[E] * ((*pressure)(x1, x2+1, x3) - (*pressure)(x1, x2-1, x3))); + // + WEIGTH[DIR_P00] * ((*pressure)(x1, x2+1, x3) - (*pressure)(x1, x2-1, x3))); //LBMReal gradPz = 3.0 * (WEIGTH[TNE] * ( // (((*pressure)(x1 + 1, x2 + 1, x3 + 1) - (*pressure)(x1 - 1, x2 - 1, x3 - 1)) + ((*pressure)(x1 - 1, x2 + 1, x3 + 1) - (*pressure)(x1 + 1, x2 - 1, x3 - 1))) @@ -631,7 +631,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) // + WEIGTH[NE] * ( // (((*pressure)(x1 + 1, x2, x3+1) - (*pressure)(x1 - 1, x2, x3-1)) + ((*pressure)(x1 - 1, x2, x3+1) - (*pressure)(x1 + 1, x2, x3-1))) // + (((*pressure)(x1, x2 - 1, x3 + 1) - (*pressure)(x1, x2 + 1, x3 - 1)) + ((*pressure)(x1, x2 + 1, x3 + 1) - (*pressure)(x1, x2 - 1, x3 - 1)))) - // + WEIGTH[E] * ((*pressure)(x1, x2, x3+1) - (*pressure)(x1, x2, x3-1))); + // + WEIGTH[DIR_P00] * ((*pressure)(x1, x2, x3+1) - (*pressure)(x1, x2, x3-1))); LBMReal gradPx = 0.0; @@ -793,7 +793,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) //////// // LBMReal divAfterSource= - //( mfcbb + 3.0 * (0.5 * forcingTerm[E]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF) *(vvyF) +(vvzF) *(vvzF)-1)+ + //( mfcbb + 3.0 * (0.5 * forcingTerm[DIR_P00]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF) *(vvyF) +(vvzF) *(vvzF)-1)+ //( mfbcb + 3.0 * (0.5 * forcingTerm[N]) / rho ) *((vvxF) *(vvxF) +(vvyF-1)*(vvyF-1)+(vvzF) *(vvzF)-1)+ //( mfbbc + 3.0 * (0.5 * forcingTerm[T]) / rho ) *((vvxF) *(vvxF) +(vvyF) *(vvyF) +(vvzF-1)*(vvzF-1)-1)+ //( mfccb + 3.0 * (0.5 * forcingTerm[NE]) / rho ) *((vvxF-1)*(vvxF-1)+(vvyF-1)*(vvyF-1)+(vvzF) *(vvzF)-1)+ @@ -856,7 +856,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) //if (fabs(divAfterSource - divBeforeSource)/(fabs(divAfterSource) + fabs(divBeforeSource)+1e-10) > 1e-5) { // LBMReal scaleDiv =0.95+(1-0.95)* (divBeforeSource) / (divBeforeSource - divAfterSource); - // forcingTerm[E] *=scaleDiv; + // forcingTerm[DIR_P00] *=scaleDiv; // forcingTerm[N] *=scaleDiv; // forcingTerm[T] *=scaleDiv; // forcingTerm[NE] *=scaleDiv; @@ -887,7 +887,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) //////// - //mfcbb += 3.0 * (0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; + //mfcbb += 3.0 * (0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; //mfbcb += 3.0 * (0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; //mfbbc += 3.0 * (0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; //mfccb += 3.0 * (0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; @@ -1230,7 +1230,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) LBMReal OxyyMxzz = 8.0 * (collFactorM - 2.0) * (collFactorM + OxxPyyPzz * (3.0 * collFactorM - 7.0)) / (OxxPyyPzz * (56.0 - 42.0 * collFactorM + 9.0 * collFactorM * collFactorM) - 8.0 * collFactorM); // LBMReal Oxyz = 24.0 * (collFactorM - 2.0) * (4.0 * collFactorM * collFactorM + collFactorM * OxxPyyPzz * (18.0 - 13.0 * collFactorM) + OxxPyyPzz * OxxPyyPzz * (2.0 + collFactorM * (6.0 * collFactorM - 11.0))) / (16.0 * collFactorM * collFactorM * (collFactorM - 6.0) - 2.0 * collFactorM * OxxPyyPzz * (216.0 + 5.0 * collFactorM * (9.0 * collFactorM - 46.0)) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (3.0 * collFactorM - 10.0) * (15.0 * collFactorM - 28.0) - 48.0)); LBMReal A = (4.0 * collFactorM * collFactorM + 2.0 * collFactorM * OxxPyyPzz * (collFactorM - 6.0) + OxxPyyPzz * OxxPyyPzz * (collFactorM * (10.0 - 3.0 * collFactorM) - 4.0)) / ((collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); - //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::B' ) + //FIXME: warning C4459: declaration of 'B' hides global declaration (message : see declaration of 'D3Q27System::DIR_00M' ) LBMReal BB = (4.0 * collFactorM * OxxPyyPzz * (9.0 * collFactorM - 16.0) - 4.0 * collFactorM * collFactorM - 2.0 * OxxPyyPzz * OxxPyyPzz * (2.0 + 9.0 * collFactorM * (collFactorM - 2.0))) / (3.0 * (collFactorM - OxxPyyPzz) * (OxxPyyPzz * (2.0 + 3.0 * collFactorM) - 8.0 * collFactorM)); @@ -1642,7 +1642,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) /////classical source term 8.4.2021 - //mfcbb += 3.0 * (0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; + //mfcbb += 3.0 * (0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; //mfbcb += 3.0 * (0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; //mfbbc += 3.0 * (0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; //mfccb += 3.0 * (0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; @@ -1784,7 +1784,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) // // //-------------------------------------------------------- // -// mfcbb = 3.0 * (mfcbb + 0.5 * forcingTerm[E]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; +// mfcbb = 3.0 * (mfcbb + 0.5 * forcingTerm[DIR_P00]) / rho; //-(3.0*p1 - rho)*WEIGTH[E ]; // mfbcb = 3.0 * (mfbcb + 0.5 * forcingTerm[N]) / rho; //-(3.0*p1 - rho)*WEIGTH[N ]; // mfbbc = 3.0 * (mfbbc + 0.5 * forcingTerm[T]) / rho; //-(3.0*p1 - rho)*WEIGTH[T ]; // mfccb = 3.0 * (mfccb + 0.5 * forcingTerm[NE]) / rho; //-(3.0*p1 - rho)*WEIGTH[NE ]; @@ -2492,7 +2492,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) // } //#endif // -// mfcbb = rho * c1o3 * (mfcbb) + 0.5 * forcingTerm[E]; +// mfcbb = rho * c1o3 * (mfcbb) + 0.5 * forcingTerm[DIR_P00]; // mfbcb = rho * c1o3 * (mfbcb) + 0.5 * forcingTerm[N]; // mfbbc = rho * c1o3 * (mfbbc) + 0.5 * forcingTerm[T]; // mfccb = rho * c1o3 * (mfccb) + 0.5 * forcingTerm[NE]; @@ -2719,11 +2719,11 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) cx = cx * (c1 - omegaD) + omegaD * vvx * concentration + - normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX1 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cy = cy * (c1 - omegaD) + omegaD * vvy * concentration + - normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX2 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; cz = cz * (c1 - omegaD) + omegaD * vvz * concentration + - normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[REST]) * (phi[REST]) * c1o3 * oneOverInterfaceScale; + normX3 * (c1 - 0.5 * omegaD) * (1.0 - phi[DIR_000]) * (phi[DIR_000]) * c1o3 * oneOverInterfaceScale; //mhx = (ux * phi[REST] + normX1 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhx; //mhy = (uy * phi[REST] + normX2 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhy; @@ -3032,11 +3032,11 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) // collision of 1st order moments cx = cx * (c1 - omegaD) + omegaD * vvx * concentration + - normX1 * (c1 - 0.5 * omegaD) * ( phi[REST]) * (phi2[REST]) * c1o3 * oneOverInterfaceScale; + normX1 * (c1 - 0.5 * omegaD) * ( phi[DIR_000]) * (phi2[DIR_000]) * c1o3 * oneOverInterfaceScale; cy = cy * (c1 - omegaD) + omegaD * vvy * concentration + - normX2 * (c1 - 0.5 * omegaD) * ( phi[REST]) * (phi2[REST]) * c1o3 * oneOverInterfaceScale; + normX2 * (c1 - 0.5 * omegaD) * ( phi[DIR_000]) * (phi2[DIR_000]) * c1o3 * oneOverInterfaceScale; cz = cz * (c1 - omegaD) + omegaD * vvz * concentration + - normX3 * (c1 - 0.5 * omegaD) * ( phi[REST]) * (phi2[REST]) * c1o3 * oneOverInterfaceScale; + normX3 * (c1 - 0.5 * omegaD) * ( phi[DIR_000]) * (phi2[DIR_000]) * c1o3 * oneOverInterfaceScale; //mhx = (ux * phi[REST] + normX1 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhx; //mhy = (uy * phi[REST] + normX2 * (tauH - 0.5) * (1.0 - phi[REST]) * (phi[REST])) / tauH + (1.0 - 1.0 / tauH) * mhy; @@ -3189,7 +3189,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) ///////////////////// PHASE-FIELD BGK SOLVER /////////////////////////////// - //h[E] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); + //h[DIR_P00] = (*this->localDistributionsH)(D3Q27System::ET_E, x1, x2, x3); //h[N] = (*this->localDistributionsH)(D3Q27System::ET_N, x1, x2, x3); //h[T] = (*this->localDistributionsH)(D3Q27System::ET_T, x1, x2, x3); //h[NE] = (*this->localDistributionsH)(D3Q27System::ET_NE, x1, x2, x3); @@ -3281,9 +3281,9 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::calculate(int step) LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::gradX1_phi() { using namespace D3Q27System; - return 3.0* ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) + (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) + (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) + (phi[BE] - phi[TW])) + ((phi[SE] - phi[NW]) + (phi[NE] - phi[SW])))) + - +WEIGTH[N] * (phi[E] - phi[W])); + return 3.0* ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) + (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) + (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) + (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_PM0] - phi[DIR_MP0]) + (phi[DIR_PP0] - phi[DIR_MM0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_P00] - phi[DIR_M00])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX1[k] * phi[k]; @@ -3294,9 +3294,9 @@ LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::gradX1_phi() LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::gradX2_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[BNE] - phi[TSW])- (phi[TSE] - phi[BNW]))) - + WEIGTH[NE] * (((phi[TN] - phi[BS]) + (phi[BN] - phi[TS])) + ((phi[NE] - phi[SW])- (phi[SE] - phi[NW])))) + - +WEIGTH[N] * (phi[N] - phi[S])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PPM] - phi[DIR_MMP])- (phi[DIR_PMP] - phi[DIR_MPM]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_0PP] - phi[DIR_0MM]) + (phi[DIR_0PM] - phi[DIR_0MP])) + ((phi[DIR_PP0] - phi[DIR_MM0])- (phi[DIR_PM0] - phi[DIR_MP0])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_0P0] - phi[DIR_0M0])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX2[k] * phi[k]; @@ -3307,9 +3307,9 @@ LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::gradX2_phi() LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::gradX3_phi() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi[TNE] - phi[BSW]) - (phi[BSE] - phi[TNW])) + ((phi[TSE] - phi[BNW]) - (phi[BNE] - phi[TSW]))) - + WEIGTH[NE] * (((phi[TE] - phi[BW]) - (phi[BE] - phi[TW])) + ((phi[TS] - phi[BN]) + (phi[TN] - phi[BS])))) + - +WEIGTH[N] * (phi[T] - phi[B])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi[DIR_PPP] - phi[DIR_MMM]) - (phi[DIR_PMM] - phi[DIR_MPP])) + ((phi[DIR_PMP] - phi[DIR_MPM]) - (phi[DIR_PPM] - phi[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi[DIR_P0P] - phi[DIR_M0M]) - (phi[DIR_P0M] - phi[DIR_M0P])) + ((phi[DIR_0MP] - phi[DIR_0PM]) + (phi[DIR_0PP] - phi[DIR_0MM])))) + + +WEIGTH[DIR_0P0] * (phi[DIR_00P] - phi[DIR_00M])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX3[k] * phi[k]; @@ -3320,9 +3320,9 @@ LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::gradX3_phi() LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::gradX1_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) + (phi2[BSE] - phi2[TNW])) + ((phi2[TSE] - phi2[BNW]) + (phi2[BNE] - phi2[TSW]))) - + WEIGTH[NE] * (((phi2[TE] - phi2[BW]) + (phi2[BE] - phi2[TW])) + ((phi2[SE] - phi2[NW]) + (phi2[NE] - phi2[SW])))) + - +WEIGTH[N] * (phi2[E] - phi2[W])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) + (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PMP] - phi2[DIR_MPM]) + (phi2[DIR_PPM] - phi2[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_P0P] - phi2[DIR_M0M]) + (phi2[DIR_P0M] - phi2[DIR_M0P])) + ((phi2[DIR_PM0] - phi2[DIR_MP0]) + (phi2[DIR_PP0] - phi2[DIR_MM0])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_P00] - phi2[DIR_M00])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX1[k] * phi2[k]; @@ -3333,9 +3333,9 @@ LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::gradX1_phi2() LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::gradX2_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) - (phi2[BSE] - phi2[TNW])) + ((phi2[BNE] - phi2[TSW]) - (phi2[TSE] - phi2[BNW]))) - + WEIGTH[NE] * (((phi2[TN] - phi2[BS]) + (phi2[BN] - phi2[TS])) + ((phi2[NE] - phi2[SW]) - (phi2[SE] - phi2[NW])))) + - +WEIGTH[N] * (phi2[N] - phi2[S])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) - (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PPM] - phi2[DIR_MMP]) - (phi2[DIR_PMP] - phi2[DIR_MPM]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_0PP] - phi2[DIR_0MM]) + (phi2[DIR_0PM] - phi2[DIR_0MP])) + ((phi2[DIR_PP0] - phi2[DIR_MM0]) - (phi2[DIR_PM0] - phi2[DIR_MP0])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_0P0] - phi2[DIR_0M0])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX2[k] * phi2[k]; @@ -3346,9 +3346,9 @@ LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::gradX2_phi2() LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::gradX3_phi2() { using namespace D3Q27System; - return 3.0 * ((WEIGTH[TNE] * (((phi2[TNE] - phi2[BSW]) - (phi2[BSE] - phi2[TNW])) + ((phi2[TSE] - phi2[BNW]) - (phi2[BNE] - phi2[TSW]))) - + WEIGTH[NE] * (((phi2[TE] - phi2[BW]) - (phi2[BE] - phi2[TW])) + ((phi2[TS] - phi2[BN]) + (phi2[TN] - phi2[BS])))) + - +WEIGTH[N] * (phi2[T] - phi2[B])); + return 3.0 * ((WEIGTH[DIR_PPP] * (((phi2[DIR_PPP] - phi2[DIR_MMM]) - (phi2[DIR_PMM] - phi2[DIR_MPP])) + ((phi2[DIR_PMP] - phi2[DIR_MPM]) - (phi2[DIR_PPM] - phi2[DIR_MMP]))) + + WEIGTH[DIR_PP0] * (((phi2[DIR_P0P] - phi2[DIR_M0M]) - (phi2[DIR_P0M] - phi2[DIR_M0P])) + ((phi2[DIR_0MP] - phi2[DIR_0PM]) + (phi2[DIR_0PP] - phi2[DIR_0MM])))) + + +WEIGTH[DIR_0P0] * (phi2[DIR_00P] - phi2[DIR_00M])); //LBMReal sum = 0.0; //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * DX3[k] * phi2[k]; @@ -3364,17 +3364,17 @@ LBMReal MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::nabla2_phi() { using namespace D3Q27System; LBMReal sum = 0.0; - sum += WEIGTH[TNE] * ((((phi[TNE] - phi[REST]) + (phi[BSW] - phi[REST])) + ((phi[TSW] - phi[REST]) + (phi[BNE] - phi[REST]))) - + (((phi[TNW] - phi[REST]) + (phi[BSE] - phi[REST])) + ((phi[TSE] - phi[REST]) + (phi[BNW] - phi[REST])))); - sum += WEIGTH[TN] * ( - (((phi[TN] - phi[REST]) + (phi[BS] - phi[REST])) + ((phi[TS] - phi[REST]) + (phi[BN] - phi[REST]))) - + (((phi[TE] - phi[REST]) + (phi[BW] - phi[REST])) + ((phi[TW] - phi[REST]) + (phi[BE] - phi[REST]))) - + (((phi[NE] - phi[REST]) + (phi[SW] - phi[REST])) + ((phi[NW] - phi[REST]) + (phi[SE] - phi[REST]))) + sum += WEIGTH[DIR_PPP] * ((((phi[DIR_PPP] - phi[DIR_000]) + (phi[DIR_MMM] - phi[DIR_000])) + ((phi[DIR_MMP] - phi[DIR_000]) + (phi[DIR_PPM] - phi[DIR_000]))) + + (((phi[DIR_MPP] - phi[DIR_000]) + (phi[DIR_PMM] - phi[DIR_000])) + ((phi[DIR_PMP] - phi[DIR_000]) + (phi[DIR_MPM] - phi[DIR_000])))); + sum += WEIGTH[DIR_0PP] * ( + (((phi[DIR_0PP] - phi[DIR_000]) + (phi[DIR_0MM] - phi[DIR_000])) + ((phi[DIR_0MP] - phi[DIR_000]) + (phi[DIR_0PM] - phi[DIR_000]))) + + (((phi[DIR_P0P] - phi[DIR_000]) + (phi[DIR_M0M] - phi[DIR_000])) + ((phi[DIR_M0P] - phi[DIR_000]) + (phi[DIR_P0M] - phi[DIR_000]))) + + (((phi[DIR_PP0] - phi[DIR_000]) + (phi[DIR_MM0] - phi[DIR_000])) + ((phi[DIR_MP0] - phi[DIR_000]) + (phi[DIR_PM0] - phi[DIR_000]))) ); - sum += WEIGTH[T] * ( - ((phi[T] - phi[REST]) + (phi[B] - phi[REST])) - + ((phi[N] - phi[REST]) + (phi[S] - phi[REST])) - + ((phi[E] - phi[REST]) + (phi[W] - phi[REST])) + sum += WEIGTH[DIR_00P] * ( + ((phi[DIR_00P] - phi[DIR_000]) + (phi[DIR_00M] - phi[DIR_000])) + + ((phi[DIR_0P0] - phi[DIR_000]) + (phi[DIR_0M0] - phi[DIR_000])) + + ((phi[DIR_P00] - phi[DIR_000]) + (phi[DIR_M00] - phi[DIR_000])) ); //for (int k = FSTARTDIR; k <= FENDDIR; k++) { // sum += WEIGTH[k] * (phi[k] - phi[REST]); @@ -3404,35 +3404,35 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::computePhasefield() int x2p = x2 + 1; int x3p = x3 + 1; - h[E] = (*this->localDistributionsH1)(D3Q27System::ET_E, x1, x2, x3); - h[N] = (*this->localDistributionsH1)(D3Q27System::ET_N, x1, x2, x3); - h[T] = (*this->localDistributionsH1)(D3Q27System::ET_T, x1, x2, x3); - h[NE] = (*this->localDistributionsH1)(D3Q27System::ET_NE, x1, x2, x3); - h[NW] = (*this->localDistributionsH1)(D3Q27System::ET_NW, x1p, x2, x3); - h[TE] = (*this->localDistributionsH1)(D3Q27System::ET_TE, x1, x2, x3); - h[TW] = (*this->localDistributionsH1)(D3Q27System::ET_TW, x1p, x2, x3); - h[TN] = (*this->localDistributionsH1)(D3Q27System::ET_TN, x1, x2, x3); - h[TS] = (*this->localDistributionsH1)(D3Q27System::ET_TS, x1, x2p, x3); - h[TNE] = (*this->localDistributionsH1)(D3Q27System::ET_TNE, x1, x2, x3); - h[TNW] = (*this->localDistributionsH1)(D3Q27System::ET_TNW, x1p, x2, x3); - h[TSE] = (*this->localDistributionsH1)(D3Q27System::ET_TSE, x1, x2p, x3); - h[TSW] = (*this->localDistributionsH1)(D3Q27System::ET_TSW, x1p, x2p, x3); - - h[W] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_W, x1p, x2, x3); - h[S] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_S, x1, x2p, x3); - h[B] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_B, x1, x2, x3p); - h[SW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SW, x1p, x2p, x3); - h[SE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SE, x1, x2p, x3); - h[BW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BW, x1p, x2, x3p); - h[BE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BE, x1, x2, x3p); - h[BS] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BS, x1, x2p, x3p); - h[BN] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BN, x1, x2, x3p); - h[BSW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSW, x1p, x2p, x3p); - h[BSE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSE, x1, x2p, x3p); - h[BNW] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNW, x1p, x2, x3p); - h[BNE] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNE, x1, x2, x3p); - - h[REST] = (*this->zeroDistributionsH1)(x1, x2, x3); + h[DIR_P00] = (*this->localDistributionsH1)(D3Q27System::ET_E, x1, x2, x3); + h[DIR_0P0] = (*this->localDistributionsH1)(D3Q27System::ET_N, x1, x2, x3); + h[DIR_00P] = (*this->localDistributionsH1)(D3Q27System::ET_T, x1, x2, x3); + h[DIR_PP0] = (*this->localDistributionsH1)(D3Q27System::ET_NE, x1, x2, x3); + h[DIR_MP0] = (*this->localDistributionsH1)(D3Q27System::ET_NW, x1p, x2, x3); + h[DIR_P0P] = (*this->localDistributionsH1)(D3Q27System::ET_TE, x1, x2, x3); + h[DIR_M0P] = (*this->localDistributionsH1)(D3Q27System::ET_TW, x1p, x2, x3); + h[DIR_0PP] = (*this->localDistributionsH1)(D3Q27System::ET_TN, x1, x2, x3); + h[DIR_0MP] = (*this->localDistributionsH1)(D3Q27System::ET_TS, x1, x2p, x3); + h[DIR_PPP] = (*this->localDistributionsH1)(D3Q27System::ET_TNE, x1, x2, x3); + h[DIR_MPP] = (*this->localDistributionsH1)(D3Q27System::ET_TNW, x1p, x2, x3); + h[DIR_PMP] = (*this->localDistributionsH1)(D3Q27System::ET_TSE, x1, x2p, x3); + h[DIR_MMP] = (*this->localDistributionsH1)(D3Q27System::ET_TSW, x1p, x2p, x3); + + h[DIR_M00] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_W, x1p, x2, x3); + h[DIR_0M0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_S, x1, x2p, x3); + h[DIR_00M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_B, x1, x2, x3p); + h[DIR_MM0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SW, x1p, x2p, x3); + h[DIR_PM0] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_SE, x1, x2p, x3); + h[DIR_M0M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BW, x1p, x2, x3p); + h[DIR_P0M] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BE, x1, x2, x3p); + h[DIR_0MM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BS, x1, x2p, x3p); + h[DIR_0PM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BN, x1, x2, x3p); + h[DIR_MMM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSW, x1p, x2p, x3p); + h[DIR_PMM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BSE, x1, x2p, x3p); + h[DIR_MPM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNW, x1p, x2, x3p); + h[DIR_PPM] = (*this->nonLocalDistributionsH1)(D3Q27System::ET_BNE, x1, x2, x3p); + + h[DIR_000] = (*this->zeroDistributionsH1)(x1, x2, x3); } } } @@ -3446,7 +3446,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::findNeighbors(CbArray3D< SPtr<BCArray3D> bcArray = this->getBCProcessor()->getBCArray(); - phi[REST] = (*ph)(x1, x2, x3); + phi[DIR_000] = (*ph)(x1, x2, x3); for (int k = FSTARTDIR; k <= FENDDIR; k++) { @@ -3466,7 +3466,7 @@ void MultiphaseTwoPhaseFieldsVelocityCumulantLBMKernel::findNeighbors2(CbArray3D SPtr<BCArray3D> bcArray = this->getBCProcessor()->getBCArray(); - phi2[REST] = (*ph)(x1, x2, x3); + phi2[DIR_000] = (*ph)(x1, x2, x3); for (int k = FSTARTDIR; k <= FENDDIR; k++) { diff --git a/src/cpu/VirtualFluidsCore/LBM/RheologyInterpolationProcessor.cpp b/src/cpu/VirtualFluidsCore/LBM/RheologyInterpolationProcessor.cpp index 7ee35063f0cfeb9379313a38b9eeb6f0e6388d49..09cd40c8eceb10fa57ba136ea5f1439211f928ab 100644 --- a/src/cpu/VirtualFluidsCore/LBM/RheologyInterpolationProcessor.cpp +++ b/src/cpu/VirtualFluidsCore/LBM/RheologyInterpolationProcessor.cpp @@ -121,11 +121,11 @@ void RheologyInterpolationProcessor::calcMoments(const LBMReal* const f, LBMReal press = rho; //interpolate rho! - kxy = -3.*omega*((((f[TSW]+f[BNE])-(f[TNW]+f[BSE]))+((f[BSW]+f[TNE])-(f[BNW]+f[TSE])))+((f[SW]+f[NE])-(f[NW]+f[SE]))-(vx1*vx2));// might not be optimal MG 25.2.13 - kyz = -3.*omega*((((f[BSW]+f[TNE])-(f[TSE]+f[BNW]))+((f[BSE]+f[TNW])-(f[TSW]+f[BNE])))+((f[BS]+f[TN])-(f[TS]+f[BN]))-(vx2*vx3)); - kxz = -3.*omega*((((f[BNW]+f[TSE])-(f[TSW]+f[BNE]))+((f[BSW]+f[TNE])-(f[BSE]+f[TNW])))+((f[BW]+f[TE])-(f[TW]+f[BE]))-(vx1*vx3)); - kxxMyy = -3./2.*omega*((((f[D3Q27System::BW]+f[TE])-(f[BS]+f[TN]))+((f[TW]+f[BE])-(f[TS]+f[BN])))+((f[W]+f[E])-(f[S]+f[N]))-(vx1*vx1-vx2*vx2)); - kxxMzz = -3./2.*omega*((((f[NW]+f[SE])-(f[BS]+f[TN]))+((f[SW]+f[NE])-(f[TS]+f[BN])))+((f[W]+f[E])-(f[B]+f[T]))-(vx1*vx1-vx3*vx3)); + kxy = -3.*omega*((((f[DIR_MMP]+f[DIR_PPM])-(f[DIR_MPP]+f[DIR_PMM]))+((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_MPM]+f[DIR_PMP])))+((f[DIR_MM0]+f[DIR_PP0])-(f[DIR_MP0]+f[DIR_PM0]))-(vx1*vx2));// might not be optimal MG 25.2.13 + kyz = -3.*omega*((((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_PMP]+f[DIR_MPM]))+((f[DIR_PMM]+f[DIR_MPP])-(f[DIR_MMP]+f[DIR_PPM])))+((f[DIR_0MM]+f[DIR_0PP])-(f[DIR_0MP]+f[DIR_0PM]))-(vx2*vx3)); + kxz = -3.*omega*((((f[DIR_MPM]+f[DIR_PMP])-(f[DIR_MMP]+f[DIR_PPM]))+((f[DIR_MMM]+f[DIR_PPP])-(f[DIR_PMM]+f[DIR_MPP])))+((f[DIR_M0M]+f[DIR_P0P])-(f[DIR_M0P]+f[DIR_P0M]))-(vx1*vx3)); + kxxMyy = -3./2.*omega*((((f[D3Q27System::DIR_M0M]+f[DIR_P0P])-(f[DIR_0MM]+f[DIR_0PP]))+((f[DIR_M0P]+f[DIR_P0M])-(f[DIR_0MP]+f[DIR_0PM])))+((f[DIR_M00]+f[DIR_P00])-(f[DIR_0M0]+f[DIR_0P0]))-(vx1*vx1-vx2*vx2)); + kxxMzz = -3./2.*omega*((((f[DIR_MP0]+f[DIR_PM0])-(f[DIR_0MM]+f[DIR_0PP]))+((f[DIR_MM0]+f[DIR_PP0])-(f[DIR_0MP]+f[DIR_0PM])))+((f[DIR_M00]+f[DIR_P00])-(f[DIR_00M]+f[DIR_00P]))-(vx1*vx1-vx3*vx3)); } ////////////////////////////////////////////////////////////////////////// void RheologyInterpolationProcessor::calcInterpolatedCoefficiets_intern(const D3Q27ICell& icell, @@ -443,33 +443,33 @@ void RheologyInterpolationProcessor::calcInterpolatedNode(LBMReal* f, /*LBMReal LBMReal feq[ENDF+1]; D3Q27System::calcIncompFeq(feq,rho,vx1,vx2,vx3); - f[E] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[E]; - f[W] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[W]; - f[N] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[N]; - f[S] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[S]; - f[T] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[T]; - f[B] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[B]; - f[NE] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[NE]; - f[SW] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[SW]; - f[SE] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[SE]; - f[NW] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[NW]; - f[TE] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[TE]; - f[BW] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[BW]; - f[BE] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[BE]; - f[TW] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[TW]; - f[TN] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[TN]; - f[BS] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[BS]; - f[BN] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[BN]; - f[TS] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[TS]; - f[TNE] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[TNE]; - f[TSW] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[TSW]; - f[TSE] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[TSE]; - f[TNW] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[TNW]; - f[BNE] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[BNE]; - f[BSW] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[BSW]; - f[BSE] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[BSE]; - f[BNW] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[BNW]; - f[REST] = f_ZERO + xs*x_ZERO + ys*y_ZERO + zs*z_ZERO + feq[REST]; + f[DIR_P00] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[DIR_P00]; + f[DIR_M00] = f_E + xs*x_E + ys*y_E + zs*z_E + xs*ys*xy_E + xs*zs*xz_E + ys*zs*yz_E + feq[DIR_M00]; + f[DIR_0P0] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[DIR_0P0]; + f[DIR_0M0] = f_N + xs*x_N + ys*y_N + zs*z_N + xs*ys*xy_N + xs*zs*xz_N + ys*zs*yz_N + feq[DIR_0M0]; + f[DIR_00P] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[DIR_00P]; + f[DIR_00M] = f_T + xs*x_T + ys*y_T + zs*z_T + xs*ys*xy_T + xs*zs*xz_T + ys*zs*yz_T + feq[DIR_00M]; + f[DIR_PP0] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[DIR_PP0]; + f[DIR_MM0] = f_NE + xs*x_NE + ys*y_NE + zs*z_NE + xs*ys*xy_NE + xs*zs*xz_NE + ys*zs*yz_NE + feq[DIR_MM0]; + f[DIR_PM0] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[DIR_PM0]; + f[DIR_MP0] = f_SE + xs*x_SE + ys*y_SE + zs*z_SE + xs*ys*xy_SE + xs*zs*xz_SE + ys*zs*yz_SE + feq[DIR_MP0]; + f[DIR_P0P] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[DIR_P0P]; + f[DIR_M0M] = f_TE + xs*x_TE + ys*y_TE + zs*z_TE + xs*ys*xy_TE + xs*zs*xz_TE + ys*zs*yz_TE + feq[DIR_M0M]; + f[DIR_P0M] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[DIR_P0M]; + f[DIR_M0P] = f_BE + xs*x_BE + ys*y_BE + zs*z_BE + xs*ys*xy_BE + xs*zs*xz_BE + ys*zs*yz_BE + feq[DIR_M0P]; + f[DIR_0PP] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[DIR_0PP]; + f[DIR_0MM] = f_TN + xs*x_TN + ys*y_TN + zs*z_TN + xs*ys*xy_TN + xs*zs*xz_TN + ys*zs*yz_TN + feq[DIR_0MM]; + f[DIR_0PM] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[DIR_0PM]; + f[DIR_0MP] = f_BN + xs*x_BN + ys*y_BN + zs*z_BN + xs*ys*xy_BN + xs*zs*xz_BN + ys*zs*yz_BN + feq[DIR_0MP]; + f[DIR_PPP] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[DIR_PPP]; + f[DIR_MMP] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[DIR_MMP]; + f[DIR_PMP] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[DIR_PMP]; + f[DIR_MPP] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[DIR_MPP]; + f[DIR_PPM] = f_TSW + xs*x_TSW + ys*y_TSW + zs*z_TSW + xs*ys*xy_TSW + xs*zs*xz_TSW + ys*zs*yz_TSW + feq[DIR_PPM]; + f[DIR_MMM] = f_TNE + xs*x_TNE + ys*y_TNE + zs*z_TNE + xs*ys*xy_TNE + xs*zs*xz_TNE + ys*zs*yz_TNE + feq[DIR_MMM]; + f[DIR_PMM] = f_TNW + xs*x_TNW + ys*y_TNW + zs*z_TNW + xs*ys*xy_TNW + xs*zs*xz_TNW + ys*zs*yz_TNW + feq[DIR_PMM]; + f[DIR_MPM] = f_TSE + xs*x_TSE + ys*y_TSE + zs*z_TSE + xs*ys*xy_TSE + xs*zs*xz_TSE + ys*zs*yz_TSE + feq[DIR_MPM]; + f[DIR_000] = f_ZERO + xs*x_ZERO + ys*y_ZERO + zs*z_ZERO + feq[DIR_000]; } ////////////////////////////////////////////////////////////////////////// //Position SWB -0.25, -0.25, -0.25 @@ -632,33 +632,33 @@ void RheologyInterpolationProcessor::calcInterpolatedNodeFC(LBMReal* f, LBMReal f_TSE = eps_new*((ay - az + bx + bz - cx + cy+kxyAverage-kxzAverage+kyzAverage)/(72.*o)); f_TNW = eps_new*((ay + az + bx - bz + cx - cy+kxyAverage+kxzAverage-kyzAverage)/(72.*o)); - f[E] = f_E + feq[E]; - 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]; + f[DIR_P00] = f_E + feq[DIR_P00]; + f[DIR_M00] = f_E + feq[DIR_M00]; + f[DIR_0P0] = f_N + feq[DIR_0P0]; + f[DIR_0M0] = f_N + feq[DIR_0M0]; + f[DIR_00P] = f_T + feq[DIR_00P]; + f[DIR_00M] = f_T + feq[DIR_00M]; + f[DIR_PP0] = f_NE + feq[DIR_PP0]; + f[DIR_MM0] = f_NE + feq[DIR_MM0]; + f[DIR_PM0] = f_SE + feq[DIR_PM0]; + f[DIR_MP0] = f_SE + feq[DIR_MP0]; + f[DIR_P0P] = f_TE + feq[DIR_P0P]; + f[DIR_M0M] = f_TE + feq[DIR_M0M]; + f[DIR_P0M] = f_BE + feq[DIR_P0M]; + f[DIR_M0P] = f_BE + feq[DIR_M0P]; + f[DIR_0PP] = f_TN + feq[DIR_0PP]; + f[DIR_0MM] = f_TN + feq[DIR_0MM]; + f[DIR_0PM] = f_BN + feq[DIR_0PM]; + f[DIR_0MP] = f_BN + feq[DIR_0MP]; + f[DIR_PPP] = f_TNE + feq[DIR_PPP]; + f[DIR_MPP] = f_TNW + feq[DIR_MPP]; + f[DIR_PMP] = f_TSE + feq[DIR_PMP]; + f[DIR_MMP] = f_TSW + feq[DIR_MMP]; + f[DIR_PPM] = f_TSW + feq[DIR_PPM]; + f[DIR_MPM] = f_TSE + feq[DIR_MPM]; + f[DIR_PMM] = f_TNW + feq[DIR_PMM]; + f[DIR_MMM] = f_TNE + feq[DIR_MMM]; + f[DIR_000] = f_ZERO + feq[DIR_000]; } ////////////////////////////////////////////////////////////////////////// void RheologyInterpolationProcessor::calcInterpolatedVelocity(LBMReal x, LBMReal y, LBMReal z, LBMReal& vx1, LBMReal& vx2, LBMReal& vx3) diff --git a/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp index a6372fc31712899dab0b8edaf919a141663991ca..f5c87b9fc695d81ad492f89113f2d9e5c56fa9a7 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/BoundaryConditionsBlockVisitor.cpp @@ -39,7 +39,7 @@ #include "D3Q27EsoTwist3DSplittedVector.h" #include "DataSet3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "BCAdapter.h" #include "Block3D.h" #include "BCArray3D.h" @@ -52,7 +52,9 @@ #include "ThixotropyVelocityWithDensityBCAlgorithm.h" -BoundaryConditionsBlockVisitor::BoundaryConditionsBlockVisitor() : Block3DVisitor(0, Grid3DSystem::MAXLEVEL) {} +BoundaryConditionsBlockVisitor::BoundaryConditionsBlockVisitor() : Block3DVisitor(0, D3Q27System::MAXLEVEL) +{ +} ////////////////////////////////////////////////////////////////////////// BoundaryConditionsBlockVisitor::~BoundaryConditionsBlockVisitor() = default; ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/Visitors/ChangeBoundaryDensityBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/ChangeBoundaryDensityBlockVisitor.cpp index b222d2c67af03cae39a385c91f25b29962565c39..e26b59729594fc3175e523e25d23ce7adc56d74e 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/ChangeBoundaryDensityBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/ChangeBoundaryDensityBlockVisitor.cpp @@ -4,11 +4,11 @@ #include "Block3D.h" #include "BoundaryConditions.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMKernel.h" ChangeBoundaryDensityBlockVisitor::ChangeBoundaryDensityBlockVisitor(float oldBoundaryDensity, float newBoundaryDensity) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), oldBoundaryDensity(oldBoundaryDensity), + : Block3DVisitor(0, D3Q27System::MAXLEVEL), oldBoundaryDensity(oldBoundaryDensity), newBoundaryDensity(newBoundaryDensity) { } diff --git a/src/cpu/VirtualFluidsCore/Visitors/CheckRatioBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/CheckRatioBlockVisitor.cpp index 1f8a9c30e1f7a98812a06716cb461ee0e7d41aba..d329763a43d6985b8930ec0e73b7a06b991801d0 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/CheckRatioBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/CheckRatioBlockVisitor.cpp @@ -1,10 +1,10 @@ #include "CheckRatioBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" CheckRatioBlockVisitor::CheckRatioBlockVisitor(int levelDepth /*shut be maxGridLevel*/, bool includeNotActiveBlocks) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), levelDepth(levelDepth), includeNotActiveBlocks(includeNotActiveBlocks), + : Block3DVisitor(0, D3Q27System::MAXLEVEL), levelDepth(levelDepth), includeNotActiveBlocks(includeNotActiveBlocks), state(true) { } diff --git a/src/cpu/VirtualFluidsCore/Visitors/GenBlocksGridVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/GenBlocksGridVisitor.cpp index a8270d40d7b2e193024056551591f6b0f3464b5e..29ea3bfda98c2ce191d1f7c5bc20691049dc2a04 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/GenBlocksGridVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/GenBlocksGridVisitor.cpp @@ -35,7 +35,7 @@ #include "Block3D.h" #include "CoordinateTransformation3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include <geometry3d/GbObject3D.h> diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp index aba67e6749a47e1c06bf28f01d284799eb39c328..0ba49c1a0683d052a07caae46410b5ea8c35aad7 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsBlockVisitor.cpp @@ -38,10 +38,10 @@ #include "DataSet3D.h" #include "EsoTwist3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMKernel.h" -InitDistributionsBlockVisitor::InitDistributionsBlockVisitor() : Block3DVisitor(0, Grid3DSystem::MAXLEVEL) +InitDistributionsBlockVisitor::InitDistributionsBlockVisitor() : Block3DVisitor(0, D3Q27System::MAXLEVEL) { this->setVx1(0.0); this->setVx2(0.0); @@ -247,33 +247,33 @@ void InitDistributionsBlockVisitor::visit(const SPtr<Grid3D> grid, SPtr<Block3D> double f_TNW = - eps_new *((bz + cy)/(36.*o)) - f_TNE; - f[E] = f_E + feq[E]; - 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]; + f[DIR_P00] = f_E + feq[DIR_P00]; + f[DIR_M00] = f_E + feq[DIR_M00]; + f[DIR_0P0] = f_N + feq[DIR_0P0]; + f[DIR_0M0] = f_N + feq[DIR_0M0]; + f[DIR_00P] = f_T + feq[DIR_00P]; + f[DIR_00M] = f_T + feq[DIR_00M]; + f[DIR_PP0] = f_NE + feq[DIR_PP0]; + f[DIR_MM0] = f_NE + feq[DIR_MM0]; + f[DIR_PM0] = f_SE + feq[DIR_PM0]; + f[DIR_MP0] = f_SE + feq[DIR_MP0]; + f[DIR_P0P] = f_TE + feq[DIR_P0P]; + f[DIR_M0M] = f_TE + feq[DIR_M0M]; + f[DIR_P0M] = f_BE + feq[DIR_P0M]; + f[DIR_M0P] = f_BE + feq[DIR_M0P]; + f[DIR_0PP] = f_TN + feq[DIR_0PP]; + f[DIR_0MM] = f_TN + feq[DIR_0MM]; + f[DIR_0PM] = f_BN + feq[DIR_0PM]; + f[DIR_0MP] = f_BN + feq[DIR_0MP]; + f[DIR_PPP] = f_TNE + feq[DIR_PPP]; + f[DIR_MPP] = f_TNW + feq[DIR_MPP]; + f[DIR_PMP] = f_TSE + feq[DIR_PMP]; + f[DIR_MMP] = f_TSW + feq[DIR_MMP]; + f[DIR_PPM] = f_TSW + feq[DIR_PPM]; + f[DIR_MPM] = f_TSE + feq[DIR_MPM]; + f[DIR_PMM] = f_TNW + feq[DIR_PMM]; + f[DIR_MMM] = f_TNE + feq[DIR_MMM]; + f[DIR_000] = f_ZERO + feq[DIR_000]; //calcFeqsFct(f,rho,vx1,vx2,vx3); distributions->setDistribution(f, ix1, ix2, ix3); diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.cpp index b10151a9d2926546c2807db05912f79f6815bf86..1bcb6057f5b5987ced9adc17e7d6fabd262911e6 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsFromFileBlockVisitor.cpp @@ -5,14 +5,14 @@ #include "DataSet3D.h" #include "EsoTwist3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "InitDensityLBMKernel.h" #include "LBMKernel.h" #include <basics/utilities/UbFileInputASCII.h> InitDistributionsFromFileBlockVisitor::InitDistributionsFromFileBlockVisitor(/*LBMReal nu, */ LBMReal rho, std::string filename) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), /*nu(nu),*/ rho(rho) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), /*nu(nu),*/ rho(rho) { UbFileInputASCII in(filename); if (!in) { @@ -202,7 +202,7 @@ void InitDistributionsFromFileBlockVisitor::visit(const SPtr<Grid3D> grid, SPtr< // 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[E] = f_E + feq[E]; + // f[DIR_P00] = f_E + feq[DIR_P00]; // f[W] = f_E + feq[W]; // f[N] = f_N + feq[N]; // f[S] = f_N + feq[S]; diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp index 343353c7b7caf58269e1b25799dbbc730fc227b5..567ce2e7ff5b40f3c8042bd404394a3fbf9ffee4 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/InitDistributionsWithInterpolationGridVisitor.cpp @@ -7,7 +7,7 @@ #include "D3Q27EsoTwist3DSplittedVector.h" #include "DataSet3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "InterpolationProcessor.h" #include "LBMKernel.h" #include <CbArray2D.h> diff --git a/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp index f9be891771838940294a5e3b348a0b4d8c31f366..9c8c05babe4fc2d454908095e8a232eb14434df2 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/InitThixotropyBlockVisitor.cpp @@ -34,7 +34,7 @@ #include "InitThixotropyBlockVisitor.h" #include "LBMKernel.h" #include "BCProcessor.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "DataSet3D.h" #include "EsoTwist3D.h" #include "Grid3D.h" @@ -42,7 +42,7 @@ #include "BCArray3D.h" InitThixotropyBlockVisitor::InitThixotropyBlockVisitor() - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL) + : Block3DVisitor(0, D3Q27System::MAXLEVEL) { //this->setVx1(0.0); //this->setVx2(0.0); @@ -56,7 +56,7 @@ InitThixotropyBlockVisitor::InitThixotropyBlockVisitor() } ////////////////////////////////////////////////////////////////////////// //InitThixotropyBlockVisitor::InitThixotropyBlockVisitor(LBMReal lambda /*LBMReal nu, LBMReal D, LBMReal rho, LBMReal vx1, LBMReal vx2, LBMReal vx3, LBMReal c, LBMReal f1, LBMReal f2, LBMReal f3*/) -// : Block3DVisitor(0, Grid3DSystem::MAXLEVEL) +// : Block3DVisitor(0, D3Q27System::MAXLEVEL) //{ // //this->setVx1(vx1); // //this->setVx2(vx2); @@ -426,7 +426,7 @@ void InitThixotropyBlockVisitor::checkFunction(mu::Parser fct) // double f_TNW = -eps_new * ((bz + cy) / (36. * o)) - f_TNE; // // -// f[E] = f_E + feq[E]; +// f[DIR_P00] = f_E + feq[DIR_P00]; // f[W] = f_E + feq[W]; // f[N] = f_N + feq[N]; // f[S] = f_N + feq[S]; diff --git a/src/cpu/VirtualFluidsCore/Visitors/MetisPartitioningGridVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/MetisPartitioningGridVisitor.cpp index 412e9347d707fe2e4ad733cf53419f18f86faf01..8cd256a9b023dbd2600c38fa8e291ada7047f5c7 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/MetisPartitioningGridVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/MetisPartitioningGridVisitor.cpp @@ -256,11 +256,11 @@ void MetisPartitioningGridVisitor::clear() int MetisPartitioningGridVisitor::getEdgeWeight(int dir) { using namespace D3Q27System; - if (dir <= B) { + if (dir <= DIR_00M) { return 100; - } else if (dir >= NE && dir <= TS) { + } else if (dir >= DIR_PP0 && dir <= DIR_0MP) { return 10; - } else if (dir >= TNE) { + } else if (dir >= DIR_PPP) { return 1; } diff --git a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseBoundaryConditionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseBoundaryConditionsBlockVisitor.cpp index 34dba741103d8160304507b5e68a311c5149ddbd..003d5d31204fafc82f78a0fddb04897c2c60e77f 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseBoundaryConditionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseBoundaryConditionsBlockVisitor.cpp @@ -39,14 +39,14 @@ #include "D3Q27EsoTwist3DSplittedVector.h" #include "DataSet3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "BCAdapter.h" #include "Block3D.h" #include "BCArray3D.h" #include "LBMKernel.h" MultiphaseBoundaryConditionsBlockVisitor::MultiphaseBoundaryConditionsBlockVisitor() : -Block3DVisitor(0, Grid3DSystem::MAXLEVEL) +Block3DVisitor(0, D3Q27System::MAXLEVEL) { } diff --git a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.cpp index 484972355fa4685769b092721fc566d92ecbe71e..a35fc289b7505c722151e2a5afe98815131a989d 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseInitDistributionsBlockVisitor.cpp @@ -38,11 +38,11 @@ #include "DataSet3D.h" #include "EsoTwist3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMKernel.h" MultiphaseInitDistributionsBlockVisitor::MultiphaseInitDistributionsBlockVisitor() - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL) + : Block3DVisitor(0, D3Q27System::MAXLEVEL) { this->setVx1(0.0); this->setVx2(0.0); @@ -51,7 +51,7 @@ MultiphaseInitDistributionsBlockVisitor::MultiphaseInitDistributionsBlockVisitor } ////////////////////////////////////////////////////////////////////////// MultiphaseInitDistributionsBlockVisitor::MultiphaseInitDistributionsBlockVisitor( LBMReal densityRatio, LBMReal vx1, LBMReal vx2, LBMReal vx3, LBMReal rho) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), densityRatio(densityRatio) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), densityRatio(densityRatio) { this->setVx1(vx1); this->setVx2(vx2); @@ -227,97 +227,97 @@ void MultiphaseInitDistributionsBlockVisitor::visit(const SPtr<Grid3D> grid, SPt } - f[E] = geq[E] ; - f[W] = geq[W] ; - f[N] = geq[N] ; - f[S] = geq[S] ; - f[T] = geq[T] ; - f[B] = geq[B] ; - f[NE] = geq[NE] ; - f[SW] = geq[SW] ; - f[SE] = geq[SE] ; - f[NW] = geq[NW] ; - f[TE] = geq[TE] ; - f[BW] = geq[BW] ; - f[BE] = geq[BE] ; - f[TW] = geq[TW] ; - f[TN] = geq[TN] ; - f[BS] = geq[BS] ; - f[BN] = geq[BN] ; - f[TS] = geq[TS] ; - f[TNE] = geq[TNE] ; - f[TNW] = geq[TNW] ; - f[TSE] = geq[TSE] ; - f[TSW] = geq[TSW] ; - f[BNE] = geq[BNE] ; - f[BNW] = geq[BNW] ; - f[BSE] = geq[BSE] ; - f[BSW] = geq[BSW] ; - f[REST] = geq[REST] ; + f[DIR_P00] = geq[DIR_P00] ; + f[DIR_M00] = geq[DIR_M00] ; + f[DIR_0P0] = geq[DIR_0P0] ; + f[DIR_0M0] = geq[DIR_0M0] ; + f[DIR_00P] = geq[DIR_00P] ; + f[DIR_00M] = geq[DIR_00M] ; + f[DIR_PP0] = geq[DIR_PP0] ; + f[DIR_MM0] = geq[DIR_MM0] ; + f[DIR_PM0] = geq[DIR_PM0] ; + f[DIR_MP0] = geq[DIR_MP0] ; + f[DIR_P0P] = geq[DIR_P0P] ; + f[DIR_M0M] = geq[DIR_M0M] ; + f[DIR_P0M] = geq[DIR_P0M] ; + f[DIR_M0P] = geq[DIR_M0P] ; + f[DIR_0PP] = geq[DIR_0PP] ; + f[DIR_0MM] = geq[DIR_0MM] ; + f[DIR_0PM] = geq[DIR_0PM] ; + f[DIR_0MP] = geq[DIR_0MP] ; + f[DIR_PPP] = geq[DIR_PPP] ; + f[DIR_MPP] = geq[DIR_MPP] ; + f[DIR_PMP] = geq[DIR_PMP] ; + f[DIR_MMP] = geq[DIR_MMP] ; + f[DIR_PPM] = geq[DIR_PPM] ; + f[DIR_MPM] = geq[DIR_MPM] ; + f[DIR_PMM] = geq[DIR_PMM] ; + f[DIR_MMM] = geq[DIR_MMM] ; + f[DIR_000] = geq[DIR_000] ; distributionsF->setDistribution(f, ix1, ix2, ix3); distributionsF->setDistributionInv(f, ix1, ix2, ix3); - f[E] = phi * feq[E] / rho; - f[W] = phi * feq[W] / rho; - f[N] = phi * feq[N] / rho; - f[S] = phi * feq[S] / rho; - f[T] = phi * feq[T] / rho; - f[B] = phi * feq[B] / rho; - f[NE] = phi * feq[NE] / rho; - f[SW] = phi * feq[SW] / rho; - f[SE] = phi * feq[SE] / rho; - f[NW] = phi * feq[NW] / rho; - f[TE] = phi * feq[TE] / rho; - f[BW] = phi * feq[BW] / rho; - f[BE] = phi * feq[BE] / rho; - f[TW] = phi * feq[TW] / rho; - f[TN] = phi * feq[TN] / rho; - f[BS] = phi * feq[BS] / rho; - f[BN] = phi * feq[BN] / rho; - f[TS] = phi * feq[TS] / rho; - f[TNE] = phi * feq[TNE] / rho; - f[TNW] = phi * feq[TNW] / rho; - f[TSE] = phi * feq[TSE] / rho; - f[TSW] = phi * feq[TSW] / rho; - f[BNE] = phi * feq[BNE] / rho; - f[BNW] = phi * feq[BNW] / rho; - f[BSE] = phi * feq[BSE] / rho; - f[BSW] = phi * feq[BSW] / rho; - f[REST] = phi * feq[REST] / rho; + f[DIR_P00] = phi * feq[DIR_P00] / rho; + f[DIR_M00] = phi * feq[DIR_M00] / rho; + f[DIR_0P0] = phi * feq[DIR_0P0] / rho; + f[DIR_0M0] = phi * feq[DIR_0M0] / rho; + f[DIR_00P] = phi * feq[DIR_00P] / rho; + f[DIR_00M] = phi * feq[DIR_00M] / rho; + f[DIR_PP0] = phi * feq[DIR_PP0] / rho; + f[DIR_MM0] = phi * feq[DIR_MM0] / rho; + f[DIR_PM0] = phi * feq[DIR_PM0] / rho; + f[DIR_MP0] = phi * feq[DIR_MP0] / rho; + f[DIR_P0P] = phi * feq[DIR_P0P] / rho; + f[DIR_M0M] = phi * feq[DIR_M0M] / rho; + f[DIR_P0M] = phi * feq[DIR_P0M] / rho; + f[DIR_M0P] = phi * feq[DIR_M0P] / rho; + f[DIR_0PP] = phi * feq[DIR_0PP] / rho; + f[DIR_0MM] = phi * feq[DIR_0MM] / rho; + f[DIR_0PM] = phi * feq[DIR_0PM] / rho; + f[DIR_0MP] = phi * feq[DIR_0MP] / rho; + f[DIR_PPP] = phi * feq[DIR_PPP] / rho; + f[DIR_MPP] = phi * feq[DIR_MPP] / rho; + f[DIR_PMP] = phi * feq[DIR_PMP] / rho; + f[DIR_MMP] = phi * feq[DIR_MMP] / rho; + f[DIR_PPM] = phi * feq[DIR_PPM] / rho; + f[DIR_MPM] = phi * feq[DIR_MPM] / rho; + f[DIR_PMM] = phi * feq[DIR_PMM] / rho; + f[DIR_MMM] = phi * feq[DIR_MMM] / rho; + f[DIR_000] = phi * feq[DIR_000] / rho; distributionsH->setDistribution(f, ix1, ix2, ix3); distributionsH->setDistributionInv(f, ix1, ix2, ix3); if (distributionsH2) { - f[E] = (1.-phi) * feq[E] / rho; - f[W] = (1.-phi) * feq[W] / rho; - f[N] = (1.-phi) * feq[N] / rho; - f[S] = (1.-phi) * feq[S] / rho; - f[T] = (1.-phi) * feq[T] / rho; - f[B] = (1.-phi) * feq[B] / rho; - f[NE] = (1.-phi) * feq[NE] / rho; - f[SW] = (1.-phi) * feq[SW] / rho; - f[SE] = (1.-phi) * feq[SE] / rho; - f[NW] = (1.-phi) * feq[NW] / rho; - f[TE] = (1.-phi) * feq[TE] / rho; - f[BW] = (1.-phi) * feq[BW] / rho; - f[BE] = (1.-phi) * feq[BE] / rho; - f[TW] = (1.-phi) * feq[TW] / rho; - f[TN] = (1.-phi) * feq[TN] / rho; - f[BS] = (1.-phi) * feq[BS] / rho; - f[BN] = (1.-phi) * feq[BN] / rho; - f[TS] = (1.-phi) * feq[TS] / rho; - f[TNE] = (1.-phi) * feq[TNE] / rho; - f[TNW] = (1.-phi) * feq[TNW] / rho; - f[TSE] = (1.-phi) * feq[TSE] / rho; - f[TSW] = (1.-phi) * feq[TSW] / rho; - f[BNE] = (1.-phi) * feq[BNE] / rho; - f[BNW] = (1.-phi) * feq[BNW] / rho; - f[BSE] = (1.-phi) * feq[BSE] / rho; - f[BSW] = (1.-phi) * feq[BSW] / rho; - f[REST] = (1.-phi) * feq[REST] / rho; + f[DIR_P00] = (1.-phi) * feq[DIR_P00] / rho; + f[DIR_M00] = (1.-phi) * feq[DIR_M00] / rho; + f[DIR_0P0] = (1.-phi) * feq[DIR_0P0] / rho; + f[DIR_0M0] = (1.-phi) * feq[DIR_0M0] / rho; + f[DIR_00P] = (1.-phi) * feq[DIR_00P] / rho; + f[DIR_00M] = (1.-phi) * feq[DIR_00M] / rho; + f[DIR_PP0] = (1.-phi) * feq[DIR_PP0] / rho; + f[DIR_MM0] = (1.-phi) * feq[DIR_MM0] / rho; + f[DIR_PM0] = (1.-phi) * feq[DIR_PM0] / rho; + f[DIR_MP0] = (1.-phi) * feq[DIR_MP0] / rho; + f[DIR_P0P] = (1.-phi) * feq[DIR_P0P] / rho; + f[DIR_M0M] = (1.-phi) * feq[DIR_M0M] / rho; + f[DIR_P0M] = (1.-phi) * feq[DIR_P0M] / rho; + f[DIR_M0P] = (1.-phi) * feq[DIR_M0P] / rho; + f[DIR_0PP] = (1.-phi) * feq[DIR_0PP] / rho; + f[DIR_0MM] = (1.-phi) * feq[DIR_0MM] / rho; + f[DIR_0PM] = (1.-phi) * feq[DIR_0PM] / rho; + f[DIR_0MP] = (1.-phi) * feq[DIR_0MP] / rho; + f[DIR_PPP] = (1.-phi) * feq[DIR_PPP] / rho; + f[DIR_MPP] = (1.-phi) * feq[DIR_MPP] / rho; + f[DIR_PMP] = (1.-phi) * feq[DIR_PMP] / rho; + f[DIR_MMP] = (1.-phi) * feq[DIR_MMP] / rho; + f[DIR_PPM] = (1.-phi) * feq[DIR_PPM] / rho; + f[DIR_MPM] = (1.-phi) * feq[DIR_MPM] / rho; + f[DIR_PMM] = (1.-phi) * feq[DIR_PMM] / rho; + f[DIR_MMM] = (1.-phi) * feq[DIR_MMM] / rho; + f[DIR_000] = (1.-phi) * feq[DIR_000] / rho; distributionsH2->setDistribution(f, ix1, ix2, ix3); distributionsH2->setDistributionInv(f, ix1, ix2, ix3); diff --git a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseSetKernelBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseSetKernelBlockVisitor.cpp index afe288e8c70a7ab3b0ceadae721b68db6a0102f4..4990690e2d7d464cfbdc69f2966655568021e7d0 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseSetKernelBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseSetKernelBlockVisitor.cpp @@ -1,17 +1,17 @@ #include "MultiphaseSetKernelBlockVisitor.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMSystem.h" #include "Block3D.h" #include "Grid3D.h" //SetKernelBlockVisitor::SetKernelBlockVisitor(LBMKernel3DPtr kernel, LBMReal nue) : -// Block3DVisitor(0, Grid3DSystem::MAXLEVEL), kernel(kernel), nue(nue) +// Block3DVisitor(0, D3Q27System::MAXLEVEL), kernel(kernel), nue(nue) //{ // //} ////////////////////////////////////////////////////////////////////////// //SetKernelBlockVisitor::SetKernelBlockVisitor( LBMKernel3DPtr kernel, LBMReal nue, double availMem, double needMem ) : -// Block3DVisitor(0, Grid3DSystem::MAXLEVEL), kernel(kernel), nue(nue) +// Block3DVisitor(0, D3Q27System::MAXLEVEL), kernel(kernel), nue(nue) //{ // if (needMem > availMem) // { @@ -20,7 +20,7 @@ //} ////////////////////////////////////////////////////////////////////////// MultiphaseSetKernelBlockVisitor::MultiphaseSetKernelBlockVisitor(SPtr<LBMKernel> kernel, LBMReal nuL, LBMReal nuG, double availMem, double needMem, MultiphaseSetKernelBlockVisitor::Action action /*= SetKernelBlockVisitor::New*/) : - Block3DVisitor(0, Grid3DSystem::MAXLEVEL), kernel(kernel), nuL(nuL), nuG(nuG), action(action), dataSetFlag(true) + Block3DVisitor(0, D3Q27System::MAXLEVEL), kernel(kernel), nuL(nuL), nuG(nuG), action(action), dataSetFlag(true) { if (needMem > availMem) { diff --git a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseVelocityFormInitDistributionsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseVelocityFormInitDistributionsBlockVisitor.cpp index 8a201fa3e7236572ca94c83c72ee90149d676390..623fcade630c6b89e0395814b555d4bc39bcd61b 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/MultiphaseVelocityFormInitDistributionsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/MultiphaseVelocityFormInitDistributionsBlockVisitor.cpp @@ -38,11 +38,11 @@ #include "DataSet3D.h" #include "EsoTwist3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMKernel.h" MultiphaseVelocityFormInitDistributionsBlockVisitor::MultiphaseVelocityFormInitDistributionsBlockVisitor() - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL) + : Block3DVisitor(0, D3Q27System::MAXLEVEL) { this->setVx1(0.0); this->setVx2(0.0); @@ -219,97 +219,97 @@ void MultiphaseVelocityFormInitDistributionsBlockVisitor::visit(const SPtr<Grid3 } - f[E] = geq[E] ; - f[W] = geq[W] ; - f[N] = geq[N] ; - f[S] = geq[S] ; - f[T] = geq[T] ; - f[B] = geq[B] ; - f[NE] = geq[NE] ; - f[SW] = geq[SW] ; - f[SE] = geq[SE] ; - f[NW] = geq[NW] ; - f[TE] = geq[TE] ; - f[BW] = geq[BW] ; - f[BE] = geq[BE] ; - f[TW] = geq[TW] ; - f[TN] = geq[TN] ; - f[BS] = geq[BS] ; - f[BN] = geq[BN] ; - f[TS] = geq[TS] ; - f[TNE] = geq[TNE] ; - f[TNW] = geq[TNW] ; - f[TSE] = geq[TSE] ; - f[TSW] = geq[TSW] ; - f[BNE] = geq[BNE] ; - f[BNW] = geq[BNW] ; - f[BSE] = geq[BSE] ; - f[BSW] = geq[BSW] ; - f[REST] = geq[REST] ; + f[DIR_P00] = geq[DIR_P00] ; + f[DIR_00M] = geq[DIR_00M] ; + f[DIR_0P0] = geq[DIR_0P0] ; + f[DIR_0M0] = geq[DIR_0M0] ; + f[DIR_00P] = geq[DIR_00P] ; + f[DIR_00M] = geq[DIR_00M] ; + f[DIR_PP0] = geq[DIR_PP0] ; + f[DIR_MM0] = geq[DIR_MM0] ; + f[DIR_PM0] = geq[DIR_PM0] ; + f[DIR_MP0] = geq[DIR_MP0] ; + f[DIR_P0P] = geq[DIR_P0P] ; + f[DIR_M0M] = geq[DIR_M0M] ; + f[DIR_P0M] = geq[DIR_P0M] ; + f[DIR_M0P] = geq[DIR_M0P] ; + f[DIR_0PP] = geq[DIR_0PP] ; + f[DIR_0MM] = geq[DIR_0MM] ; + f[DIR_0PM] = geq[DIR_0PM] ; + f[DIR_0MP] = geq[DIR_0MP] ; + f[DIR_PPP] = geq[DIR_PPP] ; + f[DIR_MPP] = geq[DIR_MPP] ; + f[DIR_PMP] = geq[DIR_PMP] ; + f[DIR_MMP] = geq[DIR_MMP] ; + f[DIR_PPM] = geq[DIR_PPM] ; + f[DIR_MPM] = geq[DIR_MPM] ; + f[DIR_PMM] = geq[DIR_PMM] ; + f[DIR_MMM] = geq[DIR_MMM] ; + f[DIR_000] = geq[DIR_000] ; distributionsF->setDistribution(f, ix1, ix2, ix3); distributionsF->setDistributionInv(f, ix1, ix2, ix3); - f[E] = phi * feq[E] ;// / rho; - f[W] = phi * feq[W] ;// / rho; - f[N] = phi * feq[N] ;// / rho; - f[S] = phi * feq[S] ;// / rho; - f[T] = phi * feq[T] ;// / rho; - f[B] = phi * feq[B] ;// / rho; - f[NE] = phi * feq[NE] ;// / rho; - f[SW] = phi * feq[SW] ;// / rho; - f[SE] = phi * feq[SE] ;// / rho; - f[NW] = phi * feq[NW] ;// / rho; - f[TE] = phi * feq[TE] ;// / rho; - f[BW] = phi * feq[BW] ;// / rho; - f[BE] = phi * feq[BE] ;// / rho; - f[TW] = phi * feq[TW] ;// / rho; - f[TN] = phi * feq[TN] ;// / rho; - f[BS] = phi * feq[BS] ;// / rho; - f[BN] = phi * feq[BN] ;// / rho; - f[TS] = phi * feq[TS] ;// / rho; - f[TNE] = phi * feq[TNE] ;// / rho; - f[TNW] = phi * feq[TNW] ;// / rho; - f[TSE] = phi * feq[TSE] ;// / rho; - f[TSW] = phi * feq[TSW] ;// / rho; - f[BNE] = phi * feq[BNE] ;// / rho; - f[BNW] = phi * feq[BNW] ;// / rho; - f[BSE] = phi * feq[BSE] ;// / rho; - f[BSW] = phi * feq[BSW] ;// / rho; - f[REST] = phi * feq[REST] ;// / rho; + f[DIR_P00] = phi * feq[DIR_P00] ;// / rho; + f[DIR_M00] = phi * feq[DIR_M00] ;// / rho; + f[DIR_0P0] = phi * feq[DIR_0P0] ;// / rho; + f[DIR_0M0] = phi * feq[DIR_0M0] ;// / rho; + f[DIR_00P] = phi * feq[DIR_00P] ;// / rho; + f[DIR_00M] = phi * feq[DIR_00M] ;// / rho; + f[DIR_PP0] = phi * feq[DIR_PP0] ;// / rho; + f[DIR_MM0] = phi * feq[DIR_MM0] ;// / rho; + f[DIR_PM0] = phi * feq[DIR_PM0] ;// / rho; + f[DIR_MP0] = phi * feq[DIR_MP0] ;// / rho; + f[DIR_P0P] = phi * feq[DIR_P0P] ;// / rho; + f[DIR_M0M] = phi * feq[DIR_M0M] ;// / rho; + f[DIR_P0M] = phi * feq[DIR_P0M] ;// / rho; + f[DIR_M0P] = phi * feq[DIR_M0P] ;// / rho; + f[DIR_0PP] = phi * feq[DIR_0PP] ;// / rho; + f[DIR_0MM] = phi * feq[DIR_0MM] ;// / rho; + f[DIR_0PM] = phi * feq[DIR_0PM] ;// / rho; + f[DIR_0MP] = phi * feq[DIR_0MP] ;// / rho; + f[DIR_PPP] = phi * feq[DIR_PPP] ;// / rho; + f[DIR_MPP] = phi * feq[DIR_MPP] ;// / rho; + f[DIR_PMP] = phi * feq[DIR_PMP] ;// / rho; + f[DIR_MMP] = phi * feq[DIR_MMP] ;// / rho; + f[DIR_PPM] = phi * feq[DIR_PPM] ;// / rho; + f[DIR_MPM] = phi * feq[DIR_MPM] ;// / rho; + f[DIR_PMM] = phi * feq[DIR_PMM] ;// / rho; + f[DIR_MMM] = phi * feq[DIR_MMM] ;// / rho; + f[DIR_000] = phi * feq[DIR_000] ;// / rho; distributionsH->setDistribution(f, ix1, ix2, ix3); distributionsH->setDistributionInv(f, ix1, ix2, ix3); if (distributionsH2) { - f[E] = (1.-phi) * feq[E] ;// / rho; - f[W] = (1.-phi) * feq[W] ;// / rho; - f[N] = (1.-phi) * feq[N] ;// / rho; - f[S] = (1.-phi) * feq[S] ;// / rho; - f[T] = (1.-phi) * feq[T] ;// / rho; - f[B] = (1.-phi) * feq[B] ;// / rho; - f[NE] = (1.-phi) * feq[NE] ;// / rho; - f[SW] = (1.-phi) * feq[SW] ;// / rho; - f[SE] = (1.-phi) * feq[SE] ;// / rho; - f[NW] = (1.-phi) * feq[NW] ;// / rho; - f[TE] = (1.-phi) * feq[TE] ;// / rho; - f[BW] = (1.-phi) * feq[BW] ;// / rho; - f[BE] = (1.-phi) * feq[BE] ;// / rho; - f[TW] = (1.-phi) * feq[TW] ;// / rho; - f[TN] = (1.-phi) * feq[TN] ;// / rho; - f[BS] = (1.-phi) * feq[BS] ;// / rho; - f[BN] = (1.-phi) * feq[BN] ;// / rho; - f[TS] = (1.-phi) * feq[TS] ;// / rho; - f[TNE] = (1.-phi) * feq[TNE] ;// / rho; - f[TNW] = (1.-phi) * feq[TNW] ;// / rho; - f[TSE] = (1.-phi) * feq[TSE] ;// / rho; - f[TSW] = (1.-phi) * feq[TSW] ;// / rho; - f[BNE] = (1.-phi) * feq[BNE] ;// / rho; - f[BNW] = (1.-phi) * feq[BNW] ;// / rho; - f[BSE] = (1.-phi) * feq[BSE] ;// / rho; - f[BSW] = (1.-phi) * feq[BSW] ;// / rho; - f[REST] = (1.-phi) * feq[REST];// / rho; + f[DIR_P00] = (1.-phi) * feq[DIR_P00] ;// / rho; + f[DIR_M00] = (1.-phi) * feq[DIR_M00] ;// / rho; + f[DIR_0P0] = (1.-phi) * feq[DIR_0P0] ;// / rho; + f[DIR_0M0] = (1.-phi) * feq[DIR_0M0] ;// / rho; + f[DIR_00P] = (1.-phi) * feq[DIR_00P] ;// / rho; + f[DIR_00M] = (1.-phi) * feq[DIR_00M] ;// / rho; + f[DIR_PP0] = (1.-phi) * feq[DIR_PP0] ;// / rho; + f[DIR_MM0] = (1.-phi) * feq[DIR_MM0] ;// / rho; + f[DIR_PM0] = (1.-phi) * feq[DIR_PM0] ;// / rho; + f[DIR_MP0] = (1.-phi) * feq[DIR_MP0] ;// / rho; + f[DIR_P0P] = (1.-phi) * feq[DIR_P0P] ;// / rho; + f[DIR_M0M] = (1.-phi) * feq[DIR_M0M] ;// / rho; + f[DIR_P0M] = (1.-phi) * feq[DIR_P0M] ;// / rho; + f[DIR_M0P] = (1.-phi) * feq[DIR_M0P] ;// / rho; + f[DIR_0PP] = (1.-phi) * feq[DIR_0PP] ;// / rho; + f[DIR_0MM] = (1.-phi) * feq[DIR_0MM] ;// / rho; + f[DIR_0PM] = (1.-phi) * feq[DIR_0PM] ;// / rho; + f[DIR_0MP] = (1.-phi) * feq[DIR_0MP] ;// / rho; + f[DIR_PPP] = (1.-phi) * feq[DIR_PPP] ;// / rho; + f[DIR_MPP] = (1.-phi) * feq[DIR_MPP] ;// / rho; + f[DIR_PMP] = (1.-phi) * feq[DIR_PMP] ;// / rho; + f[DIR_MMP] = (1.-phi) * feq[DIR_MMP] ;// / rho; + f[DIR_PPM] = (1.-phi) * feq[DIR_PPM] ;// / rho; + f[DIR_MPM] = (1.-phi) * feq[DIR_MPM] ;// / rho; + f[DIR_PMM] = (1.-phi) * feq[DIR_PMM] ;// / rho; + f[DIR_MMM] = (1.-phi) * feq[DIR_MMM] ;// / rho; + f[DIR_000] = (1.-phi) * feq[DIR_000];// / rho; distributionsH2->setDistribution(f, ix1, ix2, ix3); distributionsH2->setDistributionInv(f, ix1, ix2, ix3); diff --git a/src/cpu/VirtualFluidsCore/Visitors/OverlapBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/OverlapBlockVisitor.cpp index 338c6de90499db39836910c47a7b60f00ee7c675..54bbeda59663bf16173abcdb302f123a97b776ac 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/OverlapBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/OverlapBlockVisitor.cpp @@ -1,10 +1,10 @@ #include "OverlapBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" OverlapBlockVisitor::OverlapBlockVisitor(int levelDepth /*shut be maxGridLevel*/, bool includeNotActiveBlocks) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), levelDepth(levelDepth), includeNotActiveBlocks(includeNotActiveBlocks) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), levelDepth(levelDepth), includeNotActiveBlocks(includeNotActiveBlocks) { } ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/Visitors/RatioBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/RatioBlockVisitor.cpp index bf25b8876f540c6ff5f678b32ad67ddd736c145d..137c737e6dd85853da328b0d0cc9ccf1bca1f878 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/RatioBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/RatioBlockVisitor.cpp @@ -1,10 +1,10 @@ #include "RatioBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" RatioBlockVisitor::RatioBlockVisitor(int levelDepth, bool includeNotActiveBlocks) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), maxLevelRatio(1), expandBlocks(true), levelDepth(levelDepth), + : Block3DVisitor(0, D3Q27System::MAXLEVEL), maxLevelRatio(1), expandBlocks(true), levelDepth(levelDepth), includeNotActiveBlocks(includeNotActiveBlocks) { } diff --git a/src/cpu/VirtualFluidsCore/Visitors/RatioSmoothBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/RatioSmoothBlockVisitor.cpp index 3bcdd29299a8183a2cda60253101df89b681a51a..b48aee7cd8dcd3d3cc33c949e8a71281214c8f19 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/RatioSmoothBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/RatioSmoothBlockVisitor.cpp @@ -1,10 +1,10 @@ #include "RatioSmoothBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" RatioSmoothBlockVisitor::RatioSmoothBlockVisitor(int levelDepth, bool includeNotActiveBlocks) - : Block3DVisitor(Grid3DSystem::MAXLEVEL, 0), maxLevelRatio(1), expandBlocks(true), levelDepth(levelDepth), + : Block3DVisitor(D3Q27System::MAXLEVEL, 0), maxLevelRatio(1), expandBlocks(true), levelDepth(levelDepth), includeNotActiveBlocks(includeNotActiveBlocks) { } diff --git a/src/cpu/VirtualFluidsCore/Visitors/RefineAroundGbObjectHelper.cpp b/src/cpu/VirtualFluidsCore/Visitors/RefineAroundGbObjectHelper.cpp index c151ac90492bc7545f7d498fdfd2b3f9efbc9ab6..b0b0cf7743fd195796ef2fb3276a9a3921adf465 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/RefineAroundGbObjectHelper.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/RefineAroundGbObjectHelper.cpp @@ -38,7 +38,7 @@ void RefineAroundGbObjectHelper::refine() grid->accept(overlapVisitor); std::vector<int> dirs; - for (int i = D3Q27System::E; i <= D3Q27System::TS; i++) { + for (int i = D3Q27System::DIR_P00; i <= D3Q27System::DIR_0MP; i++) { dirs.push_back(i); } SetInterpolationDirsBlockVisitor interDirsVisitor(dirs); diff --git a/src/cpu/VirtualFluidsCore/Visitors/RefineCrossAndInsideGbObjectHelper.cpp b/src/cpu/VirtualFluidsCore/Visitors/RefineCrossAndInsideGbObjectHelper.cpp index 656457c0580739bd00783b3050fb2c460eaa5a14..0b8b631e6ef91e011e8ca226f01c7064ece7bf69 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/RefineCrossAndInsideGbObjectHelper.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/RefineCrossAndInsideGbObjectHelper.cpp @@ -55,7 +55,7 @@ void RefineCrossAndInsideGbObjectHelper::refine() std::vector<int> dirs; - for (int i = D3Q27System::E; i < D3Q27System::ENDDIR; i++) { + for (int i = D3Q27System::DIR_P00; i < D3Q27System::ENDDIR; i++) { dirs.push_back(i); } SetInterpolationDirsBlockVisitor interDirsVisitor(dirs); diff --git a/src/cpu/VirtualFluidsCore/Visitors/RenumberBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/RenumberBlockVisitor.cpp index 538fd95118b0c07069ba854c2fbb8264713907d3..b2a4d9337ad49edc4e508555929a6ca64e6f9243 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/RenumberBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/RenumberBlockVisitor.cpp @@ -1,12 +1,12 @@ #include "RenumberBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMSystem.h" int RenumberBlockVisitor::counter = 0; -RenumberBlockVisitor::RenumberBlockVisitor() : Block3DVisitor(0, Grid3DSystem::MAXLEVEL) {} +RenumberBlockVisitor::RenumberBlockVisitor() : Block3DVisitor(0, D3Q27System::MAXLEVEL) {} ////////////////////////////////////////////////////////////////////////// void RenumberBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block) { diff --git a/src/cpu/VirtualFluidsCore/Visitors/RenumberGridVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/RenumberGridVisitor.cpp index fc9c5c203c5d631ae7e125f75d72d70e8502890d..ed9a3ee59c87ab755416eecd5468a4cc763837e4 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/RenumberGridVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/RenumberGridVisitor.cpp @@ -1,7 +1,7 @@ #include "RenumberGridVisitor.h" #include "Block3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" //#include <mpi.h> RenumberGridVisitor::RenumberGridVisitor(std::shared_ptr<vf::mpi::Communicator> com) : comm(com) {} diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetBcBlocksBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SetBcBlocksBlockVisitor.cpp index bbccaa785583fdc810865337af46fca8a9872a65..de3924453dadb396a5eef4a8fb23e85f850d760f 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetBcBlocksBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SetBcBlocksBlockVisitor.cpp @@ -35,11 +35,11 @@ #include "Block3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "Interactor3D.h" SetBcBlocksBlockVisitor::SetBcBlocksBlockVisitor(SPtr<Interactor3D> interactor) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), interactor(interactor) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), interactor(interactor) { } diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.h b/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.h index f39a95afc23e5351e0331f789a0e22ae5ff5ccf2..c47c275cf50d9a7789f7c6fd302f1c2b2177f5f6 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.h +++ b/src/cpu/VirtualFluidsCore/Visitors/SetConnectorsBlockVisitor.h @@ -38,7 +38,7 @@ #include "Block3DVisitor.h" #include "D3Q27System.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "Grid3D.h" #include "CreateTransmittersHelper.h" #include <mpi/Communicator.h> @@ -75,7 +75,7 @@ protected: template <class T1, class T2> SetConnectorsBlockVisitor<T1, T2>::SetConnectorsBlockVisitor(std::shared_ptr<vf::mpi::Communicator> comm) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), comm(comm) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), comm(comm) { } ////////////////////////////////////////////////////////////////////////// @@ -114,7 +114,7 @@ void SetConnectorsBlockVisitor<T1, T2>::setSameLevelConnectors(SPtr<Grid3D> grid int ix3 = block->getX3(); int level = block->getLevel(); - for (int dir = 0; dir < D3Q27System::ENDDIR; dir++) { + for (int dir = D3Q27System::STARTDIR; dir < D3Q27System::ENDDIR; dir++) { SPtr<Block3D> neighBlock = grid->getNeighborBlock(dir, ix1, ix2, ix3, level); if (neighBlock) { diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetForcingBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SetForcingBlockVisitor.cpp index 679b63de44dd451f030aaf866bc259579efab8ef..abf828a06e0ec83b492ff9107be4a9a3c4445674 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetForcingBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SetForcingBlockVisitor.cpp @@ -1,18 +1,18 @@ #include "SetForcingBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMSystem.h" SetForcingBlockVisitor::SetForcingBlockVisitor(LBMReal forcingX1, LBMReal forcingX2, LBMReal forcingX3) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), forcingX1(forcingX1), forcingX2(forcingX2), forcingX3(forcingX3) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), forcingX1(forcingX1), forcingX2(forcingX2), forcingX3(forcingX3) { ftype = 0; } ////////////////////////////////////////////////////////////////////////// SetForcingBlockVisitor::SetForcingBlockVisitor(const mu::Parser &muForcingX1, const mu::Parser &muForcingX2, const mu::Parser &muForcingX3) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), muForcingX1(muForcingX1), muForcingX2(muForcingX2), + : Block3DVisitor(0, D3Q27System::MAXLEVEL), muForcingX1(muForcingX1), muForcingX2(muForcingX2), muForcingX3(muForcingX3) { @@ -21,7 +21,7 @@ SetForcingBlockVisitor::SetForcingBlockVisitor(const mu::Parser &muForcingX1, co ////////////////////////////////////////////////////////////////////////// SetForcingBlockVisitor::SetForcingBlockVisitor(const std::string &sForcingX1, const std::string &sForcingX2, const std::string &sForcingX3) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), sForcingX1(sForcingX1), sForcingX2(sForcingX2), sForcingX3(sForcingX3) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), sForcingX1(sForcingX1), sForcingX2(sForcingX2), sForcingX3(sForcingX3) { ftype = 2; diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationConnectorsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationConnectorsBlockVisitor.cpp index 6a55ee5af55df96b4c1335976728ca7e08ee8ece..54f46c811d4c2d065bbda7232bd4e32f24559c22 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationConnectorsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationConnectorsBlockVisitor.cpp @@ -36,14 +36,14 @@ #include "FineToCoarseVectorConnector.h" #include "TwoDistributionsFullDirectConnector.h" #include "TwoDistributionsFullVectorConnector.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include <basics/transmitter/TbTransmitterLocal.h> #include <mpi/Communicator.h> #include "InterpolationProcessor.h" SetInterpolationConnectorsBlockVisitor::SetInterpolationConnectorsBlockVisitor(std::shared_ptr<vf::mpi::Communicator> comm, LBMReal nue, SPtr<InterpolationProcessor> iProcessor) : -Block3DVisitor(0, Grid3DSystem::MAXLEVEL), +Block3DVisitor(0, D3Q27System::MAXLEVEL), comm(comm), nue(nue), iProcessor(iProcessor) @@ -82,110 +82,110 @@ void SetInterpolationConnectorsBlockVisitor::setInterpolationConnectors(SPtr<Gri int fbx3 = block->getX3() << 1; int level = block->getLevel() + 1; - if( block->hasInterpolationFlagCF(D3Q27System::E)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_P00)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+1,fbx2,fbx3,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2+1,fbx3,level); SPtr<Block3D> fblockNW = grid->getBlock(fbx1+1,fbx2,fbx3+1,level); SPtr<Block3D> fblockNE = grid->getBlock(fbx1+1,fbx2+1,fbx3+1,level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::E); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_P00); } - if( block->hasInterpolationFlagCF(D3Q27System::W)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_M00)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1,fbx2,fbx3,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1,fbx2+1,fbx3,level); SPtr<Block3D> fblockNW = grid->getBlock(fbx1,fbx2,fbx3+1,level); SPtr<Block3D> fblockNE = grid->getBlock(fbx1,fbx2+1,fbx3+1,level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::W); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_M00); } - if( block->hasInterpolationFlagCF(D3Q27System::N)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_0P0)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1,fbx2+1,fbx3,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2+1,fbx3,level); SPtr<Block3D> fblockNW = grid->getBlock(fbx1,fbx2+1,fbx3+1,level); SPtr<Block3D> fblockNE = grid->getBlock(fbx1+1,fbx2+1,fbx3+1,level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::N); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_0P0); } - if( block->hasInterpolationFlagCF(D3Q27System::S)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_0M0)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1,fbx2,fbx3,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2,fbx3,level); SPtr<Block3D> fblockNW = grid->getBlock(fbx1,fbx2,fbx3+1,level); SPtr<Block3D> fblockNE = grid->getBlock(fbx1+1,fbx2,fbx3+1,level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::S); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_0M0); } - if( block->hasInterpolationFlagCF(D3Q27System::T)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_00P)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1,fbx2,fbx3+1,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2,fbx3+1,level); SPtr<Block3D> fblockNW = grid->getBlock(fbx1,fbx2+1,fbx3+1,level); SPtr<Block3D> fblockNE = grid->getBlock(fbx1+1,fbx2+1,fbx3+1,level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::T); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_00P); } - if( block->hasInterpolationFlagCF(D3Q27System::B)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_00M)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1,fbx2,fbx3,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2,fbx3,level); SPtr<Block3D> fblockNW = grid->getBlock(fbx1,fbx2+1,fbx3,level); SPtr<Block3D> fblockNE = grid->getBlock(fbx1+1,fbx2+1,fbx3,level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::B); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_00M); } //////NE-NW-SE-SW - if( block->hasInterpolationFlagCF(D3Q27System::NE)&&!block->hasInterpolationFlagCF(D3Q27System::N) && !block->hasInterpolationFlagCF(D3Q27System::E)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_PP0)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_0P0) && !block->hasInterpolationFlagCF(D3Q27System::DIR_P00)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+1,fbx2+1,fbx3+0,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2+1,fbx3+1,level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+1, fbx2+1, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2+1, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::NE); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_PP0); } - if( block->hasInterpolationFlagCF(D3Q27System::SW)&& !block->hasInterpolationFlagCF(D3Q27System::W) && !block->hasInterpolationFlagCF(D3Q27System::S)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_MM0)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_M00) && !block->hasInterpolationFlagCF(D3Q27System::DIR_0M0)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1,fbx2,fbx3,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1,fbx2,fbx3+1,level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1, fbx2, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1, fbx2, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::SW); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_MM0); } - if( block->hasInterpolationFlagCF(D3Q27System::SE)&& !block->hasInterpolationFlagCF(D3Q27System::E) && !block->hasInterpolationFlagCF(D3Q27System::S)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_PM0)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_P00) && !block->hasInterpolationFlagCF(D3Q27System::DIR_0M0)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+1,fbx2,fbx3+0,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2,fbx3+1,level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+1, fbx2, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::SE); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_PM0); } - if( block->hasInterpolationFlagCF(D3Q27System::NW)&& !block->hasInterpolationFlagCF(D3Q27System::N) && !block->hasInterpolationFlagCF(D3Q27System::W)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_MP0)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_0P0) && !block->hasInterpolationFlagCF(D3Q27System::DIR_M00)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1,fbx2+1,fbx3,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1,fbx2+1,fbx3+1,level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1, fbx2+1, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1, fbx2+1, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::NW); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_MP0); } /////////TE-BW-BE-TW 1-0 - if( block->hasInterpolationFlagCF(D3Q27System::TE)&& !block->hasInterpolationFlagCF(D3Q27System::E) && !block->hasInterpolationFlagCF(D3Q27System::T)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_P0P)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_P00) && !block->hasInterpolationFlagCF(D3Q27System::DIR_00P)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+1,fbx2+0,fbx3+1,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2+1,fbx3+1,level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+1, fbx2+0, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2+1, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::TE); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_P0P); } - if( block->hasInterpolationFlagCF(D3Q27System::BW)&& !block->hasInterpolationFlagCF(D3Q27System::W) && !block->hasInterpolationFlagCF(D3Q27System::B)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_M0M)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_M00) && !block->hasInterpolationFlagCF(D3Q27System::DIR_00M)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1,fbx2+0,fbx3,level); @@ -193,140 +193,140 @@ void SetInterpolationConnectorsBlockVisitor::setInterpolationConnectors(SPtr<Gri SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1, fbx2+0, fbx3, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1, fbx2+1, fbx3, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::BW); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_M0M); } - if( block->hasInterpolationFlagCF(D3Q27System::BE)&& !block->hasInterpolationFlagCF(D3Q27System::E) && !block->hasInterpolationFlagCF(D3Q27System::B)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_P0M)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_P00) && !block->hasInterpolationFlagCF(D3Q27System::DIR_00M)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+1,fbx2+0,fbx3,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2+1,fbx3,level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+1, fbx2+0, fbx3, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2+1, fbx3, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::BE); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_P0M); } - if( block->hasInterpolationFlagCF(D3Q27System::TW)&& !block->hasInterpolationFlagCF(D3Q27System::W) && !block->hasInterpolationFlagCF(D3Q27System::T)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_M0P)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_M00) && !block->hasInterpolationFlagCF(D3Q27System::DIR_00P)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1,fbx2+0,fbx3+1,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1,fbx2+1,fbx3+1,level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1, fbx2+0, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1, fbx2+1, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::TW); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_M0P); } //////TN-BS-BN-TS - if( block->hasInterpolationFlagCF(D3Q27System::TN)&& !block->hasInterpolationFlagCF(D3Q27System::N) && !block->hasInterpolationFlagCF(D3Q27System::T)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_0PP)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_0P0) && !block->hasInterpolationFlagCF(D3Q27System::DIR_00P)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+0,fbx2+1,fbx3+1,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2+1,fbx3+1,level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+0, fbx2+1, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2+1, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::TN); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_0PP); } - if( block->hasInterpolationFlagCF(D3Q27System::BS)&& !block->hasInterpolationFlagCF(D3Q27System::S) && !block->hasInterpolationFlagCF(D3Q27System::B)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_0MM)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_0M0) && !block->hasInterpolationFlagCF(D3Q27System::DIR_00M)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+0,fbx2,fbx3,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2,fbx3,level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+0, fbx2, fbx3, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2, fbx3, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::BS); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_0MM); } - if( block->hasInterpolationFlagCF(D3Q27System::BN)&& !block->hasInterpolationFlagCF(D3Q27System::N) && !block->hasInterpolationFlagCF(D3Q27System::B)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_0PM)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_0P0) && !block->hasInterpolationFlagCF(D3Q27System::DIR_00M)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+0,fbx2+1,fbx3,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2+1,fbx3,level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+0, fbx2+1, fbx3, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2+1, fbx3, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::BN); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_0PM); } - if( block->hasInterpolationFlagCF(D3Q27System::TS)&& !block->hasInterpolationFlagCF(D3Q27System::S) && !block->hasInterpolationFlagCF(D3Q27System::T)) + if( block->hasInterpolationFlagCF(D3Q27System::DIR_0MP)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_0M0) && !block->hasInterpolationFlagCF(D3Q27System::DIR_00P)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+0,fbx2,fbx3+1,level); SPtr<Block3D> fblockSE = grid->getBlock(fbx1+1,fbx2,fbx3+1,level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+0, fbx2, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::TS); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_0MP); } //////corners - if (block->hasInterpolationFlagCF(D3Q27System::TNE)&&!block->hasInterpolationFlagCF(D3Q27System::TE)&&!block->hasInterpolationFlagCF(D3Q27System::TN)&&!block->hasInterpolationFlagCF(D3Q27System::NE)&&!block->hasInterpolationFlagCF(D3Q27System::T)&&!block->hasInterpolationFlagCF(D3Q27System::N) && !block->hasInterpolationFlagCF(D3Q27System::E)) + if (block->hasInterpolationFlagCF(D3Q27System::DIR_PPP)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_P0P)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_0PP)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_PP0)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_00P)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_0P0) && !block->hasInterpolationFlagCF(D3Q27System::DIR_P00)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+1, fbx2+1, fbx3+1, level); SPtr<Block3D> fblockSE;// = grid->getBlock(fbx1+1, fbx2+1, fbx3+0, level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+1, fbx2+1, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2+1, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::TNE); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_PPP); } - if (block->hasInterpolationFlagCF(D3Q27System::TSW)&&!block->hasInterpolationFlagCF(D3Q27System::TW)&&!block->hasInterpolationFlagCF(D3Q27System::TS)&& !block->hasInterpolationFlagCF(D3Q27System::SW)&& !block->hasInterpolationFlagCF(D3Q27System::T)&& !block->hasInterpolationFlagCF(D3Q27System::W) && !block->hasInterpolationFlagCF(D3Q27System::S)) + if (block->hasInterpolationFlagCF(D3Q27System::DIR_MMP)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_M0P)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_0MP)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_MM0)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_00P)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_M00) && !block->hasInterpolationFlagCF(D3Q27System::DIR_0M0)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1, fbx2, fbx3+1, level); SPtr<Block3D> fblockSE;// = grid->getBlock(fbx1, fbx2, fbx3, level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1, fbx2, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1, fbx2, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::TSW); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_MMP); } - if (block->hasInterpolationFlagCF(D3Q27System::TSE)&&!block->hasInterpolationFlagCF(D3Q27System::TE)&&!block->hasInterpolationFlagCF(D3Q27System::TS)&& !block->hasInterpolationFlagCF(D3Q27System::SE)&& !block->hasInterpolationFlagCF(D3Q27System::T)&& !block->hasInterpolationFlagCF(D3Q27System::E) && !block->hasInterpolationFlagCF(D3Q27System::S)) + if (block->hasInterpolationFlagCF(D3Q27System::DIR_PMP)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_P0P)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_0MP)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_PM0)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_00P)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_P00) && !block->hasInterpolationFlagCF(D3Q27System::DIR_0M0)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+1, fbx2, fbx3+1, level); SPtr<Block3D> fblockSE;// = grid->getBlock(fbx1+1, fbx2, fbx3+0, level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+1, fbx2, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::TSE); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_PMP); } - if (block->hasInterpolationFlagCF(D3Q27System::TNW)&&!block->hasInterpolationFlagCF(D3Q27System::TW)&&!block->hasInterpolationFlagCF(D3Q27System::TN)&& !block->hasInterpolationFlagCF(D3Q27System::NW)&& !block->hasInterpolationFlagCF(D3Q27System::T)&& !block->hasInterpolationFlagCF(D3Q27System::N) && !block->hasInterpolationFlagCF(D3Q27System::W)) + if (block->hasInterpolationFlagCF(D3Q27System::DIR_MPP)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_M0P)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_0PP)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_MP0)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_00P)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_0P0) && !block->hasInterpolationFlagCF(D3Q27System::DIR_M00)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1, fbx2+1, fbx3+1, level); SPtr<Block3D> fblockSE;// = grid->getBlock(fbx1, fbx2+1, fbx3, level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1, fbx2+1, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1, fbx2+1, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::TNW); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_MPP); } - if (block->hasInterpolationFlagCF(D3Q27System::BNE)&&!block->hasInterpolationFlagCF(D3Q27System::BE)&&!block->hasInterpolationFlagCF(D3Q27System::BN)&& !block->hasInterpolationFlagCF(D3Q27System::NE)&&!block->hasInterpolationFlagCF(D3Q27System::B)&&!block->hasInterpolationFlagCF(D3Q27System::N) && !block->hasInterpolationFlagCF(D3Q27System::E)) + if (block->hasInterpolationFlagCF(D3Q27System::DIR_PPM)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_P0M)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_0PM)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_PP0)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_00M)&&!block->hasInterpolationFlagCF(D3Q27System::DIR_0P0) && !block->hasInterpolationFlagCF(D3Q27System::DIR_P00)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+1, fbx2+1, fbx3+0, level); SPtr<Block3D> fblockSE;// = grid->getBlock(fbx1+1, fbx2+1, fbx3+0, level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+1, fbx2+1, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2+1, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::BNE); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_PPM); } - if (block->hasInterpolationFlagCF(D3Q27System::BSW)&& !block->hasInterpolationFlagCF(D3Q27System::BS)&& !block->hasInterpolationFlagCF(D3Q27System::BW)&& !block->hasInterpolationFlagCF(D3Q27System::SW)&& !block->hasInterpolationFlagCF(D3Q27System::B)&& !block->hasInterpolationFlagCF(D3Q27System::W) && !block->hasInterpolationFlagCF(D3Q27System::S)) + if (block->hasInterpolationFlagCF(D3Q27System::DIR_MMM)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_0MM)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_M0M)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_MM0)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_00M)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_M00) && !block->hasInterpolationFlagCF(D3Q27System::DIR_0M0)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1, fbx2, fbx3+0, level); SPtr<Block3D> fblockSE;// = grid->getBlock(fbx1, fbx2, fbx3, level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1, fbx2, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1, fbx2, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::BSW); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_MMM); } - if (block->hasInterpolationFlagCF(D3Q27System::BSE)&& !block->hasInterpolationFlagCF(D3Q27System::BS)&& !block->hasInterpolationFlagCF(D3Q27System::BE)&& !block->hasInterpolationFlagCF(D3Q27System::SE)&& !block->hasInterpolationFlagCF(D3Q27System::B)&& !block->hasInterpolationFlagCF(D3Q27System::E) && !block->hasInterpolationFlagCF(D3Q27System::S)) + if (block->hasInterpolationFlagCF(D3Q27System::DIR_PMM)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_0MM)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_P0M)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_PM0)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_00M)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_P00) && !block->hasInterpolationFlagCF(D3Q27System::DIR_0M0)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1+1, fbx2, fbx3, level); SPtr<Block3D> fblockSE;// = grid->getBlock(fbx1+1, fbx2, fbx3+0, level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1+1, fbx2, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1+1, fbx2, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::BSE); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_PMM); } - if (block->hasInterpolationFlagCF(D3Q27System::BNW)&& !block->hasInterpolationFlagCF(D3Q27System::BN)&& !block->hasInterpolationFlagCF(D3Q27System::BW)&& !block->hasInterpolationFlagCF(D3Q27System::NW)&& !block->hasInterpolationFlagCF(D3Q27System::B)&& !block->hasInterpolationFlagCF(D3Q27System::N) && !block->hasInterpolationFlagCF(D3Q27System::W)) + if (block->hasInterpolationFlagCF(D3Q27System::DIR_MPM)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_0PM)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_M0M)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_MP0)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_00M)&& !block->hasInterpolationFlagCF(D3Q27System::DIR_0P0) && !block->hasInterpolationFlagCF(D3Q27System::DIR_M00)) { SPtr<Block3D> fblockSW = grid->getBlock(fbx1, fbx2+1, fbx3+0, level); SPtr<Block3D> fblockSE;// = grid->getBlock(fbx1, fbx2+1, fbx3, level); SPtr<Block3D> fblockNW;// = grid->getBlock(fbx1, fbx2+1, fbx3+1, level); SPtr<Block3D> fblockNE;// = grid->getBlock(fbx1, fbx2+1, fbx3+1, level); - setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::BNW); + setInterpolationConnectors(fblockSW, fblockSE, fblockNW, fblockNE, block, D3Q27System::DIR_MPM); } } diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationDirsBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationDirsBlockVisitor.cpp index bb1ae79620179f65abd51672bd9958f471c398c7..689d84d0754f74c2f680fd2b7aa22ec0c54008c1 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationDirsBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SetInterpolationDirsBlockVisitor.cpp @@ -1,11 +1,11 @@ #include "SetInterpolationDirsBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include <D3Q27System.h> SetInterpolationDirsBlockVisitor::SetInterpolationDirsBlockVisitor(std::vector<int> &dirs) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), dirs(dirs) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), dirs(dirs) { } ////////////////////////////////////////////////////////////////////////// @@ -32,103 +32,103 @@ void SetInterpolationDirsBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> bl if (p_nblock) { bool flagDir; switch (dir) { - case NE: - checkFlagDir(grid, E, N, flagDir, ix1, ix2, ix3, level); + case DIR_PP0: + checkFlagDir(grid, DIR_P00, DIR_0P0, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case SW: - checkFlagDir(grid, W, S, flagDir, ix1, ix2, ix3, level); + case DIR_MM0: + checkFlagDir(grid, DIR_M00, DIR_0M0, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case SE: - checkFlagDir(grid, E, S, flagDir, ix1, ix2, ix3, level); + case DIR_PM0: + checkFlagDir(grid, DIR_P00, DIR_0M0, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case NW: - checkFlagDir(grid, W, N, flagDir, ix1, ix2, ix3, level); + case DIR_MP0: + checkFlagDir(grid, DIR_M00, DIR_0P0, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case TE: - checkFlagDir(grid, E, T, flagDir, ix1, ix2, ix3, level); + case DIR_P0P: + checkFlagDir(grid, DIR_P00, DIR_00P, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case BW: - checkFlagDir(grid, W, B, flagDir, ix1, ix2, ix3, level); + case DIR_M0M: + checkFlagDir(grid, DIR_M00, DIR_00M, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case BE: - checkFlagDir(grid, E, B, flagDir, ix1, ix2, ix3, level); + case DIR_P0M: + checkFlagDir(grid, DIR_P00, DIR_00M, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case TW: - checkFlagDir(grid, W, T, flagDir, ix1, ix2, ix3, level); + case DIR_M0P: + checkFlagDir(grid, DIR_M00, DIR_00P, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case TN: - checkFlagDir(grid, N, T, flagDir, ix1, ix2, ix3, level); + case DIR_0PP: + checkFlagDir(grid, DIR_0P0, DIR_00P, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case BS: - checkFlagDir(grid, S, B, flagDir, ix1, ix2, ix3, level); + case DIR_0MM: + checkFlagDir(grid, DIR_0M0, DIR_00M, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case BN: - checkFlagDir(grid, N, B, flagDir, ix1, ix2, ix3, level); + case DIR_0PM: + checkFlagDir(grid, DIR_0P0, DIR_00M, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case TS: - checkFlagDir(grid, S, T, flagDir, ix1, ix2, ix3, level); + case DIR_0MP: + checkFlagDir(grid, DIR_0M0, DIR_00P, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case TNE: - checkFlagDir(grid, E, N, T, flagDir, ix1, ix2, ix3, level); + case DIR_PPP: + checkFlagDir(grid, DIR_P00, DIR_0P0, DIR_00P, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case TSW: - checkFlagDir(grid, W, S, T, flagDir, ix1, ix2, ix3, level); + case DIR_MMP: + checkFlagDir(grid, DIR_M00, DIR_0M0, DIR_00P, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case TSE: - checkFlagDir(grid, E, S, T, flagDir, ix1, ix2, ix3, level); + case DIR_PMP: + checkFlagDir(grid, DIR_P00, DIR_0M0, DIR_00P, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case TNW: - checkFlagDir(grid, W, N, T, flagDir, ix1, ix2, ix3, level); + case DIR_MPP: + checkFlagDir(grid, DIR_M00, DIR_0P0, DIR_00P, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case BNE: - checkFlagDir(grid, E, N, B, flagDir, ix1, ix2, ix3, level); + case DIR_PPM: + checkFlagDir(grid, DIR_P00, DIR_0P0, DIR_00M, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case BSW: - checkFlagDir(grid, W, S, B, flagDir, ix1, ix2, ix3, level); + case DIR_MMM: + checkFlagDir(grid, DIR_M00, DIR_0M0, DIR_00M, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case BSE: - checkFlagDir(grid, E, S, B, flagDir, ix1, ix2, ix3, level); + case DIR_PMM: + checkFlagDir(grid, DIR_P00, DIR_0M0, DIR_00M, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; - case BNW: - checkFlagDir(grid, W, N, B, flagDir, ix1, ix2, ix3, level); + case DIR_MPM: + checkFlagDir(grid, DIR_M00, DIR_0P0, DIR_00M, flagDir, ix1, ix2, ix3, level); if (!flagDir) continue; break; diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetKernelBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SetKernelBlockVisitor.cpp index b55c405d6f72e989f229d9d35cdd1b5823f899e9..354a577e701f9d017181e6006833ad40749eef60 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetKernelBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SetKernelBlockVisitor.cpp @@ -38,7 +38,7 @@ #include "Block3D.h" #include "DataSet3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMKernel.h" #include "LBMSystem.h" #include <utility> @@ -46,7 +46,7 @@ ////////////////////////////////////////////////////////////////////////// SetKernelBlockVisitor::SetKernelBlockVisitor(SPtr<LBMKernel> kernel, LBMReal nue, double availMem, double needMem, SetKernelBlockVisitor::Action action) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), kernel(std::move(kernel)), nue(nue), action(action), dataSetFlag(true) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), kernel(std::move(kernel)), nue(nue), action(action), dataSetFlag(true) { if (needMem > availMem) { throw UbException(UB_EXARGS, "SetKernelBlockVisitor: Not enough memory!!!"); @@ -55,7 +55,7 @@ SetKernelBlockVisitor::SetKernelBlockVisitor(SPtr<LBMKernel> kernel, LBMReal nue SetKernelBlockVisitor::SetKernelBlockVisitor(SPtr<LBMKernel> kernel, LBMReal nue, int numberOfProcesses, SetKernelBlockVisitor::Action action) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), kernel(std::move(kernel)), nue(nue), action(action), dataSetFlag(true), + : Block3DVisitor(0, D3Q27System::MAXLEVEL), kernel(std::move(kernel)), nue(nue), action(action), dataSetFlag(true), numberOfProcesses(numberOfProcesses) { } diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetSolidBlocksBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SetSolidBlocksBlockVisitor.cpp index 3354755f22f18df700523d795c8fced0d0f19628..e78300c5af6590da72bec3b28516143e4ec18a1d 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetSolidBlocksBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SetSolidBlocksBlockVisitor.cpp @@ -37,11 +37,11 @@ #include "Block3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "Interactor3D.h" SetSolidBlocksBlockVisitor::SetSolidBlocksBlockVisitor(SPtr<Interactor3D> interactor) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), interactor(std::move(interactor)) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), interactor(std::move(interactor)) { } diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetSpongeLayerBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SetSpongeLayerBlockVisitor.cpp index 040f54b0fd645a206952ce2c992d4abeea3ace85..789b3e3dc932462155a897be1c2c998400adb7f3 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetSpongeLayerBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SetSpongeLayerBlockVisitor.cpp @@ -1,5 +1,5 @@ #include "SetSpongeLayerBlockVisitor.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMSystem.h" #include "Block3D.h" @@ -7,7 +7,7 @@ #include "LBMKernel.h" SetSpongeLayerBlockVisitor::SetSpongeLayerBlockVisitor(const mu::Parser &spongeLayer) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), spongeLayer(spongeLayer) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), spongeLayer(spongeLayer) { } ////////////////////////////////////////////////////////////////////////// diff --git a/src/cpu/VirtualFluidsCore/Visitors/SetUndefinedNodesBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SetUndefinedNodesBlockVisitor.cpp index 15c8b82bae5c95f6783f73c7e7a70004f3c76574..3b9eb9493fe0fa66f05fdd3ea42505604836d218 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SetUndefinedNodesBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SetUndefinedNodesBlockVisitor.cpp @@ -5,11 +5,11 @@ #include "BoundaryConditions.h" #include "D3Q27System.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "ILBMKernel.h" SetUndefinedNodesBlockVisitor::SetUndefinedNodesBlockVisitor(bool twoTypeOfConnectorsCheck) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), twoTypeOfConnectorsCheck(twoTypeOfConnectorsCheck) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), twoTypeOfConnectorsCheck(twoTypeOfConnectorsCheck) { } ////////////////////////////////////////////////////////////////////////// @@ -40,7 +40,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block // int offset = 2; int offset = 3; - if (block->hasInterpolationFlag(D3Q27System::E)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_P00)) { int startix1 = maxX1; int endix1 = maxX1; if (block->hasInterpolationFlagCF()) @@ -51,7 +51,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::W)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_M00)) { int startix1 = minX1; int endix1 = minX1; if (block->hasInterpolationFlagCF()) @@ -62,7 +62,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::N)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_0P0)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = maxX2; @@ -73,7 +73,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::S)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_0M0)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = minX2; @@ -84,7 +84,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::T)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_00P)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = minX2; @@ -95,7 +95,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block startix3 = startix3 - offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::B)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_00M)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = minX2; @@ -106,7 +106,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block endix3 = endix3 + offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::NE)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_PP0)) { int startix1 = maxX1; int endix1 = maxX1; if (block->hasInterpolationFlagCF()) @@ -119,7 +119,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::SW)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_MM0)) { int startix1 = minX1; int endix1 = minX1; if (block->hasInterpolationFlagCF()) @@ -132,7 +132,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::SE)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_PM0)) { int startix1 = maxX1; int endix1 = maxX1; if (block->hasInterpolationFlagCF()) @@ -145,7 +145,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::NW)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_MP0)) { int startix1 = minX1; int endix1 = minX1; if (block->hasInterpolationFlagCF()) @@ -158,7 +158,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::TE)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_P0P)) { int startix1 = maxX1; int endix1 = maxX1; if (block->hasInterpolationFlagCF()) @@ -171,7 +171,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block startix3 = startix3 - offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::BW)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_M0M)) { int startix1 = minX1; int endix1 = minX1; if (block->hasInterpolationFlagCF()) @@ -184,7 +184,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block endix3 = endix3 + offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::BE)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_P0M)) { int startix1 = maxX1; int endix1 = maxX1; if (block->hasInterpolationFlagCF()) @@ -197,7 +197,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block endix3 = endix3 + offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::TW)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_M0P)) { int startix1 = minX1; int endix1 = minX1; if (block->hasInterpolationFlagCF()) @@ -210,7 +210,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block startix3 = startix3 - offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::TN)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_0PP)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = maxX2; @@ -223,7 +223,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block startix3 = startix3 - offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::BS)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_0MM)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = minX2; @@ -236,7 +236,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block endix3 = endix3 + offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::BN)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_0PM)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = maxX2; @@ -249,7 +249,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block endix3 = endix3 + offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::TS)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_0MP)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = minX2; @@ -262,7 +262,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block startix3 = startix3 - offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::TNE)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_PPP)) { int startix1 = maxX1; int endix1 = maxX1; if (block->hasInterpolationFlagCF()) @@ -277,7 +277,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block startix3 = startix3 - offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::TNW)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_MPP)) { int startix1 = minX1; int endix1 = minX1; if (block->hasInterpolationFlagCF()) @@ -292,7 +292,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block startix3 = startix3 - offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::TSE)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_PMP)) { int startix1 = maxX1; int endix1 = maxX1; if (block->hasInterpolationFlagCF()) @@ -307,7 +307,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block startix3 = startix3 - offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::TSW)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_MMP)) { int startix1 = minX1; int endix1 = minX1; if (block->hasInterpolationFlagCF()) @@ -322,7 +322,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block startix3 = startix3 - offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::BNE)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_PPM)) { int startix1 = maxX1; int endix1 = maxX1; if (block->hasInterpolationFlagCF()) @@ -337,7 +337,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block endix3 = endix3 + offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::BNW)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_MPM)) { int startix1 = minX1; int endix1 = minX1; if (block->hasInterpolationFlagCF()) @@ -352,7 +352,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block endix3 = endix3 + offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::BSE)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_PMM)) { int startix1 = maxX1; int endix1 = maxX1; if (block->hasInterpolationFlagCF()) @@ -367,7 +367,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block endix3 = endix3 + offset; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlag(D3Q27System::BSW)) { + if (block->hasInterpolationFlag(D3Q27System::DIR_MMM)) { int startix1 = minX1; int endix1 = minX1; if (block->hasInterpolationFlagCF()) @@ -395,7 +395,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block maxX2 = static_cast<int>(bcMatrix->getNX2()) - 1 - ll; maxX3 = static_cast<int>(bcMatrix->getNX3()) - 1 - ll; - if (block->hasInterpolationFlagFC(D3Q27System::E)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_P00)) { int startix1 = maxX1 - offset2; int endix1 = maxX1; int startix2 = minX2; @@ -404,7 +404,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::W)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_M00)) { int startix1 = minX1; int endix1 = minX1 + offset2; int startix2 = minX2; @@ -413,7 +413,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::N)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_0P0)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = maxX2 - offset2; @@ -422,7 +422,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::S)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_0M0)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = minX2; @@ -431,7 +431,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::T)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_00P)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = minX2; @@ -440,7 +440,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::B)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_00M)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = minX2; @@ -449,7 +449,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = minX3 + offset2; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::NE)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_PP0)) { int startix1 = maxX1 - offset2; int endix1 = maxX1; int startix2 = maxX2 - offset2; @@ -458,7 +458,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::SW)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_MM0)) { int startix1 = minX1; int endix1 = minX1 + offset2; int startix2 = minX2; @@ -467,7 +467,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::SE)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_PM0)) { int startix1 = maxX1 - offset2; int endix1 = maxX1; int startix2 = minX2; @@ -476,7 +476,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::NW)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_MP0)) { int startix1 = minX1; int endix1 = minX1 + offset2; int startix2 = maxX2 - offset2; @@ -485,7 +485,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::TE)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_P0P)) { int startix1 = maxX1 - offset2; int endix1 = maxX1; int startix2 = minX2; @@ -494,7 +494,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::BW)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_M0M)) { int startix1 = minX1; int endix1 = minX1 + offset2; int startix2 = minX2; @@ -503,7 +503,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = minX3 + offset2; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::BE)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_P0M)) { int startix1 = maxX1 - offset2; int endix1 = maxX1; int startix2 = minX2; @@ -512,7 +512,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = minX3 + offset2; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::TW)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_M0P)) { int startix1 = minX1; int endix1 = minX1 + offset2; int startix2 = minX2; @@ -521,7 +521,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::TN)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_0PP)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = maxX2 - offset2; @@ -530,7 +530,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::BS)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_0MM)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = minX2; @@ -539,7 +539,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = minX3 + offset2; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::BN)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_0PM)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = maxX2 - offset2; @@ -548,7 +548,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = minX3 + offset2; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::TS)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_0MP)) { int startix1 = minX1; int endix1 = maxX1; int startix2 = minX2; @@ -557,7 +557,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::TNE)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_PPP)) { int startix1 = maxX1 - offset2; int endix1 = maxX1; int startix2 = maxX2 - offset2; @@ -566,7 +566,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::TNW)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_MPP)) { int startix1 = minX1; int endix1 = minX1 + offset2; int startix2 = maxX2 - offset2; @@ -575,7 +575,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::TSE)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_PMP)) { int startix1 = maxX1 - offset2; int endix1 = maxX1; int startix2 = minX2; @@ -584,7 +584,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::TSW)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_MMP)) { int startix1 = minX1; int endix1 = minX1 + offset2; int startix2 = minX2; @@ -593,7 +593,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = maxX3; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::BNE)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_PPM)) { int startix1 = maxX1 - offset2; int endix1 = maxX1; int startix2 = maxX2 - offset2; @@ -602,7 +602,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = minX3 + offset2; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::BNW)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_MPM)) { int startix1 = minX1; int endix1 = minX1 + offset2; int startix2 = maxX2 - offset2; @@ -611,7 +611,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = minX3 + offset2; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::BSE)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_PMM)) { int startix1 = maxX1 - offset2; int endix1 = maxX1; int startix2 = minX2; @@ -620,7 +620,7 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block int endix3 = minX3 + offset2; this->setNodesUndefined(startix1, endix1, startix2, endix2, startix3, endix3, bcMatrix); } - if (block->hasInterpolationFlagFC(D3Q27System::BSW)) { + if (block->hasInterpolationFlagFC(D3Q27System::DIR_MMM)) { int startix1 = minX1; int endix1 = minX1 + offset2; int startix2 = minX2; @@ -633,10 +633,10 @@ void SetUndefinedNodesBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block // invert scaleCF blocks if (block->hasInterpolationFlagCF()) { if (block->hasInterpolationFlagFC() && twoTypeOfConnectorsCheck) { - for (int i = D3Q27System::E; i <= D3Q27System::BSW; i++) { + for (int i = D3Q27System::DIR_P00; i <= D3Q27System::DIR_MMM; i++) { UBLOG(logINFO, "FC in dir=" << i << " " << block->hasInterpolationFlagFC(i)); } - for (int i = D3Q27System::E; i <= D3Q27System::BSW; i++) { + for (int i = D3Q27System::DIR_P00; i <= D3Q27System::DIR_MMM; i++) { UBLOG(logINFO, "CF in dir=" << i << " " << block->hasInterpolationFlagCF(i)); } throw UbException(UB_EXARGS, "block " + block->toString() + " has CF and FC"); diff --git a/src/cpu/VirtualFluidsCore/Visitors/SpongeLayerBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SpongeLayerBlockVisitor.cpp index c9bbc78cdd575f115d86d3e470cefe50dd636ba6..1ef34e0e8bbf54625efbc946b141cf16f24c213d 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SpongeLayerBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SpongeLayerBlockVisitor.cpp @@ -1,5 +1,5 @@ #include "SpongeLayerBlockVisitor.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "LBMSystem.h" #include "BCArray3D.h" @@ -15,7 +15,7 @@ using namespace std; SpongeLayerBlockVisitor::SpongeLayerBlockVisitor(SPtr<GbCuboid3D> boundingBox, SPtr<LBMKernel> kernel, double nue, int dir) - : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), boundingBox(boundingBox), kernel(kernel), nue(nue), dir(dir) + : Block3DVisitor(0, D3Q27System::MAXLEVEL), boundingBox(boundingBox), kernel(kernel), nue(nue), dir(dir) { } ////////////////////////////////////////////////////////////////////////// @@ -72,22 +72,22 @@ void SpongeLayerBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block) double newCollFactor; - if (dir == D3Q27System::E) { + if (dir == D3Q27System::DIR_P00) { int ibX1 = block->getX1(); int ibMax = val<1>(ixMax) - val<1>(ixMin) + 1; double index = (double)(ibX1 - val<1>(ixMin) + 1); newCollFactor = oldCollFactor - (oldCollFactor - 1.0) / (double)(ibMax)*index; - } else if (dir == D3Q27System::W) { + } else if (dir == D3Q27System::DIR_M00) { int ibX1 = block->getX1(); int ibMax = val<1>(ixMax) - val<1>(ixMin) + 1; double index = (double)(ibX1 - val<1>(ixMin) + 1); newCollFactor = (oldCollFactor - 1.0) / (double)(ibMax)*index; - } else if (dir == D3Q27System::T) { + } else if (dir == D3Q27System::DIR_00P) { int ibX3 = block->getX3(); int ibMax = val<3>(ixMax) - val<3>(ixMin) + 1; double index = (double)(ibX3 - val<3>(ixMin) + 1); newCollFactor = oldCollFactor - (oldCollFactor - 1.0) / (double)(ibMax)*index; - } else if (dir == D3Q27System::B) { + } else if (dir == D3Q27System::DIR_00M) { int ibX3 = block->getX3(); int ibMax = val<3>(ixMax) - val<3>(ixMin) + 1; double index = (double)(ibX3 - val<3>(ixMin) + 1); diff --git a/src/cpu/VirtualFluidsCore/Visitors/ViscosityBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/ViscosityBlockVisitor.cpp index 67d185d6ac401909d85b99b74ef1ede2d0054a6a..311a8bf19786198e85b00eb500f6e7c90d2d5106 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/ViscosityBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/ViscosityBlockVisitor.cpp @@ -1,11 +1,11 @@ #include "ViscosityBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" -#include "Grid3DSystem.h" +#include "D3Q27System.h" #include "ILBMKernel.h" #include "LBMSystem.h" -ViscosityBlockVisitor::ViscosityBlockVisitor(LBMReal nu) : Block3DVisitor(0, Grid3DSystem::MAXLEVEL), nu(nu) {} +ViscosityBlockVisitor::ViscosityBlockVisitor(LBMReal nu) : Block3DVisitor(0, D3Q27System::MAXLEVEL), nu(nu) {} ////////////////////////////////////////////////////////////////////////// void ViscosityBlockVisitor::visit(SPtr<Grid3D> grid, SPtr<Block3D> block) { diff --git a/src/lbm/constants/D3Q27.h b/src/lbm/constants/D3Q27.h index 0b2cbfdd44e84af590fa2c2be4bf319cbfd4c815..418038c35e9e5f0ae423f87a4d4a468888a2f274 100644 --- a/src/lbm/constants/D3Q27.h +++ b/src/lbm/constants/D3Q27.h @@ -64,6 +64,88 @@ static constexpr int PMM = 24; static constexpr int MMM = 25; static constexpr int ZZZ = 26; +static constexpr int DIR_000 = 0; +static constexpr int DIR_P00 = 1; +static constexpr int DIR_M00 = 2; +static constexpr int DIR_0P0 = 3; +static constexpr int DIR_0M0 = 4; +static constexpr int DIR_00P = 5; +static constexpr int DIR_00M = 6; +static constexpr int DIR_PP0 = 7; +static constexpr int DIR_MM0 = 8; +static constexpr int DIR_PM0 = 9; +static constexpr int DIR_MP0 = 10; +static constexpr int DIR_P0P = 11; +static constexpr int DIR_M0M = 12; +static constexpr int DIR_P0M = 13; +static constexpr int DIR_M0P = 14; +static constexpr int DIR_0PP = 15; +static constexpr int DIR_0MM = 16; +static constexpr int DIR_0PM = 17; +static constexpr int DIR_0MP = 18; +static constexpr int DIR_PPP = 19; +static constexpr int DIR_MPP = 20; +static constexpr int DIR_PMP = 21; +static constexpr int DIR_MMP = 22; +static constexpr int DIR_PPM = 23; +static constexpr int DIR_MPM = 24; +static constexpr int DIR_PMM = 25; +static constexpr int DIR_MMM = 26; + +static constexpr int INV_P00 = DIR_M00; +static constexpr int INV_M00 = DIR_P00; +static constexpr int INV_0P0 = DIR_0M0; +static constexpr int INV_0M0 = DIR_0P0; +static constexpr int INV_00P = DIR_00M; +static constexpr int INV_00M = DIR_00P; +static constexpr int INV_PP0 = DIR_MM0; +static constexpr int INV_MM0 = DIR_PP0; +static constexpr int INV_PM0 = DIR_MP0; +static constexpr int INV_MP0 = DIR_PM0; +static constexpr int INV_P0P = DIR_M0M; +static constexpr int INV_M0M = DIR_P0P; +static constexpr int INV_P0M = DIR_M0P; +static constexpr int INV_M0P = DIR_P0M; +static constexpr int INV_0PP = DIR_0MM; +static constexpr int INV_0MM = DIR_0PP; +static constexpr int INV_0PM = DIR_0MP; +static constexpr int INV_0MP = DIR_0PM; +static constexpr int INV_PPP = DIR_MMM; +static constexpr int INV_MPP = DIR_PMM; +static constexpr int INV_PMP = DIR_MPM; +static constexpr int INV_MMP = DIR_PPM; +static constexpr int INV_PPM = DIR_MMP; +static constexpr int INV_MPM = DIR_PMP; +static constexpr int INV_PMM = DIR_MPP; +static constexpr int INV_MMM = DIR_PPP; + +static constexpr int SGD_P00 = 0; +static constexpr int SGD_M00 = 1; +static constexpr int SGD_0P0 = 2; +static constexpr int SGD_0M0 = 3; +static constexpr int SGD_00P = 4; +static constexpr int SGD_00M = 5; +static constexpr int SGD_PP0 = 6; +static constexpr int SGD_MM0 = 7; +static constexpr int SGD_PM0 = 8; +static constexpr int SGD_MP0 = 9; +static constexpr int SGD_P0P = 10; +static constexpr int SGD_M0M = 11; +static constexpr int SGD_P0M = 12; +static constexpr int SGD_M0P = 13; +static constexpr int SGD_0PP = 14; +static constexpr int SGD_0MM = 15; +static constexpr int SGD_0PM = 16; +static constexpr int SGD_0MP = 17; +static constexpr int SGD_PPP = 18; +static constexpr int SGD_MPP = 19; +static constexpr int SGD_PMP = 20; +static constexpr int SGD_MMP = 21; +static constexpr int SGD_PPM = 22; +static constexpr int SGD_MPM = 23; +static constexpr int SGD_PMM = 24; +static constexpr int SGD_MMM = 25; + } } }