Flow123d
JS_before_hm-1804-gf2ad740aa
|
Go to the documentation of this file.
72 #ifndef REF_ELEMENT_HH_
73 #define REF_ELEMENT_HH_
275 template<std::
size_t Size>
285 template <
unsigned int OutDim,
unsigned int InDim>
338 template<
unsigned int dim>
410 static const unsigned int n_lines = (
unsigned int)((dim * (dim + 1)) / 2);
451 double tolerance = std::numeric_limits<double>::epsilon()*2);
468 template<
unsigned int subdim>
static unsigned int count();
477 template<
unsigned int subdim>
static arma::mat::fixed<dim+1,subdim+1>
bary_coords(
unsigned int sid);
483 template<
unsigned int subdim>
static BaryPoint interpolate(arma::vec::fixed<subdim+1> coord,
int sub_simplex_idx);
491 double first_theta,
double second_theta,
double theta);
524 template <
template <
unsigned int OutDim,
unsigned int InDim>
class TInteraction,
unsigned int OutDim,
unsigned int InDim>
525 static const IdxVector< (InDim>OutDim ? InDim+1 : dim-InDim) >
interact( TInteraction<OutDim,InDim> interaction,
bool inv =
false );
530 template<
unsigned int OutDim,
unsigned int InDim>
531 static const IdxVector< (InDim>OutDim ? InDim+1 : dim-InDim) >
interact_(
unsigned int index,
bool inv =
false);
602 template<
unsigned int dim>
603 template<
unsigned int subdim>
inline
606 arma::mat::fixed<dim+1,subdim+1> bary_c;
608 for(
unsigned int i = 0; i < subdim+1; i++){
609 unsigned int nid = interact_<0,subdim>(sid)[i];
610 bary_c.col(i).zeros();
611 bary_c.col(i)(nid) = 1;
618 template<
unsigned int dim>
inline
621 ASSERT_LT_DBG(nid, n_nodes).error(
"Node number is out of range!");
623 arma::vec::fixed<dim> p;
633 template<
unsigned int dim>
634 template<
unsigned int subdim>
674 template<
unsigned int dim>
675 template<
unsigned int subdim>
678 for(
unsigned int i=0; i < RefElement<dim>::count<subdim>(); i++){
679 if(zeros_positions == topology_zeros_[subdim][i])
return i;
681 ASSERT(0).error(
"Undefined zero pattern.");
694 return line_nodes_[i];}
699 return line_nodes_[i];}
704 return line_nodes_[i];}
709 return node_lines_[i];}
714 return node_lines_[i];}
724 return side_nodes_[i];}
739 return side_lines_[i];}
741 template<
unsigned int dim>
template<
unsigned int OutDim,
unsigned int InDim>
744 ASSERT(
false)(dim)(OutDim)(InDim)(i)(inv).error(
"Not implemented.");
747 return IdxVector< (InDim>OutDim ? InDim+1 : dim-InDim) >();
751 template<
unsigned int dim>
752 template <
template <
unsigned int OutDim,
unsigned int InDim>
class TInteraction,
unsigned int OutDim,
unsigned int InDim>
755 return interact_<OutDim,InDim>(interaction.i_, inv);
static LocalPoint normal_vector(unsigned int sid)
Armor::ArmaVec< double, dim > FaceBaryPoint
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)
Armor::ArmaVec< double, dim+1 > BaryPoint
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<(InDim >OutDim ? InDim+1 :dim-InDim) > interact(TInteraction< OutDim, InDim > interaction, bool inv=false)
static arma::mat::fixed< dim+1, subdim+1 > bary_coords(unsigned int sid)
static const std::vector< IdxVector< n_nodes_per_side > > side_nodes_
[n_sides] For given side, returns nodes indices. For dim == 3.
static constexpr IdxVector< 3 > S3_node_lines[2][4]
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 constexpr IdxVector< 3 > S3_node_sides[2][4]
static unsigned int count()
static const std::vector< IdxVector< n_lines_per_side > > side_lines_
[n_sides] For given side, returns lines indices. For dim == 3.
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 std::vector< IdxVector< n_sides_per_node > > node_sides_
[n_nodes] For given node, returns sides indices. For dim == 3.
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)
const typedef std::vector< LocalPoint > & CentersList
DECLARE_EXCEPTION(ExcInvalidPermutation,<< "Side permutation not found.\n")
static FaceBaryPoint barycentric_on_face(const BaryPoint &barycentric, unsigned int i_face)
static const std::vector< IdxVector< n_nodes_per_line > > line_nodes_
[n_lines] For given line, returns its nodes indices.
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 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)
static constexpr IdxVector< 2 > S3_line_sides[2][6]
Interaction(unsigned int i)
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
static BaryPoint local_to_bary(const LocalPoint &lp)
Converts from local to barycentric coordinates.
std::vector< BaryPoint > BarycentricUnitVec
static const std::vector< IdxVector< n_sides_per_line > > line_sides_
[n_lines] For given line, returns sides indices. For dim == 3.
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.
typename arma::Col< Type >::template fixed< nr > ArmaVec
static const IdxVector<(InDim >OutDim ? InDim+1 :dim-InDim) > interact_(unsigned int index, bool inv=false)
Internal part of the interact function.
static unsigned int topology_idx(unsigned int zeros_positions)
static const std::vector< IdxVector< n_lines_per_node > > node_lines_
[n_nodes] For given node, returns lines indices.