#include <nav.hpp>

Public Types

typedef Coord2D coord_t
 
typedef int elem_t
 
typedef int node_t
 
typedef int face_t
 

Public Member Functions

 Cart2D (int ni_, int nj_)
 
int num_elems () const
 Number of (possible) elements in the grid. More...
 
elem_t cart_ndx (const coord_t &coord) const
 Cartesian (flattened) index for a coordinate. More...
 
coord_t coord (const elem_t &cart_ndx) const
 Cartesian coordinate for a (flattened) index. More...
 
int num_nodes () const
 
node_t node_ndx (const coord_t &coord, const Corn2D &corn)
 
int num_faces () const
 
face_t face_ndx (const coord_t &coord, const Side2D &side)
 

Public Attributes

const int ni
 
const int nj
 

Static Public Attributes

static const int NO_ELEM
 Value used to indicate that a reference is not to a valid element. More...
 
static const int NO_FACE
 
static const int NO_NODE
 

Detailed Description

Navigate a Cartesian grid in a structured way so that clearly defined mapping between the enumeration index and the coordinate.

Member Typedef Documentation

typedef int Cart2D::elem_t
typedef int Cart2D::face_t
typedef int Cart2D::node_t

Constructor & Destructor Documentation

Cart2D::Cart2D ( int  ni_,
int  nj_ 
)
inline

Member Function Documentation

elem_t Cart2D::cart_ndx ( const coord_t coord) const
inline

Cartesian (flattened) index for a coordinate.

References Coord2D::i(), and Coord2D::j().

coord_t Cart2D::coord ( const elem_t cart_ndx) const
inline

Cartesian coordinate for a (flattened) index.

face_t Cart2D::face_ndx ( const coord_t coord,
const Side2D side 
)
inline

Translate element coordinate plus relative side of this into a Cartesian index of the face.

References Side< Dim >::dim(), Side< Dim >::dir(), Coord2D::i(), Coord2D::j(), ni, Dir::val, and Dim2D::X.

node_t Cart2D::node_ndx ( const coord_t coord,
const Corn2D corn 
)
inline
int Cart2D::num_elems ( ) const
inline

Number of (possible) elements in the grid.

References nj.

int Cart2D::num_faces ( ) const
inline

Each column has one more faces than there are rows, and each row has one more face than there are columns, due to the boundary.

int Cart2D::num_nodes ( ) const
inline

As each element has points on both sides (in both dimensions), there is an extra row and column of points compared to elements.

Member Data Documentation

const int Cart2D::ni

Referenced by face_ndx().

const int Cart2D::nj

Referenced by num_elems().

const int Cart2D::NO_ELEM
static

Value used to indicate that a reference is not to a valid element.

const int Cart2D::NO_FACE
static
const int Cart2D::NO_NODE
static

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