basis_fem_Pk_bernstein.h
Go to the documentation of this file.
#ifndef _RHEOLEF_BASIS_FEM_PK_BERNSTEIN_H
#define _RHEOLEF_BASIS_FEM_PK_BERNSTEIN_H
/*Class:sherwin
NAME: @code{Bk} - Bernstein polynomial basis
@cindex polynomial basis
@clindex space
@clindex basis
@clindex reference_element
@clindex basis_option
SYNOPSIS:
space Vh(omega,"B5");
DESCRIPTION:
@noindent
This @code{basis} was initially introduced by Bernstein
(Comm. Soc. Math. Kharkov, 2th series, 1912) and more
recently used in the context of finite elements.
It is indicated in the @code{space} (see @ref{space class})
by a string starting with
the letter @code{"B"},
followed by digits indicating the polynomial order.
OPTIONS:
This basis do not recognizes any option.
See @ref{basis_option class}.
AUTHOR: Pierre.Saramito@imag.fr
DATE: 23 september 2017
End:
*/
//
// Bernstein Pk basis
//
// author: Pierre.Saramito@imag.fr
//
// date: 11 september 2017
//
#include "rheolef/basis.h"
namespace rheolef {
template<class T>
class basis_fem_Pk_bernstein: 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_bernstein (size_type degree, const basis_option& sopt);
~basis_fem_Pk_bernstein();
// accessors:
std::string family_name() const { return "B"; }
size_type degree() const { return _raw_basis.degree(); }
bool is_nodal() const { return false; }
const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
hat_node (reference_element hat_K) const;
const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
vdm (reference_element hat_K) const;
const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
inv_vdm (reference_element hat_K) const;
// 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;
// internals:
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:
basis_raw_basic<T> _raw_basis;
mutable std::array<
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>,
reference_element::max_variant> _hat_node;
mutable std::array<Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>,
reference_element::max_variant> _vdm, _inv_vdm;
};
} // namespace rheolef
#endif // _RHEOLEF_BASIS_FEM_PK_BERNSTEIN_H
rheolef::basis_fem_Pk_bernstein
Definition: basis_fem_Pk_bernstein.h:61
rheolef::basis_fem_Pk_bernstein::base
basis_rep< T > base
Definition: basis_fem_Pk_bernstein.h:66
rheolef::basis_fem_Pk_bernstein::_inv_vdm
std::array< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic >, reference_element::max_variant > _inv_vdm
Definition: basis_fem_Pk_bernstein.h:123
rheolef::basis_fem_Pk_bernstein::value_type
T value_type
Definition: basis_fem_Pk_bernstein.h:68
rheolef::basis_fem_Pk_bernstein::_raw_basis
basis_raw_basic< T > _raw_basis
Definition: basis_fem_Pk_bernstein.h:116
rheolef::basis_fem_Pk_bernstein::basis_fem_Pk_bernstein
basis_fem_Pk_bernstein(size_type degree, const basis_option &sopt)
Definition: basis_fem_Pk_bernstein.cc:41
rheolef::basis_fem_Pk_bernstein::vdm
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & vdm(reference_element hat_K) const
Definition: basis_fem_Pk_bernstein.cc:78
rheolef::basis_fem_Pk_bernstein::_hat_node
std::array< Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 >, reference_element::max_variant > _hat_node
Definition: basis_fem_Pk_bernstein.h:120
rheolef::basis_fem_Pk_bernstein::size_type
reference_element::size_type size_type
Definition: basis_fem_Pk_bernstein.h:67
rheolef::basis_fem_Pk_bernstein::degree
size_type degree() const
Definition: basis_fem_Pk_bernstein.h:78
rheolef::basis_fem_Pk_bernstein::_initialize_cstor_sizes
void _initialize_cstor_sizes() const
Definition: basis_fem_Pk_bernstein.cc:59
rheolef::basis_fem_Pk_bernstein::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_bernstein.cc:115
rheolef::basis_fem_Pk_bernstein::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_bernstein.cc:126
rheolef::basis_fem_Pk_bernstein::~basis_fem_Pk_bernstein
~basis_fem_Pk_bernstein()
Definition: basis_fem_Pk_bernstein.cc:37
rheolef::basis_fem_Pk_bernstein::_vdm
std::array< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic >, reference_element::max_variant > _vdm
Definition: basis_fem_Pk_bernstein.h:123
rheolef::basis_fem_Pk_bernstein::_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_bernstein.cc:137
rheolef::basis_fem_Pk_bernstein::hat_node
const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
Definition: basis_fem_Pk_bernstein.cc:71
rheolef::basis_fem_Pk_bernstein::is_nodal
bool is_nodal() const
Definition: basis_fem_Pk_bernstein.h:79
rheolef::basis_fem_Pk_bernstein::family_name
std::string family_name() const
Definition: basis_fem_Pk_bernstein.h:77
rheolef::basis_fem_Pk_bernstein::inv_vdm
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & inv_vdm(reference_element hat_K) const
Definition: basis_fem_Pk_bernstein.cc:85
rheolef::basis_fem_Pk_bernstein::_initialize_data
void _initialize_data(reference_element hat_K) const
Definition: basis_fem_Pk_bernstein.cc:92
rheolef::basis_option
see the basis_option page for the full documentation
Definition: basis_option.h:93
rheolef::basis_raw_basic
Definition: basis_raw.h:107
rheolef::basis_rep
Definition: basis.h:209
rheolef::basis_rep::size_type
reference_element::size_type size_type
Definition: basis.h:214
rheolef::point_basic
Definition: point.h:87
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
rheolef::value
rheolef::std value
T
Expr1::float_type T
Definition: field_expr.h:261
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37