HyperHDG
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Friends | List of all members
TPCC::Element< n, k, Sint, Tint > Class Template Reference

Tensor coordinates for a facet of dimension k in the complex of dimension n. More...

#include <element.h>

Collaboration diagram for TPCC::Element< n, k, Sint, Tint >:
Collaboration graph
[legend]

Public Member Functions

template<typename T >
 Element (const Combination< n, k > &combi, const std::array< T, n > &pos)
 Constructor with both data elements. More...
 
constexpr Tint direction_index () const
 The index of the combination enumerating directions. More...
 
constexpr Sint operator[] (Tint index) const
 The coordinates in the n-dimensional chain complex. More...
 
constexpr Tint along_direction (Tint index) const
 Mapping from local to global coordinate directions. More...
 
constexpr Sint along_coordinate (Tint index) const
 The coordinates in the k-dimensional element. More...
 
constexpr Tint across_direction (Tint index) const
 Mapping of orthogonal coordinate directions to global. More...
 
constexpr Sint across_coordinate (Tint index) const
 The position of the element orthogonal to its extension. More...
 
void print_debug (std::ostream &os) const
 Function for printing the data stored in the element. More...
 
constexpr Element< n, k - 1, Sint, Tint > facet (Tint index) const
 Enumeration of the boundary facets of the element. More...
 

Static Public Member Functions

static constexpr Tint n_facets ()
 The number of facets in the boundary of this object. More...
 

Static Public Attributes

static constexpr unsigned int n_val = n
 
static constexpr unsigned int k_val = k
 

Private Attributes

Combination< n, k > orientation
 A Combination enumerating the coordinate directions along which the element is aligned. More...
 
std::array< Sint, n > positions
 The integer coordinates within the n-dimensional complex. More...
 

Friends

template<int , int , typename , typename , typename >
class Slab
 

Detailed Description

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
class TPCC::Element< n, k, Sint, Tint >

Tensor coordinates for a facet of dimension k in the complex of dimension n.

Each element is characterized by its orientation and its position in the complex. The orientation is described by a combination of k coordinates which span the element. It has no extension across these coordinates.

The coordinates of an Element are stored in the array positions. Its length is nand it is ordered the same way as the coordinates in the whole chain complex. Thus, the first entry in there refers to the 'global' first coordinate, no matter whether this is a coordinate direction in which the Element extends. These global coordinates are accessed by operator[]().

The k local coordinates of the Element in the directions in which it extends are accessed by along_coordinate(). Their global counterparts are numbered by along_direction().

The n-k coordinates orthogonal to the element are accessed by across_coordinate(). The corresponding global directions are numbered by across_direction().

An imbortant feature of Element is that you can obtain an Element object for each of its boundary elements through facet().

Template Parameters
nThe dimension of the tensor chain complex
kThe dimension of this element
SintThe integer type used for indexing in a single fiber
TintThe integer type used for indexing fibers, directions, etc.

Constructor & Destructor Documentation

◆ Element()

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
template<typename T >
TPCC::Element< n, k, Sint, Tint >::Element ( const Combination< n, k > &  combi,
const std::array< T, n > &  pos 
)
inline

Constructor with both data elements.

Member Function Documentation

◆ across_coordinate()

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
constexpr Sint TPCC::Element< n, k, Sint, Tint >::across_coordinate ( Tint  index) const
inlineconstexpr

The position of the element orthogonal to its extension.

Here is the call graph for this function:

◆ across_direction()

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
constexpr Tint TPCC::Element< n, k, Sint, Tint >::across_direction ( Tint  index) const
inlineconstexpr

Mapping of orthogonal coordinate directions to global.

Here is the call graph for this function:

◆ along_coordinate()

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
constexpr Sint TPCC::Element< n, k, Sint, Tint >::along_coordinate ( Tint  index) const
inlineconstexpr

The coordinates in the k-dimensional element.

Here is the call graph for this function:

◆ along_direction()

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
constexpr Tint TPCC::Element< n, k, Sint, Tint >::along_direction ( Tint  index) const
inlineconstexpr

Mapping from local to global coordinate directions.

The Element extends along k integer coordinates, which are mapped through orientation to the n integer coordinates of the complex. This function maps the local coordinate direction of the Element to the global direction in the chain complex.

Here is the call graph for this function:

◆ direction_index()

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
constexpr Tint TPCC::Element< n, k, Sint, Tint >::direction_index ( ) const
inlineconstexpr

The index of the combination enumerating directions.

Here is the call graph for this function:

◆ facet()

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
constexpr Element<n, k - 1, Sint, Tint> TPCC::Element< n, k, Sint, Tint >::facet ( Tint  index) const
inlineconstexpr

Enumeration of the boundary facets of the element.

Such a boundary facet shares all directions into which it extends, except one. Conversely, it is orthogonal to the same coordinate directions plus one. It has the same one-dimensional coordinates for all shared directions. For the one direction which was eliminated, the coordinate is either the same as for the element for the lower boundary, or plus one for the upper.

Here is the call graph for this function:

◆ n_facets()

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
static constexpr Tint TPCC::Element< n, k, Sint, Tint >::n_facets ( )
inlinestaticconstexpr

The number of facets in the boundary of this object.

◆ operator[]()

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
constexpr Sint TPCC::Element< n, k, Sint, Tint >::operator[] ( Tint  index) const
inlineconstexpr

The coordinates in the n-dimensional chain complex.

Parameters
indexbetween 0 and n, the direction in which the coordinate is returned.

◆ print_debug()

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
void TPCC::Element< n, k, Sint, Tint >::print_debug ( std::ostream &  os) const
inline

Function for printing the data stored in the element.

The format used is within enclosing parentheses as follows:

  1. Each along_direction in order
  2. A colon
  3. Each across_direction in order
  4. A space
  5. Coordinates from 0 to n-1 separated by commas
Note
This function is also used in the consistency tests, therefore, the comparison data must be changed if the output format is changed.
Here is the call graph for this function:

Friends And Related Function Documentation

◆ Slab

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
template<int , int , typename , typename , typename >
friend class Slab
friend

Member Data Documentation

◆ k_val

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
constexpr unsigned int TPCC::Element< n, k, Sint, Tint >::k_val = k
staticconstexpr

◆ n_val

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
constexpr unsigned int TPCC::Element< n, k, Sint, Tint >::n_val = n
staticconstexpr

◆ orientation

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
Combination<n, k> TPCC::Element< n, k, Sint, Tint >::orientation
private

A Combination enumerating the coordinate directions along which the element is aligned.

Since combinations are generated in descending order, coordinates usually are referenced in ascending order, the directions are actually not the value in the combination or its complement. The index i returned by the combination is immediately replaced by n-1-i.

◆ positions

template<int n, int k, typename Sint = unsigned short, typename Tint = unsigned char>
std::array<Sint, n> TPCC::Element< n, k, Sint, Tint >::positions
private

The integer coordinates within the n-dimensional complex.


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