From 60b45bc19b691c1187f4cfd9cd39b2744bf7e35a Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Mon, 27 Nov 2023 13:57:39 -0800 Subject: [PATCH 1/2] MLEBABecLap: Support Robin BC at Domain Boundaries (#3617) --- .../MLMG/AMReX_MLABecLaplacian.H | 58 +++++++++++-------- Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H | 4 +- Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.H | 13 +++-- Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.cpp | 10 ++++ Src/LinearSolvers/MLMG/AMReX_MLLinOp.H | 32 +++++----- 5 files changed, 71 insertions(+), 46 deletions(-) diff --git a/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H b/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H index 9498af0e620..5c90a4e21ff 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H @@ -190,15 +190,15 @@ public: Array const& flux, FAB const& sol, int face_only, int ncomp); -protected: - - bool m_needs_update = true; - RT m_a_scalar = std::numeric_limits::quiet_NaN(); RT m_b_scalar = std::numeric_limits::quiet_NaN(); Vector > m_a_coeffs; Vector > > m_b_coeffs; +protected: + + bool m_needs_update = true; + Vector m_is_singular; [[nodiscard]] bool supportRobinBC () const noexcept override { return true; } @@ -474,29 +474,29 @@ MLABecLaplacianT::applyMetricTermsCoeffs () // \tilde{alpha}_i = alpha_i + (1-B) beta_{i+1/2} / h^2 // \tilde{rhs}_i = rhs_i + A beta_{i+1/2} / h^2 // -template -void -MLABecLaplacianT::applyRobinBCTermsCoeffs () +namespace detail { +template +void applyRobinBCTermsCoeffs (LP& linop) { - if (!(this->hasRobinBC())) { return; } + using RT = typename LP::RT; - const int ncomp = this->getNComp(); + const int ncomp = linop.getNComp(); bool reset_alpha = false; - if (m_a_scalar == RT(0.0)) { - m_a_scalar = RT(1.0); + if (linop.m_a_scalar == RT(0.0)) { + linop.m_a_scalar = RT(1.0); reset_alpha = true; } - const RT bovera = m_b_scalar/m_a_scalar; + const RT bovera = linop.m_b_scalar/linop.m_a_scalar; - for (int amrlev = 0; amrlev < this->m_num_amr_levels; ++amrlev) { + for (int amrlev = 0; amrlev < linop.NAMRLevels(); ++amrlev) { const int mglev = 0; - const Box& domain = this->m_geom[amrlev][mglev].Domain(); - const RT dxi = static_cast(this->m_geom[amrlev][mglev].InvCellSize(0)); - const RT dyi = static_cast((AMREX_SPACEDIM >= 2) ? this->m_geom[amrlev][mglev].InvCellSize(1) : Real(1.0)); - const RT dzi = static_cast((AMREX_SPACEDIM == 3) ? this->m_geom[amrlev][mglev].InvCellSize(2) : Real(1.0)); + const Box& domain = linop.Geom(amrlev,mglev).Domain(); + const RT dxi = static_cast(linop.Geom(amrlev,mglev).InvCellSize(0)); + const RT dyi = static_cast((AMREX_SPACEDIM >= 2) ? linop.Geom(amrlev,mglev).InvCellSize(1) : Real(1.0)); + const RT dzi = static_cast((AMREX_SPACEDIM == 3) ? linop.Geom(amrlev,mglev).InvCellSize(2) : Real(1.0)); if (reset_alpha) { - m_a_coeffs[amrlev][mglev].setVal(RT(0.0)); + linop.m_a_coeffs[amrlev][mglev].setVal(RT(0.0)); } MFItInfo mfi_info; @@ -505,20 +505,20 @@ MLABecLaplacianT::applyRobinBCTermsCoeffs () #ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif - for (MFIter mfi(m_a_coeffs[amrlev][mglev], mfi_info); mfi.isValid(); ++mfi) + for (MFIter mfi(linop.m_a_coeffs[amrlev][mglev], mfi_info); mfi.isValid(); ++mfi) { const Box& vbx = mfi.validbox(); - auto const& afab = m_a_coeffs[amrlev][mglev].array(mfi); + auto const& afab = linop.m_a_coeffs[amrlev][mglev].array(mfi); for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) { - auto const& bfab = m_b_coeffs[amrlev][mglev][idim].const_array(mfi); + auto const& bfab = linop.m_b_coeffs[amrlev][mglev][idim].const_array(mfi); const Box& blo = amrex::adjCellLo(vbx,idim); const Box& bhi = amrex::adjCellHi(vbx,idim); bool outside_domain_lo = !(domain.contains(blo)); bool outside_domain_hi = !(domain.contains(bhi)); if ((!outside_domain_lo) && (!outside_domain_hi)) { continue; } for (int icomp = 0; icomp < ncomp; ++icomp) { - auto const& rbc = (*(this->m_robin_bcval[amrlev]))[mfi].const_array(icomp*3); - if (this->m_lobc_orig[icomp][idim] == LinOpBCType::Robin && outside_domain_lo) + auto const& rbc = (*(linop.m_robin_bcval[amrlev]))[mfi].const_array(icomp*3); + if (linop.m_lobc_orig[icomp][idim] == LinOpBCType::Robin && outside_domain_lo) { if (idim == 0) { RT fac = bovera*dxi*dxi; @@ -546,7 +546,7 @@ MLABecLaplacianT::applyRobinBCTermsCoeffs () }); } } - if (this->m_hibc_orig[icomp][idim] == LinOpBCType::Robin && outside_domain_hi) + if (linop.m_hibc_orig[icomp][idim] == LinOpBCType::Robin && outside_domain_hi) { if (idim == 0) { RT fac = bovera*dxi*dxi; @@ -579,6 +579,16 @@ MLABecLaplacianT::applyRobinBCTermsCoeffs () } } } +} // namespace detail + +template +void +MLABecLaplacianT::applyRobinBCTermsCoeffs () +{ + if (this->hasRobinBC()) { + detail::applyRobinBCTermsCoeffs(*this); + } +} template void diff --git a/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H b/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H index 175f34ae54b..d4b3718212a 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H @@ -131,6 +131,8 @@ public: RT location; }; + Vector > m_robin_bcval; + protected: bool m_has_metric_term = false; @@ -182,8 +184,6 @@ protected: }; Vector > > m_bcondloc; - Vector > m_robin_bcval; - // used to save interpolation coefficients of the first interior cells mutable Vector> > m_undrrelxr; diff --git a/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.H b/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.H index 6187c479e4c..448a5aaedf4 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.H @@ -114,6 +114,8 @@ public: void getEBFluxes (const Vector& a_flux, const Vector& a_sol) const override; + void applyRobinBCTermsCoeffs (); + #if defined(AMREX_USE_HYPRE) && (AMREX_SPACEDIM > 1) [[nodiscard]] std::unique_ptr makeHypre (Hypre::Interface hypre_interface) const override; #endif @@ -122,6 +124,11 @@ public: [[nodiscard]] std::unique_ptr makePETSc () const override; #endif + Real m_a_scalar = std::numeric_limits::quiet_NaN(); + Real m_b_scalar = std::numeric_limits::quiet_NaN(); + Vector > m_a_coeffs; + Vector > > m_b_coeffs; + protected: int m_ncomp = 1; @@ -131,10 +138,6 @@ protected: Location m_beta_loc; // Location of coefficients: face centers or face centroids Location m_phi_loc; // Location of solution variable: cell centers or cell centroids - Real m_a_scalar = std::numeric_limits::quiet_NaN(); - Real m_b_scalar = std::numeric_limits::quiet_NaN(); - Vector > m_a_coeffs; - Vector > > m_b_coeffs; Vector > m_cc_mask; Vector > m_eb_phi; @@ -154,6 +157,8 @@ protected: const Vector& b_eb); void averageDownCoeffs (); void averageDownCoeffsToCoarseAmrLevel (int flev); + + [[nodiscard]] bool supportRobinBC () const noexcept override { return true; } }; } diff --git a/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.cpp b/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.cpp index b37537645e6..247eeeea25c 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.cpp @@ -685,6 +685,8 @@ MLEBABecLap::prepareForSolve () MLCellABecLap::prepareForSolve(); + applyRobinBCTermsCoeffs(); + averageDownCoeffs(); if (m_eb_phi[0]) { @@ -1285,6 +1287,14 @@ MLEBABecLap::getEBFluxes (const Vector& a_flux, const VectorhasRobinBC()) { + detail::applyRobinBCTermsCoeffs(*this); + } +} + #if defined(AMREX_USE_HYPRE) && (AMREX_SPACEDIM > 1) std::unique_ptr MLEBABecLap::makeHypre (Hypre::Interface hypre_interface) const diff --git a/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H b/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H index 706fe679d7e..a889f7514af 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H @@ -488,6 +488,22 @@ public: [[nodiscard]] bool isMFIterSafe (int amrlev, int mglev1, int mglev2) const; + //! Return the number of AMR levels + [[nodiscard]] int NAMRLevels () const noexcept { return m_num_amr_levels; } + + //! Return the number of MG levels at given AMR level + [[nodiscard]] int NMGLevels (int amrlev) const noexcept { return m_num_mg_levels[amrlev]; } + + [[nodiscard]] const Geometry& Geom (int amr_lev, int mglev=0) const noexcept { return m_geom[amr_lev][mglev]; } + + // BC + Vector > m_lobc; + Vector > m_hibc; + // Need to save the original copy because we change the BC type to + // Neumann for inhomogeneous Neumann and Robin. + Vector > m_lobc_orig; + Vector > m_hibc_orig; + protected: static constexpr int mg_coarsen_ratio = 2; @@ -544,14 +560,6 @@ protected: }; std::unique_ptr m_raii_comm; - // BC - Vector > m_lobc; - Vector > m_hibc; - // Need to save the original copy because we change the BC type to - // Neumann for inhomogeneous Neumann and Robin. - Vector > m_lobc_orig; - Vector > m_hibc_orig; - Array m_domain_bloc_lo {{AMREX_D_DECL(0._rt,0._rt,0._rt)}}; Array m_domain_bloc_hi {{AMREX_D_DECL(0._rt,0._rt,0._rt)}}; @@ -561,20 +569,12 @@ protected: const MF* m_coarse_data_for_bc = nullptr; MF m_coarse_data_for_bc_raii; - //! Return the number of AMR levels - [[nodiscard]] int NAMRLevels () const noexcept { return m_num_amr_levels; } - - //! Return the number of MG levels at given AMR level - [[nodiscard]] int NMGLevels (int amrlev) const noexcept { return m_num_mg_levels[amrlev]; } - //! Return AMR refinement ratios [[nodiscard]] const Vector& AMRRefRatio () const noexcept { return m_amr_ref_ratio; } //! Return AMR refinement ratio at given AMR level [[nodiscard]] int AMRRefRatio (int amr_lev) const noexcept { return m_amr_ref_ratio[amr_lev]; } - [[nodiscard]] const Geometry& Geom (int amr_lev, int mglev=0) const noexcept { return m_geom[amr_lev][mglev]; } - [[nodiscard]] FabFactory const* Factory (int amr_lev, int mglev=0) const noexcept { return m_factory[amr_lev][mglev].get(); } From 4b64003c80099627e9da856801517844f2bb21b8 Mon Sep 17 00:00:00 2001 From: Edward Basso Date: Mon, 27 Nov 2023 15:58:46 -0600 Subject: [PATCH 2/2] Comments: correct some typos (#3641) ## Summary This PR fixes some typos and spelling errors in the comments that codespell seems to have missed. --- CHANGES | 6 +++--- Src/AmrCore/AMReX_FillPatcher.H | 8 ++++---- Src/AmrCore/AMReX_InterpFaceRegister.H | 4 ++-- Src/Base/AMReX_BCRec.H | 2 +- Src/Base/AMReX_FArrayBox.H | 2 +- Src/Base/AMReX_FabArray.H | 4 ++-- Src/Base/AMReX_MultiFab.H | 4 ++-- Src/Base/AMReX_MultiFabUtil.H | 2 +- Src/Base/AMReX_MultiFabUtil.cpp | 2 +- Src/Base/AMReX_iMultiFab.H | 4 ++-- Src/EB/AMReX_EB_utils.cpp | 2 +- Src/F_Interfaces/Base/AMReX_parallel_mod.F90 | 2 +- Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H | 10 +++++----- Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.H | 2 +- Src/LinearSolvers/MLMG/AMReX_MLLinOp.H | 2 +- Src/LinearSolvers/MLMG/AMReX_MLMG.H | 2 +- Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H | 8 ++++---- Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.H | 2 +- Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.cpp | 2 +- Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.cpp | 2 +- 20 files changed, 36 insertions(+), 36 deletions(-) diff --git a/CHANGES b/CHANGES index a7a22fd97bd..f9f2d4febe8 100644 --- a/CHANGES +++ b/CHANGES @@ -72,7 +72,7 @@ -- We weren't defining cent_hat out far enough (#3548) - -- Add Fortran inteface for FillCoarsePatch for face variables (#3542) + -- Add Fortran interface for FillCoarsePatch for face variables (#3542) -- print_state/printCell: Make it work without managed memory (#3543) @@ -114,7 +114,7 @@ -- Simplify filterParticles Kernel (#3510) - -- Generatize particle-to-cell assignment function (#3499) + -- Generalize particle-to-cell assignment function (#3499) Follow-on to 3499 (#3514) ParticleLocator: Make Assignor optional template parameter (#3515) @@ -302,7 +302,7 @@ # 23.07 - -- Allow users to change the default vector growth stategy (#3389) + -- Allow users to change the default vector growth strategy (#3389) -- Communications arena implementation (#3388) diff --git a/Src/AmrCore/AMReX_FillPatcher.H b/Src/AmrCore/AMReX_FillPatcher.H index 46d1107dea3..d36b3529efd 100644 --- a/Src/AmrCore/AMReX_FillPatcher.H +++ b/Src/AmrCore/AMReX_FillPatcher.H @@ -15,13 +15,13 @@ namespace amrex { * with interpolation of the coarse data. Then it fills the fine ghost * cells overlapping fine level valid cells with the fine level data. If * the valid cells of the destination need to be filled, it will be done as - * well. Finally, it will fill the physical bounbary using the user + * well. Finally, it will fill the physical boundary using the user * provided functor. The `fill` member function can be used to do the * operations just described. Alternatively, one can also use the * `fillCoarseFineBounary` to fill the ghost cells at the coarse/fine * boundary only. Then one can manually call FillBoundary to fill the other * ghost cells, and use the physical BC functor to handle the physical - * boundeary. + * boundary. * * The communication of the coarse data needed for spatial interpolation is * optimized at the cost of being error-prone. One must follow the @@ -42,7 +42,7 @@ namespace amrex { * * (3) When to destroy? Usually, we do time steppig on a coarse level * first. Then we recursively do time stepping on fine levels. After the - * finer level finishes, we do reflux and averge the fine data down to the + * finer level finishes, we do reflux and average the fine data down to the * coarse level. After that we should destroy the FillPatcher object * associated with these two levels, because the coarse data stored in the * object has become outdated. For AmrCore based codes, you could use @@ -118,7 +118,7 @@ public: * \param fbc for filling fine level physical BC * \param fbccomp starting component of the fine level BC functor * \param bcs BCRec specifying physical boundary types - * \parame bcscomp starting component of the BCRec Vector. + * \param bcscomp starting component of the BCRec Vector. * \param pre_interp optional pre-interpolation hook for modifying the coarse data * \param post_interp optional post-interpolation hook for modifying the fine data */ diff --git a/Src/AmrCore/AMReX_InterpFaceRegister.H b/Src/AmrCore/AMReX_InterpFaceRegister.H index 5e9f92784e7..a63c2c23e4c 100644 --- a/Src/AmrCore/AMReX_InterpFaceRegister.H +++ b/Src/AmrCore/AMReX_InterpFaceRegister.H @@ -10,7 +10,7 @@ namespace amrex { /** * \brief InterpFaceRegister is a coarse/fine boundary register for - * interpolation of face data at the coarse/fine boundadry. + * interpolation of face data at the coarse/fine boundary. */ class InterpFaceRegister @@ -31,7 +31,7 @@ public: Geometry const& fgeom, IntVect const& ref_ratio); /** - * \brief Defines an InterpFaceRegister objecct. + * \brief Defines an InterpFaceRegister object. * * \param fba The fine level BoxArray * \param fdm The fine level DistributionMapping diff --git a/Src/Base/AMReX_BCRec.H b/Src/Base/AMReX_BCRec.H index c39634cfb09..268147a3a04 100644 --- a/Src/Base/AMReX_BCRec.H +++ b/Src/Base/AMReX_BCRec.H @@ -43,7 +43,7 @@ public: {} /* * \brief Yet another constructor. Inherits bndry types from bc_domain - * when bx lies on edge of domain otherwise gets interior Dirchlet. + * when bx lies on edge of domain otherwise gets interior Dirichlet. */ AMREX_GPU_HOST_DEVICE BCRec (const Box& bx, diff --git a/Src/Base/AMReX_FArrayBox.H b/Src/Base/AMReX_FArrayBox.H index 084b38ce46b..b6dc4e887c8 100644 --- a/Src/Base/AMReX_FArrayBox.H +++ b/Src/Base/AMReX_FArrayBox.H @@ -116,7 +116,7 @@ public: * \brief Pure virtual function. Derived classes MUST override this * function to skip over the next FAB f in the istream, under the * assumption that the header for the FAB f has already been - * skpped over. + * skipped over. */ virtual void skip (std::istream& is, FArrayBox& f) const = 0; diff --git a/Src/Base/AMReX_FabArray.H b/Src/Base/AMReX_FabArray.H index e507dab153b..96efc1f18fa 100644 --- a/Src/Base/AMReX_FabArray.H +++ b/Src/Base/AMReX_FabArray.H @@ -339,7 +339,7 @@ public: /** * \brief Construct an empty FabArray that has a default Arena. If - * `define` is called later with a nulltpr as MFInfo's arena, the + * `define` is called later with a nullptr as MFInfo's arena, the * default Arena `a` will be used. If the arena in MFInfo is not a * nullptr, the MFInfo's arena will be used. */ @@ -2827,7 +2827,7 @@ template void FabArray::shift (const IntVect& v) { - clearThisBD(); // The new boxarry will have a different ID. + clearThisBD(); // The new boxarray will have a different ID. boxarray.shift(v); addThisBD(); #ifdef AMREX_USE_OMP diff --git a/Src/Base/AMReX_MultiFab.H b/Src/Base/AMReX_MultiFab.H index 416c4540da5..1a6c1d7f15f 100644 --- a/Src/Base/AMReX_MultiFab.H +++ b/Src/Base/AMReX_MultiFab.H @@ -50,7 +50,7 @@ public: /** * \brief Constructs an empty MultiFab. Data can be defined at a later * time using the define member functions inherited from FabArray. If - * `define` is called later with a nulltpr as MFInfo's arena, the default + * `define` is called later with a nullptr as MFInfo's arena, the default * Arena `a` will be used. If the arena in MFInfo is not a nullptr, the * MFInfo's arena will be used. */ @@ -60,7 +60,7 @@ public: * \brief * Constructs a MultiFab * \param bs a valid region - * \param dm a DistribuionMapping + * \param dm a DistributionMapping * \param ncomp number of components * \param ngrow number of cells the region grows * \param info MFInfo diff --git a/Src/Base/AMReX_MultiFabUtil.H b/Src/Base/AMReX_MultiFabUtil.H index ad1fa669f32..064b8a1b19f 100644 --- a/Src/Base/AMReX_MultiFabUtil.H +++ b/Src/Base/AMReX_MultiFabUtil.H @@ -375,7 +375,7 @@ namespace amrex void FillRandom (MultiFab& mf, int scomp, int ncomp); /** - * \brief Fill MultiFab with random numbers from nornmal distribution + * \brief Fill MultiFab with random numbers from normal distribution * * All cells including ghost cells are filled. * diff --git a/Src/Base/AMReX_MultiFabUtil.cpp b/Src/Base/AMReX_MultiFabUtil.cpp index 93ba453cc07..5520c6164d7 100644 --- a/Src/Base/AMReX_MultiFabUtil.cpp +++ b/Src/Base/AMReX_MultiFabUtil.cpp @@ -477,7 +477,7 @@ namespace amrex auto tmptype = type; tmptype.set(dir); if (dir >= AMREX_SPACEDIM || !tmptype.nodeCentered()) { - amrex::Abort("average_down_edges: not face index type"); + amrex::Abort("average_down_edges: not edge index type"); } const int ncomp = crse.nComp(); if (isMFIterSafe(fine, crse)) diff --git a/Src/Base/AMReX_iMultiFab.H b/Src/Base/AMReX_iMultiFab.H index 519ab9c82a5..eb1e350433a 100644 --- a/Src/Base/AMReX_iMultiFab.H +++ b/Src/Base/AMReX_iMultiFab.H @@ -24,7 +24,7 @@ namespace amrex { * member functions are defined for I/O and simple arithmetic operations on * these aggregate objects. * -8 This class does NOT provide a copy constructor or assignment operator. +* This class does NOT provide a copy constructor or assignment operator. */ class iMultiFab : @@ -42,7 +42,7 @@ public: /** * \brief Constructs an empty iMultiFab. Data can be defined at a later * time using the define member functions inherited from FabArray. If - * `define` is called later with a nulltpr as MFInfo's arena, the default + * `define` is called later with a nullptr as MFInfo's arena, the default * Arena `a` will be used. If the arena in MFInfo is not a nullptr, the * MFInfo's arena will be used. */ diff --git a/Src/EB/AMReX_EB_utils.cpp b/Src/EB/AMReX_EB_utils.cpp index 948a3d5db20..857a8eb08a8 100644 --- a/Src/EB/AMReX_EB_utils.cpp +++ b/Src/EB/AMReX_EB_utils.cpp @@ -31,7 +31,7 @@ facets_nearest_pt (IntVect const& ind_pt, IntVect const& ind_loop, RealVect cons RealVect const& eb_normal, RealVect const& eb_p0, GpuArray const& dx) { - // Enumerate the possible EB facet edges invovlved. + // Enumerate the possible EB facet edges involved. int n_facets = 0; IntVect ind_facets {AMREX_D_DECL(0, 0, 0)}; for (int d = 0; d < AMREX_SPACEDIM; ++d) { diff --git a/Src/F_Interfaces/Base/AMReX_parallel_mod.F90 b/Src/F_Interfaces/Base/AMReX_parallel_mod.F90 index 00fcc275c89..68cf647ff7f 100644 --- a/Src/F_Interfaces/Base/AMReX_parallel_mod.F90 +++ b/Src/F_Interfaces/Base/AMReX_parallel_mod.F90 @@ -71,7 +71,7 @@ subroutine amrex_parallel_init (comm) if (present(comm) .and. .not.flag) then if (comm .ne. MPI_COMM_WORLD) then - stop "MPI has not been initialized. How come we are given a communciator?" + stop "MPI has not been initialized. How come we are given a communicator?" endif end if diff --git a/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H b/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H index 5c90a4e21ff..cc9c361e916 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H @@ -72,7 +72,7 @@ public: /** * Sets alpha as a scalar field to values from a single component - * mutlifab. + * multifab. * * \param [in] amrlev The level of the multifab for the solver, with * \p amrlev = 0 always being the lowest level in the @@ -88,12 +88,12 @@ public: /** * Sets alpha as a single scalar constant value across - * the mutlifab. + * the multifab. * * \param [in] amrlev The level of the multifab for the solver, with * \p amrlev = 0 always being the lowest level in the * AMR hierarchy represented in the solve. - * \param [in] alpha Single scalar value to populate across mutlifab. + * \param [in] alpha Single scalar value to populate across multifab. */ template , @@ -118,12 +118,12 @@ public: /** * Sets beta as a single scalar constant value across - * the mutlifabs (one for each dimension). + * the multifabs (one for each dimension). * * \param [in] amrlev The level of the multifab for the solver, with * \p amrlev = 0 always being the lowest level in the * AMR hierarchy represented in the solve. - * \param [in] beta Single scalar value to populate across mutlifabs. + * \param [in] beta Single scalar value to populate across multifabs. */ template , diff --git a/Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.H b/Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.H index 0c4937d2de5..05b3250caf8 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.H @@ -18,7 +18,7 @@ namespace amrex { // where phi and rhs are nodal multifab, and sigma is a tensor constant // with only diagonal components. The EB is assumed to be Dirichlet. // -// del dot (simga grad phi) - alpha/r^2 phi = rhs, for RZ where alpha is a +// del dot (sigma grad phi) - alpha/r^2 phi = rhs, for RZ where alpha is a // scalar constant that is zero by default. class MLEBNodeFDLaplacian diff --git a/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H b/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H index a889f7514af..b8aa71eebd0 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H @@ -287,7 +287,7 @@ public: * \param famrlev fine AMR level * \param fine fine level data * \param crse coarse level data - * \parame nghost number of ghost cells + * \param nghost number of ghost cells */ virtual void interpolationAmr (int famrlev, MF& fine, const MF& crse, IntVect const& nghost) const = 0; diff --git a/Src/LinearSolvers/MLMG/AMReX_MLMG.H b/Src/LinearSolvers/MLMG/AMReX_MLMG.H index f1fed2d3db3..70e7e121486 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLMG.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLMG.H @@ -1370,7 +1370,7 @@ MLMGT::mgFcycle () } } -// At the true bottom of the coarset AMR level. +// At the true bottom of the coarsest AMR level. // in : Residual (res) as b // out : Correction (cor) as x template diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H index d1ae9e0b7ed..32c75224e78 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H @@ -2406,7 +2406,7 @@ void mlndlap_fillijmat_aa_cpu (Box const& ndbx, Real f2xmy = Real(2.0)*facx - facy; Real fmx2y = Real(2.0)*facy - facx; - // Note that ccdom has been grown at peridoci boundaries. + // Note that ccdom has been grown at periodic boundaries. const Box& nddom = amrex::surroundingNodes(ccdom); constexpr auto gidmax = std::numeric_limits::max(); @@ -2552,7 +2552,7 @@ void mlndlap_fillijmat_ha_cpu (Box const& ndbx, Real facx = Real(1.0/6.0)*dxinv[0]*dxinv[0]; Real facy = Real(1.0/6.0)*dxinv[1]*dxinv[1]; - // Note that ccdom has been grown at peridoci boundaries. + // Note that ccdom has been grown at periodic boundaries. const Box& nddom = amrex::surroundingNodes(ccdom); constexpr auto gidmax = std::numeric_limits::max(); @@ -2708,7 +2708,7 @@ void mlndlap_fillijmat_cs_cpu (Box const& ndbx, Real f2xmy = Real(2.0)*facx - facy; Real fmx2y = Real(2.0)*facy - facx; - // Note that ccdom has been grown at peridoci boundaries. + // Note that ccdom has been grown at periodic boundaries. const Box& nddom = amrex::surroundingNodes(ccdom); constexpr auto gidmax = std::numeric_limits::max(); @@ -3355,7 +3355,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int fp = fm = Real(0.0); } - // Note that nddom has been grown at peridoci boundaries. + // Note that nddom has been grown at periodic boundaries. const Box& nddom = amrex::surroundingNodes(ccdom); constexpr auto gidmax = std::numeric_limits::max(); diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.H b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.H index adbf00da231..bb2ec8dd4f5 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.H @@ -6,7 +6,7 @@ namespace amrex { -// del dot (sigma grah phi) = rhs +// del dot (sigma grad phi) = rhs // where phi and rhs are nodal, and sigma is cell-centered. class MLNodeLaplacian diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.cpp b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.cpp index 4a749a1ed08..d96e183af4d 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.cpp @@ -947,7 +947,7 @@ MLNodeLaplacian::checkPoint (std::string const& file_name) const HeaderFile.precision(17); - // MLLinop stuff + // MLLinOp stuff HeaderFile << "verbose = " << verbose << "\n" << "nlevs = " << NAMRLevels() << "\n" << "do_agglomeration = " << info.do_agglomeration << "\n" diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.cpp b/Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.cpp index 0fb9e2ba33b..41b52833e2c 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.cpp @@ -234,7 +234,7 @@ void MLNodeLinOp_set_dot_mask (MultiFab& dot_mask, iMultiFab const& omask, Geome Box nddomain = amrex::surroundingNodes(geom.Domain()); if (strategy != MLNodeLinOp::CoarseningStrategy::Sigma) { - nddomain.grow(1000); // hack to avoid masks being modified at Neuman boundary + nddomain.grow(1000); // hack to avoid masks being modified at Neumann boundary } #ifdef AMREX_USE_OMP