29 typedef basis_rep<T> base;
30 typedef typename base::size_type
size_type;
31 static void evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
32 static void grad_evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
33 static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
38 typedef basis_rep<T> base;
39 typedef typename base::size_type
size_type;
40 static void evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
41 static void grad_evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
42 static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
47 typedef basis_rep<T> base;
48 typedef typename base::size_type
size_type;
49 static void evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
50 static void grad_evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
51 static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
56 typedef basis_rep<T> base;
57 typedef typename base::size_type
size_type;
58 static void evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
59 static void grad_evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
60 static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
65 typedef basis_rep<T> base;
66 typedef typename base::size_type
size_type;
67 static void evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
68 static void grad_evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
69 static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
74 typedef basis_rep<T> base;
75 typedef typename base::size_type
size_type;
76 static void evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
77 static void grad_evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
78 static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
83 typedef basis_rep<T> base;
84 typedef typename base::size_type
size_type;
85 static void evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<T,Eigen::Dynamic,1>& values);
86 static void grad_evaluate (
const point_basic<T>& hat_x, Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values);
87 static void hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>&);
91basis_P1_p<T>::evaluate (
92 const point_basic<T>& hat_x,
93 Eigen::Matrix<T,Eigen::Dynamic,1>& values)
100basis_P1_p<T>::grad_evaluate (
101 const point_basic<T>& hat_x,
102 Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
108basis_P1_p<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
111 x[0] = point_basic<T>();
115basis_P1_e<T>::evaluate (
116 const point_basic<T>& hat_x,
117 Eigen::Matrix<T,Eigen::Dynamic,1>& values)
120 values[0] = -hat_x[0]+1.0;
121 values[1] = hat_x[0];
125basis_P1_e<T>::grad_evaluate (
126 const point_basic<T>& hat_x,
127 Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
135basis_P1_e<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
138 x[0] = point_basic<T>(0.0);
139 x[1] = point_basic<T>(1.0);
143basis_P1_t<T>::evaluate (
144 const point_basic<T>& hat_x,
145 Eigen::Matrix<T,Eigen::Dynamic,1>& values)
148 values[0] = -hat_x[1]-hat_x[0]+1.0;
149 values[1] = hat_x[0];
150 values[2] = hat_x[1];
154basis_P1_t<T>::grad_evaluate (
155 const point_basic<T>& hat_x,
156 Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
168basis_P1_t<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
171 x[0] = point_basic<T>(0.0, 0.0);
172 x[1] = point_basic<T>(1.0, 0.0);
173 x[2] = point_basic<T>(0.0, 1.0);
177basis_P1_q<T>::evaluate (
178 const point_basic<T>& hat_x,
179 Eigen::Matrix<T,Eigen::Dynamic,1>& values)
182 values[0] = hat_x[1]*( hat_x[0]-1.0)/4.0-hat_x[0]/4.0+(1.0/4.0);
183 values[1] = -( hat_x[0]+1.0)*hat_x[1]/4.0+hat_x[0]/4.0+(1.0/4.0);
184 values[2] = hat_x[0]/4.0+hat_x[1]*( hat_x[0]+1.0)/4.0+(1.0/4.0);
185 values[3] = -( hat_x[0]-1.0)*hat_x[1]/4.0-hat_x[0]/4.0+(1.0/4.0);
189basis_P1_q<T>::grad_evaluate (
190 const point_basic<T>& hat_x,
191 Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
194 values[0][0] = hat_x[1]/4.0-(1.0/4.0);
195 values[0][1] = hat_x[0]/4.0-(1.0/4.0);
196 values[1][0] = -hat_x[1]/4.0+(1.0/4.0);
197 values[1][1] = -hat_x[0]/4.0-(1.0/4.0);
198 values[2][0] = hat_x[1]/4.0+(1.0/4.0);
199 values[2][1] = hat_x[0]/4.0+(1.0/4.0);
200 values[3][0] = -hat_x[1]/4.0-(1.0/4.0);
201 values[3][1] = -hat_x[0]/4.0+(1.0/4.0);
205basis_P1_q<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
208 x[0] = point_basic<T>(-1.0, -1.0);
209 x[1] = point_basic<T>(1.0, -1.0);
210 x[2] = point_basic<T>(1.0, 1.0);
211 x[3] = point_basic<T>(-1.0, 1.0);
215basis_P1_T<T>::evaluate (
216 const point_basic<T>& hat_x,
217 Eigen::Matrix<T,Eigen::Dynamic,1>& values)
220 values[0] = -hat_x[2]-hat_x[0]-hat_x[1]+1.0;
221 values[1] = hat_x[0];
222 values[2] = hat_x[1];
223 values[3] = hat_x[2];
227basis_P1_T<T>::grad_evaluate (
228 const point_basic<T>& hat_x,
229 Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
247basis_P1_T<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
250 x[0] = point_basic<T>(0.0, 0.0, 0.0);
251 x[1] = point_basic<T>(1.0, 0.0, 0.0);
252 x[2] = point_basic<T>(0.0, 1.0, 0.0);
253 x[3] = point_basic<T>(0.0, 0.0, 1.0);
257basis_P1_P<T>::evaluate (
258 const point_basic<T>& hat_x,
259 Eigen::Matrix<T,Eigen::Dynamic,1>& values)
262 values[0] = -hat_x[1]/2.0-hat_x[0]/2.0+( hat_x[1]+hat_x[0]-1.0)*hat_x[2]/2.0+(1.0/2.0);
263 values[1] = -hat_x[2]*hat_x[0]/2.0+hat_x[0]/2.0;
264 values[2] = -hat_x[1]*hat_x[2]/2.0+hat_x[1]/2.0;
265 values[3] = -hat_x[1]/2.0-hat_x[2]*( hat_x[1]+hat_x[0]-1.0)/2.0-hat_x[0]/2.0+(1.0/2.0);
266 values[4] = hat_x[2]*hat_x[0]/2.0+hat_x[0]/2.0;
267 values[5] = hat_x[2]*hat_x[1]/2.0+hat_x[1]/2.0;
271basis_P1_P<T>::grad_evaluate (
272 const point_basic<T>& hat_x,
273 Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
276 values[0][0] = hat_x[2]/2.0-(1.0/2.0);
277 values[0][1] = hat_x[2]/2.0-(1.0/2.0);
278 values[0][2] = hat_x[0]/2.0+hat_x[1]/2.0-(1.0/2.0);
279 values[1][0] = -hat_x[2]/2.0+(1.0/2.0);
281 values[1][2] = -(1.0/2.0)*hat_x[0];
283 values[2][1] = -hat_x[2]/2.0+(1.0/2.0);
284 values[2][2] = -(1.0/2.0)*hat_x[1];
285 values[3][0] = -hat_x[2]/2.0-(1.0/2.0);
286 values[3][1] = -hat_x[2]/2.0-(1.0/2.0);
287 values[3][2] = -hat_x[1]/2.0-hat_x[0]/2.0+(1.0/2.0);
288 values[4][0] = hat_x[2]/2.0+(1.0/2.0);
290 values[4][2] = (1.0/2.0)*hat_x[0];
292 values[5][1] = hat_x[2]/2.0+(1.0/2.0);
293 values[5][2] = (1.0/2.0)*hat_x[1];
297basis_P1_P<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
300 x[0] = point_basic<T>(0.0, 0.0, -1.0);
301 x[1] = point_basic<T>(1.0, 0.0, -1.0);
302 x[2] = point_basic<T>(0.0, 1.0, -1.0);
303 x[3] = point_basic<T>(0.0, 0.0, 1.0);
304 x[4] = point_basic<T>(1.0, 0.0, 1.0);
305 x[5] = point_basic<T>(0.0, 1.0, 1.0);
309basis_P1_H<T>::evaluate (
310 const point_basic<T>& hat_x,
311 Eigen::Matrix<T,Eigen::Dynamic,1>& values)
314 values[0] = -hat_x[2]*( hat_x[1]*( hat_x[0]-1.0)-hat_x[0]+1.0)/8.0+hat_x[1]*( hat_x[0]-1.0)/8.0-hat_x[0]/8.0+(1.0/8.0);
315 values[1] = hat_x[2]*( ( hat_x[0]+1.0)*hat_x[1]-hat_x[0]-1.0)/8.0-( hat_x[0]+1.0)*hat_x[1]/8.0+hat_x[0]/8.0+(1.0/8.0);
316 values[2] = hat_x[1]*( hat_x[0]+1.0)/8.0+hat_x[0]/8.0-( hat_x[1]*( hat_x[0]+1.0)+hat_x[0]+1.0)*hat_x[2]/8.0+(1.0/8.0);
317 values[3] = hat_x[2]*( hat_x[0]+( hat_x[0]-1.0)*hat_x[1]-1.0)/8.0-hat_x[0]/8.0-( hat_x[0]-1.0)*hat_x[1]/8.0+(1.0/8.0);
318 values[4] = -hat_x[2]*( hat_x[0]-( hat_x[0]-1.0)*hat_x[1]-1.0)/8.0-hat_x[0]/8.0+( hat_x[0]-1.0)*hat_x[1]/8.0+(1.0/8.0);
319 values[5] = -( hat_x[0]+1.0)*hat_x[1]/8.0+hat_x[0]/8.0-hat_x[2]*( ( hat_x[0]+1.0)*hat_x[1]-hat_x[0]-1.0)/8.0+(1.0/8.0);
320 values[6] = ( hat_x[0]+1.0)*hat_x[1]/8.0+hat_x[0]/8.0+hat_x[2]*( ( hat_x[0]+1.0)*hat_x[1]+hat_x[0]+1.0)/8.0+(1.0/8.0);
321 values[7] = -( hat_x[0]-1.0)*hat_x[1]/8.0-hat_x[0]/8.0-hat_x[2]*( ( hat_x[0]-1.0)*hat_x[1]+hat_x[0]-1.0)/8.0+(1.0/8.0);
325basis_P1_H<T>::grad_evaluate (
326 const point_basic<T>& hat_x,
327 Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& values)
330 values[0][0] = -( hat_x[1]-1.0)*hat_x[2]/8.0+hat_x[1]/8.0-(1.0/8.0);
331 values[0][1] = hat_x[0]/8.0-( hat_x[0]-1.0)*hat_x[2]/8.0-(1.0/8.0);
332 values[0][2] = hat_x[0]/8.0-( hat_x[0]-1.0)*hat_x[1]/8.0-(1.0/8.0);
333 values[1][0] = -hat_x[1]/8.0+hat_x[2]*( hat_x[1]-1.0)/8.0+(1.0/8.0);
334 values[1][1] = -hat_x[0]/8.0+hat_x[2]*( hat_x[0]+1.0)/8.0-(1.0/8.0);
335 values[1][2] = -hat_x[0]/8.0+hat_x[1]*( hat_x[0]+1.0)/8.0-(1.0/8.0);
336 values[2][0] = hat_x[1]/8.0-( hat_x[1]+1.0)*hat_x[2]/8.0+(1.0/8.0);
337 values[2][1] = -( hat_x[0]+1.0)*hat_x[2]/8.0+hat_x[0]/8.0+(1.0/8.0);
338 values[2][2] = -( hat_x[0]+1.0)*hat_x[1]/8.0-hat_x[0]/8.0-(1.0/8.0);
339 values[3][0] = -hat_x[1]/8.0+hat_x[2]*( hat_x[1]+1.0)/8.0-(1.0/8.0);
340 values[3][1] = -hat_x[0]/8.0+hat_x[2]*( hat_x[0]-1.0)/8.0+(1.0/8.0);
341 values[3][2] = hat_x[1]*( hat_x[0]-1.0)/8.0+hat_x[0]/8.0-(1.0/8.0);
342 values[4][0] = hat_x[1]/8.0+( hat_x[1]-1.0)*hat_x[2]/8.0-(1.0/8.0);
343 values[4][1] = hat_x[0]/8.0+hat_x[2]*( hat_x[0]-1.0)/8.0-(1.0/8.0);
344 values[4][2] = ( hat_x[0]-1.0)*hat_x[1]/8.0-hat_x[0]/8.0+(1.0/8.0);
345 values[5][0] = -hat_x[2]*( hat_x[1]-1.0)/8.0-hat_x[1]/8.0+(1.0/8.0);
346 values[5][1] = -hat_x[2]*( hat_x[0]+1.0)/8.0-hat_x[0]/8.0-(1.0/8.0);
347 values[5][2] = -( hat_x[0]+1.0)*hat_x[1]/8.0+hat_x[0]/8.0+(1.0/8.0);
348 values[6][0] = hat_x[2]*( hat_x[1]+1.0)/8.0+hat_x[1]/8.0+(1.0/8.0);
349 values[6][1] = ( hat_x[0]+1.0)*hat_x[2]/8.0+hat_x[0]/8.0+(1.0/8.0);
350 values[6][2] = ( hat_x[0]+1.0)*hat_x[1]/8.0+hat_x[0]/8.0+(1.0/8.0);
351 values[7][0] = -hat_x[2]*( hat_x[1]+1.0)/8.0-hat_x[1]/8.0-(1.0/8.0);
352 values[7][1] = -hat_x[0]/8.0-( hat_x[0]-1.0)*hat_x[2]/8.0+(1.0/8.0);
353 values[7][2] = -hat_x[0]/8.0-( hat_x[0]-1.0)*hat_x[1]/8.0+(1.0/8.0);
357basis_P1_H<T>::hat_node (Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& x)
360 x[0] = point_basic<T>(-1.0, -1.0, -1.0);
361 x[1] = point_basic<T>(1.0, -1.0, -1.0);
362 x[2] = point_basic<T>(1.0, 1.0, -1.0);
363 x[3] = point_basic<T>(-1.0, 1.0, -1.0);
364 x[4] = point_basic<T>(-1.0, -1.0, 1.0);
365 x[5] = point_basic<T>(1.0, -1.0, 1.0);
366 x[6] = point_basic<T>(1.0, 1.0, 1.0);
367 x[7] = point_basic<T>(-1.0, 1.0, 1.0);
371 :
base(sopt), _hat_node()
374 base::_name = base::standard_naming (
family_name(), 1, base::_sopt);
392 Eigen::Matrix<T,Eigen::Dynamic,1>& values)
const
396 return basis_P1_p<T>::evaluate (hat_x, values);
399 return basis_P1_e<T>::evaluate (hat_x, values);
402 return basis_P1_t<T>::evaluate (hat_x, values);
405 return basis_P1_q<T>::evaluate (hat_x, values);
408 return basis_P1_T<T>::evaluate (hat_x, values);
411 return basis_P1_P<T>::evaluate (hat_x, values);
414 return basis_P1_H<T>::evaluate (hat_x, values);
417 error_macro (
"evaluate: unsupported `" << hat_K.
name() <<
"' element type");
430 return basis_P1_p<T>::grad_evaluate (hat_x, values);
433 return basis_P1_e<T>::grad_evaluate (hat_x, values);
436 return basis_P1_t<T>::grad_evaluate (hat_x, values);
439 return basis_P1_q<T>::grad_evaluate (hat_x, values);
442 return basis_P1_T<T>::grad_evaluate (hat_x, values);
445 return basis_P1_P<T>::grad_evaluate (hat_x, values);
448 return basis_P1_H<T>::grad_evaluate (hat_x, values);
451 error_macro (
"grad_evaluate: unsupported `" << hat_K.
name() <<
"' element type");
459 const Eigen::Matrix<T,Eigen::Dynamic,1>& f_xnod,
460 Eigen::Matrix<T,Eigen::Dynamic,1>& dof)
const
470 base::is_continuous(),
471 base::_ndof_on_subgeo_internal,
472 base::_ndof_on_subgeo,
473 base::_nnod_on_subgeo_internal,
474 base::_nnod_on_subgeo,
475 base::_first_idof_by_dimension_internal,
476 base::_first_idof_by_dimension,
477 base::_first_inod_by_dimension_internal,
478 base::_first_inod_by_dimension);
487 return basis_P1_p<T>::hat_node (_hat_node[hat_K.
variant()]);
490 return basis_P1_e<T>::hat_node (_hat_node[hat_K.
variant()]);
493 return basis_P1_t<T>::hat_node (_hat_node[hat_K.
variant()]);
496 return basis_P1_q<T>::hat_node (_hat_node[hat_K.
variant()]);
499 return basis_P1_T<T>::hat_node (_hat_node[hat_K.
variant()]);
502 return basis_P1_P<T>::hat_node (_hat_node[hat_K.
variant()]);
505 return basis_P1_H<T>::hat_node (_hat_node[hat_K.
variant()]);
508 error_macro (
"hat_node: unsupported `" << hat_K.
name() <<
"' element type");
field::size_type size_type
basis_P1(const basis_option &sopt)
base::size_type size_type
void _initialize_cstor_sizes() 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 evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &values) const
std::string family_name() const
void grad_evaluate(reference_element hat_K, const point_basic< T > &hat_x, Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &values) const
void _initialize_data(reference_element hat_K) const
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_internal, 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_internal, 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_internal, 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_internal, std::array< std::array< size_type, 5 >, reference_element::max_variant > &first_inod_by_dimension)
see the basis_option page for the full documentation
see the reference_element page for the full documentation
static const variant_type H
static const variant_type q
static const variant_type e
static const variant_type p
variant_type variant() const
static const variant_type T
static const variant_type P
static const variant_type t
#define error_macro(message)
This file is part of Rheolef.
void evaluate(const geo_basic< float_type, M > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, 1 > &value) const