Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_CrossProj.H
Go to the documentation of this file.
1#ifndef AMREX_CROSS_PROJ_H_
2#define AMREX_CROSS_PROJ_H_
3#include <AMReX_Config.H>
4
5#include <AMReX_Geometry.H>
6#include <AMReX_MultiFab.H>
7#include <AMReX_iMultiFab.H>
8
9#include <memory>
10
11#if (AMREX_SPACEDIM == 2)
12
13namespace amrex::GMG
14{
15
22
34class CrossProj
35{
36public:
37
39 explicit CrossProj (Geometry const& geom);
40
41 ~CrossProj ();
42 CrossProj (CrossProj const&) = delete;
43 CrossProj (CrossProj&&) = delete;
44 CrossProj& operator= (CrossProj const&) = delete;
45 CrossProj& operator= (CrossProj&&) = delete;
46
57 void solve (MultiFab& a_soln, MultiFab const& a_rhs);
58
60 void setRelTol (Real rtol) { m_reltol = rtol; }
62 void setAbsTol (Real atol) { m_abstol = atol; }
63 void setMaxIter (int n) { m_maxiter = n; }
64 void setVerbose (int v) { m_verbose = v; }
66 [[nodiscard]] int getNumIters () const { return m_niters; }
67
68 struct Level;
69
70private:
71
72 void setup (BoxArray const& ba, DistributionMapping const& dm);
73 void precond ();
74 void vcycle (int h, int lev);
75
76 Geometry m_geom;
77 Real m_reltol = std::is_same_v<Real,float> ? Real(1.e-5) : Real(1.e-10);
78 Real m_abstol = Real(0.0);
79 int m_maxiter = 200;
80 int m_verbose = 0;
81 int m_niters = 0;
82
83 BoxArray m_grids; // cell-centered
84 DistributionMapping m_dmap;
85 bool m_reduced = false; // dx == dy: PCG on the red/black reduced problem
86 MultiFab m_vel, m_x, m_p, m_q, m_rold;
87 std::unique_ptr<Level> m_top;
88 // Coarse hierarchies: 0 for smooth modes, 1 for the checkerboard.
89 Array<Vector<std::unique_ptr<Level>>,2> m_hier;
90};
91
92}
93
94#endif
95#endif
Problem-domain geometry: maps between index space and physical space.
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:80