]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Further corrections yan/parallel_mesh3
authorYoann Audouin <yoann.audouin@edf.fr>
Wed, 9 Nov 2022 08:18:34 +0000 (09:18 +0100)
committerYoann Audouin <yoann.audouin@edf.fr>
Wed, 9 Nov 2022 08:18:34 +0000 (09:18 +0100)
src/SMESH/SMESH_DriverMesh.cxx
src/SMESH/SMESH_DriverMesh.hxx
src/SMESH/SMESH_DriverShape.cxx
src/SMESH/SMESH_DriverShape.hxx
src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_Mesh.hxx
src/SMESH/SMESH_MeshLocker.hxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_I/SMESH_Mesh_i.hxx

index 01cc5df4c53968d783fac0980cf6054cc1ce8c5c..60450141beef308742a3ba0ce36c171e4b819c73 100644 (file)
@@ -46,7 +46,7 @@ using namespace MEDCoupling;
  *
  * @return true if the mesh within the files are identical
  */
-bool diffMEDFile(const std::string mesh_file1, const std::string mesh_file2, const std::string mesh_name){
+bool SMESH_DriverMesh::diffMEDFile(const std::string mesh_file1, const std::string mesh_file2, const std::string mesh_name){
   MEDFileUMesh* medmesh1 = MEDFileUMesh::New(mesh_file1, mesh_name);
   MEDFileUMesh* medmesh2 = MEDFileUMesh::New(mesh_file2, mesh_name);
   MEDCouplingUMesh *m0_1=medmesh1->getMeshAtLevel(0,false);
@@ -70,7 +70,7 @@ std::string getMeshName(std::string mesh_file){
  *
  * @return error code
  */
-int importMesh(const std::string mesh_file, SMESH_Mesh& aMesh){
+int SMESH_DriverMesh::importMesh(const std::string mesh_file, SMESH_Mesh& aMesh){
   // TODO: change that as it depends on the language
   std::string mesh_name = getMeshName(mesh_file);
   MESSAGE("Importing mesh from " << mesh_file << " mesh " << mesh_name);
@@ -87,7 +87,8 @@ int importMesh(const std::string mesh_file, SMESH_Mesh& aMesh){
  *
  * @return error code
  */
-int exportMesh(const std::string mesh_file, SMESH_Mesh& aMesh, const std::string mesh_name){
+int SMESH_DriverMesh::exportMesh(const std::string mesh_file, SMESH_Mesh& aMesh, const std::string mesh_name){
 
   MESSAGE("Exporting mesh to " << mesh_file);
   aMesh.ExportMED(mesh_file.c_str(), // theFile
index 370f9951503d0477bd7806f7959f93a3a8cd07cd..83485aa8af2ccfb3349658703e8e06b73f697f93 100644 (file)
 
 #include <string>
 #include <cassert>
+#include "SMESH_SMESH.hxx"
 
 class SMESH_Mesh;
-
-bool diffMEDFile(const std::string mesh_file1,
-                   const std::string mesh_file2,
-                   const std::string mesh_name);
-int importMesh(const std::string mesh_file,
-                SMESH_Mesh& aMesh);
-int exportMesh(const std::string mesh_file,
-                SMESH_Mesh& aMesh,
-                const std::string meshName);
-
+class SMESH_EXPORT SMESH_DriverMesh{
+  public:
+    static bool diffMEDFile(const std::string mesh_file1,
+                            const std::string mesh_file2,
+                            const std::string mesh_name);
+    static int importMesh(const std::string mesh_file,
+                          SMESH_Mesh& aMesh);
+    static int exportMesh(const std::string mesh_file,
+                          SMESH_Mesh& aMesh,
+                          const std::string meshName);
+};
 #endif
index 678e2c8fd9bd9846b5fd580bac81478309e1ee41..8efa1943f16e0ff6139123260047676559063bf3 100644 (file)
@@ -147,7 +147,7 @@ int exportBREPShape(const std::string shape_file, const TopoDS_Shape& aShape){
  *
  * @return error code
  */
-int importShape(const std::string shape_file, TopoDS_Shape& aShape){
+int SMESH_DriverShape::importShape(const std::string shape_file, TopoDS_Shape& aShape){
 #ifndef WIN32
   std::string type = fs::path(shape_file).extension().string();
   boost::algorithm::to_lower(type);
@@ -171,7 +171,7 @@ int importShape(const std::string shape_file, TopoDS_Shape& aShape){
  *
  * @return error code
  */
-int exportShape(const std::string shape_file, const TopoDS_Shape& aShape){
+int SMESH_DriverShape::exportShape(const std::string shape_file, const TopoDS_Shape& aShape){
 #ifndef WIN32
   std::string type = fs::path(shape_file).extension().string();
   boost::algorithm::to_lower(type);
index b9e3a360ede74f78db30b6447dff5578ee66d128..1d55b70a8884f3eb2a23d63ef311ce47937e3032 100644 (file)
 
 #include <string>
 #include <cassert>
-
+#include "SMESH_SMESH.hxx"
 class TopoDS_Shape;
-
-int importShape(const std::string shape_file, TopoDS_Shape& aShape);
-int exportShape(const std::string shape_file, const TopoDS_Shape& aShape);
-
-#endif
\ No newline at end of file
+class SMESH_EXPORT SMESH_DriverShape{
+  public:
+    static int importShape(const std::string shape_file, TopoDS_Shape& aShape);
+    static int exportShape(const std::string shape_file, const TopoDS_Shape& aShape);
+};
+#endif
index 7a98988f9b68a8a60c463aec8f2f72d53551e9df..bd8098302799dd02da9a79d535955a57b4cef769 100644 (file)
@@ -340,7 +340,7 @@ bool SMESH_Gen::parallelComputeSubMeshes(
       if(file_name != "")
       {
         fs::path mesh_file = fs::path(aMesh.tmp_folder) / fs::path(file_name);
-        exportMesh(mesh_file.string(), aMesh, "MESH");
+       SMESH_DriverMesh::exportMesh(mesh_file.string(), aMesh, "MESH");
 
       }
       //Resetting threaded pool info
index 42e5b4c92cb75efa4e093bf17d374ac930efab8a..9c96064996fe21fe54f6e930fc65db21e0c6169d 100644 (file)
@@ -395,7 +395,7 @@ class SMESH_EXPORT SMESH_Mesh
   void Unlock() {};
 
   int GetNbThreads(){return _NbThreads;};
-  void SetNbThreads(int nbThreads){std::cout << "Warning Parallel Meshing is disabled on Windows it will behave as a slower normal compute" << std::endl;_NbThreads=nbThreads;};
+  void SetNbThreads(long nbThreads){std::cout << "Warning Parallel Meshing is disabled on Windows it will behave as a slower normal compute" << std::endl;_NbThreads=nbThreads;};
 
   void InitPoolThreads(){};
   void DeletePoolThreads(){};
@@ -407,7 +407,7 @@ class SMESH_EXPORT SMESH_Mesh
   void Unlock() {_my_lock.unlock();};
 
   int GetNbThreads(){return _NbThreads;};
-  void SetNbThreads(int nbThreads){_NbThreads=nbThreads;};
+  void SetNbThreads(long nbThreads){_NbThreads=nbThreads;};
 
   void InitPoolThreads(){_pool = new boost::asio::thread_pool(_NbThreads);};
   void DeletePoolThreads(){delete _pool;};
index e38c31b29e9e06be0ea758851737a3edc4051100..15b41190913fb10509fae318207d47105ad8f8d2 100644 (file)
 //
 #ifndef _SMESH_MESHLOCKER_HXX_
 #define _SMESH_MESHLOCKER_HXX_
+#include "SMESH_SMESH.hxx"
 
 class SMESH_Mesh;
 
-class SMESH_MeshLocker{
+class SMESH_EXPORT SMESH_MeshLocker{
 public:
   SMESH_MeshLocker(SMESH_Mesh * aMesh);
   ~SMESH_MeshLocker();
index 6212a0c23254037229bdc84aa1acea85b7c59363..1ff5efe534d98d3597e4d4d24636398d63930b0d 100644 (file)
@@ -7042,7 +7042,7 @@ TListOfListOfInt SMESH_Mesh_i::findConcurrentSubMeshes()
  * \brief Set the number of threads for a parallel computation
  */
 //=============================================================================
- void SMESH_Mesh_i::SetNbThreads(long nbThreads){
+void SMESH_Mesh_i::SetNbThreads(CORBA::Long nbThreads){
   _impl->SetNbThreads(nbThreads);
 }
 
index b694fdc46898077e40b66e7a0c8259021bfca2ed..45928272db5698acf20ae64909c9e07f0617850d 100644 (file)
@@ -673,7 +673,7 @@ private:
                         SMESH::submesh_array_array& theSubMeshOrder,
                         const bool                  theIsDump);
 
-  void SetNbThreads(long nbThreads);
+  void SetNbThreads(CORBA::Long nbThreads);
 
   /*!
    * \brief Finds concurrent sub-meshes