Rheolef  7.1
an efficient C++ finite element environment
basis_fem_vector.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_BASIS_FEM_VECTOR_H
2 #define _RHEOLEF_BASIS_FEM_VECTOR_H
23 /*Class:sherwin
24 NAME: @code{vector(X)} - vector-valued basis
25 @cindex polynomial basis
26 @clindex space
27 @clindex basis
28 @clindex reference_element
29 SYNOPSIS:
30  space Mh (omega,"P1","vector");
31 DESCRIPTION:
32  @noindent
33  This polynomial @code{basis} is used for vector-valued basis
34  when all components are approcimated by the same scalar-valued basis.
35 AUTHOR: Pierre.Saramito@imag.fr
36 DATE: 25 january 2019
37 End:
38 */
39 #include "rheolef/basis.h"
40 namespace rheolef {
41 
42 template<class T>
43 class basis_fem_vector: public basis_rep<T> {
44 public:
45 
46 // typedefs:
47 
48  typedef basis_rep<T> base;
49  typedef typename base::size_type size_type;
52 
53 // allocators:
54 
55  basis_fem_vector (const basis_basic<T>& scalar_basis, const basis_option& sopt);
57 
58 // accessors:
59 
60  std::string family_name() const { return _scalar_basis.family_name(); }
61  size_type family_index() const { return _scalar_basis.family_index(); }
62  size_type degree() const { return _scalar_basis.degree(); }
64  bool is_hierarchical() const { return true; }
65  size_type size() const { return _n_comp; }
66  const basis_basic<T>& operator[] (size_type i_comp) const { return _scalar_basis; }
67  bool is_continuous() const { return _scalar_basis.is_continuous(); }
68  bool have_index_parameter() const { return _scalar_basis.have_index_parameter(); }
69  bool have_continuous_feature() const { return _scalar_basis.have_continuous_feature(); }
70  bool is_nodal() const { return _scalar_basis.is_nodal(); }
71  bool have_compact_support_inside_element() const { return _scalar_basis.have_compact_support_inside_element(); }
72 
73  const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
74  hat_node (reference_element hat_K) const;
75 
76 // evaluation of all basis functions at hat_x:
77 
78  void evaluate (
79  reference_element hat_K,
80  const point_basic<T>& hat_x,
81  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& value) const;
82 
83  void grad_evaluate (
84  reference_element hat_K,
85  const point_basic<T>& hat_x,
86  Eigen::Matrix<tensor_basic<T>,Eigen::Dynamic,1>& value) const;
87 
88 // internals:
89 
90  void _initialize_cstor_sizes() const;
91  void _initialize_data (reference_element hat_K) const;
92 
93 // dofs for a vector-valued function
94  void _compute_dofs (
95  reference_element hat_K,
96  const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& f_xnod,
97  Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const;
98 
99 protected:
100 // data:
103 
104 // working area:
105  mutable Eigen::Matrix<T,Eigen::Dynamic,1> _scalar_value;
106  mutable Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1> _vector_value;
107 };
108 
109 } // namespace rheolef
110 #endif // _RHEOLEF_BASIS_FEM_VECTOR_H
basis_fem_vector(const basis_basic< T > &scalar_basis, const basis_option &sopt)
bool have_compact_support_inside_element() const
valued_type valued_tag() const
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< tensor_basic< T >, Eigen::Dynamic, 1 > &value) const
point_basic< T > value_type
bool have_continuous_feature() const
const basis_basic< T > & operator[](size_type i_comp) const
space_constant::valued_type valued_type
size_type degree() const
Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > _vector_value
Eigen::Matrix< T, Eigen::Dynamic, 1 > _scalar_value
void _initialize_cstor_sizes() const
basis_basic< T > _scalar_basis
void 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< point_basic< T >, Eigen::Dynamic, 1 > &f_xnod, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof) const
size_type family_index() 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 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
rheolef::std value
This file is part of Rheolef.