Block-Structured AMR Software Framework
AMReX_HypreABecLap2.H
Go to the documentation of this file.
1 #ifndef AMREX_HYPREABECLAP2_H_
2 #define AMREX_HYPREABECLAP2_H_
3 #include <AMReX_Config.H>
4 
5 #include <AMReX_Hypre.H>
6 
7 #include "_hypre_sstruct_mv.h"
8 #include "_hypre_sstruct_ls.h"
9 
10 namespace amrex
11 {
12 
13 class HypreABecLap2 final
14  : public Hypre
15 {
16 public:
17 
18  HypreABecLap2 (const BoxArray& grids, const DistributionMapping& dmap,
19  const Geometry& geom_, MPI_Comm comm_);
20  ~HypreABecLap2 () override;
21 
22  HypreABecLap2 (HypreABecLap2 const&) = delete;
26 
27  void solve (MultiFab& soln, const MultiFab& rhs, Real reltol, Real abstol,
28  int maxiter, const BndryData& bndry, int max_bndry_order) override;
29 
30 private :
31 
32  HYPRE_SStructGrid hgrid = nullptr;
33  HYPRE_SStructStencil stencil = nullptr;
34  HYPRE_SStructGraph graph = nullptr;
35  HYPRE_SStructMatrix A = nullptr;
36  HYPRE_SStructVector b = nullptr;
37  HYPRE_SStructVector x = nullptr;
38  HYPRE_Solver solver = nullptr;
39 
40  void getSolution (MultiFab& soln);
41 
42 public: // for cuda
43  void prepareSolver ();
44  void loadVectors (MultiFab& soln, const MultiFab& rhs);
45 };
46 
47 }
48 
49 #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_HypreABecLap2.H:15
HYPRE_SStructGrid hgrid
Definition: AMReX_HypreABecLap2.H:32
HYPRE_SStructMatrix A
Definition: AMReX_HypreABecLap2.H:35
HYPRE_SStructVector x
Definition: AMReX_HypreABecLap2.H:37
HYPRE_Solver solver
Definition: AMReX_HypreABecLap2.H:38
void loadVectors(MultiFab &soln, const MultiFab &rhs)
Definition: AMReX_HypreABecLap2.cpp:289
void getSolution(MultiFab &soln)
Definition: AMReX_HypreABecLap2.cpp:119
void solve(MultiFab &soln, const MultiFab &rhs, Real reltol, Real abstol, int maxiter, const BndryData &bndry, int max_bndry_order) override
Definition: AMReX_HypreABecLap2.cpp:38
HYPRE_SStructGraph graph
Definition: AMReX_HypreABecLap2.H:34
HYPRE_SStructStencil stencil
Definition: AMReX_HypreABecLap2.H:33
HypreABecLap2(HypreABecLap2 &&)=delete
HypreABecLap2 & operator=(HypreABecLap2 const &)=delete
HypreABecLap2(const BoxArray &grids, const DistributionMapping &dmap, const Geometry &geom_, MPI_Comm comm_)
Definition: AMReX_HypreABecLap2.cpp:13
~HypreABecLap2() override
Definition: AMReX_HypreABecLap2.cpp:19
HypreABecLap2(HypreABecLap2 const &)=delete
HYPRE_SStructVector b
Definition: AMReX_HypreABecLap2.H:36
void prepareSolver()
Definition: AMReX_HypreABecLap2.cpp:148
Definition: AMReX_Hypre.H:18
A collection (stored as an array) of FArrayBox objects.
Definition: AMReX_MultiFab.H:38
Definition: AMReX_Amr.cpp:49