Skip to content

Commit 5bd9494

Browse files
authored
Account for metric term in fluxes due to inhomogeneous Neumann boundary conditions (#4579)
This fix targets the calculation of fluxes following a linear solve using an MLCellABecLapT linear operator with a metric term. Previously, there was an inconsistency between fluxes within the domain and at the domain boundaries - the presence of the metric term was only accounted for in the calculation of fluxes within the domain but not in the calculation of fluxes at the domain boundary. By changing the order of operations in the MLCellABecLapT::getFluxes method, this fix solves that issue and fluxes are calculated consistently across the domain.
1 parent ccc9119 commit 5bd9494

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Src/LinearSolvers/MLMG/AMReX_MLCellABecLap.H

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,14 @@ MLCellABecLapT<MF>::getFluxes (const Vector<Array<MF*,AMREX_SPACEDIM> >& a_flux,
285285
for (int alev = 0; alev < nlevs; ++alev) {
286286
this->compFlux(alev, a_flux[alev], *a_sol[alev], a_loc);
287287
for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
288-
this->unapplyMetricTerm(alev, 0, *a_flux[alev][idim]);
289288
if (betainv != RT(1.0)) {
290289
a_flux[alev][idim]->mult(betainv, 0, ncomp);
291290
}
292291
}
293292
this->addInhomogNeumannFlux(alev, a_flux[alev], *a_sol[alev], true);
293+
for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
294+
this->unapplyMetricTerm(alev, 0, *a_flux[alev][idim]);
295+
}
294296
}
295297
}
296298

0 commit comments

Comments
 (0)