75 virtual void subCouple(
MInt recipeStep,
MInt solverId, std::vector<MBool>& solverCompleted) = 0;
82 std::cerr <<
"WARNING: coupler does not implement balancePre(), which might be necessary for "
83 "balancing to work correctly!"
88 std::cerr <<
"WARNING: coupler does not implement balancePost(), which might be necessary for "
89 "balancing to work correctly!"
106 const MInt*
const NotUsed(bufferIdToCellId),
MInt*
const NotUsed(data)) {
107 TERMM(1,
"Not implemented for coupler.");
110 const MInt*
const NotUsed(bufferIdToCellId),
MLong*
const NotUsed(data)) {
111 TERMM(1,
"Not implemented for coupler.");
114 const MInt*
const NotUsed(bufferIdToCellId),
MFloat*
const NotUsed(data)) {
115 TERMM(1,
"Not implemented for coupler.");
118 TERMM(1,
"Not implemented for coupler.");
121 TERMM(1,
"Not implemented for coupler.");
124 TERMM(1,
"Not implemented for coupler.");
136 const MBool NotUsed(allTimings)){};
142 TERMM(1,
"m_dlbTimerId already set");
248template <MInt nDim,
class SysEqn>
285template <MInt nDim,
class SysEqn>
288template <MInt nDim,
class SysEqn>
312 using CV =
typename SysEqn::CV;
344 const std::vector<MString>& varNames,
345 const MFloat*
const data)
const {
360template <MInt nDim,
class SysEqn>
370 ASSERT(
noSolvers ==
static_cast<MInt>(fvSolvers.size()),
"Currently only works using this assumption...");
387 ASSERT(solverId <
noSolvers(),
"Invalid solverId " + std::to_string(solverId) +
"/" + std::to_string(
noSolvers()));
424template <MInt nDim, MInt nDist,
class SysEqn>
427template <MInt nDim, MInt nDist,
class SysEqn>
447 for(
const auto& solver :
solvers) {
455 ASSERT(solverId <
noSolvers(),
"Invalid solverId " + std::to_string(solverId) +
"/" + std::to_string(
noSolvers()));
491 return lbSolver(
id).a_levelSetFunctionMB(cellId, set);
495 return lbSolver(
id).a_levelSetFunctionMB(cellId, set);
499 return lbSolver(
id).a_associatedBodyIds(cellId, set);
503 return lbSolver(
id).a_associatedBodyIds(cellId, set);
509 return lbSolver(
id).c_childId(cellId, child);
529 return lbSolver(
id).a_variable(cellId, varId);
534 return lbSolver(
id).a_oldVariable(cellId, varId);
virtual ~CouplingDg()=default
MFloat * externalSource() const
Return pointer to external source memory.
MInt noElements() const
Return number of elements.
MString outputDir() const
Return output directory.
MInt minPolyDeg() const
Return the minimum polynomial degree.
SysEqn & sysEqn()
Return reference to SysEqn object.
void saveNodalData(const MString &fileNameBase, const MInt noVars, const std::vector< MString > &varNames, const MFloat *const data) const
Save nodal data to file.
ElementCollector & elements()
Return reference to elements.
solverType & dgSolver() const
Return MPI communicator.
MInt solverId() const
Return solver id.
CouplingDg(const MInt couplingId, solverType *b)
MInt getElementByCellId(const MInt cellId)
Return element id for cell id.
MInt maxPolyDeg() const
Return the maximum polynomial degree.
MInt a_noFvGridCells() const
solverType & fvSolver(const MInt solverId=0) const
~CouplingFv() override=default
CouplingFv(const MInt couplingId, Solver *solvers)
CouplingFv(const MInt couplingId, std::vector< FvCartesianSolverXD< nDim, SysEqn > * > fvSolvers, const MInt noSolvers)
CouplingFv(const CouplingFv &)=delete
std::vector< solverType * > m_fvSolvers
CouplingFv & operator=(const CouplingFv &)=delete
solverType & fvMbSolver() const
CouplingFvMb(const MInt couplingId, solverType *b)
MInt a_noLevelSetsMb() const
MInt a_noFvGridCells() const
virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MLong *const NotUsed(data))
virtual void setCellDataDlb(const MInt NotUsed(dataId), const MInt *const NotUsed(data))
virtual void finalizeAdaptation(const MInt)
virtual MInt cellDataSizeDlb(const MInt NotUsed(dataId), const MInt NotUsed(cellId))
virtual void balancePost()
virtual MInt cellDataTypeDlb(const MInt NotUsed(dataId)) const
virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MFloat *const NotUsed(data))
virtual void preCouple(MInt recipeStep)=0
virtual MInt noCellDataDlb() const
Methods to inquire coupler data during balancing.
virtual void getCouplingTimings(std::vector< std::pair< MString, MFloat > > &NotUsed(timings), const MBool NotUsed(allTimings))
Return coupling timings.
virtual void postCouple(MInt recipeStep)=0
virtual void getDomainDecompositionInformation(std::vector< std::pair< MString, MInt > > &NotUsed(domainInfo))
Return information on current domain decomposition (e.g. number of coupled cells/elements/....
virtual void prepareAdaptation()
void setDlbTimer(const MInt timerId)
virtual MInt noCouplingTimers(const MBool NotUsed(allTimings)) const
Number of coupling timers.
Coupling & operator=(const Coupling &)=delete
virtual void finalizeBalance(const MInt)
virtual void getCellDataDlb(const MInt NotUsed(dataId), const MInt NotUsed(oldNoCells), const MInt *const NotUsed(bufferIdToCellId), MInt *const NotUsed(data))
Coupling(const Coupling &)=delete
virtual void finalizeCouplerInit()=0
MFloat returnIdleRecord() const
virtual ~Coupling()=default
virtual void checkProperties()=0
virtual void balancePre()
Load balancing.
virtual void subCouple(MInt recipeStep, MInt solverId, std::vector< MBool > &solverCompleted)=0
void stopLoadTimer(const MString &name) const
Stop the load timer of the coupler.
void startLoadTimer(const MString &name) const
Start the load timer of the coupler.
MFloat returnLoadRecord() const
Coupling(const MInt couplingId)
virtual void finalizeSubCoupleInit(MInt solverId)=0
virtual void setCellDataDlb(const MInt NotUsed(dataId), const MLong *const NotUsed(data))
virtual void writeRestartFile(const MInt)
virtual void postAdaptation()
virtual void readProperties()=0
virtual void reinitAfterBalance()
virtual void setCellDataDlb(const MInt NotUsed(dataId), const MFloat *const NotUsed(data))
MInt a_noDistributions(const MInt id=0) const
MInt a_isThermal(const MInt id=0) const
MBool a_isActive(const MInt cellId, const MInt id=0) const
MFloat a_Re(const MInt id=0) const
MFloat a_cellLengthAtLevel(MInt level, const MInt id=0)
MInt a_noBndCells(const MInt id=0)
MFloat a_levelSetFunctionMb(const MInt cellId, const MInt set, const MInt id=0) const
MFloat & a_oldVariable(const MInt cellId, const MInt varId, const MInt id=0)
MInt a_bndCellId(const MInt bndCell, const MInt id=0)
solverType & lbSolver(const MInt solverId=0) const
MInt a_pvt(const MInt id=0) const
std::vector< solverType * > m_lbSolvers
MInt a_associatedBodyIdsMb(const MInt cellId, const MInt set, const MInt id=0) const
MInt a_pvrho(const MInt id=0) const
MInt a_childId(const MInt cellId, const MInt child, const MInt id=0)
MInt & a_associatedBodyIdsMb(const MInt cellId, const MInt set, const MInt id=0)
MInt a_noLevelSetsMb(const MInt id=0) const
MBool a_wasActive(const MInt cellId, const MInt id=0) const
MInt a_boundaryCellMb(const MInt cellId, const MInt id=0)
MFloat a_initTemperatureKelvin(const MInt id=0) const
MInt a_pvv(const MInt id=0) const
MInt a_pvu(const MInt id=0) const
CouplingLB(const MInt couplingId, std::vector< solverType * > solvers)
MInt a_pvw(const MInt id=0) const
MInt a_noCells(const MInt id=0) const
MFloat a_physicalTime() const
MFloat a_Ma(const MInt id=0) const
MFloat & a_variable(const MInt cellId, const MInt varId, const MInt id=0)
LbBndCnd & lbBndCnd(const MInt id=0)
MInt a_noEmbeddedBodiesLB(const MInt id=0) const
MInt noMinCells(const MInt id=0) const
MInt a_noVariables(const MInt id=0) const
MbCellCollector & a_mbCell(const MInt id=0)
MInt a_noLbCells(const MInt id=0) const
CouplingLB(const MInt couplingId, Solver *solvers, const MInt noSolvers=1)
MFloat lsTimeStep() const
MInt a_parentId(const MInt cellId, const MInt id=0)
MInt minCell(const MInt index, const MInt id=0) const
MFloat & a_levelSetFunctionMb(const MInt cellId, const MInt set, const MInt id=0)
MInt a_noG0Cells(MInt set) const
solverType & lsSolver() const
MInt a_bodyIdG(const MInt cellId, const MInt set) const
MFloat a_normalVectorG(const MInt gCellId, const MInt dim, const MInt set) const
MBool a_inBandG(MInt gcellId, MInt set) const
MInt a_bodyToSet(const MInt bodyId) const
MInt a_noEmbeddedBodies() const
MFloat a_curvatureG(const MInt gCellId, const MInt set) const
MBool a_nearGapG(const MInt gcellId) const
MFloat & a_extensionVelocityG(const MInt cellId, const MInt dim, const MInt setId)
MInt a_potentialGapCellClose(MInt gcellId) const
MInt & a_bodyIdG(const MInt cellId, const MInt set)
MInt a_maxGCellLevel(const MInt setId) const
MFloat a_coordinateG(const MInt gCellId, const MInt dim) const
MInt a_noBandCells(MInt set) const
MInt a_G0CellId(const MInt id, const MInt set) const
CouplingLS(const MInt couplingId, solverType *b)
MFloat a_outsideGValue() const
MFloat & a_levelSetFunctionG(const MInt cellId, const MInt setId)
CouplingParticle(const MInt couplingId, LPT< nDim > *solver)
void finalizeSubCoupleInit(MInt) override
LPT< nDim > * m_particleSolver
virtual LPT< nDim > & lpt() const
void finalizeCouplerInit() override
void readProperties() override
void subCouple(MInt, MInt, std::vector< MBool > &) override
void preCouple(MInt) override
void checkProperties() override
void postCouple(MInt) override
CouplingRigidBodies(const MInt couplingId, RBodies *solver)
MInt a_noEmbeddedBodies() const
MInt a_noCollectorBodies() const
void saveNodalData(const MString &fileNameBase, const MInt noVars, const std::vector< MString > &varNames, const MFloat *const data) const
Save nodal data to file.
ElementCollector m_elements
void startLoadTimer(const MInt dlbTimerId, const MString &name)
Start the load timer for the given DLB timer id.
MFloat returnLoadRecord(const MInt dlbTimerId, const MInt mode=0)
Return the load record of a DLB timer.
void stopLoadTimer(const MInt dlbTimerId, const MString &name)
Stop the load timer for the given DLB timer id.
MFloat returnIdleRecord(const MInt dlbTimerId, const MInt mode=0)
Return the idle record of a DLB timer.
std::vector< LbGridBoundaryCell< nDim > > m_bndCells
MbCellCollector m_boundaryCellsMb
MInt a_boundaryCellMb(const MInt cellId)
This class represents all LB models.
static constexpr MInt m_noDistributions
LbBndCnd * m_bndCnd
Pointers for the Boundary Conditions, for flow solving.
MFloat & a_curvatureG(const MInt cellId, const MInt set)
Returns curvature of the cell cellId for set set.
maia::ls::cell::BitsetType::reference a_nearGapG(const MInt cellId)
MInt a_maxGCellLevel(const MInt set=-1) const
MFloat & a_levelSetFunctionG(const MInt cellId, const MInt set)
Returns levelSetFunction of the cell cellId.
std::vector< MInt > * m_G0Cells
MFloat & a_normalVectorG(const MInt cellId, const MInt dim, const MInt set)
Returns normalVector of the cell cellId for index n.
MInt & a_potentialGapCellClose(const MInt id)
Returns the potential gap cell closecellId.
maia::ls::cell::BitsetTypeSet::reference a_inBandG(const MInt cellId, const MInt set)
std::vector< MInt > * m_bandCells
MFloat c_coordinate(const MInt gCellId, const MInt dim) const
Returns the coordinate of the cell cellId for direction dim.
constexpr MInt a_G0CellId(MInt id, MInt set) const
MFloat & a_extensionVelocityG(const MInt cellId, const MInt dim, const MInt set)
Returns fExt of the cell cellId for index n.
MInt & a_bodyIdG(const MInt cellId, const MInt set)
Returns bodyId of the cell cellId for set set.
Parent class of all solvers This class is the base for all solvers. I.e. all solver class (e....
MString outputDir() const
Return the directory for output files.
MInt solverId() const
Return the solverId.
constexpr MInt size() const
Return size (i.e., currently used number of nodes)
Class that represents DG element collector.
MFloat & externalSource(const MInt id)
Accessor for external source terms.
Class that represents LB cell collector.
std::basic_string< char > MString
DlbTimerController g_dlbTimerController