From: Anthony GEAY Date: Thu, 24 Sep 2020 20:24:27 +0000 (+0200) Subject: WIP X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=549969ed694a81268e1e3c279a0ea2c79299346e;p=tools%2Fmedcoupling.git WIP --- diff --git a/src/MEDLoader/MEDFileField.hxx b/src/MEDLoader/MEDFileField.hxx index 01a274580..20153b152 100644 --- a/src/MEDLoader/MEDFileField.hxx +++ b/src/MEDLoader/MEDFileField.hxx @@ -35,7 +35,6 @@ #include "MEDLoaderTraits.hxx" #include "MEDCouplingTraits.hxx" #include "MEDCouplingRefCountObject.hxx" -#include "MEDCouplingFieldInt32.hxx" #include "MEDCouplingMemArray.hxx" #include "MEDCouplingPartDefinition.hxx" diff --git a/src/MEDLoader/MEDFileField.txx b/src/MEDLoader/MEDFileField.txx index 020e7fa5c..254194fe8 100644 --- a/src/MEDLoader/MEDFileField.txx +++ b/src/MEDLoader/MEDFileField.txx @@ -23,6 +23,7 @@ #include "MEDFileField.hxx" #include "MEDCouplingTraits.hxx" #include "MEDCouplingFieldInt32.hxx" +#include "MEDCouplingFieldInt64.hxx" #include "MEDCouplingFieldFloat.hxx" #include "MEDCouplingFieldDouble.hxx" #include "MEDCouplingFieldTemplate.hxx" diff --git a/src/MEDLoader/MEDFileField1TS.cxx b/src/MEDLoader/MEDFileField1TS.cxx index 6d723d614..e6f6df260 100644 --- a/src/MEDLoader/MEDFileField1TS.cxx +++ b/src/MEDLoader/MEDFileField1TS.cxx @@ -43,7 +43,7 @@ template class MEDCoupling::MEDFileNDTemplateField1TS; template class MEDCoupling::MEDFileNDTemplateField1TS; const char MEDFileField1TSWithoutSDA::TYPE_STR[]="FLOAT64"; -const char MEDFileIntField1TSWithoutSDA::TYPE_STR[]="INT32"; +const char MEDFileInt32Field1TSWithoutSDA::TYPE_STR[]="INT32"; const char MEDFileFloatField1TSWithoutSDA::TYPE_STR[]="FLOAT32"; //= MEDFileAnyTypeField1TSWithoutSDA @@ -1430,9 +1430,9 @@ const char *MEDFileField1TSWithoutSDA::getTypeStr() const return TYPE_STR; } -MEDFileIntField1TSWithoutSDA *MEDFileField1TSWithoutSDA::convertToInt() const +MEDFileInt32Field1TSWithoutSDA *MEDFileField1TSWithoutSDA::convertToInt() const { - MCAuto ret(new MEDFileIntField1TSWithoutSDA); + MCAuto ret(new MEDFileInt32Field1TSWithoutSDA); ret->MEDFileAnyTypeField1TSWithoutSDA::operator =(*this); ret->deepCpyLeavesFrom(*this); const DataArrayDouble *arr(_arr); @@ -1490,25 +1490,25 @@ MEDFileField1TSWithoutSDA *MEDFileField1TSWithoutSDA::deepCopy() const return ret.retn(); } -//= MEDFileIntField1TSWithoutSDA +//= MEDFileInt32Field1TSWithoutSDA -MEDFileIntField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos) +MEDFileInt32Field1TSWithoutSDA *MEDFileInt32Field1TSWithoutSDA::New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos) { - return new MEDFileIntField1TSWithoutSDA(fieldName,meshName,csit,iteration,order,infos); + return new MEDFileInt32Field1TSWithoutSDA(fieldName,meshName,csit,iteration,order,infos); } -MEDFileIntField1TSWithoutSDA::MEDFileIntField1TSWithoutSDA() +MEDFileInt32Field1TSWithoutSDA::MEDFileInt32Field1TSWithoutSDA() { } -MEDFileIntField1TSWithoutSDA::MEDFileIntField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, +MEDFileInt32Field1TSWithoutSDA::MEDFileInt32Field1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos):MEDFileField1TSNDTemplateWithoutSDA(fieldName,meshName,csit,iteration,order,infos) { DataArrayInt32 *arr(getOrCreateAndGetArrayTemplate()); arr->setInfoAndChangeNbOfCompo(infos); } -const char *MEDFileIntField1TSWithoutSDA::getTypeStr() const +const char *MEDFileInt32Field1TSWithoutSDA::getTypeStr() const { return TYPE_STR; } @@ -1529,7 +1529,7 @@ const char *MEDFileIntField1TSWithoutSDA::getTypeStr() const * \throw If no field values are available. * \sa getUndergroundDataArray() */ -DataArray *MEDFileIntField1TSWithoutSDA::getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const +DataArray *MEDFileInt32Field1TSWithoutSDA::getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const { return getUndergroundDataArrayIntExt(entries); } @@ -1550,7 +1550,7 @@ DataArray *MEDFileIntField1TSWithoutSDA::getUndergroundDataArrayExt(std::vector< * \throw If no field values are available. * \sa getUndergroundDataArray() */ -DataArrayInt *MEDFileIntField1TSWithoutSDA::getUndergroundDataArrayIntExt(std::vector< std::pair,std::pair > >& entries) const +DataArrayInt *MEDFileInt32Field1TSWithoutSDA::getUndergroundDataArrayIntExt(std::vector< std::pair,std::pair > >& entries) const { if(_field_per_mesh.size()!=1) throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getUndergroundDataArrayExt : field lies on several meshes, this method has no sense !"); @@ -1560,16 +1560,16 @@ DataArrayInt *MEDFileIntField1TSWithoutSDA::getUndergroundDataArrayIntExt(std::v return getUndergroundDataArrayTemplate(); } -MEDFileIntField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::shallowCpy() const +MEDFileInt32Field1TSWithoutSDA *MEDFileInt32Field1TSWithoutSDA::shallowCpy() const { - MCAuto ret(new MEDFileIntField1TSWithoutSDA(*this)); + MCAuto ret(new MEDFileInt32Field1TSWithoutSDA(*this)); ret->deepCpyLeavesFrom(*this); return ret.retn(); } -MEDFileIntField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::deepCopy() const +MEDFileInt32Field1TSWithoutSDA *MEDFileInt32Field1TSWithoutSDA::deepCopy() const { - MCAuto ret(shallowCpy()); + MCAuto ret(shallowCpy()); if(_arr.isNotNull()) ret->_arr=_arr->deepCopy(); return ret.retn(); @@ -1683,7 +1683,7 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i } case MED_INT32: { - ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); + ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); break; } case MED_FLOAT32: @@ -1695,7 +1695,7 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i { if(sizeof(med_int)==sizeof(int)) { - ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); + ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); break; } } @@ -1751,7 +1751,7 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i } case MED_INT32: { - ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); + ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); break; } case MED_FLOAT32: @@ -1763,7 +1763,7 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i { if(sizeof(med_int)==sizeof(int)) { - ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); + ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); break; } } @@ -1816,9 +1816,9 @@ MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::BuildNewInstanceFromContent(MEDF ret->_content=c; c->incrRef(); return ret.retn(); } - if(dynamic_cast(c)) + if(dynamic_cast(c)) { - MCAuto ret(MEDFileIntField1TS::New()); + MCAuto ret(MEDFileInt32Field1TS::New()); ret->_content=c; c->incrRef(); return ret.retn(); } @@ -1911,7 +1911,7 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i } case MED_INT32: { - ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector()); + ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector()); break; } case MED_FLOAT32: @@ -1923,7 +1923,7 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i { if(sizeof(med_int)==sizeof(int)) { - ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector()); + ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector()); break; } } @@ -2542,22 +2542,22 @@ mcIdType MEDFileAnyTypeField1TS::copyTinyInfoFrom(const TimeHolder *th, const ME * * \param [in] isDeepCpyGlobs - a boolean that indicates the behaviour concerning globals (profiles and localizations) * By default (true) the globals are deeply copied. - * \return MEDFileIntField1TS * - a new object that is the result of the conversion of \a this to int32 field. + * \return MEDFileInt32Field1TS * - a new object that is the result of the conversion of \a this to int32 field. */ -MEDFileIntField1TS *MEDFileField1TS::convertToInt(bool isDeepCpyGlobs) const +MEDFileInt32Field1TS *MEDFileField1TS::convertToInt(bool isDeepCpyGlobs) const { - MCAuto ret; + MCAuto ret; const MEDFileAnyTypeField1TSWithoutSDA *content(_content); if(content) { const MEDFileField1TSWithoutSDA *contc=dynamic_cast(content); if(!contc) throw INTERP_KERNEL::Exception("MEDFileField1TS::convertToInt : the content inside this is not FLOAT64 ! This is incoherent !"); - MCAuto newc(contc->convertToInt()); - ret=static_cast(MEDFileAnyTypeField1TS::BuildNewInstanceFromContent((MEDFileIntField1TSWithoutSDA *)newc)); + MCAuto newc(contc->convertToInt()); + ret=static_cast(MEDFileAnyTypeField1TS::BuildNewInstanceFromContent((MEDFileInt32Field1TSWithoutSDA *)newc)); } else - ret=MEDFileIntField1TS::New(); + ret=MEDFileInt32Field1TS::New(); if(isDeepCpyGlobs) ret->deepCpyGlobs(*this); else @@ -2610,12 +2610,12 @@ std::vector< std::vector > MEDFileField1TS::getFieldSplitedBy return contentNotNull()->getFieldSplitedByType2(mname,types,typesF,pfls,locs); } -//= MEDFileIntField1TS +//= MEDFileInt32Field1TS -MCAuto MEDFileIntField1TS::ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt32 *f) +MCAuto MEDFileInt32Field1TS::ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt32 *f) { if(!f) - throw INTERP_KERNEL::Exception("MEDFileIntField1TS::ConvertFieldIntToFieldDouble : null input field !"); + throw INTERP_KERNEL::Exception("MEDFileInt32Field1TS::ConvertFieldIntToFieldDouble : null input field !"); int t1,t2; double t0(f->getTime(t1,t2)); std::string tu(f->getTimeUnit()); @@ -2624,7 +2624,3 @@ MCAuto MEDFileIntField1TS::ConvertFieldIntToFieldDouble( ret->setTime(t0,t1,t2); ret->setTimeUnit(tu); return ret; } - -//= MEDFileFloatField1TS - -//= MEDFileFloatField1TS diff --git a/src/MEDLoader/MEDFileField1TS.hxx b/src/MEDLoader/MEDFileField1TS.hxx index 7f931f14b..feb458c83 100644 --- a/src/MEDLoader/MEDFileField1TS.hxx +++ b/src/MEDLoader/MEDFileField1TS.hxx @@ -142,7 +142,7 @@ namespace MEDCoupling mutable mcIdType _nb_of_tuples_to_be_allocated; }; - class MEDFileIntField1TSWithoutSDA; + class MEDFileInt32Field1TSWithoutSDA; template class MEDFileField1TSTemplateWithoutSDA : public MEDFileAnyTypeField1TSWithoutSDA @@ -184,7 +184,7 @@ namespace MEDCoupling MEDLOADER_EXPORT MEDFileField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos); MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *shallowCpy() const; MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *deepCopy() const; - MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *convertToInt() const; + MEDLOADER_EXPORT MEDFileInt32Field1TSWithoutSDA *convertToInt() const; public: static const char TYPE_STR[]; }; @@ -202,19 +202,39 @@ namespace MEDCoupling /*! * SDA is for Shared Data Arrays such as profiles. */ - class MEDFileIntField1TSWithoutSDA : public MEDFileField1TSNDTemplateWithoutSDA + class MEDFileInt32Field1TSWithoutSDA : public MEDFileField1TSNDTemplateWithoutSDA { public: - MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA(); - MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileIntField1TSWithoutSDA"); } - MEDLOADER_EXPORT static MEDFileIntField1TSWithoutSDA *New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos); - MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *deepCopy() const; - MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *shallowCpy() const; + MEDLOADER_EXPORT MEDFileInt32Field1TSWithoutSDA(); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt32Field1TSWithoutSDA"); } + MEDLOADER_EXPORT static MEDFileInt32Field1TSWithoutSDA *New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos); + MEDLOADER_EXPORT MEDFileInt32Field1TSWithoutSDA *deepCopy() const; + MEDLOADER_EXPORT MEDFileInt32Field1TSWithoutSDA *shallowCpy() const; MEDLOADER_EXPORT const char *getTypeStr() const; MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const; MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair,std::pair > >& entries) const; protected: - MEDFileIntField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos); + MEDFileInt32Field1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos); + public: + MEDLOADER_EXPORT static const char TYPE_STR[]; + }; + + /*! + * SDA is for Shared Data Arrays such as profiles. + */ + class MEDFileInt64Field1TSWithoutSDA : public MEDFileField1TSNDTemplateWithoutSDA + { + public: + MEDLOADER_EXPORT MEDFileInt64Field1TSWithoutSDA(); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt64Field1TSWithoutSDA"); } + MEDLOADER_EXPORT static MEDFileInt64Field1TSWithoutSDA *New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos); + MEDLOADER_EXPORT MEDFileInt64Field1TSWithoutSDA *deepCopy() const; + MEDLOADER_EXPORT MEDFileInt64Field1TSWithoutSDA *shallowCpy() const; + MEDLOADER_EXPORT const char *getTypeStr() const; + MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const; + MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair,std::pair > >& entries) const; + protected: + MEDFileInt64Field1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos); public: MEDLOADER_EXPORT static const char TYPE_STR[]; }; @@ -337,7 +357,7 @@ namespace MEDCoupling MCAuto _content; }; - class MEDFileIntField1TS; + class MEDFileInt32Field1TS; template class MEDFileTemplateField1TS : public MEDFileAnyTypeField1TS @@ -392,7 +412,7 @@ namespace MEDCoupling { friend class MEDFileTemplateField1TS; public: - MEDLOADER_EXPORT MEDFileIntField1TS *convertToInt(bool isDeepCpyGlobs=true) const; + MEDLOADER_EXPORT MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const; public: MEDLOADER_EXPORT MEDFileField1TS *shallowCpy() const; MEDLOADER_EXPORT std::vector< std::vector > getFieldSplitedByType2(const std::string& mname, std::vector& types, std::vector< std::vector >& typesF, @@ -424,29 +444,54 @@ namespace MEDCoupling MEDFileNDTemplateField1TS(const typename MLFieldTraits::F1TSWSDAType& other, bool shallowCopyOfContent):MEDFileTemplateField1TS(other,shallowCopyOfContent) { } }; - class MEDFileIntField1TS : public MEDFileNDTemplateField1TS + class MEDFileInt32Field1TS : public MEDFileNDTemplateField1TS + { + friend class MEDFileTemplateField1TS; + public: + MEDLOADER_EXPORT MEDFileInt32Field1TS *shallowCpy() const { return new MEDFileInt32Field1TS(*this); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt32Field1TS"); } + public: + MEDLOADER_EXPORT static MCAuto ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt32 *f); + private: + med_field_type getMEDFileFieldType() const { return MED_INT32; } + private: + ~MEDFileInt32Field1TS() { } + MEDFileInt32Field1TS() { } + MEDFileInt32Field1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS(fid,loadAll,ms) { } + MEDFileInt32Field1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS(fid,fieldName,loadAll,ms) { } + MEDFileInt32Field1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS(fid,fieldName,iteration,order,loadAll,ms) { } + /*! + * This constructor is a shallow copy constructor. If \a shallowCopyOfContent is true the content of \a other is shallow copied. + * If \a shallowCopyOfContent is false, \a other is taken to be the content of \a this. + * + * \warning this is a shallow copy constructor + */ + MEDFileInt32Field1TS(const MEDFileInt32Field1TSWithoutSDA& other, bool shallowCopyOfContent):MEDFileNDTemplateField1TS(other,shallowCopyOfContent) { } + }; + + class MEDFileInt64Field1TS : public MEDFileNDTemplateField1TS { - friend class MEDFileTemplateField1TS; + friend class MEDFileTemplateField1TS; public: - MEDLOADER_EXPORT MEDFileIntField1TS *shallowCpy() const { return new MEDFileIntField1TS(*this); } - MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileIntField1TS"); } + MEDLOADER_EXPORT MEDFileInt64Field1TS *shallowCpy() const { return new MEDFileInt64Field1TS(*this); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt64Field1TS"); } public: MEDLOADER_EXPORT static MCAuto ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt32 *f); private: med_field_type getMEDFileFieldType() const { return MED_INT32; } private: - ~MEDFileIntField1TS() { } - MEDFileIntField1TS() { } - MEDFileIntField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS(fid,loadAll,ms) { } - MEDFileIntField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS(fid,fieldName,loadAll,ms) { } - MEDFileIntField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS(fid,fieldName,iteration,order,loadAll,ms) { } + ~MEDFileInt64Field1TS() { } + MEDFileInt64Field1TS() { } + MEDFileInt64Field1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS(fid,loadAll,ms) { } + MEDFileInt64Field1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS(fid,fieldName,loadAll,ms) { } + MEDFileInt64Field1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS(fid,fieldName,iteration,order,loadAll,ms) { } /*! * This constructor is a shallow copy constructor. If \a shallowCopyOfContent is true the content of \a other is shallow copied. * If \a shallowCopyOfContent is false, \a other is taken to be the content of \a this. * * \warning this is a shallow copy constructor */ - MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent):MEDFileNDTemplateField1TS(other,shallowCopyOfContent) { } + MEDFileInt64Field1TS(const MEDFileInt64Field1TSWithoutSDA& other, bool shallowCopyOfContent):MEDFileNDTemplateField1TS(other,shallowCopyOfContent) { } }; class MEDFileFloatField1TS : public MEDFileNDTemplateField1TS diff --git a/src/MEDLoader/MEDFileFieldMultiTS.cxx b/src/MEDLoader/MEDFileFieldMultiTS.cxx index 117d84d63..b6807f27f 100644 --- a/src/MEDLoader/MEDFileFieldMultiTS.cxx +++ b/src/MEDLoader/MEDFileFieldMultiTS.cxx @@ -527,7 +527,7 @@ void MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysR } case MED_INT32: { - _time_steps[i]=MEDFileIntField1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt(numdt),FromMedInt(numo),_infos); + _time_steps[i]=MEDFileInt32Field1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt(numdt),FromMedInt(numo),_infos); break; } case MED_FLOAT32: @@ -539,7 +539,7 @@ void MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysR { if(sizeof(med_int)==sizeof(int)) { - _time_steps[i]=MEDFileIntField1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt(numdt),FromMedInt(numo),_infos); + _time_steps[i]=MEDFileInt32Field1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt(numdt),FromMedInt(numo),_infos); break; } } @@ -1741,10 +1741,10 @@ MCAuto MEDFileAnyTypeFieldMultiTS::getCont } /*! - * Returns a new MEDFileField1TS or MEDFileIntField1TS holding data of a given time step of \a this field. + * Returns a new MEDFileField1TS or MEDFileInt32Field1TS holding data of a given time step of \a this field. * \param [in] iteration - the iteration number of a required time step. * \param [in] order - the iteration order number of required time step. - * \return MEDFileField1TS * or MEDFileIntField1TS *- a new instance of MEDFileField1TS or MEDFileIntField1TS. The caller is to + * \return MEDFileField1TS * or MEDFileInt32Field1TS *- a new instance of MEDFileField1TS or MEDFileInt32Field1TS. The caller is to * delete this field using decrRef() as it is no more needed. * \throw If there is no required time step in \a this field. */ @@ -1755,7 +1755,7 @@ MEDFileAnyTypeField1TS *MEDFileAnyTypeFieldMultiTS::getTimeStep(int iteration, i } /*! - * Returns a new MEDFileField1TS or MEDFileIntField1TS holding data of a given time step of \a this field. + * Returns a new MEDFileField1TS or MEDFileInt32Field1TS holding data of a given time step of \a this field. * \param [in] time - the time of the time step of interest. * \param [in] eps - a precision used to compare time values. * \return MEDFileField1TS * - a new instance of MEDFileField1TS. The caller is to diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index 982f39bf0..687d0bcbf 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -1263,7 +1263,7 @@ MCAuto MEDCoupling::ReadField(const std::string& } } { - MCAuto f1(MEDCoupling::DynamicCast(f)); + MCAuto f1(MEDCoupling::DynamicCast(f)); if(f1.isNotNull()) { MCAuto ret(f1->field(mesh)); @@ -1390,7 +1390,7 @@ namespace MEDCoupling } } { - MCAuto f1(MEDCoupling::DynamicCast(f)); + MCAuto f1(MEDCoupling::DynamicCast(f)); if(f1.isNotNull()) { MCAuto ret(ReadFieldCellLikeT(f1,type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order)); @@ -1467,7 +1467,7 @@ MEDCoupling::MEDCouplingField *MEDCoupling::ReadFieldNode(const std::string& fil } } { - MCAuto f1(MEDCoupling::DynamicCast(f)); + MCAuto f1(MEDCoupling::DynamicCast(f)); if(f1.isNotNull()) { MCAuto ret(ReadFieldNodeT(f1,fileName,meshName,meshDimRelToMax,fieldName,iteration,order)); diff --git a/src/MEDLoader/MEDLoaderTraits.hxx b/src/MEDLoader/MEDLoaderTraits.hxx index 9a997436b..d0e0551b9 100644 --- a/src/MEDLoader/MEDLoaderTraits.hxx +++ b/src/MEDLoader/MEDLoaderTraits.hxx @@ -18,10 +18,10 @@ // // Author : Anthony Geay (EDF R&D) -#ifndef __MEDLOADERTRAITS_HXX__ -#define __MEDLOADERTRAITS_HXX__ +#pragma once #include "MEDLoaderDefines.hxx" +#include "MCType.hxx" namespace MEDCoupling { @@ -34,11 +34,13 @@ namespace MEDCoupling class MEDFileFieldMultiTS; class MEDFileField1TS; class MEDFileIntFieldMultiTS; - class MEDFileIntField1TS; + class MEDFileInt32Field1TS; + class MEDFileInt64Field1TS; class MEDFileFloatFieldMultiTS; class MEDFileFloatField1TS; class MEDFileField1TSWithoutSDA; - class MEDFileIntField1TSWithoutSDA; + class MEDFileInt32Field1TSWithoutSDA; + class MEDFileInt64Field1TSWithoutSDA; class MEDFileFloatField1TSWithoutSDA; class MEDFileFieldMultiTSWithoutSDA; class MEDFileIntFieldMultiTSWithoutSDA; @@ -63,12 +65,21 @@ namespace MEDCoupling }; template<> - struct MEDLOADER_EXPORT MLFieldTraits + struct MEDLOADER_EXPORT MLFieldTraits { typedef MEDFileIntFieldMultiTSWithoutSDA FMTSWSDAType; typedef MEDFileIntFieldMultiTS FMTSType; - typedef MEDFileIntField1TS F1TSType; - typedef MEDFileIntField1TSWithoutSDA F1TSWSDAType; + typedef MEDFileInt32Field1TS F1TSType; + typedef MEDFileInt32Field1TSWithoutSDA F1TSWSDAType; + }; + + template<> + struct MEDLOADER_EXPORT MLFieldTraits + { + //typedef MEDFileIntFieldMultiTSWithoutSDA FMTSWSDAType; + //typedef MEDFileIntFieldMultiTS FMTSType; + typedef MEDFileInt64Field1TS F1TSType; + typedef MEDFileInt64Field1TSWithoutSDA F1TSWSDAType; }; template @@ -98,5 +109,3 @@ namespace MEDCoupling static const char ClassName[]; }; } - -#endif