piola_on_pointset.h
Go to the documentation of this file.
#ifndef _RHEOLEF_PIOLA_ON_POINTSET_H
#define _RHEOLEF_PIOLA_ON_POINTSET_H
//
// evaluate the Piola transformation on a full pointset,
// e.g. a quadrature node set or an interpolation node set:
//
// F : hat_K ---> K
// hat_x +--> x = F(hat_x)
//
#include "rheolef/geo.h"
#include "rheolef/piola.h"
#include "rheolef/basis_on_pointset.h"
#include "rheolef/integrate_option.h"
namespace rheolef {
// ----------------------------------------------------------------------------
// representation
// ----------------------------------------------------------------------------
template<class T>
class piola_on_pointset_rep {
public:
typedef reference_element::size_type size_type;
// allocators:
piola_on_pointset_rep();
// modifiers:
void initialize (
const basis_basic<T>& piola_basis,
const quadrature<T>& quad,
const integrate_option& iopt);
void initialize (
const basis_basic<T>& piola_basis,
const basis_basic<T>& nodal_basis,
const integrate_option& iopt);
// accessors:
const basis_on_pointset<T>& get_basis_on_pointset() const { return _bops; }
bool has_quadrature() const { return _bops.has_quadrature(); }
const quadrature<T>& get_quadrature() const { return _bops.get_quadrature(); }
const basis_basic<T>& get_nodal_basis() const { return _bops.get_nodal_basis(); }
bool ignore_sys_coord() const { return _ignore_sys_coord; }
template<class M>
const Eigen::Matrix<piola<T>,Eigen::Dynamic,1>&
get_piola (const geo_basic<T,M>& omega, const geo_element& K) const;
template<class M>
const Eigen::Matrix<T,Eigen::Dynamic,1>&
get_weight (const geo_basic<T,M>& omega, const geo_element& K) const;
protected:
// internal:
template<class M>
void _update (const geo_basic<T,M>& omega, const geo_element& K) const;
// data:
basis_on_pointset<T> _bops;
bool _ignore_sys_coord;
// working area:
mutable std::array<
std::string
,reference_element::max_variant> _last_visited_geo;
mutable std::array<
size_type
,reference_element::max_variant> _last_visited_dis_ie;
mutable std::vector<size_type> _dis_inod_K;
mutable std::array<
Eigen::Matrix<piola<T>,Eigen::Dynamic,1>
,reference_element::max_variant> _piola;
mutable std::array<
Eigen::Matrix<T,Eigen::Dynamic,1>
,reference_element::max_variant> _weight;
};
template<class T>
inline
piola_on_pointset_rep<T>::piola_on_pointset_rep()
: _bops(),
_ignore_sys_coord(false),
_last_visited_geo(),
_last_visited_dis_ie(),
_dis_inod_K(),
_piola(),
_weight()
{
_last_visited_geo.fill ("");
_last_visited_dis_ie.fill (std::numeric_limits<size_type>::max());
}
template<class T>
template<class M>
inline
const Eigen::Matrix<piola<T>,Eigen::Dynamic,1>&
piola_on_pointset_rep<T>::get_piola (const geo_basic<T,M>& omega, const geo_element& K) const
{
_update (omega, K);
return _piola [K.variant()];
}
template<class T>
template<class M>
inline
const Eigen::Matrix<T,Eigen::Dynamic,1>&
piola_on_pointset_rep<T>::get_weight (const geo_basic<T,M>& omega, const geo_element& K) const
{
_update (omega, K);
return _weight [K.variant()];
}
// ----------------------------------------------------------------------------
// interface
// ----------------------------------------------------------------------------
template<class T>
class piola_on_pointset: public smart_pointer<piola_on_pointset_rep<T> > {
public:
typedef piola_on_pointset_rep<T> rep;
typedef smart_pointer<rep> base;
typedef typename rep::size_type size_type;
// allocators:
piola_on_pointset();
// modifiers:
void initialize (
const basis_basic<T>& piola_basis,
const quadrature<T>& quad,
const integrate_option& iopt);
void initialize (
const basis_basic<T>& piola_basis,
const basis_basic<T>& nodal_basis,
const integrate_option& iopt);
// accessors:
const basis_on_pointset<T>& get_basis_on_pointset() const;
bool has_quadrature() const;
const quadrature<T>& get_quadrature() const;
const basis_basic<T>& get_nodal_basis() const;
template<class M>
const Eigen::Matrix<piola<T>,Eigen::Dynamic,1>&
get_piola (const geo_basic<T,M>& omega, const geo_element& K) const;
template<class M>
const Eigen::Matrix<T,Eigen::Dynamic,1>&
get_weight (const geo_basic<T,M>& omega, const geo_element& K) const;
bool ignore_sys_coord() const { return base::data().ignore_sys_coord(); }
};
template<class T>
inline
piola_on_pointset<T>::piola_on_pointset()
: base(new_macro(rep))
{
}
template<class T>
inline
void
piola_on_pointset<T>::initialize (
const basis_basic<T>& piola_basis,
const quadrature<T>& quad,
const integrate_option& iopt)
{
base::data().initialize (piola_basis, quad, iopt);
}
template<class T>
inline
void
piola_on_pointset<T>::initialize (
const basis_basic<T>& piola_basis,
const basis_basic<T>& nodal_basis,
const integrate_option& iopt)
{
base::data().initialize (piola_basis, nodal_basis, iopt);
}
template<class T>
inline
const basis_on_pointset<T>&
piola_on_pointset<T>::get_basis_on_pointset() const
{
return base::data().get_basis_on_pointset();
}
template<class T>
inline
bool
piola_on_pointset<T>::has_quadrature() const
{
return base::data().has_quadrature();
}
template<class T>
inline
const quadrature<T>&
piola_on_pointset<T>::get_quadrature() const
{
return base::data().get_quadrature();
}
template<class T>
inline
const basis_basic<T>&
piola_on_pointset<T>::get_nodal_basis() const
{
return base::data().get_nodal_basis();
}
template<class T>
template<class M>
inline
const Eigen::Matrix<piola<T>,Eigen::Dynamic,1>&
piola_on_pointset<T>::get_piola (const geo_basic<T,M>& omega, const geo_element& K) const
{
return base::data().get_piola (omega, K);
}
template<class T>
template<class M>
inline
const Eigen::Matrix<T,Eigen::Dynamic,1>&
piola_on_pointset<T>::get_weight (const geo_basic<T,M>& omega, const geo_element& K) const
{
return base::data().get_weight (omega, K);
}
}// namespace rheolef
#endif // _RHEOLEF_PIOLA_ON_POINTSET_H
rheolef::basis_basic
Definition: basis.h:532
rheolef::basis_on_pointset
Definition: basis_on_pointset.h:192
rheolef::geo_basic< T, M >
rheolef::geo_element
see the geo_element page for the full documentation
Definition: geo_element.h:102
rheolef::geo_element::variant
variant_type variant() const
Definition: geo_element.h:161
rheolef::integrate_option
see the integrate_option page for the full documentation
Definition: integrate_option.h:125
rheolef::piola_on_pointset_rep
Definition: piola_on_pointset.h:40
rheolef::piola_on_pointset_rep::_ignore_sys_coord
bool _ignore_sys_coord
Definition: piola_on_pointset.h:85
rheolef::piola_on_pointset_rep::has_quadrature
bool has_quadrature() const
Definition: piola_on_pointset.h:63
rheolef::piola_on_pointset_rep::_bops
basis_on_pointset< T > _bops
Definition: piola_on_pointset.h:84
rheolef::piola_on_pointset_rep::get_basis_on_pointset
const basis_on_pointset< T > & get_basis_on_pointset() const
Definition: piola_on_pointset.h:62
rheolef::piola_on_pointset_rep::piola_on_pointset_rep
piola_on_pointset_rep()
Definition: piola_on_pointset.h:108
rheolef::piola_on_pointset_rep::_weight
std::array< Eigen::Matrix< T, Eigen::Dynamic, 1 >,reference_element::max_variant > _weight
Definition: piola_on_pointset.h:104
rheolef::piola_on_pointset_rep::get_quadrature
const quadrature< T > & get_quadrature() const
Definition: piola_on_pointset.h:64
rheolef::piola_on_pointset_rep::size_type
reference_element::size_type size_type
Definition: piola_on_pointset.h:42
rheolef::piola_on_pointset_rep::initialize
void initialize(const basis_basic< T > &piola_basis, const quadrature< T > &quad, const integrate_option &iopt)
Definition: piola_on_pointset.cc:31
rheolef::piola_on_pointset_rep::_update
void _update(const geo_basic< T, M > &omega, const geo_element &K) const
Definition: piola_on_pointset.cc:59
rheolef::piola_on_pointset_rep::_last_visited_dis_ie
std::array< size_type,reference_element::max_variant > _last_visited_dis_ie
Definition: piola_on_pointset.h:94
rheolef::piola_on_pointset_rep::_last_visited_geo
std::array< std::string,reference_element::max_variant > _last_visited_geo
Definition: piola_on_pointset.h:91
rheolef::piola_on_pointset_rep::ignore_sys_coord
bool ignore_sys_coord() const
Definition: piola_on_pointset.h:66
rheolef::piola_on_pointset_rep::get_piola
const Eigen::Matrix< piola< T >, Eigen::Dynamic, 1 > & get_piola(const geo_basic< T, M > &omega, const geo_element &K) const
Definition: piola_on_pointset.h:124
rheolef::piola_on_pointset_rep::get_weight
const Eigen::Matrix< T, Eigen::Dynamic, 1 > & get_weight(const geo_basic< T, M > &omega, const geo_element &K) const
Definition: piola_on_pointset.h:133
rheolef::piola_on_pointset_rep::_piola
std::array< Eigen::Matrix< piola< T >, Eigen::Dynamic, 1 >,reference_element::max_variant > _piola
Definition: piola_on_pointset.h:100
rheolef::piola_on_pointset_rep::get_nodal_basis
const basis_basic< T > & get_nodal_basis() const
Definition: piola_on_pointset.h:65
rheolef::piola_on_pointset_rep::_dis_inod_K
std::vector< size_type > _dis_inod_K
Definition: piola_on_pointset.h:96
rheolef::piola_on_pointset
Definition: piola_on_pointset.h:142
rheolef::piola_on_pointset::initialize
void initialize(const basis_basic< T > &piola_basis, const basis_basic< T > &nodal_basis, const integrate_option &iopt)
Definition: piola_on_pointset.h:200
rheolef::piola_on_pointset::piola_on_pointset
piola_on_pointset()
Definition: piola_on_pointset.h:183
rheolef::piola_on_pointset::has_quadrature
bool has_quadrature() const
Definition: piola_on_pointset.h:217
rheolef::piola_on_pointset::initialize
void initialize(const basis_basic< T > &piola_basis, const quadrature< T > &quad, const integrate_option &iopt)
Definition: piola_on_pointset.h:190
rheolef::piola_on_pointset::base
smart_pointer< rep > base
Definition: piola_on_pointset.h:145
rheolef::piola_on_pointset::get_quadrature
const quadrature< T > & get_quadrature() const
Definition: piola_on_pointset.h:224
rheolef::piola_on_pointset::size_type
rep::size_type size_type
Definition: piola_on_pointset.h:146
rheolef::piola_on_pointset::get_nodal_basis
const basis_basic< T > & get_nodal_basis() const
Definition: piola_on_pointset.h:231
rheolef::piola_on_pointset::rep
piola_on_pointset_rep< T > rep
Definition: piola_on_pointset.h:144
rheolef::piola_on_pointset::get_basis_on_pointset
const basis_on_pointset< T > & get_basis_on_pointset() const
Definition: piola_on_pointset.h:210
rheolef::piola_on_pointset::ignore_sys_coord
bool ignore_sys_coord() const
Definition: piola_on_pointset.h:179
rheolef::piola_on_pointset::get_piola
const Eigen::Matrix< piola< T >, Eigen::Dynamic, 1 > & get_piola(const geo_basic< T, M > &omega, const geo_element &K) const
Definition: piola_on_pointset.h:239
rheolef::piola_on_pointset::get_weight
const Eigen::Matrix< T, Eigen::Dynamic, 1 > & get_weight(const geo_basic< T, M > &omega, const geo_element &K) const
Definition: piola_on_pointset.h:247
rheolef::quadrature
Definition: quadrature.h:186
rheolef::reference_element::max_variant
static const variant_type max_variant
Definition: reference_element.h:82
rheolef::reference_element::size_type
std::vector< int >::size_type size_type
Definition: reference_element.h:71
rheolef::smart_pointer_base< T, details::constructor_copy< T > >::data
const T & data() const
Definition: smart_pointer.h:266
rheolef::smart_pointer
see the smart_pointer page for the full documentation
Definition: smart_pointer.h:351
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37