Further corrections

This commit is contained in:
Yoann Audouin 2022-11-09 09:18:34 +01:00
parent 57c1f8af17
commit a39871a637
9 changed files with 32 additions and 27 deletions

View 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

View File

@ -30,16 +30,18 @@
#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

View 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);

View File

@ -30,10 +30,11 @@
#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
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

View 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

View 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;};

View File

@ -26,10 +26,11 @@
//
#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();

View 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);
}

View 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