const char MEDFileField1TSWithoutSDA::TYPE_STR[]="FLOAT64";
const char MEDFileInt32Field1TSWithoutSDA::TYPE_STR[]="INT32";
+const char MEDFileInt64Field1TSWithoutSDA::TYPE_STR[]="INT64";
const char MEDFileFloatField1TSWithoutSDA::TYPE_STR[]="FLOAT32";
//= MEDFileAnyTypeField1TSWithoutSDA
* \throw If no field values are available.
* \sa getUndergroundDataArray()
*/
-DataArrayInt *MEDFileInt32Field1TSWithoutSDA::getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const
+DataArrayInt32 *MEDFileInt32Field1TSWithoutSDA::getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const
{
if(_field_per_mesh.size()!=1)
throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getUndergroundDataArrayExt : field lies on several meshes, this method has no sense !");
return ret.retn();
}
+//= MEDFileInt64Field1TSWithoutSDA
+
+MEDFileInt64Field1TSWithoutSDA *MEDFileInt64Field1TSWithoutSDA::New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos)
+{
+ return new MEDFileInt64Field1TSWithoutSDA(fieldName,meshName,csit,iteration,order,infos);
+}
+
+MEDFileInt64Field1TSWithoutSDA::MEDFileInt64Field1TSWithoutSDA()
+{
+}
+
+MEDFileInt64Field1TSWithoutSDA::MEDFileInt64Field1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order,
+ const std::vector<std::string>& infos):MEDFileField1TSNDTemplateWithoutSDA<Int64>(fieldName,meshName,csit,iteration,order,infos)
+{
+ DataArrayInt64 *arr(getOrCreateAndGetArrayTemplate());
+ arr->setInfoAndChangeNbOfCompo(infos);
+}
+
+const char *MEDFileInt64Field1TSWithoutSDA::getTypeStr() const
+{
+ return TYPE_STR;
+}
+
+/*!
+ * Returns a pointer to the underground DataArrayIdType instance and a
+ * sequence describing parameters of a support of each part of \a this field. The
+ * caller should not decrRef() the returned DataArrayIdType. This method allows for a
+ * direct access to the field values. This method is intended for the field lying on one
+ * mesh only.
+ * \param [in,out] entries - the sequence describing parameters of a support of each
+ * part of \a this field. Each item of this sequence consists of two parts. The
+ * first part describes a type of mesh entity and an id of discretization of a
+ * current field part. The second part describes a range of values [begin,end)
+ * within the returned array relating to the current field part.
+ * \return DataArrayIdType * - the pointer to the field values array.
+ * \throw If the number of underlying meshes is not equal to 1.
+ * \throw If no field values are available.
+ * \sa getUndergroundDataArray()
+ */
+DataArray *MEDFileInt64Field1TSWithoutSDA::getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const
+{
+ return getUndergroundDataArrayIntExt(entries);
+}
+
+/*!
+ * Returns a pointer to the underground DataArrayInt instance and a
+ * sequence describing parameters of a support of each part of \a this field. The
+ * caller should not decrRef() the returned DataArrayIdType. This method allows for a
+ * direct access to the field values. This method is intended for the field lying on one
+ * mesh only.
+ * \param [in,out] entries - the sequence describing parameters of a support of each
+ * part of \a this field. Each item of this sequence consists of two parts. The
+ * first part describes a type of mesh entity and an id of discretization of a
+ * current field part. The second part describes a range of values [begin,end)
+ * within the returned array relating to the current field part.
+ * \return DataArrayInt * - the pointer to the field values array.
+ * \throw If the number of underlying meshes is not equal to 1.
+ * \throw If no field values are available.
+ * \sa getUndergroundDataArray()
+ */
+DataArrayInt64 *MEDFileInt64Field1TSWithoutSDA::getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const
+{
+ if(_field_per_mesh.size()!=1)
+ throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getUndergroundDataArrayExt : field lies on several meshes, this method has no sense !");
+ if(_field_per_mesh[0]==0)
+ throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getUndergroundDataArrayExt : no field specified !");
+ _field_per_mesh[0]->getUndergroundDataArrayExt(entries);
+ return getUndergroundDataArrayTemplate();
+}
+
+MEDFileInt64Field1TSWithoutSDA *MEDFileInt64Field1TSWithoutSDA::shallowCpy() const
+{
+ MCAuto<MEDFileInt64Field1TSWithoutSDA> ret(new MEDFileInt64Field1TSWithoutSDA(*this));
+ ret->deepCpyLeavesFrom(*this);
+ return ret.retn();
+}
+
+MEDFileInt64Field1TSWithoutSDA *MEDFileInt64Field1TSWithoutSDA::deepCopy() const
+{
+ MCAuto<MEDFileInt64Field1TSWithoutSDA> ret(shallowCpy());
+ if(_arr.isNotNull())
+ ret->_arr=_arr->deepCopy();
+ return ret.retn();
+}
+
//= MEDFileFloatField1TSWithoutSDA
MEDFileFloatField1TSWithoutSDA *MEDFileFloatField1TSWithoutSDA::New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos)
ret->_content=c; c->incrRef();
return ret.retn();
}
+ if(dynamic_cast<const MEDFileInt64Field1TSWithoutSDA *>(c))
+ {
+ MCAuto<MEDFileInt64Field1TS> ret(MEDFileInt64Field1TS::New());
+ ret->_content=c; c->incrRef();
+ return ret.retn();
+ }
if(dynamic_cast<const MEDFileFloatField1TSWithoutSDA *>(c))
{
MCAuto<MEDFileFloatField1TS> ret(MEDFileFloatField1TS::New());
ret->setTime(t0,t1,t2); ret->setTimeUnit(tu);
return ret;
}
+
+//= MEDFileInt64Field1TS
+
+MCAuto<MEDCouplingFieldDouble> MEDFileInt64Field1TS::ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt64 *f)
+{
+ if(!f)
+ throw INTERP_KERNEL::Exception("MEDFileInt64Field1TS::ConvertFieldIntToFieldDouble : null input field !");
+ int t1,t2;
+ double t0(f->getTime(t1,t2));
+ std::string tu(f->getTimeUnit());
+ MCAuto<MEDCouplingFieldTemplate> ft(MEDCouplingFieldTemplate::New(*f));
+ MCAuto<MEDCouplingFieldDouble> ret(MEDCouplingFieldDouble::New(*ft));
+ ret->setTime(t0,t1,t2); ret->setTimeUnit(tu);
+ return ret;
+}
+
MEDLOADER_EXPORT MEDFileInt32Field1TSWithoutSDA *shallowCpy() const;
MEDLOADER_EXPORT const char *getTypeStr() const;
MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
- MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
+ MEDLOADER_EXPORT DataArrayInt32 *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
protected:
MEDFileInt32Field1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
public:
MEDLOADER_EXPORT MEDFileInt64Field1TSWithoutSDA *shallowCpy() const;
MEDLOADER_EXPORT const char *getTypeStr() const;
MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
- MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
+ MEDLOADER_EXPORT DataArrayInt64 *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<mcIdType,mcIdType> > >& entries) const;
protected:
MEDFileInt64Field1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
public:
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<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt32 *f);
+ MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt64 *f);
private:
med_field_type getMEDFileFieldType() const { return MED_INT64; }
private:
using namespace MEDCoupling;
-template class MEDCoupling::MEDFileTemplateFieldMultiTSWithoutSDA<int>;
+template class MEDCoupling::MEDFileTemplateFieldMultiTSWithoutSDA<Int32>;
+template class MEDCoupling::MEDFileTemplateFieldMultiTSWithoutSDA<Int64>;
template class MEDCoupling::MEDFileTemplateFieldMultiTSWithoutSDA<float>;
template class MEDCoupling::MEDFileTemplateFieldMultiTSWithoutSDA<double>;
-template class MEDCoupling::MEDFileNDTemplateFieldMultiTSWithoutSDA<int>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTSWithoutSDA<Int32>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTSWithoutSDA<Int64>;
template class MEDCoupling::MEDFileNDTemplateFieldMultiTSWithoutSDA<float>;
-template class MEDCoupling::MEDFileTemplateFieldMultiTS<int>;
+template class MEDCoupling::MEDFileTemplateFieldMultiTS<Int32>;
+template class MEDCoupling::MEDFileTemplateFieldMultiTS<Int64>;
template class MEDCoupling::MEDFileTemplateFieldMultiTS<float>;
template class MEDCoupling::MEDFileTemplateFieldMultiTS<double>;
-template class MEDCoupling::MEDFileNDTemplateFieldMultiTS<int>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTS<Int32>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTS<Int64>;
template class MEDCoupling::MEDFileNDTemplateFieldMultiTS<float>;
extern INTERP_KERNEL::NormalizedCellType ConvertGeometryType(med_geometry_type geotype);
ret->_content=c; c->incrRef();
return ret.retn();
}
+ if(dynamic_cast<const MEDFileInt64FieldMultiTSWithoutSDA *>(c))
+ {
+ MCAuto<MEDFileInt64FieldMultiTS> ret(MEDFileInt64FieldMultiTS::New());
+ ret->_content=c; c->incrRef();
+ return ret.retn();
+ }
if(dynamic_cast<const MEDFileFloatFieldMultiTSWithoutSDA *>(c))
{
MCAuto<MEDFileFloatFieldMultiTS> ret(MEDFileFloatFieldMultiTS::New());
std::size_t sz(fmtss.size());
std::vector<const MEDFileFieldMultiTS *> fmtss1;
std::vector<const MEDFileInt32FieldMultiTS *> fmtss2;
+ std::vector<const MEDFileInt64FieldMultiTS *> fmtss3;
for(std::vector<const MEDFileAnyTypeFieldMultiTS *>::const_iterator it=fmtss.begin();it!=fmtss.end();it++)
{
if(!(*it))
fmtss2.push_back(elt2);
continue;
}
+ const MEDFileInt64FieldMultiTS *elt3(dynamic_cast<const MEDFileInt64FieldMultiTS *>(*it));
+ if(elt3)
+ {
+ fmtss3.push_back(elt3);
+ continue;
+ }
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::Aggregate : not recognized type !");
}
- if(fmtss1.size()!=sz && fmtss2.size()!=sz)
+ if(fmtss1.size()!=sz && fmtss2.size()!=sz && fmtss3.size()!=sz)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::Aggregate : type of data is not homogeneous !");
if(fmtss1.size()==sz)
return AggregateHelperFMTS<double>(fmtss1,dts);
if(fmtss2.size()!=sz)
- return AggregateHelperFMTS<int>(fmtss2,dts);
+ return AggregateHelperFMTS<Int32>(fmtss2,dts);
+ if(fmtss3.size()!=sz)
+ return AggregateHelperFMTS<Int64>(fmtss3,dts);
throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::Aggregate : not implemented yet !");
}