|
unsigned | shape (unsigned u=0) const |
| \( n_u N_u\) the total number of points of an axis
|
|
host_vector | abscissas (unsigned u=0) const |
| Construct grid abscissas of the u axis.
|
|
host_vector | weights (unsigned u=0) const |
| Get the weights of the u axis.
|
|
std::array< unsigned, Nd > | get_shape () const |
| \( n_u N_u\) the total number of points of an axis
|
|
std::array< host_vector, Nd > | get_abscissas () const |
| Construct abscissas for all axes.
|
|
std::array< host_vector, Nd > | get_weights () const |
| Construct weights for all axes.
|
|
std::array< real_type, Nd > | get_p () const |
| Get left boundary point \( \vec p\).
|
|
std::array< real_type, Nd > | get_q () const |
| Get right boundary point \( \vec q\).
|
|
std::array< real_type, Nd > | get_l () const |
| Get grid length \( l_u = q_u - p_u\) for all axes.
|
|
std::array< real_type, Nd > | get_h () const |
| Get grid constant \( h_u = \frac{q_u - p_u}{N_u}\) for all axes.
|
|
std::array< unsigned, Nd > | get_N () const |
| Get number of cells \( N_u\) for all axes.
|
|
std::array< unsigned, Nd > | get_n () const |
| Get number of polynomial coefficients \( n_u\) for all axes.
|
|
std::array< dg::bc, Nd > | get_bc () const |
| Get boundary condition \( b_u\) for all axes.
|
|
real_type | p (unsigned u=0) const |
| Get left boundary point \( p_u\) for axis u .
|
|
real_type | q (unsigned u=0) const |
| Get right boundary point \( q_u\) for axis u .
|
|
real_type | h (unsigned u=0) const |
| Get grid constant \( h_u = \frac{q_u - p_u}{N_u}\) for axis u .
|
|
real_type | l (unsigned u=0) const |
| Get grid length \( l_u = q_u - p_u\) for axis u .
|
|
unsigned | n (unsigned u=0) const |
| Get number of polynomial coefficients \( n_u\) for axis u .
|
|
unsigned | N (unsigned u=0) const |
| Get number of cells \( N_u\) for axis u .
|
|
dg::bc | bc (unsigned u=0) const |
| Get boundary condition \( b_u\) for axis u .
|
|
RealGrid< real_type, 1 > | grid (unsigned u) const |
| Get axis u as a 1d grid.
|
|
RealGrid< real_type, 1 > | axis (unsigned u) const |
| An alias for "grid".
|
|
template<size_t Md = Nd> |
real_type | x0 () const |
| Equivalent to p(0)
|
|
template<size_t Md = Nd> |
real_type | x1 () const |
| Equivalent to p(1)
|
|
template<size_t Md = Nd> |
real_type | y0 () const |
| Equivalent to p(2)
|
|
template<size_t Md = Nd> |
real_type | y1 () const |
| Equivalent to q(0)
|
|
template<size_t Md = Nd> |
real_type | z0 () const |
| Equivalent to q(1)
|
|
template<size_t Md = Nd> |
real_type | z1 () const |
| Equivalent to q(2)
|
|
template<size_t Md = Nd> |
real_type | lx () const |
| Equivalent to l(0)
|
|
template<size_t Md = Nd> |
real_type | ly () const |
| Equivalent to l(1)
|
|
template<size_t Md = Nd> |
real_type | lz () const |
| Equivalent to l(2)
|
|
template<size_t Md = Nd> |
real_type | hx () const |
| Equivalent to h(0)
|
|
template<size_t Md = Nd> |
real_type | hy () const |
| Equivalent to h(1)
|
|
template<size_t Md = Nd> |
real_type | hz () const |
| Equivalent to h(2)
|
|
template<size_t Md = Nd> |
unsigned | nx () const |
| Equivalent to n(0)
|
|
template<size_t Md = Nd> |
unsigned | ny () const |
| Equivalent to n(1)
|
|
template<size_t Md = Nd> |
unsigned | nz () const |
| Equivalent to n(2)
|
|
template<size_t Md = Nd> |
unsigned | Nx () const |
| Equivalent to N(0)
|
|
template<size_t Md = Nd> |
unsigned | Ny () const |
| Equivalent to N(1)
|
|
template<size_t Md = Nd> |
unsigned | Nz () const |
| Equivalent to N(2)
|
|
template<size_t Md = Nd> |
dg::bc | bcx () const |
| Equivalent to bc(0)
|
|
template<size_t Md = Nd> |
dg::bc | bcy () const |
| Equivalent to bc(1)
|
|
template<size_t Md = Nd> |
dg::bc | bcz () const |
| Equivalent to bc(2)
|
|
template<size_t Md = Nd> |
RealGrid< real_type, 1 > | gx () const |
| Equivalent to grid(0)
|
|
template<size_t Md = Nd> |
RealGrid< real_type, 1 > | gy () const |
| Equivalent to grid(1)
|
|
template<size_t Md = Nd> |
RealGrid< real_type, 1 > | gz () const |
| Equivalent to grid(2)
|
|
std::array< unsigned, Nd > | start () const |
| Start coordinate in C-order for dg::file::NcHyperslab .
|
|
std::array< unsigned, Nd > | count () const |
| Count vector in C-order for dg::file::NcHyperslab .
|
|
template<size_t Md = Nd> |
std::enable_if_t<(Md >=2), void > | multiplyCellNumbers (real_type fx, real_type fy) |
| Multiply the number of cells in the first two dimensions with a given factor.
|
|
template<size_t Md = Nd> |
std::enable_if_t<(Md==1), void > | set (unsigned new_n, unsigned new_Nx) |
| Set n and N in a 1-dimensional grid.
|
|
template<size_t Md = Nd> |
std::enable_if_t<(Md==2), void > | set (unsigned new_n, unsigned new_Nx, unsigned new_Ny) |
| Set n and N in a 2-dimensional grid.
|
|
template<size_t Md = Nd> |
std::enable_if_t<(Md==3), void > | set (unsigned new_n, unsigned new_Nx, unsigned new_Ny, unsigned new_Nz) |
| Set n and N in a 3-dimensional grid.
|
|
void | set (unsigned new_n, std::array< unsigned, Nd > new_N) |
| Same as set( {new_n, new_n,...}, new_N);
|
|
void | set_axis (unsigned coord, unsigned new_n, unsigned new_N) |
| Set n and N for axis coord .
|
|
void | set (std::array< unsigned, Nd > new_n, std::array< unsigned, Nd > new_N) |
| Set the number of polynomials and cells.
|
|
void | set_pq (std::array< real_type, Nd > new_p, std::array< real_type, Nd > new_q) |
| Reset the boundaries of the grid.
|
|
void | set_bcs (std::array< dg::bc, Nd > new_bcs) |
| Reset the boundary conditions of the grid.
|
|
void | set (std::array< real_type, Nd > new_p, std::array< real_type, Nd > new_q, std::array< unsigned, Nd > new_n, std::array< unsigned, Nd > new_N, std::array< dg::bc, Nd > new_bcs) |
| Reset the entire grid.
|
|
unsigned | size () const |
| The total number of points.
|
|
void | display (std::ostream &os=std::cout) const |
| Display.
|
|
template<size_t Md = Nd> |
std::enable_if_t<(Md==1), bool > | contains (real_type x) const |
| Check if the grid contains a point.
|
|
template<class Vector > |
bool | contains (const Vector &x) const |
| Check if the grid contains a point.
|
|
|
| ~aRealTopology ()=default |
| disallow deletion through base class pointer
|
|
| aRealTopology ()=default |
| default constructor
|
|
| aRealTopology (std::array< real_type, Nd > p, std::array< real_type, Nd > q, std::array< unsigned, Nd > n, std::array< unsigned, Nd > N, std::array< dg::bc, Nd > bcs) |
| Construct a topology directly from points and dimensions.
|
|
| aRealTopology (const std::array< RealGrid< real_type, 1 >, Nd > &axes) |
| Construct a topology as the product of 1d axes grids.
|
|
| aRealTopology (const aRealTopology &src)=default |
|
aRealTopology & | operator= (const aRealTopology &src)=default |
|
virtual void | do_set (std::array< unsigned, Nd > new_n, std::array< unsigned, Nd > new_N)=0 |
| Set the number of polynomials and cells.
|
|
virtual void | do_set_pq (std::array< real_type, Nd > new_p, std::array< real_type, Nd > new_q)=0 |
| Reset the boundaries of the grid.
|
|
virtual void | do_set (std::array< dg::bc, Nd > new_bcs)=0 |
| Reset the boundary conditions of the grid.
|
|
template<class real_type, size_t Nd>
struct dg::aRealTopology< real_type, Nd >
An abstract base class for Nd-dimensional dG grids.
This grid defines a discretization of the \(N_d\) dimensional hypercube given by
\[ [\vec p, \vec q] = [p_0, p_1] \times [p_1,q_1] \times ... \times
[p_{N_d-1}, q_{N_d-1}]\]
Each axis \( [p_i, q_i] \) is discretized using \( N_i\) equidistant cells. Each cells is then further discretized using \( n_i\) Gauss-Legendre nodes. The Gauss-Legendre nodes are tabulated by the dg::DLT
class for \( 1\leq n_i \leq 20\). Each axis further can have a boundary condition \( b_i \) that is given by dg::bc
For more information dG methods see
- See also
- Introduction to dg methods
This class in essence provides a collection of getters and setters for the aforementioned parameters together with the abscissas
and weights
members that are necessary for dg::evaluate
and dg::create::weights
. Lastly, we provide start
and count
members such that the grid can be used as a dg::file::NcHyperslab
in NetCDF output in dg::file
For code readability in many physical contexts the first 3 dimensions get special names \( x,\ y,\ z\) i.e. \( \vec p = (x_0, y_0, z_0)\) and \(
\vec q = (x_1, y_1, z_1)\). The class provides coresponding getters and setters like e.g. x0()
or Nx()
for p(0)
and N(0)
- Template Parameters
-
real_type | Determines value type of abscissas and weights |
Nd | The number of dimensions \( N_d\) |