Discontinuous Galerkin Library
#include "dg/algorithm.h"
|
2D MPI abstract grid class More...
Public Types | |
using | value_type = real_type |
using | host_vector = MPI_Vector< thrust::host_vector< real_type > > |
The host vector type used by host functions like evaluate. More... | |
using | host_grid = RealMPIGrid2d< real_type > |
Public Member Functions | |
real_type | x0 () const |
Return global x0. More... | |
real_type | x1 () const |
Return global x1. More... | |
real_type | y0 () const |
Return global y0. More... | |
real_type | y1 () const |
Return global y1. More... | |
real_type | lx () const |
Return global lx. More... | |
real_type | ly () const |
Return global ly. More... | |
real_type | hx () const |
Return global hx. More... | |
real_type | hy () const |
Return global hy. More... | |
unsigned | n () const |
Return n. More... | |
unsigned | nx () const |
number of polynomial coefficients in x More... | |
unsigned | ny () const |
number of polynomial coefficients in y More... | |
unsigned | Nx () const |
Return the global number of cells. More... | |
unsigned | Ny () const |
Return the global number of cells. More... | |
bc | bcx () const |
global x boundary More... | |
bc | bcy () const |
global y boundary More... | |
MPI_Comm | communicator () const |
Return mpi cartesian communicator that is used in this grid. More... | |
const DLT< real_type > & | dltx () const |
discrete legendre transformation in x More... | |
const DLT< real_type > & | dlty () const |
discrete legendre transformation in y More... | |
unsigned | size () const |
The total global number of points. More... | |
unsigned | local_size () const |
The total local number of points. More... | |
void | display (std::ostream &os=std::cout) const |
Display global and local grid. More... | |
int | pidOf (real_type x, real_type y) const |
Returns the pid of the process that holds the local grid surrounding the given point. More... | |
void | multiplyCellNumbers (real_type fx, real_type fy) |
Multiply the number of cells with a given factor. More... | |
void | set (unsigned new_n, unsigned new_Nx, unsigned new_Ny) |
Set the number of polynomials and cells. More... | |
void | set (unsigned new_nx, unsigned new_Nx, unsigned new_ny, unsigned new_Ny) |
Set the number of polynomials and cells. More... | |
bool | local2globalIdx (int localIdx, int PID, int &globalIdx) const |
Map a local index plus the PID to a global vector index. More... | |
bool | global2localIdx (int globalIdx, int &localIdx, int &PID) const |
Map a global vector index to a local vector Index and the corresponding PID. More... | |
const RealGrid2d< real_type > & | local () const |
Return a non-MPI grid local for the calling process. More... | |
const RealGrid2d< real_type > & | global () const |
Return the global non-MPI grid. More... | |
Protected Member Functions | |
~aRealMPITopology2d ()=default | |
disallow deletion through base class pointer More... | |
aRealMPITopology2d (RealGrid1d< real_type > gx, RealGrid1d< real_type > gy, MPI_Comm comm) | |
Construct a 2d grid as the product of two 1d grids. More... | |
aRealMPITopology2d (const aRealMPITopology2d &src)=default | |
aRealMPITopology2d & | operator= (const aRealMPITopology2d &src)=default |
virtual void | do_set (unsigned new_nx, unsigned new_Nx, unsigned new_ny, unsigned new_Ny)=0 |
This function has an implementation. More... | |
2D MPI abstract grid class
Represents the global grid coordinates and the process topology. It just divides the given (global) box into nonoverlapping (local) subboxes that are attributed to each process
using dg::aRealMPITopology2d< real_type >::host_grid = RealMPIGrid2d<real_type> |
using dg::aRealMPITopology2d< real_type >::host_vector = MPI_Vector<thrust::host_vector<real_type> > |
The host vector type used by host functions like evaluate.
using dg::aRealMPITopology2d< real_type >::value_type = real_type |
|
protecteddefault |
disallow deletion through base class pointer
|
inlineprotected |
Construct a 2d grid as the product of two 1d grids.
gx | a Grid in x - direction |
gy | a Grid in y - direction |
comm | a two-dimensional Cartesian communicator |
|
protecteddefault |
explicit copy constructor (default)
src | source |
|
inline |
global x boundary
|
inline |
global y boundary
|
inline |
Return mpi cartesian communicator that is used in this grid.
|
inline |
Display global and local grid.
os | output stream |
|
inline |
discrete legendre transformation in x
|
inline |
discrete legendre transformation in y
|
protectedpure virtual |
This function has an implementation.
|
inline |
|
inline |
Map a global vector index to a local vector Index and the corresponding PID.
globalIdx | a global vector Index |
localIdx | contains local vector index on output |
PID | contains corresponding PID in the communicator on output |
|
inline |
Return global hx.
|
inline |
Return global hy.
|
inline |
Return a non-MPI grid local for the calling process.
The local grid contains the boundaries and cell numbers the calling process sees and is in charge of.
|
inline |
Map a local index plus the PID to a global vector index.
localIdx | a local vector index |
PID | a PID in the communicator |
globalIdx | the corresponding global vector Index (contains result on output) |
|
inline |
The total local number of points.
local.size()
|
inline |
Return global lx.
|
inline |
Return global ly.
|
inline |
|
inline |
Return n.
|
inline |
number of polynomial coefficients in x
|
inline |
Return the global number of cells.
|
inline |
number of polynomial coefficients in y
|
inline |
Return the global number of cells.
|
protecteddefault |
explicit assignment operator (default)
src | source |
int dg::aRealMPITopology2d< real_type >::pidOf | ( | real_type | x, |
real_type | y | ||
) | const |
Returns the pid of the process that holds the local grid surrounding the given point.
x | X-coord |
y | Y-coord |
|
inline |
Set the number of polynomials and cells.
Same as set(new_n,new_Nx,new_n,new_Ny)
new_n | new number of Gaussian nodes for both x and y |
new_Nx | new number of cells in x |
new_Ny | new number of cells in y |
|
inline |
Set the number of polynomials and cells.
new_nx | new number of Gaussian nodes in x |
new_Nx | new number of cells in x |
new_ny | new number of Gaussian nodes in y |
new_Ny | new number of cells in y |
|
inline |
The total global number of points.
nx()*ny()*Nx()*Ny()
|
inline |
Return global x0.
|
inline |
Return global x1.
|
inline |
Return global y0.
|
inline |
Return global y1.