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::QuadMeshSurface Class Reference

Structured quad mesh (assuming edges meshed appropriately) or quad-dominant mesh. More...

Detailed Description

Definition at line 159 of file NucMeshShapeData.H.

Public Member Functions

 QuadMeshSurface (std::string groupName)
 
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...
 
void updateModified (const TopoDS_Shape &shape, const TopTools_ListOfShape &modifiedShapes, NEM::GEO::GeoManager &geoMetadata) const override
 
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 updateDeleted (const TopoDS_Shape &shape, GeoManager &geoMetadata)
 Method that is called when geoMetadata removes shape. More...
 

Public Attributes

std::string groupName
 
SMDSAbs_ElementType type
 

Protected Types

using CRTPBase = CopyOverrideShapeData< QuadMeshSurface, GroupData >
 

Inherits NEM::NUCMESH::CopyOverrideShapeData< QuadMeshSurface, GroupData >.

Member Typedef Documentation

◆ CRTPBase

Constructor & Destructor Documentation

◆ QuadMeshSurface()

NEM::NUCMESH::QuadMeshSurface::QuadMeshSurface ( std::string  groupName)
inlineexplicit

Definition at line 162 of file NucMeshShapeData.H.

References mesh.

163  : CRTPBase(std::move(groupName), SMDSAbs_Face) {}
CopyOverrideShapeData< QuadMeshSurface, GroupData > CRTPBase

Member Function Documentation

◆ setupAlgos()

void NEM::NUCMESH::QuadMeshSurface::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::GroupData.

Definition at line 147 of file NucMeshShapeData.C.

References NEM::NUCMESH::GroupData::setupAlgos().

149  {
150  this->GroupData::setupAlgos(shape, generator, mesh, generatedHyps);
151  int numEdges = 0;
152  for (TopExp_Explorer explorer{shape, TopAbs_EDGE}; explorer.More();
153  explorer.Next()) {
154  ++numEdges;
155  }
156  if (numEdges == 4) {
157  auto algId = generator.GetANewId();
158  auto alg = new StdMeshers_Quadrangle_2D{algId, &generator};
159  mesh.AddHypothesis(shape, algId);
160  generatedHyps.emplace_back(alg);
161  } else {
162 #ifdef HAVE_NGEN
163  auto algId = generator.GetANewId();
164  auto alg = new NETGENPlugin_NETGEN_2D_ONLY{algId, &generator};
165  mesh.AddHypothesis(shape, algId);
166  generatedHyps.emplace_back(alg);
167  auto hypId = generator.GetANewId();
168  auto hyp = new StdMeshers_QuadranglePreference{hypId, &generator};
169  mesh.AddHypothesis(shape, hypId);
170  generatedHyps.emplace_back(hyp);
171 #else
172  std::cerr << "Cannot generate quad-dominant mesh on general faces "
173  "without Netgen\n";
174 #endif
175  }
176 }
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.
std::shared_ptr< meshBase > mesh

◆ 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()

void NEM::NUCMESH::CopyOverrideShapeData< QuadMeshSurface , GroupData >::updateModified ( const TopoDS_Shape &  shape,
const TopTools_ListOfShape modifiedShapes,
NEM::GEO::GeoManager geoMetadata 
) const
inlineoverridevirtualinherited

Implements NEM::GEO::ShapeData.

Definition at line 75 of file NucMeshShapeData.H.

References NEM::GEO::GeoManager::getMap().

77  {
78  for (auto &modifiedShape : modifiedShapes) {
79  geoMetadata.getMap()[modifiedShape] =
80  std::shared_ptr<NEM::GEO::ShapeData>{
81  new T{*static_cast<const T *>(this)}};
82  }
83  }
MapType & getMap()
Definition: GeoManager.C:186

Member Data Documentation

◆ groupName

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

Definition at line 102 of file NucMeshShapeData.H.

Referenced by NEM::NUCMESH::GroupData::setupAlgos().

◆ type

SMDSAbs_ElementType NEM::NUCMESH::GroupData::type
inherited

Definition at line 103 of file NucMeshShapeData.H.

Referenced by NEM::NUCMESH::GroupData::setupAlgos().


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