Loading...
Searching...
No Matches
basis_fem_vector.h
Go to the documentation of this file.
#ifndef _RHEOLEF_BASIS_FEM_VECTOR_H
#define _RHEOLEF_BASIS_FEM_VECTOR_H
/*Class:sherwin
NAME: @code{vector(X)} - vector-valued basis
@cindex polynomial basis
@clindex space
@clindex basis
@clindex reference_element
SYNOPSIS:
space Mh (omega,"P1","vector");
DESCRIPTION:
@noindent
This polynomial @code{basis} is used for vector-valued basis
when all components are approcimated by the same scalar-valued basis.
AUTHOR: Pierre.Saramito@imag.fr
DATE: 25 january 2019
End:
*/
#include "rheolef/basis.h"
namespace rheolef {
template<class T>
class basis_fem_vector: public basis_rep<T> {
public:
// typedefs:
typedef basis_rep<T> base;
typedef typename base::size_type size_type;
typedef point_basic<T> value_type;
typedef space_constant::valued_type valued_type;
// allocators:
basis_fem_vector (const basis_basic<T>& scalar_basis, const basis_option& sopt);
~basis_fem_vector();
// accessors:
std::string family_name() const { return _scalar_basis.family_name(); }
size_type family_index() const { return _scalar_basis.family_index(); }
size_type degree() const { return _scalar_basis.degree(); }
valued_type valued_tag() const { return space_constant::vector; }
bool is_hierarchical() const { return true; }
size_type size() const { return _n_comp; }
const basis_basic<T>& operator[] (size_type i_comp) const { return _scalar_basis; }
bool is_continuous() const { return _scalar_basis.is_continuous(); }
bool have_index_parameter() const { return _scalar_basis.have_index_parameter(); }
bool have_continuous_feature() const { return _scalar_basis.have_continuous_feature(); }
bool is_nodal() const { return _scalar_basis.is_nodal(); }
bool have_compact_support_inside_element() const { return _scalar_basis.have_compact_support_inside_element(); }
const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
hat_node (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<point_basic<T>,Eigen::Dynamic,1>& value) const;
void grad_evaluate (
reference_element hat_K,
const point_basic<T>& hat_x,
Eigen::Matrix<tensor_basic<T>,Eigen::Dynamic,1>& value) const;
// internals:
void _initialize_cstor_sizes() const;
void _initialize_data (reference_element hat_K) const;
// dofs for a vector-valued function
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;
protected:
// data:
size_type _n_comp;
basis_basic<T> _scalar_basis;
// working area:
mutable Eigen::Matrix<T,Eigen::Dynamic,1> _scalar_value;
mutable Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1> _vector_value;
};
} // namespace rheolef
#endif // _RHEOLEF_BASIS_FEM_VECTOR_H
rheolef::basis_basic
Definition basis.h:566
rheolef::basis_fem_vector
Definition basis_fem_vector.h:43
rheolef::basis_fem_vector::is_continuous
bool is_continuous() const
Definition basis_fem_vector.h:67
rheolef::basis_fem_vector::base
basis_rep< T > base
Definition basis_fem_vector.h:48
rheolef::basis_fem_vector::_n_comp
size_type _n_comp
Definition basis_fem_vector.h:101
rheolef::basis_fem_vector::have_compact_support_inside_element
bool have_compact_support_inside_element() const
Definition basis_fem_vector.h:71
rheolef::basis_fem_vector::valued_tag
valued_type valued_tag() const
Definition basis_fem_vector.h:63
rheolef::basis_fem_vector::grad_evaluate
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< tensor_basic< T >, Eigen::Dynamic, 1 > &value) const
Definition basis_fem_vector.cc:114
rheolef::basis_fem_vector::value_type
point_basic< T > value_type
Definition basis_fem_vector.h:50
rheolef::basis_fem_vector::have_continuous_feature
bool have_continuous_feature() const
Definition basis_fem_vector.h:69
rheolef::basis_fem_vector::size
size_type size() const
Definition basis_fem_vector.h:65
rheolef::basis_fem_vector::size_type
base::size_type size_type
Definition basis_fem_vector.h:49
rheolef::basis_fem_vector::valued_type
space_constant::valued_type valued_type
Definition basis_fem_vector.h:51
rheolef::basis_fem_vector::degree
size_type degree() const
Definition basis_fem_vector.h:62
rheolef::basis_fem_vector::_vector_value
Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > _vector_value
Definition basis_fem_vector.h:106
rheolef::basis_fem_vector::_scalar_value
Eigen::Matrix< T, Eigen::Dynamic, 1 > _scalar_value
Definition basis_fem_vector.h:105
rheolef::basis_fem_vector::_initialize_cstor_sizes
void _initialize_cstor_sizes() const
Definition basis_fem_vector.cc:65
rheolef::basis_fem_vector::_scalar_basis
basis_basic< T > _scalar_basis
Definition basis_fem_vector.h:102
rheolef::basis_fem_vector::~basis_fem_vector
~basis_fem_vector()
Definition basis_fem_vector.cc:35
rheolef::basis_fem_vector::evaluate
void evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &value) const
Definition basis_fem_vector.cc:94
rheolef::basis_fem_vector::_compute_dofs
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
Definition basis_fem_vector.cc:136
rheolef::basis_fem_vector::family_index
size_type family_index() const
Definition basis_fem_vector.h:61
rheolef::basis_fem_vector::is_hierarchical
bool is_hierarchical() const
Definition basis_fem_vector.h:64
rheolef::basis_fem_vector::hat_node
const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
Definition basis_fem_vector.cc:88
rheolef::basis_fem_vector::operator[]
const basis_basic< T > & operator[](size_type i_comp) const
Definition basis_fem_vector.h:66
rheolef::basis_fem_vector::is_nodal
bool is_nodal() const
Definition basis_fem_vector.h:70
rheolef::basis_fem_vector::family_name
std::string family_name() const
Definition basis_fem_vector.h:60
rheolef::basis_fem_vector::have_index_parameter
bool have_index_parameter() const
Definition basis_fem_vector.h:68
rheolef::basis_fem_vector::_initialize_data
void _initialize_data(reference_element hat_K) const
Definition basis_fem_vector.cc:83
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::size_type
reference_element::size_type size_type
Definition basis.h:214
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::tensor_basic
Definition tensor.h:90
rheolef::space_constant::valued_type
valued_type
Definition space_constant.h:133
rheolef::space_constant::vector
@ vector
Definition space_constant.h:135
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39