Block-Structured AMR Software Framework
AMReX_HypreABecLap.H
Go to the documentation of this file.
1 #ifndef AMREX_HypreABecLap_H_
2 #define AMREX_HypreABecLap_H_
3 #include <AMReX_Config.H>
4 
5 #include <AMReX_Hypre.H>
6 #include <AMReX_Array.H>
7 #include <AMReX_Geometry.H>
8 #include <AMReX_MultiFab.H>
9 #include <AMReX_BndryData.H>
10 #include <AMReX_LO_BCTYPES.H>
11 
12 #include <HYPRE_struct_ls.h>
13 
14 #include <memory>
15 
16 namespace amrex {
17 
18 class HypreABecLap final
19  : public Hypre
20 {
21 public:
22 
23  HypreABecLap (const BoxArray& grids, const DistributionMapping& dmap,
24  const Geometry& geom_, MPI_Comm comm_);
25  ~HypreABecLap () override;
26 
27  HypreABecLap (HypreABecLap const&) = delete;
28  HypreABecLap (HypreABecLap &&) = delete;
31 
32  void solve (MultiFab& soln, const MultiFab& rhs, Real reltol, Real abstol,
33  int maxiter, const BndryData& bndry, int max_bndry_order) override;
34 
35 private:
36 
37  HYPRE_StructGrid grid = nullptr;
38  HYPRE_StructMatrix A = nullptr;
39  HYPRE_StructVector b = nullptr;
40  HYPRE_StructVector x = nullptr;
41  HYPRE_StructSolver solver = nullptr;
42 
43  void getSolution (MultiFab& soln);
44 
45 public: // for cuda
46  void prepareSolver ();
47  void loadVectors (MultiFab& soln, const MultiFab& rhs);
48 };
49 
50 }
51 
52 #endif
int MPI_Comm
Definition: AMReX_ccse-mpi.H:47
A BndryData stores and manipulates boundary data information on each side of each box in a BoxArray.
Definition: AMReX_BndryData.H:41
A collection of Boxes stored in an Array.
Definition: AMReX_BoxArray.H:549
Calculates the distribution of FABs to MPI processes.
Definition: AMReX_DistributionMapping.H:41
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
Definition: AMReX_HypreABecLap.H:20
HypreABecLap(HypreABecLap &&)=delete
HYPRE_StructGrid grid
Definition: AMReX_HypreABecLap.H:37
HYPRE_StructSolver solver
Definition: AMReX_HypreABecLap.H:41
void loadVectors(MultiFab &soln, const MultiFab &rhs)
Definition: AMReX_HypreABecLap.cpp:256
HYPRE_StructVector x
Definition: AMReX_HypreABecLap.H:40
void prepareSolver()
Definition: AMReX_HypreABecLap.cpp:126
HypreABecLap(HypreABecLap const &)=delete
void solve(MultiFab &soln, const MultiFab &rhs, Real reltol, Real abstol, int maxiter, const BndryData &bndry, int max_bndry_order) override
Definition: AMReX_HypreABecLap.cpp:33
void getSolution(MultiFab &soln)
Definition: AMReX_HypreABecLap.cpp:102
~HypreABecLap() override
Definition: AMReX_HypreABecLap.cpp:18
HypreABecLap & operator=(HypreABecLap const &)=delete
HYPRE_StructMatrix A
Definition: AMReX_HypreABecLap.H:38
HypreABecLap(const BoxArray &grids, const DistributionMapping &dmap, const Geometry &geom_, MPI_Comm comm_)
Definition: AMReX_HypreABecLap.cpp:12
HYPRE_StructVector b
Definition: AMReX_HypreABecLap.H:39
Definition: AMReX_Hypre.H:18
A collection (stored as an array) of FArrayBox objects.
Definition: AMReX_MultiFab.H:38
Definition: AMReX_Amr.cpp:49