Discontinuous Galerkin Library
#include "dg/algorithm.h"
dg::RealGridX1d< real_type > Struct Template Reference

1D grid for X-point topology More...

Public Types

using value_type = real_type
 
using host_vector = thrust::host_vector< real_type >
 The host vector type used by host functions like evaluate. More...
 
using host_grid = RealGridX1d< real_type >
 

Public Member Functions

 RealGridX1d (real_type x0, real_type x1, real_type f, unsigned n, unsigned N, bc bcx=NEU)
 1D X-point grid More...
 
real_type x0 () const
 left boundary More...
 
real_type x1 () const
 right boundary More...
 
real_type f () const
 Factor. More...
 
real_type lx () const
 total length of interval More...
 
real_type h () const
 cell size More...
 
unsigned N () const
 number of cells More...
 
unsigned outer_N () const
 number of cells in one of the outer regions More...
 
unsigned inner_N () const
 number of cells in the inner region More...
 
unsigned n () const
 number of polynomial coefficients More...
 
bc bcx () const
 boundary conditions More...
 
unsigned size () const
 the total number of points More...
 
void display (std::ostream &os=std::cout) const
 Display. More...
 
const DLT< real_type > & dlt () const
 the discrete legendre transformation More...
 
RealGrid1d< real_type > grid () const
 
void shift_topologic (real_type x0, real_type &x1) const
 Shifts a point coordinate due to topology. More...
 
bool contains (real_type x) const
 Check if the grid contains a point. More...
 

Detailed Description

template<class real_type>
struct dg::RealGridX1d< real_type >

1D grid for X-point topology

The grid looks like

|------x----------x------|
@ x
x direction

, where the x indicates the periodicity and - the number of points The left boundary is x0 and the right x1, the inner boundaries lie at x0 + f*Lx and x1-f*Lx therefore f must be smaller than 0.5

Member Typedef Documentation

◆ host_grid

template<class real_type >
using dg::RealGridX1d< real_type >::host_grid = RealGridX1d<real_type>

◆ host_vector

template<class real_type >
using dg::RealGridX1d< real_type >::host_vector = thrust::host_vector<real_type>

The host vector type used by host functions like evaluate.

◆ value_type

template<class real_type >
using dg::RealGridX1d< real_type >::value_type = real_type

Constructor & Destructor Documentation

◆ RealGridX1d()

template<class real_type >
dg::RealGridX1d< real_type >::RealGridX1d ( real_type  x0,
real_type  x1,
real_type  f,
unsigned  n,
unsigned  N,
bc  bcx = NEU 
)
inline

1D X-point grid

Parameters
x0left boundary
x1right boundary
ffactor 0<f<0.5 divides the domain
n# of polynomial coefficients
N# of cells
bcxboundary conditions

Member Function Documentation

◆ bcx()

template<class real_type >
bc dg::RealGridX1d< real_type >::bcx ( ) const
inline

boundary conditions

Returns

◆ contains()

template<class real_type >
bool dg::RealGridX1d< real_type >::contains ( real_type  x) const
inline

Check if the grid contains a point.

Note
doesn't check periodicity!!
Parameters
xpoint to check
Returns
true if x0()<=x<=x1(), false else

◆ display()

template<class real_type >
void dg::RealGridX1d< real_type >::display ( std::ostream &  os = std::cout) const
inline

Display.

Parameters
osoutput stream

◆ dlt()

template<class real_type >
const DLT< real_type > & dg::RealGridX1d< real_type >::dlt ( ) const
inline

the discrete legendre transformation

Returns

◆ f()

template<class real_type >
real_type dg::RealGridX1d< real_type >::f ( ) const
inline

Factor.

Returns

◆ grid()

template<class real_type >
RealGrid1d< real_type > dg::RealGridX1d< real_type >::grid ( ) const
inline

◆ h()

template<class real_type >
real_type dg::RealGridX1d< real_type >::h ( ) const
inline

cell size

Returns

◆ inner_N()

template<class real_type >
unsigned dg::RealGridX1d< real_type >::inner_N ( ) const
inline

number of cells in the inner region

Returns

◆ lx()

template<class real_type >
real_type dg::RealGridX1d< real_type >::lx ( ) const
inline

total length of interval

Returns

◆ N()

template<class real_type >
unsigned dg::RealGridX1d< real_type >::N ( ) const
inline

number of cells

Returns

◆ n()

template<class real_type >
unsigned dg::RealGridX1d< real_type >::n ( ) const
inline

number of polynomial coefficients

Returns

◆ outer_N()

template<class real_type >
unsigned dg::RealGridX1d< real_type >::outer_N ( ) const
inline

number of cells in one of the outer regions

Returns

◆ shift_topologic()

template<class real_type >
void dg::RealGridX1d< real_type >::shift_topologic ( real_type  x0,
real_type &  x1 
) const
inline

Shifts a point coordinate due to topology.

If you want to construct a point by adding delta X to a given point x0 then the resulting coordinate x1 might be incorrect due to topologic reasons (periodic boundaries). This function corrects this coordinate

Parameters
x0starting point (must lie inside of the grid)
x1end point (inout)

◆ size()

template<class real_type >
unsigned dg::RealGridX1d< real_type >::size ( ) const
inline

the total number of points

Returns
n*Nx

◆ x0()

template<class real_type >
real_type dg::RealGridX1d< real_type >::x0 ( ) const
inline

left boundary

Returns

◆ x1()

template<class real_type >
real_type dg::RealGridX1d< real_type >::x1 ( ) const
inline

right boundary

Returns

The documentation for this struct was generated from the following file: