OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <AmrMultiGridLevel.h>
Public Types | |
enum | Mask { COVERED = -1 , INTERIOR = 0 , BNDRY = 1 , PHYSBNDRY = 2 } |
enum | Refined { YES = 0 , NO = 1 } |
typedef amr::AmrField_t | AmrField_t |
typedef amr::AmrGeometry_t | AmrGeometry_t |
typedef std::unique_ptr< AmrField_t > | AmrField_u |
typedef std::shared_ptr< AmrField_t > | AmrField_s |
typedef amr::AmrIntVect_t | AmrIntVect_t |
typedef MatrixType | matrix_t |
typedef VectorType | vector_t |
typedef amrex::BaseFab< int > | basefab_t |
typedef amrex::FabArray< basefab_t > | mask_t |
typedef std::shared_ptr< AmrBoundary< AmrMultiGridLevel< MatrixType, VectorType > > > | boundary_t |
typedef amr::comm_t | comm_t |
typedef amr::dmap_t | dmap_t |
typedef amr::global_ordinal_t | go_t |
typedef amr::scalar_t | scalar_t |
typedef amr::local_ordinal_t | lo_t |
typedef std::vector< go_t > | indices_t |
Type for matrix indices. More... | |
typedef std::vector< scalar_t > | coefficients_t |
Type for matrix entries. More... | |
typedef std::unordered_map< go_t, scalar_t > | umap_t |
Public Member Functions | |
AmrMultiGridLevel (const Vector_t &meshScaling, const amrex::BoxArray &_grids, const amrex::DistributionMapping &_dmap, const AmrGeometry_t &_geom, const AmrIntVect_t &rr, const boundary_t *bc, const Teuchos::RCP< comm_t > &comm) | |
~AmrMultiGridLevel () | |
go_t | serialize (const AmrIntVect_t &iv) const |
bool | isBoundary (const AmrIntVect_t &iv) const |
bool | applyBoundary (const AmrIntVect_t &iv, umap_t &map, const scalar_t &value) |
bool | applyBoundary (const AmrIntVect_t &iv, const basefab_t &fab, umap_t &map, const scalar_t &value) |
void | applyBoundary (const AmrIntVect_t &iv, const lo_t &dir, umap_t &map, const scalar_t &value) |
const AmrIntVect_t & | refinement () const |
const scalar_t * | cellSize () const |
const scalar_t & | cellSize (lo_t dir) const |
const scalar_t * | invCellSize () const |
const scalar_t & | invCellSize (lo_t dir) const |
bool | isValid (const AmrIntVect_t &iv) const |
void | buildLevelMask () |
Public Attributes | |
const amrex::BoxArray & | grids |
boxes of this level More... | |
const amrex::DistributionMapping & | dmap |
AMReX core distribution map. More... | |
const AmrGeometry_t & | geom |
geometry of this problem More... | |
Teuchos::RCP< dmap_t > | map_p |
Tpetra core map. More... | |
Teuchos::RCP< matrix_t > | Anf_p |
no fine Poisson matrix More... | |
Teuchos::RCP< matrix_t > | R_p |
restriction matrix More... | |
Teuchos::RCP< matrix_t > | I_p |
interpolation matrix More... | |
Teuchos::RCP< matrix_t > | Bcrse_p |
boundary from coarse cells More... | |
Teuchos::RCP< matrix_t > | Bfine_p |
boundary from fine cells More... | |
Teuchos::RCP< matrix_t > | Awf_p |
composite Poisson matrix More... | |
Teuchos::RCP< matrix_t > | G_p [AMREX_SPACEDIM] |
gradient matrices in x, y, and z to compute electric field More... | |
Teuchos::RCP< vector_t > | rho_p |
charge density More... | |
Teuchos::RCP< vector_t > | phi_p |
potential vector More... | |
Teuchos::RCP< vector_t > | residual_p |
residual over all cells More... | |
Teuchos::RCP< vector_t > | error_p |
error over all cells More... | |
Teuchos::RCP< matrix_t > | UnCovered_p |
uncovered cells More... | |
std::unique_ptr< mask_t > | mask |
interior, phys boundary, interface, covered More... | |
std::unique_ptr< mask_t > | refmask |
covered (i.e. refined) or not-covered More... | |
std::unique_ptr< mask_t > | crsemask |
Private Member Functions | |
void | buildMap (const Teuchos::RCP< comm_t > &comm) |
Private Attributes | |
go_t | nr_m [AMREX_SPACEDIM] |
number of grid points More... | |
AmrIntVect_t | rr_m |
refinement More... | |
boundary_t | bc_mp [AMREX_SPACEDIM] |
boundary conditions More... | |
scalar_t | dx_m [AMREX_SPACEDIM] |
cell size in particle rest frame More... | |
scalar_t | invdx_m [AMREX_SPACEDIM] |
inverse cell size in particle rest frame More... | |
Definition at line 36 of file AmrMultiGridLevel.h.
typedef std::shared_ptr<AmrField_t> AmrMultiGridLevel< MatrixType, VectorType >::AmrField_s |
Definition at line 42 of file AmrMultiGridLevel.h.
typedef amr::AmrField_t AmrMultiGridLevel< MatrixType, VectorType >::AmrField_t |
Definition at line 39 of file AmrMultiGridLevel.h.
typedef std::unique_ptr<AmrField_t> AmrMultiGridLevel< MatrixType, VectorType >::AmrField_u |
Definition at line 41 of file AmrMultiGridLevel.h.
typedef amr::AmrGeometry_t AmrMultiGridLevel< MatrixType, VectorType >::AmrGeometry_t |
Definition at line 40 of file AmrMultiGridLevel.h.
typedef amr::AmrIntVect_t AmrMultiGridLevel< MatrixType, VectorType >::AmrIntVect_t |
Definition at line 43 of file AmrMultiGridLevel.h.
typedef amrex::BaseFab<int> AmrMultiGridLevel< MatrixType, VectorType >::basefab_t |
Definition at line 46 of file AmrMultiGridLevel.h.
typedef std::shared_ptr<AmrBoundary<AmrMultiGridLevel<MatrixType, VectorType > > > AmrMultiGridLevel< MatrixType, VectorType >::boundary_t |
Definition at line 52 of file AmrMultiGridLevel.h.
typedef std::vector<scalar_t> AmrMultiGridLevel< MatrixType, VectorType >::coefficients_t |
Type for matrix entries.
Definition at line 64 of file AmrMultiGridLevel.h.
typedef amr::comm_t AmrMultiGridLevel< MatrixType, VectorType >::comm_t |
Definition at line 54 of file AmrMultiGridLevel.h.
typedef amr::dmap_t AmrMultiGridLevel< MatrixType, VectorType >::dmap_t |
Definition at line 55 of file AmrMultiGridLevel.h.
typedef amr::global_ordinal_t AmrMultiGridLevel< MatrixType, VectorType >::go_t |
Definition at line 56 of file AmrMultiGridLevel.h.
typedef std::vector<go_t> AmrMultiGridLevel< MatrixType, VectorType >::indices_t |
Type for matrix indices.
Definition at line 61 of file AmrMultiGridLevel.h.
typedef amr::local_ordinal_t AmrMultiGridLevel< MatrixType, VectorType >::lo_t |
Definition at line 58 of file AmrMultiGridLevel.h.
typedef amrex::FabArray<basefab_t> AmrMultiGridLevel< MatrixType, VectorType >::mask_t |
Definition at line 47 of file AmrMultiGridLevel.h.
typedef MatrixType AmrMultiGridLevel< MatrixType, VectorType >::matrix_t |
Definition at line 44 of file AmrMultiGridLevel.h.
typedef amr::scalar_t AmrMultiGridLevel< MatrixType, VectorType >::scalar_t |
Definition at line 57 of file AmrMultiGridLevel.h.
typedef std::unordered_map<go_t, scalar_t> AmrMultiGridLevel< MatrixType, VectorType >::umap_t |
Definition at line 67 of file AmrMultiGridLevel.h.
typedef VectorType AmrMultiGridLevel< MatrixType, VectorType >::vector_t |
Definition at line 45 of file AmrMultiGridLevel.h.
enum AmrMultiGridLevel::Mask |
Enumerator | |
---|---|
COVERED | |
INTERIOR | |
BNDRY | |
PHYSBNDRY |
Definition at line 75 of file AmrMultiGridLevel.h.
enum AmrMultiGridLevel::Refined |
Enumerator | |
---|---|
YES | |
NO |
Definition at line 84 of file AmrMultiGridLevel.h.
AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel | ( | const Vector_t & | meshScaling, |
const amrex::BoxArray & | _grids, | ||
const amrex::DistributionMapping & | _dmap, | ||
const AmrGeometry_t & | _geom, | ||
const AmrIntVect_t & | rr, | ||
const boundary_t * | bc, | ||
const Teuchos::RCP< comm_t > & | comm | ||
) |
mesh | scaling due to particle rest frame |
_grids | of this level |
_dmap | AMReX core distribution map |
_geom | of domain |
rr | refinement ratio |
bc | physical boundaries (x, y, z) |
comm | MPI communicator |
Definition at line 27 of file AmrMultiGridLevel.hpp.
References AmrMultiGridLevel< MatrixType, VectorType >::bc_mp, AmrMultiGridLevel< MatrixType, VectorType >::buildLevelMask(), AmrMultiGridLevel< MatrixType, VectorType >::buildMap(), AmrMultiGridLevel< MatrixType, VectorType >::dx_m, AmrMultiGridLevel< MatrixType, VectorType >::error_p, AmrMultiGridLevel< MatrixType, VectorType >::G_p, AmrMultiGridLevel< MatrixType, VectorType >::geom, AmrMultiGridLevel< MatrixType, VectorType >::invdx_m, AmrMultiGridLevel< MatrixType, VectorType >::map_p, AmrMultiGridLevel< MatrixType, VectorType >::nr_m, and AmrMultiGridLevel< MatrixType, VectorType >::residual_p.
AmrMultiGridLevel< MatrixType, VectorType >::~AmrMultiGridLevel |
Definition at line 82 of file AmrMultiGridLevel.hpp.
bool AmrMultiGridLevel< MatrixType, VectorType >::applyBoundary | ( | const AmrIntVect_t & | iv, |
const basefab_t & | fab, | ||
umap_t & | map, | ||
const scalar_t & | value | ||
) |
Slightly faster version of apply().
iv | is the cell where we want to have the boundary value |
fab | is the mask |
map | with indices global matrix indices and matrix values |
value | matrix entry (coefficients) @precondition Basefab needs to be a mask with AmrMultiGridLevel::Mask::PHYSBNDRY |
Definition at line 140 of file AmrMultiGridLevel.hpp.
void AmrMultiGridLevel< MatrixType, VectorType >::applyBoundary | ( | const AmrIntVect_t & | iv, |
const lo_t & | dir, | ||
umap_t & | map, | ||
const scalar_t & | value | ||
) |
Apply boundary in a certain direction.
iv | is the cell where we want to have the boundary value |
dir | direction of physical / mesh boundary |
map | with indices global matrix indices and matrix values |
value | matrix entry (coefficients) |
Definition at line 160 of file AmrMultiGridLevel.hpp.
bool AmrMultiGridLevel< MatrixType, VectorType >::applyBoundary | ( | const AmrIntVect_t & | iv, |
umap_t & | map, | ||
const scalar_t & | value | ||
) |
Checks all directions if physical / mesh boundary.
iv | is the cell where we want to have the boundary value |
map | with indices global matrix indices and matrix values |
value | matrix entry (coefficients) |
Definition at line 124 of file AmrMultiGridLevel.hpp.
void AmrMultiGridLevel< MatrixType, VectorType >::buildLevelMask |
Build a mask specifying if a grid point is covered, an interior cell, at physical boundary or at interior boundary
Definition at line 170 of file AmrMultiGridLevel.hpp.
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel().
|
private |
Build Tpetra::Map of this level
comm | MPI communicator |
Definition at line 218 of file AmrMultiGridLevel.hpp.
References serialize().
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel().
const amr::scalar_t * AmrMultiGridLevel< MatrixType, VectorType >::cellSize |
Definition at line 187 of file AmrMultiGridLevel.hpp.
const amr::scalar_t & AmrMultiGridLevel< MatrixType, VectorType >::cellSize | ( | lo_t | dir | ) | const |
Definition at line 193 of file AmrMultiGridLevel.hpp.
const amr::scalar_t * AmrMultiGridLevel< MatrixType, VectorType >::invCellSize |
Definition at line 199 of file AmrMultiGridLevel.hpp.
const amr::scalar_t & AmrMultiGridLevel< MatrixType, VectorType >::invCellSize | ( | lo_t | dir | ) | const |
Definition at line 205 of file AmrMultiGridLevel.hpp.
bool AmrMultiGridLevel< MatrixType, VectorType >::isBoundary | ( | const AmrIntVect_t & | iv | ) | const |
Checks if grid point is on the physical / mesh boundary
iv | grid point (i, j, k) |
Definition at line 117 of file AmrMultiGridLevel.hpp.
bool AmrMultiGridLevel< MatrixType, VectorType >::isValid | ( | const AmrIntVect_t & | iv | ) | const |
Check if a cell on that level is valid
iv | is the cell |
Definition at line 211 of file AmrMultiGridLevel.hpp.
const amr::AmrIntVect_t & AmrMultiGridLevel< MatrixType, VectorType >::refinement |
Definition at line 181 of file AmrMultiGridLevel.hpp.
AmrMultiGridLevel< MatrixType, VectorType >::go_t AmrMultiGridLevel< MatrixType, VectorType >::serialize | ( | const AmrIntVect_t & | iv | ) | const |
Map a 2D / 3D grid point to an array index
iv | grid point (i, j, k) |
Definition at line 107 of file AmrMultiGridLevel.hpp.
Teuchos::RCP<matrix_t> AmrMultiGridLevel< MatrixType, VectorType >::Anf_p |
no fine Poisson matrix
Definition at line 208 of file AmrMultiGridLevel.h.
Teuchos::RCP<matrix_t> AmrMultiGridLevel< MatrixType, VectorType >::Awf_p |
composite Poisson matrix
Definition at line 213 of file AmrMultiGridLevel.h.
|
private |
boundary conditions
Definition at line 233 of file AmrMultiGridLevel.h.
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel().
Teuchos::RCP<matrix_t> AmrMultiGridLevel< MatrixType, VectorType >::Bcrse_p |
boundary from coarse cells
Definition at line 211 of file AmrMultiGridLevel.h.
Teuchos::RCP<matrix_t> AmrMultiGridLevel< MatrixType, VectorType >::Bfine_p |
boundary from fine cells
Definition at line 212 of file AmrMultiGridLevel.h.
std::unique_ptr<mask_t> AmrMultiGridLevel< MatrixType, VectorType >::crsemask |
Definition at line 226 of file AmrMultiGridLevel.h.
const amrex::DistributionMapping& AmrMultiGridLevel< MatrixType, VectorType >::dmap |
AMReX core distribution map.
Definition at line 203 of file AmrMultiGridLevel.h.
|
private |
cell size in particle rest frame
Definition at line 235 of file AmrMultiGridLevel.h.
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel().
Teuchos::RCP<vector_t> AmrMultiGridLevel< MatrixType, VectorType >::error_p |
error over all cells
Definition at line 221 of file AmrMultiGridLevel.h.
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel().
Teuchos::RCP<matrix_t> AmrMultiGridLevel< MatrixType, VectorType >::G_p[AMREX_SPACEDIM] |
gradient matrices in x, y, and z to compute electric field
Definition at line 216 of file AmrMultiGridLevel.h.
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel().
const AmrGeometry_t& AmrMultiGridLevel< MatrixType, VectorType >::geom |
geometry of this problem
Definition at line 204 of file AmrMultiGridLevel.h.
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel().
const amrex::BoxArray& AmrMultiGridLevel< MatrixType, VectorType >::grids |
boxes of this level
Definition at line 202 of file AmrMultiGridLevel.h.
Teuchos::RCP<matrix_t> AmrMultiGridLevel< MatrixType, VectorType >::I_p |
interpolation matrix
Definition at line 210 of file AmrMultiGridLevel.h.
|
private |
inverse cell size in particle rest frame
Definition at line 236 of file AmrMultiGridLevel.h.
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel().
Teuchos::RCP<dmap_t> AmrMultiGridLevel< MatrixType, VectorType >::map_p |
Tpetra core map.
Definition at line 206 of file AmrMultiGridLevel.h.
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel().
std::unique_ptr<mask_t> AmrMultiGridLevel< MatrixType, VectorType >::mask |
interior, phys boundary, interface, covered
Definition at line 224 of file AmrMultiGridLevel.h.
|
private |
number of grid points
Definition at line 229 of file AmrMultiGridLevel.h.
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel().
Teuchos::RCP<vector_t> AmrMultiGridLevel< MatrixType, VectorType >::phi_p |
potential vector
Definition at line 219 of file AmrMultiGridLevel.h.
Teuchos::RCP<matrix_t> AmrMultiGridLevel< MatrixType, VectorType >::R_p |
restriction matrix
Definition at line 209 of file AmrMultiGridLevel.h.
std::unique_ptr<mask_t> AmrMultiGridLevel< MatrixType, VectorType >::refmask |
covered (i.e. refined) or not-covered
Definition at line 225 of file AmrMultiGridLevel.h.
Teuchos::RCP<vector_t> AmrMultiGridLevel< MatrixType, VectorType >::residual_p |
residual over all cells
Definition at line 220 of file AmrMultiGridLevel.h.
Referenced by AmrMultiGridLevel< MatrixType, VectorType >::AmrMultiGridLevel().
Teuchos::RCP<vector_t> AmrMultiGridLevel< MatrixType, VectorType >::rho_p |
charge density
Definition at line 218 of file AmrMultiGridLevel.h.
|
private |
refinement
Definition at line 231 of file AmrMultiGridLevel.h.
Teuchos::RCP<matrix_t> AmrMultiGridLevel< MatrixType, VectorType >::UnCovered_p |
uncovered cells
Definition at line 222 of file AmrMultiGridLevel.h.