1 #ifndef AMREX_MLEBNODEFDLAPLACIAN_H_
2 #define AMREX_MLEBNODEFDLAPLACIAN_H_
3 #include <AMReX_Config.H>
58 void setRZ (
bool flag);
65 void setEBDirichlet (Real a_phi_eb);
69 setEBDirichlet (F
const&
f);
77 [[nodiscard]] std::unique_ptr<FabFactory<FArrayBox> >
makeFactory (
int amrlev,
int mglev)
const final;
88 [[nodiscard]] std::string
name ()
const override {
return std::string(
"MLEBNodeFDLaplacian"); }
100 [[nodiscard]]
bool isSingular (
int) const final {
return false; }
106 #if defined(AMREX_USE_HYPRE) && (AMREX_SPACEDIM > 1)
107 void fillIJMatrix (
MFIter const& mfi,
112 Real* mat)
const override;
114 void fillRHS (
MFIter const& mfi,
134 template <
typename F>
136 MLEBNodeFDLaplacian::setEBDirichlet (F
const&
f)
148 auto const& flags = factory->getMultiEBCellFlagFab();
149 auto const& levset = factory->getLevelSet();
151 #pragma omp parallel if (Gpu::notInLaunchRegion())
155 const Box& ndbx = mfi.growntilebox();
156 const auto& flag = flags[mfi];
162 if (lstarr(i,j,k) >= Real(0.0)) {
164 problo[1]+j*cellsize[1],
165 problo[2]+k*cellsize[2]));
#define AMREX_HOST_DEVICE_FOR_3D(...)
Definition: AMReX_GpuLaunch.nolint.H:50
Array4< Real > fine
Definition: AMReX_InterpFaceRegister.cpp:90
Array4< Real const > crse
Definition: AMReX_InterpFaceRegister.cpp:92
#define AMREX_D_DECL(a, b, c)
Definition: AMReX_SPACE.H:104
GpuArray< Real, AMREX_SPACEDIM > CellSizeArray() const noexcept
Definition: AMReX_CoordSys.H:76
Definition: AMReX_EBFabFactory.H:22
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
GpuArray< Real, AMREX_SPACEDIM > ProbLoArray() const noexcept
Definition: AMReX_Geometry.H:186
HYPRE_Int Int
Definition: AMReX_HypreNodeLap.H:36
Definition: AMReX_MFIter.H:57
bool isValid() const noexcept
Is the iterator valid i.e. is it associated with a FAB?
Definition: AMReX_MFIter.H:141
Definition: AMReX_MLEBNodeFDLaplacian.H:29
void restriction(int amrlev, int cmglev, MultiFab &crse, MultiFab &fine) const final
Definition: AMReX_MLEBNodeFDLaplacian.cpp:167
std::string name() const override
Definition: AMReX_MLEBNodeFDLaplacian.H:88
bool isBottomSingular() const final
Is the bottom of MG singular?
Definition: AMReX_MLEBNodeFDLaplacian.H:101
void postSolve(Vector< MultiFab > &sol) const override
Definition: AMReX_MLEBNodeFDLaplacian.cpp:754
int m_rz
Definition: AMReX_MLEBNodeFDLaplacian.H:128
void Fsmooth(int amrlev, int mglev, MultiFab &sol, const MultiFab &rhs) const final
Definition: AMReX_MLEBNodeFDLaplacian.cpp:521
void interpolation(int amrlev, int fmglev, MultiFab &fine, const MultiFab &crse) const final
Definition: AMReX_MLEBNodeFDLaplacian.cpp:214
void setAlpha(Real a_alpha)
Definition: AMReX_MLEBNodeFDLaplacian.cpp:67
MLEBNodeFDLaplacian(const MLEBNodeFDLaplacian &)=delete
MLEBNodeFDLaplacian()=default
Real m_rz_alpha
Definition: AMReX_MLEBNodeFDLaplacian.H:129
void setRZ(bool flag)
Definition: AMReX_MLEBNodeFDLaplacian.cpp:57
GpuArray< Real, AMREX_SPACEDIM > m_sigma
Definition: AMReX_MLEBNodeFDLaplacian.H:123
void Fapply(int amrlev, int mglev, MultiFab &out, const MultiFab &in) const final
Definition: AMReX_MLEBNodeFDLaplacian.cpp:398
void define(const Vector< Geometry > &a_geom, const Vector< BoxArray > &a_grids, const Vector< DistributionMapping > &a_dmap, const LPInfo &a_info)
Definition: AMReX_MLEBNodeFDLaplacian.cpp:123
MLEBNodeFDLaplacian & operator=(const MLEBNodeFDLaplacian &)=delete
Vector< MultiFab > m_phi_eb
Definition: AMReX_MLEBNodeFDLaplacian.H:127
void setSigma(Array< Real, AMREX_SPACEDIM > const &a_sigma) noexcept
Definition: AMReX_MLEBNodeFDLaplacian.cpp:36
void normalize(int amrlev, int mglev, MultiFab &mf) const final
Definition: AMReX_MLEBNodeFDLaplacian.cpp:626
MLEBNodeFDLaplacian(MLEBNodeFDLaplacian &&)=delete
Real m_s_phi_eb
Definition: AMReX_MLEBNodeFDLaplacian.H:126
void prepareForSolve() final
Definition: AMReX_MLEBNodeFDLaplacian.cpp:258
void compGrad(int amrlev, const Array< MultiFab *, AMREX_SPACEDIM > &grad, MultiFab &sol, Location) const override
Definition: AMReX_MLEBNodeFDLaplacian.cpp:638
~MLEBNodeFDLaplacian() override=default
bool m_has_sigma_mf
Definition: AMReX_MLEBNodeFDLaplacian.H:125
Vector< Vector< std::unique_ptr< MultiFab > > > m_sigma_mf
Definition: AMReX_MLEBNodeFDLaplacian.H:124
void fixUpResidualMask(int amrlev, iMultiFab &resmsk) final
Definition: AMReX_MLEBNodeFDLaplacian.cpp:632
bool isSingular(int) const final
Is it singular on given AMR level?
Definition: AMReX_MLEBNodeFDLaplacian.H:100
Vector< Vector< std::unique_ptr< FabFactory< FAB > > > > m_factory
Definition: AMReX_MLLinOp.H:601
Vector< Vector< BoxArray > > m_grids
Definition: AMReX_MLLinOp.H:599
virtual std::unique_ptr< FabFactory< FAB > > makeFactory(int, int) const
Definition: AMReX_MLLinOp.H:689
Vector< Vector< DistributionMapping > > m_dmap
Definition: AMReX_MLLinOp.H:600
Vector< Vector< Geometry > > m_geom
first Vector is for amr level and second is mg level
Definition: AMReX_MLLinOp.H:598
LinOpEnumType::Location Location
Definition: AMReX_MLLinOp.H:114
virtual void scaleRHS(int, MF &) const
scale RHS to fix solvability
Definition: AMReX_MLLinOp.H:458
int m_num_amr_levels
Definition: AMReX_MLLinOp.H:583
Definition: AMReX_MLNodeLinOp.H:16
A collection (stored as an array) of FArrayBox objects.
Definition: AMReX_MultiFab.H:38
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition: AMReX_Vector.H:27
Definition: AMReX_iMultiFab.H:32
static int f(amrex::Real t, N_Vector y_data, N_Vector y_rhs, void *user_data)
Definition: AMReX_SundialsIntegrator.H:44
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE BoxND< dim > convert(const BoxND< dim > &b, const IntVectND< dim > &typ) noexcept
Returns a BoxND with different type.
Definition: AMReX_Box.H:1435
IntVectND< AMREX_SPACEDIM > IntVect
Definition: AMReX_BaseFwd.H:30
bool TilingIfNotGPU() noexcept
Definition: AMReX_MFIter.H:12
std::array< T, N > Array
Definition: AMReX_Array.H:24
Definition: AMReX_Array4.H:61
Test if a given type T is callable with arguments of type Args...
Definition: AMReX_TypeTraits.H:207
Definition: AMReX_MLLinOp.H:35