Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
basis_on_pointset_evaluate.icc
Go to the documentation of this file.
1#ifndef _RHEO_BASIS_ON_POINTSET_EVALUATE_H
2#define _RHEO_BASIS_ON_POINTSET_EVALUATE_H
23// basis evaluated on lattice of quadrature formulae: auxilliaries
24
25#include "rheolef/basis.h"
26namespace rheolef { namespace details {
27
28// vdm = (phi_j(xi))_{i,j}
29// i.e. the full basis at xi is the i-th row
30template<class Basis, class T, class Value>
32 const Basis& b,
33 const reference_element& hat_K,
34 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_x,
35 Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& vdm)
36{
37 size_t loc_ndof = b.ndof(hat_K);
38 size_t loc_nnod = hat_x.size();
39 vdm.resize (loc_nnod, loc_ndof);
40 Eigen::Matrix<Value,Eigen::Dynamic,1> vdm_row;
41 vdm_row.resize (loc_ndof);
42 for (size_t loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
43 b.evaluate (hat_K, hat_x[loc_inod], vdm_row);
44 vdm.row (loc_inod) = vdm_row.transpose(); // TODO: how to avoid a copy: support matrix::row arg ?
45 }
46}
47template<class Basis, class T, class Value>
49 const Basis& b,
50 const reference_element& hat_K,
51 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_x,
52 Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& vdm_grad)
53{
54 size_t loc_ndof = b.ndof(hat_K);
55 size_t loc_nnod = hat_x.size();
56 vdm_grad.resize (loc_nnod, loc_ndof);
57 Eigen::Matrix<Value,Eigen::Dynamic,1> vdm_grad_row;
58 vdm_grad_row.resize (loc_ndof);
59 for (size_t loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
60 b.grad_evaluate (hat_K, hat_x[loc_inod], vdm_grad_row);
61 vdm_grad.row (loc_inod) = vdm_grad_row.transpose(); // TODO: how to avoid a copy: support matrix::row arg ?
62 }
63}
64template<class Basis, class T, class Value>
66 const Basis& b,
67 const reference_element& tilde_K,
68 const side_information_type& sid,
69 const Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>& hat_x,
70 Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& vdm)
71{
72 size_t d = tilde_K.dimension();
73 check_macro (d > 0, "invalid zero dimension");
74 size_t loc_ndof = b.ndof(tilde_K);
75 size_t loc_nnod = hat_x.size();
76 vdm.resize (loc_nnod, loc_ndof);
77 Eigen::Matrix<Value,Eigen::Dynamic,1> vdm_row;
78 vdm_row.resize (loc_ndof);
79 for (size_t loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
80 b.evaluate_on_side (tilde_K, sid, hat_x[loc_inod], vdm_row);
81 vdm.row (loc_inod) = vdm_row.transpose(); // TODO: how to avoid a copy: support matrix::row arg ?
82 }
83}
84
85}}// namespace rheolef::details
86#endif // _RHEO_BASIS_ON_POINTSET_EVALUATE_H
see the reference_element page for the full documentation
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
void basis_on_pointset_grad_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_grad)
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)
void basis_on_pointset_evaluate_on_side(const Basis &b, const reference_element &tilde_K, const side_information_type &sid, const Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 > &hat_x, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &vdm)
This file is part of Rheolef.