Salome HOME
projects
/
plugins
/
netgenplugin.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding nnthreads as parameter for netgen
[plugins/netgenplugin.git]
/
src
/
NETGENPlugin
/
NETGENPlugin_Mesher.cxx
diff --git
a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx
b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx
index c407073210f477dae284da63d3411830434a589c..615c970fea997620e02ea70b6410ee34289539e3 100644
(file)
--- a/
src/NETGENPlugin/NETGENPlugin_Mesher.cxx
+++ b/
src/NETGENPlugin/NETGENPlugin_Mesher.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-202
1
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-202
2
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
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-380,7
+380,7
@@
namespace
//================================================================================
/*!
//================================================================================
/*!
- * \brief Restrict size of elements on the given edge
+ * \brief Restrict size of elements on the given edge
*/
//================================================================================
*/
//================================================================================
@@
-602,14
+602,13
@@
void NETGENPlugin_Mesher::SetDefaultParameters()
#ifdef NETGEN_V6
#ifdef NETGEN_V6
- mparams.nthreads =
std::thread::hardware_concurrency
();
+ mparams.nthreads =
NETGENPlugin_Hypothesis::GetDefaultNbThreads
();
if ( getenv( "SALOME_NETGEN_DISABLE_MULTITHREADING" ))
{
mparams.nthreads = 1;
mparams.parallel_meshing = false;
}
if ( getenv( "SALOME_NETGEN_DISABLE_MULTITHREADING" ))
{
mparams.nthreads = 1;
mparams.parallel_meshing = false;
}
-
#endif
}
#endif
}
@@
-655,6
+654,7
@@
void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_Hypothesis* hyp)
#ifdef NETGEN_V6
// std::string
mparams.meshsizefilename = hyp->GetMeshSizeFile();
#ifdef NETGEN_V6
// std::string
mparams.meshsizefilename = hyp->GetMeshSizeFile();
+ mparams.nthreads = hyp->GetNbThreads();
#else
// const char*
mparams.meshsizefilename= hyp->GetMeshSizeFile().empty() ? 0 : hyp->GetMeshSizeFile().c_str();
#else
// const char*
mparams.meshsizefilename= hyp->GetMeshSizeFile().empty() ? 0 : hyp->GetMeshSizeFile().c_str();
@@
-1575,7
+1575,7
@@
void NETGENPlugin_Mesher::FixIntFaces(const netgen::OCCGeometry& occgeom,
NETGENPlugin_Internals& internalShapes)
{
SMESHDS_Mesh* meshDS = internalShapes.getMesh().GetMeshDS();
NETGENPlugin_Internals& internalShapes)
{
SMESHDS_Mesh* meshDS = internalShapes.getMesh().GetMeshDS();
-
+
// find ng indices of internal faces
set<int> ngFaceIds;
for ( int ngFaceID = 1; ngFaceID <= occgeom.fmap.Extent(); ++ngFaceID )
// find ng indices of internal faces
set<int> ngFaceIds;
for ( int ngFaceID = 1; ngFaceID <= occgeom.fmap.Extent(); ++ngFaceID )
@@
-1735,7
+1735,7
@@
namespace
double dist3D = surf->Value( uv1.X(), uv1.Y() ).Distance( surf->Value( uv2.X(), uv2.Y() ));
if ( stopHandler == 0 ) // stop recursion
return dist3D;
double dist3D = surf->Value( uv1.X(), uv1.Y() ).Distance( surf->Value( uv2.X(), uv2.Y() ));
if ( stopHandler == 0 ) // stop recursion
return dist3D;
-
+
// start recursion if necessary
double dist2D = SMESH_MesherHelper::ApplyIn2D(surf, uv1, uv2, gp_XY_Subtracted, 0).Modulus();
if ( fabs( dist3D - dist2D ) < dist2D * 1e-10 )
// start recursion if necessary
double dist2D = SMESH_MesherHelper::ApplyIn2D(surf, uv1, uv2, gp_XY_Subtracted, 0).Modulus();
if ( fabs( dist3D - dist2D ) < dist2D * 1e-10 )
@@
-2205,7
+2205,7
@@
void NETGENPlugin_Mesher::AddIntVerticesInSolids(const netgen::OCCGeometry&
* \param wires - data of nodes on FACE boundary
* \param helper - mesher helper holding the FACE
* \param nodeVec - vector of nodes in which node index == netgen ID
* \param wires - data of nodes on FACE boundary
* \param helper - mesher helper holding the FACE
* \param nodeVec - vector of nodes in which node index == netgen ID
- * \retval SMESH_ComputeErrorPtr - error description
+ * \retval SMESH_ComputeErrorPtr - error description
*/
//================================================================================
*/
//================================================================================
@@
-2712,7
+2712,7
@@
int NETGENPlugin_Mesher::FillSMesh(const netgen::OCCGeometry& occgeo,
for ( int i = 1; i <= nbVol; ++i )
{
for ( int i = 1; i <= nbVol; ++i )
{
- const netgen::Element& elem = ngMesh.VolumeElement(i);
+ const netgen::Element& elem = ngMesh.VolumeElement(i);
int aSolidInd = elem.GetIndex();
TopoDS_Solid aSolid;
if ( aSolidInd > 0 && aSolidInd <= occgeo.somap.Extent() )
int aSolidInd = elem.GetIndex();
TopoDS_Solid aSolid;
if ( aSolidInd > 0 && aSolidInd <= occgeo.somap.Extent() )
@@
-2905,7
+2905,7
@@
bool NETGENPlugin_Mesher::Compute()
// vector of nodes in which node index == netgen ID
vector< const SMDS_MeshNode* > nodeVec;
// vector of nodes in which node index == netgen ID
vector< const SMDS_MeshNode* > nodeVec;
-
+
{
// ----------------
// compute 1D mesh
{
// ----------------
// compute 1D mesh
@@
-3511,7
+3511,7
@@
bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
const int hugeNb = std::numeric_limits<int>::max() / 100;
// ----------------
const int hugeNb = std::numeric_limits<int>::max() / 100;
// ----------------
- // evaluate 1D
+ // evaluate 1D
// ----------------
// pass 1D simple parameters to NETGEN
if ( _simpleHyp )
// ----------------
// pass 1D simple parameters to NETGEN
if ( _simpleHyp )
@@
-3618,7
+3618,7
@@
bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
return false;
// ----------------
return false;
// ----------------
- // evaluate 2D
+ // evaluate 2D
// ----------------
if ( _simpleHyp ) {
if ( double area = _simpleHyp->GetMaxElementArea() ) {
// ----------------
if ( _simpleHyp ) {
if ( double area = _simpleHyp->GetMaxElementArea() ) {
@@
-3820,9
+3820,9
@@
NETGENPlugin_Mesher::ReadErrors(const vector<const SMDS_MeshNode* >& nodeVec)
}
else if ( strncmp( file, "Intersecting: ", 14 ) == 0 )
{
}
else if ( strncmp( file, "Intersecting: ", 14 ) == 0 )
{
-// Intersecting:
+// Intersecting:
// openelement 18 with open element 126
// openelement 18 with open element 126
-// 41 36 38
+// 41 36 38
// 69 70 72
file.getLine();
const char* pos = file;
// 69 70 72
file.getLine();
const char* pos = file;
@@
-3939,7
+3939,7
@@
void NETGENPlugin_Mesher::toPython( const netgen::Mesh* ngMesh )
#else //////// V 5
PointIndex pi;
#else //////// V 5
PointIndex pi;
- for (pi = PointIndex::BASE;
+ for (pi = PointIndex::BASE;
pi < ngMesh->GetNP()+PointIndex::BASE; pi++)
{
outfile << "mesh.AddNode( ";
pi < ngMesh->GetNP()+PointIndex::BASE; pi++)
{
outfile << "mesh.AddNode( ";