diff --git a/src/cpu/VirtualFluidsCore/Parallel/MPIIODataStructures.h b/src/cpu/VirtualFluidsCore/Parallel/MPIIODataStructures.h index e0f5268899811138fe5cd7e34feee8634a6d04cb..dd5b9935a99e6ad1da05cb48a18b0c5ef12090ac 100644 --- a/src/cpu/VirtualFluidsCore/Parallel/MPIIODataStructures.h +++ b/src/cpu/VirtualFluidsCore/Parallel/MPIIODataStructures.h @@ -9,8 +9,8 @@ namespace MPIIODataStructures //! \brief Structure describes parameters of the grid //! \details The structure is nessasary to restore the grid correctly struct GridParam { - real trafoParams[33]; - real deltaX; + double trafoParams[33]; // not float!!! + double deltaX; // not float!!! int blockNx1; int blockNx2; int blockNx3; @@ -59,18 +59,11 @@ struct dataSetParam { //! \brief Structure describes parameters of the dataSet in MPIIORestartSimulationObserver format //! \details The structure is used when reading from the file struct DataSetRestart { - real collFactor; - real deltaT; - real collFactorL; // for Multiphase model - real collFactorG; // for Multiphase model - real densityRatio;// for Multiphase model - real sigma; // for Multiphase model - real contactAngle; // for Multiphase model - real phiL; // for Multiphase model - real phiH; // for Multiphase model - real tauH; // for Multiphase model - real mob; // for Multiphase model - real interfaceWidth; // for Multiphase model + double collFactor; // not float!!! + double deltaT; // not float!!! + double collFactorL; // for Multiphase model // not float!!! + double collFactorG; // for Multiphase model // not float!!! + double densityRatio;// for Multiphase model // not float!!! int x1; int x2; int x3; @@ -84,18 +77,11 @@ struct DataSetRestart { //! \brief Structure describes parameters of the dataSet in MPIIOMigrationSimulationObserver format //! \details The structure is used to find the needed block in the grid when restoring a dataSet struct DataSetMigration { - real collFactor; - real deltaT; - real collFactorL; // for Multiphase model - real collFactorG; // for Multiphase model - real densityRatio;// for Multiphase model - real sigma; // for Multiphase model - real contactAngle; // for Multiphase model - real phiL; // for Multiphase model - real phiH; // for Multiphase model - real tauH; // for Multiphase model - real mob; // for Multiphase model - real interfaceWidth; // for Multiphase model + double collFactor; // not float!!! + double deltaT; // not float!!! + double collFactorL; // for Multiphase model + double collFactorG; // for Multiphase model + double densityRatio;// for Multiphase model int globalID; int ghostLayerWidth; bool compressible; @@ -129,14 +115,14 @@ struct BoundaryCondition { long long densityBoundaryFlags; long long wallModelBoundaryFlags; - real bcVelocityX1; - real bcVelocityX2; - real bcVelocityX3; - real bcDensity; - real bcPhaseField; + float bcVelocityX1; // not double!!! + float bcVelocityX2; // not double!!! + float bcVelocityX3; // not double!!! + float bcDensity; // not double!!! + float bcPhaseField; // not double!!! - real nx1, nx2, nx3; - real q[26]; + float nx1, nx2, nx3; // not double!!! + float q[26]; // not double!!! char algorithmType; }; diff --git a/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp b/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp index 5cdc87c6867c5ec2a8676e66a228ba5e768014fb..c6bed523e5cf319b1cfced74cffed3b93265f0f4 100644 --- a/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp +++ b/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationBESimulationObserver.cpp @@ -695,16 +695,16 @@ void MPIIOMigrationBESimulationObserver::writeBoundaryConds(int step) bouCond->velocityBoundaryFlags = bcArr->bcvector[bc]->getVelocityBoundary(); bouCond->densityBoundaryFlags = bcArr->bcvector[bc]->getDensityBoundary(); bouCond->wallModelBoundaryFlags = bcArr->bcvector[bc]->getWallModelBoundary(); - bouCond->bcVelocityX1 = (real)bcArr->bcvector[bc]->getBoundaryVelocityX1(); - bouCond->bcVelocityX2 = (real)bcArr->bcvector[bc]->getBoundaryVelocityX2(); - bouCond->bcVelocityX3 = (real)bcArr->bcvector[bc]->getBoundaryVelocityX3(); - bouCond->bcDensity = (real)bcArr->bcvector[bc]->getBoundaryDensity(); - bouCond->bcPhaseField = (real)bcArr->bcvector[bc]->getBoundaryPhaseField(); - bouCond->nx1 = (real)bcArr->bcvector[bc]->nx1; - bouCond->nx2 = (real)bcArr->bcvector[bc]->nx2; - bouCond->nx3 = (real)bcArr->bcvector[bc]->nx3; + bouCond->bcVelocityX1 = bcArr->bcvector[bc]->getBoundaryVelocityX1(); + bouCond->bcVelocityX2 = bcArr->bcvector[bc]->getBoundaryVelocityX2(); + bouCond->bcVelocityX3 = bcArr->bcvector[bc]->getBoundaryVelocityX3(); + bouCond->bcDensity = bcArr->bcvector[bc]->getBoundaryDensity(); + bouCond->bcPhaseField = bcArr->bcvector[bc]->getBoundaryPhaseField(); + bouCond->nx1 = bcArr->bcvector[bc]->nx1; + bouCond->nx2 = bcArr->bcvector[bc]->nx2; + bouCond->nx3 = bcArr->bcvector[bc]->nx3; for (int iq = 0; iq < 26; iq++) - bouCond->q[iq] = (real)bcArr->bcvector[bc]->getQ(iq); + bouCond->q[iq] = bcArr->bcvector[bc]->getQ(iq); bouCond->algorithmType = bcArr->bcvector[bc]->getBCStrategyType(); } diff --git a/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationSimulationObserver.cpp b/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationSimulationObserver.cpp index cb36362df47bc125ac7e0ba8476b75c6cab3e953..9fcc3c9b8ba84fa6322a7e5d9ed5974912707e68 100644 --- a/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationSimulationObserver.cpp +++ b/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationSimulationObserver.cpp @@ -31,7 +31,7 @@ MPIIOMigrationSimulationObserver::MPIIOMigrationSimulationObserver(SPtr<Grid3D> //------------------------- define MPI types --------------------------------- MPI_Datatype typesDataSet[3] = { MPI_DOUBLE, MPI_INT, MPI_CHAR }; - int blocksDataSet[3] = { 12, 2, 2 }; + int blocksDataSet[3] = { 5, 2, 2 }; MPI_Aint offsetsDatatSet[3], lbDataSet, extentDataSet; offsetsDatatSet[0] = 0; @@ -173,14 +173,6 @@ void MPIIOMigrationSimulationObserver::writeDataSet(int step) dataSetArray[ic].collFactorG = kernel->getCollisionFactorG(); dataSetArray[ic].densityRatio = kernel->getDensityRatio(); - dataSetArray[ic].sigma = kernel->getSigma(); - dataSetArray[ic].contactAngle = kernel->getContactAngle(); - dataSetArray[ic].phiL = kernel->getPhiL(); - dataSetArray[ic].phiH = kernel->getPhiH(); - dataSetArray[ic].tauH = kernel->getPhaseFieldRelaxation(); - dataSetArray[ic].mob = kernel->getMobility(); - dataSetArray[ic].interfaceWidth = kernel->getInterfaceWidth(); - D3Q27EsoTwist3DSplittedVectorPtrF = dynamicPointerCast<D3Q27EsoTwist3DSplittedVector>(block->getKernel()->getDataSet()->getFdistributions()); localDistributionsF = D3Q27EsoTwist3DSplittedVectorPtrF->getLocalDistributions(); nonLocalDistributionsF = D3Q27EsoTwist3DSplittedVectorPtrF->getNonLocalDistributions(); @@ -784,23 +776,23 @@ void MPIIOMigrationSimulationObserver::writeBoundaryConds(int step) bouCond->velocityBoundaryFlags = bcArr->bcvector[bc]->getVelocityBoundary(); bouCond->densityBoundaryFlags = bcArr->bcvector[bc]->getDensityBoundary(); bouCond->wallModelBoundaryFlags = bcArr->bcvector[bc]->getWallModelBoundary(); - bouCond->bcVelocityX1 = (real)bcArr->bcvector[bc]->getBoundaryVelocityX1(); - bouCond->bcVelocityX2 = (real)bcArr->bcvector[bc]->getBoundaryVelocityX2(); - bouCond->bcVelocityX3 = (real)bcArr->bcvector[bc]->getBoundaryVelocityX3(); - bouCond->bcDensity = (real)bcArr->bcvector[bc]->getBoundaryDensity(); - bouCond->bcPhaseField = (real)bcArr->bcvector[bc]->getBoundaryPhaseField(); - bouCond->nx1 = (real)bcArr->bcvector[bc]->nx1; - bouCond->nx2 = (real)bcArr->bcvector[bc]->nx2; - bouCond->nx3 = (real)bcArr->bcvector[bc]->nx3; + bouCond->bcVelocityX1 = bcArr->bcvector[bc]->getBoundaryVelocityX1(); + bouCond->bcVelocityX2 = bcArr->bcvector[bc]->getBoundaryVelocityX2(); + bouCond->bcVelocityX3 = bcArr->bcvector[bc]->getBoundaryVelocityX3(); + bouCond->bcDensity = bcArr->bcvector[bc]->getBoundaryDensity(); + bouCond->bcPhaseField = bcArr->bcvector[bc]->getBoundaryPhaseField(); + bouCond->nx1 = bcArr->bcvector[bc]->nx1; + bouCond->nx2 = bcArr->bcvector[bc]->nx2; + bouCond->nx3 = bcArr->bcvector[bc]->nx3; for (int iq = 0; iq < 26; iq++) - bouCond->q[iq] = (real)bcArr->bcvector[bc]->getQ(iq); + bouCond->q[iq] = bcArr->bcvector[bc]->getQ(iq); bouCond->algorithmType = bcArr->bcvector[bc]->getBCStrategyType(); } bcVector[ic].push_back(*bouCond); bcAddArray[ic].boundCond_count++; bytesCount[ic] += sizeof(BoundaryCondition); - } + } if (bcindexmatrixCountNotInit) { @@ -1162,15 +1154,7 @@ void MPIIOMigrationSimulationObserver::readDataSet(int step) kernel->setCollisionFactorMultiphase(dataSetArray[n].collFactorL, dataSetArray[n].collFactorG); kernel->setDensityRatio(dataSetArray[n].densityRatio); - kernel->setSigma(dataSetArray[n].sigma); - kernel->setContactAngle(dataSetArray[n].contactAngle); - kernel->setPhiL(dataSetArray[n].phiL); - kernel->setPhiH(dataSetArray[n].phiH); - kernel->setPhaseFieldRelaxation(dataSetArray[n].tauH); - kernel->setMobility(dataSetArray[n].mob); - kernel->setInterfaceWidth(dataSetArray[n].interfaceWidth); - - SPtr<DataSet3D> dataSetPtr = SPtr<DataSet3D>(new DataSet3D()); + SPtr<DataSet3D> dataSetPtr = SPtr<DataSet3D>(new DataSet3D()); dataSetPtr->setFdistributions(mFdistributions); if (multiPhase1) dataSetPtr->setHdistributions(mH1distributions); diff --git a/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationSimulationObserver.h b/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationSimulationObserver.h index 588366a6498c107600d377a65819e11100aa6702..7466e02a204e60060848f5b09d59a766387b9fff 100644 --- a/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationSimulationObserver.h +++ b/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIOMigrationSimulationObserver.h @@ -25,10 +25,10 @@ public: AverageFluktuations = 3, AverageTriple = 4, ShearStressVal = 5, - RelaxationFactor = 6, - PhaseField1 = 7, - PhaseField2 = 8, - PressureField = 9 + RelaxationFactor = 6, + PhaseField1 = 7, + PhaseField2 = 8, + PressureField = 9 }; MPIIOMigrationSimulationObserver(SPtr<Grid3D> grid, SPtr<UbScheduler> s, SPtr<Grid3DVisitor> mV, const std::string &path, std::shared_ptr<vf::mpi::Communicator> comm); @@ -82,6 +82,7 @@ private: SPtr<LBMKernel> lbmKernel; SPtr<BCSet> bcSet; SPtr<Grid3DVisitor> metisVisitor; + }; #endif diff --git a/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIORestartSimulationObserver.cpp b/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIORestartSimulationObserver.cpp index fdc3f4d4347f56d52c2b8a4952da3309ca90fe19..fd73d61608733b7782d2970fc90085b10864ed2f 100644 --- a/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIORestartSimulationObserver.cpp +++ b/src/cpu/VirtualFluidsCore/SimulationObservers/MPIIORestartSimulationObserver.cpp @@ -849,16 +849,16 @@ void MPIIORestartSimulationObserver::writeBoundaryConds(int step) bouCond->velocityBoundaryFlags = bcArr->bcvector[bc]->getVelocityBoundary(); bouCond->densityBoundaryFlags = bcArr->bcvector[bc]->getDensityBoundary(); bouCond->wallModelBoundaryFlags = bcArr->bcvector[bc]->getWallModelBoundary(); - bouCond->bcVelocityX1 = (real)bcArr->bcvector[bc]->getBoundaryVelocityX1(); - bouCond->bcVelocityX2 = (real)bcArr->bcvector[bc]->getBoundaryVelocityX2(); - bouCond->bcVelocityX3 = (real)bcArr->bcvector[bc]->getBoundaryVelocityX3(); - bouCond->bcDensity = (real)bcArr->bcvector[bc]->getBoundaryDensity(); - bouCond->bcPhaseField = (real)bcArr->bcvector[bc]->getBoundaryPhaseField(); - bouCond->nx1 = (real)bcArr->bcvector[bc]->nx1; - bouCond->nx2 = (real)bcArr->bcvector[bc]->nx2; - bouCond->nx3 = (real)bcArr->bcvector[bc]->nx3; + bouCond->bcVelocityX1 = bcArr->bcvector[bc]->getBoundaryVelocityX1(); + bouCond->bcVelocityX2 = bcArr->bcvector[bc]->getBoundaryVelocityX2(); + bouCond->bcVelocityX3 = bcArr->bcvector[bc]->getBoundaryVelocityX3(); + bouCond->bcDensity = bcArr->bcvector[bc]->getBoundaryDensity(); + bouCond->bcPhaseField = bcArr->bcvector[bc]->getBoundaryPhaseField(); + bouCond->nx1 = bcArr->bcvector[bc]->nx1; + bouCond->nx2 = bcArr->bcvector[bc]->nx2; + bouCond->nx3 = bcArr->bcvector[bc]->nx3; for (int iq = 0; iq < 26; iq++) - bouCond->q[iq] = (real)bcArr->bcvector[bc]->getQ(iq); + bouCond->q[iq] = bcArr->bcvector[bc]->getQ(iq); bouCond->algorithmType = bcArr->bcvector[bc]->getBCStrategyType(); }