v0.8.23
FEMultiIndices.hpp
Go to the documentation of this file.
1 /** \file FEMultiIndices.hpp
2  * \brief Multi-index contains, data structures for mofem finite elements and
3  * other low-level functions
4  */
5 
6 /* MoFEM is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
18  */
19 
20 #ifndef __FEMMULTIINDICES_HPP__
21 #define __FEMMULTIINDICES_HPP__
22 
23 namespace MoFEM {
24 
25 /**
26  * \brief keeps data about abstract refined finite element
27  * \ingroup fe_multi_indices
28  */
29 struct RefElement : public interface_RefEntity<RefEntity> {
30 
32 
34 
36  RefElement(const boost::shared_ptr<RefEntity> &ref_ent_ptr);
37  virtual const BitRefEdges &getBitRefEdges() const { return DummyBitRefEdges; }
38 
39  virtual int getBitRefEdgesUlong() const { return 0; }
40 
42  return const_cast<SideNumber_multiIndex &>(side_number_table);
43  }
44 
45  static const boost::shared_ptr<SideNumber> nullSideNumber;
46 
47  virtual const boost::shared_ptr<SideNumber> &
48  getSideNumberPtr(const EntityHandle ent) const {
49  NOT_USED(ent);
50  return nullSideNumber;
51  };
52 
53  /**
54  * \brief Get pointer to RefEntity
55  */
56  inline boost::shared_ptr<RefEntity> &getRefEntityPtr() const {
57  return this->sPtr;
58  }
59 
60  friend std::ostream &operator<<(std::ostream &os, const RefElement &e);
61 };
62 
63 /**
64  * \brief keeps data about abstract MESHSET finite element
65  * \ingroup fe_multi_indices
66  */
67 struct RefElement_MESHSET : public RefElement {
68  RefElement_MESHSET(const boost::shared_ptr<RefEntity> &ref_ent_ptr);
69  const boost::shared_ptr<SideNumber> &
70  getSideNumberPtr(const EntityHandle ent) const;
71 };
72 /**
73  * \brief keeps data about abstract PRISM finite element
74  * \ingroup fe_multi_indices
75  */
76 struct RefElement_PRISM : public RefElement {
78  RefElement_PRISM(const boost::shared_ptr<RefEntity> &ref_ent_ptr);
79  const boost::shared_ptr<SideNumber> &
80  getSideNumberPtr(const EntityHandle ent) const;
81  const BitRefEdges &getBitRefEdges() const { return *tag_BitRefEdges; }
82  int getBitRefEdgesUlong() const { return getBitRefEdges().to_ulong(); }
83 };
84 
85 /**
86  * \brief keeps data about abstract TET finite element
87  * \ingroup fe_multi_indices
88  */
89 struct RefElement_TET : public RefElement {
91  const int *tag_type_data;
92  RefElement_TET(const boost::shared_ptr<RefEntity> &ref_ent_ptr);
93  const boost::shared_ptr<SideNumber> &
94  getSideNumberPtr(const EntityHandle ent) const;
96  return const_cast<SideNumber_multiIndex &>(side_number_table);
97  };
98  const BitRefEdges &getBitRefEdges() const { return *tag_BitRefEdges; }
99  int getBitRefEdgesUlong() const { return getBitRefEdges().to_ulong(); }
100 };
101 
102 /**
103  * \brief keeps data about abstract TRI finite element
104  * \ingroup fe_multi_indices
105  */
106 struct RefElement_TRI : public RefElement {
107  RefElement_TRI(const boost::shared_ptr<RefEntity> &ref_ent_ptr);
108  const boost::shared_ptr<SideNumber> &
109  getSideNumberPtr(const EntityHandle ent) const;
110  friend std::ostream &operator<<(std::ostream &os, const RefElement_TRI &e);
111 };
112 
113 /**
114  * \brief keeps data about abstract EDGE finite element
115  * \ingroup fe_multi_indices
116  */
117 struct RefElement_EDGE : public RefElement {
118  RefElement_EDGE(const boost::shared_ptr<RefEntity> &ref_ent_ptr);
119  const boost::shared_ptr<SideNumber> &
120  getSideNumberPtr(const EntityHandle ent) const;
121  friend std::ostream &operator<<(std::ostream &os, const RefElement_EDGE &e);
122 };
123 
124 /**
125  * \brief keeps data about abstract VERTEX finite element
126  * \ingroup fe_multi_indices
127  */
128 struct RefElement_VERTEX : public RefElement {
129  RefElement_VERTEX(const boost::shared_ptr<RefEntity> &ref_ent_ptr);
130  const boost::shared_ptr<SideNumber> &
131  getSideNumberPtr(const EntityHandle ent) const;
132  friend std::ostream &operator<<(std::ostream &os, const RefElement_VERTEX &e);
133 };
134 
135 /**
136  * \brief intrface to RefElement
137  * \ingroup fe_multi_indices
138  */
139 template <typename T> struct interface_RefElement : interface_RefEntity<T> {
140 
143 
144  interface_RefElement(const boost::shared_ptr<T> &sptr)
145  : interface_RefEntity<T>(sptr) {}
146 
147  inline int getBitRefEdgesUlong() const {
148  return this->sPtr->getBitRefEdgesUlong();
149  }
150 
152  return this->sPtr->getSideNumberTable();
153  }
154 
155  inline const boost::shared_ptr<SideNumber> &
156  getSideNumberPtr(const EntityHandle ent) const {
157  return this->sPtr->getSideNumberPtr(ent);
158  }
159 
160  inline boost::shared_ptr<RefEntity> &getRefEntityPtr() const {
161  return this->sPtr->getRefEntityPtr();
162  }
163 
164  inline const boost::shared_ptr<T> &getRefElement() const {
165  return this->sPtr;
166  }
167 
169 };
170 
171 /**
172  * \typedef RefElement_multiIndex
173  * type multiIndex container for RefElement
174  * \ingroup fe_multi_indices
175  *
176  * \param hashed_unique Ent_mi_tag
177  * \param ordered_non_unique Meshset_mi_tag
178  * \param ordered_non_unique Ent_Ent_mi_tag
179  * \param ordered_non_unique Composite_ParentEnt_And_BitsOfRefinedEdges_mi_tag
180  */
181 typedef multi_index_container<
182  boost::shared_ptr<RefElement>,
183  // ptrWrapperRefElement,
184  indexed_by<
185  ordered_unique<tag<Ent_mi_tag>,
188  ordered_non_unique<
189  tag<EntType_mi_tag>,
190  const_mem_fun<RefElement::interface_type_RefEntity, EntityType,
191  &RefElement::getEntType> > > >
193 
194 typedef multi_index_container<
195  boost::shared_ptr<RefElement>,
196  // ptrWrapperRefElement,
197  indexed_by<
198  ordered_unique<tag<Ent_mi_tag>,
201  ordered_non_unique<
202  tag<Ent_Ent_mi_tag>,
205  ordered_non_unique<
206  tag<Composite_ParentEnt_And_BitsOfRefinedEdges_mi_tag>,
207  composite_key<
208  RefElement,
211  const_mem_fun<RefElement, int,
214 
216 
217 /** \brief user adjacency function
218  * \ingroup fe_multi_indices
219  */
220 typedef boost::function<MoFEMErrorCode(Interface &moab, const Field &field_ptr,
221  const EntFiniteElement &fe_ptr,
222  Range &adjacency)>
224 
225 /**
226  * \brief Finite element definition
227  * \ingroup fe_multi_indices
228  */
230 
231  EntityHandle meshset; ///< meshset stores FE ents
232  BitFEId *tagId; ///< ptr to tag storing FE id
233  void *tagName; ///< ptr to tag storing FE name
234  int tagNameSize; ///< numer of characters in FE name
235  BitFieldId *tag_BitFieldId_col_data; ///< tag stores col id_id for fields
236  BitFieldId *tag_BitFieldId_row_data; ///< tag stores row id_id for fields
237  BitFieldId *tag_BitFieldId_data; ///< tag stores data id_id for fields
238 
239  FiniteElement(Interface &moab, const EntityHandle _meshset);
240 
241  /**
242  * \brief Get finite element id
243  * @return Finite element Id
244  */
245  inline BitFEId getId() const { return *tagId; };
246 
247  /**
248  * \brief Get meshset containing element entities
249  * @return Meshset
250  */
251  inline EntityHandle getMeshset() const { return meshset; }
252 
253  /**
254  * \brief Get finite element name
255  * @return string_ref
256  */
257  inline boost::string_ref getNameRef() const {
258  return boost::string_ref((char *)tagName, tagNameSize);
259  }
260 
261  /**
262  * \brief Get finite element name
263  * @return string
264  */
265  inline std::string getName() const {
266  return std::string((char *)tagName, tagNameSize);
267  }
268 
269  /**
270  * \brief Get field ids on columns
271  * @return Bit field ids
272  */
273  inline BitFieldId getBitFieldIdCol() const {
274  return *((BitFieldId *)tag_BitFieldId_col_data);
275  }
276 
277  /**
278  * \brief Get field ids on rows
279  * @return Bit field ids
280  */
281  inline BitFieldId getBitFieldIdRow() const {
282  return *((BitFieldId *)tag_BitFieldId_row_data);
283  }
284 
285  /**
286  * \brief Get field ids on data
287  * @return Bit field ids
288  */
289  inline BitFieldId getBitFieldIdData() const {
290  return *((BitFieldId *)tag_BitFieldId_data);
291  }
292 
293  /**
294  * \brief Get bit identifying this element
295  *
296  * Each element like field is identified by bit set. Each element has unique
297  * bit set, this function returns number of that bit.
298  *
299  * @return Bit number
300  */
301  inline unsigned int getBitNumber() const {
302  return ffsl(((BitFieldId *)tagId)->to_ulong());
303  }
304 
305  /**
306  * \brief Table of functions retrieving adjacencies for finite element
307  * User can alter and change default behavior
308  */
310 
311  /**
312  * \brief print finite element
313  */
314  friend std::ostream &operator<<(std::ostream &os, const FiniteElement &e);
315 };
316 
317 /** \brief default adjacency map
318  * \ingroup fe_multi_indices
319  */
321 
322  static MoFEMErrorCode defaultVertex(Interface &moab, const Field &field_ptr,
323  const EntFiniteElement &fe_ptr,
324  Range &adjacency);
325  static MoFEMErrorCode defaultEdge(Interface &moab, const Field &field_ptr,
326  const EntFiniteElement &fe_ptr,
327  Range &adjacency);
328  static MoFEMErrorCode defaultTri(Interface &moab, const Field &field_ptr,
329  const EntFiniteElement &fe_ptr,
330  Range &adjacency);
331  static MoFEMErrorCode defaultTet(Interface &moab, const Field &field_ptr,
332  const EntFiniteElement &fe_ptr,
333  Range &adjacency);
334  static MoFEMErrorCode defaultPrism(Interface &moab, const Field &field_ptr,
335  const EntFiniteElement &fe_ptr,
336  Range &adjacency);
337  static MoFEMErrorCode defaultMeshset(Interface &moab, const Field &field_ptr,
338  const EntFiniteElement &fe_ptr,
339  Range &adjacency);
340 };
341 
342 /**
343  * \brief Inetface for FE
344  * \ingroup fe_multi_indices
345  */
346 template <typename T> struct interface_FiniteElement {
347 
348  mutable boost::shared_ptr<T> sFePtr;
349 
350  interface_FiniteElement(const boost::shared_ptr<T> &ptr) : sFePtr(ptr){};
351 
352  inline const boost::shared_ptr<FiniteElement> &get_MoFEMFiniteElementPtr() {
353  return this->sFePtr;
354  };
355 
356  /**
357  * \brief Get finite element id
358  * @return Finite element Id
359  */
360  inline BitFEId getId() const { return this->sFePtr->getId(); }
361 
362  /**
363  * \brief Get meshset containing element entities
364  * @return Meshset
365  */
366  inline EntityHandle getMeshset() const { return this->sFePtr->getMeshset(); }
367 
368  /**
369  * \brief Get finite element name
370  * @return string_ref
371  */
372  inline boost::string_ref getNameRef() const {
373  return this->sFePtr->getNameRef();
374  }
375 
376  /**
377  * \brief Get finite element name
378  * @return string_ref
379  */
380  inline std::string getName() const { return this->sFePtr->getName(); }
381 
382  /**
383  * \brief Get field ids on columns
384  * @return Bit field ids
385  */
386  inline BitFieldId getBitFieldIdCol() const {
387  return this->sFePtr->getBitFieldIdCol();
388  }
389 
390  /**
391  * \brief Get field ids on rows
392  * @return Bit field ids
393  */
394  inline BitFieldId getBitFieldIdRow() const {
395  return this->sFePtr->getBitFieldIdRow();
396  }
397 
398  /**
399  * \brief Get field ids on data
400  * @return Bit field ids
401  */
402  inline BitFieldId getBitFieldIdData() const {
403  return this->sFePtr->getBitFieldIdData();
404  }
405 
406  /**
407  * \brief Get bit identifying this element
408  *
409  * Each element like field is identified by bit set. Each element has unique
410  * bit set, this function returns number of that bit.
411  *
412  * @return Bit number
413  */
414  inline unsigned int getBitNumber() const {
415  return this->sFePtr->getBitNumber();
416  }
417 };
418 
419 /**
420  * \brief Finite element data for entity
421  * \ingroup fe_multi_indices
422  */
423 struct EntFiniteElement : public interface_FiniteElement<FiniteElement>,
424  interface_RefElement<RefElement> {
425 
429  boost::shared_ptr<FEDofEntity_multiIndex> data_dofs;
430  boost::shared_ptr<FieldEntity_vector_view> row_field_ents_view;
431  boost::shared_ptr<FieldEntity_vector_view> col_field_ents_view;
432  boost::shared_ptr<FieldEntity_multiIndex_spaceType_view> data_field_ents_view;
434 
435  EntFiniteElement(const boost::shared_ptr<RefElement> &ref_finite_element,
436  const boost::shared_ptr<FiniteElement> &fe_ptr);
437 
438  /**
439  * \brief Get unique UId for finite element entity
440  * @return UId
441  */
442  inline const UId &getGlobalUniqueId() const { return globalUId; }
443 
444  /**
445  * \brief Generate UId for finite element entity
446  * @return finite element entity unique Id
447  */
448  static inline UId getGlobalUniqueIdCalculate(const EntityHandle ent,
449  const int bit_number) {
450  assert(bit_number <= 32);
451  return static_cast<UId>(ent) | static_cast<UId>(bit_number)
452  << 8 * sizeof(EntityHandle);
453  }
454 
455  /**
456  * \brief Generate UId for finite element entity
457  * @return finite element entity unique Id
458  */
460  return getGlobalUniqueIdCalculate(sPtr->getRefEnt(), getBitNumber());
461  }
462 
463  /**
464  * \brief Get element entity
465  * @return Element entity handle
466  */
467  inline EntityHandle getEnt() const { return getRefEnt(); }
468 
469  /**
470  * \brief Get number of DOFs on data
471  * @return Number of dofs on data
472  */
473  inline DofIdx getNbDofsData() const { return data_dofs->size(); }
474 
475  /**
476  * \brief Get data data dos multi-index structure
477  * @return Reference multi-index FEDofEntity_multiIndex
478  */
479  inline const FEDofEntity_multiIndex &getDataDofs() const {
480  return *data_dofs;
481  };
482 
483  friend std::ostream &operator<<(std::ostream &os, const EntFiniteElement &e);
484 
485  template <typename FE_ENTS, typename MOFEM_DOFS, typename MOFEM_DOFS_VIEW>
486  inline MoFEMErrorCode
487  getDofView(const FE_ENTS &fe_ents_view, const MOFEM_DOFS &mofem_dofs,
488  MOFEM_DOFS_VIEW &dofs_view, const int operation_type) {
490  if (operation_type == moab::Interface::UNION) {
491  for (auto &it : fe_ents_view) {
492  if (auto e = it.lock()) {
493  auto r = mofem_dofs.template get<Unique_Ent_mi_tag>().equal_range(
494  e->getGlobalUniqueId());
495  dofs_view.insert(r.first, r.second);
496  }
497  }
498  } else
499  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
501  }
502 
503  template <typename MOFEM_DOFS, typename MOFEM_DOFS_VIEW>
504  inline MoFEMErrorCode
505  getRowDofView(const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view,
506  const int operation_type = moab::Interface::UNION) {
507  return getDofView(*row_field_ents_view, mofem_dofs, dofs_view,
508  operation_type);
509  }
510 
511  template <typename MOFEM_DOFS, typename MOFEM_DOFS_VIEW>
512  inline MoFEMErrorCode
513  getColDofView(const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view,
514  const int operation_type = moab::Interface::UNION) {
515  return getDofView(*col_field_ents_view, mofem_dofs, dofs_view,
516  operation_type);
517  }
518 
519  MoFEMErrorCode getElementAdjacency(const boost::shared_ptr<Field> field_ptr,
520  Range &adjacency);
521 
522  inline boost::shared_ptr<RefElement> &getRefElement() const {
523  return this->sPtr;
524  }
525 
526  /**
527  * \brief Get weak_ptr reference to sequence/vector storing dofs on entity.
528  *
529  * Vector is automatically destroy when last DOF in vector os destroyed. Every
530  * shared_ptr to the DOF has aliased shared_ptr to vector of DOFs in that
531  * vector. That do the trick.
532  *
533  */
534  inline boost::weak_ptr<std::vector<FEDofEntity> > &getDofsSequence() const {
535  return dofsSequce;
536  }
537 
538 private:
539  // Keep vector of DoFS on entity
540  mutable boost::weak_ptr<std::vector<FEDofEntity> > dofsSequce;
541 };
542 
543 /**
544  * \brief interface to EntFiniteElement
545  * \ingroup fe_multi_indices
546  */
547 template <typename T>
550 
551  interface_EntFiniteElement(const boost::shared_ptr<T> &sptr)
552  : interface_FiniteElement<T>(sptr), interface_RefElement<T>(sptr) {}
553 
554  inline const FEDofEntity_multiIndex &getDataDofs() const {
555  return this->sPtr->getDataDofs();
556  }
557 
558  /**
559  * \brief Get number of DOFs on data
560  * @return Number of dofs on data
561  */
562  inline DofIdx getNbDofsData() const { return this->sPtr->getNbDofsData(); }
563 
564  /**
565  * \brief Get element entity
566  * @return Element entity handle
567  */
568  inline EntityHandle getEnt() const { return this->sPtr->getRefEnt(); }
569 
570  // /** \deprecated Use getEnt() instead
571  // */
572  // DEPRECATED inline EntityHandle get_ent() const { return getEnt(); }
573 
574  /**
575  * \brief Get unique UId for finite element entity
576  * @return UId
577  */
578  inline UId getGlobalUniqueId() const {
579  return this->sPtr->getGlobalUniqueId();
580  }
581 
583  return this->sPtr->getSideNumberTable();
584  }
585 
586  // /** \deprecated Use getSideNumberTable() instead
587  // */
588  // DEPRECATED SideNumber_multiIndex &get_side_number_table() const {
589  // return this->sPtr->getSideNumberTable();
590  // }
591 
592  inline MoFEMErrorCode getElementAdjacency(const Field *field_ptr,
593  Range &adjacency) {
594  return this->getElementAdjacency(field_ptr, adjacency);
595  }
596 
597  // /** \deprecated Use getElementAdjacency() instead
598  // */
599  // DEPRECATED inline MoFEMErrorCode get_element_adjacency(
600  // const Field *field_ptr,Range &adjacency
601  // ) {
602  // return this->getElementAdjacency(field_ptr,adjacency);
603  // }
604 
605  inline boost::shared_ptr<RefElement> &getRefElement() const {
606  return this->sPtr->getRefElement();
607  }
608 };
609 
610 /** \brief Partitioned (Indexed) Finite Element in Problem
611 
612  * This type of structure is used to compose problem. Problem is build from
613  * indexed finite elements. This data structure carry information about
614  * partition, which is specific to problem.
615 
616 
617  * \ingroup fe_multi_indices
618  */
620  : public interface_EntFiniteElement<EntFiniteElement> {
621 
626 
627  unsigned int part; ///< Partition number
628  boost::shared_ptr<FENumeredDofEntity_multiIndex>
629  rows_dofs; ///< indexed dofs on rows
630  boost::shared_ptr<FENumeredDofEntity_multiIndex>
631  cols_dofs; ///< indexed dofs on columns
632 
633  inline boost::shared_ptr<EntFiniteElement> &getEntFiniteElement() const {
634  return this->sPtr;
635  }
636 
637  /**
638  * \Construct indexed finite element
639  */
640  NumeredEntFiniteElement(const boost::shared_ptr<EntFiniteElement> &sptr)
642  rows_dofs(boost::shared_ptr<FENumeredDofEntity_multiIndex>(
644  cols_dofs(boost::shared_ptr<FENumeredDofEntity_multiIndex>(
646 
647  /**
648  * \brief Get partition number
649  * @return [description]
650  */
651  inline unsigned int getPart() const { return part; };
652 
653  /** \brief get FE dof on row
654  * \ingroup mofem_dofs
655  */
657  return *rows_dofs;
658  };
659 
660  /** \brief get FE dof on column
661  * \ingroup mofem_dofs
662  */
664  return *cols_dofs;
665  };
666 
667  /** \brief get FE dof by petsc index
668  * \ingroup mofem_dofs
669  */
670  boost::weak_ptr<FENumeredDofEntity>
671  getRowDofsByPetscGlobalDofIdx(const int idx) const;
672 
673  /** \brief get FE dof by petsc index
674  * \ingroup mofem_dofs
675  */
676  boost::weak_ptr<FENumeredDofEntity>
677  getColDofsByPetscGlobalDofIdx(const int idx) const;
678 
679  /**
680  * @deprecated Unsafe to use, will be removed in future releases.
681  *
682  * Get the Row Dofs By Petsc Global Dof Idx object
683  *
684  * @param idx
685  * @param dof_raw_ptr
686  * @return MoFEMErrorCode
687  */
690  const FENumeredDofEntity **dof_raw_ptr) const {
692  if (auto r = getRowDofsByPetscGlobalDofIdx(idx).lock())
693  *dof_raw_ptr = r.get();
694  else
695  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND,
696  "dof which index < %d > not found", idx);
698  }
699 
700  /**
701  * @deprecated Unsafe to use, will be removed in future releases.
702  *
703  * Get the Row Dofs By Petsc Global Dof Idx object
704  *
705  * @param idx
706  * @param dof_raw_ptr
707  * @return MoFEMErrorCode
708  */
711  const FENumeredDofEntity **dof_raw_ptr) const {
713  if (auto r = getColDofsByPetscGlobalDofIdx(idx).lock())
714  *dof_raw_ptr = r.get();
715  else
716  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_FOUND,
717  "dof which index < %d > not found", idx);
719  }
720 
721  friend std::ostream &operator<<(std::ostream &os,
722  const NumeredEntFiniteElement &e) {
723  os << "part " << e.part << " " << *(e.sFePtr);
724  return os;
725  }
726 
727  /**
728  * \brief Get weak_ptr reference to sequence/vector storing dofs on entity.
729  *
730  * Vector is automatically destroy when last DOF in vector os destroyed. Every
731  * shared_ptr to the DOF has aliased shared_ptr to vector of DOFs in that
732  * vector. That do the trick.
733  *
734  */
735  inline boost::weak_ptr<std::vector<FENumeredDofEntity> > &
737  return dofsRowSequce;
738  }
739 
740  /**
741  * \brief Get weak_ptr reference to sequence/vector storing dofs on entity.
742  *
743  * Vector is automatically destroy when last DOF in vector os destroyed. Every
744  * shared_ptr to the DOF has aliased shared_ptr to vector of DOFs in that
745  * vector. That do the trick.
746  *
747  */
748  inline boost::weak_ptr<std::vector<FENumeredDofEntity> > &
750  return dofsColSequce;
751  }
752 
753 private:
754  // Keep vector of DoFS on entity
755  mutable boost::weak_ptr<std::vector<FENumeredDofEntity> > dofsRowSequce;
756  mutable boost::weak_ptr<std::vector<FENumeredDofEntity> > dofsColSequce;
757 };
758 
759 /** \brief interface for NumeredEntFiniteElement
760  * \ingroup fe_multi_indices
761  */
762 template <typename T>
764  : public interface_EntFiniteElement<T> {
765 
766  interface_NumeredEntFiniteElement(const boost::shared_ptr<T> &sptr)
767  : interface_EntFiniteElement<T>(sptr){};
768 
769  /**
770  * \brief Get partition number
771  * @return Partition number
772  */
773  inline unsigned int getPart() const { return this->sPtr->getPart(); }
774 
775  /** \brief get FE dof on row
776  * \ingroup mofem_dofs
777  */
779  return this->sPtr->getRowsDofs();
780  };
781 
782  /** \brief get FE dof on column
783  * \ingroup mofem_dofs
784  */
786  return this->sPtr->getColsDofs();
787  };
788 };
789 
790 /**
791  * @relates multi_index_container
792  * \brief MultiIndex container for EntFiniteElement
793  * \ingroup fe_multi_indices
794  *
795  */
796 typedef multi_index_container<
797  boost::shared_ptr<EntFiniteElement>,
798  indexed_by<
799  ordered_unique<
800  tag<Unique_mi_tag>,
801  member<EntFiniteElement, UId, &EntFiniteElement::globalUId> >,
802  ordered_non_unique<tag<Ent_mi_tag>,
803  const_mem_fun<EntFiniteElement, EntityHandle,
805  ordered_non_unique<
806  tag<FiniteElement_name_mi_tag>,
808  boost::string_ref, &EntFiniteElement::getNameRef> >,
809  ordered_non_unique<
810  tag<BitFEId_mi_tag>,
813  LtBit<BitFEId> >,
814  ordered_non_unique<
815  tag<EntType_mi_tag>,
817  EntityType, &EntFiniteElement::getEntType> >,
818  ordered_non_unique<
819  tag<Composite_Name_And_Ent_mi_tag>,
820  composite_key<
821  EntFiniteElement,
823  boost::string_ref, &EntFiniteElement::getNameRef>,
824  const_mem_fun<EntFiniteElement, EntityHandle,
825  &EntFiniteElement::getEnt> > > > >
827 
828 /**
829  * \brief Entity finite element multi-index by finite element name
830  *
831  * \ingroup fe_multi_indices
832  */
833 typedef EntFiniteElement_multiIndex::index<FiniteElement_name_mi_tag>::type
835 
836 /**
837  @relates multi_index_container
838  \brief MultiIndex for entities for NumeredEntFiniteElement
839  \ingroup fe_multi_indices
840  */
841 typedef multi_index_container<
842  boost::shared_ptr<NumeredEntFiniteElement>,
843  indexed_by<
844  ordered_unique<
845  tag<Unique_mi_tag>,
846  const_mem_fun<
849  ordered_non_unique<tag<Part_mi_tag>,
850  member<NumeredEntFiniteElement, unsigned int,
852  ordered_non_unique<
853  tag<FiniteElement_name_mi_tag>,
855  boost::string_ref,
857  ordered_non_unique<
858  tag<Ent_mi_tag>,
859  const_mem_fun<
862  ordered_non_unique<
863  tag<Composite_Name_And_Ent_mi_tag>,
864  composite_key<
866  const_mem_fun<
868  boost::string_ref, &NumeredEntFiniteElement::getNameRef>,
869  const_mem_fun<
872  ordered_non_unique<
873  tag<Composite_Name_And_Part_mi_tag>,
874  composite_key<
876  const_mem_fun<
878  boost::string_ref, &NumeredEntFiniteElement::getNameRef>,
879  member<NumeredEntFiniteElement, unsigned int,
882 
883 /**
884  * \brief Entity finite element multi-index by finite element name
885  *
886  * \ingroup fe_multi_indices
887  */
888 typedef NumeredEntFiniteElement_multiIndex::index<
890 
891 /**
892  * \brief Entity finite element multi-index by finite element name and
893  * partition
894  *
895  * \ingroup fe_multi_indices
896  */
897 typedef NumeredEntFiniteElement_multiIndex::index<
899 
900 /**
901  @relates multi_index_container
902  \brief MultiIndex for entities for FiniteElement
903  \ingroup fe_multi_indices
904  */
905 typedef multi_index_container<
906  boost::shared_ptr<FiniteElement>,
907  indexed_by<hashed_unique<tag<FiniteElement_Meshset_mi_tag>,
908  member<FiniteElement, EntityHandle,
910  hashed_unique<
911  tag<BitFEId_mi_tag>,
912  const_mem_fun<FiniteElement, BitFEId, &FiniteElement::getId>,
914  ordered_unique<tag<FiniteElement_name_mi_tag>,
915  const_mem_fun<FiniteElement, boost::string_ref,
918 
919 // modificators
920 
921 /**
922  * \brief Change finite element part
923  *
924  * \ingroup fe_multi_indices
925  */
927  unsigned int pArt;
928  NumeredEntFiniteElement_change_part(unsigned int part) : pArt(part){};
929  void operator()(boost::shared_ptr<NumeredEntFiniteElement> &fe) {
930  fe->part = pArt;
931  }
933 };
934 
935 /**
936  * \brief Add field to column
937  *
938  * \ingroup fe_multi_indices
939  */
943  : fIdCol(f_id_col){};
944  void operator()(boost::shared_ptr<FiniteElement> &fe);
945 };
946 
947 /**
948  * \brief Add field to row
949  *
950  * \ingroup fe_multi_indices
951  */
955  : fIdRow(f_id_row){};
956  void operator()(boost::shared_ptr<FiniteElement> &fe);
957 };
958 
959 /**
960  * \brief Add field to data
961  *
962  * \ingroup fe_multi_indices
963  */
967  : fIdData(f_id_data){};
968  void operator()(boost::shared_ptr<FiniteElement> &fe);
969 };
970 
971 /**
972  * \brief Unset field from column
973  *
974  * \ingroup fe_multi_indices
975  */
979  : fIdCol(f_id_col){};
980  void operator()(boost::shared_ptr<FiniteElement> &fe);
981 };
982 
983 /**
984  * \brief Unset field from row
985  *
986  * \ingroup fe_multi_indices
987  */
991  : fIdRow(f_id_row){};
992  void operator()(boost::shared_ptr<FiniteElement> &fe);
993 };
994 
995 /**
996  * \brief Unset field from data
997  *
998  * \ingroup fe_multi_indices
999  */
1003  : fIdData(f_id_data){};
1004  void operator()(boost::shared_ptr<FiniteElement> &fe);
1005 };
1006 
1007 } // namespace MoFEM
1008 
1009 /**
1010  * Loop over DOFs in row on element
1011  * @param FEPTR pointer to element structure \ref NumeredEntFiniteElement
1012  * @param IT iterator
1013  * @return user return in for(_IT_FENUMEREDDOF_ROW_FOR_LOOP_(FEPTR,IT))
1014  * \ingroup fe_multi_indices
1015  */
1016 #define _IT_FENUMEREDDOF_ROW_FOR_LOOP_(FEPTR, IT) \
1017  FENumeredDofEntity_multiIndex::iterator IT = FEPTR->rows_dofs->begin(); \
1018  IT != FEPTR->rows_dofs->end(); \
1019  IT++
1020 
1021 /// \deprecated use _IT_FENUMEREDDOF_ROW_FOR_LOOP_
1022 #define _IT_FENUMEREDDOFMOFEMENTITY_ROW_FOR_LOOP_(FEPTR, IT) \
1023  _IT_FENUMEREDDOF_ROW_FOR_LOOP_(FEPTR, IT)
1024 
1025 /**
1026  * Loop over DOFs in col on element
1027  * @param FEPTR pointer to element structure \ref NumeredEntFiniteElement
1028  * @param IT iterator
1029  * @return user return in for(_IT_FENUMEREDDOF_COL_FOR_LOOP_(FEPTR,IT))
1030  * \ingroup fe_multi_indices
1031  */
1032 #define _IT_FENUMEREDDOF_COL_FOR_LOOP_(FEPTR, IT) \
1033  FENumeredDofEntity_multiIndex::iterator IT = FEPTR->cols_dofs->begin(); \
1034  IT != FEPTR->cols_dofs->end(); \
1035  IT++
1036 
1037 /// \deprecated use _IT_FENUMEREDDOF_COL_FOR_LOOP_ instead
1038 #define _IT_FENUMEREDDOFMOFEMENTITY_COL_FOR_LOOP_(FEPTR, IT) \
1039  _IT_FENUMEREDDOF_COL_FOR_LOOP_(FEPTR, IT)
1040 
1041 /**
1042  * Loop over DOFs in row on element for particular filed
1043  * @param FEPTR pointer to element structure \ref NumeredEntFiniteElement
1044  * @param NAME name of filed
1045  * @param IT iterator
1046  * @return user return in
1047  * for(_IT_FENUMEREDDOF_BY_NAME_ROW_FOR_LOOP_(FEPTR,NAME,IT)) \ingroup
1048  * fe_multi_indices
1049  */
1050 #define _IT_FENUMEREDDOF_BY_NAME_ROW_FOR_LOOP_(FEPTR, NAME, IT) \
1051  FENumeredDofEntityByFieldName::iterator IT = \
1052  FEPTR->rows_dofs->get<FieldName_mi_tag>().lower_bound(NAME); \
1053  IT != FEPTR->rows_dofs->get<FieldName_mi_tag>().upper_bound(NAME); \
1054  IT++
1055 
1056 /// \deprecated use _IT_FENUMEREDDOF_BY_NAME_ROW_FOR_LOOP_ instead
1057 #define _IT_FENUMEREDDOFMOFEMENTITY_BY_NAME_ROW_FOR_LOOP_(FEPTR, NAME, IT) \
1058  _IT_FENUMEREDDOF_BY_NAME_ROW_FOR_LOOP_(FEPTR, NAME, IT)
1059 
1060 /**
1061  * Loop over DOFs in col on element for particular filed
1062  * @param FEPTR pointer to element structure \ref NumeredEntFiniteElement
1063  * @param NAME name of filed
1064  * @param IT iterator
1065  * @return user return in
1066  * for(_IT_FENUMEREDDOF_BY_NAME_COL_FOR_LOOP_(FEPTR,NAME,IT)) \ingroup
1067  * fe_multi_indices
1068  */
1069 #define _IT_FENUMEREDDOF_BY_NAME_COL_FOR_LOOP_(FEPTR, NAME, IT) \
1070  FENumeredDofEntityByFieldName::iterator IT = \
1071  FEPTR->cols_dofs->get<FieldName_mi_tag>().lower_bound(NAME); \
1072  IT != FEPTR->cols_dofs->get<FieldName_mi_tag>().upper_bound(NAME); \
1073  IT++
1074 
1075 /// \deprecated use _IT_FENUMEREDDOF_BY_NAME_COL_FOR_LOOP_ instead
1076 #define _IT_FENUMEREDDOFMOFEMENTITY_BY_NAME_COL_FOR_LOOP_(FEPTR, NAME, IT) \
1077  _IT_FENUMEREDDOF_BY_NAME_COL_FOR_LOOP_(FEPTR, NAME, IT)
1078 
1079 #endif // __FEMMULTIINDICES_HPP__
1080 
1081 /***************************************************************************/ /**
1082 * \defgroup fe_multi_indices Finite elements structures and multi-indices
1083 * \ingroup mofem
1084 ******************************************************************************/
interface_FiniteElement< FiniteElement > interface_type_FiniteElement
keeps data about abstract VERTEX finite element
interface_RefEntity< RefEntity > interface_type_RefEntity
virtual int getBitRefEdgesUlong() const
FiniteElement_col_change_bit_off(const BitFieldId f_id_col)
boost::weak_ptr< std::vector< FEDofEntity > > dofsSequce
boost::shared_ptr< RefEntity > sPtr
keeps information about indexed dofs for the finite element
unsigned int getPart() const
Get partition number.
boost::weak_ptr< FENumeredDofEntity > getColDofsByPetscGlobalDofIdx(const int idx) const
get FE dof by petsc index
void operator()(boost::shared_ptr< FiniteElement > &fe)
void operator()(boost::shared_ptr< FiniteElement > &fe)
RefElement_MESHSET(const boost::shared_ptr< RefEntity > &ref_ent_ptr)
NumeredEntFiniteElement_multiIndex::index< FiniteElement_name_mi_tag >::type NumeredEntFiniteElementbyName
Entity finite element multi-index by finite element name.
FiniteElement_row_change_bit_add(const BitFieldId f_id_row)
RefElement_EDGE(const boost::shared_ptr< RefEntity > &ref_ent_ptr)
multi_index_container< boost::shared_ptr< RefElement >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getRefEnt > >, ordered_non_unique< tag< EntType_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityType, &RefElement::getEntType > > > > RefElement_multiIndex
const FENumeredDofEntity_multiIndex & getRowsDofs() const
get FE dof on row
const BitRefEdges & getBitRefEdges() const
EntFiniteElement(const boost::shared_ptr< RefElement > &ref_finite_element, const boost::shared_ptr< FiniteElement > &fe_ptr)
BitFEId getId() const
Get finite element id.
interface_RefElement(const boost::shared_ptr< T > &sptr)
Provide data structure for (tensor) field approximation.The Field is intended to provide support for ...
const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
multi_index_container< boost::shared_ptr< FiniteElement >, indexed_by< hashed_unique< tag< FiniteElement_Meshset_mi_tag >, member< FiniteElement, EntityHandle, &FiniteElement::meshset > >, hashed_unique< tag< BitFEId_mi_tag >, const_mem_fun< FiniteElement, BitFEId, &FiniteElement::getId >, HashBit< BitFEId >, EqBit< BitFEId > >, ordered_unique< tag< FiniteElement_name_mi_tag >, const_mem_fun< FiniteElement, boost::string_ref, &FiniteElement::getNameRef > > > > FiniteElement_multiIndex
MultiIndex for entities for FiniteElement.
static MoFEMErrorCode defaultVertex(Interface &moab, const Field &field_ptr, const EntFiniteElement &fe_ptr, Range &adjacency)
SideNumber_multiIndex side_number_table
friend std::ostream & operator<<(std::ostream &os, const RefElement_EDGE &e)
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
const boost::shared_ptr< FiniteElement > & get_MoFEMFiniteElementPtr()
Partitioned (Indexed) Finite Element in Problem.
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.
FiniteElement_col_change_bit_add(const BitFieldId f_id_col)
keeps data about abstract PRISM finite element
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:476
MoFEMErrorCode getColDofView(const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, const int operation_type=moab::Interface::UNION)
BitFieldId getBitFieldIdRow() const
Get field ids on rows.
boost::weak_ptr< std::vector< FENumeredDofEntity > > & getRowDofsSequence() const
Get weak_ptr reference to sequence/vector storing dofs on entity.
static MoFEMErrorCode defaultTri(Interface &moab, const Field &field_ptr, const EntFiniteElement &fe_ptr, Range &adjacency)
unsigned int getBitNumber() const
Get bit identifying this element.
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
MoFEMErrorCode getDofView(const FE_ENTS &fe_ents_view, const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, const int operation_type)
const UId & getGlobalUniqueId() const
Get unique UId for finite element entity.
std::string getName() const
Get finite element name.
virtual const BitRefEdges & getBitRefEdges() const
const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
UId getGlobalUniqueIdCalculate() const
Generate UId for finite element entity.
BitFieldId getBitFieldIdData() const
Get field ids on data.
void operator()(boost::shared_ptr< FiniteElement > &fe)
void operator()(NumeredEntFiniteElement &fe)
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:507
BitFieldId * tag_BitFieldId_row_data
tag stores row id_id for fields
interface_FiniteElement(const boost::shared_ptr< T > &ptr)
const FENumeredDofEntity_multiIndex & getColsDofs() const
get FE dof on column
DofIdx getNbDofsData() const
Get number of DOFs on data.
interface_EntFiniteElement< EntFiniteElement > interface_type_EntFiniteElement
BitFieldId * tag_BitFieldId_data
tag stores data id_id for fields
MoFEMErrorCode getRowDofView(const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, const int operation_type=moab::Interface::UNION)
EntityHandle getEnt() const
Get element entity.
const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
boost::weak_ptr< std::vector< FENumeredDofEntity > > & getColDofsSequence() const
Get weak_ptr reference to sequence/vector storing dofs on entity.
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
interface_RefElement< T > interface_type_RefElement
boost::shared_ptr< RefElement > & getRefElement() const
BitFieldId getBitFieldIdData() const
Get field ids on data.
const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
keeps data about abstract refined finite element
NumeredEntFiniteElement_multiIndex::index< Composite_Name_And_Part_mi_tag >::type NumeredEntFiniteElementbyNameAndPart
Entity finite element multi-index by finite element name and partition.
std::bitset< BITREFEDGES_SIZE > BitRefEdges
Definition: Types.hpp:45
const FENumeredDofEntity_multiIndex & getColsDofs() const
get FE dof on column
const FEDofEntity_multiIndex & getDataDofs() const
Get data data dos multi-index structure.
DofIdx getNbDofsData() const
Get number of DOFs on data.
interface_RefElement< RefElement > interface_type_RefElement
BitRefEdges * tag_BitRefEdges
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:54
multi_index_container< boost::shared_ptr< NumeredEntFiniteElement >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< NumeredEntFiniteElement::interface_type_EntFiniteElement, UId, &NumeredEntFiniteElement::getGlobalUniqueId > >, ordered_non_unique< tag< Part_mi_tag >, member< NumeredEntFiniteElement, unsigned int, &NumeredEntFiniteElement::part > >, ordered_non_unique< tag< FiniteElement_name_mi_tag >, const_mem_fun< NumeredEntFiniteElement::interface_type_FiniteElement, boost::string_ref, &NumeredEntFiniteElement::getNameRef > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< NumeredEntFiniteElement::interface_type_EntFiniteElement, EntityHandle, &NumeredEntFiniteElement::getEnt > >, ordered_non_unique< tag< Composite_Name_And_Ent_mi_tag >, composite_key< NumeredEntFiniteElement, const_mem_fun< NumeredEntFiniteElement::interface_type_FiniteElement, boost::string_ref, &NumeredEntFiniteElement::getNameRef >, const_mem_fun< NumeredEntFiniteElement::interface_type_EntFiniteElement, EntityHandle, &NumeredEntFiniteElement::getEnt > > >, ordered_non_unique< tag< Composite_Name_And_Part_mi_tag >, composite_key< NumeredEntFiniteElement, const_mem_fun< NumeredEntFiniteElement::interface_type_FiniteElement, boost::string_ref, &NumeredEntFiniteElement::getNameRef >, member< NumeredEntFiniteElement, unsigned int, &NumeredEntFiniteElement::part > > > > > NumeredEntFiniteElement_multiIndex
MultiIndex for entities for NumeredEntFiniteElement.
unsigned int getBitNumber() const
Get bit identifying this element.
boost::shared_ptr< FieldEntity_vector_view > col_field_ents_view
unsigned int getPart() const
Get partition number.
static UId getGlobalUniqueIdCalculate(const EntityHandle ent, const int bit_number)
Generate UId for finite element entity.
void operator()(boost::shared_ptr< FiniteElement > &fe)
boost::weak_ptr< FENumeredDofEntity > getRowDofsByPetscGlobalDofIdx(const int idx) const
get FE dof by petsc index
MoFEMErrorCode getElementAdjacency(const Field *field_ptr, Range &adjacency)
RefElement(const boost::shared_ptr< RefEntity > &ref_ent_ptr)
DEPRECATED MoFEMErrorCode getColDofsByPetscGlobalDofIdx(const int idx, const FENumeredDofEntity **dof_raw_ptr) const
DEPRECATED MoFEMErrorCode getRowDofsByPetscGlobalDofIdx(const int idx, const FENumeredDofEntity **dof_raw_ptr) const
boost::weak_ptr< std::vector< FEDofEntity > > & getDofsSequence() const
Get weak_ptr reference to sequence/vector storing dofs on entity.
friend std::ostream & operator<<(std::ostream &os, const RefElement &e)
NumeredEntFiniteElement(const boost::shared_ptr< EntFiniteElement > &sptr)
interface_FiniteElement< EntFiniteElement > interface_type_FiniteElement
interface_EntFiniteElement(const boost::shared_ptr< T > &sptr)
static MoFEMErrorCode defaultTet(Interface &moab, const Field &field_ptr, const EntFiniteElement &fe_ptr, Range &adjacency)
Finite element definition.
boost::shared_ptr< FEDofEntity_multiIndex > data_dofs
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Get pointer to RefEntity.
EntityHandle meshset
meshset stores FE ents
ElementAdjacencyFunct elementAdjacencyTable[MBMAXTYPE]
Table of functions retrieving adjacencies for finite element User can alter and change default behavi...
boost::function< MoFEMErrorCode(Interface &moab, const Field &field_ptr, const EntFiniteElement &fe_ptr, Range &adjacency)> ElementAdjacencyFunct
user adjacency function
BitFEId * tagId
ptr to tag storing FE id
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
void operator()(boost::shared_ptr< NumeredEntFiniteElement > &fe)
multi_index_container< boost::shared_ptr< RefElement >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getRefEnt > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getParentEnt > >, ordered_non_unique< tag< Composite_ParentEnt_And_BitsOfRefinedEdges_mi_tag >, composite_key< RefElement, const_mem_fun< RefElement::interface_type_RefEntity, EntityHandle, &RefElement::getParentEnt >, const_mem_fun< RefElement, int, &RefElement::getBitRefEdgesUlong > > > > > RefElement_multiIndex_parents_view
EntityHandle getMeshset() const
Get meshset containing element entities.
boost::weak_ptr< std::vector< FENumeredDofEntity > > dofsColSequce
friend std::ostream & operator<<(std::ostream &os, const EntFiniteElement &e)
BitRefEdges * tag_BitRefEdges
void operator()(boost::shared_ptr< FiniteElement > &fe)
const BitRefEdges & getBitRefEdges() const
friend std::ostream & operator<<(std::ostream &os, const NumeredEntFiniteElement &e)
int tagNameSize
numer of characters in FE name
boost::shared_ptr< T > sFePtr
boost::shared_ptr< FENumeredDofEntity_multiIndex > rows_dofs
indexed dofs on rows
interface to RefEntity
RefElement_VERTEX(const boost::shared_ptr< RefEntity > &ref_ent_ptr)
boost::weak_ptr< std::vector< FENumeredDofEntity > > dofsRowSequce
boost::shared_ptr< FENumeredDofEntity_multiIndex > cols_dofs
indexed dofs on columns
BitFEId getId() const
Get finite element id.
static MoFEMErrorCode defaultEdge(Interface &moab, const Field &field_ptr, const EntFiniteElement &fe_ptr, Range &adjacency)
interface_RefEntity< T > interface_type_RefEntity
keeps data about abstract TET finite element
intrface to RefElement
friend std::ostream & operator<<(std::ostream &os, const RefElement_TRI &e)
SideNumber_multiIndex & getSideNumberTable() const
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
Finite element data for entity.
multi_index_container< boost::shared_ptr< EntFiniteElement >, indexed_by< ordered_unique< tag< Unique_mi_tag >, member< EntFiniteElement, UId, &EntFiniteElement::globalUId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< EntFiniteElement, EntityHandle, &EntFiniteElement::getEnt > >, ordered_non_unique< tag< FiniteElement_name_mi_tag >, const_mem_fun< EntFiniteElement::interface_type_FiniteElement, boost::string_ref, &EntFiniteElement::getNameRef > >, ordered_non_unique< tag< BitFEId_mi_tag >, const_mem_fun< EntFiniteElement::interface_type_FiniteElement, BitFEId, &EntFiniteElement::getId >, LtBit< BitFEId > >, ordered_non_unique< tag< EntType_mi_tag >, const_mem_fun< EntFiniteElement::interface_type_RefEntity, EntityType, &EntFiniteElement::getEntType > >, ordered_non_unique< tag< Composite_Name_And_Ent_mi_tag >, composite_key< EntFiniteElement, const_mem_fun< EntFiniteElement::interface_type_FiniteElement, boost::string_ref, &EntFiniteElement::getNameRef >, const_mem_fun< EntFiniteElement, EntityHandle, &EntFiniteElement::getEnt > > > > > EntFiniteElement_multiIndex
MultiIndex container for EntFiniteElement.
EntityHandle getMeshset() const
Get meshset containing element entities.
FiniteElement_row_change_bit_off(const BitFieldId f_id_row)
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.
FiniteElement(Interface &moab, const EntityHandle _meshset)
SideNumber_multiIndex & getSideNumberTable() const
boost::shared_ptr< RefElement > & getRefElement() const
interface_NumeredEntFiniteElement(const boost::shared_ptr< T > &sptr)
#define DEPRECATED
Definition: definitions.h:29
RefElement_PRISM(const boost::shared_ptr< RefEntity > &ref_ent_ptr)
static MoFEMErrorCode defaultPrism(Interface &moab, const Field &field_ptr, const EntFiniteElement &fe_ptr, Range &adjacency)
std::string getName() const
Get finite element name.
friend std::ostream & operator<<(std::ostream &os, const FiniteElement &e)
print finite element
const FEDofEntity_multiIndex & getDataDofs() const
BitFieldId * tag_BitFieldId_col_data
tag stores col id_id for fields
UId getGlobalUniqueId() const
Get unique UId for finite element entity.
BitFieldId getBitFieldIdRow() const
Get field ids on rows.
MoFEMErrorCode getElementAdjacency(const boost::shared_ptr< Field > field_ptr, Range &adjacency)
BitFieldId getBitFieldIdCol() const
Get field ids on columns.
keeps data about abstract EDGE finite element
EntFiniteElement_multiIndex::index< FiniteElement_name_mi_tag >::type EntFiniteElementByName
Entity finite element multi-index by finite element name.
static MoFEMErrorCode defaultMeshset(Interface &moab, const Field &field_ptr, const EntFiniteElement &fe_ptr, Range &adjacency)
FiniteElement_change_bit_add(const BitFieldId f_id_data)
boost::shared_ptr< EntFiniteElement > & getEntFiniteElement() const
boost::shared_ptr< FieldEntity_multiIndex_spaceType_view > data_field_ents_view
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:406
unsigned int part
Partition number.
void * tagName
ptr to tag storing FE name
FiniteElement_change_bit_off(const BitFieldId f_id_data)
keeps data about abstract TRI finite element
const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
interface to EntFiniteElement
static BitRefEdges DummyBitRefEdges
RefElement_TET(const boost::shared_ptr< RefEntity > &ref_ent_ptr)
boost::string_ref getNameRef() const
Get finite element name.
RefElement_TRI(const boost::shared_ptr< RefEntity > &ref_ent_ptr)
keeps data about abstract MESHSET finite element
virtual const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
EntityHandle getEnt() const
Get element entity.
const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
#define NOT_USED(x)
Definition: definitions.h:302
SideNumber_multiIndex & getSideNumberTable() const
uint128_t UId
Unique Id.
Definition: Types.hpp:41
static const boost::shared_ptr< SideNumber > nullSideNumber
boost::string_ref getNameRef() const
Get finite element name.
interface for NumeredEntFiniteElement
const FENumeredDofEntity_multiIndex & getRowsDofs() const
get FE dof on row
void operator()(boost::shared_ptr< FiniteElement > &fe)
const boost::shared_ptr< SideNumber > & getSideNumberPtr(const EntityHandle ent) const
SideNumber_multiIndex & getSideNumberTable() const
friend std::ostream & operator<<(std::ostream &os, const RefElement_VERTEX &e)
int getBitRefEdgesUlong() const
interface_RefEntity< RefElement > interface_type_RefEntity
boost::shared_ptr< FieldEntity_vector_view > row_field_ents_view
BitFieldId getBitFieldIdCol() const
Get field ids on columns.
const boost::shared_ptr< T > & getRefElement() const