Rheolef  7.1
an efficient C++ finite element environment
basis_fem_sides.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_BASIS_FEM_SIDES_H
2 #define _RHEOLEF_BASIS_FEM_SIDES_H
23 /*Class:sherwin
24 NAME: @code{Pkd[sides]} - trace of a basis on element boundaries
25 @cindex polynomial basis
26 @clindex space
27 @clindex basis
28 @clindex reference_element
29 SYNOPSIS:
30  space Mh (omega,"RT1d[sides]");
31 DESCRIPTION:
32  @noindent
33  This polynomial @code{basis} is used by the postprocessing stage of the
34  hybrid discontinuous Galerkin finite element method.
35  It is indicated in the @code{space} (see @ref{space class}) by
36  inserting the "[sides]" option between square braces after
37  the classical element characterisation
38  (see @ref{basis_option class}).
39 
40 AUTHOR: Pierre.Saramito@imag.fr
41 DATE: 2 january 2019
42 End:
43 */
44 #include "rheolef/basis.h"
45 namespace rheolef {
46 
47 template<class T>
48 class basis_fem_sides: public basis_rep<T> {
49 public:
50 
51 // typedefs:
52 
53  typedef basis_rep<T> base;
55  typedef T value_type;
56 
57 // allocators:
58 
59  basis_fem_sides (const basis_basic<T>& side_basis);
61 
62 // accessors:
63 
64  std::string family_name() const { return _side_basis.family_name(); }
65  size_type family_index() const { return _side_basis.family_index(); }
66  size_type degree() const { return _side_basis.degree(); }
67  bool is_nodal() const { return _side_basis.is_nodal(); }
68  const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
69  hat_node (reference_element hat_K) const;
70 
72  reference_element hat_K,
73  const side_information_type& sid) const;
74  void local_idof_on_side (
75  reference_element hat_K,
76  const side_information_type& sid,
77  Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof) const;
78 
79 // evaluation of all basis functions at hat_x:
80 
81  void evaluate_on_side (
82  reference_element hat_K,
83  const side_information_type& sid,
84  const point_basic<T>& hat_x,
85  Eigen::Matrix<T,Eigen::Dynamic,1>& value) const;
86 
87 // internals:
88 
89  // accessors to subgeo ndof & nnod by dimension (not available for basis_sides)
90  virtual size_type first_sid_inod (reference_element hat_K, size_type loc_isid) const {
91  return _first_sid_inod [hat_K.variant()][loc_isid];
92  }
93  virtual size_type first_sid_idof (reference_element hat_K, size_type loc_isid) const {
94  return _first_sid_idof [hat_K.variant()][loc_isid];
95  }
96  void _initialize_cstor_sizes() const;
97  void _initialize_data (reference_element hat_K) const;
98  void _compute_dofs (
99  reference_element hat_K,
100  const Eigen::Matrix<T,Eigen::Dynamic,1>& f_xnod, // scalar-valued case
101  Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const;
102 
103  // overload visualization:
104  virtual void put_scalar_valued (std::ostream& os, reference_element hat_K) const;
105 
106 protected:
107 // data:
109 
110  mutable std::array<
111  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>,
113 
114  // nodes and dofs are organized by side=0..6 of subgeos, for each hat_K:
115  mutable std::array<
116  std::array<size_type,reference_element::max_side_by_variant+1>,
119 
120  // working array:
121  mutable Eigen::Matrix<T,Eigen::Dynamic,1> _sid_value;
122 };
123 
124 } // namespace rheolef
125 #endif // _RHEOLEF_BASIS_FEM_SIDES_H
field::size_type size_type
Definition: branch.cc:425
basis_fem_sides(const basis_basic< T > &side_basis)
std::array< std::array< size_type, reference_element::max_side_by_variant+1 >, reference_element::max_variant > _first_sid_idof
basis_basic< T > _side_basis
void evaluate_on_side(reference_element hat_K, const side_information_type &sid, const point_basic< T > &hat_x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &value) const
std::array< Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 >, reference_element::max_variant > _hat_node
reference_element::size_type size_type
void local_idof_on_side(reference_element hat_K, const side_information_type &sid, Eigen::Matrix< size_type, Eigen::Dynamic, 1 > &loc_idof) const
Eigen::Matrix< T, Eigen::Dynamic, 1 > _sid_value
std::array< std::array< size_type, reference_element::max_side_by_variant+1 >, reference_element::max_variant > _first_sid_inod
size_type degree() const
void _initialize_cstor_sizes() const
virtual size_type first_sid_inod(reference_element hat_K, size_type loc_isid) const
size_type local_ndof_on_side(reference_element hat_K, const side_information_type &sid) const
virtual void put_scalar_valued(std::ostream &os, reference_element hat_K) const
void _compute_dofs(reference_element hat_K, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &f_xnod, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof) const
size_type family_index() const
virtual size_type first_sid_idof(reference_element hat_K, size_type loc_isid) const
const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
std::string family_name() const
void _initialize_data(reference_element hat_K) const
see the reference_element page for the full documentation
static const variant_type max_variant
variant_type variant() const
std::vector< int >::size_type size_type
rheolef::std value
Expr1::float_type T
Definition: field_expr.h:261
This file is part of Rheolef.