Flow123d
JS_before_hm-1754-g1847fd3ed
|
#include <ref_element.hh>
Public Types | |
typedef arma::vec::fixed< dim > | LocalPoint |
typedef Armor::ArmaVec< double, dim+1 > | BaryPoint |
typedef Armor::ArmaVec< double, dim > | FaceBaryPoint |
typedef std::vector< BaryPoint > | BarycentricUnitVec |
Public Member Functions | |
DECLARE_EXCEPTION (ExcInvalidPermutation,<< "Side permutation not found.\n") | |
const std::vector< std::vector< std::vector< unsigned int > > > | nodes_of_subelements |
const std::vector< std::vector< std::vector< unsigned int > > > | nodes_of_subelements |
const std::vector< std::vector< std::vector< unsigned int > > > | nodes_of_subelements |
const std::vector< std::vector< std::vector< unsigned int > > > | nodes_of_subelements |
vec::fixed< 1 > | normal_vector (unsigned int sid) |
vec::fixed< 2 > | normal_vector (unsigned int sid) |
vec::fixed< 3 > | normal_vector (unsigned int sid) |
auto | clip (const BaryPoint &barycentric) -> BaryPoint |
double | side_measure (unsigned int sid) |
double | side_measure (unsigned int sid) |
double | side_measure (unsigned int sid) |
unsigned int | line_between_faces (unsigned int f1, unsigned int f2) |
const std::vector< std::vector< std::vector< unsigned int > > > | nodes_of_subelements |
const std::vector< std::vector< std::vector< unsigned int > > > | nodes_of_subelements |
const std::vector< std::vector< std::vector< unsigned int > > > | nodes_of_subelements |
const std::vector< std::vector< std::vector< unsigned int > > > | nodes_of_subelements |
template<unsigned int subdim> | |
auto | interpolate (arma::vec::fixed< subdim+1 > coord, int sub_simplex_idx) -> BaryPoint |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
unsigned int | count () |
template<template< unsigned int OutDim, unsigned int InDim > class TInteraction, unsigned int OutDim, unsigned int InDim> | |
const IdxVector<(InDim >OutDim ? InDim+1 :dim-InDim) > | interact (TInteraction< OutDim, InDim > interaction) |
Static Public Member Functions | |
static LocalPoint | node_coords (unsigned int nid) |
static LocalPoint | normal_vector (unsigned int sid) |
static BaryPoint | clip (const BaryPoint &barycentric) |
static unsigned int | normal_orientation (unsigned int sid) |
static double | side_measure (unsigned int sid) |
static unsigned int | oposite_node (unsigned int sid) |
static unsigned int | line_between_faces (unsigned int f1, unsigned int f2) |
static BaryPoint | local_to_bary (const LocalPoint &lp) |
Converts from local to barycentric coordinates. More... | |
static LocalPoint | bary_to_local (const BaryPoint &bp) |
Converts from barycentric to local coordinates. More... | |
static BarycentricUnitVec | make_bary_unit_vec () |
static FaceBaryPoint | barycentric_on_face (const BaryPoint &barycentric, unsigned int i_face) |
static CentersList | centers_of_subelements (unsigned int sub_dim) |
static std::pair< unsigned int, unsigned int > | zeros_positions (const BaryPoint &barycentric, double tolerance=std::numeric_limits< double >::epsilon() *2) |
template<unsigned int subdim> | |
static unsigned int | topology_idx (unsigned int zeros_positions) |
template<unsigned int subdim> | |
static unsigned int | count () |
template<unsigned int subdim> | |
static arma::mat::fixed< dim+1, subdim+1 > | bary_coords (unsigned int sid) |
template<unsigned int subdim> | |
static BaryPoint | interpolate (arma::vec::fixed< subdim+1 > coord, int sub_simplex_idx) |
static BaryPoint | line_barycentric_interpolation (BaryPoint first_coords, BaryPoint second_coords, double first_theta, double second_theta, double theta) |
template<template< unsigned int OutDim, unsigned int InDim > class TInteraction, unsigned int OutDim, unsigned int InDim> | |
static const IdxVector<(InDim >OutDim ? InDim+1 :dim-InDim) > | interact (TInteraction< OutDim, InDim > interaction) |
Public Attributes | |
const typedef std::vector< LocalPoint > & | CentersList |
Static Public Attributes | |
static const unsigned int | n_sides = dim + 1 |
Number of sides. More... | |
static const unsigned int | n_nodes = dim + 1 |
Number of nodes. More... | |
static const unsigned int | n_nodes_per_side = dim |
Number of nodes on one side. More... | |
static const unsigned int | n_lines_per_node = dim |
Number of lines with one common node. More... | |
static const unsigned int | n_nodes_per_line = 2 |
Number of nodes in one line. More... | |
static const unsigned int | n_sides_per_line = 2 |
Number of sides with one common line. dim == 3. More... | |
static const unsigned int | n_sides_per_node = dim |
Number of sides with one common line. More... | |
static const unsigned int | n_lines_per_side = (unsigned int)((dim * (dim - 1)) / 2) |
Number of lines on boundary of one side. More... | |
static const unsigned int | n_lines = (unsigned int)((dim * (dim + 1)) / 2) |
Number of lines, i.e. object of dimension dim-2 on the boundary of the reference element. More... | |
static const std::vector< std::vector< std::vector< unsigned int > > > | nodes_of_subelements |
Private Member Functions | |
const std::vector< IdxVector< 2 > > | line_nodes_ |
const std::vector< IdxVector< 2 > > | line_nodes_ |
const std::vector< IdxVector< 2 > > | line_nodes_ |
const std::vector< IdxVector< 1 > > | node_lines_ |
const std::vector< IdxVector< 2 > > | node_lines_ |
const std::vector< IdxVector< 3 > > | node_lines_ |
const std::vector< IdxVector< 3 > > | side_nodes_ |
const std::vector< IdxVector< 3 > > | node_sides_ |
const std::vector< IdxVector< 2 > > | line_sides_ |
const std::vector< IdxVector< 3 > > | side_lines_ |
const IdxVector< 1 > | topology_zeros_ [] |
const IdxVector< 2 > | topology_zeros_ [] |
const IdxVector< 3 > | topology_zeros_ [] |
const IdxVector< 6 > | topology_zeros_ [] |
const IdxVector< 1 > | topology_zeros_ [] |
const IdxVector< 2 > | topology_zeros_ [] |
const IdxVector< 3 > | topology_zeros_ [] |
const IdxVector< 6 > | topology_zeros_ [] |
const std::vector< IdxVector< 2 > > | line_nodes_ |
const std::vector< IdxVector< 2 > > | line_nodes_ |
const std::vector< IdxVector< 2 > > | line_nodes_ |
const std::vector< IdxVector< 1 > > | node_lines_ |
const std::vector< IdxVector< 2 > > | node_lines_ |
const std::vector< IdxVector< 3 > > | node_lines_ |
const std::vector< IdxVector< 3 > > | side_nodes_ |
const std::vector< IdxVector< 3 > > | node_sides_ |
const std::vector< IdxVector< 2 > > | line_sides_ |
const std::vector< IdxVector< 3 > > | side_lines_ |
const IdxVector< 1 > | topology_zeros_ [] |
const IdxVector< 2 > | topology_zeros_ [] |
const IdxVector< 3 > | topology_zeros_ [] |
const IdxVector< 6 > | topology_zeros_ [] |
const IdxVector< 1 > | interact_ (unsigned int i) |
This function is for "side_nodes" - for given side, give me nodes (0->0, 1->1). More... | |
const IdxVector< 2 > | interact_ (unsigned int i) |
For line i {0}, give me indices of its nodes. More... | |
const IdxVector< 2 > | interact_ (unsigned int i) |
For line i {0,1,2}, give me indices of its nodes. More... | |
const IdxVector< 2 > | interact_ (unsigned int i) |
For line i {0,1,2,3,4,5}, give me indices of its nodes. More... | |
const IdxVector< 1 > | interact_ (unsigned int i) |
For node i {0,1}, give me indices of lines. More... | |
const IdxVector< 2 > | interact_ (unsigned int i) |
For node i {0,1,2}, give me indices of lines. More... | |
const IdxVector< 3 > | interact_ (unsigned int i) |
For node i {0,1,2,3}, give me indices of lines. More... | |
const IdxVector< 3 > | interact_ (unsigned int i) |
For side i {0,1,2}, give me indices of its nodes. More... | |
const IdxVector< 3 > | interact_ (unsigned int i) |
For node i {0,1,2,3}, give me indices of sides. More... | |
const IdxVector< 2 > | interact_ (unsigned int i) |
For line i {0,1,2,3}, give me indices of sides. More... | |
const IdxVector< 3 > | interact_ (unsigned int i) |
For side i {0,1,2}, give me indices of its lines. More... | |
Static Private Member Functions | |
template<unsigned int OutDim, unsigned int InDim> | |
static const IdxVector<(InDim >OutDim ? InDim+1 :dim-InDim) > | interact_ (unsigned int index) |
Internal part of the interact function. More... | |
Static Private Attributes | |
static const std::vector< IdxVector< n_nodes_per_line > > | line_nodes_ |
[n_lines] For given line, returns its nodes indices. More... | |
static const std::vector< IdxVector< n_lines_per_node > > | node_lines_ |
[n_nodes] For given node, returns lines indices. More... | |
static const std::vector< IdxVector< n_nodes_per_side > > | side_nodes_ |
[n_sides] For given side, returns nodes indices. For dim == 3. More... | |
static const std::vector< IdxVector< n_sides_per_node > > | node_sides_ |
[n_nodes] For given node, returns sides indices. For dim == 3. More... | |
static const std::vector< IdxVector< n_sides_per_line > > | line_sides_ |
[n_lines] For given line, returns sides indices. For dim == 3. More... | |
static const std::vector< IdxVector< n_lines_per_side > > | side_lines_ |
[n_sides] For given side, returns lines indices. For dim == 3. More... | |
static const IdxVector<(n_lines > n_nodes) ? n_lines :n_nodes > | topology_zeros_ [dim+1] |
Definition at line 309 of file ref_element.hh.
typedef std::vector<BaryPoint> RefElement< dim >::BarycentricUnitVec |
Definition at line 419 of file ref_element.hh.
typedef Armor::ArmaVec<double, dim+1> RefElement< dim >::BaryPoint |
Barycentric coordinates.
e.g. coordinates (a,b,c) on triangle with vertices X, Y, Z represents a point: a*X+b*Y+c*Z
Definition at line 319 of file ref_element.hh.
typedef Armor::ArmaVec<double, dim> RefElement< dim >::FaceBaryPoint |
Definition at line 320 of file ref_element.hh.
typedef arma::vec::fixed<dim> RefElement< dim >::LocalPoint |
Definition at line 312 of file ref_element.hh.
|
inlinestatic |
sid | - index of a sub-simplex in a simplex return an array of barycentric coordinates on <dim> simplex from <subdim> simplex for example: simplex<3> - ABCD and its subsubsimplex<1> AD (line index: 3) AD has barycoords for A (1,0), for D (0,1), but A in ABCD is (1,0,0,0) and D is (0,0,0,1) this method creates array ((1,0,0,0),(0,0,0,1)) |
Definition at line 595 of file ref_element.hh.
|
static |
Converts from barycentric to local coordinates.
bp | point in barycentric coordinates |
Definition at line 286 of file ref_element.cc.
|
static |
For given barycentric coordinates on the ref element returns barycentric coordinates on the ref. element of given face. Assumes that the input point is on the face. Barycentric order: (complanatory, local_coords )
Definition at line 364 of file ref_element.cc.
|
static |
Definition at line 451 of file ref_element.cc.
|
static |
If the given barycentric coordinate is in the ref. element, return unchanged. If the given barycentric coordinate is out of the ref. element, project it on the surface of the ref. element.
Definition at line 417 of file ref_element.cc.
auto RefElement< 0 >::clip | ( | const BaryPoint & | barycentric | ) | -> BaryPoint |
Definition at line 397 of file ref_element.cc.
|
static |
Function returns number of subdim-simplices inside dim-simplex. The aim is covering all the n_**** members with a single function. TODO: think of generalization for n_****_per_**** members, like function interact:
template<unsigned int subdimA, unsigned int subdimB> static unsigned int count();
|
inline |
Definition at line 649 of file ref_element.hh.
|
inline |
Definition at line 651 of file ref_element.hh.
|
inline |
Definition at line 653 of file ref_element.hh.
|
inline |
Definition at line 655 of file ref_element.hh.
|
inline |
Definition at line 657 of file ref_element.hh.
|
inline |
Definition at line 659 of file ref_element.hh.
|
inline |
Definition at line 661 of file ref_element.hh.
|
inline |
Definition at line 663 of file ref_element.hh.
|
inline |
Definition at line 665 of file ref_element.hh.
|
inline |
Definition at line 667 of file ref_element.hh.
|
inline |
Definition at line 669 of file ref_element.hh.
|
inline |
Definition at line 671 of file ref_element.hh.
|
inline |
Definition at line 673 of file ref_element.hh.
|
inline |
Definition at line 675 of file ref_element.hh.
|
inline |
Definition at line 677 of file ref_element.hh.
|
inline |
Definition at line 679 of file ref_element.hh.
RefElement< dim >::DECLARE_EXCEPTION | ( | ExcInvalidPermutation | , |
<< "Side permutation not found.\n" | |||
) |
|
static |
Usage: RefElement<3>::interact(Interaction<2,0>(1)) (means: In tetrahedron <3>, give indices of sides <2>, connected by node <0> with index 1) RefElement<3>::interact(Interaction<2,0>(1))[1] (as above, but give only the side with index 1)
Template usage: RefElement<dim>::interact(Interaction<OutDim, InDim>(i))[j] (means: on dim-dimensional reference element, go on InDim-dimensional subelement with index i, which connects OutDim-dimnesional subelements and select the one with index j)
This method serves as an interface to topology information of the reference element. It returns indices of OutDim-dimensional object of InDim-dimnesional object of given index in dim-dimnesional reference element.
interaction | - auxilliary object carying the index and the template arguments OutDim and InDim |
OutDim | - output dimension (give me node-0, line-1, side-2), <= dim |
InDim | - input dimension (for node-0, line-1, side-2), <= dim |
IdxVector
object.possible calls: dim OutDim InDim return 1,2,3 0 1 InDim+1 - give me indices of nodes of line of given index 3 0 2 InDim+1 - give me indices of nodes of a side (triangle) of given index 3 1 2 InDim+1 - give me indices of lines of side (triangle) of given index
1,2,3 1 0 dim-InDim - give me indices of lines with common node of given index 3 2 0 dim-InDim - give me indices of sides (triangles) with common node of given index 3 2 1 dim-InDim - give me indices of sides (triangles) with common line of given index
|
inline |
Definition at line 761 of file ref_element.hh.
|
inlineprivate |
For node i {0,1}, give me indices of lines.
Definition at line 715 of file ref_element.hh.
|
inlineprivate |
This function is for "side_nodes" - for given side, give me nodes (0->0, 1->1).
Definition at line 695 of file ref_element.hh.
|
inlineprivate |
For node i {0,1,2,3}, give me indices of sides.
Definition at line 735 of file ref_element.hh.
|
inlineprivate |
For line i {0}, give me indices of its nodes.
Definition at line 700 of file ref_element.hh.
|
inlineprivate |
For line i {0,1,2}, give me indices of its nodes.
Definition at line 705 of file ref_element.hh.
|
inlineprivate |
For line i {0,1,2,3,4,5}, give me indices of its nodes.
Definition at line 710 of file ref_element.hh.
|
inlineprivate |
For node i {0,1,2}, give me indices of lines.
Definition at line 720 of file ref_element.hh.
|
inlineprivate |
For node i {0,1,2,3}, give me indices of lines.
Definition at line 725 of file ref_element.hh.
|
inlineprivate |
For side i {0,1,2}, give me indices of its nodes.
Definition at line 730 of file ref_element.hh.
|
inlineprivate |
For line i {0,1,2,3}, give me indices of sides.
Definition at line 740 of file ref_element.hh.
|
inlineprivate |
For side i {0,1,2}, give me indices of its lines.
Definition at line 745 of file ref_element.hh.
|
staticprivate |
Internal part of the interact function.
|
static |
Interpolate barycentric coords to a higher dimension of a simplex.
coord | - barycentric coords of a point on a sub-simplex |
sub_simplex_idx | - id of sub-simplex on a simplex |
auto RefElement< dim >::interpolate | ( | arma::vec::fixed< subdim+1 > | coord, |
int | sub_simplex_idx | ||
) | -> BaryPoint |
Definition at line 626 of file ref_element.hh.
|
static |
Basic line interpolation.
Basic line interpolation
Definition at line 524 of file ref_element.cc.
|
static |
Return index of 1D line, shared by two faces f1
and f2
of the reference tetrahedron. Implemented only for dim
== 3.
unsigned int RefElement< 3 >::line_between_faces | ( | unsigned int | f1, |
unsigned int | f2 | ||
) |
Definition at line 508 of file ref_element.cc.
|
private |
Definition at line 51 of file ref_element.cc.
|
private |
Definition at line 54 of file ref_element.cc.
|
private |
Definition at line 59 of file ref_element.cc.
|
private |
Definition at line 551 of file ref_element.hh.
|
private |
Definition at line 552 of file ref_element.hh.
|
private |
Definition at line 553 of file ref_element.hh.
|
private |
Definition at line 101 of file ref_element.cc.
|
private |
Definition at line 560 of file ref_element.hh.
|
static |
Converts from local to barycentric coordinates.
lp | point in local coordinates (x,y) |
Definition at line 272 of file ref_element.cc.
|
static |
Used in the clip method.
Definition at line 403 of file ref_element.cc.
|
inlinestatic |
Return coordinates of given node.
RefElement
nid | Node number. NOTE: Implementation is dependent on current node and side numbering. |
Definition at line 610 of file ref_element.hh.
|
private |
Definition at line 68 of file ref_element.cc.
|
private |
Definition at line 72 of file ref_element.cc.
|
private |
Definition at line 78 of file ref_element.cc.
|
private |
Definition at line 554 of file ref_element.hh.
|
private |
Definition at line 555 of file ref_element.hh.
|
private |
Definition at line 557 of file ref_element.hh.
|
private |
Definition at line 94 of file ref_element.cc.
|
private |
Definition at line 559 of file ref_element.hh.
const std::vector< std::vector< std::vector< unsigned int > > > RefElement< 0 >::nodes_of_subelements |
Definition at line 248 of file ref_element.cc.
const std::vector< std::vector< std::vector< unsigned int > > > RefElement< 1 >::nodes_of_subelements |
Definition at line 252 of file ref_element.cc.
const std::vector< std::vector< std::vector< unsigned int > > > RefElement< 2 >::nodes_of_subelements |
Definition at line 257 of file ref_element.cc.
const std::vector< std::vector< std::vector< unsigned int > > > RefElement< 3 >::nodes_of_subelements |
Definition at line 263 of file ref_element.cc.
const std::vector< std::vector< std::vector< unsigned int > > > RefElement< 0 >::nodes_of_subelements |
Definition at line 578 of file ref_element.hh.
const std::vector< std::vector< std::vector< unsigned int > > > RefElement< 1 >::nodes_of_subelements |
Definition at line 579 of file ref_element.hh.
const std::vector< std::vector< std::vector< unsigned int > > > RefElement< 2 >::nodes_of_subelements |
Definition at line 580 of file ref_element.hh.
const std::vector< std::vector< std::vector< unsigned int > > > RefElement< 3 >::nodes_of_subelements |
Definition at line 581 of file ref_element.hh.
|
static |
Returns orientation of the normal of side sid
. 0 -> OUT, 1 -> IN. NOTE: Implementation is dependent on current node and side numbering.
Definition at line 301 of file ref_element.cc.
vec::fixed< 1 > RefElement< 1 >::normal_vector | ( | unsigned int | sid | ) |
Definition at line 310 of file ref_element.cc.
vec::fixed< 2 > RefElement< 2 >::normal_vector | ( | unsigned int | sid | ) |
Definition at line 318 of file ref_element.cc.
|
static |
Compute normal vector to a given side.
sid | Side number. |
vec::fixed< 3 > RefElement< 3 >::normal_vector | ( | unsigned int | sid | ) |
Definition at line 340 of file ref_element.cc.
|
inlinestatic |
Returns index of the node that is oposite to side of given index sid
. Note: It is dependent on current node and side numbering.
sid | Side number. NOTE: Implementation is dependent on current node and side numbering. |
Definition at line 294 of file ref_element.cc.
|
private |
Definition at line 110 of file ref_element.cc.
|
private |
Definition at line 561 of file ref_element.hh.
|
static |
double RefElement< 1 >::side_measure | ( | unsigned int | sid | ) |
Definition at line 479 of file ref_element.cc.
double RefElement< 2 >::side_measure | ( | unsigned int | sid | ) |
Definition at line 488 of file ref_element.cc.
double RefElement< 3 >::side_measure | ( | unsigned int | sid | ) |
Definition at line 497 of file ref_element.cc.
|
private |
Definition at line 87 of file ref_element.cc.
|
private |
Definition at line 558 of file ref_element.hh.
|
static |
According to positions of zeros in barycentric coordinates, it gives the index of subdim-simplex in the reference element. Number of zeros must be equal to (3-subdim). e.g.: if 1 zeros, return index of side (subdim 2) if 2 zeros, return index of edge (subdim 1) if 3 zeros, return index of vertex (subdim 0)
Definition at line 684 of file ref_element.hh.
|
private |
Definition at line 118 of file ref_element.cc.
|
private |
Definition at line 123 of file ref_element.cc.
|
private |
Definition at line 131 of file ref_element.cc.
|
private |
Definition at line 143 of file ref_element.cc.
|
private |
Definition at line 545 of file ref_element.hh.
|
private |
Definition at line 546 of file ref_element.hh.
|
private |
Definition at line 547 of file ref_element.hh.
|
private |
Definition at line 548 of file ref_element.hh.
|
private |
Definition at line 564 of file ref_element.hh.
|
private |
Definition at line 565 of file ref_element.hh.
|
private |
Definition at line 566 of file ref_element.hh.
|
private |
Definition at line 567 of file ref_element.hh.
|
static |
Return (1) number of zeros and (2) positions of zeros in barycentric coordinates. tolerance
serves for testing zero values of barycentric
coordinates.
Definition at line 379 of file ref_element.cc.
const typedef std::vector<LocalPoint>& RefElement< dim >::CentersList |
Definition at line 434 of file ref_element.hh.
|
staticprivate |
[n_lines] For given line, returns its nodes indices.
Definition at line 524 of file ref_element.hh.
|
staticprivate |
[n_lines] For given line, returns sides indices. For dim
== 3.
Definition at line 528 of file ref_element.hh.
|
static |
Number of lines, i.e. object
of dimension dim-2
on the boundary of the reference element.
Definition at line 380 of file ref_element.hh.
|
static |
Number of lines with one common node.
Definition at line 371 of file ref_element.hh.
|
static |
Number of lines on boundary of one side.
Definition at line 377 of file ref_element.hh.
|
static |
Number of nodes.
Definition at line 369 of file ref_element.hh.
|
static |
Number of nodes in one line.
Definition at line 372 of file ref_element.hh.
|
static |
Number of nodes on one side.
Definition at line 370 of file ref_element.hh.
|
static |
Number of sides.
Definition at line 368 of file ref_element.hh.
|
static |
Number of sides with one common line. dim
== 3.
Definition at line 373 of file ref_element.hh.
|
static |
Number of sides with one common line.
Definition at line 374 of file ref_element.hh.
|
staticprivate |
[n_nodes] For given node, returns lines indices.
Definition at line 525 of file ref_element.hh.
|
staticprivate |
[n_nodes] For given node, returns sides indices. For dim
== 3.
Definition at line 527 of file ref_element.hh.
|
static |
Definition at line 404 of file ref_element.hh.
|
staticprivate |
[n_sides] For given side, returns lines indices. For dim
== 3.
Definition at line 529 of file ref_element.hh.
|
staticprivate |
[n_sides] For given side, returns nodes indices. For dim
== 3.
Definition at line 526 of file ref_element.hh.
|
staticprivate |
Consider an n-face (node, edge, face, bulk) with dimension subdim
and index within subdimension idx
. Barycentric coordinates of all points on the n-face have unique pattern of zero coordinates.
topology_zeros_[subdim][idx] is a bitfield with '1' where the pattern have zeros.
Definition at line 539 of file ref_element.hh.