From: Anthony Geay Date: Fri, 25 Sep 2020 05:52:57 +0000 (+0200) Subject: WIP X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ca4fdef6ee3ae0094971ced0e2f1b1cb8a0781f0;p=tools%2Fmedcoupling.git WIP --- diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 4ddc793ec..80bdd00f9 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -276,6 +276,11 @@ try:MEDFileFieldGlobsReal(fid) _fields[i]=MEDFileInt32FieldMultiTSWithoutSDA::New(fid,fieldName,meshName,typcha,infos,nbOfStep,dtunit,loadAll,ms,entities); break; } + case MED_INT64: + { + _fields[i]=MEDFileInt64FieldMultiTSWithoutSDA::New(fid,fieldName,meshName,typcha,infos,nbOfStep,dtunit,loadAll,ms,entities); + break; + } case MED_FLOAT32: { _fields[i]=MEDFileFloatFieldMultiTSWithoutSDA::New(fid,fieldName,meshName,typcha,infos,nbOfStep,dtunit,loadAll,ms,entities); @@ -291,7 +296,7 @@ try:MEDFileFieldGlobsReal(fid) } default: { - std::ostringstream oss; oss << "constructor MEDFileFields(fileName) : file \'" << FileNameFromFID(fid) << "\' at pos #" << i << " field has name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32] !"; + std::ostringstream oss; oss << "constructor MEDFileFields(fileName) : file \'" << FileNameFromFID(fid) << "\' at pos #" << i << " field has name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32, MED_INT64] !"; throw INTERP_KERNEL::Exception(oss.str()); } } diff --git a/src/MEDLoader/MEDFileField1TS.cxx b/src/MEDLoader/MEDFileField1TS.cxx index e6f6df260..fd0969226 100644 --- a/src/MEDLoader/MEDFileField1TS.cxx +++ b/src/MEDLoader/MEDFileField1TS.cxx @@ -1686,6 +1686,11 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); break; } + case MED_INT64: + { + ret=MEDFileInt64Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); + break; + } case MED_FLOAT32: { ret=MEDFileFloatField1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); @@ -1701,7 +1706,7 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i } default: { - std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of the first field is not in [MED_FLOAT64, MED_INT32] !"; + std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of the first field is not in [MED_FLOAT64, MED_FLOAT32, MED_INT32, MED_INT64] !"; throw INTERP_KERNEL::Exception(oss.str()); } } @@ -1754,6 +1759,11 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); break; } + case MED_INT64: + { + ret=MEDFileInt64Field1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); + break; + } case MED_FLOAT32: { ret=MEDFileFloatField1TSWithoutSDA::New(fieldName,meshName,-1,-1/*iteration*/,-1/*order*/,std::vector()); @@ -1769,7 +1779,7 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i } default: { - std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid,fieldName) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32] !"; + std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid,fieldName) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32, MED_INT64] !"; throw INTERP_KERNEL::Exception(oss.str()); } } @@ -1914,6 +1924,11 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i ret=MEDFileInt32Field1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector()); break; } + case MED_INT64: + { + ret=MEDFileInt64Field1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector()); + break; + } case MED_FLOAT32: { ret=MEDFileFloatField1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector()); @@ -1929,7 +1944,7 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i } default: { - std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid,fieldName,iteration,order) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32] !"; + std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::BuildContentFrom(fid,fieldName,iteration,order) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32, MED_INT64] !"; throw INTERP_KERNEL::Exception(oss.str()); } } diff --git a/src/MEDLoader/MEDFileField1TS.hxx b/src/MEDLoader/MEDFileField1TS.hxx index feb458c83..ad610783c 100644 --- a/src/MEDLoader/MEDFileField1TS.hxx +++ b/src/MEDLoader/MEDFileField1TS.hxx @@ -478,7 +478,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT static MCAuto ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt32 *f); private: - med_field_type getMEDFileFieldType() const { return MED_INT32; } + med_field_type getMEDFileFieldType() const { return MED_INT64; } private: ~MEDFileInt64Field1TS() { } MEDFileInt64Field1TS() { } diff --git a/src/MEDLoader/MEDFileFieldMultiTS.cxx b/src/MEDLoader/MEDFileFieldMultiTS.cxx index b63823b1d..6ad718de6 100644 --- a/src/MEDLoader/MEDFileFieldMultiTS.cxx +++ b/src/MEDLoader/MEDFileFieldMultiTS.cxx @@ -530,6 +530,11 @@ void MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysR _time_steps[i]=MEDFileInt32Field1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt(numdt),FromMedInt(numo),_infos); break; } + case MED_INT64: + { + _time_steps[i]=MEDFileInt64Field1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt(numdt),FromMedInt(numo),_infos); + break; + } case MED_FLOAT32: { _time_steps[i]=MEDFileFloatField1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt(numdt),FromMedInt(numo),_infos); @@ -544,7 +549,7 @@ void MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysR } } default: - throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysRecursively : managed field type are : FLOAT64, INT32, FLOAT32 !"); + throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysRecursively : managed field type are : FLOAT64, INT32, FLOAT32, INT64 !"); } if(loadAll) _time_steps[i]->loadStructureAndBigArraysRecursively(fid,*this,ms,entitiesForSubInstances); @@ -1186,6 +1191,11 @@ MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFr ret=new MEDFileInt32FieldMultiTSWithoutSDA(fid,i,loadAll,ms,entities); break; } + case MED_INT64: + { + ret=new MEDFileInt64FieldMultiTSWithoutSDA(fid,i,loadAll,ms,entities); + break; + } case MED_FLOAT32: { ret=new MEDFileFloatFieldMultiTSWithoutSDA(fid,i,loadAll,ms,entities); @@ -1201,7 +1211,7 @@ MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFr } default: { - std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::BuildContentFrom(fid,fieldName) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32] !"; + std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::BuildContentFrom(fid,fieldName) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32, MED_INT64] !"; throw INTERP_KERNEL::Exception(oss.str()); } } @@ -1230,6 +1240,11 @@ MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFr ret=new MEDFileInt32FieldMultiTSWithoutSDA(fid,0,loadAll,ms,0); break; } + case MED_INT64: + { + ret=new MEDFileInt64FieldMultiTSWithoutSDA(fid,0,loadAll,ms,0); + break; + } case MED_FLOAT32: { ret=new MEDFileFloatFieldMultiTSWithoutSDA(fid,0,loadAll,ms,0); @@ -1245,7 +1260,7 @@ MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFr } default: { - std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::BuildContentFrom(fid) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of the first field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32] !"; + std::ostringstream oss; oss << "MEDFileAnyTypeFieldMultiTS::BuildContentFrom(fid) : file \'" << FileNameFromFID(fid) << "\' contains field with name \'" << fieldName << "\' but the type of the first field is not in [MED_FLOAT64, MED_INT32, MED_FLOAT32, MED_INT64] !"; throw INTERP_KERNEL::Exception(oss.str()); } } diff --git a/src/MEDLoader/MEDFileUtilities.cxx b/src/MEDLoader/MEDFileUtilities.cxx index 280963984..ad4004df8 100644 --- a/src/MEDLoader/MEDFileUtilities.cxx +++ b/src/MEDLoader/MEDFileUtilities.cxx @@ -49,18 +49,21 @@ med_access_mode MEDFileUtilities::TraduceWriteMode(int medloaderwritemode) const char *MEDFileUtilities::GetReadableMEDFieldType(med_field_type ft) { static const char medFloat64[]="MED_FLOAT64"; + static const char medFloat32[]="MED_FLOAT32"; static const char medInt32[]="MED_INT32"; static const char medInt64[]="MED_INT64"; switch(ft) { case MED_FLOAT64: return medFloat64; + case MED_FLOAT32: + return medFloat32; case MED_INT32: return medInt32; case MED_INT64: return medInt64; default: - throw INTERP_KERNEL::Exception("Non supported field type ! Should be FLOAT64, INT32 or INT64 !"); + throw INTERP_KERNEL::Exception("Non supported field type ! Should be FLOAT64, FLOAT32, INT32 or INT64 !"); } }