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