//================================================================================
/*!
- * \brief Restrict size of elements on the given edge
+ * \brief Restrict size of elements on the given edge
*/
//================================================================================
_fineness = NETGENPlugin_Hypothesis::GetDefaultFineness();
mparams.uselocalh = NETGENPlugin_Hypothesis::GetDefaultSurfaceCurvature();
netgen::merge_solids = NETGENPlugin_Hypothesis::GetDefaultFuseEdges();
+ // Unused argument but set 0 to initialise it
+ mparams.elementorder = 0;
#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;
}
-
#endif
}
+
//=============================================================================
/*!
* Pass parameters to NETGEN
#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();
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 )
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 )
* \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
*/
//================================================================================
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() )
// vector of nodes in which node index == netgen ID
vector< const SMDS_MeshNode* > nodeVec;
-
+
{
// ----------------
// compute 1D mesh
const int hugeNb = std::numeric_limits<int>::max() / 100;
// ----------------
- // evaluate 1D
+ // evaluate 1D
// ----------------
// pass 1D simple parameters to NETGEN
if ( _simpleHyp )
return false;
// ----------------
- // evaluate 2D
+ // evaluate 2D
// ----------------
if ( _simpleHyp ) {
if ( double area = _simpleHyp->GetMaxElementArea() ) {
}
else if ( strncmp( file, "Intersecting: ", 14 ) == 0 )
{
-// Intersecting:
+// Intersecting:
// openelement 18 with open element 126
-// 41 36 38
+// 41 36 38
// 69 70 72
file.getLine();
const char* pos = file;
#else //////// V 5
PointIndex pi;
- for (pi = PointIndex::BASE;
+ for (pi = PointIndex::BASE;
pi < ngMesh->GetNP()+PointIndex::BASE; pi++)
{
outfile << "mesh.AddNode( ";
_ngcerr = NULL;
if ( !getenv( "KEEP_NETGEN_OUTPUT" ))
{
- // redirect all netgen output (mycout,myerr,cout) to _outputFileName
- _outputFileName = getOutputFileName();
- _ngcout = netgen::mycout;
- _ngcerr = netgen::myerr;
- netgen::mycout = new ofstream ( _outputFileName.c_str() );
- netgen::myerr = netgen::mycout;
- _coutBuffer = std::cout.rdbuf();
-#ifdef _DEBUG_
- std::cout << "NOTE: netgen output is redirected to file " << _outputFileName << std::endl;
-#else
- std::cout.rdbuf( netgen::mycout->rdbuf() );
-#endif
+ setOutputFile(getOutputFileName());
}
setMesh( Ng_NewMesh() );
if ( !ngMesh )
ngMesh = new netgen::Mesh;
+ // To dump mparam
+ // netgen::mparam.Print(std::cerr);
+
#ifdef NETGEN_V6
ngMesh->SetGeometry( shared_ptr<netgen::NetgenGeometry>( &occgeo, &NOOP_Deleter ));
return aGenericName.ToCString();
}
+//================================================================================
+/*!
+ * \brief Set output file name for netgen log
+ */
+//================================================================================
+
+void NETGENPlugin_NetgenLibWrapper::setOutputFile(std::string outputfile)
+{
+ // redirect all netgen output (mycout,myerr,cout) to _outputFileName
+ _outputFileName = outputfile;
+ _ngcout = netgen::mycout;
+ _ngcerr = netgen::myerr;
+ netgen::mycout = new ofstream ( _outputFileName.c_str() );
+ netgen::myerr = netgen::mycout;
+ _coutBuffer = std::cout.rdbuf();
+#ifdef _DEBUG_
+ std::cout << "NOTE: netgen output is redirected to file " << _outputFileName << std::endl;
+#else
+ std::cout.rdbuf( netgen::mycout->rdbuf() );
+#endif
+}
//================================================================================
/*!