Loading...
Searching...
No Matches
basis_fem_trace_n.h
Go to the documentation of this file.
#ifndef _RHEOLEF_BASIS_FEM_TRACE_N_H
#define _RHEOLEF_BASIS_FEM_TRACE_N_H
/*Class:sherwin
NAME: @code{trace_n(RTkd)} - normal trace of a basis on element boundaries
@cindex polynomial basis
@clindex space
@clindex basis
@clindex reference_element
SYNOPSIS:
space Mh (omega,"trace_n(RT1d)");
DESCRIPTION:
@noindent
This polynomial @code{basis} is used by the postprocessing stage of the
hybrid high order (HHO) finite element method.
It is indicated in the @code{space} (see @ref{space class}) by
inserting the "trace_n(.)" operator around
an H(div) element characterisation, e.g. Raviart-Thomas
(see @ref{basis class}).
AUTHOR: Pierre.Saramito@imag.fr
DATE: 23 march 2020
End:
*/
#include "rheolef/basis.h"
namespace rheolef {
template<class T>
class basis_fem_trace_n: 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_trace_n (const basis_basic<T>& vec_basis);
~basis_fem_trace_n();
// accessors:
std::string family_name() const { return _vec_basis.family_name(); }
size_type family_index() const { return _vec_basis.family_index(); }
size_type degree() const { return _vec_basis.family_index(); }
bool is_nodal() const { return _tr_n_basis.is_nodal(); }
const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
hat_node (reference_element hat_K) const;
size_type local_ndof_on_side (
reference_element hat_K,
const side_information_type& sid) const;
void local_idof_on_side (
reference_element hat_K,
const side_information_type& sid,
Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof) const;
// evaluation of all basis functions at hat_x:
void evaluate_on_side (
reference_element hat_K,
const side_information_type& sid,
const point_basic<T>& hat_x,
Eigen::Matrix<T,Eigen::Dynamic,1>& value) const;
// internals:
// accessors to subgeo ndof & nnod by dimension (not available for basis_trace_n)
virtual size_type first_sid_inod (reference_element hat_K, size_type loc_isid) const {
return _first_sid_inod [hat_K.variant()][loc_isid];
}
virtual size_type first_sid_idof (reference_element hat_K, size_type loc_isid) const {
return _first_sid_idof [hat_K.variant()][loc_isid];
}
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;
// overload visualization:
virtual void put_scalar_valued (std::ostream& os, reference_element hat_K) const;
protected:
// data:
basis_basic<T> _vec_basis,
_tr_n_basis;
mutable std::array<
Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>,
reference_element::max_variant> _hat_node;
// nodes and dofs are organized by side=0..6 of subgeos, for each hat_K:
mutable std::array<
std::array<size_type,reference_element::max_side_by_variant+1>,
reference_element::max_variant>
_first_sid_inod, _first_sid_idof;
// working array:
mutable Eigen::Matrix<T,Eigen::Dynamic,1> _sid_value;
};
} // namespace rheolef
#endif // _RHEOLEF_BASIS_FEM_TRACE_N_H
size_type
field::size_type size_type
Definition branch.cc:430
rheolef::basis_basic
Definition basis.h:566
rheolef::basis_fem_trace_n
Definition basis_fem_trace_n.h:48
rheolef::basis_fem_trace_n::base
basis_rep< T > base
Definition basis_fem_trace_n.h:53
rheolef::basis_fem_trace_n::local_ndof_on_side
size_type local_ndof_on_side(reference_element hat_K, const side_information_type &sid) const
Definition basis_fem_trace_n.cc:161
rheolef::basis_fem_trace_n::_first_sid_idof
std::array< std::array< size_type, reference_element::max_side_by_variant+1 >, reference_element::max_variant > _first_sid_idof
Definition basis_fem_trace_n.h:119
rheolef::basis_fem_trace_n::value_type
T value_type
Definition basis_fem_trace_n.h:55
rheolef::basis_fem_trace_n::evaluate_on_side
void evaluate_on_side(reference_element hat_K, const side_information_type &sid, const point_basic< T > &hat_x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &value) const
Definition basis_fem_trace_n.cc:139
rheolef::basis_fem_trace_n::_hat_node
std::array< Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 >, reference_element::max_variant > _hat_node
Definition basis_fem_trace_n.h:113
rheolef::basis_fem_trace_n::size_type
reference_element::size_type size_type
Definition basis_fem_trace_n.h:54
rheolef::basis_fem_trace_n::_tr_n_basis
basis_basic< T > _tr_n_basis
Definition basis_fem_trace_n.h:109
rheolef::basis_fem_trace_n::local_idof_on_side
void local_idof_on_side(reference_element hat_K, const side_information_type &sid, Eigen::Matrix< size_type, Eigen::Dynamic, 1 > &loc_idof) const
Definition basis_fem_trace_n.cc:171
rheolef::basis_fem_trace_n::_sid_value
Eigen::Matrix< T, Eigen::Dynamic, 1 > _sid_value
Definition basis_fem_trace_n.h:122
rheolef::basis_fem_trace_n::_first_sid_inod
std::array< std::array< size_type, reference_element::max_side_by_variant+1 >, reference_element::max_variant > _first_sid_inod
Definition basis_fem_trace_n.h:119
rheolef::basis_fem_trace_n::degree
size_type degree() const
Definition basis_fem_trace_n.h:66
rheolef::basis_fem_trace_n::_initialize_cstor_sizes
void _initialize_cstor_sizes() const
Definition basis_fem_trace_n.cc:73
rheolef::basis_fem_trace_n::first_sid_inod
virtual size_type first_sid_inod(reference_element hat_K, size_type loc_isid) const
Definition basis_fem_trace_n.h:90
rheolef::basis_fem_trace_n::put_scalar_valued
virtual void put_scalar_valued(std::ostream &os, reference_element hat_K) const
Definition basis_fem_trace_n.cc:202
rheolef::basis_fem_trace_n::_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_trace_n.cc:189
rheolef::basis_fem_trace_n::family_index
size_type family_index() const
Definition basis_fem_trace_n.h:65
rheolef::basis_fem_trace_n::first_sid_idof
virtual size_type first_sid_idof(reference_element hat_K, size_type loc_isid) const
Definition basis_fem_trace_n.h:93
rheolef::basis_fem_trace_n::hat_node
const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
Definition basis_fem_trace_n.cc:129
rheolef::basis_fem_trace_n::~basis_fem_trace_n
~basis_fem_trace_n()
Definition basis_fem_trace_n.cc:40
rheolef::basis_fem_trace_n::is_nodal
bool is_nodal() const
Definition basis_fem_trace_n.h:67
rheolef::basis_fem_trace_n::family_name
std::string family_name() const
Definition basis_fem_trace_n.h:64
rheolef::basis_fem_trace_n::_vec_basis
basis_basic< T > _vec_basis
Definition basis_fem_trace_n.h:108
rheolef::basis_fem_trace_n::_initialize_data
void _initialize_data(reference_element hat_K) const
Definition basis_fem_trace_n.cc:100
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::variant
variant_type variant() const
Definition reference_element.h:99
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
rheolef::side_information_type
Definition reference_element_face_transformation.h:37