an efficient C++ finite element environment
|
|
Go to the documentation of this file.
22 #include "rheolef/rheostream.h"
44 std::array<std::array<size_type,reference_element::max_variant>,4>& ndof_on_subgeo,
45 std::array<std::array<size_type,reference_element::max_variant>,4>& nnod_on_subgeo,
50 if (k ==
size_t(-1)) {
52 for (
size_type map_d = 0; map_d < 4; ++map_d) {
53 ndof_on_subgeo [map_d].fill (0);
57 for (
size_type map_d = 0; map_d < 4; ++map_d) {
58 ndof_on_subgeo [map_d].fill (0);
62 ndof_on_subgeo [map_d] [
variant] = 1;
66 for (
size_type map_d = 0; map_d < 4; ++map_d) {
71 ndof_on_subgeo [map_d] [
variant] = 0;
75 base::_helper_discontinuous_ndof_on_subgeo_inplace_change (is_continuous, ndof_on_subgeo);
78 base::_helper_initialize_first_ixxx_by_dimension_from_nxxx_on_subgeo (ndof_on_subgeo, first_idof_by_dimension);
80 nnod_on_subgeo = ndof_on_subgeo;
81 first_inod_by_dimension = first_idof_by_dimension;
120 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
123 base::_initialize_data_guard (hat_K);
124 return _hat_node [hat_K.
variant()];
127 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
130 base::_initialize_data_guard (hat_K);
134 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
137 base::_initialize_data_guard (hat_K);
138 return _inv_vdm [hat_K.
variant()];
146 base::is_continuous(),
147 base::_ndof_on_subgeo,
148 base::_nnod_on_subgeo,
149 base::_first_idof_by_dimension,
150 base::_first_inod_by_dimension);
160 switch (base::_sopt.get_node()) {
167 default:
error_macro (
"unsupported node set: "<<base::_sopt.get_node_name());
172 "unisolvence failed for " <<
base::name() <<
"(" << hat_K.
name() <<
") basis");
180 Eigen::Matrix<T,Eigen::Dynamic,1>&
value)
const
182 base::_initialize_data_guard (hat_K);
183 Eigen::Matrix<T,Eigen::Dynamic,1> raw_value;
184 _raw_basis.evaluate (hat_K, hat_x, raw_value);
185 value = _inv_vdm[hat_K.
variant()].transpose()*raw_value;
195 base::_initialize_data_guard (hat_K);
196 Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& inv_vdm = _inv_vdm [hat_K.
variant()];
197 Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1> raw_v_value;
198 _raw_basis.grad_evaluate (hat_K, hat_x, raw_v_value);
200 value.resize (loc_ndof);
202 for (
size_type loc_idof = 0; loc_idof < loc_ndof; ++loc_idof) {
204 for (
size_type loc_jdof = 0; loc_jdof < loc_ndof; ++loc_jdof) {
205 value [loc_idof] += inv_vdm (loc_jdof,loc_idof)*raw_v_value[loc_jdof];
223 Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof)
const
225 details::Pk_get_local_idof_on_side (hat_K, sid, degree(), loc_idof);
232 const Eigen::Matrix<T,Eigen::Dynamic,1>& f_xnod,
233 Eigen::Matrix<T,Eigen::Dynamic,1>& dof)
const
240 #define _RHEOLEF_instanciation(T) \
241 template class basis_fem_Pk_lagrange<T>;
size_type ndof(const basis_basic< T > &b, const geo_size &gs, size_type map_dim)
static variant_type last_variant_by_dimension(size_type dim)
size_type local_ndof_on_side(reference_element hat_K, const side_information_type &sid) const
static void init_local_nnode_by_variant(size_type order, std::array< size_type, reference_element::max_variant > &loc_nnod_by_variant)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
void evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &value) const
void pointset_lagrange_equispaced(reference_element hat_K, size_t order_in, Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &hat_xnod, size_t internal=0)
void basis_on_pointset_evaluate(const Basis &b, const reference_element &hat_K, const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &hat_x, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &vdm)
basis_raw_basic< T > _raw_basis
_RHEOLEF_instanciation(Float, sequential, std::allocator< Float >) _RHEOLEF_instanciation(Float
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &value) const
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & inv_vdm(reference_element hat_K) const
see the basis_option page for the full documentation
reference_element::size_type size_type
static variant_type first_variant_by_dimension(size_type dim)
see the reference_element page for the full documentation
void local_idof_on_side(reference_element hat_K, const side_information_type &sid, Eigen::Matrix< size_type, Eigen::Dynamic, 1 > &loc_idof) const
piola_fem< T > _piola_fem
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & vdm(reference_element hat_K) const
variant_type variant() const
void _compute_dofs(reference_element hat_K, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &f_xnod, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof) const
void pointset_lagrange_warburton(reference_element hat_K, size_t degree, Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &hat_xnod, bool map_on_reference_element=true)
This file is part of Rheolef.
static void initialize_local_first(size_type k, bool is_continuous, std::array< std::array< size_type, reference_element::max_variant >, 4 > &ndof_on_subgeo, std::array< std::array< size_type, reference_element::max_variant >, 4 > &nnod_on_subgeo, std::array< std::array< size_type, 5 >, reference_element::max_variant > &first_idof_by_dimension, std::array< std::array< size_type, 5 >, reference_element::max_variant > &first_inod_by_dimension)
#define error_macro(message)
see the Float page for the full documentation
basis_fem_Pk_lagrange(size_type degree, const basis_option &sopt)
static const variant_type max_variant
void _initialize_cstor_sizes() const
static std::string standard_naming(std::string family_name, size_t degree, const basis_option &sopt)
void invert(tiny_matrix< T > &a, tiny_matrix< T > &inv_a)
reference_element::size_type size_type
std::string itos(std::string::size_type i)
itos: see the rheostream page for the full documentation
void pointset_lagrange_fekete(reference_element hat_K, size_t degree, Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &hat_xnod, bool map_on_reference_element=true)
void _initialize_data(reference_element hat_K) const
std::string get_raw_polynomial_name() const
virtual std::string family_name() const