Loading...
Searching...
No Matches
basis_fem_Pk_sherwin.h
Go to the documentation of this file.
#ifndef _RHEOLEF_BASIS_FEM_PK_SHERWIN_H
#define _RHEOLEF_BASIS_FEM_PK_SHERWIN_H
/*Class:sherwin
NAME: @code{Sk} - Dubiner-Sherwin-Karniadakis polynomial basis
@cindex polynomial basis
@clindex space
@clindex basis
@clindex reference_element
SYNOPSIS:
space Vh(omega,"S5");
DESCRIPTION:
@noindent
This @code{basis} is described for the triangle
by Dubiner (J. Sci. Comput., 1991)
and extended by Sherwin and Karniadakis (2005, Cambridge Univ. Press)
to others reference elements.
It is indicated in the @code{space} (see @ref{space class})
by a string starting with
the letter @code{"S"},
followed by digits indicating the polynomial order.
OPTIONS:
This basis recognizes the equispaced/warburton node option
for degrees of freedom located on sides.
See @ref{basis_option class}.
AUTHOR: Pierre.Saramito@imag.fr
DATE: 23 september 2017
End:
*/
#include "rheolef/basis.h"
#include "rheolef/ad3.h"
namespace rheolef {
template<class T>
class basis_fem_Pk_sherwin: public basis_rep<T> {
public:
// typedefs:
typedef basis_rep<T> base;
typedef reference_element::size_type size_type;
typedef T value_type;
// allocators:
basis_fem_Pk_sherwin (size_type degree, const basis_option& sopt);
~basis_fem_Pk_sherwin();
// accessors:
std::string family_name() const { return "S"; }
size_type degree() const { return _degree; }
bool is_nodal() const { return false; }
// evaluation of all basis functions at hat_x:
void evaluate (
reference_element hat_K,
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& value) const;
// evaluate the gradient:
void grad_evaluate (
reference_element hat_K,
const point_basic<T>& hat_x,
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& value) const;
void _initialize_cstor_sizes() const;
void _initialize_data (reference_element hat_K) const;
void _compute_dofs (
reference_element hat_K,
const Eigen::Matrix<T,Eigen::Dynamic,1>& f_xnod, // scalar-valued case
Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const;
protected:
// data:
size_type _degree;
T _alpha;
T _beta;
#ifdef TODO
mutable std::array<std::vector<ad3_basic<T> >,
reference_element::max_variant> _value_ad;
mutable std::vector<ad3_basic<T> > _work0_ad, _work1_ad, _work2_ad;
mutable Eigen::Matrix<T,Eigen::Dynamic,1> _work0, _work1, _work2;
#endif // TODO
};
} // namespace rheolef
#endif // _RHEOLEF_BASIS_FEM_PK_SHERWIN_H
rheolef::basis_fem_Pk_sherwin
Definition basis_fem_Pk_sherwin.h:56
rheolef::basis_fem_Pk_sherwin::base
basis_rep< T > base
Definition basis_fem_Pk_sherwin.h:61
rheolef::basis_fem_Pk_sherwin::_work1_ad
std::vector< ad3_basic< T > > _work1_ad
Definition basis_fem_Pk_sherwin.h:107
rheolef::basis_fem_Pk_sherwin::~basis_fem_Pk_sherwin
~basis_fem_Pk_sherwin()
Definition basis_fem_Pk_sherwin.cc:38
rheolef::basis_fem_Pk_sherwin::_work2
Eigen::Matrix< T, Eigen::Dynamic, 1 > _work2
Definition basis_fem_Pk_sherwin.h:109
rheolef::basis_fem_Pk_sherwin::value_type
T value_type
Definition basis_fem_Pk_sherwin.h:63
rheolef::basis_fem_Pk_sherwin::_alpha
T _alpha
Definition basis_fem_Pk_sherwin.h:100
rheolef::basis_fem_Pk_sherwin::_value_ad
std::array< std::vector< ad3_basic< T > >, reference_element::max_variant > _value_ad
Definition basis_fem_Pk_sherwin.h:105
rheolef::basis_fem_Pk_sherwin::size_type
reference_element::size_type size_type
Definition basis_fem_Pk_sherwin.h:62
rheolef::basis_fem_Pk_sherwin::_work0
Eigen::Matrix< T, Eigen::Dynamic, 1 > _work0
Definition basis_fem_Pk_sherwin.h:109
rheolef::basis_fem_Pk_sherwin::_work0_ad
std::vector< ad3_basic< T > > _work0_ad
Definition basis_fem_Pk_sherwin.h:107
rheolef::basis_fem_Pk_sherwin::_beta
T _beta
Definition basis_fem_Pk_sherwin.h:101
rheolef::basis_fem_Pk_sherwin::degree
size_type degree() const
Definition basis_fem_Pk_sherwin.h:73
rheolef::basis_fem_Pk_sherwin::_work2_ad
std::vector< ad3_basic< T > > _work2_ad
Definition basis_fem_Pk_sherwin.h:107
rheolef::basis_fem_Pk_sherwin::_initialize_cstor_sizes
void _initialize_cstor_sizes() const
Definition basis_fem_Pk_sherwin.cc:70
rheolef::basis_fem_Pk_sherwin::evaluate
void evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &value) const
Definition basis_fem_Pk_sherwin.cc:112
rheolef::basis_fem_Pk_sherwin::grad_evaluate
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &value) const
Definition basis_fem_Pk_sherwin.cc:126
rheolef::basis_fem_Pk_sherwin::_degree
size_type _degree
Definition basis_fem_Pk_sherwin.h:99
rheolef::basis_fem_Pk_sherwin::_compute_dofs
void _compute_dofs(reference_element hat_K, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &f_xnod, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof) const
Definition basis_fem_Pk_sherwin.cc:150
rheolef::basis_fem_Pk_sherwin::is_nodal
bool is_nodal() const
Definition basis_fem_Pk_sherwin.h:74
rheolef::basis_fem_Pk_sherwin::family_name
std::string family_name() const
Definition basis_fem_Pk_sherwin.h:72
rheolef::basis_fem_Pk_sherwin::_work1
Eigen::Matrix< T, Eigen::Dynamic, 1 > _work1
Definition basis_fem_Pk_sherwin.h:109
rheolef::basis_fem_Pk_sherwin::_initialize_data
void _initialize_data(reference_element hat_K) const
Definition basis_fem_Pk_sherwin.cc:86
rheolef::basis_option
see the basis_option page for the full documentation
Definition basis_option.h:93
rheolef::basis_rep
Definition basis.h:209
rheolef::basis_rep::vector
vector
Definition basis.h:323
rheolef::point_basic
Definition point.h:86
rheolef::reference_element
see the reference_element page for the full documentation
Definition reference_element.h:66
rheolef::reference_element::max_variant
static const variant_type max_variant
Definition reference_element.h:82
rheolef::reference_element::size_type
std::vector< int >::size_type size_type
Definition reference_element.h:71
T
Expr1::float_type T
Definition field_expr.h:230
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39