basis_fem_sides.h
Go to the documentation of this file.
#ifndef _RHEOLEF_BASIS_FEM_SIDES_H
#define _RHEOLEF_BASIS_FEM_SIDES_H
/*Class:sherwin
NAME: @code{Pkd[sides]} - trace of a basis on element boundaries
@cindex polynomial basis
@clindex space
@clindex basis
@clindex reference_element
SYNOPSIS:
space Mh (omega,"RT1d[sides]");
DESCRIPTION:
@noindent
This polynomial @code{basis} is used by the postprocessing stage of the
hybrid discontinuous Galerkin finite element method.
It is indicated in the @code{space} (see @ref{space class}) by
inserting the "[sides]" option between square braces after
the classical element characterisation
(see @ref{basis_option class}).
AUTHOR: Pierre.Saramito@imag.fr
DATE: 2 january 2019
End:
*/
#include "rheolef/basis.h"
namespace rheolef {
template<class T>
class basis_fem_sides: 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_sides (const basis_basic<T>& side_basis);
~basis_fem_sides();
// accessors:
std::string family_name() const { return _side_basis.family_name(); }
size_type family_index() const { return _side_basis.family_index(); }
size_type degree() const { return _side_basis.degree(); }
bool is_nodal() const { return _side_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_sides)
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> _side_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_SIDES_H
rheolef::basis_fem_sides::family_index
size_type family_index() const
Definition: basis_fem_sides.h:65
rheolef::basis_fem_sides::_initialize_cstor_sizes
void _initialize_cstor_sizes() const
Definition: basis_fem_sides.cc:92
rheolef::point_basic
Definition: point.h:87
rheolef::basis_fem_sides::degree
size_type degree() const
Definition: basis_fem_sides.h:66
rheolef::basis_fem_sides::put_scalar_valued
virtual void put_scalar_valued(std::ostream &os, reference_element hat_K) const
Definition: basis_fem_sides.cc:219
rheolef::basis_fem_sides::_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_sides.h:118
rheolef::value
rheolef::std value
rheolef::basis_fem_sides::_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_sides.cc:206
rheolef::basis_fem_sides::hat_node
const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
Definition: basis_fem_sides.cc:146
rheolef::basis_fem_sides::family_name
std::string family_name() const
Definition: basis_fem_sides.h:64
rheolef::basis_fem_sides::first_sid_inod
virtual size_type first_sid_inod(reference_element hat_K, size_type loc_isid) const
Definition: basis_fem_sides.h:90
rheolef::side_information_type
Definition: reference_element_face_transformation.h:37
rheolef::basis_basic
Definition: basis.h:206
rheolef::reference_element
see the reference_element page for the full documentation
Definition: reference_element.h:66
rheolef::basis_fem_sides::_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_sides.h:118
rheolef::basis_fem_sides::_sid_value
Eigen::Matrix< T, Eigen::Dynamic, 1 > _sid_value
Definition: basis_fem_sides.h:121
rheolef::reference_element::variant
variant_type variant() const
Definition: reference_element.h:99
rheolef::basis_fem_sides::base
basis_rep< T > base
Definition: basis_fem_sides.h:53
rheolef::basis_fem_sides
Definition: basis_fem_sides.h:48
rheolef::basis_fem_sides::value_type
T value_type
Definition: basis_fem_sides.h:55
rheolef::basis_fem_sides::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_sides.cc:156
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::basis_fem_sides::~basis_fem_sides
~basis_fem_sides()
Definition: basis_fem_sides.cc:67
rheolef::basis_fem_sides::_initialize_data
void _initialize_data(reference_element hat_K) const
Definition: basis_fem_sides.cc:117
rheolef::reference_element::max_variant
static const variant_type max_variant
Definition: reference_element.h:82
rheolef::basis_fem_sides::size_type
reference_element::size_type size_type
Definition: basis_fem_sides.h:54
rheolef::basis_fem_sides::first_sid_idof
virtual size_type first_sid_idof(reference_element hat_K, size_type loc_isid) const
Definition: basis_fem_sides.h:93
rheolef::basis_fem_sides::is_nodal
bool is_nodal() const
Definition: basis_fem_sides.h:67
size_type
field::size_type size_type
Definition: branch.cc:425
rheolef::basis_fem_sides::_hat_node
std::array< Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 >, reference_element::max_variant > _hat_node
Definition: basis_fem_sides.h:112
rheolef::basis_fem_sides::_side_basis
basis_basic< T > _side_basis
Definition: basis_fem_sides.h:108
rheolef::basis_fem_sides::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_sides.cc:188
rheolef::reference_element::size_type
std::vector< int >::size_type size_type
Definition: reference_element.h:71
rheolef::basis_fem_sides::local_ndof_on_side
size_type local_ndof_on_side(reference_element hat_K, const side_information_type &sid) const
Definition: basis_fem_sides.cc:178
rheolef::basis_rep
Definition: basis.h:209
T
Expr1::float_type T
Definition: field_expr.h:218
rheolef::basis_fem_sides::basis_fem_sides
basis_fem_sides(const basis_basic< T > &side_basis)
Definition: basis_fem_sides.cc:71