7#ifndef DGCOUPLINGCONDITIONACOUSTICPERTURB_H_
8#define DGCOUPLINGCONDITIONACOUSTICPERTURB_H_
28template <MInt nDim,
class SysEqn>
31template <MInt nDim,
class SysEqn>
39template <MInt nDim,
class FvSysEqn>
85 :
Base(couplingId),
BaseDg(couplingId, dgSolver_, fvSolver_) {}
111 TERMM_IF_NOT_COND(dataId == 0,
"invalid data id");
117 MFloat*
const data)
override;
132 MFloat* sourceTerms)
override;
134 MFloat*
const sourceTerms)
override;
139 const MInt timeStep)
override;
163template <MInt nDim,
class FvSysEqn>
167 MFloat maxGlobalConservationError = -1.0;
168 MFloat maxGlobalL2Error = -1.0;
171 if(m_checkConservation && m_hasDgCartesianSolver) {
173 MPI_MAX, dgSolver().mpiComm(), AT_,
"m_maxConservationError",
"maxGlobalConservationError");
175 m_log <<
"Global maximum Galerkin projection conservation error: " << std::scientific << maxGlobalConservationError
177 m_log <<
"Local maximum Galerkin projection conservation error: " << std::scientific << m_maxConservationError
182 if(m_calcProjectionError && m_hasDgCartesianSolver) {
184 dgSolver().mpiComm(), AT_,
"m_maxL2Error",
"maxGlobalL2Error");
186 m_log <<
"Global maximum Galerking projection L2 error: " << std::scientific << maxGlobalL2Error << std::endl;
187 m_log <<
"Local maximum Galerking projection L2 error: " << std::scientific << m_maxL2Error << std::endl;
191 if(m_hasDgCartesianSolver && dgSolver().domainId() == 0 && (m_checkConservation || m_calcProjectionError)) {
192 std::ofstream errorFile(outputDir() +
"errors.txt");
194 if(m_checkConservation) {
195 errorFile <<
"maxGlobalConservationError: " << std::scientific << maxGlobalConservationError << std::endl;
197 if(m_calcProjectionError) {
198 errorFile <<
"maxGlobalProjectionError: " << std::scientific << maxGlobalL2Error << std::endl;
204 RECORD_TIMER_STOP(m_timers[Timers::Class]);
212template <MInt nDim,
class FvSysEqn>
216 if(!fvSolver().calcSlopesAfterStep()) {
218 "Enable calcSlopesAfterStep for FV-solver for coupled simulation (else the slopes are not "
219 "initialized prior to the first source term calculation and will contain garbage)");
232template <MInt nDim,
class FvSysEqn>
234 const MFloat*
const vorticity,
235 MFloat*
const sourceTerms) {
237 RECORD_TIMER_START(m_timers[Timers::CalcSourceLamb]);
240 const MInt lambIndex = m_meanVarsIndex[MV::LAMB0[0]];
242 std::array<MFloat, MAX_SPACE_DIMENSIONS> lambVector{};
246 for(
MInt donorIndex = 0; donorIndex < m_noActiveDonorCells; donorIndex++) {
247 const MInt donorId = m_calcSourceDonorCells[donorIndex];
249 const MFloat* meanVars = &m_meanVars[donorIndex * noMeanVars()];
250 const MFloat* velo = &velocity[donorId * noVelocities()];
251 const MFloat* vort = &vorticity[donorId * noVorticities()];
254 if constexpr(nDim == 2) {
255 lambVector[0] = -vort[0] * velo[1];
256 lambVector[1] = vort[0] * velo[0];
258 lambVector[0] = vort[1] * velo[2] - vort[2] * velo[1];
259 lambVector[1] = vort[2] * velo[0] - vort[0] * velo[2];
260 lambVector[2] = vort[0] * velo[1] - vort[1] * velo[0];
268 for(
MInt dim = 0; dim < nDim; dim++) {
270 sourceTerms[donorId * SysEqn::noVars() + dim] += -2.0 * (lambVector[dim] - meanVars[lambIndex + dim]);
274 RECORD_TIMER_STOP(m_timers[Timers::CalcSourceLamb]);
286template <MInt nDim,
class FvSysEqn>
288 MFloat*
const sourceTerms) {
290 RECORD_TIMER_START(m_timers[Timers::CalcSourceQmII]);
292 const MInt rhoIndex = m_meanVarsIndex[MV::RHO0];
293 const MInt pIndex = m_meanVarsIndex[MV::P0];
294 const MInt drhoIndex = m_meanVarsIndex[MV::DRHO[0]];
295 const MInt dpIndex = m_meanVarsIndex[MV::DP[0]];
296 const MInt dprhoIndex = m_meanVarsIndex[MV::GRADPRHO[0]];
300 for(
MInt donorIndex = 0; donorIndex < m_noActiveDonorCells; donorIndex++) {
301 const MInt donorId = m_calcSourceDonorCells[donorIndex];
303 const MFloat* meanVars = &m_meanVars[donorIndex * noMeanVars()];
304 const MFloat curRho = fvSolver().a_variable(donorId, fvSolver().
CV->RHO);
305 const MFloat curP = fvSolver().a_pvariable(donorId, fvSolver().PV->P);
306 const MFloat rhoM = meanVars[rhoIndex];
307 const MFloat pM = meanVars[pIndex];
310 std::array<MFloat, nDim> drhoM;
311 for(
MInt dim = 0; dim < nDim; dim++) {
312 drhoM[dim] = meanVars[drhoIndex + dim];
316 std::array<MFloat, nDim> dpM;
317 for(
MInt dim = 0; dim < nDim; dim++) {
318 dpM[dim] = meanVars[dpIndex + dim];
322 std::array<MFloat, nDim> dprhoM;
323 for(
MInt dim = 0; dim < nDim; dim++) {
324 dprhoM[dim] = meanVars[dprhoIndex + dim];
327 std::array<MFloat, nDim> qmIISource;
328 for(
MInt dim = 0; dim < nDim; dim++) {
330 qmIISource[dim] = ((fvSolver().a_slope(donorId, fvSolver().PV->P, dim)) - dpM[dim]) / rhoM
332 - ((curP - pM) / (rhoM * rhoM)) * drhoM[dim]
334 - (fvSolver().a_slope(donorId, fvSolver().PV->P, dim)) / curRho
340 for(
MInt dim = 0; dim < nDim; dim++) {
342 sourceTerms[donorId * SysEqn::noVars() + CV::UU[0] + dim] += qmIISource[dim];
346 RECORD_TIMER_STOP(m_timers[Timers::CalcSourceQmII]);
353template <MInt nDim,
class FvSysEqn>
356 RECORD_TIMER_START(m_timers[Timers::CalcSourceQmIII]);
357 TERMM(1,
"requires testing");
359 const MInt umIndex = m_meanVarsIndex[MV::UU0[0]];
363 for(
MInt donorIndex = 0; donorIndex < m_noActiveDonorCells; donorIndex++) {
364 const MInt donorId = m_calcSourceDonorCells[donorIndex];
366 const MFloat* meanVars = &m_meanVars[donorIndex * noMeanVars()];
368 std::array<MFloat, nDim> qmIIISource;
369 std::fill_n(&qmIIISource[0], nDim, 0.0);
372 for(
MInt dim = 0; dim < nDim; dim++) {
373 const MFloat velDiff = velocity[donorId * nDim + dim] - meanVars[umIndex + dim];
375 for(
MInt i = 0; i < nDim; i++) {
376 const MFloat velGrad = fvSolver().a_slope(donorId, fvSolver().PV->VV[dim], i);
377 const MFloat velGradM = meanVars[m_meanVarsIndex[MV::GRADU[dim * nDim + i]]];
379 qmIIISource[i] += velDiff * (velGrad - velGradM);
383 qmIIISource[dim] -= meanVars[m_meanVarsIndex[MV::UGRADU[dim]]];
385 for(
MInt i = 0; i < nDim; i++) {
386 const MInt gradUPos = i * nDim + dim;
387 qmIIISource[dim] += meanVars[m_meanVarsIndex[MV::UU0[i]]] * meanVars[m_meanVarsIndex[MV::GRADU[gradUPos]]];
392 for(
MInt dim = 0; dim < nDim; dim++) {
394 sourceTerms[donorId * SysEqn::noVars() + CV::UU[0] + dim] -= qmIIISource[dim];
398 RECORD_TIMER_STOP(m_timers[Timers::CalcSourceQmIII]);
411template <MInt nDim,
class FvSysEqn>
413 const MFloat*
const vorticity,
416 RECORD_TIMER_START(m_timers[Timers::CalcSourceLamb]);
419 const MInt veloIndex = m_meanVarsIndex[MV::UU0[0]];
420 const MInt vortIndex = m_meanVarsIndex[MV::VORT0[0]];
422 std::array<MFloat, MAX_SPACE_DIMENSIONS> veloP{};
423 std::array<MFloat, MAX_SPACE_DIMENSIONS> vortP{};
427 for(
MInt donorIndex = 0; donorIndex < m_noActiveDonorCells; donorIndex++) {
428 const MInt donorId = m_calcSourceDonorCells[donorIndex];
430 const MFloat* meanVars = &m_meanVars[donorIndex * noMeanVars()];
431 const MFloat* velo = &velocity[donorId * noVelocities()];
432 const MFloat* vort = &vorticity[donorId * noVorticities()];
435 for(
MInt dim = 0; dim < nDim; dim++) {
436 veloP[dim] = velo[dim] - meanVars[veloIndex + dim];
439 for(
MInt i = 0; i < noVorticities(); i++) {
440 vortP[i] = vort[i] - meanVars[vortIndex + i];
448 const MInt sourcesOffset = donorId * SysEqn::noVars() + CV::UU[0];
449 IF_CONSTEXPR(nDim == 2) {
451 sourceTerms[sourcesOffset] += -2.0 * (-vortP[0] * meanVars[veloIndex + 1] - meanVars[vortIndex] * veloP[1]);
454 sourceTerms[sourcesOffset + 1] += -2.0 * (vortP[0] * meanVars[veloIndex] + meanVars[vortIndex] * veloP[0]);
458 sourceTerms[sourcesOffset] += -2.0
459 * (vortP[1] * meanVars[veloIndex + 2] - vortP[2] * meanVars[veloIndex + 1]
460 + meanVars[vortIndex + 1] * veloP[2] - meanVars[vortIndex + 2] * veloP[1]);
463 sourceTerms[sourcesOffset + 1] += -2.0
464 * (vortP[2] * meanVars[veloIndex] - vortP[0] * meanVars[veloIndex + 2]
465 + meanVars[vortIndex + 2] * veloP[0] - meanVars[vortIndex] * veloP[2]);
468 sourceTerms[sourcesOffset + 2] += -2.0
469 * (vortP[0] * meanVars[veloIndex + 1] - vortP[1] * meanVars[veloIndex]
470 + meanVars[vortIndex] * veloP[1] - meanVars[vortIndex + 1] * veloP[0]);
474 RECORD_TIMER_STOP(m_timers[Timers::CalcSourceLamb]);
486template <MInt nDim,
class FvSysEqn>
489 MFloat*
const sourceTerms) {
491 RECORD_TIMER_START(m_timers[Timers::CalcSourceQe]);
492 TERMM(1,
"untested in new coupling condition");
495 if(m_isFirstSourceCalculation) {
497 m_oldPressure.resize(m_noActiveDonorCells);
504 fvSolver().oldPressure(&buffer[0]);
505 for(
MInt donorIndex = 0; donorIndex < m_noActiveDonorCells; donorIndex++) {
506 const MInt donorId = m_calcSourceDonorCells[donorIndex];
507 m_oldPressure[donorIndex] = buffer[donorId];
512 for(
MInt donorIndex = 0; donorIndex < m_noActiveDonorCells; donorIndex++) {
513 const MInt donorId = m_calcSourceDonorCells[donorIndex];
514 m_oldPressure[donorIndex] = fvSolver().a_pvariable(donorId, fvSolver().PV->P);
519 fvSolver().LSReconstructCellCenter();
524 (m_isFirstSourceCalculation && !m_isRestart) ? std::numeric_limits<MFloat>::infinity() : time - m_previousTime;
528 const MInt rhoIndex = m_meanVarsIndex[MV::RHO0];
529 const MInt pIndex = m_meanVarsIndex[MV::P0];
530 const MInt cIndex = m_meanVarsIndex[MV::C0];
531 const MInt veloIndex = m_meanVarsIndex[MV::UU0[0]];
532 const MInt dcIndex = m_meanVarsIndex[MV::DC0[0]];
533 std::array<MInt, nDim> divIndex;
534 for(
MInt i = 0; i < nDim; i++) {
535 divIndex[i] = m_meanVarsIndex[MV::DU[i]];
537 const MInt drhoIndex = m_meanVarsIndex[MV::DRHO[0]];
538 const MInt dpIndex = m_meanVarsIndex[MV::DP[0]];
540 for(
MInt donorIndex = 0; donorIndex < m_noActiveDonorCells; donorIndex++) {
541 const MInt donorId = m_calcSourceDonorCells[donorIndex];
544 const MFloat curP = fvSolver().a_pvariable(donorId, fvSolver().PV->P);
545 const MFloat dpdt = (curP - m_oldPressure[donorIndex]) / dt;
546 m_oldPressure[donorIndex] = curP;
549 const MFloat* meanVars = &m_meanVars[donorIndex * noMeanVars()];
552 std::array<MFloat, nDim> veloM;
553 for(
MInt dim = 0; dim < nDim; dim++) {
554 veloM[dim] = meanVars[veloIndex + dim];
558 std::array<MFloat, nDim> dcM;
559 for(
MInt dim = 0; dim < nDim; dim++) {
560 dcM[dim] = meanVars[dcIndex + dim];
564 std::array<MFloat, nDim> drhoM;
565 for(
MInt dim = 0; dim < nDim; dim++) {
566 drhoM[dim] = meanVars[drhoIndex + dim];
570 std::array<MFloat, nDim> dpM;
571 for(
MInt dim = 0; dim < nDim; dim++) {
572 dpM[dim] = meanVars[dpIndex + dim];
577 for(
MInt dim = 0; dim < nDim; dim++) {
578 divUm += meanVars[divIndex[dim]];
582 for(
MInt dim = 0; dim < nDim; dim++) {
583 divU += fvSolver().a_slope(donorId, fvSolver().PV->VV[dim], dim);
587 const MFloat*
const velo = &velocity[donorId * noVelocities()];
589 for(
MInt dim = 0; dim < nDim; dim++) {
590 drhodttmp += velo[dim] * fvSolver().a_slope(donorId, fvSolver().PV->RHO, dim);
592 const MFloat curRho = fvSolver().a_variable(donorId, fvSolver().
CV->RHO);
593 const MFloat drhodt = -curRho * divU - drhodttmp;
596 const MFloat rhoM = meanVars[rhoIndex];
597 const MFloat pM = meanVars[pIndex];
598 const MFloat cM = meanVars[cIndex];
599 const MFloat cTerm = cM * cM;
601 qeSource += drhodt - (1.0 / cTerm) * dpdt;
602 qeSource += (curRho - rhoM) * divUm;
603 qeSource -= ((curP - pM) / cTerm) * divUm;
604 for(
MInt dim = 0; dim < nDim; dim++) {
606 qeSource += veloM[dim] * ((fvSolver().a_slope(donorId, fvSolver().PV->RHO, dim)) - drhoM[dim]);
607 qeSource -= (1.0 / cTerm) * veloM[dim] * ((fvSolver().a_slope(donorId, fvSolver().PV->P, dim)) - dpM[dim]);
608 qeSource += 2.0 * ((curP - pM) / (cM * cM * cM)) * veloM[dim] * dcM[dim];
616 sourceTerms[donorId * SysEqn::noVars() + CV::P] += qeSource;
619 RECORD_TIMER_STOP(m_timers[Timers::CalcSourceQe]);
632template <MInt nDim,
class FvSysEqn>
634 MFloat*
const sourceTerms,
635 const MFloat NotUsed(time),
636 const MInt NotUsed(timeStep)) {
638 RECORD_TIMER_START(m_timers[Timers::CalcSourceQc]);
640 const MInt veloIndex = m_meanVarsIndex[MV::UU0[0]];
641 const MInt drhoIndex = m_meanVarsIndex[MV::DRHO[0]];
642 const MInt rhoDivUIndex = m_meanVarsIndex[MV::RHODIVU[0]];
643 const MInt uGradRhoIndex = m_meanVarsIndex[MV::UGRADRHO[0]];
644 std::array<MInt, nDim> divIndex;
645 for(
MInt i = 0; i < nDim; i++) {
646 divIndex[i] = m_meanVarsIndex[MV::DU[i]];
648 const MInt cIndex = m_meanVarsIndex[MV::C0];
649 const MInt rhoIndex = m_meanVarsIndex[MV::RHO0];
654 for(
MInt donorIndex = 0; donorIndex < m_noActiveDonorCells; donorIndex++) {
655 const MInt donorId = m_calcSourceDonorCells[donorIndex];
658 const MFloat*
const meanVars = &m_meanVars[donorIndex * noMeanVars()];
661 std::array<MFloat, nDim> veloM;
662 for(
MInt dim = 0; dim < nDim; dim++) {
663 veloM[dim] = meanVars[veloIndex + dim];
667 std::array<MFloat, nDim> drhoM;
668 for(
MInt dim = 0; dim < nDim; dim++) {
669 drhoM[dim] = meanVars[drhoIndex + dim];
674 for(
MInt dim = 0; dim < nDim; dim++) {
675 rhodivuM += meanVars[rhoDivUIndex + dim];
680 for(
MInt dim = 0; dim < nDim; dim++) {
681 ugradrhoM += meanVars[uGradRhoIndex + dim];
685 for(
MInt dim = 0; dim < nDim; dim++) {
686 divUm += meanVars[divIndex[dim]];
690 divU += fvSolver().a_slope(donorId, fvSolver().PV->U, 0);
691 divU += fvSolver().a_slope(donorId, fvSolver().PV->V, 1);
692 IF_CONSTEXPR(nDim == 3) { divU += fvSolver().a_slope(donorId, fvSolver().PV->W, 2); }
695 const MFloat rhoM = meanVars[rhoIndex];
696 const MFloat curRho = fvSolver().a_variable(donorId, fvSolver().
CV->RHO);
697 const MFloat*
const velo = &velocity[donorId * noVelocities()];
699 qcSource += (curRho - rhoM) * (divU - divUm);
700 qcSource -= rhodivuM;
701 qcSource -= ugradrhoM;
702 qcSource += rhoM * divUm;
703 for(
MInt dim = 0; dim < nDim; dim++) {
704 qcSource += (velo[dim] - veloM[dim]) * ((fvSolver().a_slope(donorId, fvSolver().PV->RHO, dim)) - drhoM[dim]);
705 qcSource += veloM[dim] * drhoM[dim];
709 qcSource *= -meanVars[cIndex] * meanVars[cIndex];
713 sourceTerms[donorId * SysEqn::noVars() + CV::P] += qcSource;
716 RECORD_TIMER_STOP(m_timers[Timers::CalcSourceQc]);
719template <MInt nDim,
class FvSysEqn>
724 for(
auto donorId : donorCellIds) {
725 for(
MInt varId = 0; varId < noVelocities(); varId++) {
726 p_velocity(donorId, varId) = fvSolver().a_pvariable(donorId, fvSolver().PV->VV[varId]);
733 if(m_hasDonorCartesianSolver) {
734 fvSolver().getVorticityT(&p_vorticity[0]);
744template <MInt nDim,
class FvSysEqn>
748 if(m_fixedTimeStep < 0.0) {
749 TERMM(1,
"Fixed time step less than zero.");
752 fvSolver().forceTimeStep(m_fixedTimeStep);
753 dgSolver().forceTimeStep(m_fixedTimeStep);
756 return m_fixedTimeStep;
759template <MInt nDim,
class FvSysEqn>
762 TERMM_IF_NOT_COND(dataId == 0,
"invalid data id");
765 const MInt fvCellId = fvSolver().grid().tree().grid2solver(gridCellId);
772 const MBool foundDonorCell =
773 std::binary_search(m_calcSourceDonorCells.begin(), m_calcSourceDonorCells.end(), fvCellId);
775 dataSize = noMeanVars();
781template <MInt nDim,
class FvSysEqn>
783 const MInt NotUsed(oldNoCells),
784 const MInt*
const NotUsed(bufferIdToCellId),
787 TERMM_IF_NOT_COND(dataId == 0,
"invalid data id");
789 const MBool donorIdsSorted = std::is_sorted(m_calcSourceDonorCells.begin(), m_calcSourceDonorCells.end());
790 TERMM_IF_NOT_COND(donorIdsSorted,
"donor ids not sorted");
792 if(m_noActiveDonorCells > 0) {
793 std::copy_n(&m_meanVars[0], m_noActiveDonorCells * noMeanVars(), data);
798template <MInt nDim,
class FvSysEqn>
801 TERMM_IF_NOT_COND(dataId == 0,
"invalid data id");
804 if(m_loadBalancingReinitStage != 0) {
808 const MBool donorIdsSorted = std::is_sorted(m_calcSourceDonorCells.begin(), m_calcSourceDonorCells.end());
809 TERMM_IF_NOT_COND(donorIdsSorted,
"donor ids not sorted");
811 if(m_noActiveDonorCells > 0) {
812 std::copy_n(data, m_noActiveDonorCells * noMeanVars(), &m_meanVars[0]);
Intermediate class for coupling DG solver with APE sysEqn.
static constexpr MInt noVelocities()
Return number of velocity variables.
DgGalerkinProjection< nDim > ProjectionType
MBool m_isRestart
Store whether this is a restart (in case special treatment is necessary)
MBool m_checkConservation
Check if each Galerkin projection is conservative.
std::array< MInt, s_totalNoMeanVars > m_meanVarsIndex
MBool m_isFirstSourceCalculation
Store whether this is the first calculation of the source terms.
MInt noMeanVars() const
Return number of mean variables.
std::array< MInt, Timers::_count > m_timers
static constexpr MInt noVorticities()
Return number of vorticity variables.
MBool m_calcProjectionError
Calculate the L2 error of the Galerkin projection.
MFloat m_maxL2Error
Maximum computed L2 error of the Galerkin projection.
std::vector< MInt > m_calcSourceDonorCells
List of all donor cell ids for which source terms need to be computed.
MInt m_noDonorCells
Total number of donor cells on this domain.
MeanVariables< nDim > MV
Hold indices for mean variables.
MFloat m_previousTime
Previous time for the calculation of time derivatives.
void initCoupler()
Initialize the coupling condition (data structures).
MInt m_noActiveDonorCells
MBool m_hasDonorCartesianSolver
Store whether this domain has Cartesian donor solver cells.
MFloat m_fixedTimeStep
Fixed time step to use.
MBool m_hasDgCartesianSolver
Store whether this domain has DG cells/elements.
std::vector< MFloat > m_meanVars
Local storage for mean variables of the donor cells.
DgSysEqnAcousticPerturb< nDim > SysEqn
MFloat m_maxConservationError
Maximum conservation error.
typename BaseDg::solverType DgCartesianSolverType
MString outputDir() const
Return output directory.
DgSysEqnAcousticPerturb< nDim > & sysEqn()
Return reference to SysEqn object.
solverType & dgSolver() const
Return MPI communicator.
MInt solverId() const
Return solver id.
solverType & fvSolver(const MInt solverId=0) const
FvCartesianSolverXD< nDim, FvSysEqn > solverType
Coupling condition for direct-hybrid LES-CAA computations.
void balancePre() override
Load balancing.
typename BaseDg::ProjectionType ProjectionType
MBool forceTimeStep() const
Return true if time step calculation should be overruled by coupling.
typename BaseDg::DgCartesianSolverType DgCartesianSolverType
void calcSourceLambLinearized(const MFloat *const velocity, const MFloat *const vorticity, MFloat *sourceTerms) override
Calculate the linearized Lamb vector coupling source terms on all donor cells where it is needed.
MFloat calcTimeStep()
Return the time step size dt as determined by the coupling condition.
void sanityCheck()
Perform sanity checks.
void calcSourceLambNonlinear(const MFloat *const velocity, const MFloat *const vorticity, MFloat *const sourceTerms) override
Calculate the nonlinear Lamb vector coupling source terms on all donor cells where it is needed.
void setCellDataDlb(const MInt NotUsed(dataId), const MFloat *const NotUsed(data)) override
typename BaseDg::Timers Timers
FvCartesianSolverType & donorSolver(const MInt xSolverId=0) const override
void calcSourceQc(const MFloat *const velocity, MFloat *const sourceTerms, const MFloat time, const MInt timeStep) override
Calculate the q_c source terms on all donor cells where it is needed.
void calcSourceQe(const MFloat *const velocity, const MFloat time, MFloat *const sourceTerms) override
Calculate the q_e source terms on all donor cells where it is needed.
MInt cellDataSizeDlb(const MInt NotUsed(dataId), const MInt NotUsed(cellId)) override
void getCellDataDlb(const MInt dataId, const MInt oldNoCells, const MInt *const bufferIdToCellId, MFloat *const data) override
MInt noCellDataDlb() const override
Methods to inquire coupler data during balancing.
void calcSourceQmIII(const MFloat *const velocity, MFloat *sourceTerms) override
Calculate the q_mIII source terms on all donor cells where it is needed.
DgCcAcousticPerturb(const MInt couplingId, FvCartesianSolverType *fvSolver_, DgCartesianSolverType *const dgSolver_)
MInt m_loadBalancingReinitStage
DLB reinitialization stage.
void getDonorVelocityAndVorticity(const std::vector< MInt > &donorCellIds, MFloatScratchSpace &p_velocity, MFloatScratchSpace &p_vorticity) override
typename BaseFv::solverType FvCartesianSolverType
void finalizeCouplerInit() override
virtual ~DgCcAcousticPerturb()
Stop the object lifetime timer and calculate global maximum errors.
std::vector< MFloat > m_oldPressure
Store previous pressure term for dp/dt calculation.
void balancePost() override
typename BaseDg::SysEqn SysEqn
MInt cellDataTypeDlb(const MInt dataId) const override
void calcSourceQmII(const MFloat *const velocity, MFloat *const sourceTerms) override
Calculate the q_mII source terms on all donor cells where it is needed.
This class is a ScratchSpace.
Parent class of all solvers This class is the base for all solvers. I.e. all solver class (e....
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