NEMoSys  0.63.0
A modular, extensible resource with robust automated mesh generation, mesh quality analysis, adaptive mesh refinement, and data transfer between arbitrary meshes.
NEM::NUCMESH::GroupData Class Referenceabstract

Class to hold the material/physical group of a geometry. More...

Detailed Description

Definition at line 92 of file NucMeshShapeData.H.

Public Member Functions

 GroupData (std::string groupName, SMDSAbs_ElementType type)
 
void setupAlgos (const TopoDS_Shape &shape, SMESH_Gen &generator, SMESH_Mesh &mesh, std::vector< std::unique_ptr< SMESH_Hypothesis >> &generatedHyps) const override
 Method that is called when a GeoManager instance tries to mesh shape. More...
 
virtual void updateGenerated (const TopoDS_Shape &shape, const TopTools_ListOfShape &generatedShapes, GeoManager &geoMetadata) const
 Method that is called when a geometry operation generates new shapes. More...
 
virtual void updateModified (const TopoDS_Shape &shape, const TopTools_ListOfShape &modifiedShapes, GeoManager &geoMetadata) const =0
 Method that is called when a geometry operation modifies shape. More...
 
virtual void updateDeleted (const TopoDS_Shape &shape, GeoManager &geoMetadata)
 Method that is called when geoMetadata removes shape. More...
 

Public Attributes

std::string groupName
 
SMDSAbs_ElementType type
 

Inherits NEM::NUCMESH::NucMeshShapeData.

Inherited by NEM::NUCMESH::CopyOverrideShapeData< QuadMeshSurface, GroupData >, NEM::NUCMESH::CopyOverrideShapeData< SideSetEdge, GroupData >, and NEM::NUCMESH::CopyOverrideShapeData< TriMeshSurface, GroupData >.

Constructor & Destructor Documentation

◆ GroupData()

NEM::NUCMESH::GroupData::GroupData ( std::string  groupName,
SMDSAbs_ElementType  type 
)
inline

Definition at line 94 of file NucMeshShapeData.H.

References mesh.

95  : groupName(std::move(groupName)), type(type) {}
SMDSAbs_ElementType type

Member Function Documentation

◆ setupAlgos()

void NEM::NUCMESH::GroupData::setupAlgos ( const TopoDS_Shape &  shape,
SMESH_Gen &  generator,
SMESH_Mesh &  mesh,
std::vector< std::unique_ptr< SMESH_Hypothesis >> &  generatedHyps 
) const
overridevirtual

Default implementation does nothing

Parameters
[in]shapeShape to mesh
[in,out]generatorGenerator that will mesh
[in,out]meshMesh that will mesh
[out]generatedHypsOutput list of created hypotheses/algorithms (for memory management; will be deleted when the GeoManager instance is deleted)

Reimplemented from NEM::NUCMESH::NucMeshShapeData.

Reimplemented in NEM::NUCMESH::QuadMeshSurface, NEM::NUCMESH::TriMeshSurface, NEM::NUCMESH::EdgeSegments, and NEM::NUCMESH::SideSetEdge.

Definition at line 56 of file NucMeshShapeData.C.

References NEM::MSH::containerWrapper(), groupName, and type.

Referenced by NEM::NUCMESH::SideSetEdge::setupAlgos(), NEM::NUCMESH::TriMeshSurface::setupAlgos(), and NEM::NUCMESH::QuadMeshSurface::setupAlgos().

