16#include <CD_NamespaceHeader.H>
18template <
typename Duration>
22 CH_TIME(
"MFHelmholtzOp::computeOperatorLoads");
27 CH_assert(a_numApply > 0);
30 LevelData<MFCellFAB> Lphi;
33 const DisjointBoxLayout& dbl = a_phi.disjointBoxLayout();
34 const DataIterator& dit = dbl.dataIterator();
36 Vector<long long> loads(dbl.size(), 0LL);
38 const int nbox = dit.size();
40#pragma omp parallel for schedule(runtime)
41 for (
int mybox = 0; mybox < nbox; mybox++) {
42 const DataIndex& din = dit[mybox];
43 const int intCode = din.intCode();
45 const auto t0 = std::chrono::steady_clock::now();
47 for (
int i = 0; i < a_numApply; i++) {
52 const int iphase = op.first;
54 RefCountedPtr<EBMultigridInterpolator>& phaseInterpolator =
m_interpolator.getInterpolator(iphase);
56 EBCellFAB& phi = (EBCellFAB&)a_phi[din].getPhase(iphase);
58 phaseInterpolator->coarseFineInterpH(phi, Interval(
m_comp,
m_comp), din);
69 const Box cellBox = Lphi.disjointBoxLayout()[din];
71 const int iphase = op.first;
73 EBCellFAB& Lph = Lphi[din].getPhase(iphase);
74 EBCellFAB& phi = a_phi[din].getPhase(iphase);
76 const EBCellFAB& Acoef = (*m_Acoef)[din].getPhase(iphase);
77 const EBFluxFAB& Bcoef = (*m_Bcoef)[din].getPhase(iphase);
78 const BaseIVFAB<Real>& BcoefIrreg = *(*m_BcoefIrreg)[din].getPhasePtr(iphase);
80 op.second->applyOp(Lph, phi, Acoef, Bcoef, BcoefIrreg, cellBox, din,
true);
84 const auto t1 = std::chrono::steady_clock::now();
85 const auto duration = (std::chrono::duration_cast<Duration>(t1 - t0));
87 loads[intCode] = (
long long)duration.count();
95#include <CD_NamespaceFooter.H>
Declaration of a class for solving multiphase Helmholtz equations.
Agglomeration of basic MPI reductions.
RefCountedPtr< MFHelmholtzJumpBC > m_jumpBC
BC jump object. This is the one that has the stencils and can compute derivatives.
Definition CD_MFHelmholtzOp.H:684
IntVect m_ghostPhi
Number of ghost cells.
Definition CD_MFHelmholtzOp.H:784
static constexpr int m_comp
Component that we solve for.
Definition CD_MFHelmholtzOp.H:653
bool m_multifluid
Multifluid operator or not.
Definition CD_MFHelmholtzOp.H:759
RefCountedPtr< LevelData< BaseIVFAB< Real > > > m_jump
Actual BC jump in data-based format. This is the right-hand side of dphi/dn1 + dphi/dn2 = jump.
Definition CD_MFHelmholtzOp.H:689
std::map< int, RefCountedPtr< EBHelmholtzOp > > m_helmOps
Helmholtz operators on each phase. Note that I'm using int rather than Phase as identifier because th...
Definition CD_MFHelmholtzOp.H:679
Vector< long long > computeOperatorLoads(LevelData< MFCellFAB > &a_phi, const int a_numApply) noexcept
Time the applyOp routine. Template parameter is std::chrono duration. E.g. std::chrono::microseconds.
Definition CD_MFHelmholtzOpImplem.H:20
bool m_hasCoar
True if there is a coarser AMR level.
Definition CD_MFHelmholtzOp.H:794
MFMultigridInterpolator m_interpolator
Multi grid interpolator.
Definition CD_MFHelmholtzOp.H:729
void create(LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs) override final
Create method.
Definition CD_MFHelmholtzOp.cpp:588
Real sum(const Real &a_value) noexcept
Compute the sum across all MPI ranks.
Definition CD_ParallelOpsImplem.H:354