From 1884d40051c18e559695d67e81c942f485902469 Mon Sep 17 00:00:00 2001 From: ageay Date: Wed, 7 Aug 2013 12:42:16 +0000 Subject: [PATCH] Addition of the 2 new unstructured mesh types. --- src/MEDCoupling/MEDCoupling1GTUMesh.cxx | 22 +++++++++++++++ src/MEDCoupling/MEDCoupling1GTUMesh.hxx | 19 ++++++++----- ...EDCouplingMeshFieldFactoryComponentClt.cxx | 27 +++++++++++++++++++ ...EDCouplingMeshFieldFactoryComponentClt.hxx | 4 +++ 4 files changed, 66 insertions(+), 6 deletions(-) diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx index 484ed7aea..02d38fd91 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx @@ -26,6 +26,10 @@ using namespace ParaMEDMEM; +MEDCoupling1GTUMesh::MEDCoupling1GTUMesh() +{ +} + MEDCoupling1GTUMesh::MEDCoupling1GTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm):_cm(&cm) { setName(name); @@ -465,6 +469,15 @@ MEDCoupling1SGTUMesh::MEDCoupling1SGTUMesh(const char *name, const INTERP_KERNEL { } +MEDCoupling1SGTUMesh::MEDCoupling1SGTUMesh() +{ +} + +MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::New() +{ + return new MEDCoupling1SGTUMesh; +} + MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception) { if(type==INTERP_KERNEL::NORM_ERROR) @@ -1682,6 +1695,11 @@ MEDCoupling1DGTUMesh *MEDCoupling1SGTUMesh::computeDualMesh2D() const throw(INTE //== +MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::New() +{ + return new MEDCoupling1DGTUMesh; +} + MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception) { if(type==INTERP_KERNEL::NORM_ERROR) @@ -1695,6 +1713,10 @@ MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::New(const char *name, INTERP_KERNEL: return new MEDCoupling1DGTUMesh(name,cm); } +MEDCoupling1DGTUMesh::MEDCoupling1DGTUMesh() +{ +} + MEDCoupling1DGTUMesh::MEDCoupling1DGTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm):MEDCoupling1GTUMesh(name,cm) { } diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.hxx b/src/MEDCoupling/MEDCoupling1GTUMesh.hxx index 690a2c37e..8a8cb16d4 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.hxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.hxx @@ -73,8 +73,9 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT virtual DataArrayInt *getNodalConnectivity() const throw(INTERP_KERNEL::Exception) = 0; MEDCOUPLING_EXPORT virtual void checkCoherencyOfConnectivity() const throw(INTERP_KERNEL::Exception) = 0; protected: - MEDCOUPLING_EXPORT MEDCoupling1GTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm); - MEDCOUPLING_EXPORT MEDCoupling1GTUMesh(const MEDCoupling1GTUMesh& other, bool recDeepCpy); + MEDCoupling1GTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm); + MEDCoupling1GTUMesh(const MEDCoupling1GTUMesh& other, bool recDeepCpy); + MEDCoupling1GTUMesh(); protected: const INTERP_KERNEL::CellModel *_cm; }; @@ -86,6 +87,8 @@ namespace ParaMEDMEM public: MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception); + //! useless constructor only for CORBA -> not swigged + MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New(); MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *clone(bool recDeepCpy) const; MEDCOUPLING_EXPORT MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception); // overload of TimeLabel and RefCountObject @@ -140,8 +143,9 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT MEDCoupling1GTUMesh *computeDualMesh() const throw(INTERP_KERNEL::Exception); private: - MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm); - MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh(const MEDCoupling1SGTUMesh& other, bool recDeepCpy); + MEDCoupling1SGTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm); + MEDCoupling1SGTUMesh(const MEDCoupling1SGTUMesh& other, bool recDeepCpy); + MEDCoupling1SGTUMesh(); private: void checkNonDynamicGeoType() const throw(INTERP_KERNEL::Exception); static MEDCoupling1SGTUMesh *Merge1SGTUMeshesLL(std::vector& a) throw(INTERP_KERNEL::Exception); @@ -160,6 +164,8 @@ namespace ParaMEDMEM public: MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New(const char *name, INTERP_KERNEL::NormalizedCellType type) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m) throw(INTERP_KERNEL::Exception); + //! useless constructor only for CORBA -> not swigged + MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New(); MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *clone(bool recDeepCpy) const; MEDCOUPLING_EXPORT MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception); // overload of TimeLabel and RefCountObject @@ -218,8 +224,9 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT static std::vector BuildAPolygonFromParts(const std::vector< std::vector >& parts) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception); private: - MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm); - MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh(const MEDCoupling1DGTUMesh& other, bool recDeepCpy); + MEDCoupling1DGTUMesh(const char *name, const INTERP_KERNEL::CellModel& cm); + MEDCoupling1DGTUMesh(const MEDCoupling1DGTUMesh& other, bool recDeepCpy); + MEDCoupling1DGTUMesh(); private: void checkDynamicGeoT2ype() const throw(INTERP_KERNEL::Exception); static MEDCoupling1DGTUMesh *Merge1DGTUMeshesLL(std::vector& a) throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponentClt.cxx b/src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponentClt.cxx index b75dab8d0..49cae918f 100644 --- a/src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponentClt.cxx +++ b/src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponentClt.cxx @@ -22,6 +22,9 @@ #include "MEDCouplingMeshFieldFactoryComponent.hxx" #include "MEDCouplingUMesh.hxx" #include "MEDCouplingUMeshClient.hxx" +#include "MEDCoupling1GTUMesh.hxx" +#include "MEDCoupling1SGTUMeshClient.hxx" +#include "MEDCoupling1DGTUMeshClient.hxx" #include "MEDCouplingExtrudedMesh.hxx" #include "MEDCouplingExtrudedMeshClient.hxx" #include "MEDCouplingCMesh.hxx" @@ -217,6 +220,30 @@ void SALOME_TEST::MEDCouplingCorbaServBasicsTestClt::checkCorbaFetchingCurveLine meshFromDistant->decrRef(); } +void SALOME_TEST::MEDCouplingCorbaServBasicsTestClt::checkCorbaFetching1SGTUMesh() +{ + SALOME_MED::MEDCoupling1SGTUMeshCorbaInterface_ptr meshPtr=_objC->get1SGTUMesh(); + ParaMEDMEM::MEDCoupling1SGTUMesh *meshFromDistant=ParaMEDMEM::MEDCoupling1SGTUMeshClient::New(meshPtr); + meshPtr->UnRegister(); + CORBA::release(meshPtr); + ParaMEDMEM::MEDCoupling1SGTUMesh *meshRef=SALOME_TEST::MEDCouplingCorbaServBasicsTest::build1SGTUMesh(); + CPPUNIT_ASSERT(meshFromDistant->isEqual(meshRef,1e-12)); + meshRef->decrRef(); + meshFromDistant->decrRef(); +} + +void SALOME_TEST::MEDCouplingCorbaServBasicsTestClt::checkCorbaFetching1DGTUMesh() +{ + SALOME_MED::MEDCoupling1DGTUMeshCorbaInterface_ptr meshPtr=_objC->get1DGTUMesh(); + ParaMEDMEM::MEDCoupling1DGTUMesh *meshFromDistant=ParaMEDMEM::MEDCoupling1DGTUMeshClient::New(meshPtr); + meshPtr->UnRegister(); + CORBA::release(meshPtr); + ParaMEDMEM::MEDCoupling1DGTUMesh *meshRef=SALOME_TEST::MEDCouplingCorbaServBasicsTest::build1DGTUMesh(); + CPPUNIT_ASSERT(meshFromDistant->isEqual(meshRef,1e-12)); + meshRef->decrRef(); + meshFromDistant->decrRef(); +} + void SALOME_TEST::MEDCouplingCorbaServBasicsTestClt::checkCorbaField2DNTFetching() { SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr fieldPtr=_objC->getFieldScalarOn2DNT(); diff --git a/src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponentClt.hxx b/src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponentClt.hxx index 775d812cf..59770bf64 100644 --- a/src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponentClt.hxx +++ b/src/MEDCouplingCorba/Test/MEDCouplingMeshFieldFactoryComponentClt.hxx @@ -53,6 +53,8 @@ namespace SALOME_TEST CPPUNIT_TEST( checkCorbaFetchingExtruded ); CPPUNIT_TEST( checkCorbaFetchingCMesh ); CPPUNIT_TEST( checkCorbaFetchingCurveLinearMesh ); + CPPUNIT_TEST( checkCorbaFetching1SGTUMesh ); + CPPUNIT_TEST( checkCorbaFetching1DGTUMesh ); CPPUNIT_TEST( checkCorbaField2DNTFetching ); CPPUNIT_TEST( checkCorbaField2DNTMultiFetching ); CPPUNIT_TEST( checkCorbaField2DNTMultiFetchingMT ); @@ -95,6 +97,8 @@ namespace SALOME_TEST void checkCorbaFetchingExtruded(); void checkCorbaFetchingCMesh(); void checkCorbaFetchingCurveLinearMesh(); + void checkCorbaFetching1SGTUMesh(); + void checkCorbaFetching1DGTUMesh(); void checkCorbaField2DNTFetching(); void checkCorbaField2DNTMultiFetching(); void checkCorbaField2DNTMultiFetchingMT(); -- 2.30.2