Rheolef  7.2
an efficient C++ finite element environment
basis_fem_Pk_bernstein.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_BASIS_FEM_PK_BERNSTEIN_H
2 #define _RHEOLEF_BASIS_FEM_PK_BERNSTEIN_H
23 /*Class:sherwin
24 NAME: @code{Bk} - Bernstein polynomial basis
25 @cindex polynomial basis
26 @clindex space
27 @clindex basis
28 @clindex reference_element
29 @clindex basis_option
30 SYNOPSIS:
31  space Vh(omega,"B5");
32 DESCRIPTION:
33  @noindent
34  This @code{basis} was initially introduced by Bernstein
35  (Comm. Soc. Math. Kharkov, 2th series, 1912) and more
36  recently used in the context of finite elements.
37  It is indicated in the @code{space} (see @ref{space class})
38  by a string starting with
39  the letter @code{"B"},
40  followed by digits indicating the polynomial order.
41 
42 OPTIONS:
43  This basis do not recognizes any option.
44  See @ref{basis_option class}.
45 
46 AUTHOR: Pierre.Saramito@imag.fr
47 DATE: 23 september 2017
48 End:
49 */
50 //
51 // Bernstein Pk basis
52 //
53 // author: Pierre.Saramito@imag.fr
54 //
55 // date: 11 september 2017
56 //
57 #include "rheolef/basis.h"
58 namespace rheolef {
59 
60 template<class T>
62 public:
63 
64 // typedefs:
65 
66  typedef basis_rep<T> base;
68  typedef T value_type;
69 
70 // allocators:
71 
74 
75 // accessors:
76 
77  std::string family_name() const { return "B"; }
78  size_type degree() const { return _raw_basis.degree(); }
79  bool is_nodal() const { return false; }
80 
81  const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
82  hat_node (reference_element hat_K) const;
83 
84  const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
85  vdm (reference_element hat_K) const;
86 
87  const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
88  inv_vdm (reference_element hat_K) const;
89 
90 
91 // evaluation of all basis functions at hat_x:
92 
93  void evaluate (
94  reference_element hat_K,
95  const point_basic<T>& hat_x,
96  Eigen::Matrix<T,Eigen::Dynamic,1>& value) const;
97 
98 // evaluate the gradient:
99 
100  void grad_evaluate (
101  reference_element hat_K,
102  const point_basic<T>& hat_x,
103  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& value) const;
104 
105 // internals:
106 
107  void _initialize_cstor_sizes() const;
108  void _initialize_data (reference_element hat_K) const;
109  void _compute_dofs (
110  reference_element hat_K,
111  const Eigen::Matrix<T,Eigen::Dynamic,1>& f_xnod, // scalar-valued case
112  Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const;
113 
114 protected:
115 // data:
117 
118  mutable std::array<
119  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>,
121 
122  mutable std::array<Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>,
124 };
125 
126 } // namespace rheolef
127 #endif // _RHEOLEF_BASIS_FEM_PK_BERNSTEIN_H
std::array< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic >, reference_element::max_variant > _inv_vdm
basis_fem_Pk_bernstein(size_type degree, const basis_option &sopt)
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & vdm(reference_element hat_K) const
std::array< Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 >, reference_element::max_variant > _hat_node
reference_element::size_type size_type
void evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &value) const
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &value) const
std::array< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic >, reference_element::max_variant > _vdm
void _compute_dofs(reference_element hat_K, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &f_xnod, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof) const
const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & inv_vdm(reference_element hat_K) const
void _initialize_data(reference_element hat_K) const
see the basis_option page for the full documentation
Definition: basis_option.h:93
reference_element::size_type size_type
Definition: basis.h:214
see the reference_element page for the full documentation
static const variant_type max_variant
std::vector< int >::size_type size_type
rheolef::std value
Expr1::float_type T
Definition: field_expr.h:230
This file is part of Rheolef.