Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
basis_fem_Pk_sherwin.h
Go to the documentation of this file.
1#ifndef _RHEOLEF_BASIS_FEM_PK_SHERWIN_H
2#define _RHEOLEF_BASIS_FEM_PK_SHERWIN_H
23/*Class:sherwin
24NAME: @code{Sk} - Dubiner-Sherwin-Karniadakis polynomial basis
25@cindex polynomial basis
26@clindex space
27@clindex basis
28@clindex reference_element
29SYNOPSIS:
30 space Vh(omega,"S5");
31DESCRIPTION:
32 @noindent
33 This @code{basis} is described for the triangle
34 by Dubiner (J. Sci. Comput., 1991)
35 and extended by Sherwin and Karniadakis (2005, Cambridge Univ. Press)
36 to others reference elements.
37 It is indicated in the @code{space} (see @ref{space class})
38 by a string starting with
39 the letter @code{"S"},
40 followed by digits indicating the polynomial order.
41
42OPTIONS:
43 This basis recognizes the equispaced/warburton node option
44 for degrees of freedom located on sides.
45 See @ref{basis_option class}.
46
47AUTHOR: Pierre.Saramito@imag.fr
48DATE: 23 september 2017
49End:
50*/
51#include "rheolef/basis.h"
52#include "rheolef/ad3.h"
53namespace rheolef {
54
55template<class T>
57public:
58
59// typedefs:
60
63 typedef T value_type;
64
65// allocators:
66
69
70// accessors:
71
72 std::string family_name() const { return "S"; }
73 size_type degree() const { return _degree; }
74 bool is_nodal() const { return false; }
75
76// evaluation of all basis functions at hat_x:
77
78 void evaluate (
80 const point_basic<T>& hat_x,
81 Eigen::Matrix<T,Eigen::Dynamic,1>& value) const;
82
83// evaluate the gradient:
84
85 void grad_evaluate (
87 const point_basic<T>& hat_x,
88 Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& value) const;
89
90 void _initialize_cstor_sizes() const;
91 void _initialize_data (reference_element hat_K) const;
92 void _compute_dofs (
93 reference_element hat_K,
94 const Eigen::Matrix<T,Eigen::Dynamic,1>& f_xnod, // scalar-valued case
95 Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const;
96
97protected:
98// data:
102
103#ifdef TODO
104 mutable std::array<std::vector<ad3_basic<T> >,
106
107 mutable std::vector<ad3_basic<T> > _work0_ad, _work1_ad, _work2_ad;
108
109 mutable Eigen::Matrix<T,Eigen::Dynamic,1> _work0, _work1, _work2;
110#endif // TODO
111};
112
113} // namespace rheolef
114#endif // _RHEOLEF_BASIS_FEM_PK_SHERWIN_H
std::vector< ad3_basic< T > > _work1_ad
Eigen::Matrix< T, Eigen::Dynamic, 1 > _work2
std::array< std::vector< ad3_basic< T > >, reference_element::max_variant > _value_ad
reference_element::size_type size_type
Eigen::Matrix< T, Eigen::Dynamic, 1 > _work0
std::vector< ad3_basic< T > > _work0_ad
std::vector< ad3_basic< T > > _work2_ad
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
void _compute_dofs(reference_element hat_K, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &f_xnod, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof) const
Eigen::Matrix< T, Eigen::Dynamic, 1 > _work1
void _initialize_data(reference_element hat_K) const
see the basis_option page for the full documentation
see the reference_element page for the full documentation
static const variant_type max_variant
std::vector< int >::size_type size_type
Expr1::float_type T
Definition field_expr.h:230
This file is part of Rheolef.