Flow123d  DF_patch_fe_data_tables-956a7bc
patch_point_values.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file patch_point_values.hh
15  * @brief Store finite element data on the actual patch
16  * such as shape function values, gradients, Jacobian
17  * of the mapping from the reference cell etc.
18  * @author David Flanderka
19  */
20 
21 #ifndef PATCH_POINT_VALUES_HH_
22 #define PATCH_POINT_VALUES_HH_
23 
24 #include <Eigen/Dense>
25 
26 #include "fem/eigen_tools.hh"
27 #include "fem/dh_cell_accessor.hh"
28 #include "fem/element_values.hh"
30 #include "fem/arena_resource.hh"
31 #include "fem/arena_vec.hh"
32 
33 
34 template<unsigned int spacedim> class PatchFEValues;
35 template<unsigned int spacedim> class ElOp;
36 template<unsigned int dim> class BulkValues;
37 template<unsigned int dim> class SideValues;
38 using Scalar = double;
41 
42 
43 
44 
45 /// Type for conciseness
46 using ReinitFunction = std::function<void(std::vector<ElOp<3>> &, IntTableArena &)>;
47 
48 
49 namespace FeBulk {
50  /**
51  * Enumeration of element bulk operations
52  *
53  * Operations are stored in fix order. Order in enum is equal to order
54  * in PatchPointVale::operations_ vector. FE operations are added dynamically
55  * by request of user.
56  */
57  enum BulkOps
58  {
59  /// operations evaluated on elements
60  opElCoords, ///< coordinations of all nodes of element
61  opJac, ///< Jacobian of element
62  opInvJac, ///< inverse Jacobian
63  opJacDet, ///< determinant of Jacobian
64  /// operations evaluated on quadrature points
65  opCoords, ///< coordinations of quadrature point
66  opWeights, ///< weight of quadrature point
67  opJxW ///< JxW value of quadrature point
68  };
69 }
70 
71 
72 namespace FeSide {
73  /**
74  * Enumeration of element side operations
75  *
76  * Operations are stored in fix order. Order in enum is equal to order
77  * in PatchPointVale::operations_ vector. FE operations are added dynamically
78  * by request of user.
79  */
80  enum SideOps
81  {
82  /// operations evaluated on elements
83  opElCoords, ///< coordinations of all nodes of element
84  opElJac, ///< Jacobian of element
85  opElInvJac, ///< inverse Jacobian of element
86  /// operations evaluated on sides
87  opSideCoords, ///< coordinations of all nodes of side
88  opSideJac, ///< Jacobian of element
89  opSideJacDet, ///< determinant of Jacobian of side
90  /// operations evaluated on quadrature points
91  opCoords, ///< coordinations of quadrature point
92  opWeights, ///< weight of quadrature point
93  opJxW, ///< JxW value of quadrature point
94  opNormalVec ///< normal vector of quadrature point
95  };
96 }
97 
98 
99 /// Distinguishes operations by type and size of output rows
101 {
102  elemOp, ///< operation is evaluated on elements or sides
103  pointOp, ///< operation is evaluated on quadrature points
104  fixedSizeOp ///< operation has fixed size and it is filled during initialization
105 };
106 
107 
108 
109 /**
110  * v Class for storing FE data of quadrature points on one patch.
111  *
112  * Store data of bulk or side quadrature points of one dimension.
113  */
114 template<unsigned int spacedim = 3>
116 {
117 public:
118  /**
119  * Constructor
120  *
121  * @param dim Set dimension
122  */
124  : dim_(dim), elements_map_(300, 0), points_map_(300, 0), asm_arena_(asm_arena) {
125  reset();
126  }
127 
128  /**
129  * Initialize object, set number of columns (quantities) in tables.
130  */
131  void initialize() {
132  this->reset();
133  int_table_.resize(int_sizes_.size());
134  }
135 
136  inline void init_finalize(PatchArena *patch_arena) {
137  patch_arena_ = patch_arena;
138  }
139 
140  /// Reset number of columns (points and elements)
141  inline void reset() {
142  n_points_ = 0;
143  n_elems_ = 0;
144  i_elem_ = 0;
145  }
146 
147  /// Getter for dim_
148  inline uint dim() const {
149  return dim_;
150  }
151 
152  /// Getter for n_elems_
153  inline uint n_elems() const {
154  return n_elems_;
155  }
156 
157  /// Getter for n_points_
158  inline uint n_points() const {
159  return n_points_;
160  }
161 
162  /// Getter for quadrature
164  return quad_;
165  }
166 
167  /// Resize data tables. Method is called before reinit of patch.
169  n_elems_ = n_elems;
172  for (uint i=0; i<int_table_.rows(); ++i) {
173  int_table_(i) = ArenaVec<uint>(sizes[ int_sizes_[i] ], *patch_arena_);
174  }
175  for (auto &elOp : operations_)
176  if (elOp.size_type() != fixedSizeOp) {
177  elOp.allocate_result(sizes[elOp.size_type()], *patch_arena_);
178  }
179  }
180 
181  /**
182  * Register element, add to coords operation
183  *
184  * @param coords Coordinates of element nodes.
185  * @param element_patch_idx Index of element on patch.
186  */
187  uint register_element(arma::mat coords, uint element_patch_idx) {
189  auto &coords_mat = op.result_matrix();
190  std::size_t i_elem = i_elem_;
191  for (uint i_col=0; i_col<coords.n_cols; ++i_col)
192  for (uint i_row=0; i_row<coords.n_rows; ++i_row) {
193  coords_mat(i_row, i_col)(i_elem) = coords(i_row, i_col);
194  }
195 
196  elements_map_[element_patch_idx] = i_elem_;
197  return i_elem_++;
198  }
199 
200  /**
201  * Register side, add to coords operations
202  *
203  * @param coords Coordinates of element nodes.
204  * @param side_coords Coordinates of side nodes.
205  * @param side_idx Index of side on element.
206  */
207  uint register_side(arma::mat elm_coords, arma::mat side_coords, uint side_idx) {
208  {
210  auto &coords_mat = op.result_matrix();
211  std::size_t i_elem = i_elem_;
212  for (uint i_col=0; i_col<elm_coords.n_cols; ++i_col)
213  for (uint i_row=0; i_row<elm_coords.n_rows; ++i_row) {
214  coords_mat(i_row, i_col)(i_elem) = elm_coords(i_row, i_col);
215  }
216  }
217 
218  {
220  auto &coords_mat = op.result_matrix();
221  std::size_t i_elem = i_elem_;
222  for (uint i_col=0; i_col<side_coords.n_cols; ++i_col)
223  for (uint i_row=0; i_row<side_coords.n_rows; ++i_row) {
224  coords_mat(i_row, i_col)(i_elem) = side_coords(i_row, i_col);
225  }
226  }
227 
228  int_table_(3)(i_elem_) = side_idx;
229 
230  return i_elem_++;
231  }
232 
233  /**
234  * Register bulk point, add to int_table_
235  *
236  * @param elem_table_row Index of element in temporary element table.
237  * @param value_patch_idx Index of point in ElementCacheMap.
238  * @param elem_idx Index of element in Mesh.
239  * @param i_point_on_elem Index of point on element
240  */
241  uint register_bulk_point(uint elem_table_row, uint value_patch_idx, uint elem_idx, uint i_point_on_elem) {
242  uint point_pos = i_point_on_elem * n_elems_ + elem_table_row; // index of bulk point on patch
243  int_table_(0)(point_pos) = value_patch_idx;
244  int_table_(1)(point_pos) = elem_table_row;
245  int_table_(2)(point_pos) = elem_idx;
246 
247  points_map_[value_patch_idx] = point_pos;
248  return point_pos;
249  }
250 
251  /**
252  * Register side point, add to int_table_
253  *
254  * @param elem_table_row Index of side in temporary element table.
255  * @param value_patch_idx Index of point in ElementCacheMap.
256  * @param elem_idx Index of element in Mesh.
257  * @param side_idx Index of side on element.
258  * @param i_point_on_side Index of point on side
259  */
260  uint register_side_point(uint elem_table_row, uint value_patch_idx, uint elem_idx, uint side_idx, uint i_point_on_side) {
261  uint point_pos = i_point_on_side * n_elems_ + elem_table_row; // index of side point on patch
262  int_table_(0)(point_pos) = value_patch_idx;
263  int_table_(1)(point_pos) = elem_table_row;
264  int_table_(2)(point_pos) = elem_idx;
265  int_table_(4)(point_pos) = side_idx;
266 
267  points_map_[value_patch_idx] = point_pos;
268  return point_pos;
269  }
270 
271  /**
272  * Adds accessor of new operation to operations_ vector
273  *
274  * @param shape Shape of function output
275  * @param reinit_f Reinitialize function
276  * @param input_ops_vec Indices of input operations in operations_ vector.
277  * @param size_type Type of operation by size of rows
278  */
279  ElOp<spacedim> &make_new_op(std::initializer_list<uint> shape, ReinitFunction reinit_f, std::vector<uint> input_ops_vec, OpSizeType size_type = pointOp) {
280  ElOp<spacedim> op_accessor(this->dim_, shape, reinit_f, size_type, input_ops_vec);
281  row_sizes_.insert(row_sizes_.end(), op_accessor.n_comp(), size_type);
282  operations_.push_back(op_accessor);
283  return operations_[operations_.size()-1];
284  }
285 
286  /**
287  * Adds accessor of new operation with fixed data size (ref data) to operations_ vector
288  *
289  * @param shape Shape of function output
290  * @param reinit_f Reinitialize function
291  */
292  ElOp<spacedim> &make_fixed_op(std::initializer_list<uint> shape, ReinitFunction reinit_f) {
293  return make_new_op(shape, reinit_f, {}, fixedSizeOp);
294  }
295 
296  /**
297  * Adds accessor of FE operation and adds operation dynamically to operations_ vector
298  *
299  * @param shape Shape of function output
300  * @param reinit_f Reinitialize function
301  * @param input_ops_vec Indices of input operations in operations_ vector.
302  * @param n_dofs Number of DOFs
303  * @param size_type Type of operation by size of rows
304  */
305  ElOp<spacedim> &make_fe_op(std::initializer_list<uint> shape, ReinitFunction reinit_f, std::vector<uint> input_ops_vec, uint n_dofs,
306  OpSizeType size_type = pointOp) {
307  ElOp<spacedim> op_accessor(this->dim_, shape, reinit_f, size_type, input_ops_vec, n_dofs);
308  row_sizes_.insert(row_sizes_.end(), op_accessor.n_comp() * n_dofs, size_type);
309  operations_.push_back(op_accessor);
310  return operations_[operations_.size()-1];
311  }
312 
313 
314  /**
315  * Reinitializes patch data.
316  *
317  * Calls reinit functions defined on each operations.
318  */
319  void reinit_patch() {
320  if (n_elems_ == 0) return; // skip if tables are empty
321  for (uint i=0; i<operations_.size(); ++i)
322  operations_[i].reinit_function(operations_, int_table_);
323  }
324 
325  /**
326  * Returns scalar output value.
327  *
328  * @param op_idx Index of operation in operations vector
329  * @param point_idx Index of quadrature point in ElementCacheMap
330  * @param i_dof Index of DOF
331  */
332  inline Scalar scalar_value(uint op_idx, uint point_idx, uint i_dof=0) const {
333  return operations_[op_idx].result_matrix()(0)(points_map_[point_idx] + i_dof*n_points_);
334  }
335 
336  /**
337  * Returns vector output value.
338  *
339  * @param op_idx Index of operation in operations vector
340  * @param point_idx Index of quadrature point in ElementCacheMap
341  * @param i_dof Index of DOF
342  */
343  inline Vector vector_value(uint op_idx, uint point_idx, uint i_dof=0) const {
344  Vector val;
345  const auto &op_matrix = operations_[op_idx].result_matrix();
346  uint op_matrix_idx = points_map_[point_idx] + i_dof*n_points_;
347  for (uint i=0; i<3; ++i)
348  val(i) = op_matrix(i)(op_matrix_idx);
349  return val;
350  }
351 
352  /**
353  * Returns tensor output value.
354  *
355  * @param op_idx Index of operation in operations vector
356  * @param point_idx Index of quadrature point in ElementCacheMap
357  * @param i_dof Index of DOF
358  */
359  inline Tensor tensor_value(uint op_idx, uint point_idx, uint i_dof=0) const {
360  Tensor val;
361  const auto &op_matrix = operations_[op_idx].result_matrix();
362  uint op_matrix_idx = points_map_[point_idx] + i_dof*n_points_;
363  for (uint i=0; i<3; ++i)
364  for (uint j=0; j<3; ++j)
365  val(i,j) = op_matrix(i,j)(op_matrix_idx);
366  return val;
367  }
368 
369  /**
370  * Performs output of data tables to stream.
371  *
372  * Development method.
373  * @param points Allows switched off output of point table,
374  * @param ints Allows switched off output of int (connectivity to elements) table,
375  */
376  void print_data_tables(ostream& stream, bool points, bool ints) const {
377  if (points) {
378  stream << "Point vals: " << std::endl;
379  for (auto &op : operations_) {
380  const auto &mat = op.result_matrix();
381  for (uint i_mat=0; i_mat<mat.rows()*mat.cols(); ++i_mat) {
382  if (mat(i_mat).data_size()==0) stream << "<empty>";
383  else {
384  const double *vals = mat(i_mat).data_ptr();
385  for (size_t i_val=0; i_val<mat(i_mat).data_size(); ++i_val)
386  stream << vals[i_val] << " ";
387  }
388  stream << std::endl;
389  }
390  stream << " --- end of operation ---" << std::endl;
391  }
392  }
393  if (ints) {
394  stream << "Int vals: " << int_table_.rows() << " - " << int_table_.cols() << std::endl;
395  for (uint i_row=0; i_row<int_table_.rows(); ++i_row) {
396  if (int_table_(i_row).data_size()==0) stream << "<empty>";
397  else {
398  const uint *vals = int_table_(i_row).data_ptr();
399  for (size_t i_val=0; i_val<int_table_(i_row).data_size(); ++i_val)
400  stream << vals[i_val] << " ";
401  }
402  stream << std::endl;
403  }
404  stream << std::endl;
405  }
406  }
407 
408  /**
409  * Performs table of fixed operations to stream.
410  *
411  * Development method.
412  * @param bulk_side Needs set 0 (bulk) or 1 (side) for correct output of operation names.
413  */
414  void print_operations(ostream& stream, uint bulk_side) const {
416  {
417  { "el_coords", "jacobian", "inv_jac", "jac_det", "pt_coords", "weights", "JxW", "", "", "", "", "" },
418  { "el_coords", "el_jac", "el_inv_jac", "side_coords", "side_jac", "side_jac_det", "exp_el_coords", "exp_el_jac", "exp_el_inv_jac",
419  "exp_side_coords", "exp_side_jac", "exp_side_jac_det", "pt_coords", "weights", "JxW", "normal_vec", "", "", "", "", "" }
420  };
421  stream << std::setfill(' ') << " Operation" << setw(12) << "" << "Shape" << setw(2) << ""
422  << "n DOFs" << setw(2) << "" << "Input operations" << endl;
423  for (uint i=0; i<operations_.size(); ++i) {
424  stream << " " << std::left << setw(20) << op_names[bulk_side][i] << "" << " " << setw(6) << operations_[i].format_shape() << "" << " "
425  << setw(7) << operations_[i].n_dofs() << "" << " ";
426  auto &input_ops = operations_[i].input_ops();
427  for (auto i_o : input_ops) stream << op_names[bulk_side][i_o] << " ";
428  stream << std::endl;
429  }
430  }
431 
432 protected:
433  /**
434  * Hold integer values of quadrature points of defined operations.
435  *
436  * Table contains following rows:
437  * 0: Index of quadrature point on patch
438  * 1: Row of element/side in ElOp::result_ table in registration step (before expansion)
439  * 2: Element idx in Mesh
440  * - last two rows are allocated only for side point table
441  * 3: Index of side in element - short vector, size of column = number of sides
442  * 4: Index of side in element - long vector, size of column = number of points
443  * Number of used rows is given by n_points_.
444  */
446 
447  /// Set size and type of rows of int_table_, value is set implicitly in constructor of descendants
449 
450 
451  /// Vector of all defined operations
453 
454  uint dim_; ///< Dimension
455  uint n_points_; ///< Number of points in patch
456  uint n_elems_; ///< Number of elements in patch
457  uint i_elem_; ///< Index of registered element in table, helper value used during patch creating.
458  Quadrature *quad_; ///< Quadrature of given dimension and order passed in constructor.
459 
460  std::vector<uint> elements_map_; ///< Map of element patch indices to ElOp::result_ and int_table_ tables
461  std::vector<uint> points_map_; ///< Map of point patch indices to ElOp::result_ and int_table_ tables
462  std::vector<OpSizeType> row_sizes_; ///< hold sizes of rows by type of operation
463  AssemblyArena &asm_arena_; ///< Reference to global assembly arena of PatchFeValues
464  PatchArena *patch_arena_; ///< Pointer to global patch arena of PatchFeValues
465 
466  friend class PatchFEValues<spacedim>;
467  friend class ElOp<spacedim>;
468  template<unsigned int dim>
469  friend class BulkValues;
470  template<unsigned int dim>
471  friend class SideValues;
472  template<unsigned int dim>
473  friend class JoinValues;
474 };
475 
476 /**
477  * @brief Class represents element or FE operations.
478  */
479 template<unsigned int spacedim = 3>
480 class ElOp {
481 public:
482  /**
483  * Constructor
484  *
485  * Set all data members.
486  */
487  ElOp(uint dim, std::initializer_list<uint> shape, ReinitFunction reinit_f, OpSizeType size_type, std::vector<uint> input_ops = {}, uint n_dofs = 1)
489  {}
490 
491  /// Aligns shape_vec to 2 items (equal to matrix number of dimensions)
492  std::vector<uint> set_shape_vec(std::initializer_list<uint> shape) const {
493  std::vector<uint> shape_vec(shape);
494  if (shape_vec.size() == 1) shape_vec.push_back(1);
495  ASSERT_EQ(shape_vec.size(), 2);
496  return shape_vec;
497  }
498 
499  /**
500  * Return number of operation components
501  *
502  * Value is computed from shape_ vector
503  */
504  inline uint n_comp() const {
505  return shape_[0] * shape_[1];
506  }
507 
508  /// Getter for dimension
509  inline uint dim() const {
510  return dim_;
511  }
512 
513  /// Getter for size_type_
515  return size_type_;
516  }
517 
518  /// Getter for n_dofs_
519  inline uint n_dofs() const {
520  return n_dofs_;
521  }
522 
523  /// Getter for input_ops_
524  inline const std::vector<uint> &input_ops() const {
525  return input_ops_;
526  }
527 
528  /// Getter for shape_
529  inline const std::vector<uint> &shape() const {
530  return shape_;
531  }
532 
533  /**
534  * Format shape to string
535  *
536  * Method is used in output development method.
537  */
538  inline std::string format_shape() const {
539  stringstream ss;
540  ss << shape_[0] << "x" << shape_[1];
541  return ss.str();
542  }
543 
544  /// Call reinit function on element table if function is defined
545  inline void reinit_function(std::vector<ElOp<spacedim>> &operations, IntTableArena &int_table) {
546  reinit_func(operations, int_table);
547  }
548 
549  inline void allocate_result(size_t data_size, PatchArena &arena) {
550  result_ = Eigen::Matrix<ArenaVec<double>, Eigen::Dynamic, Eigen::Dynamic>(shape_[0], shape_[1]);
551  for (uint i=0; i<n_comp(); ++i)
552  result_(i) = ArenaVec<double>(data_size, arena);
553  }
554 
555  /// Return map referenced result as Eigen::Matrix
556  Eigen::Matrix<ArenaVec<double>, Eigen::Dynamic, Eigen::Dynamic> &result_matrix() {
557  return result_;
558  }
559 
560  /// Same as previous but return const reference
561  const Eigen::Matrix<ArenaVec<double>, Eigen::Dynamic, Eigen::Dynamic> &result_matrix() const {
562  return result_;
563  }
564 
565 
566 protected:
567  uint dim_; ///< Dimension
568  std::vector<uint> shape_; ///< Shape of stored data (size of vector or number of rows and cols of matrix)
569  Eigen::Matrix<ArenaVec<double>, Eigen::Dynamic, Eigen::Dynamic> result_; ///< Result matrix of operation
570  OpSizeType size_type_; ///< Type of operation by size of vector (element, point or fixed size)
571  std::vector<uint> input_ops_; ///< Indices of operations in PatchPointValues::operations_ vector on which ElOp is depended
572  uint n_dofs_; ///< Number of DOFs of FE operations (or 1 in case of element operations)
573 
574  ReinitFunction reinit_func; ///< Pointer to patch reinit function of element data table specialized by operation
575 };
576 
577 
578 /// Defines common functionality of reinit operations.
580  // empty base operation
581  static inline void op_base(FMT_UNUSED std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
582  // empty
583  }
584 
585 };
586 
587 /// Defines reinit operations on bulk points.
588 struct bulk_reinit {
589  // element operations
590  template<unsigned int dim>
591  static inline void elop_jac(std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
592  // result matrix(spacedim, dim), input matrix(spacedim, dim+1)
593  auto &op = operations[FeBulk::BulkOps::opJac];
594  auto &jac_value = op.result_matrix();
595  const auto &coords_value = operations[ op.input_ops()[0] ].result_matrix();
596  for (unsigned int i=0; i<3; i++)
597  for (unsigned int j=0; j<dim; j++)
598  jac_value(i,j) = coords_value(i,j+1) - coords_value(i,0);
599  }
600  template<unsigned int dim>
601  static inline void elop_inv_jac(std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
602  // result matrix(spacedim, dim), input matrix(spacedim, dim+1)
603  auto &op = operations[FeBulk::BulkOps::opInvJac];
604  auto &inv_jac_value = op.result_matrix();
605  const auto &jac_value = operations[ op.input_ops()[0] ].result_matrix();
606  inv_jac_value = eigen_arena_tools::inverse<3, dim>(jac_value);
607  }
608  template<unsigned int dim>
609  static inline void elop_jac_det(std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
610  // result double, input matrix(spacedim, dim)
611  auto &op = operations[FeBulk::BulkOps::opJacDet];
612  auto &jac_det_value = op.result_matrix();
613  const auto &jac_value = operations[ op.input_ops()[0] ].result_matrix();
614  jac_det_value(0,0) = eigen_arena_tools::determinant<3, dim>(jac_value).abs();
615  }
616 
617  // point operations
618  static inline void ptop_coords(FMT_UNUSED std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
619  // Implement
620  }
621  static inline void ptop_weights(std::vector<ElOp<3>> &operations, PatchArena *arena, const std::vector<double> &point_weights) {
622  auto &op = operations[FeBulk::BulkOps::opWeights];
623  op.allocate_result(point_weights.size(), *arena);
624  auto &weights_value = op.result_matrix();
625  for (uint i=0; i<point_weights.size(); ++i)
626  weights_value(0,0)(i) = point_weights[i];
627  }
628  static inline void ptop_JxW(std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
629  auto &op = operations[FeBulk::BulkOps::opJxW];
630  auto &weights_value = operations[ op.input_ops()[0] ].result_matrix();
631  auto &jac_det_value = operations[ op.input_ops()[1] ].result_matrix();
632  ArenaOVec<double> weights_ovec( weights_value(0,0) );
633  ArenaOVec<double> jac_det_ovec( jac_det_value(0,0) );
634  ArenaOVec<double> jxw_ovec = jac_det_ovec * weights_ovec;
635  auto &jxw_value = op.result_matrix();
636  jxw_value(0,0) = jxw_ovec.get_vec();
637  }
638  static inline void ptop_scalar_shape(std::vector<ElOp<3>> &operations,
639  std::vector< std::vector<double> > shape_values, uint scalar_shape_op_idx) {
640  auto &op = operations[scalar_shape_op_idx];
641  uint n_dofs = shape_values.size();
642  uint n_points = shape_values[0].size();
643  uint n_elem = op.result_matrix()(0).data_size() / n_points;
644 
645  auto &shape_matrix = op.result_matrix();
646  ArenaVec<double> ref_vec(n_points * n_dofs, op.result_matrix()(0).arena());
647  ArenaVec<double> elem_vec(n_elem, op.result_matrix()(0).arena());
648  for (uint i=0; i<n_elem; ++i) {
649  elem_vec(i) = 1.0;
650  }
651  ArenaOVec<double> ref_ovec(ref_vec);
652  ArenaOVec<double> elem_ovec(elem_vec);
653  for (uint i_dof=0; i_dof<n_dofs; ++i_dof)
654  for (uint i_p=0; i_p<n_points; ++i_p)
655  ref_vec(i_dof * n_points + i_p) = shape_values[i_dof][i_p];
656  ArenaOVec<double> shape_ovec = elem_ovec * ref_ovec;
657  shape_matrix(0) = shape_ovec.get_vec();
658  }
659  template<unsigned int dim>
660  static inline void ptop_scalar_shape_grads(std::vector<ElOp<3>> &operations,
661  std::vector< std::vector<arma::mat> > ref_shape_grads, uint scalar_shape_grads_op_idx) {
662  auto &op = operations[scalar_shape_grads_op_idx];
663  auto &inv_jac_vec = operations[ op.input_ops()[0] ].result_matrix();
664  uint n_points = ref_shape_grads.size();
665  uint n_dofs = ref_shape_grads[0].size();
666 
667  Eigen::Matrix<ArenaVec<double>, dim, 1> ref_grads_vec;
668  Eigen::Matrix<ArenaOVec<double>, dim, 1> ref_grads_ovec;
669  for (uint i=0; i<ref_grads_vec.rows(); ++i) {
670  ref_grads_vec(i) = ArenaVec<double>(n_points * n_dofs, op.result_matrix()(0).arena());
671  for (uint i_dof=0; i_dof<n_dofs; ++i_dof)
672  for (uint i_p=0; i_p<n_points; ++i_p)
673  ref_grads_vec(i)(i_dof * n_points + i_p) = ref_shape_grads[i_dof][i_p](i);
674  ref_grads_ovec(i) = ArenaOVec(ref_grads_vec(i));
675  }
676 
677  Eigen::Matrix<ArenaOVec<double>, dim, 3> inv_jac_ovec;
678  for (uint i=0; i<dim*3; ++i) {
679  inv_jac_ovec(i) = ArenaOVec(inv_jac_vec(i));
680  }
681 
682  auto &result_vec = op.result_matrix();
683  Eigen::Matrix<ArenaOVec<double>, 3, 1> result_ovec = inv_jac_ovec.transpose() * ref_grads_ovec;
684  for (uint i=0; i<3; ++i) {
685  result_vec(i) = result_ovec(i).get_vec();
686  }
687  }
688 };
689 
690 
691 
692 /// Defines reinit operations on side points.
693 struct side_reinit {
694  // element operations
695  template<unsigned int dim>
696  static inline void elop_el_jac(std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
697  // result matrix(spacedim, dim), input matrix(spacedim, dim+1)
698  auto &op = operations[FeSide::SideOps::opElJac];
699  auto &jac_value = op.result_matrix();
700  const auto &coords_value = operations[ op.input_ops()[0] ].result_matrix();
701  for (unsigned int i=0; i<3; i++)
702  for (unsigned int j=0; j<dim; j++)
703  jac_value(i,j) = coords_value(i,j+1) - coords_value(i,0);
704  }
705  template<unsigned int dim>
706  static inline void elop_el_inv_jac(std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
707  auto &op = operations[FeSide::SideOps::opElInvJac];
708  auto &inv_jac_value = op.result_matrix();
709  const auto &jac_value = operations[ op.input_ops()[0] ].result_matrix();
710  inv_jac_value = eigen_arena_tools::inverse<3, dim>(jac_value);
711  }
712  template<unsigned int dim>
713  static inline void elop_sd_jac(std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
714  // result matrix(spacedim, dim), input matrix(spacedim, dim+1)
715  auto &op = operations[FeSide::SideOps::opSideJac];
716  auto &jac_value = op.result_matrix();
717  const auto &coords_value = operations[ op.input_ops()[0] ].result_matrix();
718  for (unsigned int i=0; i<3; i++)
719  for (unsigned int j=0; j<dim-1; j++)
720  jac_value(i,j) = coords_value(i,j+1) - coords_value(i,0);
721  }
722  template<unsigned int dim>
723  static inline void elop_sd_jac_det(std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
724  // result double, input matrix(spacedim, dim)
725  auto &op = operations[FeSide::SideOps::opSideJacDet];
726  auto &jac_det_value = op.result_matrix();
727  const auto &jac_value = operations[ op.input_ops()[0] ].result_matrix();
728  jac_det_value(0,0) = eigen_arena_tools::determinant<3, dim-1>(jac_value).abs();
729  }
730 
731  // Point operations
732  static inline void ptop_coords(FMT_UNUSED std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
733  // Implement
734  }
735  static inline void ptop_weights(std::vector<ElOp<3>> &operations, PatchArena *arena, const std::vector<double> &point_weights) {
736  auto &op = operations[FeSide::SideOps::opWeights];
737  op.allocate_result(point_weights.size(), *arena);
738  auto &weights_value = op.result_matrix();
739  for (uint i=0; i<point_weights.size(); ++i)
740  weights_value(0,0)(i) = point_weights[i];
741  }
742  static inline void ptop_JxW(std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
743  auto &op = operations[FeSide::SideOps::opJxW];
744  auto &weights_value = operations[ op.input_ops()[0] ].result_matrix();
745  auto &jac_det_value = operations[ op.input_ops()[1] ].result_matrix();
746  ArenaOVec<double> weights_ovec( weights_value(0,0) );
747  ArenaOVec<double> jac_det_ovec( jac_det_value(0,0) );
748  ArenaOVec<double> jxw_ovec = jac_det_ovec * weights_ovec;
749  auto &jxw_value = op.result_matrix();
750  jxw_value(0,0) = jxw_ovec.get_vec();
751  }
752  template<unsigned int dim>
753  static inline void ptop_normal_vec(std::vector<ElOp<3>> &operations, IntTableArena &el_table) {
754  auto &op = operations[FeSide::SideOps::opNormalVec];
755  auto &normal_value = op.result_matrix();
756  auto &inv_jac_mat_value = operations[ op.input_ops()[0] ].result_matrix();
757  normal_value = inv_jac_mat_value.transpose() * RefElement<dim>::normal_vector_array( el_table(3) );
758 
759  ArenaVec<double> norm_vec( normal_value(0).data_size(), normal_value(0).arena() );
760  Eigen::VectorXd A(3);
761  for (uint i=0; i<normal_value(0).data_size(); ++i) {
762  A(0) = normal_value(0)(i);
763  A(1) = normal_value(1)(i);
764  A(2) = normal_value(2)(i);
765  norm_vec(i) = A.norm();
766  }
767 
768  size_t points_per_side = el_table(4).data_size() / el_table(3).data_size();
769  size_t n_points = el_table(3).data_size();
770  for (uint i=0; i<3; ++i) {
771  normal_value(i) = normal_value(i) / norm_vec;
772  ArenaVec<double> expand_vec( normal_value(i).data_size() * points_per_side, normal_value(i).arena() );
773  for (uint j=0; j<expand_vec.data_size(); ++j) {
774  expand_vec(j) = normal_value(i)(j % n_points);
775  }
776  normal_value(i) = expand_vec;
777  }
778  }
779  static inline void ptop_scalar_shape(std::vector<ElOp<3>> &operations, IntTableArena &el_table,
780  std::vector< std::vector< std::vector<double> > > shape_values, uint scalar_shape_op_idx) {
781  uint n_dofs = shape_values[0][0].size();
782  uint n_sides = el_table(3).data_size();
783  uint n_patch_points = el_table(4).data_size();
784 
785  auto &op = operations[scalar_shape_op_idx];
786  auto &scalar_shape_value = op.result_matrix();
787  scalar_shape_value(0) = ArenaVec<double>(n_dofs*n_patch_points, scalar_shape_value(0).arena());
788 
789  for (uint i_dof=0; i_dof<n_dofs; ++i_dof) {
790  uint dof_shift = i_dof * n_patch_points;
791  for (uint i_pt=0; i_pt<n_patch_points; ++i_pt)
792  scalar_shape_value(0)(i_pt + dof_shift) = shape_values[el_table(4)(i_pt)][i_pt / n_sides][i_dof];
793  }
794  }
795  template<unsigned int dim>
796  static inline void ptop_scalar_shape_grads(std::vector<ElOp<3>> &operations, IntTableArena &el_table,
797  std::vector< std::vector< std::vector<arma::mat> > > ref_shape_grads, uint scalar_shape_grads_op_idx) {
798  uint n_points = ref_shape_grads[0].size();
799  uint n_dofs = ref_shape_grads[0][0].size();
800  uint n_sides = el_table(3).data_size();
801  uint n_patch_points = el_table(4).data_size();
802 
803  // Result vector
804  auto &op = operations[scalar_shape_grads_op_idx];
805  auto &grad_scalar_shape_value = op.result_matrix();
806 
807  // Expands inverse jacobian to inv_jac_expd_value
808  auto &inv_jac_value = operations[ op.input_ops()[0] ].result_matrix();
809  Eigen::Matrix<ArenaVec<double>, dim, 3> inv_jac_expd_value;
810  for (uint i=0; i<dim*3; ++i) {
811  inv_jac_expd_value(i) = ArenaVec<double>( n_dofs*n_patch_points, inv_jac_value(i).arena() );
812  for (uint j=0; j<n_dofs*n_patch_points; ++j)
813  inv_jac_expd_value(i)(j) = inv_jac_value(i)(j%n_sides);
814  }
815 
816  // Fill ref shape gradients by q_point. DOF and side_idx
817  Eigen::Matrix<ArenaVec<double>, dim, 1> ref_shape_grads_expd;
818  for (uint i=0; i<dim; ++i) {
819  ref_shape_grads_expd(i) = ArenaVec<double>( n_dofs*n_patch_points, inv_jac_value(0).arena() );
820  }
821  for (uint i_dof=0; i_dof<n_dofs; ++i_dof) {
822  for (uint i_pt=0; i_pt<n_points; ++i_pt) {
823  uint i_begin = (i_dof * n_points + i_pt) * n_sides;
824  for (uint i_sd=0; i_sd<n_sides; ++i_sd) {
825  for (uint i_c=0; i_c<dim; ++i_c) {
826  ref_shape_grads_expd(i_c)(i_begin + i_sd) = ref_shape_grads[el_table(3)(i_sd)][i_pt][i_dof][i_c];
827  }
828  }
829  }
830  }
831 
832  // computes operation result
833  grad_scalar_shape_value = inv_jac_expd_value.transpose() * ref_shape_grads_expd;
834  }
835 };
836 
837 
838 // template specialization
839 template<>
840 inline void side_reinit::elop_sd_jac<1>(FMT_UNUSED std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
841 }
842 
843 template<>
844 inline void side_reinit::elop_sd_jac_det<1>(std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
845  auto &op = operations[FeSide::SideOps::opSideJacDet];
846  auto &result_vec = op.result_matrix();
847  for (uint i=0;i<result_vec(0,0).data_size(); ++i) {
848  result_vec(0,0)(i) = 1.0;
849  }
850 }
851 
852 
853 
854 namespace FeBulk {
855 
856  /// Bulk data specialization, order of item in operations_ vector corresponds to the BulkOps enum
857  template<unsigned int spacedim = 3>
858  class PatchPointValues : public ::PatchPointValues<spacedim> {
859  public:
860  /// Constructor
861  PatchPointValues(uint dim, uint quad_order, AssemblyArena &asm_arena)
862  : ::PatchPointValues<spacedim>(dim, asm_arena) {
863  this->quad_ = new QGauss(dim, 2*quad_order);
864  this->int_sizes_ = {pointOp, pointOp, pointOp};
865  switch (dim) {
866  case 1:
867  init<1>();
868  break;
869  case 2:
870  init<2>();
871  break;
872  case 3:
873  init<3>();
874  break;
875  }
876  }
877 
878  private:
879  /// Initialize operations vector
880  template<unsigned int dim>
881  void init() {
882  // First step: adds element values operations
883  /*auto &el_coords =*/ this->make_new_op( {spacedim, this->dim_+1}, &common_reinit::op_base, {}, OpSizeType::elemOp );
884 
885  /*auto &el_jac =*/ this->make_new_op( {spacedim, this->dim_}, &bulk_reinit::elop_jac<dim>, {BulkOps::opElCoords}, OpSizeType::elemOp );
886 
887  /*auto &el_inv_jac =*/ this->make_new_op( {this->dim_, spacedim}, &bulk_reinit::elop_inv_jac<dim>, {BulkOps::opJac}, OpSizeType::elemOp );
888 
889  /*auto &el_jac_det =*/ this->make_new_op( {1}, &bulk_reinit::elop_jac_det<dim>, {BulkOps::opJac}, OpSizeType::elemOp );
890 
891  // Second step: adds point values operations
892  /*auto &pt_coords =*/ this->make_new_op( {spacedim}, &bulk_reinit::ptop_coords, {} );
893 
894  // use lambda reinit function
895  const std::vector<double> &point_weights_vec = this->quad_->get_weights();
896  auto lambda_weights = [this, point_weights_vec](std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
897  bulk_reinit::ptop_weights(operations, this->patch_arena_, point_weights_vec);
898  };
899  /*auto &weights =*/ this->make_fixed_op( {1}, lambda_weights );
900 
901  /*auto &JxW =*/ this->make_new_op( {1}, &bulk_reinit::ptop_JxW, {BulkOps::opWeights, BulkOps::opJacDet} );
902  }
903  };
904 
905 } // closing namespace FeBulk
906 
907 
908 
909 namespace FeSide {
910 
911 /// Bulk Side specialization, order of item in operations_ vector corresponds to the SideOps enum
912  template<unsigned int spacedim = 3>
913  class PatchPointValues : public ::PatchPointValues<spacedim> {
914  public:
915  /// Constructor
916  PatchPointValues(uint dim, uint quad_order, AssemblyArena &asm_arena)
917  : ::PatchPointValues<spacedim>(dim, asm_arena) {
918  this->quad_ = new QGauss(dim-1, 2*quad_order);
919  this->int_sizes_ = {pointOp, pointOp, pointOp, elemOp, pointOp};
920  switch (dim) {
921  case 1:
922  init<1>();
923  break;
924  case 2:
925  init<2>();
926  break;
927  case 3:
928  init<3>();
929  break;
930  }
931  }
932 
933  private:
934  /// Initialize operations vector
935  template<unsigned int dim>
936  void init() {
937  // First step: adds element values operations
938  /*auto &el_coords =*/ this->make_new_op( {spacedim, this->dim_+1}, &common_reinit::op_base, {}, OpSizeType::elemOp );
939 
940  /*auto &el_jac =*/ this->make_new_op( {spacedim, this->dim_}, &side_reinit::elop_el_jac<dim>, {SideOps::opElCoords}, OpSizeType::elemOp );
941 
942  /*auto &el_inv_jac =*/ this->make_new_op( {this->dim_, spacedim}, &side_reinit::elop_el_inv_jac<dim>, {SideOps::opElJac}, OpSizeType::elemOp );
943 
944  // Second step: adds side values operations
945  /*auto &sd_coords =*/ this->make_new_op( {spacedim, this->dim_}, &common_reinit::op_base, {}, OpSizeType::elemOp );
946 
947  /*auto &sd_jac =*/ this->make_new_op( {spacedim, this->dim_-1}, &side_reinit::elop_sd_jac<dim>, {SideOps::opSideCoords}, OpSizeType::elemOp );
948 
949  /*auto &sd_jac_det =*/ this->make_new_op( {1}, &side_reinit::elop_sd_jac_det<dim>, {SideOps::opSideJac}, OpSizeType::elemOp );
950 
951  // Third step: adds point values operations
952  /*auto &coords =*/ this->make_new_op( {spacedim}, &side_reinit::ptop_coords, {} );
953 
954  // use lambda reinit function
955  const std::vector<double> &point_weights_vec = this->quad_->get_weights();
956  auto lambda_weights = [this, point_weights_vec](std::vector<ElOp<3>> &operations, FMT_UNUSED IntTableArena &el_table) {
957  side_reinit::ptop_weights(operations, this->patch_arena_, point_weights_vec);
958  };
959  /*auto &weights =*/ this->make_fixed_op( {1}, lambda_weights );
960 
962 
963  /*auto &normal_vec =*/ this->make_new_op( {spacedim}, &side_reinit::ptop_normal_vec<dim>, {SideOps::opElInvJac} );
964  }
965  };
966 
967 } // closing namespace FeSide
968 
969 
970 
971 #endif /* PATCH_POINT_VALUES_HH_ */
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:333
ArenaVec< T > get_vec() const
Convert ArenaOVec to ArenaVec and its.
Definition: arena_vec.hh:284
size_t data_size() const
Getter for data_size_.
Definition: arena_vec.hh:104
Class represents element or FE operations.
ElOp(uint dim, std::initializer_list< uint > shape, ReinitFunction reinit_f, OpSizeType size_type, std::vector< uint > input_ops={}, uint n_dofs=1)
Eigen::Matrix< ArenaVec< double >, Eigen::Dynamic, Eigen::Dynamic > & result_matrix()
Return map referenced result as Eigen::Matrix.
void allocate_result(size_t data_size, PatchArena &arena)
std::string format_shape() const
std::vector< uint > input_ops_
Indices of operations in PatchPointValues::operations_ vector on which ElOp is depended.
std::vector< uint > set_shape_vec(std::initializer_list< uint > shape) const
Aligns shape_vec to 2 items (equal to matrix number of dimensions)
uint dim_
Dimension.
Eigen::Matrix< ArenaVec< double >, Eigen::Dynamic, Eigen::Dynamic > result_
Result matrix of operation.
std::vector< uint > shape_
Shape of stored data (size of vector or number of rows and cols of matrix)
const std::vector< uint > & shape() const
Getter for shape_.
const std::vector< uint > & input_ops() const
Getter for input_ops_.
OpSizeType size_type_
Type of operation by size of vector (element, point or fixed size)
const Eigen::Matrix< ArenaVec< double >, Eigen::Dynamic, Eigen::Dynamic > & result_matrix() const
Same as previous but return const reference.
uint n_dofs() const
Getter for n_dofs_.
ReinitFunction reinit_func
Pointer to patch reinit function of element data table specialized by operation.
void reinit_function(std::vector< ElOp< spacedim >> &operations, IntTableArena &int_table)
Call reinit function on element table if function is defined.
uint n_dofs_
Number of DOFs of FE operations (or 1 in case of element operations)
uint dim() const
Getter for dimension.
uint n_comp() const
OpSizeType size_type() const
Getter for size_type_.
Bulk data specialization, order of item in operations_ vector corresponds to the BulkOps enum.
PatchPointValues(uint dim, uint quad_order, AssemblyArena &asm_arena)
Constructor.
void init()
Initialize operations vector.
Bulk Side specialization, order of item in operations_ vector corresponds to the SideOps enum.
PatchPointValues(uint dim, uint quad_order, AssemblyArena &asm_arena)
Constructor.
void init()
Initialize operations vector.
void print_data_tables(ostream &stream, bool points, bool ints) const
PatchPointValues(uint dim, AssemblyArena &asm_arena)
AssemblyArena & asm_arena_
Reference to global assembly arena of PatchFeValues.
std::vector< OpSizeType > row_sizes_
hold sizes of rows by type of operation
std::vector< uint > points_map_
Map of point patch indices to ElOp::result_ and int_table_ tables.
uint register_bulk_point(uint elem_table_row, uint value_patch_idx, uint elem_idx, uint i_point_on_elem)
uint register_element(arma::mat coords, uint element_patch_idx)
void resize_tables(uint n_elems, uint n_points)
Resize data tables. Method is called before reinit of patch.
ElOp< spacedim > & make_fe_op(std::initializer_list< uint > shape, ReinitFunction reinit_f, std::vector< uint > input_ops_vec, uint n_dofs, OpSizeType size_type=pointOp)
std::vector< ElOp< spacedim > > operations_
Vector of all defined operations.
Quadrature * get_quadrature() const
Getter for quadrature.
uint n_elems() const
Getter for n_elems_.
uint i_elem_
Index of registered element in table, helper value used during patch creating.
void reset()
Reset number of columns (points and elements)
uint n_points() const
Getter for n_points_.
ElOp< spacedim > & make_fixed_op(std::initializer_list< uint > shape, ReinitFunction reinit_f)
std::vector< uint > elements_map_
Map of element patch indices to ElOp::result_ and int_table_ tables.
uint dim() const
Getter for dim_.
Tensor tensor_value(uint op_idx, uint point_idx, uint i_dof=0) const
Scalar scalar_value(uint op_idx, uint point_idx, uint i_dof=0) const
void init_finalize(PatchArena *patch_arena)
uint register_side(arma::mat elm_coords, arma::mat side_coords, uint side_idx)
uint register_side_point(uint elem_table_row, uint value_patch_idx, uint elem_idx, uint side_idx, uint i_point_on_side)
IntTableArena int_table_
uint n_points_
Number of points in patch.
void print_operations(ostream &stream, uint bulk_side) const
Quadrature * quad_
Quadrature of given dimension and order passed in constructor.
ElOp< spacedim > & make_new_op(std::initializer_list< uint > shape, ReinitFunction reinit_f, std::vector< uint > input_ops_vec, OpSizeType size_type=pointOp)
std::vector< OpSizeType > int_sizes_
Set size and type of rows of int_table_, value is set implicitly in constructor of descendants.
Vector vector_value(uint op_idx, uint point_idx, uint i_dof=0) const
PatchArena * patch_arena_
Pointer to global patch arena of PatchFeValues.
uint n_elems_
Number of elements in patch.
Symmetric Gauss-Legendre quadrature formulae on simplices.
Base class for quadrature rules on simplices in arbitrary dimensions.
Definition: quadrature.hh:48
const std::vector< double > & get_weights() const
Return a reference to the whole array of weights.
Definition: quadrature.hh:111
static Eigen::Matrix< ArenaVec< double >, dim, 1 > normal_vector_array(ArenaVec< uint > loc_side_idx_vec)
Definition: ref_element.cc:280
Store finite element data on the actual patch such as shape function values, gradients,...
Eigen::Vector< ArenaVec< uint >, Eigen::Dynamic > IntTableArena
Definition: eigen_tools.hh:39
Class ElementValues calculates data related to transformation of reference cell to actual cell (Jacob...
unsigned int uint
ArmaMat< double, N, M > mat
Definition: armor.hh:936
@ opCoords
operations evaluated on quadrature points
@ opInvJac
inverse Jacobian
@ opWeights
weight of quadrature point
@ opJac
Jacobian of element.
@ opElCoords
operations evaluated on elements
@ opJxW
JxW value of quadrature point.
@ opNormalVec
normal vector of quadrature point
@ opSideCoords
operations evaluated on sides
@ opJxW
JxW value of quadrature point.
@ opCoords
operations evaluated on quadrature points
@ opElCoords
operations evaluated on elements
@ opElJac
Jacobian of element.
@ opWeights
weight of quadrature point
@ opSideJac
Jacobian of element.
ArenaVec< double > determinant(const Eigen::Matrix< ArenaVec< double >, m, n > &A)
Calculates determinant of a rectangular matrix.
double Scalar
std::function< void(std::vector< ElOp< 3 > > &, IntTableArena &)> ReinitFunction
Type for conciseness.
OpSizeType
Distinguishes operations by type and size of output rows.
@ pointOp
operation is evaluated on quadrature points
@ elemOp
operation is evaluated on elements or sides
@ fixedSizeOp
operation has fixed size and it is filled during initialization
#define FMT_UNUSED
Definition: posix.h:75
Definitions of particular quadrature rules on simplices.
Defines reinit operations on bulk points.
static void elop_inv_jac(std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)
static void ptop_scalar_shape_grads(std::vector< ElOp< 3 >> &operations, std::vector< std::vector< arma::mat > > ref_shape_grads, uint scalar_shape_grads_op_idx)
static void elop_jac(std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)
static void elop_jac_det(std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)
static void ptop_JxW(std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)
static void ptop_weights(std::vector< ElOp< 3 >> &operations, PatchArena *arena, const std::vector< double > &point_weights)
static void ptop_scalar_shape(std::vector< ElOp< 3 >> &operations, std::vector< std::vector< double > > shape_values, uint scalar_shape_op_idx)
static void ptop_coords(FMT_UNUSED std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)
Defines common functionality of reinit operations.
static void op_base(FMT_UNUSED std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)
Defines reinit operations on side points.
static void elop_el_jac(std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)
static void elop_sd_jac_det(std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)
static void elop_sd_jac(std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)
static void ptop_normal_vec(std::vector< ElOp< 3 >> &operations, IntTableArena &el_table)
static void ptop_weights(std::vector< ElOp< 3 >> &operations, PatchArena *arena, const std::vector< double > &point_weights)
static void ptop_scalar_shape_grads(std::vector< ElOp< 3 >> &operations, IntTableArena &el_table, std::vector< std::vector< std::vector< arma::mat > > > ref_shape_grads, uint scalar_shape_grads_op_idx)
static void ptop_scalar_shape(std::vector< ElOp< 3 >> &operations, IntTableArena &el_table, std::vector< std::vector< std::vector< double > > > shape_values, uint scalar_shape_op_idx)
static void elop_el_inv_jac(std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)
static void ptop_JxW(std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)
static void ptop_coords(FMT_UNUSED std::vector< ElOp< 3 >> &operations, FMT_UNUSED IntTableArena &el_table)