Loading...
Searching...
No Matches
basis_fem_tensor.h
Go to the documentation of this file.
#ifndef _RHEOLEF_BASIS_FEM_TENSOR_H
#define _RHEOLEF_BASIS_FEM_TENSOR_H
/*Class:sherwin
NAME: @code{tensor(X)} - symmetric tensor-valued basis
@cindex polynomial basis
@clindex space
@clindex basis
@clindex reference_element
SYNOPSIS:
space Mh (omega,"P1","tensor");
DESCRIPTION:
@noindent
This polynomial @code{basis} is used for symmetric tensor-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_tensor: public basis_rep<T> {
public:
// typedefs:
typedef basis_rep<T> base;
typedef typename base::size_type size_type;
typedef tensor_basic<T> value_type;
typedef space_constant::valued_type valued_type;
// allocators:
basis_fem_tensor (const basis_basic<T>& scalar_basis, const basis_option& sopt);
~basis_fem_tensor();
// 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::tensor; }
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<tensor_basic<T>,Eigen::Dynamic,1>& value) const;
void grad_evaluate (
reference_element hat_K,
const point_basic<T>& hat_x,
Eigen::Matrix<tensor3_basic<T>,Eigen::Dynamic,1>& value) const;
// dofs for a tensor-valued function
void _compute_dofs (
reference_element hat_K,
const Eigen::Matrix<tensor_basic<T>,Eigen::Dynamic,1>& f_xnod,
Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const;
// internals:
void _initialize_cstor_sizes() const;
void _initialize_data (reference_element hat_K) 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_TENSOR_H
rheolef::basis_basic
Definition basis.h:566
rheolef::basis_fem_tensor::is_continuous
bool is_continuous() const
Definition basis_fem_tensor.h:67
rheolef::basis_fem_tensor::base
basis_rep< T > base
Definition basis_fem_tensor.h:48
rheolef::basis_fem_tensor::_n_comp
size_type _n_comp
Definition basis_fem_tensor.h:100
rheolef::basis_fem_tensor::have_compact_support_inside_element
bool have_compact_support_inside_element() const
Definition basis_fem_tensor.h:71
rheolef::basis_fem_tensor::_compute_dofs
void _compute_dofs(reference_element hat_K, const Eigen::Matrix< tensor_basic< T >, Eigen::Dynamic, 1 > &f_xnod, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof) const
Definition basis_fem_tensor.cc:159
rheolef::basis_fem_tensor::valued_tag
valued_type valued_tag() const
Definition basis_fem_tensor.h:63
rheolef::basis_fem_tensor::have_continuous_feature
bool have_continuous_feature() const
Definition basis_fem_tensor.h:69
rheolef::basis_fem_tensor::basis_fem_tensor
basis_fem_tensor(const basis_basic< T > &scalar_basis, const basis_option &sopt)
Definition basis_fem_tensor.cc:36
rheolef::basis_fem_tensor::size
size_type size() const
Definition basis_fem_tensor.h:65
rheolef::basis_fem_tensor::size_type
base::size_type size_type
Definition basis_fem_tensor.h:49
rheolef::basis_fem_tensor::valued_type
space_constant::valued_type valued_type
Definition basis_fem_tensor.h:51
rheolef::basis_fem_tensor::degree
size_type degree() const
Definition basis_fem_tensor.h:62
rheolef::basis_fem_tensor::_vector_value
Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > _vector_value
Definition basis_fem_tensor.h:105
rheolef::basis_fem_tensor::_scalar_value
Eigen::Matrix< T, Eigen::Dynamic, 1 > _scalar_value
Definition basis_fem_tensor.h:104
rheolef::basis_fem_tensor::_initialize_cstor_sizes
void _initialize_cstor_sizes() const
Definition basis_fem_tensor.cc:75
rheolef::basis_fem_tensor::value_type
tensor_basic< T > value_type
Definition basis_fem_tensor.h:50
rheolef::basis_fem_tensor::grad_evaluate
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< tensor3_basic< T >, Eigen::Dynamic, 1 > &value) const
Definition basis_fem_tensor.cc:130
rheolef::basis_fem_tensor::evaluate
void evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< tensor_basic< T >, Eigen::Dynamic, 1 > &value) const
Definition basis_fem_tensor.cc:104
rheolef::basis_fem_tensor::_scalar_basis
basis_basic< T > _scalar_basis
Definition basis_fem_tensor.h:101
rheolef::basis_fem_tensor::family_index
size_type family_index() const
Definition basis_fem_tensor.h:61
rheolef::basis_fem_tensor::is_hierarchical
bool is_hierarchical() const
Definition basis_fem_tensor.h:64
rheolef::basis_fem_tensor::hat_node
const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
Definition basis_fem_tensor.cc:98
rheolef::basis_fem_tensor::operator[]
const basis_basic< T > & operator[](size_type i_comp) const
Definition basis_fem_tensor.h:66
rheolef::basis_fem_tensor::~basis_fem_tensor
~basis_fem_tensor()
Definition basis_fem_tensor.cc:32
rheolef::basis_fem_tensor::is_nodal
bool is_nodal() const
Definition basis_fem_tensor.h:70
rheolef::basis_fem_tensor::family_name
std::string family_name() const
Definition basis_fem_tensor.h:60
rheolef::basis_fem_tensor::have_index_parameter
bool have_index_parameter() const
Definition basis_fem_tensor.h:68
rheolef::basis_fem_tensor::_initialize_data
void _initialize_data(reference_element hat_K) const
Definition basis_fem_tensor.cc:93
rheolef::basis_option
Definition basis_option.h:93
rheolef::basis_rep::basis_rep
basis_rep(const basis_option &sopt)
Definition basis_rep.cc:107
rheolef::basis_rep::size_type
reference_element::size_type size_type
Definition basis.h:214
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::tensor3_basic
Definition tensor3.h:73
rheolef::tensor_basic
Definition tensor.h:90
rheolef::space_constant::valued_type
valued_type
Definition space_constant.h:133
rheolef::space_constant::tensor
@ tensor
Definition space_constant.h:136
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39