Flow123d
release_3.0.0-968-gc87a28e79
|
Go to the documentation of this file.
71 #ifndef REF_ELEMENT_HH_
72 #define REF_ELEMENT_HH_
137 IdxVector(std::array<unsigned int,Size> data_in);
139 IdxVector(std::initializer_list<unsigned int> data_in);
141 unsigned int operator[](unsigned int idx) const;
145 template<std::
size_t Size>
155 template <
unsigned int OutDim,
unsigned int InDim>
161 template<
unsigned int dim>
231 static const unsigned int n_lines = (
unsigned int)((dim * (dim + 1)) / 2);
313 double tolerance = std::numeric_limits<double>::epsilon()*2);
330 template<
unsigned int subdim>
static unsigned int count();
339 template<
unsigned int subdim>
static arma::mat::fixed<dim+1,subdim+1>
bary_coords(
unsigned int sid);
345 template<
unsigned int subdim>
static BaryPoint interpolate(arma::vec::fixed<subdim+1> coord,
int sub_simplex_idx);
353 double first_theta,
double second_theta,
double theta);
386 template <
template <
unsigned int OutDim,
unsigned int InDim>
class TInteraction,
unsigned int OutDim,
unsigned int InDim>
387 static const IdxVector< (InDim>OutDim ? InDim+1 : dim-InDim) >
interact( TInteraction<OutDim,InDim> interaction );
392 template<
unsigned int OutDim,
unsigned int InDim>
393 static const IdxVector< (InDim>OutDim ? InDim+1 : dim-InDim) >
interact_(
unsigned int index);
448 template<
unsigned int dim>
449 template<
unsigned int subdim>
inline
452 arma::mat::fixed<dim+1,subdim+1> bary_c;
454 for(
unsigned int i = 0; i < subdim+1; i++){
455 unsigned int nid = interact_<0,subdim>(sid)[i];
456 bary_c.col(i).zeros();
457 bary_c.col(i)(nid) = 1;
464 template<
unsigned int dim>
inline
467 ASSERT_LT_DBG(nid, n_nodes).error(
"Node number is out of range!");
469 arma::vec::fixed<dim> p;
479 template<
unsigned int dim>
480 template<
unsigned int subdim>
529 template<
unsigned int dim>
530 template<
unsigned int subdim>
533 for(
unsigned int i=0; i < RefElement<dim>::count<subdim>(); i++){
534 if(zeros_positions == topology_zeros_[subdim][i])
return i;
536 ASSERT(0).error(
"Undefined zero pattern.");
549 return line_nodes_[i];}
554 return line_nodes_[i];}
559 return line_nodes_[i];}
564 return node_lines_[i];}
569 return node_lines_[i];}
574 return node_lines_[i];}
579 return side_nodes_[i];}
584 return node_sides_[i];}
589 return line_sides_[i];}
594 return side_lines_[i];}
596 template<
unsigned int dim>
template<
unsigned int OutDim,
unsigned int InDim>
599 ASSERT(
false)(dim)(OutDim)(InDim)(i).error(
"Not implemented.");
605 template<
unsigned int dim>
606 template <
template <
unsigned int OutDim,
unsigned int InDim>
class TInteraction,
unsigned int OutDim,
unsigned int InDim>
609 return interact_<OutDim,InDim>(interaction.i_);
static LocalPoint normal_vector(unsigned int sid)
arma::vec::fixed< dim+1 > BaryPoint
static unsigned int permutation_index(unsigned int p[n_nodes_per_side])
static BaryPoint line_barycentric_interpolation(BaryPoint first_coords, BaryPoint second_coords, double first_theta, double second_theta, double theta)
static unsigned int normal_orientation(unsigned int sid)
arma::vec::fixed< dim > LocalPoint
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
static const unsigned int n_sides_per_line
Number of sides with one common line. dim == 3.
static const IdxVector< n_sides_per_line > line_sides_[n_lines]
For given line, returns sides indices. For dim == 3.
static arma::mat::fixed< dim+1, subdim+1 > bary_coords(unsigned int sid)
static const unsigned int n_nodes
Number of nodes.
static BaryPoint interpolate(arma::vec::fixed< subdim+1 > coord, int sub_simplex_idx)
static std::pair< unsigned int, unsigned int > zeros_positions(const BaryPoint &barycentric, double tolerance=std::numeric_limits< double >::epsilon() *2)
static const IdxVector< n_lines_per_node > node_lines_[n_nodes]
For given node, returns lines indices.
static unsigned int count()
static const unsigned int n_sides
Number of sides.
static BarycentricUnitVec make_bary_unit_vec()
static CentersList centers_of_subelements(unsigned int sub_dim)
static const std::vector< std::vector< std::vector< unsigned int > > > nodes_of_subelements
static const IdxVector<(InDim >OutDim ? InDim+1 :dim-InDim) > interact_(unsigned int index)
Internal part of the interact function.
static LocalPoint bary_to_local(const BaryPoint &bp)
Converts from barycentric to local coordinates.
static const unsigned int n_nodes_per_line
Number of nodes in one line.
static const unsigned int n_sides_per_node
Number of sides with one common line.
static BaryPoint clip(const BaryPoint &barycentric)
std::array< unsigned int, Size > IdxVector
static const IdxVector<(n_lines > n_nodes) ? n_lines :n_nodes > topology_zeros_[dim+1]
static unsigned int oposite_node(unsigned int sid)
static const IdxVector<(InDim >OutDim ? InDim+1 :dim-InDim) > interact(TInteraction< OutDim, InDim > interaction)
const typedef std::vector< LocalPoint > & CentersList
static const IdxVector< n_nodes_per_side > side_nodes_[n_sides]
For given side, returns nodes indices. For dim == 3.
static const IdxVector< n_nodes_per_line > line_nodes_[n_lines]
For given line, returns its nodes indices.
static const unsigned int side_permutations[n_side_permutations][n_nodes_per_side]
static FaceBaryPoint barycentric_on_face(const BaryPoint &barycentric, unsigned int i_face)
static const unsigned int n_side_permutations
static const unsigned int n_lines
Number of lines, i.e. object of dimension dim-2 on the boundary of the reference element.
static LocalPoint node_coords(unsigned int nid)
static const IdxVector< n_sides_per_node > node_sides_[n_nodes]
For given node, returns sides indices. For dim == 3.
static const unsigned int n_lines_per_side
Number of lines on boundary of one side.
static unsigned int line_between_faces(unsigned int f1, unsigned int f2)
Interaction(unsigned int i)
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
static const IdxVector< n_lines_per_side > side_lines_[n_sides]
For given side, returns lines indices. For dim == 3.
static BaryPoint local_to_bary(const LocalPoint &lp)
Converts from local to barycentric coordinates.
std::vector< BaryPoint > BarycentricUnitVec
static double side_measure(unsigned int sid)
static const unsigned int n_lines_per_node
Number of lines with one common node.
static const unsigned int n_nodes_per_side
Number of nodes on one side.
static unsigned int topology_idx(unsigned int zeros_positions)
arma::vec::fixed< dim > FaceBaryPoint