Rheolef  7.1
an efficient C++ finite element environment
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
3 // basis evaluated on lattice of quadrature formulae: auxilliaries
24 
25 #include "rheolef/basis.h"
26 namespace rheolef { namespace details {
27 
28 // vdm = (phi_j(xi))_{i,j}
29 // i.e. the full basis at xi is the i-th row
30 template<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 }
47 template<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 }
64 template<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
rheolef::point_basic
Definition: point.h:87
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
rheolef::details::basis_on_pointset_evaluate_on_side
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)
Definition: basis_on_pointset_evaluate.icc:65
mkgeo_ball.b
int b
Definition: mkgeo_ball.sh:152
rheolef::details::basis_on_pointset_evaluate
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)
Definition: basis_on_pointset_evaluate.icc:31
mkgeo_ball.d
int d
Definition: mkgeo_ball.sh:154
rheolef::side_information_type
Definition: reference_element_face_transformation.h:37
rheolef::reference_element
see the reference_element page for the full documentation
Definition: reference_element.h:66
rheolef::details::basis_on_pointset_grad_evaluate
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)
Definition: basis_on_pointset_evaluate.icc:48
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::reference_element::dimension
size_type dimension() const
Definition: reference_element.h:101