v0.8.23
ForcesAndSourcesCore.hpp
Go to the documentation of this file.
1 /** \file ForcesAndSourcesCore.hpp
2  \brief Implementation of elements on entities.
3 
4  Those element are inherited by user to implement specific implementation of
5  particular problem.
6 
7 */
8 
9 /* This file is part of MoFEM.
10  * MoFEM is free software: you can redistribute it and/or modify it under
11  * the terms of the GNU Lesser General Public License as published by the
12  * Free Software Foundation, either version 3 of the License, or (at your
13  * option) any later version.
14  *
15  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18  * License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>. */
22 
23 #ifndef __FORCES_AND_SOURCES_CORE__HPP__
24 #define __FORCES_AND_SOURCES_CORE__HPP__
25 
26 using namespace boost::numeric;
27 
28 namespace MoFEM {
29 
30 /** \brief structure to get information form mofem into DataForcesAndSourcesCore
31  * \ingroup mofem_forces_and_sources
32  *
33  */
34 struct ForcesAndSourcesCore : public FEMethod {
35 
37 
38  /**
39  * @brief Entity data on element entity rows fields
40  *
41  *
42  * FIXME: that should be moved to private class data and acessed only by
43  * member function
44  */
45  const boost::shared_ptr<DataForcesAndSourcesCore> dataOnElement[LASTSPACE];
46 
47  /**
48  * @brief Entity data on element entity columns fields
49  *
50  * FIXME: that should be moved to private class data and acessed only by
51  * member function
52  */
53  const boost::shared_ptr<DataForcesAndSourcesCore>
54  derivedDataOnElement[LASTSPACE];
55 
61 
63  virtual ~ForcesAndSourcesCore() {}
64 
65  MoFEMErrorCode getNumberOfNodes(int &num_nodes) const;
66 
67  /** \brief Get max order of approximation for data fields
68 
69  Method getMaxDataOrder () return maximal order on entities, for
70  all data on the element. So for example if finite element is triangle, and
71  triangle base function have order 4 and on edges base function have order 2,
72  this function return 4.
73 
74  If finite element has for example 2 or more approximated fields, for example
75  Pressure (order 3) and displacement field (order 5), this function returns 5.
76 
77  */
78  int getMaxDataOrder() const;
79 
80  /// \brief Get max order of approximation for field in rows
81  int getMaxRowOrder() const;
82 
83  /// \brief Get max order of approximation for field in columns
84  int getMaxColOrder() const;
85 
86  /**
87  * \brief get sense (orientation) of entity
88  * @param type type of entity
89  * @param data entity data
90  * @return error code
91  */
92  MoFEMErrorCode getEntitySense(
93  const EntityType type,
94  boost::ptr_vector<DataForcesAndSourcesCore::EntData> &data) const;
95 
96  /**
97  * @brief Get the entity data order
98  *
99  * @param type
100  * @param space
101  * @param data
102  * @return MoFEMErrorCode
103  */
104  MoFEMErrorCode getEntityDataOrder(
105  const EntityType type, const FieldSpace space,
106  boost::ptr_vector<DataForcesAndSourcesCore::EntData> &data) const;
107 
108  /**
109  * @brief Get the entity sense (orientation)
110  *
111  * @tparam type
112  * @param data
113  * @return MoFEMErrorCode
114  */
115  template <EntityType type>
117  return getEntitySense(type, data.dataOnEntities[type]);
118  }
119 
120  /**
121  * @brief Get the entity data order for given space
122  *
123  * @tparam type
124  * @param data
125  * @param space
126  * @return MoFEMErrorCode
127  */
128  template <EntityType type>
130  const FieldSpace space) const {
131  return getEntityDataOrder(type, space, data.dataOnEntities[type]);
132  }
133 
134  // ** Indices **
135 
136  /// \brief get node indices
137  MoFEMErrorCode getNodesIndices(const boost::string_ref field_name,
139  VectorInt &nodes_indices,
140  VectorInt &local_nodes_indices) const;
141 
142  /// \brief get row node indices from FENumeredDofEntity_multiIndex
143  MoFEMErrorCode getRowNodesIndices(DataForcesAndSourcesCore &data,
144  const std::string &field_name) const;
145 
146  /// \brief get col node indices from FENumeredDofEntity_multiIndex
147  MoFEMErrorCode getColNodesIndices(DataForcesAndSourcesCore &data,
148  const std::string &field_name) const;
149 
150  MoFEMErrorCode getEntityIndices(
151  DataForcesAndSourcesCore &data, const std::string &field_name,
152  FENumeredDofEntity_multiIndex &dofs, const EntityType type_lo = MBVERTEX,
153  const EntityType type_hi = MBPOLYHEDRON) const;
154 
155  inline MoFEMErrorCode
157  const std::string &field_name,
158  const EntityType type_lo = MBVERTEX,
159  const EntityType type_hi = MBPOLYHEDRON) const {
160  return getEntityIndices(data, field_name,
161  const_cast<FENumeredDofEntity_multiIndex &>(
162  numeredEntFiniteElementPtr->getRowsDofs()),
163  type_lo, type_hi);
164  }
165 
166  inline MoFEMErrorCode
168  const std::string &field_name,
169  const EntityType type_lo = MBVERTEX,
170  const EntityType type_hi = MBPOLYHEDRON) const {
171  return getEntityIndices(data, field_name,
172  const_cast<FENumeredDofEntity_multiIndex &>(
173  numeredEntFiniteElementPtr->getColsDofs()),
174  type_lo, type_hi);
175  }
176 
177  /// \brief get NoField indices
178  MoFEMErrorCode getNoFieldIndices(const std::string &field_name,
180  VectorInt &nodes_indices) const;
181 
182  /// \brief get col NoField indices
183  MoFEMErrorCode getNoFieldRowIndices(DataForcesAndSourcesCore &data,
184  const std::string &field_name) const;
185 
186  /// \brief get col NoField indices
187  MoFEMErrorCode getNoFieldColIndices(DataForcesAndSourcesCore &data,
188  const std::string &field_name) const;
189 
190  // ** Data **
191 
192  /**
193  * \brief Get field data on nodes
194  * @param field_name Name of field
195  * @param dofs Dofs (element) multi index
196  * @param nodes_data Returned DOFs values
197  * @param nodes_dofs Vector of pointers to DOFs data structure
198  * @param space Get space on nodes (Only H! is valid)
199  * @param base Get base on nodes
200  * @return Error code
201  */
202  MoFEMErrorCode getNodesFieldData(const boost::string_ref field_name,
204  VectorDouble &nodes_data,
205  VectorDofs &nodes_dofs, FieldSpace &space,
206  FieldApproximationBase &base) const;
207 
208  MoFEMErrorCode getNoFieldFieldData(const boost::string_ref field_name,
210  VectorDouble &ent_field_data,
211  VectorDofs &ent_field_dofs) const;
212  MoFEMErrorCode getNoFieldFieldData(DataForcesAndSourcesCore &data,
213  const boost::string_ref field_name) const;
214 
215  /**
216  * \brief Get data on nodes
217  * @param data Data structure
218  * @param field_name Field name
219  * @return Error code
220  */
221  MoFEMErrorCode getNodesFieldData(DataForcesAndSourcesCore &data,
222  const std::string &field_name) const;
223 
225  getEntityFieldData(DataForcesAndSourcesCore &data,
226  const std::string &field_name,
227  const EntityType type_lo = MBVERTEX,
228  const EntityType type_hi = MBPOLYHEDRON) const;
229 
230  /// \brief Get nodes on triangles
231  MoFEMErrorCode getFaceTriNodes(DataForcesAndSourcesCore &data) const;
232 
233  /// \brief Get field approximation space and base on entities
235  getSpacesAndBaseOnEntities(DataForcesAndSourcesCore &data) const;
236 
237  // ** Data form NumeredDofEntity_multiIndex **
238 
239  /// \brief get indices of nodal indices which are declared for problem but not
240  /// this particular element
241  MoFEMErrorCode getProblemNodesIndices(const std::string &field_name,
242  const NumeredDofEntity_multiIndex &dofs,
243  VectorInt &nodes_indices) const;
244 
245  /// \brief get indices by type (generic function) which are declared for
246  /// problem but not this particular element
247  MoFEMErrorCode getProblemTypeIndices(const std::string &field_name,
248  const NumeredDofEntity_multiIndex &dofs,
249  EntityType type, int side_number,
250  VectorInt &indices) const;
251 
252  MoFEMErrorCode getProblemNodesRowIndices(const std::string &field_name,
253  VectorInt &nodes_indices) const;
254  MoFEMErrorCode getProblemTypeRowIndices(const std::string &field_name,
255  EntityType type, int side_number,
256  VectorInt &indices) const;
257  MoFEMErrorCode getProblemNodesColIndices(const std::string &field_name,
258  VectorInt &nodes_indices) const;
259  MoFEMErrorCode getProblemTypeColIndices(const std::string &field_name,
260  EntityType type, int side_number,
261  VectorInt &indices) const;
262 
263  typedef boost::function<int(int order_row, int order_col, int order_data)>
265 
266  /**
267  * \brief Hook to get rule
268  *
269  * \todo check preferred format how works with gcc and clang,
270  * see
271  * <http://www.boost.org/doc/libs/1_64_0/doc/html/function/tutorial.html#idp247873024>
272  */
274 
275  /**
276  * @brief Set function to calculate integration rule
277  *
278  */
280 
281  /**
282  * \brief another variant of getRule
283  * @param order_row order of base function on row
284  * @param order_col order of base function on columns
285  * @param order_data order of base function approximating data
286  * @return integration rule
287  *
288  * This function is overloaded by the user. The integration rule
289  * is set such that specific operator implemented by the user is integrated
290  * accurately. For example if user implement bilinear operator
291  * \f[
292  * b(u,v) =
293  * \int_\mathcal{T}
294  * \frac{\partial u_i}{\partial x_j}\frac{\partial v_i}{\partial x_j}
295  * \textrm{d}\mathcal{T}
296  * \f]
297  * then if \f$u\f$ and \f$v\f$ are polynomial of given \em order, then exact
298  * integral would be
299  * \code
300  * int getRule(int order) { return 2*(order-1); };
301  * \endcode
302  *
303  * The integration points and weights are set appropriately for given entity
304  * type and integration rule from \ref quad.c
305  *
306  * Method \ref ForcesAndSourcesCore::getRule takes at argument takes maximal
307  * polynomial order set on the element on all fields defined on the element.
308  * If a user likes to have more control, another variant of this function can
309  * be called which distinguishing between field orders on rows, columns and
310  * data, the i.e. first argument of a bilinear form, the second argument of
311  * bilinear form and field coefficients on the element.
312  *
313  * \note If user set rule to -1 or any other negative integer, then method
314  * \ref ForcesAndSourcesCore::setGaussPts is called. In that method user can
315  * implement own (specific) integration method.
316  *
317  * \bug this function should be const
318  */
319  virtual int getRule(int order_row, int order_col, int order_data) {
320  return getRuleHook ? getRuleHook(order_row, order_col, order_data)
321  : getRule(order_data);
322  }
323 
324  /** \brief set user specific integration rule
325 
326  This function allows for user defined integration rule. The key is to
327  called matrix gaussPts, which is used by other MoFEM procedures. Matrix has
328  number of rows equal to problem dimension plus one, where last index is used
329  to store weight values. %Number of columns is equal to number of integration
330  points.
331 
332  \note This function is called if method \ref ForcesAndSourcesCore::getRule
333  is returning integer -1 or any other negative integer.
334 
335  User sets
336  \code
337  MatrixDouble gaussPts;
338  \endcode
339  where
340  \code
341  gaussPts.resize(dim+1,nb_gauss_pts);
342  \endcode
343  number rows represents local coordinates of integration points
344  in reference element, where last index in row is for integration weight.
345 
346  */
347  virtual MoFEMErrorCode setGaussPts(int order_row, int order_col,
348  int order_data) {
349  return setRuleHook ? setRuleHook(order_row, order_col, order_data)
350  : setGaussPts(order_data);
351  }
352 
353  /** \brief Data operator to do calculations at integration points.
354  * \ingroup mofem_forces_and_sources
355 
356  Is inherited and implemented by user to do calculations. It can be used in
357  many different ways but typically is used to integrate matrices (f.e.
358  stiffness matrix) and the right hand vector (f.e. force vector).
359 
360  Note: It is assumed that operator is executed for symmetric problem. That
361  means that is executed for not repeating entities on finite element. For
362  example on triangle we have nodes, 3 edges and one face. Because of symmetry
363  calculations are for: nodes-nodes, nodes-edge0, nodes-edge_1, nodes-edge_2,
364  nodes-face,
365  edges_1-edges_1, edges_1-edge_1, edge_1-edge_2,
366  edge_1-edge_1, edge_1-edge_2,
367  edge_2-edge_2,
368  edge_1-face, edge_1-face, edges_3-face,
369  face - face
370 
371  In case of non symmetric problem in addition calculations of lower off
372  diagonal terms. F.e. edge_1-edge_0, esges_3-edge_0, edge_3-edge_1,
373 
374  In that case class variable UserDataOperator::sYmm = false;
375 
376  NoteL: By default sYmm is set for symmetric problems
377 
378  */
379  struct UserDataOperator : public DataOperator {
380 
381  /**
382  * \brief Controls loop over entities on element
383  *
384  * OPROW is used if row vector is assembled
385  * OPCOL is usually used if column vector is assembled
386  * OPROWCOL is usually used for assemble matrices.
387  *
388  * For typical problem like Bubnov-Galerkin OPROW and OPCOL are the same. In
389  * more general case for example for non-square matrices columns and rows
390  * could have different numeration and/or different set of fields.
391  *
392  */
393  enum OpType {
394  OPROW = 1 << 0,
395  OPCOL = 1 << 1,
396  OPROWCOL = 1 << 2,
397  OPLAST = 1 << 3
398  };
399 
400  char opType;
401  std::string rowFieldName;
402  std::string colFieldName;
404 
405  /**
406  * This Constructor is used typically when some modification base shape
407  * functions on some approx. space is applied. Operator is run for all data
408  * on space.
409  *
410  * User has no access to field data from this operator.
411  */
412  UserDataOperator(const FieldSpace space, const char type = OPLAST,
413  const bool symm = true)
414  : DataOperator(symm), opType(type), sPace(space), ptrFE(NULL) {}
415 
416  UserDataOperator(const std::string &field_name, const char type,
417  const bool symm = true)
418  : DataOperator(symm), opType(type), rowFieldName(field_name),
419  colFieldName(field_name), sPace(LASTSPACE), ptrFE(NULL) {}
420 
421  UserDataOperator(const std::string &row_field_name,
422  const std::string &col_field_name, const char type,
423  const bool symm = true)
424  : DataOperator(symm), opType(type), rowFieldName(row_field_name),
425  colFieldName(col_field_name), sPace(LASTSPACE), ptrFE(NULL) {}
426 
427  virtual ~UserDataOperator() {}
428 
429  /** \brief Return raw pointer to NumeredEntFiniteElement
430  */
431  inline boost::shared_ptr<const NumeredEntFiniteElement>
433  return ptrFE->numeredEntFiniteElementPtr;
434  };
435 
436  /**
437  * \brief Return finite element entity handle
438  * @return Finite element entity handle
439  */
441  return getNumeredEntFiniteElementPtr()->getEnt();
442  }
443 
444  /** \brief Get row indices
445 
446  Field could be or not declared for this element but is declared for problem
447 
448  \param field_name
449  \param type entity type
450  \param side side number, any number if type is MBVERTEX
451  \return indices
452 
453  NOTE: Using those indices to assemble matrix will result in error if new
454  non-zero values need to be created.
455 
456  */
457  MoFEMErrorCode getProblemRowIndices(const std::string filed_name,
458  const EntityType type, const int side,
459  VectorInt &indices) const;
460 
461  /** \brief Get col indices
462 
463  Field could be or not declared for this element but is declared for problem
464 
465  \param field_name
466  \param type entity type
467  \param side side number, any number if type is MBVERTEX
468  \return indices
469 
470  NOTE: Using those indices to assemble matrix will result in error if new
471  non-zero values need to be created.
472 
473  */
474  MoFEMErrorCode getProblemColIndices(const std::string filed_name,
475  const EntityType type, const int side,
476  VectorInt &indices) const;
477 
480  ptrFE = ptr;
482  }
483 
484  /** \brief Return raw pointer to Finite Element Method object
485  */
486  inline const FEMethod *getFEMethod() const { return ptrFE; }
487 
488  /**
489  * \brief Get operator types
490  * @return Return operator type
491  */
492  inline int getOpType() const { return opType; }
493 
494  /**
495  * \brief Set operator type
496  * @param Operator type
497  */
498  inline void setOpType(const OpType type) { opType = type; }
499 
500  /**
501  * \brief Add operator type
502  */
503  inline void addOpType(const OpType type) { opType |= type; }
504 
505  /**
506  * \brief get number of finite element in the loop
507  * @return number of finite element
508  */
509  inline int getNinTheLoop() const { return getFEMethod()->getNinTheLoop(); }
510 
511  /**
512  * \brief get size of elements in the loop
513  * @return loop size
514  */
515  inline int getLoopSize() const { return getFEMethod()->getLoopSize(); }
516 
517  /** \brief Get name of the element
518  */
519  inline const std::string &getFEName() const {
520  return getFEMethod()->feName;
521  }
522 
523  /** \name Accessing SNES */
524 
525  /**@{*/
526 
527  inline Vec getSnesF() const { return getFEMethod()->snes_f; }
528 
529  inline Vec getSnesX() const { return getFEMethod()->snes_x; }
530 
531  inline Mat getSnesA() const { return getFEMethod()->snes_A; }
532 
533  inline Mat getSnesB() const { return getFEMethod()->snes_B; }
534 
535  /**@}*/
536 
537  /** \name Accessing TS */
538 
539  /**@{*/
540 
541  inline Vec getTSu() const { return getFEMethod()->ts_u; }
542 
543  inline Vec getTSu_t() const { return getFEMethod()->ts_u_t; }
544 
545  inline Vec getTSf() const { return getFEMethod()->ts_F; }
546 
547  inline Mat getTSA() const { return getFEMethod()->ts_A; }
548 
549  inline Mat getTSB() const { return getFEMethod()->ts_B; }
550 
551  inline int getTSstep() const { return getFEMethod()->ts_step; }
552 
553  inline double getTStime() const { return getFEMethod()->ts_t; }
554 
555  inline double getTSa() const { return getFEMethod()->ts_a; }
556 
557  /**@}*/
558 
559  /**@{*/
560 
561  /** \name Base funtions and integration points */
562 
563  /** \brief matrix of integration (Gauss) points for Volume Element
564  *
565  * For triangle: columns 0,1 are x,y coordinates respectively and column
566  * 2 is a weight value for example getGaussPts()(1,13) returns y coordinate
567  * of 13th Gauss point on particular volume element
568  *
569  * For tetrahedron: columns 0,1,2 are x,y,z coordinates respectively and
570  * column 3 is a weight value for example getGaussPts()(1,13) returns y
571  * coordinate of 13th Gauss point on particular volume element
572  *
573  */
575  return static_cast<ForcesAndSourcesCore *>(ptrFE)->gaussPts;
576  }
577 
578  /**
579  * @brief Get integration weights
580  *
581  * \code
582  * auto t_w = getFTensor0IntegrationWeight();
583  * for(int gg = 0; gg!=getGaussPts.size2(); ++gg) {
584  * // integrate something
585  * ++t_w;
586  * }
587  * \endcode
588  *
589  * @return FTensor::Tensor0<FTensor::PackPtr<double *, 1>>
590  */
593  &(getGaussPts()(getGaussPts().size1() - 1, 0)));
594  }
595 
596  /**@}*/
597 
598  /**@{*/
599 
600  /** \name Deprecated (do not use) */
601 
602  // \deprecated Deprecated function with spelling mistake
604  getPorblemRowIndices(const std::string filed_name, const EntityType type,
605  const int side, VectorInt &indices) const {
606  return getProblemRowIndices(filed_name, type, side, indices);
607  }
608 
609  // \deprecated Deprecated function with spelling mistake
611  getPorblemColIndices(const std::string filed_name, const EntityType type,
612  const int side, VectorInt &indices) const {
613  return getProblemColIndices(filed_name, type, side, indices);
614  }
615 
616  /**@}*/
617 
618  protected:
620  };
621 
622  /**
623  * @brief Vector of finite element users data operators
624  *
625  * FIXME: that should be moved to private class data and acessed only by
626  * member function
627  */
628  boost::ptr_vector<UserDataOperator> opPtrVector;
629 
630  /** \brief Use to push back operator for row operator
631 
632  It can be used to calculate nodal forces or other quantities on the mesh.
633 
634  */
635  boost::ptr_vector<UserDataOperator> &getOpPtrVector() { return opPtrVector; }
636 
637  /**
638  * @brief Get the Entity Polynomial Base object
639  *
640  * @return boost::shared_ptr<BaseFunction>&&
641  */
642  auto &getElementPolynomialBase() { return elementPolynomialBasePtr; }
643 
644  /**
645  * @brief Get the User Polynomial Base object
646  *
647  * @return boost::shared_ptr<BaseFunction>&
648  */
649  auto &getUserPolynomialBase() { return userPolynomialBasePtr; }
650 
651  /**
652  * @brief Matrix of integration points
653  *
654  * Columns is equal to number of integration points, numver of rows depends on
655  * dimension of finite element entity, for example for tetrahedron rows are
656  * x,y,z,weight. Last row is integration weight.
657  *
658  * FIXME: that should be moved to private class data and acessed only by
659  * member function
660  */
662 
665  if (preProcessHook) {
666  ierr = preProcessHook();
667  CHKERRG(ierr);
668  }
670  }
673  if (operatorHook) {
674  ierr = operatorHook();
675  CHKERRG(ierr);
676  }
678  }
681  if (postProcessHook) {
682  ierr = postProcessHook();
683  CHKERRG(ierr);
684  }
686  }
687 
688  /**
689  * \brief Calculate base functions
690  * @return Error code
691  */
693  calculateBaseFunctionsOnElement(const FieldApproximationBase b);
694 
695  /**
696  * \brief Calculate base functions
697  * @return Error code
698  */
699  MoFEMErrorCode calculateBaseFunctionsOnElement();
700 
701  /**
702  * @brief Create a entity data on element object
703  *
704  * @return MoFEMErrorCode
705  */
706  MoFEMErrorCode createDataOnElement();
707 
708  /**
709  * @brief Iterate user data operators
710  *
711  * @return MoFEMErrorCode
712  */
713  MoFEMErrorCode loopOverOperators();
714 
715  /**@{*/
716 
717  /** \name Deprecated (do not use) */
718 
719  /** \deprecated Use getRule(int row_order, int col_order, int data order)
720  */
721  virtual int getRule(int order) { return 2 * order; }
722 
723  /** \deprecated setGaussPts(int row_order, int col_order, int data order);
724  */
727  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "sorry, not implemented");
729  }
730 
731  /**@/}*/
732 
733 private:
734  /**
735  * @brief Last evaluated type of element entity
736  *
737  */
739 
740  /**
741  * @brief Pointer to entity polynomial base
742  *
743  */
744  boost::shared_ptr<BaseFunction> elementPolynomialBasePtr;
745 
746  /**
747  * @brief Pointer to user polynomail base
748  */
749  boost::shared_ptr<BaseFunction> userPolynomialBasePtr;
750 };
751 
752 /// \deprecated Used ForcesAndSourcesCore instead
754 
755 } // namespace MoFEM
756 
757 #endif //__FORCES_AND_SOURCES_CORE__HPP__
758 
759 /**
760  * \defgroup mofem_forces_and_sources Forces and sources
761  * \ingroup mofem
762  *
763  * \brief Manages complexities related to assembly of vector and matrices at
764  * single finite element level.
765  *
766  **/
MoFEMErrorCode getEntityDataOrder(DataForcesAndSourcesCore &data, const FieldSpace space) const
Get the entity data order for given space.
DataForcesAndSourcesCore & dataL2
structure for User Loop Methods on finite elementsIt can be used to calculate stiffness matrices,...
void setOpType(const OpType type)
Set operator type.
boost::ptr_vector< UserDataOperator > opPtrVector
Vector of finite element users data operators.
virtual MoFEMErrorCode setPtrFE(ForcesAndSourcesCore *ptr)
MatrixDouble gaussPts
Matrix of integration points.
base operator to do operations at Gauss Pt. level
data structure for finite element entityIt keeps that about indices of degrees of freedom,...
DataForcesAndSourcesCore & dataH1
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
DEPRECATED MoFEMErrorCode getPorblemColIndices(const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:77
auto & getUserPolynomialBase()
Get the User Polynomial Base object.
multi_index_container< boost::shared_ptr< FENumeredDofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< FENumeredDofEntity::interface_type_DofEntity, const UId &, &FENumeredDofEntity::getGlobalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FENumeredDofEntity::interface_type_DofEntity, EntityHandle, &FENumeredDofEntity::getEnt > >, ordered_non_unique< tag< FieldName_mi_tag >, const_mem_fun< FENumeredDofEntity::interface_type_Field, boost::string_ref, &FENumeredDofEntity::getNameRef > >, ordered_non_unique< tag< Composite_Name_Type_And_Side_Number_mi_tag >, composite_key< FENumeredDofEntity, const_mem_fun< FENumeredDofEntity::interface_type_Field, boost::string_ref, &FENumeredDofEntity::getNameRef >, const_mem_fun< FENumeredDofEntity::interface_type_RefEntity, EntityType, &FENumeredDofEntity::getEntType >, KeyFromKey< member< SideNumber, char, &SideNumber::side_number >, member< FENumeredDofEntity::BaseFEEntity, boost::shared_ptr< SideNumber >, &FENumeredDofEntity::sideNumberPtr > > > >, ordered_non_unique< tag< Composite_Name_And_Type_mi_tag >, composite_key< FENumeredDofEntity, const_mem_fun< FENumeredDofEntity::interface_type_Field, boost::string_ref, &FENumeredDofEntity::getNameRef >, const_mem_fun< FENumeredDofEntity::interface_type_RefEntity, EntityType, &FENumeredDofEntity::getEntType > > >, ordered_non_unique< tag< Composite_Name_And_Ent_mi_tag >, composite_key< FENumeredDofEntity, const_mem_fun< FENumeredDofEntity::interface_type_Field, boost::string_ref, &FENumeredDofEntity::getNameRef >, const_mem_fun< FENumeredDofEntity::interface_type_DofEntity, EntityHandle, &FENumeredDofEntity::getEnt > > > > > FENumeredDofEntity_multiIndex
MultiIndex container keeps FENumeredDofEntity.
boost::shared_ptr< const NumeredEntFiniteElement > getNumeredEntFiniteElementPtr() const
Return raw pointer to NumeredEntFiniteElement.
boost::shared_ptr< BaseFunction > userPolynomialBasePtr
Pointer to user polynomail base.
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:543
UserDataOperator(const std::string &row_field_name, const std::string &col_field_name, const char type, const bool symm=true)
virtual MoFEMErrorCode setGaussPts(int order_row, int order_col, int order_data)
set user specific integration rule
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507
UserDataOperator(const FieldSpace space, const char type=OPLAST, const bool symm=true)
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
OpType
Controls loop over entities on element.
boost::ptr_vector< EntData > dataOnEntities[MBMAXTYPE]
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:174
RuleHookFun getRuleHook
Hook to get rule.
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
virtual MoFEMErrorCode setGaussPts(int order)
DataForcesAndSourcesCore & dataHcurl
EntityType lastEvaluatedElementEntityType
Last evaluated type of element entity.
virtual MoFEMErrorCode preProcess()
function is run at the beginning of loop
int getLoopSize() const
get size of elements in the loop
FieldApproximationBase
approximation base
Definition: definitions.h:142
boost::shared_ptr< BaseFunction > elementPolynomialBasePtr
Pointer to entity polynomial base.
UserDataOperator(const std::string &field_name, const char type, const bool symm=true)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
auto getFTensor0IntegrationWeight()
Get integration weights.
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
EntityHandle getFEEntityHandle() const
Return finite element entity handle.
const std::string & getFEName() const
Get name of the element.
boost::function< int(int order_row, int order_col, int order_data)> RuleHookFun
MoFEMErrorCode getEntitySense(DataForcesAndSourcesCore &data) const
Get the entity sense (orientation)
FieldSpace
approximation spaces
Definition: definitions.h:167
DEPRECATED MoFEMErrorCode getPorblemRowIndices(const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
boost::ptr_vector< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
int getNinTheLoop() const
get number of finite element in the loop
multi_index_container< boost::shared_ptr< FEDofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< FEDofEntity::interface_type_DofEntity, const UId &, &FEDofEntity::getGlobalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FEDofEntity::interface_type_DofEntity, EntityHandle, &FEDofEntity::getEnt > >, ordered_non_unique< tag< FieldName_mi_tag >, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef > >, ordered_non_unique< tag< EntType_mi_tag >, const_mem_fun< FEDofEntity::interface_type_RefEntity, EntityType, &FEDofEntity::getEntType > >, ordered_non_unique< tag< Composite_Name_And_Type_mi_tag >, composite_key< FEDofEntity, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef >, const_mem_fun< FEDofEntity::interface_type_RefEntity, EntityType, &FEDofEntity::getEntType > > >, ordered_non_unique< tag< Composite_Name_And_Ent_mi_tag >, composite_key< FEDofEntity, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef >, const_mem_fun< FEDofEntity::interface_type_DofEntity, EntityHandle, &FEDofEntity::getEnt > > >, ordered_non_unique< tag< Composite_Name_Type_And_Side_Number_mi_tag >, composite_key< FEDofEntity, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef >, const_mem_fun< FEDofEntity::interface_type_RefEntity, EntityType, &FEDofEntity::getEntType >, KeyFromKey< member< SideNumber, char, &SideNumber::side_number >, member< FEDofEntity::BaseFEEntity, boost::shared_ptr< SideNumber >, &FEDofEntity::sideNumberPtr > > > > > > FEDofEntity_multiIndex
MultiIndex container keeps FEDofEntity.
ublas::vector< int, IntAllocator > VectorInt
Definition: Types.hpp:75
ublas::vector< boost::shared_ptr< const FEDofEntity >, DofsAllocator > VectorDofs
#define DEPRECATED
Definition: definitions.h:29
DataForcesAndSourcesCore & dataHdiv
MoFEMErrorCode getEntityColIndices(DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
void addOpType(const OpType type)
Add operator type.
structure to get information form mofem into DataForcesAndSourcesCore
virtual MoFEMErrorCode postProcess()
function is run at the end of loop
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:76
virtual int getRule(int order_row, int order_col, int order_data)
another variant of getRule
Data operator to do calculations at integration points.Is inherited and implemented by user to do cal...
RuleHookFun setRuleHook
Set function to calculate integration rule.
virtual MoFEMErrorCode operator()()
function is run for every finite element
const int order
approximation order
MoFEMErrorCode getEntityRowIndices(DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
auto & getElementPolynomialBase()
Get the Entity Polynomial Base object.
multi_index_container< boost::shared_ptr< NumeredDofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< NumeredDofEntity::interface_type_DofEntity, const UId &, &NumeredDofEntity::getGlobalUniqueId > >, ordered_non_unique< tag< Unique_Ent_mi_tag >, const_mem_fun< NumeredDofEntity::interface_type_DofEntity, const UId &, &NumeredDofEntity::getEntGlobalUniqueId > >, ordered_non_unique< tag< Part_mi_tag >, member< NumeredDofEntity, unsigned int, &NumeredDofEntity::pArt > >, ordered_non_unique< tag< Idx_mi_tag >, member< NumeredDofEntity, DofIdx, &NumeredDofEntity::dofIdx > >, ordered_non_unique< tag< FieldName_mi_tag >, const_mem_fun< NumeredDofEntity::interface_type_Field, boost::string_ref, &NumeredDofEntity::getNameRef > >, ordered_non_unique< tag< PetscGlobalIdx_mi_tag >, member< NumeredDofEntity, DofIdx, &NumeredDofEntity::petscGloablDofIdx > >, ordered_non_unique< tag< PetscLocalIdx_mi_tag >, member< NumeredDofEntity, DofIdx, &NumeredDofEntity::petscLocalDofIdx > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< NumeredDofEntity::interface_type_DofEntity, EntityHandle, &NumeredDofEntity::getEnt > >, ordered_non_unique< tag< Composite_Name_And_Ent_And_EntDofIdx_mi_tag >, composite_key< NumeredDofEntity, const_mem_fun< NumeredDofEntity::interface_type_Field, boost::string_ref, &NumeredDofEntity::getNameRef >, const_mem_fun< NumeredDofEntity::interface_type_DofEntity, EntityHandle, &NumeredDofEntity::getEnt >, const_mem_fun< NumeredDofEntity::interface_type_DofEntity, DofIdx, &NumeredDofEntity::getEntDofIdx > > >, ordered_non_unique< tag< Composite_Name_And_Part_mi_tag >, composite_key< NumeredDofEntity, const_mem_fun< NumeredDofEntity::interface_type_Field, boost::string_ref, &NumeredDofEntity::getNameRef >, member< NumeredDofEntity, unsigned int, &NumeredDofEntity::pArt > > >, ordered_non_unique< tag< Composite_Name_Ent_And_Part_mi_tag >, composite_key< NumeredDofEntity, const_mem_fun< NumeredDofEntity::interface_type_Field, boost::string_ref, &NumeredDofEntity::getNameRef >, const_mem_fun< NumeredDofEntity::interface_type_DofEntity, EntityHandle, &NumeredDofEntity::getEnt >, member< NumeredDofEntity, unsigned int, &NumeredDofEntity::pArt > > > > > NumeredDofEntity_multiIndex
MultiIndex container keeps NumeredDofEntity.
DEPRECATED typedef ForcesAndSourcesCore ForcesAndSurcesCore
DataForcesAndSourcesCore & dataNoField