Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
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
22namespace amrex {
23
27class HypreABecLap final
28 : public Hypre
29{
30public:
31
40 HypreABecLap (const BoxArray& grids, const DistributionMapping& dmap,
41 const Geometry& geom_, MPI_Comm comm_);
42 ~HypreABecLap () override;
43
44 HypreABecLap (HypreABecLap const&) = delete;
48
60 void solve (MultiFab& soln, const MultiFab& rhs, Real reltol, Real abstol,
61 int maxiter, const BndryData& bndry, int max_bndry_order) override;
62
63private:
64
65 HYPRE_StructGrid grid = nullptr;
66 HYPRE_StructMatrix A = nullptr;
67 HYPRE_StructVector b = nullptr;
68 HYPRE_StructVector x = nullptr;
69 HYPRE_StructSolver solver = nullptr;
70
71 void getSolution (MultiFab& soln);
72
73public: // for cuda
75 void prepareSolver ();
77 void loadVectors (MultiFab& soln, const MultiFab& rhs);
78};
79
80}
81
82#endif
Boundary data container that owns masks, boundary values, and metadata.
Constants describing linear-operator boundary condition types.
A BndryData stores and manipulates boundary data information on each side of each box in a BoxArray.
Definition AMReX_BndryData.H:46
A collection of Boxes stored in an Array.
Definition AMReX_BoxArray.H:568
Calculates the distribution of FABs to MPI processes.
Definition AMReX_DistributionMapping.H:43
Rectangular problem domain geometry.
Definition AMReX_Geometry.H:74
Struct-interface HYPRE solver for (a - b div beta grad) phi = rhs.
Definition AMReX_HypreABecLap.H:29
HypreABecLap(HypreABecLap &&)=delete
HypreABecLap & operator=(HypreABecLap const &)=delete
void loadVectors(MultiFab &soln, const MultiFab &rhs)
Copy AMReX solution guess soln and RHS rhs into HYPRE vectors prior to a solve.
Definition AMReX_HypreABecLap.cpp:257
void prepareSolver()
Build the HYPRE structures and apply runtime parameters.
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
Solve the struct-interface linear system with the configured coefficients.
Definition AMReX_HypreABecLap.cpp:33
~HypreABecLap() override
Definition AMReX_HypreABecLap.cpp:18
Lightweight base class shared by HYPRE-backed linear solvers, HypreABecLap, HypreABecLap2,...
Definition AMReX_Hypre.H:33
A collection (stored as an array) of FArrayBox objects.
Definition AMReX_MultiFab.H:40
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:79
int MPI_Comm
Definition AMReX_ccse-mpi.H:51
Definition AMReX_Amr.cpp:49