Flow123d  release_2.2.0-914-gf1a3a4f
Public Member Functions | Private Attributes | Friends | List of all members
Simplex< N > Class Template Reference

#include <simplex.hh>

Public Member Functions

 Simplex ()
 Default (empty) constructor. More...
 
 Simplex (arma::vec3 **field_of_pointers_to_coordinates)
 
 ~Simplex ()
 Destructor. More...
 
void set_simplices (arma::vec3 **field_of_pointers_to_coordinates)
 Creating sub-simplices in lexicografic order. More...
 
Simplex< N-1 > & operator[] (unsigned int idx)
 Returns subsimplex of index idx. More...
 
Simplex< 1 > & abscissa (unsigned int idx)
 Get simplex of abscissa from different simplices - if it has own implementation in .cpp file. More...
 
Simplex< 0 > & node (unsigned int idx)
 
template<>
Simplex< 1 > & abscissa (unsigned int idx)
 
template<>
Simplex< 0 > & node (unsigned int idx)
 

Private Attributes

Simplex< N-1 > simplices_ [N+1]
 

Friends

std::ostream & operator<< (std::ostream &os, const Simplex< N > &s)
 Friend output operator. More...
 

Detailed Description

template<unsigned int N>
class Simplex< N >

Simplex<N> represents N-dimensional simplex, Simplex<0> = pointer to 3D point Simplex<1> = abscissa Simplex<2> = triangle Simplex<3> = tetrahedron Sub - simplices are made in lexicographical order

            Simplex<3> with 4 points 0,1,2,3 creates:
                            |
                 -----------------------------------------------------------------------------------------------------------------------------------------------
                |                                               |                                               |                                               |
                S<2>(0,1,2)                                     S<2>(0,1,3)                                     S<2>(0,2,3)                                     S<2>(1,2,3)
                    |                                               |                                               |                                               |
     -------------------------------                 -------------------------------                 -------------------------------                 -------------------------------
    |               |               |               |               |               |               |               |               |               |               |               |
    S<1>(0,1)       S<1>(0,2)       S<1>(1,2)       S<1>(0,1)       S<1>(0,3)       S<1>(1,3)       S<1>(0,2)       S<1>(0,3)       S<1>(2,3)       S<1>(1,2)       S<1>(1,3)       S<1>(2,3)
        |               |               |               |               |               |               |               |               |               |               |               |
     -------         -------         -------         -------         -------         -------         -------         -------         -------         -------         -------         -------
    |       |       |       |       |       |       |       |       |       |       |       |       |       |       |       |       |       |       |       |       |       |       |       |
S<0>(0) S<0>(1) S<0>(0) S<0>(2) S<0>(1) S<0>(2) S<0>(0) S<0>(1) S<0>(0) S<0>(3) S<0>(1) S<0>(3) S<0>(0) S<0>(2) S<0>(0) S<0>(3) S<0>(2) S<0>(3) S<0>(1) S<0>(2) S<0>(1) S<0>(3) S<0>(2) S<0>(3)

Simplex<0> has pointer to 3D point, because 3D point will be only once in memory

https://en.wikipedia.org/wiki/Simplex

Definition at line 35 of file simplex.hh.

Constructor & Destructor Documentation

template<unsigned int N>
Simplex< N >::Simplex ( )

Default (empty) constructor.

Definition at line 126 of file simplex.hh.

template<unsigned int N>
Simplex< N >::Simplex ( arma::vec3 **  field_of_pointers_to_coordinates)

Constuctor that sets the coordinates of all vertices.

Parameters
field- array of pointers to point coordinates of the vertices array must contain (N+1) elements for case Simplex<N>

Definition at line 128 of file simplex.hh.

template<unsigned int N>
Simplex< N >::~Simplex ( )

Destructor.

Definition at line 131 of file simplex.hh.

Member Function Documentation

template<>
Simplex< 1 > & Simplex< 3 >::abscissa ( unsigned int  idx)

Definition at line 28 of file simplex.cc.

template<unsigned int N>
Simplex<1>& Simplex< N >::abscissa ( unsigned int  idx)

Get simplex of abscissa from different simplices - if it has own implementation in .cpp file.

Here is the caller graph for this function:

template<>
Simplex< 0 > & Simplex< 3 >::node ( unsigned int  idx)

Definition at line 56 of file simplex.cc.

template<unsigned int N>
Simplex<0>& Simplex< N >::node ( unsigned int  idx)
template<unsigned int N>
Simplex< N-1 > & Simplex< N >::operator[] ( unsigned int  idx)

Returns subsimplex of index idx.

Definition at line 133 of file simplex.hh.

template<unsigned int N>
void Simplex< N >::set_simplices ( arma::vec3 **  field_of_pointers_to_coordinates)

Creating sub-simplices in lexicografic order.

Definition at line 10 of file simplex.cc.

Here is the caller graph for this function:

Friends And Related Function Documentation

template<unsigned int N>
std::ostream& operator<< ( std::ostream &  os,
const Simplex< N > &  s 
)
friend

Friend output operator.

Member Data Documentation

template<unsigned int N>
Simplex<N - 1> Simplex< N >::simplices_[N+1]
private

Every simplex<N> has (N+1) simplices of dimension (N-1) TODO: (idea - when used in new mesh) replace with references

Definition at line 76 of file simplex.hh.


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