template class MEDCoupling::MEDFileField1TSTemplateWithoutSDA<int>;
template class MEDCoupling::MEDFileField1TSTemplateWithoutSDA<float>;
template class MEDCoupling::MEDFileField1TSTemplateWithoutSDA<double>;
+template class MEDCoupling::MEDFileField1TSNDTemplateWithoutSDA<int>;
+template class MEDCoupling::MEDFileField1TSNDTemplateWithoutSDA<float>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTSWithoutSDA<int>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTSWithoutSDA<float>;
template class MEDCoupling::MEDFileTemplateField1TS<int>;
+template class MEDCoupling::MEDFileTemplateField1TS<float>;
template class MEDCoupling::MEDFileTemplateField1TS<double>;
+template class MEDCoupling::MEDFileNDTemplateField1TS<int>;
+template class MEDCoupling::MEDFileNDTemplateField1TS<float>;
template class MEDCoupling::MEDFileTemplateFieldMultiTS<int>;
+template class MEDCoupling::MEDFileTemplateFieldMultiTS<float>;
template class MEDCoupling::MEDFileTemplateFieldMultiTS<double>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTS<int>;
+template class MEDCoupling::MEDFileNDTemplateFieldMultiTS<float>;
const char MEDFileField1TSWithoutSDA::TYPE_STR[]="FLOAT64";
const char MEDFileIntField1TSWithoutSDA::TYPE_STR[]="INT32";
}
MEDFileIntField1TSWithoutSDA::MEDFileIntField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order,
- const std::vector<std::string>& infos):MEDFileField1TSTemplateWithoutSDA<int>(fieldName,meshName,csit,iteration,order)
+ const std::vector<std::string>& infos):MEDFileField1TSNDTemplateWithoutSDA<int>(fieldName,meshName,csit,iteration,order,infos)
{
DataArrayInt *arr(getOrCreateAndGetArrayTemplate());
arr->setInfoAndChangeNbOfCompo(infos);
return TYPE_STR;
}
-MEDFileField1TSWithoutSDA *MEDFileIntField1TSWithoutSDA::convertToDouble() const
-{
- MCAuto<MEDFileField1TSWithoutSDA> ret(new MEDFileField1TSWithoutSDA);
- ret->MEDFileAnyTypeField1TSWithoutSDA::operator =(*this);
- ret->deepCpyLeavesFrom(*this);
- if(_arr.isNotNull())
- {
- MCAuto<DataArrayDouble> arr2(_arr->convertToDblArr());
- ret->setArray(arr2);
- }
- return ret.retn();
-}
-
/*!
* Returns a pointer to the underground DataArrayInt instance and a
* sequence describing parameters of a support of each part of \a this field. The
}
MEDFileFloatField1TSWithoutSDA::MEDFileFloatField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order,
- const std::vector<std::string>& infos):MEDFileField1TSTemplateWithoutSDA<float>(fieldName,meshName,csit,iteration,order)
+ const std::vector<std::string>& infos):MEDFileField1TSNDTemplateWithoutSDA<float>(fieldName,meshName,csit,iteration,order,infos)
{
DataArrayFloat *arr(getOrCreateAndGetArrayTemplate());
arr->setInfoAndChangeNbOfCompo(infos);
return TYPE_STR;
}
-MEDFileField1TSWithoutSDA *MEDFileFloatField1TSWithoutSDA::convertToDouble() const
-{
- MCAuto<MEDFileField1TSWithoutSDA> ret(new MEDFileField1TSWithoutSDA);
- ret->MEDFileAnyTypeField1TSWithoutSDA::operator =(*this);
- ret->deepCpyLeavesFrom(*this);
- if(_arr.isNotNull())
- {
- MCAuto<DataArrayDouble> arr2(_arr->convertToDblArr());
- ret->setArray(arr2);
- }
- return ret.retn();
-}
-
/*!
* Returns a pointer to the underground DataArrayFloat instance and a
* sequence describing parameters of a support of each part of \a this field. The
}
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] !";
+ 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] !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
ret=MEDFileIntField1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector<std::string>());
break;
}
+ case MED_NODE://6432
+ {
+ ret=MEDFileFloatField1TSWithoutSDA::New(fieldName,meshName,-1,iteration,order,std::vector<std::string>());
+ break;
+ }
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] !";
+ 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] !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
//= MEDFileIntField1TS
-MEDFileIntField1TS::MEDFileIntField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms)
-try:MEDFileTemplateField1TS<int>(fid,loadAll,ms)
-{
-}
-catch(INTERP_KERNEL::Exception& e)
-{ throw e; }
-
-MEDFileIntField1TS::MEDFileIntField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms)
-try:MEDFileTemplateField1TS<int>(fid,fieldName,loadAll,ms)
-{
-}
-catch(INTERP_KERNEL::Exception& e)
-{ throw e; }
-
-MEDFileIntField1TS::MEDFileIntField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms)
-try:MEDFileTemplateField1TS<int>(fid,fieldName,iteration,order,loadAll,ms)
-{
-}
-catch(INTERP_KERNEL::Exception& e)
-{ throw e; }
-
-/*!
- * 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::MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent):MEDFileTemplateField1TS<int>(other,shallowCopyOfContent)
-{
-}
-
-MEDFileIntField1TS *MEDFileIntField1TS::shallowCpy() const
-{
- return new MEDFileIntField1TS(*this);
-}
-
-/*!
- * This method performs a copy with datatype modification ( int32->float64 ) of \a this. The globals information are copied
- * following the given input policy.
- *
- * \param [in] isDeepCpyGlobs - a boolean that indicates the behaviour concerning globals (profiles and localizations)
- * By default (true) the globals are deeply copied.
- * \return MEDFileField1TS * - a new object that is the result of the conversion of \a this to float64 field.
- */
-MEDFileField1TS *MEDFileIntField1TS::convertToDouble(bool isDeepCpyGlobs) const
-{
- MCAuto<MEDFileField1TS> ret;
- const MEDFileAnyTypeField1TSWithoutSDA *content(_content);
- if(content)
- {
- const MEDFileIntField1TSWithoutSDA *contc=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(content);
- if(!contc)
- throw INTERP_KERNEL::Exception("MEDFileIntField1TS::convertToInt : the content inside this is not INT32 ! This is incoherent !");
- MCAuto<MEDFileField1TSWithoutSDA> newc(contc->convertToDouble());
- ret=static_cast<MEDFileField1TS *>(MEDFileAnyTypeField1TS::BuildNewInstanceFromContent((MEDFileField1TSWithoutSDA *)newc));
- }
- else
- ret=MEDFileField1TS::New();
- if(isDeepCpyGlobs)
- ret->deepCpyGlobs(*this);
- else
- ret->shallowCpyGlobs(*this);
- return ret.retn();
-}
-
MCAuto<MEDCouplingFieldDouble> MEDFileIntField1TS::ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f)
{
if(!f)
throw INTERP_KERNEL::Exception("MEDFileIntField1TS::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->setTime(t0,t1,t2); ret->setTimeUnit(tu);
return ret;
}
//= MEDFileFloatField1TS
-MEDFileFloatField1TS::MEDFileFloatField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms)
-try:MEDFileTemplateField1TS<float>(fid,loadAll,ms)
-{
-}
-catch(INTERP_KERNEL::Exception& e)
-{ throw e; }
-
-MEDFileFloatField1TS::MEDFileFloatField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms)
-try:MEDFileTemplateField1TS<float>(fid,fieldName,loadAll,ms)
-{
-}
-catch(INTERP_KERNEL::Exception& e)
-{ throw e; }
-
-MEDFileFloatField1TS::MEDFileFloatField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms)
-try:MEDFileTemplateField1TS<float>(fid,fieldName,iteration,order,loadAll,ms)
-{
-}
-catch(INTERP_KERNEL::Exception& e)
-{ throw e; }
-
-MEDFileFloatField1TS *MEDFileFloatField1TS::shallowCpy() const
-{
- return new MEDFileFloatField1TS(*this);
-}
-
//= MEDFileFloatField1TS
//= MEDFileAnyTypeFieldMultiTSWithoutSDA
_time_steps[i]=MEDFileIntField1TSWithoutSDA::New(getName(),getMeshName(),i+1,numdt,numo,_infos);
break;
}
+ case MED_NODE://6432
+ {
+ _time_steps[i]=MEDFileFloatField1TSWithoutSDA::New(getName(),getMeshName(),i+1,numdt,numo,_infos);
+ break;
+ }
default:
- throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysRecursively : managed field type are : FLOAT64, INT32 !");
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysRecursively : managed field type are : FLOAT64, INT32, FLOAT32 !");
}
if(loadAll)
_time_steps[i]->loadStructureAndBigArraysRecursively(fid,*this,ms,entities);
ret=new MEDFileIntFieldMultiTSWithoutSDA(fid,i,loadAll,ms,entities);
break;
}
+ case MED_NODE://6432
+ {
+ ret=new MEDFileFloatFieldMultiTSWithoutSDA(fid,i,loadAll,ms,entities);
+ break;
+ }
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] !";
+ 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] !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
ret=new MEDFileIntFieldMultiTSWithoutSDA(fid,0,loadAll,ms,0);
break;
}
+ case MED_NODE://6432
+ {
+ ret=new MEDFileFloatFieldMultiTSWithoutSDA(fid,0,loadAll,ms,0);
+ break;
+ }
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] !";
+ 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] !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
throw e;
}
-//= MEDFileIntFieldMultiTSWithoutSDA
-
-MEDFileFieldMultiTSWithoutSDA *MEDFileIntFieldMultiTSWithoutSDA::convertToDouble() const
-{
- MCAuto<MEDFileFieldMultiTSWithoutSDA> ret(new MEDFileFieldMultiTSWithoutSDA);
- ret->MEDFileAnyTypeFieldMultiTSWithoutSDA::operator =(*this);
- int i=0;
- for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++,i++)
- {
- const MEDFileAnyTypeField1TSWithoutSDA *eltToConv(*it);
- if(eltToConv)
- {
- const MEDFileIntField1TSWithoutSDA *eltToConvC=dynamic_cast<const MEDFileIntField1TSWithoutSDA *>(eltToConv);
- if(!eltToConvC)
- throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTSWithoutSDA::convertToInt : presence of an invalid 1TS type ! Should be of type INT32 !");
- MCAuto<MEDFileAnyTypeField1TSWithoutSDA> elt=eltToConvC->convertToDouble();
- ret->setIteration(i,elt);
- }
- }
- return ret.retn();
-}
-
//= MEDFileAnyTypeFieldMultiTS
/*!
//= MEDFileIntFieldMultiTS
-/*!
- * This method performs a copy with datatype modification ( int32->float64 ) of \a this. The globals information are copied
- * following the given input policy.
- *
- * \param [in] isDeepCpyGlobs - a boolean that indicates the behaviour concerning globals (profiles and localizations)
- * By default (true) the globals are deeply copied.
- * \return MEDFileFieldMultiTS * - a new object that is the result of the conversion of \a this to float64 field.
- */
-MEDFileFieldMultiTS *MEDFileIntFieldMultiTS::convertToDouble(bool isDeepCpyGlobs) const
-{
- MCAuto<MEDFileFieldMultiTS> ret;
- const MEDFileAnyTypeFieldMultiTSWithoutSDA *content(_content);
- if(content)
- {
- const MEDFileIntFieldMultiTSWithoutSDA *contc=dynamic_cast<const MEDFileIntFieldMultiTSWithoutSDA *>(content);
- if(!contc)
- throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTS::convertToInt : the content inside this is not INT32 ! This is incoherent !");
- MCAuto<MEDFileFieldMultiTSWithoutSDA> newc(contc->convertToDouble());
- ret=static_cast<MEDFileFieldMultiTS *>(MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent((MEDFileFieldMultiTSWithoutSDA *)newc));
- }
- else
- ret=MEDFileFieldMultiTS::New();
- if(isDeepCpyGlobs)
- ret->deepCpyGlobs(*this);
- else
- ret->shallowCpyGlobs(*this);
- return ret.retn();
-}
-
//= MEDFileFields
MEDFileFields *MEDFileFields::New()
_fields[i]=MEDFileIntFieldMultiTSWithoutSDA::New(fid,fieldName,meshName,typcha,infos,nbOfStep,dtunit,loadAll,ms,entities);
break;
}
+ case MED_NODE://6432
+ {
+ _fields[i]=MEDFileFloatFieldMultiTSWithoutSDA::New(fid,fieldName,meshName,typcha,infos,nbOfStep,dtunit,loadAll,ms,entities);
+ break;
+ }
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] !";
+ 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] !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
{
protected:
MEDFileField1TSTemplateWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order):MEDFileAnyTypeField1TSWithoutSDA(fieldName,meshName,csit,iteration,order) { }
- MEDFileField1TSTemplateWithoutSDA():MEDFileAnyTypeField1TSWithoutSDA() { }
+ MEDFileField1TSTemplateWithoutSDA() { }
public:
MEDLOADER_EXPORT void setArray(DataArray *arr);
MEDLOADER_EXPORT DataArray *createNewEmptyDataArrayInstance() const;
static const char TYPE_STR[];
};
+ template<class T>
+ class MEDFileField1TSNDTemplateWithoutSDA : public MEDFileField1TSTemplateWithoutSDA<T>
+ {
+ public:
+ MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *convertToDouble() const;
+ protected:
+ MEDFileField1TSNDTemplateWithoutSDA() { }
+ MEDFileField1TSNDTemplateWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos):MEDFileField1TSTemplateWithoutSDA<T>(fieldName,meshName,csit,iteration,order) { }
+ };
+
/*!
* SDA is for Shared Data Arrays such as profiles.
*/
- class MEDFileIntField1TSWithoutSDA : public MEDFileField1TSTemplateWithoutSDA<int>
+ class MEDFileIntField1TSWithoutSDA : public MEDFileField1TSNDTemplateWithoutSDA<int>
{
public:
MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA();
MEDLOADER_EXPORT const char *getTypeStr() const;
MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
MEDLOADER_EXPORT DataArrayInt *getUndergroundDataArrayIntExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
- MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *convertToDouble() const;
protected:
MEDFileIntField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
public:
/*!
* SDA is for Shared Data Arrays such as profiles.
*/
- class MEDFileFloatField1TSWithoutSDA : public MEDFileField1TSTemplateWithoutSDA<float>
+ class MEDFileFloatField1TSWithoutSDA : public MEDFileField1TSNDTemplateWithoutSDA<float>
{
public:
MEDLOADER_EXPORT MEDFileFloatField1TSWithoutSDA();
MEDLOADER_EXPORT const char *getTypeStr() const;
MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
MEDLOADER_EXPORT DataArrayFloat *getUndergroundDataArrayFloatExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
- MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *convertToDouble() const;
protected:
MEDFileFloatField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector<std::string>& infos);
public:
MEDFileField1TS() { }
};
- class MEDFileIntField1TS : public MEDFileTemplateField1TS<int>
+ template<class T>
+ class MEDFileNDTemplateField1TS : public MEDFileTemplateField1TS<T>
{
- friend class MEDFileTemplateField1TS<int>;
public:
MEDLOADER_EXPORT MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const;
- MEDLOADER_EXPORT MEDFileIntField1TS *shallowCpy() const;
+ protected:
+ ~MEDFileNDTemplateField1TS() { }
+ MEDFileNDTemplateField1TS() { }
+ MEDFileNDTemplateField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileTemplateField1TS<T>(fid,loadAll,ms) { }
+ MEDFileNDTemplateField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms):MEDFileTemplateField1TS<T>(fid,fieldName,loadAll,ms) { }
+ MEDFileNDTemplateField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms):MEDFileTemplateField1TS<T>(fid,fieldName,iteration,order,loadAll,ms) { }
+ MEDFileNDTemplateField1TS(const typename MLFieldTraits<T>::F1TSWSDAType& other, bool shallowCopyOfContent):MEDFileTemplateField1TS<T>(other,shallowCopyOfContent) { }
+ };
+
+ class MEDFileIntField1TS : public MEDFileNDTemplateField1TS<int>
+ {
+ friend class MEDFileTemplateField1TS<int>;
+ public:
+ MEDLOADER_EXPORT MEDFileIntField1TS *shallowCpy() const { return new MEDFileIntField1TS(*this); }
public:
MEDLOADER_EXPORT static MCAuto<MEDCouplingFieldDouble> ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f);
private:
private:
~MEDFileIntField1TS() { }
MEDFileIntField1TS() { }
- MEDFileIntField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
- MEDFileIntField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
- MEDFileIntField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
- MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
+ MEDFileIntField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<int>(fid,loadAll,ms) { }
+ MEDFileIntField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<int>(fid,fieldName,loadAll,ms) { }
+ MEDFileIntField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<int>(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<int>(other,shallowCopyOfContent) { }
};
- class MEDFileFloatField1TS : public MEDFileTemplateField1TS<float>
+ class MEDFileFloatField1TS : public MEDFileNDTemplateField1TS<float>
{
friend class MEDFileTemplateField1TS<float>;
private:
med_field_type getMEDFileFieldType() const { return MED_INT32; }//6432
- MEDLOADER_EXPORT MEDFileFloatField1TS *shallowCpy() const;
+ MEDLOADER_EXPORT MEDFileFloatField1TS *shallowCpy() const { return new MEDFileFloatField1TS(*this); }
private:
~MEDFileFloatField1TS() { }
MEDFileFloatField1TS() { }
- MEDFileFloatField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
- MEDFileFloatField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms);
- MEDFileFloatField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms);
- MEDFileFloatField1TS(const MEDFileFloatField1TSWithoutSDA& other, bool shallowCopyOfContent);
+ MEDFileFloatField1TS(med_idt fid, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<float>(fid,loadAll,ms) { }
+ MEDFileFloatField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<float>(fid,fieldName,loadAll,ms) { }
+ MEDFileFloatField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms):MEDFileNDTemplateField1TS<float>(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
+ */
+ MEDFileFloatField1TS(const MEDFileFloatField1TSWithoutSDA& other, bool shallowCopyOfContent):MEDFileNDTemplateField1TS<float>(other,shallowCopyOfContent) { }
};
class MEDFileAnyTypeFieldMultiTSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA() { }
};
- class MEDFileIntFieldMultiTSWithoutSDA : public MEDFileTemplateFieldMultiTSWithoutSDA<int>
+ template<class T>
+ class MEDFileNDTemplateFieldMultiTSWithoutSDA : public MEDFileTemplateFieldMultiTSWithoutSDA<T>
{
- friend class MEDFileTemplateFieldMultiTSWithoutSDA<int>;
public:
- MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileTemplateFieldMultiTSWithoutSDA<int>(fid,fieldId,loadAll,ms,entities) { }
MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA *convertToDouble() const;
+ protected:
+ MEDFileNDTemplateFieldMultiTSWithoutSDA() { }
+ MEDFileNDTemplateFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileTemplateFieldMultiTSWithoutSDA<T>(fid,fieldId,loadAll,ms,entities) { }
+ MEDFileNDTemplateFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileTemplateFieldMultiTSWithoutSDA<T>(fieldName,meshName) { }
+ MEDFileNDTemplateFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileTemplateFieldMultiTSWithoutSDA<T>(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { }
+ };
+
+ class MEDFileIntFieldMultiTSWithoutSDA : public MEDFileNDTemplateFieldMultiTSWithoutSDA<int>
+ {
+ friend class MEDFileTemplateFieldMultiTSWithoutSDA<int>;
+ public:
+ MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA<int>(fid,fieldId,loadAll,ms,entities) { }
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const { return new MEDFileIntFieldMultiTSWithoutSDA(*this); }
protected:
- MEDFileIntFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileTemplateFieldMultiTSWithoutSDA<int>(fieldName,meshName) { }
- MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileTemplateFieldMultiTSWithoutSDA<int>(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { }
+ MEDFileIntFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileNDTemplateFieldMultiTSWithoutSDA<int>(fieldName,meshName) { }
+ MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA<int>(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { }
med_field_type getMEDFileFieldType() const { return MED_INT32; }
public:
MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA() { }
};
- class MEDFileFloatFieldMultiTSWithoutSDA : public MEDFileTemplateFieldMultiTSWithoutSDA<float>
+ class MEDFileFloatFieldMultiTSWithoutSDA : public MEDFileNDTemplateFieldMultiTSWithoutSDA<float>
{
- friend class MEDFileTemplateFieldMultiTSWithoutSDA<int>;
+ friend class MEDFileTemplateFieldMultiTSWithoutSDA<float>;
public:
- MEDLOADER_EXPORT MEDFileFloatFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileTemplateFieldMultiTSWithoutSDA<float>(fid,fieldId,loadAll,ms,entities) { }
- MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA *convertToDouble() const;
+ MEDLOADER_EXPORT MEDFileFloatFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA<float>(fid,fieldId,loadAll,ms,entities) { }
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const { return new MEDFileFloatFieldMultiTSWithoutSDA(*this); }
protected:
- MEDFileFloatFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileTemplateFieldMultiTSWithoutSDA<float>(fieldName,meshName) { }
- MEDFileFloatFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileTemplateFieldMultiTSWithoutSDA<float>(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { }
+ MEDFileFloatFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileNDTemplateFieldMultiTSWithoutSDA<float>(fieldName,meshName) { }
+ MEDFileFloatFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA<float>(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { }
med_field_type getMEDFileFieldType() const { return MED_INT32; }//6432
public:
MEDLOADER_EXPORT MEDFileFloatFieldMultiTSWithoutSDA() { }
template<class T>
class MEDFileNDTemplateFieldMultiTS : public MEDFileTemplateFieldMultiTS<T>
{
+ public:
+ MEDLOADER_EXPORT MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
protected:
~MEDFileNDTemplateFieldMultiTS() { }
MEDFileNDTemplateFieldMultiTS() { }
friend class MEDFileTemplateFieldMultiTS<int>;
public:
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const { return new MEDFileIntFieldMultiTS(*this); }
- MEDLOADER_EXPORT MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const;
MEDLOADER_EXPORT MEDFileIntFieldMultiTS *buildNewEmpty() const { return buildNewEmptyImpl(); }
private:
~MEDFileIntFieldMultiTS() { }
}
}
+ ///////////////////////////////////////////////////////
+
+ template<class T>
+ MEDFileField1TSWithoutSDA *MEDFileField1TSNDTemplateWithoutSDA<T>::convertToDouble() const
+ {
+ MCAuto<MEDFileField1TSWithoutSDA> ret(new MEDFileField1TSWithoutSDA);
+ ret->MEDFileAnyTypeField1TSWithoutSDA::operator =(*this);
+ ret->deepCpyLeavesFrom(*this);
+ if(this->_arr.isNotNull())
+ {
+ MCAuto<DataArrayDouble> arr2(this->_arr->convertToDblArr());
+ ret->setArray(arr2);
+ }
+ return ret.retn();
+ }
+
+ ///////////////////////////////////////////////////////
+
template<class T>
MEDFileTemplateField1TS<T>::MEDFileTemplateField1TS()
{
}
return ret.retn();
}
+
+ //////////////////////////
+
+ /*!
+ * This method performs a copy with datatype modification ( int32->float64 ) of \a this. The globals information are copied
+ * following the given input policy.
+ *
+ * \param [in] isDeepCpyGlobs - a boolean that indicates the behaviour concerning globals (profiles and localizations)
+ * By default (true) the globals are deeply copied.
+ * \return MEDFileField1TS * - a new object that is the result of the conversion of \a this to float64 field.
+ */
+ template<class T>
+ MEDFileField1TS *MEDFileNDTemplateField1TS<T>::convertToDouble(bool isDeepCpyGlobs) const
+ {
+ MCAuto<MEDFileField1TS> ret;
+ const MEDFileAnyTypeField1TSWithoutSDA *content(this->_content);
+ if(content)
+ {
+ const typename MLFieldTraits<T>::F1TSWSDAType *contc(dynamic_cast<const typename MLFieldTraits<T>::F1TSWSDAType *>(content));
+ if(!contc)
+ {
+ std::ostringstream oss; oss << "MEDFileNDTemplateField1TS<T>::convertToDouble : the content inside this is not " << MLFieldTraits<T>::F1TSWSDAType::TYPE_STR << " ! This is incoherent !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ MCAuto<MEDFileField1TSWithoutSDA> newc(contc->convertToDouble());
+ ret=static_cast<MEDFileField1TS *>(MEDFileAnyTypeField1TS::BuildNewInstanceFromContent((MEDFileField1TSWithoutSDA *)newc));
+ }
+ else
+ ret=MEDFileField1TS::New();
+ if(isDeepCpyGlobs)
+ ret->deepCpyGlobs(*this);
+ else
+ ret->shallowCpyGlobs(*this);
+ return ret.retn();
+ }
+
+ //////////////////////////
+
+ template<class T>
+ typename MLFieldTraits<T>::FMTSWSDAType *MEDFileTemplateFieldMultiTSWithoutSDA<T>::New(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities)
+ {
+ return new typename MLFieldTraits<T>::FMTSWSDAType(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities);
+ }
+
+ template<class T>
+ void MEDFileTemplateFieldMultiTSWithoutSDA<T>::checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const
+ {
+ if(!f1ts)
+ throw INTERP_KERNEL::Exception("MEDFileFieldMultiTSWithoutSDA::checkCoherencyOfType : input field1TS is NULL ! Impossible to check !");
+ const typename MLFieldTraits<T>::F1TSWSDAType *f1tsC(dynamic_cast<const typename MLFieldTraits<T>::F1TSWSDAType *>(f1ts));
+ if(!f1tsC)
+ {
+ std::ostringstream oss; oss << "MEDFileFieldMultiTSWithoutSDA::checkCoherencyOfType : the input field1TS is not a " << MLFieldTraits<T>::F1TSWSDAType::TYPE_STR << " type !";
+ throw INTERP_KERNEL::Exception(oss.str());
+ }
+ }
+
+ template<class T>
+ const char *MEDFileTemplateFieldMultiTSWithoutSDA<T>::getTypeStr() const
+ {
+ return MLFieldTraits<T>::F1TSWSDAType::TYPE_STR;
+ }
+
+ template<class T>
+ MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileTemplateFieldMultiTSWithoutSDA<T>::createNew() const
+ {
+ return new typename MLFieldTraits<T>::FMTSWSDAType;
+ }
+
+ template<class T>
+ MEDFileAnyTypeField1TSWithoutSDA *MEDFileTemplateFieldMultiTSWithoutSDA<T>::createNew1TSWithoutSDAEmptyInstance() const
+ {
+ return new typename MLFieldTraits<T>::F1TSWSDAType;
+ }
+
+ //////////////////////////
+
+ template<class T>
+ MEDFileFieldMultiTSWithoutSDA *MEDFileNDTemplateFieldMultiTSWithoutSDA<T>::convertToDouble() const
+ {
+ MCAuto<MEDFileFieldMultiTSWithoutSDA> ret(new MEDFileFieldMultiTSWithoutSDA);
+ ret->MEDFileAnyTypeFieldMultiTSWithoutSDA::operator =(*this);
+ int i=0;
+ for(std::vector< MCAuto<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=this->_time_steps.begin();it!=this->_time_steps.end();it++,i++)
+ {
+ const MEDFileAnyTypeField1TSWithoutSDA *eltToConv(*it);
+ if(eltToConv)
+ {
+ const typename MLFieldTraits<T>::F1TSWSDAType *eltToConvC(dynamic_cast<const typename MLFieldTraits<T>::F1TSWSDAType *>(eltToConv));
+ if(!eltToConvC)
+ throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTSWithoutSDA::convertToInt : presence of an invalid 1TS type ! Should be of type INT32 !");
+ MCAuto<MEDFileAnyTypeField1TSWithoutSDA> elt(eltToConvC->convertToDouble());
+ ret->setIteration(i,elt);
+ }
+ }
+ return ret.retn();
+ }
//////////////////////////
throw INTERP_KERNEL::Exception(oss.str());
}
}
-
- template<class T>
- typename MLFieldTraits<T>::FMTSWSDAType *MEDFileTemplateFieldMultiTSWithoutSDA<T>::New(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities)
- {
- return new typename MLFieldTraits<T>::FMTSWSDAType(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities);
- }
-
+
+ //////////////////////////
+
+ /*!
+ * This method performs a copy with datatype modification ( int32->float64 ) of \a this. The globals information are copied
+ * following the given input policy.
+ *
+ * \param [in] isDeepCpyGlobs - a boolean that indicates the behaviour concerning globals (profiles and localizations)
+ * By default (true) the globals are deeply copied.
+ * \return MEDFileFieldMultiTS * - a new object that is the result of the conversion of \a this to float64 field.
+ */
template<class T>
- void MEDFileTemplateFieldMultiTSWithoutSDA<T>::checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const
+ MEDFileFieldMultiTS *MEDFileNDTemplateFieldMultiTS<T>::convertToDouble(bool isDeepCpyGlobs) const
{
- if(!f1ts)
- throw INTERP_KERNEL::Exception("MEDFileFieldMultiTSWithoutSDA::checkCoherencyOfType : input field1TS is NULL ! Impossible to check !");
- const typename MLFieldTraits<T>::F1TSWSDAType *f1tsC(dynamic_cast<const typename MLFieldTraits<T>::F1TSWSDAType *>(f1ts));
- if(!f1tsC)
+ MCAuto<MEDFileFieldMultiTS> ret;
+ const MEDFileAnyTypeFieldMultiTSWithoutSDA *content(this->_content);
+ if(content)
{
- std::ostringstream oss; oss << "MEDFileFieldMultiTSWithoutSDA::checkCoherencyOfType : the input field1TS is not a " << MLFieldTraits<T>::F1TSWSDAType::TYPE_STR << " type !";
- throw INTERP_KERNEL::Exception(oss.str());
+ const typename MLFieldTraits<T>::FMTSWSDAType *contc=dynamic_cast<const typename MLFieldTraits<T>::FMTSWSDAType *>(content);
+ if(!contc)
+ throw INTERP_KERNEL::Exception("MEDFileIntFieldMultiTS::convertToInt : the content inside this is not INT32 ! This is incoherent !");
+ MCAuto<MEDFileFieldMultiTSWithoutSDA> newc(contc->convertToDouble());
+ ret=static_cast<MEDFileFieldMultiTS *>(MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent((MEDFileFieldMultiTSWithoutSDA *)newc));
}
- }
-
- template<class T>
- const char *MEDFileTemplateFieldMultiTSWithoutSDA<T>::getTypeStr() const
- {
- return MLFieldTraits<T>::F1TSWSDAType::TYPE_STR;
- }
-
- template<class T>
- MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileTemplateFieldMultiTSWithoutSDA<T>::createNew() const
- {
- return new typename MLFieldTraits<T>::FMTSWSDAType;
- }
-
- template<class T>
- MEDFileAnyTypeField1TSWithoutSDA *MEDFileTemplateFieldMultiTSWithoutSDA<T>::createNew1TSWithoutSDAEmptyInstance() const
- {
- return new typename MLFieldTraits<T>::F1TSWSDAType;
+ else
+ ret=MEDFileFieldMultiTS::New();
+ if(isDeepCpyGlobs)
+ ret->deepCpyGlobs(*this);
+ else
+ ret->shallowCpyGlobs(*this);
+ return ret.retn();
}
}
def MEDCouplingMEDFileIntFieldMultiTSnew(cls,*args):
import _MEDLoader
return _MEDLoader.MEDFileIntFieldMultiTS____new___(cls,args)
+def MEDCouplingMEDFileFloatField1TSnew(cls,*args):
+ import _MEDLoader
+ return _MEDLoader.MEDFileFloatField1TS____new___(cls,args)
+def MEDCouplingMEDFileFloatFieldMultiTSnew(cls,*args):
+ import _MEDLoader
+ return _MEDLoader.MEDFileFloatFieldMultiTS____new___(cls,args)
def MEDCouplingMEDFileParametersnew(cls,*args):
import _MEDLoader
return _MEDLoader.MEDFileParameters____new___(cls,args)
del MEDCouplingMEDFileIntField1TSnew
MEDFileIntFieldMultiTS.__new__=classmethod(MEDCouplingMEDFileIntFieldMultiTSnew)
del MEDCouplingMEDFileIntFieldMultiTSnew
+MEDFileFloatField1TS.__new__=classmethod(MEDCouplingMEDFileFloatField1TSnew)
+del MEDCouplingMEDFileFloatField1TSnew
+MEDFileFloatFieldMultiTS.__new__=classmethod(MEDCouplingMEDFileFloatFieldMultiTSnew)
+del MEDCouplingMEDFileFloatFieldMultiTSnew
MEDFileParameters.__new__=classmethod(MEDCouplingMEDFileParametersnew)
del MEDCouplingMEDFileParametersnew
%}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Anthony Geay (CEA/DEN)
+// Author : Anthony Geay (EDF R&D)
%module MEDLoader
%newobject MEDCoupling::MEDFileFieldMultiTS::getFieldAtLevelOld;
%newobject MEDCoupling::MEDFileFieldMultiTS::getUndergroundDataArray;
%newobject MEDCoupling::MEDFileFieldMultiTS::convertToInt;
+
%newobject MEDCoupling::MEDFileIntFieldMultiTS::New;
%newobject MEDCoupling::MEDFileIntFieldMultiTS::field;
%newobject MEDCoupling::MEDFileIntFieldMultiTS::LoadSpecificEntities;
%newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldOnMeshAtLevel;
%newobject MEDCoupling::MEDFileIntFieldMultiTS::getFieldAtLevelOld;
+%newobject MEDCoupling::MEDFileFloatFieldMultiTS::New;
+%newobject MEDCoupling::MEDFileFloatFieldMultiTS::field;
+%newobject MEDCoupling::MEDFileFloatFieldMultiTS::LoadSpecificEntities;
+%newobject MEDCoupling::MEDFileFloatFieldMultiTS::getUndergroundDataArray;
+%newobject MEDCoupling::MEDFileFloatFieldMultiTS::convertToDouble;
+%newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevel;
+%newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtTopLevel;
+%newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldOnMeshAtLevel;
+%newobject MEDCoupling::MEDFileFloatFieldMultiTS::getFieldAtLevelOld;
+
%newobject MEDCoupling::MEDFileAnyTypeField1TS::New;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::NewAdv;
%newobject MEDCoupling::MEDFileAnyTypeField1TS::shallowCpy;
%newobject MEDCoupling::MEDFileIntField1TS::getUndergroundDataArray;
%newobject MEDCoupling::MEDFileIntField1TS::convertToDouble;
+%newobject MEDCoupling::MEDFileFloatField1TS::New;
+%newobject MEDCoupling::MEDFileFloatField1TS::field;
+%newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevel;
+%newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtTopLevel;
+%newobject MEDCoupling::MEDFileFloatField1TS::getFieldOnMeshAtLevel;
+%newobject MEDCoupling::MEDFileFloatField1TS::getFieldAtLevelOld;
+%newobject MEDCoupling::MEDFileFloatField1TS::getUndergroundDataArray;
+%newobject MEDCoupling::MEDFileFloatField1TS::convertToDouble;
+
%newobject MEDCoupling::MEDFileData::New;
%newobject MEDCoupling::MEDFileData::deepCopy;
%newobject MEDCoupling::MEDFileData::getMeshes;
%feature("unref") MEDFileAnyTypeField1TS "$this->decrRef();"
%feature("unref") MEDFileField1TS "$this->decrRef();"
%feature("unref") MEDFileIntField1TS "$this->decrRef();"
+%feature("unref") MEDFileFloatField1TS "$this->decrRef();"
%feature("unref") MEDFileAnyTypeFieldMultiTS "$this->decrRef();"
%feature("unref") MEDFileFieldMultiTS "$this->decrRef();"
%feature("unref") MEDFileIntFieldMultiTS "$this->decrRef();"
+%feature("unref") MEDFileFloatFieldMultiTS "$this->decrRef();"
%feature("unref") MEDFileMeshSupports "$this->decrRef();"
%feature("unref") MEDFileStructureElements "$this->decrRef();"
%feature("unref") MEDFileFields "$this->decrRef();"
}
};
+ class MEDFileFloatField1TS : public MEDFileAnyTypeField1TS
+ {
+ public:
+ static MEDFileFloatField1TS *New();
+ static MEDFileFloatField1TS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileFloatField1TS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
+ static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileFloatField1TS *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ //
+ void setFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
+ void setFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldFloat *field(const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ %extend
+ {
+ MEDFileFloatField1TS() throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileFloatField1TS::New();
+ }
+
+ MEDFileFloatField1TS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileFloatField1TS::New(fileName,loadAll);
+ }
+
+ MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileFloatField1TS::New(fileName,fieldName,loadAll);
+ }
+
+ MEDFileFloatField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileFloatField1TS::New(fileName,fieldName,iteration,order,loadAll);
+ }
+
+ MEDFileFloatField1TS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileFloatField1TS::New(db);
+ }
+
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFloatField1TS");
+ }
+
+ std::string __str__() const throw(INTERP_KERNEL::Exception)
+ {
+ return self->simpleRepr();
+ }
+
+ PyObject *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayInt *ret1=0;
+ DataArrayFloat *ret0=self->getFieldWithProfile(type,meshDimRelToMax,mesh,ret1);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ DataArrayFloat *getUndergroundDataArray() const throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayFloat *ret=self->getUndergroundDataArray();
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+ }
+ };
+
class MEDFileAnyTypeFieldMultiTSIterator
{
public:
}
};
+ class MEDFileIntFieldMultiTS;
+
class MEDFileFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
{
public:
//
void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
- MEDCoupling::MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
%extend
{
MEDFileFieldMultiTS()
static MEDFileIntFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
{
std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
- std::size_t sz(tmp.size());
- std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
- for(std::size_t i=0;i<sz;i++)
- {
- entitiesCpp[i].first=(TypeOfField)tmp[i].first;
- entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
- }
+ std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
return MEDFileIntFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
}
}
}
};
+
+ class MEDFileFloatFieldMultiTS : public MEDFileAnyTypeFieldMultiTS
+ {
+ public:
+ static MEDFileFloatFieldMultiTS *New();
+ static MEDFileFloatFieldMultiTS *New(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileFloatFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
+ static MEDFileFloatFieldMultiTS *New(DataArrayByte *db) throw(INTERP_KERNEL::Exception);
+ //
+ void appendFieldNoProfileSBT(const MEDCouplingFieldFloat *field) throw(INTERP_KERNEL::Exception);
+ void appendFieldProfile(const MEDCouplingFieldFloat *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
+ MEDCoupling::MEDFileFieldMultiTS *convertToDouble(bool isDeepCpyGlobs=true) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldDouble *field(int iteration, int order, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldFloat *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldFloat *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldFloat *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ MEDCouplingFieldFloat *getFieldAtLevelOld(TypeOfField type, int iteration, int order, const std::string& mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
+ %extend
+ {
+ MEDFileFloatFieldMultiTS()
+ {
+ return MEDFileFloatFieldMultiTS::New();
+ }
+
+ MEDFileFloatFieldMultiTS(const std::string& fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileFloatFieldMultiTS::New(fileName,loadAll);
+ }
+
+ MEDFileFloatFieldMultiTS(const std::string& fileName, const std::string& fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileFloatFieldMultiTS::New(fileName,fieldName,loadAll);
+ }
+
+ MEDFileFloatFieldMultiTS(DataArrayByte *db) throw(INTERP_KERNEL::Exception)
+ {
+ return MEDFileFloatFieldMultiTS::New(db);
+ }
+
+ // serialization
+ static PyObject *___new___(PyObject *cls, PyObject *args) throw(INTERP_KERNEL::Exception)
+ {
+ return NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(cls,args,"MEDFileFloatFieldMultiTS");
+ }
+
+ static MEDFileFloatFieldMultiTS *LoadSpecificEntities(const std::string& fileName, const std::string& fieldName, PyObject *entities, bool loadAll=true)
+ {
+ std::vector<std::pair<int,int> > tmp(convertTimePairIdsFromPy(entities));
+ std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(convertVecPairIntToVecPairTOFCT(tmp));
+ return MEDFileFloatFieldMultiTS::LoadSpecificEntities(fileName,fieldName,entitiesCpp,loadAll);
+ }
+
+ std::string __str__() const throw(INTERP_KERNEL::Exception)
+ {
+ return self->simpleRepr();
+ }
+
+ PyObject *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayInt *ret1=0;
+ DataArrayFloat *ret0=self->getFieldWithProfile(type,iteration,order,meshDimRelToMax,mesh,ret1);
+ PyObject *ret=PyTuple_New(2);
+ PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayFloat, SWIG_POINTER_OWN | 0 ));
+ PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
+ return ret;
+ }
+
+ DataArrayFloat *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception)
+ {
+ DataArrayFloat *ret=self->getUndergroundDataArray(iteration,order);
+ if(ret)
+ ret->incrRef();
+ return ret;
+ }
+ }
+ };
class MEDFileMeshSupports : public RefCountObject, public MEDFileWritableStandAlone
{
ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileField1TS,owner);
if(dynamic_cast<MEDFileIntField1TS *>(p))
ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileIntField1TS,owner);
+ if(dynamic_cast<MEDFileFloatField1TS *>(p))
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileFloatField1TS,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of MEDFileAnyTypeField1TS on downcast !");
return ret;
ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileFieldMultiTS,owner);
if(dynamic_cast<MEDFileIntFieldMultiTS *>(p))
ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileIntFieldMultiTS,owner);
+ if(dynamic_cast<MEDFileFloatFieldMultiTS *>(p))
+ ret=SWIG_NewPointerObj((void*)p,SWIGTYPE_p_MEDCoupling__MEDFileFloatFieldMultiTS,owner);
if(!ret)
throw INTERP_KERNEL::Exception("Not recognized type of MEDFileAnyTypeFieldMultiTS on downcast !");
return ret;
return ret;
}
+static std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > convertVecPairIntToVecPairTOFCT(const std::vector<std::pair<int,int> >& tmp)
+{
+ std::size_t sz(tmp.size());
+ std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > entitiesCpp(sz);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ entitiesCpp[i].first=(TypeOfField)tmp[i].first;
+ entitiesCpp[i].second=(INTERP_KERNEL::NormalizedCellType)tmp[i].second;
+ }
+ return entitiesCpp;
+}
+
static void converPyListToVecString(PyObject *pyLi, std::vector<std::string>& v)
{
if(PyList_Check(pyLi))