an efficient C++ finite element environment
|
|
Go to the documentation of this file.
193 #include "rheolef/reference_element.h"
194 #include "rheolef/reference_element_face_transformation.h"
195 #include "rheolef/point.h"
196 #include "rheolef/tensor.h"
197 #include "rheolef/persistent_table.h"
198 #include "rheolef/space_constant.h"
199 #include "rheolef/basis_raw.h"
200 #include "rheolef/basis_option.h"
201 #include "rheolef/piola_fem.h"
202 #include <unordered_map>
270 Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof)
const;
273 virtual const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
vdm (
reference_element hat_K)
const;
285 #define _RHEOLEF_evaluate(MEMBER,VALUED,VALUE) \
289 reference_element hat_K, \
290 const point_basic<T>& hat_x, \
291 Eigen::Matrix<VALUE,Eigen::Dynamic,1>& value) const \
293 error_macro ("basis \""<<name()<<"\": " \
294 << VALUED << "-valued " << #MEMBER \
295 << "() member not implemented"); \
308 #undef _RHEOLEF_evaluate
310 #define _RHEOLEF_evaluate_on_side(VALUED,VALUE) \
314 reference_element tilde_K, \
315 const side_information_type& sid, \
316 const point_basic<T>& hat_x, \
317 Eigen::Matrix<VALUE,Eigen::Dynamic,1>& value) const \
319 error_macro ("basis \""<<name()<<"\": " \
320 << VALUED << "-valued evaluate_on_side() member not implemented"); \
325 #undef _RHEOLEF_evaluate_on_side
327 #define _RHEOLEF_compute_dofs(VALUED,VALUE) \
331 reference_element hat_K, \
332 const Eigen::Matrix<VALUE,Eigen::Dynamic,1>& f_xnod, \
333 Eigen::Matrix<T,Eigen::Dynamic,1>& dof) const \
335 error_macro ("basis \"" << name() << "\": " \
336 << VALUED << "-valued _compute_dofs() member not implemented"); \
342 #undef _RHEOLEF_compute_dofs
346 void put (std::ostream& os, reference_element hat_K)
const;
347 virtual void put_scalar_valued (std::ostream& os, reference_element hat_K)
const;
348 virtual void put_vector_valued (std::ostream& os, reference_element hat_K)
const;
349 void put_hat_node (std::ostream& os, reference_element hat_K)
const;
351 const side_information_type& sid)
const;
375 ,4>& _nxxx_on_subgeo,
388 ,4>& nxxx_on_subgeo);
396 mutable std::array<bool,
418 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
421 error_macro (
"basis \""<<
name()<<
"\": hat_node() member not implemented");
422 static const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1> _dummy;
427 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
431 static const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> _dummy;
436 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
439 error_macro (
"basis \""<<
name()<<
"\": inv_vdm() member not implemented");
440 static const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> _dummy;
451 error_macro (
"basis \""<<
name()<<
"\": local_ndof_on_side() member not implemented");
return 0;
459 Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof)
const
461 error_macro (
"basis \""<<
name()<<
"\": local_idof_on_side() member not implemented");
480 template <
class T,
class Function>
483 is_scalar<typename function_traits<Function>::result_type>
::value
490 Eigen::Matrix<T,Eigen::Dynamic,1>& dof)
494 "interpolate: incompatible scalar-valued function and "<<
b.valued()<<
"-valued basis");
495 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_node =
b.hat_node (hat_K);
497 Eigen::Matrix<T,Eigen::Dynamic,1> f_xnod (hat_node.size());
498 for (
size_type loc_inod = 0, loc_nnod = hat_node.size(); loc_inod < loc_nnod; ++loc_inod) {
499 f_xnod [loc_inod] =
f (hat_node [loc_inod]);
501 b._compute_dofs (hat_K, f_xnod, dof);
503 template <
class T,
class Function>
506 is_point<typename function_traits<Function>::result_type>
::value
513 Eigen::Matrix<T,Eigen::Dynamic,1>& dof)
517 "interpolate: incompatible vector-valued function and "<<
b.valued()<<
"-valued basis");
518 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_node =
b.hat_node (hat_K);
520 Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1> f_xnod (hat_node.size());
521 for (
size_type loc_inod = 0, loc_nnod = hat_node.size(); loc_inod < loc_nnod; ++loc_inod) {
522 f_xnod [loc_inod] =
f (hat_node [loc_inod]);
524 b._compute_dofs (hat_K, f_xnod, dof);
531 class basis_basic :
public smart_pointer_nocopy<basis_rep<T> >,
532 public persistent_table<basis_basic<T> > {
555 std::string
name()
const;
569 const std::string&
valued()
const;
579 Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof)
const;
587 template<
class Value>
591 Eigen::Matrix<Value,Eigen::Dynamic,1>&
value)
const;
594 template<
class Value>
599 Eigen::Matrix<Value,Eigen::Dynamic,1>&
value)
const;
602 template<
class Value>
606 Eigen::Matrix<Value,Eigen::Dynamic,1>&
value)
const;
612 template <
class Function>
616 Eigen::Matrix<T,Eigen::Dynamic,1>& dofs)
const;
618 template <
class Value>
621 const Eigen::Matrix<Value,Eigen::Dynamic,1>& f_xnod,
622 Eigen::Matrix<T,Eigen::Dynamic,1>& dof)
const;
663 return base::data()._clear();
670 return base::data().family_name();
677 return base::data().family_index();
684 return base::data().name();
691 return base::data().degree();
698 return base::data().ndof (hat_K);
705 return base::data().nnod (hat_K);
712 return base::data().option();
719 return base::data().is_continuous();
726 return base::data().is_discontinuous();
733 return base::data().is_nodal();
740 return base::data().have_continuous_feature();
747 return base::data().have_compact_support_inside_element();
754 return base::data().size();
761 return base::data().is_hierarchical();
768 error_macro (
"basis \""<<
name()<<
"\": invalid basis indexation [i_comp]");
776 return base::data().operator[] (i_comp);
783 return base::data().have_index_parameter();
790 return base::data().valued_tag();
797 return base::data().get_piola_fem();
804 return base::data().valued();
811 return base::data().ndof_on_subgeo (
map_dim, subgeo_variant);
818 return base::data().nnod_on_subgeo (
map_dim, subgeo_variant);
825 return base::data().first_idof_by_dimension (hat_K,
dim);
832 return base::data().first_inod_by_dimension (hat_K,
dim);
836 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
839 return base::data().vdm(hat_K);
843 const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>&
846 return base::data().inv_vdm(hat_K);
849 template<
class Value>
855 Eigen::Matrix<Value,Eigen::Dynamic,1>&
value)
const
857 base::data().evaluate (hat_K, hat_x,
value);
860 template<
class Value>
867 Eigen::Matrix<Value,Eigen::Dynamic,1>&
value)
const
869 base::data().evaluate_on_side (tilde_K, sid, hat_x,
value);
872 template<
class Value>
878 Eigen::Matrix<Value,Eigen::Dynamic,1>&
value)
const
880 base::data().grad_evaluate (hat_K, hat_x,
value);
883 template <
class Function>
889 Eigen::Matrix<T,Eigen::Dynamic,1>& dof)
const
894 template<
class Value>
899 const Eigen::Matrix<Value,Eigen::Dynamic,1>& f_xnod,
900 Eigen::Matrix<T,Eigen::Dynamic,1>& dof)
const
902 base::data()._compute_dofs (hat_K, f_xnod, dof);
906 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&
909 return base::data().hat_node (hat_K);
916 base::data().put (os, hat_K);
923 base::data().put_hat_node (os, hat_K);
932 return base::data().local_ndof_on_side (hat_K, sid);
940 Eigen::Matrix<size_type,Eigen::Dynamic,1>& loc_idof)
const
942 base::data().local_idof_on_side (hat_K, sid, loc_idof);
952 base::data().put_hat_node_on_side (os, hat_K, sid);
956 #endif // _RHEO_BASIS_H
const piola_fem< T > & get_piola_fem() const
bool have_index_parameter() const
see the tensor3 page for the full documentation
std::array< std::array< size_type,5 >,reference_element::max_variant > _first_idof_by_dimension
size_type first_idof_by_dimension(reference_element hat_K, size_type dim) const
see the tensor page for the full documentation
void reset(std::string &name)
virtual const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
const piola_fem< T > & get_piola_fem() const
std::array< std::array< size_type,reference_element::max_variant >,4 > _ndof_on_subgeo
void _initialize_data_guard(reference_element hat_K) const
bool is_continuous() const
size_type first_idof_by_dimension(reference_element hat_K, size_type dim) const
size_type nnod(reference_element hat_K) const
void evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
void put(std::ostream &out, std::string name, const tiny_matrix< T > &a)
virtual bool have_index_parameter() const
static void _helper_discontinuous_ndof_on_subgeo_inplace_change(bool is_continuous, std::array< std::array< size_type, reference_element::max_variant >, 4 > &nxxx_on_subgeo)
void put(std::ostream &os, reference_element hat_K) const
bool is_initialized() const
rep::value_type value_type
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & inv_vdm(reference_element hat_K) const
size_type first_inod_by_dimension(reference_element hat_K, size_type dim) const
smart_pointer_nocopy< rep > base
basis_basic< Float > basis
_RHEOLEF_compute_dofs("scalar", T) _RHEOLEF_compute_dofs("vector"
static iorheo::force_initialization dummy
bool is_discontinuous() const
see the tensor4 page for the full documentation
const basis_basic< T > & operator[](size_type i_comp) const
size_type nnod_on_subgeo(size_type map_dim, size_type subgeo_variant) const
bool have_compact_support_inside_element() const
const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > & hat_node(reference_element hat_K) const
bool is_continuous() const
static void _helper_initialize_first_ixxx_by_dimension_from_nxxx_on_subgeo(const std::array< std::array< size_type, reference_element::max_variant >, 4 > &_nxxx_on_subgeo, std::array< std::array< size_type, 5 >, reference_element::max_variant > &_first_ixxx_by_dimension)
void put_hat_node_on_side(std::ostream &os, reference_element hat_K, const side_information_type &sid) const
see the basis_option page for the full documentation
size_type first_inod_by_dimension(reference_element hat_K, size_type dim) 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
reference_element::size_type size_type
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
virtual size_type size() const
void compute_dofs(reference_element hat_K, const Eigen::Matrix< Value, Eigen::Dynamic, 1 > &f_xnod, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof) const
see the persistent_table page for the full documentation
_RHEOLEF_evaluate_on_side("scalar", T) _RHEOLEF_evaluate_on_side("vector"
see the reference_element page for the full documentation
piola_fem< T > _piola_fem
size_type nnod_on_subgeo(size_type map_dim, size_type subgeo_variant) const
virtual void _initialize_cstor_sizes() const =0
void compute_dof(reference_element hat_K, const Function &f, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dofs) const
size_type family_index() const
basis_rep(const basis_option &sopt)
size_type ndof(reference_element hat_K) const
const std::string & valued() const
virtual size_type degree() const =0
std::array< bool, reference_element::max_variant > _have_initialize_data
basis_basic(std::string name="")
valued_type valued_tag() const
virtual bool have_compact_support_inside_element() const
virtual bool have_continuous_feature() const
variant_type variant() const
virtual void put_vector_valued(std::ostream &os, reference_element hat_K) const
rep::valued_type valued_type
size_type local_ndof_on_side(reference_element hat_K, const side_information_type &sid) const
const T * operator->() const
size_type nnod(reference_element hat_K) const
virtual void local_idof_on_side(reference_element hat_K, const side_information_type &sid, Eigen::Matrix< size_type, Eigen::Dynamic, 1 > &loc_idof) const
space_constant::valued_type valued_type
virtual size_type family_index() const
void put_hat_node_on_side(std::ostream &os, reference_element hat_K, const side_information_type &sid) const
void reset_family_index(size_type k)
const std::string & valued_name(valued_type valued_tag)
const std::string & valued() const
_RHEOLEF_evaluate(evaluate,"scalar", T) _RHEOLEF_evaluate(evaluate
bool is_hierarchical() const
This file is part of Rheolef.
size_type ndof(reference_element hat_K) const
virtual bool is_hierarchical() const
#define error_macro(message)
std::string family_name() const
virtual std::string family_name() const =0
size_type ndof_on_subgeo(size_type map_dim, size_type subgeo_variant) const
virtual valued_type valued_tag() const
virtual const class basis_basic< T > & operator[](size_type i_comp) const
static const variant_type max_variant
point_basic< T > tensor3_basic< T > scalar
const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & vdm(reference_element hat_K) const
std::array< std::array< size_type,5 >,reference_element::max_variant > _first_inod_by_dimension
size_type dimension() const
virtual void _initialize_data(reference_element hat_K) const =0
virtual size_type local_ndof_on_side(reference_element hat_K, const side_information_type &sid) const
bool is_discontinuous() const
bool have_continuous_feature() const
void evaluate_on_side(reference_element tilde_K, const side_information_type &sid, const point_basic< T > &hat_x, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
static std::string standard_naming(std::string family_name, size_t degree, const basis_option &sopt)
field::size_type size_type
void put_hat_node(std::ostream &os, reference_element hat_K) const
std::enable_if< is_scalar< typename function_traits< Function >::result_type >::value,void >::type compute_dof(const basis_rep< T > &b, reference_element hat_K, const Function &f, Eigen::Matrix< T, Eigen::Dynamic, 1 > &dof)
void put_hat_node(std::ostream &os, reference_element hat_K) const
size_type ndof_on_subgeo(size_type map_dim, size_type subgeo_variant) const
virtual const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & inv_vdm(reference_element hat_K) const
void evaluate(const geo_basic< float_type, M > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, 1 > &value) const
virtual bool is_nodal() const =0
const basis_option & option() const
const basis_option & option() const
std::array< std::array< size_type,reference_element::max_variant >,4 > _nnod_on_subgeo
std::vector< int >::size_type size_type
bool is_continuous() const
virtual const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & vdm(reference_element hat_K) const
static basis_rep * make_ptr(const std::string &name)