X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSMESH%2FSMESH_Gen.cxx;h=65e59d98dfdb38e53223261b42b0937910621293;hb=HEAD;hp=f5bff50586aeb53f7ce890c0fba4c79e5857f2e4;hpb=93edbb3a29c3e3e3965fa07bf5aaf71cdd541883;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index f5bff5058..8b042cf00 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -301,6 +301,7 @@ const std::function(aMesh); // Calling run_mesher // Path to mesher script @@ -351,6 +352,7 @@ void SMESH_Gen::send_mesh(SMESH_Mesh& aMesh, std::string file_name) msg += cmd + "\n"; throw SALOME_Exception(msg); } +#endif } //============================================================================= @@ -392,7 +394,7 @@ bool SMESH_Gen::parallelComputeSubMeshes( // do not mesh vertices of a pseudo shape const TopoDS_Shape& shape = smToCompute->GetSubShape(); const TopAbs_ShapeEnum shapeType = shape.ShapeType(); - // Not doing in parallel 1D and 2D meshes + // Not doing in parallel 1D meshes if ( !aMesh.HasShapeToMesh() && shapeType == TopAbs_VERTEX ) continue; @@ -400,22 +402,10 @@ bool SMESH_Gen::parallelComputeSubMeshes( // Waiting for all threads for the previous type to end aMesh.wait(); - std::string file_name; - switch(previousShapeType){ - case TopAbs_FACE: - file_name = "Mesh2D.med"; - break; - //case TopAbs_EDGE: - // file_name = "Mesh1D.med"; - // break; - //case TopAbs_VERTEX: - // file_name = "Mesh0D.med"; - // break; - case TopAbs_SOLID: - default: - file_name = ""; - break; - } + std::string file_name=""; + if (previousShapeType == aParMesh.GetDumpElement()) + file_name = "Mesh"+std::to_string(aParMesh.GetParallelismDimension()-1)+"D.med"; + if(file_name != "") { fs::path mesh_file = fs::path(aParMesh.GetTmpFolder()) / fs::path(file_name); @@ -437,7 +427,7 @@ bool SMESH_Gen::parallelComputeSubMeshes( continue; } // Parallelism is only for 3D parts - if(shapeType!=TopAbs_SOLID){ + if(shapeType!=aMesh.GetParallelElement()){ compute_function(smToCompute, computeEvent, shapeSM, aShapeOnly, allowedSubShapes, aShapesId); @@ -453,6 +443,9 @@ bool SMESH_Gen::parallelComputeSubMeshes( aMesh.GetMeshDS()->Modified(); + // Cleanup done here as in Python the destructor is not called + aParMesh.cleanup(); + return ret; #endif };