Guard MEFISTO code with version check against SMESH.

This commit is contained in:
Alexander Neumann
2023-12-17 22:58:04 +01:00
committed by Chris Hennes
parent 71df82dad3
commit 2bf42925f5
7 changed files with 24 additions and 4 deletions

View File

@@ -103,7 +103,9 @@ PyMOD_INIT_FUNC(Fem)
Fem::StdMeshers_LayerDistributionPy ::init_type(femModule);
Fem::StdMeshers_LengthFromEdgesPy ::init_type(femModule);
Fem::StdMeshers_MaxElementVolumePy ::init_type(femModule);
#if SMESH_VERSION_MAJOR <= 9 && SMESH_VERSION_MINOR < 10
Fem::StdMeshers_MEFISTO_2DPy ::init_type(femModule);
#endif
Fem::StdMeshers_NumberOfLayersPy ::init_type(femModule);
Fem::StdMeshers_NumberOfSegmentsPy ::init_type(femModule);
Fem::StdMeshers_Prism_3DPy ::init_type(femModule);

View File

@@ -36,7 +36,9 @@
#include <StdMeshers_LayerDistribution.hxx>
#include <StdMeshers_LengthFromEdges.hxx>
#include <StdMeshers_LocalLength.hxx>
#if SMESH_VERSION_MAJOR <= 9 && SMESH_VERSION_MINOR < 10
#include <StdMeshers_MEFISTO_2D.hxx>
#endif
#include <StdMeshers_MaxElementArea.hxx>
#include <StdMeshers_MaxElementVolume.hxx>
#include <StdMeshers_MaxLength.hxx>
@@ -1161,7 +1163,7 @@ Py::Object StdMeshers_NumberOfLayersPy::getNumLayers(const Py::Tuple& args)
}
// ---------------------------------------------------------------------------
#if SMESH_VERSION_MAJOR <= 9 && SMESH_VERSION_MINOR < 10
void StdMeshers_MEFISTO_2DPy::init_type(PyObject* module)
{
behaviors().name("StdMeshers_MEFISTO_2D");
@@ -1178,7 +1180,7 @@ StdMeshers_MEFISTO_2DPy::StdMeshers_MEFISTO_2DPy(int hypId, int studyId, SMESH_G
: SMESH_HypothesisPyBase(new StdMeshers_MEFISTO_2D(hypId, studyId, gen))
{}
#endif
#endif
StdMeshers_MEFISTO_2DPy::~StdMeshers_MEFISTO_2DPy() = default;
// ---------------------------------------------------------------------------

View File

@@ -354,6 +354,7 @@ public:
Py::Object getNumLayers(const Py::Tuple& args);
};
#if SMESH_VERSION_MAJOR <= 9 && SMESH_VERSION_MINOR < 10
class StdMeshers_MEFISTO_2DPy: public SMESH_HypothesisPy<StdMeshers_MEFISTO_2DPy>
{
public:
@@ -361,6 +362,7 @@ public:
StdMeshers_MEFISTO_2DPy(int hypId, SMESH_Gen* gen);
~StdMeshers_MEFISTO_2DPy();
};
#endif
class StdMeshers_MaxElementVolumePy: public SMESH_HypothesisPy<StdMeshers_MaxElementVolumePy>
{
@@ -693,6 +695,7 @@ public:
Py::Object getNumLayers(const Py::Tuple& args);
};
#if SMESH_VERSION_MAJOR <= 9 && SMESH_VERSION_MINOR < 10
class StdMeshers_MEFISTO_2DPy: public SMESH_HypothesisPy<StdMeshers_MEFISTO_2DPy>
{
public:
@@ -700,6 +703,7 @@ public:
StdMeshers_MEFISTO_2DPy(int hypId, int studyId, SMESH_Gen* gen);
~StdMeshers_MEFISTO_2DPy() override;
};
#endif
class StdMeshers_MaxElementVolumePy: public SMESH_HypothesisPy<StdMeshers_MaxElementVolumePy>
{

View File

@@ -78,7 +78,9 @@
#include <StdMeshers_LayerDistribution.hxx>
#include <StdMeshers_LengthFromEdges.hxx>
#include <StdMeshers_LocalLength.hxx>
#if SMESH_VERSION_MAJOR <= 9 && SMESH_VERSION_MINOR < 10
#include <StdMeshers_MEFISTO_2D.hxx>
#endif
#include <StdMeshers_MaxElementArea.hxx>
#include <StdMeshers_MaxElementVolume.hxx>
#include <StdMeshers_MaxLength.hxx>

View File

@@ -1,5 +1,8 @@
if (BUILD_SMESH)
add_definitions(-DHAVE_SMESH -DHAVE_MEFISTO)
add_definitions(-DHAVE_SMESH)
if(SMESH_VERSION_MAJOR LESS_EQUAL 9 AND SMESH_VERSION_MINOR LESS 10 )
add_definitions(-DHAVE_MEFISTO)
endif()
endif(BUILD_SMESH)
if(BUILD_FEM_NETGEN)

View File

@@ -61,7 +61,9 @@
#include <StdMeshers_AutomaticLength.hxx>
#include <StdMeshers_Deflection1D.hxx>
#include <StdMeshers_LocalLength.hxx>
#if SMESH_VERSION_MAJOR <= 9 && SMESH_VERSION_MINOR < 10
#include <StdMeshers_MEFISTO_2D.hxx>
#endif
#include <StdMeshers_MaxElementArea.hxx>
#include <StdMeshers_NumberOfSegments.hxx>
#include <StdMeshers_QuadranglePreference.hxx>
@@ -409,6 +411,7 @@ Mesh::MeshObject* Mesher::createMesh() const
hypoth.push_back(alg2d);
} break;
#endif
#if SMESH_VERSION_MAJOR <= 9 && SMESH_VERSION_MINOR < 10
#if defined(HAVE_MEFISTO)
case Mefisto: {
if (maxLength > 0) {
@@ -499,6 +502,7 @@ Mesh::MeshObject* Mesher::createMesh() const
#endif
hypoth.push_back(alg2d);
} break;
#endif
#endif
default:
break;

View File

@@ -1,5 +1,8 @@
if (BUILD_SMESH)
add_definitions(-DHAVE_SMESH -DHAVE_MEFISTO)
add_definitions(-DHAVE_SMESH)
if(SMESH_VERSION_MAJOR LESS_EQUAL 9 AND SMESH_VERSION_MINOR LESS 10 )
add_definitions(-DHAVE_MEFISTO)
endif()
endif(BUILD_SMESH)
if(BUILD_FEM_NETGEN)