v0.14.0
BitRefManager.hpp
Go to the documentation of this file.
1 /** \file BitRefManager.hpp
2  * \brief Interface managing BitRefLevels
3  * \ingroup mofem_bit_ref
4  *
5  * Managing BitRef levels
6  *
7  */
8 
9 #ifndef __BITREFMANAGER_HPP__
10 #define __BITREFMANAGER_HPP__
11 
12 #include "UnknownInterface.hpp"
13 
14 namespace MoFEM {
15 
16 /**
17  * \brief Managing BitRefLevels
18  * \ingroup mofem_bit_ref
19  * \nosubgrouping
20  */
22 
23  MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
24  UnknownInterface **iface) const;
25 
27  bool dEbug;
28 
29  BitRefManager(const MoFEM::Core &core);
30 
31  /**
32  * \brief Destructor
33  */
34  virtual ~BitRefManager() = default;
35 
36  /** \name Setting and shifting bits */
37 
38  /**@{*/
39 
40  /**
41  * \brief add entities to database and set bit ref level
42  * \ingroup mofem_bit_ref
43  *
44  * This function set bit ref level, add entries to core database and
45  * create ref finite elements. Finite elements are create of entities in
46  function
47  * argument, whereas all lower dimension entities are added as a field
48  entities
49  *
50  *
51 
52  Example:\code
53  EntityHandle meshset1; //contains ent1,ent2,ent3
54  BitRefLevel myLevel0;
55  myLevel0.set(0);
56  m_field.getInterface<BitRefManager>()->setBitRefLevelByDim(meshset1,3,myLevel0);
57  //refine meshset1 into meshset2 and get new ents which are ent4, ent5
58  EntityHandle meshset2; //contains ent1,ent2,ent3,ent4,ent5
59  BitRefLevel myLevel1;
60  myLevel1.set(1);
61  m_field.getInterface<BitRefManager>()->setBitRefLevelByDim(meshset2,3,myLevel1);
62  \endcode
63 
64  * So entities 1,2,3 would be assigned to bit level 0 and 1 <br>
65  * ent1[1,1,0,0,0,0,0], ent2[1,1,0,0,0,0,0], ent3[1,1,0,0,0,0,0], <br>
66  * and entities 4 and 5 are assigned to bit level 1 only <br>
67  * ent4[0,1,0,0,0,0,0], ent5[0,1,0,0,0,0,0] <br>
68 
69 
70  * @param ents entities to set
71  * @param bit bit refinement level
72  * @param only_tets only add entities on tetrahedral (obsolete need to be
73  fixed)
74  * @param verb verbosity level
75  * @param adj_ents_ptr if pointer is given, it is used to get adj entities by
76  dimension/type
77  * @return error code
78  */
80  const bool only_tets = true, int verb = 0,
81  Range *adj_ents_ptr = nullptr) const;
82 
83  /**
84  * @brief add entities to database and set bit ref level
85  * \ingroup mofem_bit_ref
86  *
87  * \note In THIS variant only entities in range are added and ref finite
88  * elements reated.
89  *
90  * @param ents
91  * @param bit
92  * @param only_tets
93  * @param verb
94  * @return MoFEMErrorCode setBitRefLevel
95  */
97  const BitRefLevel bit = BitRefLevel(),
98  int verb = QUIET) const;
99 
100  /**
101  * @brief add entities to database and set bit ref level
102  * \ingroup mofem_bit_ref
103  *
104  * \note In THIS variant only entities in range are added. And DO NOT create
105  * elements.
106  *
107  * @param ents
108  * @param bit
109  * @param only_tets
110  * @param verb
111  * @return MoFEMErrorCode setBitRefLevel
112  */
114  const BitRefLevel bit = BitRefLevel(),
115  int verb = QUIET) const;
116 
117  /**
118  * @brief Set the bit ref level to entities in the field meshset
119  *
120  * @param field_name
121  * @param bit
122  * @param verb
123  * @return MoFEMErrorCode
124  */
126  setFieldEntitiesBitRefLevel(const std::string field_name,
127  const BitRefLevel bit = BitRefLevel(),
128  int verb = QUIET) const;
129 
130  /**
131  * @brief Set the Bit Ref Level By Dim object
132  *
133  * \note In THIS variant only entities in range are added. And DO NOT create
134  * elements.
135  *
136  * @param meshset
137  * @param dim
138  * @param bit
139  * @param verb
140  * @return MoFEMErrorCode
141  */
142  MoFEMErrorCode setBitRefLevelByDim(const EntityHandle meshset, const int dim,
143  const BitRefLevel bit,
144  int verb = QUIET) const;
145 
146  /**
147  * @brief Set the Bit Ref Level By Type object
148  *
149  * \note In THIS variant only entities in range are added. And DO NOT create
150  * elements.
151  *
152  * @param meshset
153  * @param type
154  * @param bit
155  * @param verb
156  * @return MoFEMErrorCode
157  */
159  const EntityType type,
160  const BitRefLevel bit,
161  int verb = QUIET) const;
162 
163  /** brief add meshset and set bit ref level
164  * \ingroup mofem_bit_ref
165  *
166  * \param EntityHandle MeshSet
167  * \param BitRefLevel bitLevel
168  */
170  const BitRefLevel bit,
171  int verb = 0) const;
172 
173  /**
174  * @brief Add entities which exist in MoAB database, and have set appropiate
175  * BitRef level tag, to multi-indices in MoFEM.
176  *
177  * \note Every entity, used for create DoFS, or elements has to have set
178  * BitRefLevel and be added to MoFEM database.
179  *
180  * \note This functions add lower dimension entities by calling
181  * setEntitiesBitRefLevel
182  *
183  * @param type of entity
184  * @param bit bit ref level
185  * @param mask
186  * @param verb verbosity level
187  * @return MoFEMErrorCode
188  */
190  addToDatabaseBitRefLevelByType(const EntityType type, const BitRefLevel bit,
191  const BitRefLevel mask = BitRefLevel().set(),
192  int verb = QUIET) const;
193 
194  /**
195  * @brief Add entities which exist in MoAB database, and have set appropiate
196  * BitRef level tag, to multi-indices in MoFEM.
197  *
198  * \note Every entity, used for create DoFS, or elements has to have set
199  * BitRefLevel and be added to MoFEM database.
200  *
201  * \note This functions add lower dimension entities by calling
202  * setEntitiesBitRefLevel
203  *
204  * @param dim dimension of entity
205  * @param bit bit ref level
206  * @param verb verbosity level
207  * @return MoFEMErrorCode
208  */
210  addToDatabaseBitRefLevelByDim(const int dim, const BitRefLevel bit,
211  const BitRefLevel mask = BitRefLevel().set(),
212  int verb = QUIET) const;
213 
214  /**
215  * @brief Process bit ref level by lambda function
216  *
217  * \note That not apply to type of MBENTITY. To avoid problems with problem
218  * meshsets.
219  *
220  * @param fun
221  * @return MoFEMErrorCode
222  */
224  boost::function<void(EntityHandle ent, BitRefLevel &bit)> fun) const;
225 
226  /**
227  * @brief Process bit ref level by lambda function
228  *
229  * @param fun
230  * @return MoFEMErrorCode
231  */
233  const Range &ents,
234  boost::function<void(EntityHandle ent, BitRefLevel &bit)> fun) const;
235 
236  /**
237  * \brief add bit ref level to ref entity
238  * \ingroup mofem_bit_ref
239  * @param ents range of entities
240  * @param bit bit ref level
241  * @param verb verbosity level
242  * @return error code
243  */
244  MoFEMErrorCode addBitRefLevel(const Range &ents, const BitRefLevel &bit,
245  int verb = QUIET) const;
246 
247  /**
248  * @brief add bit ref level by dimension
249  *
250  * @param meshset
251  * @param dim dimension of entities
252  * @param bit added bit
253  * @param verb verbosity level
254  * @return MoFEMErrorCode
255  */
256  MoFEMErrorCode addBitRefLevelByDim(const EntityHandle meshset, const int dim,
257  const BitRefLevel bit,
258  int verb = QUIET) const;
259 
260  /**
261  * \brief Set nth bit ref level
262  *
263  * \note This function modify bits only on entities in RefEntity_multiindex
264  *
265  * @param ents entities to set bit ref level
266  * @param n nth bit
267  * @param b value to set
268  * @return error code
269  */
270  MoFEMErrorCode setNthBitRefLevel(const Range &ents, const int n, const bool b,
271  int verb = QUIET) const;
272 
273  /**
274  * \brief Set nth bit ref level to all entities in database
275  * \ingroup mofem_bit_ref
276  * @param n nth bit
277  * @param b value to set
278  * @return error code
279  */
280  MoFEMErrorCode setNthBitRefLevel(const int n, const bool b,
281  int verb = QUIET) const;
282 
283  /** \brief left shift bit ref level
284  * \ingroup mofem_bit_ref
285  * this results of deletion of entities on far left side
286  *
287  * \note Not implemented
288  */
289  MoFEMErrorCode shiftLeftBitRef(const int shift,
290  const BitRefLevel mask = BitRefLevel().set(),
291  int verb = DEFAULT_VERBOSITY) const;
292 
293  /** \brief right shift bit ref level
294  * \ingroup mofem_bit_ref
295  */
296  MoFEMErrorCode shiftRightBitRef(const int shift,
297  const BitRefLevel mask = BitRefLevel().set(),
298  int verb = DEFAULT_VERBOSITY,
299  MoFEMTypes mf = MF_ZERO) const;
300 
301  /**@}*/
302 
303  /** \name Entity handlers by bit ref level */
304 
305  /**@{*/
306 
307  /**
308  * @brief filter entities by bit ref level
309  *
310  * @param bit
311  * @param mask
312  * @param ents
313  * @param QUIET
314  * @return MoFEMErrorCode
315  */
317  const BitRefLevel mask, Range &ents,
318  int verb = QUIET) const;
319 
320  /**\brief add all ents from ref level given by bit to meshset
321  * \ingroup mofem_bit_ref
322  *
323  * \note Entities NOT have to be added to MoFEM database
324  *
325  * \param BitRefLevel bitLevel
326  * \param BitRefLevel mask
327  * \param EntityType type of entities
328  * \retval EntityHandle meshset
329  *
330  */
332  const BitRefLevel mask,
333  const EntityType type,
334  const EntityHandle meshset,
335  int verb = 0) const;
336 
337  /**\brief add all ents from ref level given by bit to meshset
338  * \ingroup mofem_bit_ref
339  *
340  * \note Entities NOT have to be added to MoFEM database
341  *
342  * \param BitRefLevel bitLevel
343  * \param BitRefLevel mask
344  * \param EntityType type of entities
345  * \retval ents
346  *
347  */
349  const BitRefLevel mask,
350  const EntityType type,
351  Range &ents, int verb = 0) const;
352 
353  /**\brief add all ents from ref level given by bit to meshset
354  * \ingroup mofem_bit_ref
355  *
356  * \note Entities NOT have to be added to MoFEM database
357  *
358  * \param BitRefLevel bitLevel
359  * \param BitRefLevel mask
360  * \param EntityType dimension of entities
361  * \retval ents
362  *
363  */
365  const BitRefLevel mask,
366  const int dim,
367  const EntityHandle meshset,
368  int verb = 0) const;
369 
370  /**\brief add all ents from ref level given by bit to meshset
371  * \ingroup mofem_bit_ref
372  *
373  * \note Entities NOT have to be added to MoFEM database
374  *
375  * \param BitRefLevel bitLevel
376  * \param BitRefLevel mask
377  * \param EntityType dimension of entities
378  * \retval ents
379  *
380  */
382  const BitRefLevel mask,
383  const int dim, Range &ents,
384  int verb = 0) const;
385 
386  /**\brief add all ents from ref level given by bit to meshset
387  * \ingroup mofem_bit_ref
388  *
389  * \note Entities NOT have to be added to MoFEM database
390  *
391  * \param BitRefLevel bitLevel
392  * \param BitRefLevel mask
393  * \param EntityHandle meshset
394  *
395  */
397  const BitRefLevel mask,
398  const EntityHandle meshset,
399  const int verb = QUIET) const;
400 
401  /**\brief add all ents from ref level given by bit to meshset
402  * \ingroup mofem_bit_ref
403  *
404  * \note Entities NOT have to be added to MoFEM database
405  *
406  * \param BitRefLevel bitLevel
407  * \param BitRefLevel mask
408  * \retval ents
409  */
411  const BitRefLevel mask, Range &ents,
412  const int verb = QUIET) const;
413 
414  /**
415  * \brief get entities by bit ref level and type of parent
416  *
417  * \note Entities have to be added to MoFEM database
418  *
419  * \param BitRefLevel bitLevel
420  * \param BitRefLevel mask
421  * @param type of parent
422  * @param ents returned ents
423  * @return error code
424  */
426  const BitRefLevel mask,
427  const EntityType type, Range &ents,
428  const int verb = QUIET) const;
429 
430  /**
431  * @brief Get all entities not in database
432  *
433  * @param ents
434  * @return MoFEMErrorCode
435  */
437 
438  /**
439  * @brief \brief Get entities not in database
440  *
441  * @param ents
442  * @return MoFEMErrorCode
443  */
445 
446  /**@}*/
447 
448  /** \name Get adjacencies bit ref level */
449 
450  /**@{*/
451 
452  /** \brief Get the adjacencies associated with a entity to entities of a
453  * specified dimension.
454  * \ingroup mofem_bit_ref
455  *
456  * bit ref level of adjacent entities is equal to bit ref level of adjacent
457  * entities
458  */
459  virtual MoFEMErrorCode getAdjacenciesEquality(const EntityHandle from_entity,
460  const int to_dimension,
461  Range &adj_entities) const;
462 
463  /** \brief Get the adjacencies associated with a entity to entities of a
464  * specified dimension.
465  * \ingroup mofem_bit_ref
466  *
467  * bit ref level of adjacent entities is any of bit ref level of adjacent
468  * entities
469  */
470  virtual MoFEMErrorCode getAdjacenciesAny(const EntityHandle from_entity,
471  const int to_dimension,
472  Range &adj_entities) const;
473 
474  /** \brief Get the adjacencies associated with a entity to entities of a
475  * specified dimension.
476  * \ingroup mofem_bit_ref
477  *
478  * bit ref level of adjacent entities is equal to bit ref level of adjacent
479  * entities
480  */
481  virtual MoFEMErrorCode
482  getAdjacencies(const Problem *problem_ptr, const EntityHandle *from_entities,
483  const int num_entities, const int to_dimension,
484  Range &adj_entities,
485  const int operation_type = moab::Interface::INTERSECT,
486  const int verb = 0) const;
487 
488  /** \brief Get the adjacencies associated with a entity to entities of a
489  * specified dimension.
490  * \ingroup mofem_bit_ref
491  *
492  * bit ref level of adjacent entities is equal to bit ref level of adjacent
493  * entities
494  */
495  virtual MoFEMErrorCode
496  getAdjacencies(const BitRefLevel bit, const EntityHandle *from_entities,
497  const int num_entities, const int to_dimension,
498  Range &adj_entities,
499  const int operation_type = moab::Interface::INTERSECT,
500  const int verb = 0) const;
501 
502  /**@}*/
503 
504  /** \name Update meshsets and ranges by children */
505 
506  /**@{*/
507 
508  /** \brief Get child entities form meshset containing parent entities
509  * \ingroup mofem_bit_ref
510  *
511  * Search for refined entities of given type whose parent are entities in
512  *the
513  * parent meshset. It can be used for example to transfer information about
514  * boundary conditions to refined mesh or split mesh by interface
515  * elements. It is used by function refineMeshset, to update MESHSET
516  *finite elements.
517  *
518  * \param parent meshset
519  * \param parent_bit refinement level
520  * \param mask of parent bit ref level
521  * \param child_bit refinement level
522  * \param mask of child bit ref level
523  * \param child meshset where child entities are stored (if the child
524  *meshset is set to be the parent meshset, the parent would be updated with
525  *the refined entities)
526  * \param child_type meshset is update only by entities of specified type. if
527  *type is set to MBMAXTYPE all types are updated.
528  * \param recursive if true parent meshset is searched recursively
529  *
530  **/
532  const EntityHandle parent, const BitRefLevel &parent_bit,
533  const BitRefLevel &parent_mask, const BitRefLevel &child_bit,
534  const BitRefLevel &child_mask, const EntityHandle child,
535  EntityType child_type, const bool recursive = false, int verb = 0);
536 
537  /** \copydoc updateMeshsetByEntitiesChildren
538  **/
540  const BitRefLevel &child_bit,
541  const EntityHandle child,
542  EntityType child_type,
543  const bool recursive = false,
544  int verb = 0);
545 
546  /** \brief update fields meshesets by child entities
547  * \ingroup mofem_update_meshsets_and_ranges
548  *
549  * \note This calls updateMeshsetByEntitiesChildren for all entity types.
550  *
551  */
554  int verb = 0);
555 
556  /** \brief update field meshset by child entities
557  * \ingroup mofem_update_meshsets_and_ranges
558  */
560  const std::string name, const BitRefLevel &child_bit, int verb = 0);
561 
562  /** \brief update finite element meshset by child entities
563  * \ingroup mofem_update_meshsets_and_ranges
564  */
566  const std::string name, const BitRefLevel &child_bit,
567  const EntityType fe_ent_type, int verb = 0);
568 
569  /**
570  * \brief Update range by childrens
571  *
572  * FIXME: NOT TESTED
573  *
574  * @param parent parent range
575  * @param child children range
576  * @return error code
577  */
578  MoFEMErrorCode updateRangeByChildren(const Range &parent, Range &child,
579  MoFEMTypes bh = MF_ZERO);
580 
581  /**
582  * \brief Update range by parents
583  *
584  * FIXME: NOT TESTED
585  *
586  * @param child parent range
587  * @param parent children range
588  * @return error code
589  */
590  MoFEMErrorCode updateRangeByParent(const Range &child_ents,
591  Range &parent_ents,
592  MoFEMTypes bh = MF_ZERO);
593 
594  /**
595  * @deprecated use updateRangeByChildren
596  */
598  updateRange(const Range &parent, Range &child, MoFEMTypes bh = MF_ZERO) {
599  return updateRangeByChildren(parent, child, bh);
600  }
601 
602  /**@}*/
603 
604  /** \name Writing files */
605 
606  /**@{*/
607 
608  /**
609  * \brief Write bit ref level to file
610  * @param bit bit ref level
611  * @param mask mask of bit ref level
612  * @param dim dimension
613  * @param file_name file name (see moab documentation)
614  * @param file_type file type (see moab documentation)
615  * @param options file options (see moab documentation)
616  * @return error code
617  */
619  const char *file_name, const char *file_type,
620  const char *options,
621  const bool check_for_empty = true) const;
622 
623  /**
624  * \brief Write bit ref level to file
625  * @param bit bit ref level
626  * @param mask mask of bit ref level
627  * @param dim dimension
628  * @param file_name file name (see moab documentation)
629  * @param file_type file type (see moab documentation)
630  * @param options file options (see moab documentation)
631  * @return error code
632  */
634  const BitRefLevel mask, const int dim,
635  const char *file_name,
636  const char *file_type, const char *options,
637  const bool check_for_empty = true) const;
638 
639  /**
640  * \brief Write bit ref level to file
641  * @param bit bit ref level
642  * @param mask mask of bit ref level
643  * @param type type of entity
644  * @param file_name file name (see moab documentation)
645  * @param file_type file type (see moab documentation)
646  * @param options file options (see moab documentation)
647  * @return error code
648  */
650  const BitRefLevel mask,
651  const EntityType type,
652  const char *file_name,
653  const char *file_type, const char *options,
654  const bool check_for_empty = true) const;
655 
656  /**
657  * @brief Write ents not in database
658  *
659  * @param file_name
660  * @param file_type for example "VTK"
661  * @param options
662  * @param check_for_empty
663  * @return MoFEMErrorCode
664  */
666  writeEntitiesNotInDatabase(const char *file_name, const char *file_type,
667  const char *options,
668  const bool check_for_empty = true) const;
669 
670  /**
671  * @brief Write all entities by bit levels and type
672  *
673  * @param mask
674  * @param type
675  * @param file_name
676  * @param file_type
677  * @param options
678  * @return MoFEMErrorCode
679  */
681  const EntityType type,
682  const char *file_name,
683  const char *file_type,
684  const char *options);
685 
686  /**@}*/
687 
688  /**@{*/
689 
690  /**
691  * @brief Fix tag size when BITREFLEVEL_SIZE of core library is different than
692  * file BITREFLEVEL_SIZE
693  *
694  * @return MoFEMErrorCode
695  */
697  bool *changed = nullptr);
698 
699  /**@}*/
700 
701 
702  /** \name Get tag handles to data on the mesh */
703 
704  /**@{*/
705 
706  inline Tag get_th_RefParentHandle() const {
707  return cOre.get_th_RefParentHandle();
708  }
709  inline Tag get_th_RefBitLevel() const { return cOre.get_th_RefBitLevel(); }
710 
711  /**@}*/
712 
713 };
714 } // namespace MoFEM
715 
716 #endif //__BITREFMANAGER_HPP__
717 
718 /**
719  * \defgroup mofem_bit_ref BitRefManager
720  * \brief Managing BitRefLevels
721  *
722  * \ingroup mofem
723  */
MoFEM::BitRefManager::~BitRefManager
virtual ~BitRefManager()=default
Destructor.
DEFAULT_VERBOSITY
@ DEFAULT_VERBOSITY
Definition: definitions.h:207
MoFEM::BitRefManager::addBitRefLevelByDim
MoFEMErrorCode addBitRefLevelByDim(const EntityHandle meshset, const int dim, const BitRefLevel bit, int verb=QUIET) const
add bit ref level by dimension
Definition: BitRefManager.cpp:561
MoFEM::BitRefManager::get_th_RefParentHandle
Tag get_th_RefParentHandle() const
Definition: BitRefManager.hpp:706
MoFEM::BitRefManager::getEntitiesByRefLevel
MoFEMErrorCode getEntitiesByRefLevel(const BitRefLevel bit, const BitRefLevel mask, const EntityHandle meshset, const int verb=QUIET) const
add all ents from ref level given by bit to meshset
Definition: BitRefManager.cpp:845
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
DEPRECATED
#define DEPRECATED
Definition: definitions.h:17
MoFEM::BitRefManager::shiftLeftBitRef
MoFEMErrorCode shiftLeftBitRef(const int shift, const BitRefLevel mask=BitRefLevel().set(), int verb=DEFAULT_VERBOSITY) const
left shift bit ref level
Definition: BitRefManager.cpp:595
EntityHandle
MoFEM::BitRefManager::setElementsBitRefLevel
MoFEMErrorCode setElementsBitRefLevel(const Range &ents, const BitRefLevel bit=BitRefLevel(), int verb=QUIET) const
add entities to database and set bit ref level
Definition: BitRefManager.cpp:376
MoFEM::BitRefManager::dEbug
bool dEbug
Definition: BitRefManager.hpp:27
MoFEM::BitRefManager::setBitRefLevelByType
MoFEMErrorCode setBitRefLevelByType(const EntityHandle meshset, const EntityType type, const BitRefLevel bit, int verb=QUIET) const
Set the Bit Ref Level By Type object.
Definition: BitRefManager.cpp:512
MoFEM::BitRefManager::getEntitiesByParentType
MoFEMErrorCode getEntitiesByParentType(const BitRefLevel bit, const BitRefLevel mask, const EntityType type, Range &ents, const int verb=QUIET) const
get entities by bit ref level and type of parent
Definition: BitRefManager.cpp:873
MoFEM::BitRefManager::filterEntitiesNotInDatabase
MoFEMErrorCode filterEntitiesNotInDatabase(Range &ents) const
Get entities not in database.
Definition: BitRefManager.cpp:908
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::BitRefManager::setFieldEntitiesBitRefLevel
MoFEMErrorCode setFieldEntitiesBitRefLevel(const std::string field_name, const BitRefLevel bit=BitRefLevel(), int verb=QUIET) const
Set the bit ref level to entities in the field meshset.
Definition: BitRefManager.cpp:441
MoFEM::BitRefManager::cOre
MoFEM::Core & cOre
Definition: BitRefManager.hpp:26
MoFEM::BitRefManager::lambdaBitRefLevel
MoFEMErrorCode lambdaBitRefLevel(boost::function< void(EntityHandle ent, BitRefLevel &bit)> fun) const
Process bit ref level by lambda function.
Definition: BitRefManager.cpp:524
MoFEM::BitRefManager::writeBitLevel
MoFEMErrorCode writeBitLevel(const BitRefLevel bit, const BitRefLevel mask, const char *file_name, const char *file_type, const char *options, const bool check_for_empty=true) const
Write bit ref level to file.
Definition: BitRefManager.cpp:634
MoFEM::BitRefManager::filterEntitiesByRefLevel
MoFEMErrorCode filterEntitiesByRefLevel(const BitRefLevel bit, const BitRefLevel mask, Range &ents, int verb=QUIET) const
filter entities by bit ref level
Definition: BitRefManager.cpp:746
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
MoFEM::BitRefManager::fixTagSize
static MoFEMErrorCode fixTagSize(moab::Interface &moab, bool *changed=nullptr)
Fix tag size when BITREFLEVEL_SIZE of core library is different than file BITREFLEVEL_SIZE.
Definition: BitRefManager.cpp:1232
MoFEM::BitRefManager::addToDatabaseBitRefLevelByType
MoFEMErrorCode addToDatabaseBitRefLevelByType(const EntityType type, const BitRefLevel bit, const BitRefLevel mask=BitRefLevel().set(), int verb=QUIET) const
Add entities which exist in MoAB database, and have set appropiate BitRef level tag,...
Definition: BitRefManager.cpp:453
MoFEM::BitRefManager::setEntitiesBitRefLevel
MoFEMErrorCode setEntitiesBitRefLevel(const Range &ents, const BitRefLevel bit=BitRefLevel(), int verb=QUIET) const
add entities to database and set bit ref level
Definition: BitRefManager.cpp:416
MoFEM::BitRefManager::writeEntitiesNotInDatabase
MoFEMErrorCode writeEntitiesNotInDatabase(const char *file_name, const char *file_type, const char *options, const bool check_for_empty=true) const
Write ents not in database.
Definition: BitRefManager.cpp:704
MoFEM::BitRefManager::setBitRefLevel
MoFEMErrorCode setBitRefLevel(const Range &ents, const BitRefLevel bit, const bool only_tets=true, int verb=0, Range *adj_ents_ptr=nullptr) const
add entities to database and set bit ref level
Definition: BitRefManager.cpp:279
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::BitRefManager::setBitRefLevelByDim
MoFEMErrorCode setBitRefLevelByDim(const EntityHandle meshset, const int dim, const BitRefLevel bit, int verb=QUIET) const
Set the Bit Ref Level By Dim object.
Definition: BitRefManager.cpp:499
MoFEM::BitRefManager::getEntitiesByDimAndRefLevel
MoFEMErrorCode getEntitiesByDimAndRefLevel(const BitRefLevel bit, const BitRefLevel mask, const int dim, const EntityHandle meshset, int verb=0) const
add all ents from ref level given by bit to meshset
Definition: BitRefManager.cpp:822
MoFEM::BitRefManager::updateFiniteElementMeshsetByEntitiesChildren
MoFEMErrorCode updateFiniteElementMeshsetByEntitiesChildren(const std::string name, const BitRefLevel &child_bit, const EntityType fe_ent_type, int verb=0)
update finite element meshset by child entities
Definition: BitRefManager.cpp:1133
bit
auto bit
set bit
Definition: hanging_node_approx.cpp:75
convert.type
type
Definition: convert.py:64
MoFEM::CoreTmp< 0 >::get_th_RefParentHandle
Tag get_th_RefParentHandle() const
Definition: Core.hpp:197
MoFEM::BitRefManager::updateRangeByParent
MoFEMErrorCode updateRangeByParent(const Range &child_ents, Range &parent_ents, MoFEMTypes bh=MF_ZERO)
Update range by parents.
Definition: BitRefManager.cpp:1187
MoFEM::CoreTmp< 0 >::get_th_RefBitLevel
Tag get_th_RefBitLevel() const
Definition: Core.hpp:198
MoFEM::BitRefManager::updateMeshsetByEntitiesChildren
MoFEMErrorCode updateMeshsetByEntitiesChildren(const EntityHandle parent, const BitRefLevel &parent_bit, const BitRefLevel &parent_mask, const BitRefLevel &child_bit, const BitRefLevel &child_mask, const EntityHandle child, EntityType child_type, const bool recursive=false, int verb=0)
Get child entities form meshset containing parent entities.
Definition: BitRefManager.cpp:1029
MoFEM::BitRefManager::addBitRefLevel
MoFEMErrorCode addBitRefLevel(const Range &ents, const BitRefLevel &bit, int verb=QUIET) const
add bit ref level to ref entity
Definition: BitRefManager.cpp:554
UnknownInterface.hpp
MoFEM interface.
MoFEM::BitRefManager::setBitLevelToMeshset
MoFEMErrorCode setBitLevelToMeshset(const EntityHandle meshset, const BitRefLevel bit, int verb=0) const
Definition: BitRefManager.cpp:473
MoFEM::BitRefManager::writeBitLevelByDim
MoFEMErrorCode writeBitLevelByDim(const BitRefLevel bit, const BitRefLevel mask, const int dim, const char *file_name, const char *file_type, const char *options, const bool check_for_empty=true) const
Write bit ref level to file.
Definition: BitRefManager.cpp:660
MoFEM::BitRefManager::BitRefManager
BitRefManager(const MoFEM::Core &core)
Definition: BitRefManager.cpp:16
MoFEM::BitRefManager::addToDatabaseBitRefLevelByDim
MoFEMErrorCode addToDatabaseBitRefLevelByDim(const int dim, const BitRefLevel bit, const BitRefLevel mask=BitRefLevel().set(), int verb=QUIET) const
Add entities which exist in MoAB database, and have set appropiate BitRef level tag,...
Definition: BitRefManager.cpp:463
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
convert.n
n
Definition: convert.py:82
MoFEM::BitRefManager::updateRangeByChildren
MoFEMErrorCode updateRangeByChildren(const Range &parent, Range &child, MoFEMTypes bh=MF_ZERO)
Update range by childrens.
Definition: BitRefManager.cpp:1144
MoFEM::UnknownInterface
base class for all interface classes
Definition: UnknownInterface.hpp:34
MoFEM::BitRefManager::updateRange
DEPRECATED MoFEMErrorCode updateRange(const Range &parent, Range &child, MoFEMTypes bh=MF_ZERO)
Definition: BitRefManager.hpp:598
Range
MF_ZERO
@ MF_ZERO
Definition: definitions.h:98
MoFEM::BitRefManager::get_th_RefBitLevel
Tag get_th_RefBitLevel() const
Definition: BitRefManager.hpp:709
MoFEM::BitRefManager::getAdjacencies
virtual MoFEMErrorCode getAdjacencies(const Problem *problem_ptr, const EntityHandle *from_entities, const int num_entities, const int to_dimension, Range &adj_entities, const int operation_type=moab::Interface::INTERSECT, const int verb=0) const
Get the adjacencies associated with a entity to entities of a specified dimension.
Definition: BitRefManager.cpp:977
MoFEM::BitRefManager::getAdjacenciesAny
virtual MoFEMErrorCode getAdjacenciesAny(const EntityHandle from_entity, const int to_dimension, Range &adj_entities) const
Get the adjacencies associated with a entity to entities of a specified dimension.
Definition: BitRefManager.cpp:951
MoFEM::BitRefManager::query_interface
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Definition: BitRefManager.cpp:9
MoFEM::BitRefManager::updateFieldMeshsetByEntitiesChildren
MoFEMErrorCode updateFieldMeshsetByEntitiesChildren(const BitRefLevel &child_bit, int verb=0)
update fields meshesets by child entities
Definition: BitRefManager.cpp:1065
MoFEM::BitRefManager::writeBitLevelByType
MoFEMErrorCode writeBitLevelByType(const BitRefLevel bit, const BitRefLevel mask, const EntityType type, const char *file_name, const char *file_type, const char *options, const bool check_for_empty=true) const
Write bit ref level to file.
Definition: BitRefManager.cpp:682
MoFEM::BitRefManager::setNthBitRefLevel
MoFEMErrorCode setNthBitRefLevel(const Range &ents, const int n, const bool b, int verb=QUIET) const
Set nth bit ref level.
Definition: BitRefManager.cpp:579
MoFEM::BitRefManager::getAdjacenciesEquality
virtual MoFEMErrorCode getAdjacenciesEquality(const EntityHandle from_entity, const int to_dimension, Range &adj_entities) const
Get the adjacencies associated with a entity to entities of a specified dimension.
Definition: BitRefManager.cpp:925
MoFEMTypes
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:97
MoFEM::BitRefManager
Managing BitRefLevels.
Definition: BitRefManager.hpp:21
MoFEM::Types::BitRefLevel
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
QUIET
@ QUIET
Definition: definitions.h:208
MoFEM::Problem
keeps basic data about problem
Definition: ProblemsMultiIndices.hpp:54
MoFEM::BitRefManager::writeEntitiesAllBitLevelsByType
MoFEMErrorCode writeEntitiesAllBitLevelsByType(const BitRefLevel mask, const EntityType type, const char *file_name, const char *file_type, const char *options)
Write all entities by bit levels and type.
Definition: BitRefManager.cpp:722
MoFEM::BitRefManager::getEntitiesByTypeAndRefLevel
MoFEMErrorCode getEntitiesByTypeAndRefLevel(const BitRefLevel bit, const BitRefLevel mask, const EntityType type, const EntityHandle meshset, int verb=0) const
add all ents from ref level given by bit to meshset
Definition: BitRefManager.cpp:734
fun
auto fun
Function to approximate.
Definition: dg_projection.cpp:36
MoFEM::BitRefManager::getAllEntitiesNotInDatabase
MoFEMErrorCode getAllEntitiesNotInDatabase(Range &ents) const
Get all entities not in database.
Definition: BitRefManager.cpp:898
MoFEM::BitRefManager::shiftRightBitRef
MoFEMErrorCode shiftRightBitRef(const int shift, const BitRefLevel mask=BitRefLevel().set(), int verb=DEFAULT_VERBOSITY, MoFEMTypes mf=MF_ZERO) const
right shift bit ref level
Definition: BitRefManager.cpp:603