From 0ff31969cfbe10f068d452e2b7894bbacf443090 Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 1 Jul 2013 09:22:18 +0000 Subject: [PATCH] MED file mesh loading on demand. --- src/MEDLoader/MEDFileMesh.cxx | 22 +-- src/MEDLoader/MEDFileMesh.hxx | 13 +- src/MEDLoader/MEDFileMeshReadSelector.cxx | 34 ++++- src/MEDLoader/MEDFileMeshReadSelector.hxx | 6 + src/MEDLoader/Swig/MEDLoaderCommon.i | 8 +- src/MEDLoader/Swig/MEDLoaderTest3.py | 159 ++++++++++++++++++---- 6 files changed, 194 insertions(+), 48 deletions(-) diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index 0158c3cdb..50c3f3bf1 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -62,7 +62,7 @@ std::size_t MEDFileMesh::getHeapMemorySize() const * \throw If there is no meshes in the file. * \throw If the mesh in the file is of a not supported type. */ -MEDFileMesh *MEDFileMesh::New(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileMesh *MEDFileMesh::New(const char *fileName, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception) { std::vector ms=MEDLoader::GetMeshNames(fileName); if(ms.empty()) @@ -81,7 +81,7 @@ MEDFileMesh *MEDFileMesh::New(const char *fileName) throw(INTERP_KERNEL::Excepti case UNSTRUCTURED: { MEDCouplingAutoRefCountObjectPtr ret=MEDFileUMesh::New(); - ret->loadUMeshFromFile(fid,ms.front().c_str(),dt,it); + ret->loadUMeshFromFile(fid,ms.front().c_str(),dt,it,mrs); return (MEDFileUMesh *)ret.retn(); } case CARTESIAN: @@ -118,7 +118,7 @@ MEDFileMesh *MEDFileMesh::New(const char *fileName) throw(INTERP_KERNEL::Excepti * \throw If there is no mesh with given attributes in the file. * \throw If the mesh in the file is of a not supported type. */ -MEDFileMesh *MEDFileMesh::New(const char *fileName, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception) +MEDFileMesh *MEDFileMesh::New(const char *fileName, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception) { MEDFileUtilities::CheckFileForRead(fileName); ParaMEDMEM::MEDCouplingMeshType meshType; @@ -131,7 +131,7 @@ MEDFileMesh *MEDFileMesh::New(const char *fileName, const char *mName, int dt, i case UNSTRUCTURED: { MEDCouplingAutoRefCountObjectPtr ret=MEDFileUMesh::New(); - ret->loadUMeshFromFile(fid,mName,dt,it); + ret->loadUMeshFromFile(fid,mName,dt,it,mrs); return (MEDFileUMesh *)ret.retn(); } case CARTESIAN: @@ -1868,11 +1868,11 @@ void MEDFileMesh::getFamilyRepr(std::ostream& oss) const * \throw If there is no mesh with given attributes in the file. * \throw If the mesh in the file is not an unstructured one. */ -MEDFileUMesh *MEDFileUMesh::New(const char *fileName, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception) +MEDFileUMesh *MEDFileUMesh::New(const char *fileName, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception) { MEDFileUtilities::CheckFileForRead(fileName); MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY); - return new MEDFileUMesh(fid,mName,dt,it); + return new MEDFileUMesh(fid,mName,dt,it,mrs); } /*! @@ -1885,7 +1885,7 @@ MEDFileUMesh *MEDFileUMesh::New(const char *fileName, const char *mName, int dt, * \throw If there is no meshes in the file. * \throw If the mesh in the file is not an unstructured one. */ -MEDFileUMesh *MEDFileUMesh::New(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileUMesh *MEDFileUMesh::New(const char *fileName, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception) { std::vector ms=MEDLoader::GetMeshNames(fileName); if(ms.empty()) @@ -1899,7 +1899,7 @@ MEDFileUMesh *MEDFileUMesh::New(const char *fileName) throw(INTERP_KERNEL::Excep ParaMEDMEM::MEDCouplingMeshType meshType; std::string dummy2; MEDFileMeshL2::GetMeshIdFromName(fid,ms.front().c_str(),meshType,dt,it,dummy2); - return new MEDFileUMesh(fid,ms.front().c_str(),dt,it); + return new MEDFileUMesh(fid,ms.front().c_str(),dt,it,mrs); } /*! @@ -2103,17 +2103,17 @@ MEDFileUMesh::MEDFileUMesh() { } -MEDFileUMesh::MEDFileUMesh(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception) +MEDFileUMesh::MEDFileUMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception) try { - loadUMeshFromFile(fid,mName,dt,it); + loadUMeshFromFile(fid,mName,dt,it,mrs); } catch(INTERP_KERNEL::Exception& e) { throw e; } -void MEDFileUMesh::loadUMeshFromFile(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception) +void MEDFileUMesh::loadUMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception) { MEDFileUMeshL2 loaderl2; ParaMEDMEM::MEDCouplingMeshType meshType; diff --git a/src/MEDLoader/MEDFileMesh.hxx b/src/MEDLoader/MEDFileMesh.hxx index f17081e04..c501e45ad 100644 --- a/src/MEDLoader/MEDFileMesh.hxx +++ b/src/MEDLoader/MEDFileMesh.hxx @@ -24,6 +24,7 @@ #include "MEDLoaderDefines.hxx" #include "MEDFileMeshLL.hxx" #include "MEDFileUtilities.hxx" +#include "MEDFileMeshReadSelector.hxx" #include #include @@ -33,8 +34,8 @@ namespace ParaMEDMEM class MEDLOADER_EXPORT MEDFileMesh : public RefCountObject, public MEDFileWritable { public: - static MEDFileMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception); + static MEDFileMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); + static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySize() const; virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception) = 0; virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception) = 0; @@ -182,8 +183,8 @@ namespace ParaMEDMEM { friend class MEDFileMesh; public: - static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception); - static MEDFileUMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception); + static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); + static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); static MEDFileUMesh *New(); std::size_t getHeapMemorySize() const; MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception); @@ -254,8 +255,8 @@ namespace ParaMEDMEM private: void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception); MEDFileUMesh(); - MEDFileUMesh(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception); - void loadUMeshFromFile(med_idt fid, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception); + MEDFileUMesh(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception); + void loadUMeshFromFile(med_idt fid, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs) throw(INTERP_KERNEL::Exception); const MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception); MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception); void checkMeshDimCoherency(int meshDim, int meshDimRelToMax) const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/MEDFileMeshReadSelector.cxx b/src/MEDLoader/MEDFileMeshReadSelector.cxx index 945d02b16..5730901d7 100644 --- a/src/MEDLoader/MEDFileMeshReadSelector.cxx +++ b/src/MEDLoader/MEDFileMeshReadSelector.cxx @@ -60,6 +60,16 @@ bool MEDFileMeshReadSelector::isNodeNameFieldReading() const return _code & 0x00000008; } +bool MEDFileMeshReadSelector::isCellNumFieldReading() const +{ + return _code & 0x00000010; +} + +bool MEDFileMeshReadSelector::isNodeNumFieldReading() const +{ + return _code & 0x00000020; +} + void MEDFileMeshReadSelector::setCellFamilyFieldReading(bool b) { unsigned int code(_code & 0xFFFFFFFE); @@ -96,13 +106,33 @@ void MEDFileMeshReadSelector::setNodeNameFieldReading(bool b) _code=code; } +void MEDFileMeshReadSelector::setCellNumFieldReading(bool b) +{ + unsigned int code(_code & 0xFFFFFFEF); + unsigned int b2=b?1:0; + b2<<=4; + code+=b2; + _code=code; +} + +void MEDFileMeshReadSelector::setNodeNumFieldReading(bool b) +{ + unsigned int code(_code & 0xFFFFFFDF); + unsigned int b2=b?1:0; + b2<<=5; + code+=b2; + _code=code; +} + void MEDFileMeshReadSelector::reprAll(std::ostream& str) const { str << "MEDFileMeshReadSelector (code=" << _code << ") : \n"; str << "Read family field on cells : " << ReprStatus(isCellFamilyFieldReading()) << std::endl; str << "Read family field on nodes : " << ReprStatus(isNodeFamilyFieldReading()) << std::endl; - str << "Read family name on cells : " << ReprStatus(isCellNameFieldReading()) << std::endl; - str << "Read family name on nodes : " << ReprStatus(isNodeNameFieldReading()); + str << "Read name field on cells : " << ReprStatus(isCellNameFieldReading()) << std::endl; + str << "Read name field on nodes : " << ReprStatus(isNodeNameFieldReading()) << std::endl; + str << "Read number field on cells : " << ReprStatus(isCellNumFieldReading()) << std::endl; + str << "Read number field name on nodes : " << ReprStatus(isNodeNumFieldReading()); } std::string MEDFileMeshReadSelector::ReprStatus(bool v) diff --git a/src/MEDLoader/MEDFileMeshReadSelector.hxx b/src/MEDLoader/MEDFileMeshReadSelector.hxx index 15ac3ad6a..41ae451fc 100644 --- a/src/MEDLoader/MEDFileMeshReadSelector.hxx +++ b/src/MEDLoader/MEDFileMeshReadSelector.hxx @@ -39,10 +39,14 @@ namespace ParaMEDMEM bool isNodeFamilyFieldReading() const; bool isCellNameFieldReading() const; bool isNodeNameFieldReading() const; + bool isCellNumFieldReading() const; + bool isNodeNumFieldReading() const; void setCellFamilyFieldReading(bool b); void setNodeFamilyFieldReading(bool b); void setCellNameFieldReading(bool b); void setNodeNameFieldReading(bool b); + void setCellNumFieldReading(bool b); + void setNodeNumFieldReading(bool b); void reprAll(std::ostream& str) const; private: static std::string ReprStatus(bool v); @@ -51,6 +55,8 @@ namespace ParaMEDMEM //bit #1 node family field //bit #2 cell name field //bit #3 node name field + //bit #4 cell num field + //bit #5 node num field unsigned int _code; }; } diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i index 246a1b266..487b91b4d 100644 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ b/src/MEDLoader/Swig/MEDLoaderCommon.i @@ -402,10 +402,14 @@ namespace ParaMEDMEM bool isNodeFamilyFieldReading() const; bool isCellNameFieldReading() const; bool isNodeNameFieldReading() const; + bool isCellNumFieldReading() const; + bool isNodeNumFieldReading() const; void setCellFamilyFieldReading(bool b); void setNodeFamilyFieldReading(bool b); void setCellNameFieldReading(bool b); void setNodeNameFieldReading(bool b); + void setCellNumFieldReading(bool b); + void setNodeNumFieldReading(bool b); %extend { std::string __str__() const throw(INTERP_KERNEL::Exception) @@ -426,8 +430,8 @@ namespace ParaMEDMEM class MEDFileMesh : public RefCountObject, public MEDFileWritable { public: - static MEDFileMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception); + static MEDFileMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); + static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception); virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception); virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index 580dd906a..2627ad21e 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -2967,58 +2967,163 @@ class MEDLoaderTest(unittest.TestCase): def testMEDFileMeshReadSelector1(self): mrs=MEDFileMeshReadSelector() - self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading()) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs.__str__() ; mrs.__repr__() # mrs=MEDFileMeshReadSelector(0) - self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading()) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(1) - self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading()) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(2) - self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading()) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(3) - self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading()) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(4) - self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading()) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(5) - self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading()) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(6) - self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading()) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(7) - self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading()) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(8) - self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading()) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(9) - self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading()) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(10) - self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading()) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(11) - self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading()) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(12) - self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading()) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(13) - self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading()) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(14) - self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading()) - mrs=MEDFileMeshReadSelector(15) - self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading()) - # + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) mrs=MEDFileMeshReadSelector(15) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(16) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(17) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(18) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(19) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(20) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(21) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(22) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(23) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(24) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(25) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(26) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(27) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(28) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(29) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(30) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(31) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and not mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(32) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(33) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(34) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(35) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(36) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(37) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(38) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(39) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(40) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(41) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(42) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(43) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(44) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(45) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(46) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(47) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and not mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(48) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(49) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(50) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(51) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(52) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(53) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(54) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(55) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and not mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(56) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(57) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(58) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(59) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and not mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(60) + self.assertTrue(not mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(61) + self.assertTrue(mrs.isCellFamilyFieldReading() and not mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(62) + self.assertTrue(not mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + mrs=MEDFileMeshReadSelector(63) + self.assertTrue(mrs.isCellFamilyFieldReading() and mrs.isNodeFamilyFieldReading() and mrs.isCellNameFieldReading() and mrs.isNodeNameFieldReading() and mrs.isCellNumFieldReading() and mrs.isNodeNumFieldReading()) + # + mrs=MEDFileMeshReadSelector(63) mrs.setCellFamilyFieldReading(False) - self.assertEqual(mrs.getCode(),14) + self.assertEqual(mrs.getCode(),62) mrs.setCellFamilyFieldReading(True) - self.assertEqual(mrs.getCode(),15) + self.assertEqual(mrs.getCode(),63) mrs.setNodeFamilyFieldReading(False) - self.assertEqual(mrs.getCode(),13) + self.assertEqual(mrs.getCode(),61) mrs.setNodeFamilyFieldReading(True) - self.assertEqual(mrs.getCode(),15) + self.assertEqual(mrs.getCode(),63) mrs.setCellNameFieldReading(False) - self.assertEqual(mrs.getCode(),11) + self.assertEqual(mrs.getCode(),59) mrs.setCellNameFieldReading(True) - self.assertEqual(mrs.getCode(),15) + self.assertEqual(mrs.getCode(),63) mrs.setNodeNameFieldReading(False) - self.assertEqual(mrs.getCode(),7) + self.assertEqual(mrs.getCode(),55) mrs.setNodeNameFieldReading(True) - self.assertEqual(mrs.getCode(),15) + self.assertEqual(mrs.getCode(),63) + mrs.setCellNumFieldReading(False) + self.assertEqual(mrs.getCode(),47) + mrs.setCellNumFieldReading(True) + self.assertEqual(mrs.getCode(),63) + mrs.setNodeNumFieldReading(False) + self.assertEqual(mrs.getCode(),31) + mrs.setNodeNumFieldReading(True) + self.assertEqual(mrs.getCode(),63) pass pass -- 2.39.2