MCPcopy Create free account
hub / github.com/AMReX-Astro/Castro / applyop_mlmg

Method applyop_mlmg

Source/diffusion/Diffusion.cpp:94–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void
95Diffusion::applyop_mlmg (int level, MultiFab& Temperature,
96 MultiFab& CrseTemp, MultiFab& DiffTerm,
97 Vector<std::unique_ptr<MultiFab> >& temp_cond_coef)
98{
99 BL_PROFILE("Diffusion::applyop_mlmg()");
100
101 if (verbose && ParallelDescriptor::IOProcessor()) {
102 std::cout << " " << '\n';
103 std::cout << "... compute diffusive term at level " << level << '\n';
104 }
105
106 const Geometry& geom = parent->Geom(level);
107 const BoxArray& ba = Temperature.boxArray();
108 const DistributionMapping& dm = Temperature.DistributionMap();
109
110 LPInfo info;
111 info.setMetricTerm(true);
112 info.setMaxCoarseningLevel(0);
113 info.setAgglomeration(false);
114 info.setConsolidation(false);
115
116 MLABecLaplacian mlabec({geom}, {ba}, {dm}, info);
117 mlabec.setMaxOrder(diffusion::mlmg_maxorder);
118
119 mlabec.setDomainBC(mlmg_lobc, mlmg_hibc);
120
121 if (level > 0) {
122 const auto& rr = parent->refRatio(level-1);
123 mlabec.setCoarseFineBC(&CrseTemp, rr[0]);
124 }
125 mlabec.setLevelBC(0, &Temperature);
126
127 mlabec.setScalars(0.0, -1.0);
128 mlabec.setBCoeffs(0, Array<MultiFab const*, AMREX_SPACEDIM>{AMREX_D_DECL(temp_cond_coef[0].get(),
129 temp_cond_coef[1].get(),
130 temp_cond_coef[2].get())});
131
132 MLMG mlmg(mlabec);
133 mlmg.setVerbose(verbose);
134 mlmg.apply({&DiffTerm}, {&Temperature});
135}

Callers

nothing calls this directly

Calls 2

setScalarsMethod · 0.45
setVerboseMethod · 0.45

Tested by

no test coverage detected