50
50
template <class Function>
51
void operator() (const geo_element& K, Function f, std::vector<T>& uk) const;
51
void operator() (const geo_element& K, Function f, std::vector<T>& lk) const;
53
53
// specializations for field as special Function classes (avoid localization octree search)
54
void operator() (const geo_element& K, const field_basic<T,M>& fh, std::vector<T>& uk) const;
54
void operator() (const geo_element& K, const field_basic<T,M>& fh, std::vector<T>& lk) const;
56
void eval (const geo_element& K, const std::vector<T>& fq, std::vector<T>& uk) const;
57
void eval (const geo_element& K, const std::vector<point_basic<T> >& fq, std::vector<T>& uk) const;
56
void eval (const geo_element& K, const std::vector<T>& fq, std::vector<T>& lk) const;
57
void eval (const geo_element& K, const std::vector<point_basic<T> >& fq, std::vector<T>& lk) const;
59
59
// modifiers (const, since data are mutable: avoid copies):
62
62
const quadrature_option_type& qopt
63
63
= quadrature_option_type(quadrature_option_type::gauss)) const;
65
void set_band (const band_basic<T,M>& gh) const { _band = gh; _is_on_band = true; }
65
67
// accessors (for building elementary fields):
67
const space_basic<T,M>& get_space() const;
68
const basis& get_basis() const;
69
const numbering<T,M>& get_numbering() const;
70
const basis& get_piola_basis () const;
72
size_type dimension() const;
69
const space_basic<T,M>& get_space() const { return _X; }
70
const numbering<T,M>& get_numbering() const { return _X.get_numbering(); }
71
const basis_basic<T>& get_basis() const { return get_numbering().get_basis(); }
72
bool is_on_band() const { return _is_on_band; }
73
const band_basic<T,M>& get_band () const { return _band; }
74
const geo_basic<T,M>& get_geo() const { return _is_on_band ? _band.level_set() : get_space().get_geo(); }
75
const basis_basic<T>& get_piola_basis () const { return get_geo().get_piola_basis(); }
76
size_type dimension() const { return get_geo().dimension(); }
76
80
mutable space_basic<T,M> _X; // origin dof numbering
77
mutable quadrature _quad;
78
mutable basis_on_quadrature _basis_on_quad;
79
mutable basis_on_quadrature _piola_on_quad;
81
mutable quadrature<T> _quad;
82
mutable basis_on_pointset<T> _basis_on_quad;
83
mutable basis_on_pointset<T> _piola_on_quad;
80
84
mutable bool _initialized;
85
mutable bool _is_on_band;
86
mutable band_basic<T,M> _band;
82
88
// -----------------------------------------------------------------------
84
90
// -----------------------------------------------------------------------
86
91
template<class T, class M>
88
93
field_element<T,M>::field_element()
95
template<class T, class M>
97
field_element<T,M>::~field_element()
100
template<class T, class M>
102
const space_basic<T,M>&
103
field_element<T,M>::get_space() const
107
template<class T, class M>
109
const numbering<T,M>&
110
field_element<T,M>::get_numbering() const
112
return get_space().get_numbering();
114
template<class T, class M>
117
field_element<T,M>::get_basis() const
119
return get_numbering().get_basis();
121
template<class T, class M>
124
field_element<T,M>::get_piola_basis () const
126
return get_space().get_geo().get_piola_basis();
128
template<class T, class M>
130
typename field_element<T,M>::size_type
131
field_element<T,M>::dimension() const
133
return get_space().get_geo().dimension();
102
// evaluate a template class-function f at quadrature points
103
// then call a compiled function for the integrations over element K
135
104
template<class T, class M>
136
105
template<class Function>
139
107
field_element<T,M>::operator() (
140
108
const geo_element& K,
142
std::vector<T>& uk) const
110
std::vector<T>& lk) const
144
112
typedef typename boost::unary_traits<Function>::result_type result_type;
145
std::vector<result_type> fq (_quad.size(K));
113
const geo_basic<T,M>& omega = get_geo();
114
reference_element hat_K (K.variant());
115
std::vector<result_type> fq (_quad.size(hat_K));
146
116
std::vector<size_type> dis_inod;
147
get_space().get_geo().dis_inod (K, dis_inod);
148
for (size_type q = 0, nq = _piola_on_quad.size(K); q < nq; q++) {
149
point_basic<T> xq = piola_transformation (get_space().get_geo(), _piola_on_quad, K, dis_inod, q);
117
omega.dis_inod (K, dis_inod);
118
for (size_type q = 0, nq = _piola_on_quad.size(hat_K); q < nq; q++) {
119
point_basic<T> xq = piola_transformation (omega, _piola_on_quad, K, dis_inod, q);
155
125
}// namespace rheolef