-// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "NETGENPlugin_Hypothesis.hxx"
-// TODO: remove use of netgen_param
-#include "NETGENPlugin_DriverParam.hxx"
-
#include <SMDS_MeshElement.hxx>
#include <SMDS_MeshNode.hxx>
#include <SMESHDS_Mesh.hxx>
*/
//=============================================================================
+
/**
- * @brief Get an iterator on the Surface element with their orientation
+ * @brief Compute the list of already meshed Surface elements and info
+ * on their orientation and if they are internal
*
+ * @param aMesh Global Mesh
+ * @param aShape Shape associated to the mesh
+ * @param proxyMesh pointer to mesh used fo find the elements
+ * @param internals information on internal sub shapes
+ * @param helper helper associated to the mesh
+ * @param listElements map of surface element associated with
+ * their orientation and internal status
+ * @return true if their was some error
*/
-
bool NETGENPlugin_NETGEN_3D::getSurfaceElements(
SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
SMESH_ProxyMesh::Ptr proxyMesh,
NETGENPlugin_Internals &internals,
SMESH_MesherHelper &helper,
- std::map<const SMDS_MeshElement*, tuple<bool, bool>>& listElements
+ std::map<const SMDS_MeshElement*, tuple<bool, bool>, TIDCompare>& listElements
)
{
SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
return false;
}
+/**
+ * @brief Part of Compute: adding already meshed elements
+ * into netgen structure
+ *
+ * @param aMesh Global mesh
+ * @param aShape Shape associated with the mesh
+ * @param nodeVec Mapping between nodes mesh id and netgen structure id
+ * @param ngLib Wrapper on netgen lib
+ * @param helper helper assocaited to the mesh
+ * @param Netgen_NbOfNodes Number of nodes in netge structure
+ * @return true if there was some error
+ */
bool NETGENPlugin_NETGEN_3D::computeFillNgMesh(
SMESH_Mesh& aMesh,
SMESH::Controls::TSequenceOfXYZ nodesCoords;
// maps nodes to ng ID
+ // map must be sorted by ID to ensure that we will have the same number of
+ // 3D element if we recompute
typedef map< const SMDS_MeshNode*, int, TIDCompare > TNodeToIDMap;
typedef TNodeToIDMap::value_type TN2ID;
TNodeToIDMap nodeToNetgenID;
proxyMesh.reset( Adaptor );
}
- std::map<const SMDS_MeshElement*, tuple<bool, bool>> listElements;
+ // map must be sorted by ID to ensure that we will have the same number of
+ // 3D element if we recompute
+ std::map<const SMDS_MeshElement*, tuple<bool, bool>, TIDCompare> listElements;
bool ret = getSurfaceElements(aMesh, aShape, proxyMesh, internals, helper, listElements);
if(ret)
return ret;
return false;
}
+/**
+ * @brief Part of Compute: Setting the netgen parameters from the Hypothesis
+ *
+ * @param aMesh Global mesh
+ * @param ngLib Wrapper on netgen lib
+ * @param occgeo Mapping between nodes mesh id and netgen structure id
+ * @param helper helper assocaited to the mesh
+ * @param endWith end step of netgen
+ * @return true if there was some error
+ */
bool NETGENPlugin_NETGEN_3D::computePrepareParam(
SMESH_Mesh& aMesh,
NETGENPlugin_NetgenLibWrapper &ngLib,
return false;
}
+/**
+ * @brief Part of Compute: call to the netgen mesher
+ *
+ * @param occgeo netgen geometry structure
+ * @param nodeVec Mapping between nodes mesh id and netgen structure id
+ * @param ngMesh netgen mesh structure
+ * @param ngLib Wrapper on netgen lib
+ * @param startWith starting step of netgen
+ * @param endWith end step of netgen
+ * @return true if there was some error
+ */
bool NETGENPlugin_NETGEN_3D::computeRunMesher(
netgen::OCCGeometry &occgeo,
vector< const SMDS_MeshNode* > &nodeVec,
return false;
}
+/**
+ * @brief Part of Compute: Adding new element created by mesher to SMESH_Mesh
+ *
+ * @param nodeVec Mapping between nodes mesh id and netgen structure id
+ * @param ngLib Wrapper on netgen lib
+ * @param helper tool associated to the mesh to add element
+ * @param Netgen_NbOfNodes Number of nodes in netgen structure
+ * @return true if there was some error
+ */
bool NETGENPlugin_NETGEN_3D::computeFillMesh(
vector< const SMDS_MeshNode* > &nodeVec,
NETGENPlugin_NetgenLibWrapper &ngLib,
return false;
}
+
+/**
+ * @brief Compute mesh associate to shape
+ *
+ * @param aMesh The mesh
+ * @param aShape The shape
+ * @return true fi there are some error
+ */
bool NETGENPlugin_NETGEN_3D::Compute(
SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape)