v0.15.0
Loading...
Searching...
No Matches
MoFEM::MeshRefinement::SetParent Struct Reference
Collaboration diagram for MoFEM::MeshRefinement::SetParent:
[legend]

Public Member Functions

MoFEMErrorCode operator() (const EntityHandle ent, const EntityHandle parent, const RefEntity_multiIndex *ref_ents_ptr, MoFEM::Core &cOre)
 
MoFEMErrorCode operator() (const RefEntity_multiIndex *ref_ents_ptr)
 

Public Attributes

map< EntityHandle, EntityHandleparentsToChange
 

Detailed Description

Definition at line 181 of file MeshRefinement.hpp.

Member Function Documentation

◆ operator()() [1/2]

MoFEMErrorCode MoFEM::MeshRefinement::SetParent::operator() ( const EntityHandle ent,
const EntityHandle parent,
const RefEntity_multiIndex * ref_ents_ptr,
MoFEM::Core & cOre )

Definition at line 209 of file MeshRefinement.cpp.

211 {
212 MoFEM::Interface &m_field = cOre;
214 auto it = ref_ents_ptr->find(ent);
215 if (it != ref_ents_ptr->end()) {
216 if (it->get()->getParentEnt() != parent && ent != parent) {
217 parentsToChange[ent] = parent;
218 }
219 } else {
220 if (ent != parent) {
221 CHKERR m_field.get_moab().tag_set_data(cOre.get_th_RefParentHandle(),
222 &ent, 1, &parent);
223 }
224 }
226}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
virtual moab::Interface & get_moab()=0
Tag get_th_RefParentHandle() const
Definition Core.hpp:197
Deprecated interface functions.
map< EntityHandle, EntityHandle > parentsToChange

◆ operator()() [2/2]

MoFEMErrorCode MoFEM::MeshRefinement::SetParent::operator() ( const RefEntity_multiIndex * ref_ents_ptr)

Definition at line 228 of file MeshRefinement.cpp.

229 {
231 for (auto mit = parentsToChange.begin(); mit != parentsToChange.end();
232 ++mit) {
233 auto it = ref_ents_ptr->find(mit->first);
234 bool success = const_cast<RefEntity_multiIndex *>(ref_ents_ptr)
235 ->modify(it, RefEntity_change_parent(mit->second));
236 if (!success) {
237 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
238 "impossible to set parent");
239 }
240 }
242}
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, ordered_non_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > > >, ordered_non_unique< tag< Composite_ParentEnt_And_EntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > > RefEntity_multiIndex

Member Data Documentation

◆ parentsToChange

map<EntityHandle, EntityHandle> MoFEM::MeshRefinement::SetParent::parentsToChange

Definition at line 182 of file MeshRefinement.hpp.


The documentation for this struct was generated from the following files: