98 template <MInt nDim_,
class SysEqn>
101 template <MInt nDim_, MInt nDist,
class SysEqn>
104 template <MInt nDim_,
class SysEqn>
107 template <MInt nDim_>
110 template <MInt nDim_>
113 template <MInt nDim_>
116 template <MInt nDim_>
124 using Grid =
typename CartesianSolver::Grid;
129 using CartesianSolver::domainId;
130 using CartesianSolver::domainOffset;
131 using CartesianSolver::getIdentifier;
132 using CartesianSolver::grid;
133 using CartesianSolver::haloCellId;
134 using CartesianSolver::isActive;
135 using CartesianSolver::localPartitionCellOffsets;
136 using CartesianSolver::m_bandWidth;
137 using CartesianSolver::m_freeIndices;
138 using CartesianSolver::m_innerBandWidth;
139 using CartesianSolver::m_Ma;
140 using CartesianSolver::m_noDirs;
141 using CartesianSolver::m_outerBandWidth;
142 using CartesianSolver::m_Re;
143 using CartesianSolver::m_recalcIds;
144 using CartesianSolver::m_residualInterval;
145 using CartesianSolver::m_restartFile;
146 using CartesianSolver::m_revDir;
147 using CartesianSolver::m_solutionInterval;
148 using CartesianSolver::m_solutionOffset;
149 using CartesianSolver::m_solutionTimeSteps;
150 using CartesianSolver::m_solverId;
151 using CartesianSolver::maxLevel;
152 using CartesianSolver::maxNoGridCells;
153 using CartesianSolver::maxRefinementLevel;
154 using CartesianSolver::maxUniformRefinementLevel;
155 using CartesianSolver::minLevel;
156 using CartesianSolver::mpiComm;
157 using CartesianSolver::neighborDomain;
158 using CartesianSolver::noDomains;
159 using CartesianSolver::noHaloCells;
160 using CartesianSolver::noNeighborDomains;
161 using CartesianSolver::noWindowCells;
162 using CartesianSolver::outputDir;
163 using CartesianSolver::restartDir;
164 using CartesianSolver::returnIdleRecord;
165 using CartesianSolver::returnLoadRecord;
166 using CartesianSolver::solverId;
167 using CartesianSolver::solverMethod;
168 using CartesianSolver::updateDomainInfo;
169 using CartesianSolver::windowCellId;
171 using CartesianSolver::exchangeData;
211 void setSensors(std::vector<std::vector<MFloat>>&, std::vector<MFloat>&, std::vector<std::bitset<64>>&,
212 std::vector<MInt>&)
override;
222 void sensorParticle(std::vector<std::vector<MFloat>>& sensors, std::vector<std::bitset<64>>& sensorCellFlag,
223 std::vector<MFloat>& sensorWeight,
MInt sensorOffset,
MInt sen)
override;
224 void sensorInterface(std::vector<std::vector<MFloat>>& sensors, std::vector<std::bitset<64>>& sensorCellFlag,
225 std::vector<MFloat>& sensorWeight,
MInt sensorOffset,
MInt sen)
override;
234 if(
grid().hasInactiveRanks()) {
236 "MPI_IN_PLACE",
"m_forceAdaptation");
255 void getSolverTimings(std::vector<std::pair<std::string, MFloat>>&,
const MBool allTimings)
override;
262#ifdef MAIA_TIMER_FUNCTION
263 TERMM_IF_COND(!allTimings,
"FIXME: reduced timings mode not yet supported by LPT.");
264 static const MInt noAdditionTimers = 9;
265 return 2 + noAdditionTimers;
293 }
else if(dataId == 0 || dataId == 2) {
296 TERMM(1,
"solverCelldataType: invalid data id");
302 MInt*
const data)
override;
304 MFloat*
const data)
override;
311 void getGlobalSolverVars(std::vector<MFloat>& globalFloatVars, std::vector<MInt>& globalIdVars)
override;
312 void setGlobalSolverVars(std::vector<MFloat>& globalFloatVars, std::vector<MInt>& globalIdVars)
override;
355 mTerm(1, AT_,
"Unknown mpiTag");
365 template <
class LPTParticle = LPTSpherical<nDim>>
369 mTerm(-1, AT_,
"Unknown particle type");
375 template <
class LPTParticle>
379 mTerm(-1, AT_,
"Unknown particle type");
459 return grid().tree().coordinate(cellId, dim);
465 template <
class P, MInt a, MInt b>
467 std::vector<MFloat>& weight);
469 template <MInt a, MInt b, MBool
interpolateVelocitySlopes>
471 template <MInt a, MInt b>
473 interpolateVariablesLS<a, b, false>(cellId, position, interpolatedVar);
508 template <
class LPTParticle>
510 std::vector<LPTParticle>& partList = a_particleList<LPTParticle>();
512 for(
MInt d = 0; d <
grid().noNeighborDomains(); d++) {
513 auto pos = pointsTo[d].find(partList[partPos].m_cellId);
515 if(pos != pointsTo[d].end()) {
517 thisSend.toCellId = pos->second;
657 const MInt addMode = 0,
const MFloat* velocity =
nullptr,
const MFloat* position =
nullptr,
658 const MInt parcelSize = 1);
661 const MFloat particleDensityRatio,
const MInt random = 1,
const MInt addMode = 0,
662 const MFloat* velocity =
nullptr,
const MFloat* position =
nullptr);
670 template <
class LPTParticle>
674 template <
class LPTParticle>
678 template <
class LPTParticle>
682 template <
class LPTParticle>
688 template <
class LPTParticle>
690 template <
class LPTParticle>
692 template <MBool allNeighbors,
class LPTParticle>
694 template <MBool allNeighbors>
696 template <MBool allNeighbors,
class LPTParticle>
712 template <
class T,
class Pred>
714 using tag =
typename std::iterator_traits<typename T::iterator>::iterator_category;
718 template <
class T,
class Pred>
719 void sort_impl_(T& c, Pred& p, std::random_access_iterator_tag ) {
720 std::sort(c.begin(), c.end(), p);
723 template <
class T,
class Pred>
725 using tag =
typename std::iterator_traits<typename T::iterator>::iterator_category;
729 template <
class T,
class Pred>
731 c.erase(std::remove_if(c.begin(), c.end(), p), c.end());
856 MFloat bboxLocal[nDim * 2];
857 for(
MInt i = 0; i < nDim; i++) {
858 bboxLocal[i] = std::numeric_limits<MFloat>::max();
859 bboxLocal[nDim + i] = std::numeric_limits<MFloat>::lowest();
862 for(
MInt cellId = 0; cellId <
grid().noInternalCells(); cellId++) {
863 for(
MInt i = 0; i < nDim; i++) {
866 grid().tree().coordinate(cellId, i) - F1B2 *
grid().cellLengthAtLevel(
grid().tree().level(cellId)));
867 bboxLocal[nDim + i] =
868 mMax(bboxLocal[nDim + i],
869 grid().tree().coordinate(cellId, i) + F1B2 *
grid().cellLengthAtLevel(
grid().tree().level(cellId)));
872 for(
MInt i = 0; i < 2 * nDim; i++)
873 globalBbox[i] = bboxLocal[i];
875 MPI_Allreduce(MPI_IN_PLACE, &globalBbox[0], nDim, MPI_DOUBLE, MPI_MIN,
mpiComm(), AT_,
"MPI_IN_PLACE",
877 MPI_Allreduce(MPI_IN_PLACE, &globalBbox[nDim], nDim, MPI_DOUBLE, MPI_MAX,
mpiComm(), AT_,
"MPI_IN_PLACE",
880 for(
MInt i = 0; i < 2 * nDim; i++) {
881 globalBbox[i] =
grid().raw().globalBoundingBox()[i];
897 template <
class LPTParticle, MBool t_search>
899 const MBool allowNonLeaf =
false);
998 std::cerr <<
"loadSampleVariables DgCartesianSolver " <<
timeStep << std::endl;
1001 std::cerr <<
"getSampleVariables LPT " << cellId <<
" " << vars << std::endl;
1004 std::cerr <<
"getSampleVariables LPT " << cellId << std::endl;
1008 std::cerr <<
"getHeatRelease DgCartesianSolver " << heatRelease << std::endl;
1016 static const MInt Segfault = std::numeric_limits<MInt>::min();
1020 static constexpr MInt W = nDim == 3 ? 2 : Segfault;
1021 static constexpr std::array<MInt, 3> VV = {0, 1, 2};
1023 static constexpr MInt P = nDim + 1;
1024 static constexpr MInt T = nDim + 2;
1026 static constexpr MInt m_noVars = nDim + 3;
GridCell
Grid cell Property Labels.
static MBool propertyExists(const MString &name, MInt solver=m_noSolvers)
This function checks if a property exists in general.
void sendSourceTerms()
exchanges the source terms on the LPT grid, non-Blocking version from above
MFloat c_cellVolume(const MInt cellId) const
void cancelMpiRequests() override
actually doing same pre-partitioneing stuff during balcne
void getHeatRelease(MFloat *&heatRelease)
MBool a_isBndryCell(const MInt cellId) const override
void readSpawnProps()
Read properties related to creating particles from configuration file.
MInt m_timeStepComputationInterval
MFloat calculateAverageRep()
MFloat a_fluidSpecies(const MInt cellId) const
void checkCells()
some debug check for cells
std::mt19937_64 & randomRespawn()
void broadcastInjected(const MUint prevNumPart)
Send newly created particles.
void perCellStats()
set cell-particle mapping which is used to merge particle in reduceParticles!
void motionEquationEllipsoids(const MInt offset)
void receiveParticles_()
receive particles that have been sent non-blocking before
std::mt19937_64 & randomInit()
typename CartesianSolver::GridProxy GridProxy
MLong c_globalId(const MInt cellId) const
MInt a_hasNeighbor(const MInt cellId, const MInt dir) const
void calculateHeatRelease()
void sendParticles()
send particles non-blocking
void spawnParticles()
Spawn new particles (used for testing)
std::vector< LPTParticle > & a_particleList()
void interpolateVariablesLS(const MInt cellId, const MFloat *const position, MFloat *const interpolatedVar)
calculates interpolated variables (in the range a, b) for a given position in a given cell
void getCellDataDlb(const MInt dataId, const MInt oldNoCells, const MInt *const bufferIdToCellId, MInt *const data) override
Return solver data for DLB.
void setCellDataDlb(const MInt dataId, const MInt *const data) override
Set solver data for DLB.
MBool a_isWindow(const MInt cellId) const
void sendAndReceiveParticles(const MBool allowNonLeaf)
Particle transfer between solvers The particles to be sent are in the queueToSend array MBool mayExis...
void interpolateAndCalcWeights(P &particle, const MInt cellId, const MFloat *position, const MFloat *interpolatedVar, std::vector< MFloat > &weight)
MInt mpiTag(const MString exchangeType)
MPI_Request * m_checkAdaptationSendRequest
MFloat & a_fluidTemperature(const MInt cellId)
std::map< MInt, std::vector< MInt > > m_cellToNghbrHoodInterpolation
MFloat a_fluidVelocity(const MInt cellId, const MInt dim) const
void motionEquation(const MInt offset)
std::vector< MPI_Request > m_mpi_reqSendFloat
MInt c_childId(const MInt cellId, const MInt pos) const
void checkRegridTrigger()
check if any of the cells with the regrid Trigger also have particles inside
void computeBoundingBox(MFloat *globalBbox)
void unpackParticle(LPTSpherical< nDim > &thisParticle, const MInt *intBuffer, MInt &z, const MFloat *floatBuffer, MInt &h, MInt &step, MInt id)
Unpack spherical particle from buffers.
MFloat m_weightParticleCell
MFloat & a_massFlux(const MInt cellId)
MFloat getCellLoad(const MInt cellId, const MFloat *const weights) const override
Return the load of a single cell (given computational weights).
void getLoadQuantities(MInt *const loadQuantities) const override
Return the cumulative load quantities on this domain.
Collector< LPTBndryCell< nDim > > * m_bndryCells
void balancePre() override
reset the solver during balancing
void checkParticles()
some debug check for partcles
MInt m_initializationMethod
std::vector< std::unique_ptr< MFloat[]> > m_sendBuffer
MBool prepareRestart(MBool force, MBool &) override
before writing a restart file
MInt domainId() const override
Return the domainId (rank)
void writeRestartFile(MBool) override
MInt & a_bndryCellId(const MInt cellId)
MFloat calculateTotalKineticEnergy()
void setCellWeights(MFloat *) override
set cell weight for partitioning
void getSampleVariables(MInt cellId, const MFloat *&vars)
MInt c_noChildren(const MInt cellId) const
void initCollector()
init LPT cell collector
MFloat a_fluidTemperature(const MInt cellId) const
void remove_if_impl_(T &c, Pred &p, std::random_access_iterator_tag)
void initGridProperties()
calculate Grid Properties for periodic boundaries, adapted from rigedbodies
MFloat & a_fluidDensity(const MInt cellId)
maia::lpt::cell::BitsetType::reference a_regridTrigger(const MInt cellId)
void finalizeAdaptation() override
reinit the solver after the full adaptation loop!
MBool m_activeSecondaryBUp
void resizeGridMap() override
Swap the given cells.
MInt a_noEllipsoidsInCell(const MInt cellId) const
MFloat m_spawnCoord[nDim]
void postAdaptation() override
post adaptation for split adaptation within the adaptation loop
void sort_impl_(T &c, Pred &p, std::random_access_iterator_tag)
MInt a_noSphericalParticles() const
MInt a_level(const MInt cellId) const
LPT & operator=(const LPT &)=delete
MInt cellOutside(const MFloat *, const MInt, const MInt) override
checks if a child lies outSide of the domain! necessary for refinement at the bndry!
void loadSampleVariables(MInt timeStep)
std::vector< MPI_Request > m_mpi_reqRecvInt
MInt loadParticleRestartFile()
Read particle restart file and create new particle instances accordingly.
void refineCell(const MInt) override
refining a cartesian cell
MInt m_spawnParticlesCount
void crankAngleSolutionOutput()
save a full solutionOutput at timeSteps closesed to a specified crankAngle Interval save a solution s...
void getDomainDecompositionInformation(std::vector< std::pair< MString, MInt > > &domainInfo) override
Return decomposition information, i.e. number of local elements,...
typename maia::CartesianSolver< nDim, LPT > CartesianSolver
static constexpr MInt m_addInjDataCnt
std::unique_ptr< ParticleCollision< nDim > > m_collisionModel
void resetSourceTerms(const MInt)
reset all source terms with cellId larger than the offset
MInt globalNoEllipsoids()
std::vector< MInt > m_checkAdaptationSend
std::vector< std::unique_ptr< MFloat[]> > m_recvBuffer
MFloat a_momentumFlux(const MInt cellId, const MInt dim) const
void readMomentumCouplingProps()
Read properties specific to the momentum coupling.
void exchangeParticles(const MBool collOnly, const MInt offset, const MBool allowNonLeaf=false)
Calls exchange for the different particle types.
void resetSolver() override
actually doing some pre-balance-stuff
MPI_Status m_mpi_statusInt
void readEllipsoidProps()
Read properties specific to ellipsoids.
void evaporation(const MInt offset)
MInt noSolverTimers(const MBool allTimings) override
MBool fiveStageSolutionStep()
Splitting the solutionStep into 5 separate parts to match the 5-stage Runge-Kutta time-stepping for i...
std::vector< std::unique_ptr< MFloat[]> > m_sourceSend
MInt injectorCellId() const
void receiveSourceTerms()
exchanges the source terms on the LPT grid, non-Blocking version from above
MInt c_neighborId(const MInt cellId, const MInt dir) const
void removeCell(const MInt) override
Remove the given cell.
std::vector< MInt > m_checkAdaptationRecv
std::mt19937_64 m_PRNGSpawn
MFloat a_workFlux(const MInt cellId) const
void saveSolverSolution(const MBool, const MBool) override
MFloat a_velocitySlope(const MInt cellId, const MInt varId, const MInt dir) const
std::map< MFloat, MFloat > m_terminalVelocity
MInt noVariables() const override
Return the number of variables.
MPI_Request * m_flowSendRequest
std::mt19937_64 & randomSpawn(const MInt calls)
std::multimap< MInt, LPTSpherical< nDim > * > m_cellToPartMap
std::unique_ptr< MaterialState< nDim > > m_material
void particleRespawn()
respawn of Particles
MFloat & a_velocitySlope(const MInt cellId, const MInt varId, const MInt dir)
MInt addEllipsoid(const MInt cellId, const MFloat semiMinorAxis, const MFloat aspectRatio, const MFloat particleDensityRatio, const MInt random=1, const MInt addMode=0, const MFloat *velocity=nullptr, const MFloat *position=nullptr)
Add new ellipsoidal particle.
std::vector< std::unique_ptr< MFloat[]> > m_sourceRecv
MFloat & a_volumeFraction(const MInt cellId)
void resetSolverFull()
reset the solver during balancing
void writePartData()
write particle snapshot to Netcdf file (using parallel output)
void wallCollision()
collision step with LPT wall
MBool smallParticle(const LPTSpherical< nDim > &particle)
typename maia::grid::tree::Tree< nDim >::Cell Cell
MFloat m_spawnParticlesConeAngle
std::vector< std::map< MInt, MInt > > m_pointsToHalo
MFloat c_coordinate(const MInt cellId, const MInt dir) const
std::vector< std::unique_ptr< MInt[]> > m_intRecvBuffer
MBool a_isHalo(const MInt cellId) const
MPI_Request * m_checkAdaptationRecvRequest
MInt m_exchangeBufferSize
MInt & a_noParticlesInCell(const MInt cellId)
void removeInvalidParticles(const MBool)
MBool pushToQueue(std::vector< std::map< MInt, MInt > > &pointsTo, const MInt partPos)
void balancePost() override
Reinitialize solver after setting solution data in DLB.
MInt noCellDataDlb() const override
Methods to inquire solver data information.
void forceTimeStep(const MFloat timeStep)
void removeChilds(const MInt) override
coarseining a cartesian cell
std::vector< MPI_Status > m_mpi_statusProbe
MFloat & a_fluidVelocity(const MInt cellId, const MInt dim)
MInt a_timeStepComputationInterval()
MInt c_level(const MInt cellId) const
MInt * m_respawnGlobalDomainOffsets
void packParticles(std::vector< LPTSpherical< nDim > * > &particlesToSend, MInt *intBuffer, MFloat *floatBuffer, std::vector< MInt >)
Pack particles for sending.
LPT(const MInt solverId, GridProxy &gridProxy_, Geom &geometry_, const MPI_Comm comm)
Solver constructor.
maia::lpt::cell::BitsetType::reference a_isHalo(const MInt cellId)
MFloat a_volumeFraction(const MInt cellId) const
void reIntAfterRestart(MBool) override
std::vector< std::map< MInt, MInt > > m_pointsToWindow
void getGlobalSolverVars(std::vector< MFloat > &globalFloatVars, std::vector< MInt > &globalIdVars) override
Get/set global solver variables during DLB.
typename CartesianSolver::Grid Grid
void sendFlowField()
exchanges the flow Field data on the LPT grid, non-Blocking version
void countParticlesInCells()
set accessor for a_noParticlesInCell which is used for the particle-sensor during adaptation
void initializeTimers()
Initializes the communication timers.
void spawnTimeStep()
spawn new particles and compute their timeStep NOTE: this is an older functionality which is only use...
MPI_Request * m_slopesRecvRequest
particleSendQueue< nDim > m_queueToSend
void setGlobalSolverVars(std::vector< MFloat > &globalFloatVars, std::vector< MInt > &globalIdVars) override
Set global solver variables for DLB (same on each domain)
void receiveVelocitySlopes()
exchanges the velocity slopes on the LPT grid, non-Blocking version
void particleWallCollisionStep(const MInt)
MFloat & a_fluidPressure(const MInt cellId)
MPI_Request * m_slopesSendRequest
std::map< MInt, std::vector< MInt > > m_cellToNghbrHood
MFloat c_cellLengthAtLevel(const MInt level) const
MInt & a_noEllipsoidsInCell(const MInt cellId)
std::vector< MInt > m_respawnCells
void initialCondition()
Initialize particles.
void coupling(MInt offset)
void writeRestartFile(const MBool, const MBool, const MString, MInt *) override
writing a restart File as regularly called from the grid-controller!
std::vector< MPI_Request > m_mpi_reqRecvFloat
MPI_Request * m_sourceRecvRequest
MBool oneStageSolutionStep()
single solution step for pure LPT computation or without interleafed coupling!
void sensorInterface(std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen) override
set the sensors around the boundary positions to get the markedCells
std::vector< MPI_Request > m_mpi_reqSendSize
MFloat m_particleResiduum
void initMPI(const MBool=true)
Init MPI buffers and communication datastructures.
MInt noDomains() const override
void saveDebugRestartFile()
writing a restart File NOTE: for debugging purposes only!
void limitWeights(MFloat *) override
Limit weight of base cell.
MFloat & a_fluidVariable(const MInt cellId, const MInt var)
MBool m_weightSourceCells
void mergeParticles(LPTSpherical< nDim > *partA, LPTSpherical< nDim > *partB)
MPI_Request * m_sourceSendRequest
void writeParticleRestartFile()
Write particle restart file.
MInt a_bndryCellId(const MInt cellId) const
MInt m_motionEquationType
MPI_Request * m_flowRecvRequest
std::vector< MPI_Request > m_mpi_reqSendInt
MFloat m_sutherlandConstant
void updateFluidFraction()
MInt a_noParticlesInCell(const MInt cellId) const
const MFloat & a_coordinate(const MInt cellId, const MInt dim) const
void exchangeOffset(MInt noParticles)
In case of multisolver, communicate particle id offset to ensure consistent particle ids across the s...
void finalizeBalance() override
re-inits the solver after the balance
MFloat timeSinceSOI() const
MFloat c_cellLengthAtCell(const MInt cellId) const
std::mt19937_64 m_PRNGRespawn
void unpackParticles(const MInt num, const MInt *intBuffer, const MFloat *floatBuffer, const MInt domainId=-1, const MBool allowNonLeaf=false)
Unpack particles.
void setSensors(std::vector< std::vector< MFloat > > &, std::vector< MFloat > &, std::vector< std::bitset< 64 > > &, std::vector< MInt > &) override
set the sensors for a single adaptation step
void initSolver() override
std::array< MFloat, nDim > m_globDomainLength
std::vector< LPTEllipsoidal< nDim > > m_partListEllipsoid
std::multimap< MInt, LPTEllipsoidal< nDim > * > m_cellToEllipsMap
MFloat & a_momentumFlux(const MInt cellId, const MInt dim)
MBool solutionStep() override
Time stepping of particles NOTE: the solutionStep is split into sub-steps, to allow for an interleafe...
void own_remove_if(T &c, Pred &p)
MFloat time() const override
Return the time.
MInt c_parentId(const MInt cellId) const
void getDefaultWeights(MFloat *weights, std::vector< MString > &names) const override
Return the default weights for all load quantities.
void sendInjected(const MUint prevNumPart)
void getSampleVariables(const MInt cellId, std::vector< MFloat > &)
void exchangeSourceTerms()
exchanges the source terms on the LPT grid, this is necessary a) before writing the cell solution fil...
std::unique_ptr< SprayModel< nDim > > m_sprayModel
void receiveFlowField()
exchanges the flow Field data on the LPT grid, non-Blocking version
MInt * m_respawnDomainRanks
void waitForSendReqs()
wait on all mpi send calls, prior to balance, adaptation or IO
MLong m_ellipsoidRandomOrientationSeed
void initBndryCells()
init LPT boundary-cells used for the wall-collision
void initParticleVector()
init LPT spherical and ellipsoids particle vectors (i.e. set length and read non-dimensionalisation P...
MFloat a_massFlux(const MInt cellId) const
MFloat & a_fluidSpecies(const MInt cellId)
MFloat a_fluidPressure(const MInt cellId) const
std::vector< std::unique_ptr< MInt[]> > m_intSendBuffer
std::vector< MInt > m_sendSize
void prepareAdaptation() override
prepare solver adaptation
void postTimeStep() override
after the LPT time-Step!
void preTimeStep() override
prepare the LPT timeStep
void getSolverTimings(std::vector< std::pair< std::string, MFloat > > &, const MBool allTimings) override
Get solver timings.
void swapProxy(MInt, MInt) override
maia::lpt::cell::BitsetType::reference a_isWindow(const MInt cellId)
std::mt19937_64 m_PRNGInit
void findSpawnCellId()
Find spawn cellId.
void own_sort(T &c, Pred &p)
MPI_Status m_mpi_statusFloat
MInt cellDataSizeDlb(const MInt dataId, const MInt cellId) override
Return data size to be communicated during DLB for a grid cell and given data id.
MInt m_loadBalancingReinitStage
void a_resetPropertiesSolver(const MInt cellId)
MBool c_isLeafCell(const MInt cellId) const
MInt noLoadTypes() const override
void interpolateVariablesLS(const MInt cellId, const MFloat *const position, MFloat *const interpolatedVar)
void exchangeParticles_(const MBool collOnly, const MInt offset, const MBool allowNonLeaf=false)
exchange particles to neighboring domains, can be either non-blocking or blocking communication!
MFloat a_fluidVariable(const MInt cellId, const MInt var) const
void readModelProps()
Read model configuration properties from configuration file.
void receiveParticles()
Calls particle receive function for different particle types.
MFloat & a_workFlux(const MInt cellId)
MInt c_hasNeighbor(const MInt cellId, const MInt dir) const
std::vector< LPTSpherical< nDim > > m_partList
MFloat injectionDuration() const
Geom & geometry() const
Access the solver's geometry.
MFloat computeTimeStep()
computes the non-dimensional LPT time-step on the assumption that a particle may only travel for a co...
MFloat a_fluidDensity(const MInt cellId) const
maia::lpt::cell::BitsetType::reference a_isValidCell(const MInt cellId)
void initSummary()
Print information at the start of simulation.
MBool a_validCell(const MInt cellId)
MFloat m_spawnDistSigmaCoeff
void recvInjected()
receive particles generated during injection
void finalizeInitSolver() override
MBool forceAdaptation() override
Returns the LPT adaptation forcing.
void sendVelocitySlopes()
exchanges the velocity slopes on the LPT grid, non-Blocking version
void sensorParticle(std::vector< std::vector< MFloat > > &sensors, std::vector< std::bitset< 64 > > &sensorCellFlag, std::vector< MFloat > &sensorWeight, MInt sensorOffset, MInt sen) override
set the sensors around the particle positions to get the markedCells
void advanceParticles(const MInt offset)
void updateExchangeCells()
Set exchange properties in LPT cell collector (a_isHalo/a_isWindow) and set m_pointsToHalo and m_poin...
void calculateTerminalVelocities()
calculates the terminal velocity of particles used for initialization
MFloat reduceData(const MInt cellId, MFloat *data, const MInt dataBlockSize=1, const MBool average=true)
reduce data to lower level
MFloat m_sutherlandPlusOne
MFloat m_weightMulitSolverFactor
void swapCells(const MInt, const MInt) override
swap Cell information when the grid collector is restructured during adaptation cleanup
MInt addParticle(const MInt cellId, const MFloat diameter, const MFloat particleDensityRatio, const MInt random=1, const MInt addMode=0, const MFloat *velocity=nullptr, const MFloat *position=nullptr, const MInt parcelSize=1)
Add new particle.
MInt a_noEllipsoidalParticles() const
MInt m_ellipsoidRandomOrientation
void writeCellSolutionFile(const MString &, MInt *)
Write lpt cell based solution file currently ony used for debugging!
void setRegridTrigger()
set a_regridTriggerG around all particles to allow for an adaptation check
MInt cellDataTypeDlb(const MInt dataId) const override
MBool m_receiveVelocitySlopes
MInt noInternalCells() const override
Return the number of internal cells within this solver.
MBool a_regridTrigger(const MInt cellId) const
MFloat & a_heatFlux(const MInt cellId)
std::array< MFloat, nDim *2 > m_globBbox
MBool m_openParticleInjSend
void addBndryCell(const MInt, MFloat *, MFloat *, MFloatScratchSpace &, MFloat *)
add an LPT bndryCell to the collector and fill the data
MFloat a_heatFlux(const MInt cellId) const
std::map< MInt, std::vector< MFloat > > m_injData
std::vector< MInt > m_recvSize
std::array< MInt, Timers::_count > m_timers
MBool hasSplitBalancing() const override
Return if load balancing for solver is split into multiple methods or implemented in balance()
MBool a_isValidCell(const MInt cellId) const
MFloat m_diameter
particle diameter
This class is a ScratchSpace.
void startLoadTimer(const MString name)
MPI_Comm mpiComm() const
Return the MPI communicator used by this solver.
MInt solverId() const
Return the solverId.
const MInt m_solverId
a unique solver identifier
void stopLoadTimer(const MString &name)
constexpr GridProxy & grid() const
MBool isActive() const override
constexpr MInt size() const
Return size (i.e., currently used number of nodes)
Class that represents LPT cell collector.
MFloat & momentumFlux(const MInt id, const MInt dim)
Accessor for momentumFlux.
MInt noEllipsoids(const MInt id) const
MFloat & velocitySlope(const MInt id, const MInt varId, const MInt dim)
MInt bndryCellId(const MInt id) const
MFloat fluidSpecies(const MInt id) const
MFloat volumeFraction(const MInt id) const
MFloat & heatFlux(const MInt id)
Accessor for heatFlux.
MInt noParticles(const MInt id) const
MFloat & massFlux(const MInt id)
Accessor for massFlux.
BitsetType::reference hasProperty(const MInt id, const LptCell p)
Accessor for properties.
MFloat & workFlux(const MInt id)
Accessor for workFlux.
MFloat fluidVariable(const MInt id, const MInt var) const
void resetProperties(const MInt id)
Reset all properties.
MInt string2enum(MString theString)
This global function translates strings in their corresponding enum values (integer values)....
void mTerm(const MInt errorCode, const MString &location, const MString &message)
constexpr T mMin(const T &x, const T &y)
constexpr T mMax(const T &x, const T &y)
std::vector< std::queue< maia::lpt::sendQueueType< nDim > > > particleSendQueue
std::basic_string< char > MString
int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, const MString &name, const MString &sndvarname, const MString &rcvvarname)
same as MPI_Allreduce
Namespace for auxiliary functions/classes.
Static indices for accessing primitive variables in nDim spatial dimensions.
constexpr MInt noVars() const
static constexpr std::array< MInt, 3 > VV
static constexpr MInt RHO