From dc5eb67ca0658ee1f2c632fe948ce8f3ddeb3f8b Mon Sep 17 00:00:00 2001 From: Edward Basso Date: Mon, 20 Nov 2023 13:25:37 -0800 Subject: [PATCH] More fixes --- Src/LinearSolvers/MLMG/AMReX_MLCellABecLap.H | 32 +++++++++---------- Src/LinearSolvers/MLMG/AMReX_MLMG.H | 2 +- .../MLMG/AMReX_MLNodeABecLaplacian.H | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Src/LinearSolvers/MLMG/AMReX_MLCellABecLap.H b/Src/LinearSolvers/MLMG/AMReX_MLCellABecLap.H index 6262064f550..c63cbcb4584 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLCellABecLap.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLCellABecLap.H @@ -256,14 +256,14 @@ MLCellABecLapT::getFluxes (const Vector >& a_flux, BL_PROFILE("MLMG::getFluxes()"); const int ncomp = this->getNComp(); - const RT betainv = RT(1.0) / getBScalar(); + const RT bscalarinv = RT(1.0) / getBScalar(); const int nlevs = this->NAMRLevels(); for (int alev = 0; alev < nlevs; ++alev) { this->compFlux(alev, a_flux[alev], *a_sol[alev], a_loc); for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) { this->unapplyMetricTerm(alev, 0, *a_flux[alev][idim]); - if (betainv != RT(1.0)) { - a_flux[alev][idim]->mult(betainv, 0, ncomp); + if (bscalarinv != RT(1.0)) { + a_flux[alev][idim]->mult(bscalarinv, 0, ncomp); } } this->addInhomogNeumannFlux(alev, a_flux[alev], *a_sol[alev], true); @@ -292,7 +292,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const const RT dx = static_cast(this->m_geom[amrlev][mglev].CellSize(0)); const Box& domain = this->m_geom[amrlev][mglev].Domain(); - const RT beta = getBScalar(); + const RT bscalar = getBScalar(); Array const& bcoef = getBCoeffs(amrlev,mglev); FAB foo(Box(IntVect(0),IntVect(1))); bool has_bcoef = (bcoef[0] != nullptr); @@ -338,7 +338,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const if (this->m_lobc_orig[icomp][idim] == LinOpBCType::inhomogNeumann && outside_domain_lo) { if (idim == 0) { - RT fac = beta*dxi; + RT fac = bscalar*dxi; if (this->m_has_metric_term && !has_bcoef) { #if (AMREX_SPACEDIM == 1) fac *= static_cast(problo[0]*problo[0]); @@ -353,7 +353,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const fac, has_bcoef, icomp); }); } else if (idim == 1) { - RT fac = beta*dyi; + RT fac = bscalar*dyi; if (this->m_has_metric_term && !has_bcoef) { AMREX_HOST_DEVICE_FOR_3D(blo, i, j, k, { @@ -371,7 +371,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const }); } } else { - RT fac = beta*dzi; + RT fac = bscalar*dzi; AMREX_HOST_DEVICE_FOR_3D(blo, i, j, k, { mllinop_apply_innu_zlo(i,j,k, rhsfab, mlo, bfab, @@ -383,7 +383,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const if (this->m_hibc_orig[icomp][idim] == LinOpBCType::inhomogNeumann && outside_domain_hi) { if (idim == 0) { - RT fac = beta*dxi; + RT fac = bscalar*dxi; if (this->m_has_metric_term && !has_bcoef) { #if (AMREX_SPACEDIM == 1) fac *= static_cast(probhi[0]*probhi[0]); @@ -398,7 +398,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const fac, has_bcoef, icomp); }); } else if (idim == 1) { - RT fac = beta*dyi; + RT fac = bscalar*dyi; if (this->m_has_metric_term && !has_bcoef) { AMREX_HOST_DEVICE_FOR_3D(bhi, i, j, k, { @@ -415,7 +415,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const }); } } else { - RT fac = beta*dzi; + RT fac = bscalar*dzi; AMREX_HOST_DEVICE_FOR_3D(bhi, i, j, k, { mllinop_apply_innu_zhi(i,j,k, rhsfab, mhi, bfab, @@ -432,7 +432,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const if (this->m_lobc_orig[icomp][idim] == LinOpBCType::Robin && outside_domain_lo) { if (idim == 0) { - RT fac = beta*dxi*dxi; + RT fac = bscalar*dxi*dxi; AMREX_HOST_DEVICE_FOR_3D(blo, i, j, k, { RT A = rbc(i,j,k,2) @@ -440,7 +440,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const rhsfab(i+1,j,k,icomp) += fac*bfab(i+1,j,k,icomp)*A; }); } else if (idim == 1) { - RT fac = beta*dyi*dyi; + RT fac = bscalar*dyi*dyi; AMREX_HOST_DEVICE_FOR_3D(blo, i, j, k, { RT A = rbc(i,j,k,2) @@ -448,7 +448,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const rhsfab(i,j+1,k,icomp) += fac*bfab(i,j+1,k,icomp)*A; }); } else { - RT fac = beta*dzi*dzi; + RT fac = bscalar*dzi*dzi; AMREX_HOST_DEVICE_FOR_3D(blo, i, j, k, { RT A = rbc(i,j,k,2) @@ -460,7 +460,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const if (this->m_hibc_orig[icomp][idim] == LinOpBCType::Robin && outside_domain_hi) { if (idim == 0) { - RT fac = beta*dxi*dxi; + RT fac = bscalar*dxi*dxi; AMREX_HOST_DEVICE_FOR_3D(bhi, i, j, k, { RT A = rbc(i,j,k,2) @@ -468,7 +468,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const rhsfab(i-1,j,k,icomp) += fac*bfab(i,j,k,icomp)*A; }); } else if (idim == 1) { - RT fac = beta*dyi*dyi; + RT fac = bscalar*dyi*dyi; AMREX_HOST_DEVICE_FOR_3D(bhi, i, j, k, { RT A = rbc(i,j,k,2) @@ -476,7 +476,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const rhsfab(i,j-1,k,icomp) += fac*bfab(i,j,k,icomp)*A; }); } else { - RT fac = beta*dzi*dzi; + RT fac = bscalar*dzi*dzi; AMREX_HOST_DEVICE_FOR_3D(bhi, i, j, k, { RT A = rbc(i,j,k,2) diff --git a/Src/LinearSolvers/MLMG/AMReX_MLMG.H b/Src/LinearSolvers/MLMG/AMReX_MLMG.H index f1fed2d3db3..af0b3dd8e8d 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLMG.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLMG.H @@ -57,7 +57,7 @@ public: Location a_loc = Location::FaceCenter); /** - * \brief For ``(alpha * a - beta * (del dot b grad)) phi = rhs``, flux means ``-b grad phi`` + * \brief For ``(A * alpha - B * (del dot beta grad)) phi = rhs``, flux means ``-beta grad phi`` */ template void getFluxes (const Vector >& a_flux, diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeABecLaplacian.H b/Src/LinearSolvers/MLMG/AMReX_MLNodeABecLaplacian.H index 63f20fe447a..c66be7038dd 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeABecLaplacian.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeABecLaplacian.H @@ -7,7 +7,7 @@ namespace amrex { // (A * alpha - B * (del dot beta grad)) phi = rhs -// a, phi and rhs are nodal. b is cell-centered. +// alpha, phi and rhs are nodal. beta is cell-centered. class MLNodeABecLaplacian : public MLNodeLinOp {