58  {
59  if (!groupName.empty()) {
60  bool addedToGroup = false;
61  int oldGroup = -1;
62  bool removeOldGroup = false;
63  for (auto group : NEM::MSH::containerWrapper(mesh.GetGroups())) {
64  auto groupDS = group->GetGroupDS();
65  if (groupName == group->GetName() && groupDS &&
66  type == group->GetGroupDS()->GetType()) {
67  if (auto otherGeomGroup =
68  dynamic_cast<SMESHDS_GroupOnGeom *>(groupDS)) {
69  auto otherPred = boost::make_shared<SMESH::Controls::BelongToGeom>();
70  otherPred->SetGeom(otherGeomGroup->GetShape());
71  otherPred->SetType(type);
72  auto thisPred = boost::make_shared<SMESH::Controls::BelongToGeom>();
73  thisPred->SetGeom(shape);
74  thisPred->SetType(type);
75  auto disjunction = boost::make_shared<SMESH::Controls::LogicalOR>();
76  disjunction->SetPredicate1(otherPred);
77  disjunction->SetPredicate2(thisPred);
78  mesh.AddGroup(type, groupName.c_str(), -1, TopoDS_Shape{},
79  disjunction);
80  addedToGroup = true;
81  oldGroup = group->GetID();
82  removeOldGroup = true;
83  break;
84  } else if (auto otherFilterGroup =
85  dynamic_cast<SMESHDS_GroupOnFilter *>(groupDS)) {
86  auto otherPred = otherFilterGroup->GetPredicate();
87  auto thisPred = boost::make_shared<SMESH::Controls::BelongToGeom>();
88  thisPred->SetGeom(shape);
89  thisPred->SetType(type);
90  auto disjunction = boost::make_shared<SMESH::Controls::LogicalOR>();
91  disjunction->SetPredicate1(otherPred);
92  disjunction->SetPredicate2(thisPred);
93  otherFilterGroup->SetPredicate(disjunction);
94  addedToGroup = true;
95  break;
96  }
97  }
98  }
99  if (!addedToGroup) { mesh.AddGroup(type, groupName.c_str(), -1, shape); }
100  if (removeOldGroup && oldGroup >= 0) { mesh.RemoveGroup(oldGroup); }
101  }
102 }
SMDSAbs_ElementType type
std::shared_ptr< meshBase > mesh
SM_StdContainerWrapperFromIter< typename std::decay< PtrSMDSIterator >::type, VALUE, EqualVALUE > containerWrapper(PtrSMDSIterator &&iter)
Definition: smeshUtils.H:57

◆ updateDeleted()

virtual void NEM::GEO::ShapeData::updateDeleted ( const TopoDS_Shape &  shape,
GeoManager geoMetadata 
)
inlinevirtualinherited

Default implementation does nothing

Parameters
[in]shapeShape to be removed
[in,out]geoMetadataGeometry-to-data map to alter

Definition at line 83 of file ShapeData.H.

84  {};

◆ updateGenerated()

virtual void NEM::GEO::ShapeData::updateGenerated ( const TopoDS_Shape &  shape,
const TopTools_ListOfShape generatedShapes,
GeoManager geoMetadata 
) const
inlinevirtualinherited

Default implementation does nothing

Parameters
[in]shapeArgument to operation; shape existing in geoMetadata
[in]generatedShapesShapes provided by a call to op.Generated(shape) for some geometry operation
[in,out]geoMetadataGeometry-to-data map to alter

Definition at line 62 of file ShapeData.H.

64  {};

◆ updateModified()

virtual void NEM::GEO::ShapeData::updateModified ( const TopoDS_Shape &  shape,
const TopTools_ListOfShape modifiedShapes,
GeoManager geoMetadata 
) const
pure virtualinherited
Parameters
[in]shapeArgument to operation; shape existing in geoMetadata
[in]modifiedShapesShapes provided by a call to op.Modified(shape) for some geometry operation
[in,out]geoMetadataGeometry-to-data map to alter

Implemented in NEM::NUCMESH::CopyOverrideShapeData< SideSetEdge, GroupData >, NEM::NUCMESH::CopyOverrideShapeData< TriMeshSurface, GroupData >, NEM::NUCMESH::CopyOverrideShapeData< EdgeSegments, SideSetEdge >, and NEM::NUCMESH::CopyOverrideShapeData< QuadMeshSurface, GroupData >.

Member Data Documentation

◆ groupName

std::string NEM::NUCMESH::GroupData::groupName

Definition at line 102 of file NucMeshShapeData.H.

Referenced by setupAlgos().

◆ type

SMDSAbs_ElementType NEM::NUCMESH::GroupData::type

Definition at line 103 of file NucMeshShapeData.H.

Referenced by setupAlgos().


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