Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
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
16namespace amrex
17{
18
22class HypreABecLap2 final
23 : public Hypre
24{
25public:
26
35 HypreABecLap2 (const BoxArray& grids, const DistributionMapping& dmap,
36 const Geometry& geom_, MPI_Comm comm_);
37 ~HypreABecLap2 () override;
38
39 HypreABecLap2 (HypreABecLap2 const&) = delete;
43
55 void solve (MultiFab& soln, const MultiFab& rhs, Real reltol, Real abstol,
56 int maxiter, const BndryData& bndry, int max_bndry_order) override;
57
58private :
59
60 HYPRE_SStructGrid hgrid = nullptr;
61 HYPRE_SStructStencil stencil = nullptr;
62 HYPRE_SStructGraph graph = nullptr;
63 HYPRE_SStructMatrix A = nullptr;
64 HYPRE_SStructVector b = nullptr;
65 HYPRE_SStructVector x = nullptr;
66 HYPRE_Solver solver = nullptr;
67
68 void getSolution (MultiFab& soln);
69
70public: // for cuda
72 void prepareSolver ();
74 void loadVectors (MultiFab& soln, const MultiFab& rhs);
75};
76
77}
78
79#endif
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
Semi-structured ABecLaplacian operator built on HYPRE's SStruct API.
Definition AMReX_HypreABecLap2.H:24
void loadVectors(MultiFab &soln, const MultiFab &rhs)
Copy AMReX solution guess soln and RHS rhs into the HYPRE vectors before solving.
Definition AMReX_HypreABecLap2.cpp:290
void solve(MultiFab &soln, const MultiFab &rhs, Real reltol, Real abstol, int maxiter, const BndryData &bndry, int max_bndry_order) override
Solve (a - b div beta grad) phi = rhs via HYPRE's SStruct interface.
Definition AMReX_HypreABecLap2.cpp:38
HypreABecLap2 & operator=(HypreABecLap2 const &)=delete
HypreABecLap2(HypreABecLap2 &&)=delete
~HypreABecLap2() override
Definition AMReX_HypreABecLap2.cpp:19
HypreABecLap2(HypreABecLap2 const &)=delete
void prepareSolver()
Build the SStruct graph/matrix given the current coefficients.
Definition AMReX_HypreABecLap2.cpp:148
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