v0.14.0
Public Member Functions | Public Attributes | List of all members
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 }

◆ 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 }

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:
MoFEM::MeshRefinement::SetParent::parentsToChange
map< EntityHandle, EntityHandle > parentsToChange
Definition: MeshRefinement.hpp:182
MoFEM::RefEntity_multiIndex
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
Definition: RefEntsMultiIndices.hpp:760
MoFEM::MeshRefinement::cOre
MoFEM::Core & cOre
Definition: MeshRefinement.hpp:31
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
MoFEM::CoreTmp< 0 >::get_th_RefParentHandle
Tag get_th_RefParentHandle() const
Definition: Core.hpp:197
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359