#include "MEDFileMesh.hxx"
#include "MEDLoaderBase.hxx"
#include "MEDFileUtilities.hxx"
+#include "MEDFileSafeCaller.txx"
#include "MEDFileFieldOverView.hxx"
#include "MEDCouplingFieldDouble.hxx"
extern med_geometry_type typmainoeud[1];
extern med_geometry_type typmai3[34];
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
const char MEDFileField1TSWithoutSDA::TYPE_STR[]="FLOAT64";
const char MEDFileIntField1TSWithoutSDA::TYPE_STR[]="INT32";
}
else
{
- if(da3->getNumberOfTuples()!=nbOfEltsInWholeMesh || !da3->isIdentity())
+ if(!da3->isIdentity2(nbOfEltsInWholeMesh))
{
da3->setName(oss.str().c_str());
glob.appendProfile(da3);
{
INTERP_KERNEL::AutoPtr<char> locname(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
int nbi,tmp1;
- med_int nbValsInFile=MEDfieldnValueWithProfileByName(fid,fieldName.c_str(),iteration,order,menti,mgeoti,_profile.c_str(),MED_COMPACT_PFLMODE,&tmp1,locname,&nbi);
+ med_int nbValsInFile(MEDfieldnValueWithProfileByName(fid,fieldName.c_str(),iteration,order,menti,mgeoti,_profile.c_str(),MED_COMPACT_PFLMODE,&tmp1,locname,&nbi));
if(_end-_start!=nbValsInFile*nbi)
{
std::ostringstream oss; oss << "MEDFileFieldPerMeshPerTypePerDisc::goReadZeValuesInFile : The number of tuples to read is " << nbValsInFile << "*" << nbi << " (nb integration points) ! But in data structure it values " << _end-_start << " is expected !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- MEDfieldValueWithProfileRd(fid,fieldName.c_str(),iteration,order,menti,mgeoti,MED_COMPACT_PFLMODE,_profile.c_str(),MED_FULL_INTERLACE,MED_ALL_CONSTITUENT,startFeedingPtr);
+ MEDFILESAFECALLERRD0(MEDfieldValueWithProfileRd,(fid,fieldName.c_str(),iteration,order,menti,mgeoti,MED_COMPACT_PFLMODE,_profile.c_str(),MED_FULL_INTERLACE,MED_ALL_CONSTITUENT,startFeedingPtr));
}
else
{
MED_ALL_CONSTITUENT,MED_FULL_INTERLACE,MED_COMPACT_STMODE,MED_NO_PROFILE,
/*start*/start+1,/*stride*/step,/*count*/1,/*blocksize*/nbOfEltsToLoad,
/*lastblocksize=useless because count=1*/0,&filter);
- MEDfieldValueAdvancedRd(fid,fieldName.c_str(),iteration,order,menti,mgeoti,&filter,startFeedingPtr);
+ MEDFILESAFECALLERRD0(MEDfieldValueAdvancedRd,(fid,fieldName.c_str(),iteration,order,menti,mgeoti,&filter,startFeedingPtr));
MEDfilterClose(&filter);
return ;
}
MED_ALL_CONSTITUENT,MED_FULL_INTERLACE,MED_COMPACT_STMODE,MED_NO_PROFILE,
/*start*/a+1,/*stride*/1,/*count*/1,/*blocksize*/nbOfEltsToLoad,
/*lastblocksize=useless because count=1*/0,&filter);
- MEDfieldValueAdvancedRd(fid,fieldName.c_str(),iteration,order,menti,mgeoti,&filter,reinterpret_cast<unsigned char *>(tmp->getPointer()));
+ MEDFILESAFECALLERRD0(MEDfieldValueAdvancedRd,(fid,fieldName.c_str(),iteration,order,menti,mgeoti,&filter,reinterpret_cast<unsigned char *>(tmp->getPointer())));
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> feeder(DataArrayDouble::New());
feeder->useExternalArrayWithRWAccess(reinterpret_cast<double *>(startFeedingPtr),_nval,nbOfCompo);
feeder->setContigPartOfSelectedValues(0,tmp,myIds);
locToWrite=reinterpret_cast<const unsigned char *>(arrI->getConstPointer()+_start*arr->getNumberOfComponents());
else
throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerTypePerDisc::writeLL : not recognized type of values ! Supported are FLOAT64 and INT32 !");
- MEDfieldValueWithProfileWr(fid,nasc.getName().c_str(),getIteration(),getOrder(),getTime(),menti,mgeoti,
- MED_COMPACT_PFLMODE,_profile.c_str(),_localization.c_str(),MED_FULL_INTERLACE,MED_ALL_CONSTITUENT,_nval,
- locToWrite);
+ MEDFILESAFECALLERWR0(MEDfieldValueWithProfileWr,(fid,nasc.getName().c_str(),getIteration(),getOrder(),getTime(),menti,mgeoti,
+ MED_COMPACT_PFLMODE,_profile.c_str(),_localization.c_str(),MED_FULL_INTERLACE,MED_ALL_CONSTITUENT,_nval,
+ locToWrite));
}
void MEDFileFieldPerMeshPerTypePerDisc::getCoarseData(TypeOfField& type, std::pair<int,int>& dad, std::string& pfl, std::string& loc) const
int nbEntityElts=subIds->getNumberOfTuples();
bool ret2;
MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> eltToAdd=MEDFileFieldPerMeshPerTypePerDisc::
- NewObjectOnSameDiscThanPool(type,(INTERP_KERNEL::NormalizedCellType)newCode[3*(*idIt)],subIds,!subIds->isIdentity() || nbEntityElts!=newCode[3*(*idIt)+1],nbi,
+ NewObjectOnSameDiscThanPool(type,(INTERP_KERNEL::NormalizedCellType)newCode[3*(*idIt)],subIds,!subIds->isIdentity2(newCode[3*(*idIt)+1]),nbi,
offset+offset2,
li,glob,ret2);
ret=ret || ret2;
}
if(type==ON_CELLS)
{
- int nbProfiles2=MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_NODE_ELEMENT,mgeoti,pflName,locName);
+ int nbProfiles2(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_NODE_ELEMENT,mgeoti,pflName,locName));
for(int i=0;i<nbProfiles2;i++)
_field_pm_pt_pd.push_back(MEDFileFieldPerMeshPerTypePerDisc::NewOnRead(this,ON_GAUSS_NE,i,pd));
}
const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes,
const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
- if(da->isIdentity())
- {
- int nbOfTuples=da->getNumberOfTuples();
- if(nbOfTuples==mesh->getNumberOfCells())
- return finishField(type,glob,dads,locs,mesh,isPfl,arrOut,nasc);
- }
+ if(da->isIdentity2(mesh->getNumberOfCells()))
+ return finishField(type,glob,dads,locs,mesh,isPfl,arrOut,nasc);
MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m2=mesh->buildPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
m2->setName(mesh->getName().c_str());
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=finishField(type,glob,dads,locs,m2,isPfl,arrOut,nasc);
const std::vector<std::pair<int,int> >& dads, const std::vector<int>& locs,
const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
- if(da->isIdentity())
- {
- int nbOfTuples=da->getNumberOfTuples();
- if(nbOfTuples==mesh->getNumberOfNodes())//No problem for NORM_ERROR because it is in context of node
- return finishField(ON_NODES,glob,dads,locs,mesh,isPfl,arrOut,nasc);
- }
+ if(da->isIdentity2(mesh->getNumberOfNodes()))
+ return finishField(ON_NODES,glob,dads,locs,mesh,isPfl,arrOut,nasc);
// Treatment of particular case where nodal field on pfl is requested with a meshDimRelToMax=1.
const MEDCouplingUMesh *meshu=dynamic_cast<const MEDCouplingUMesh *>(mesh);
if(meshu)
}
}
-/// @cond INTERNAL
+/// @endcond
MEDFileFieldPerMesh::MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const std::vector< std::pair<TypeOfField,INTERP_KERNEL::NormalizedCellType> > *entities):_mesh_iteration(meshIteration),_mesh_order(meshOrder),
_father(fath)
}
if(MFFPMIter::IsPresenceOfNode(entities))
{
- int nbProfile=MEDfield23nProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_NODE,MED_NONE,meshCsit+1,meshName,pflName,locName);
+ int nbProfile(MEDfield23nProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_NODE,MED_NONE,meshCsit+1,meshName,pflName,locName));
if(nbProfile>0)
{
const PartDefinition *pd(0);
if(id>=(int)_pfls.size())
_pfls.resize(id+1);
_pfls[id]=DataArrayInt::New();
- int lgth=MEDprofileSizeByName(fid,pflName.c_str());
+ int lgth(MEDprofileSizeByName(fid,pflName.c_str()));
_pfls[id]->setName(pflName);
_pfls[id]->alloc(lgth,1);
- MEDprofileRd(fid,pflName.c_str(),_pfls[id]->getPointer());
+ MEDFILESAFECALLERRD0(MEDprofileRd,(fid,pflName.c_str(),_pfls[id]->getPointer()));
_pfls[id]->applyLin(1,-1,0);//Converting into C format
}
{
INTERP_KERNEL::AutoPtr<char> pflName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
int sz;
- MEDprofileInfo(fid,i+1,pflName,&sz);
+ MEDFILESAFECALLERRD0(MEDprofileInfo,(fid,i+1,pflName,&sz));
std::string pflCpp=MEDLoaderBase::buildStringFromFortran(pflName,MED_NAME_SIZE);
if(i>=(int)_pfls.size())
_pfls.resize(i+1);
_pfls[i]=DataArrayInt::New();
_pfls[i]->alloc(sz,1);
_pfls[i]->setName(pflCpp.c_str());
- MEDprofileRd(fid,pflName,_pfls[i]->getPointer());
+ MEDFILESAFECALLERRD0(MEDprofileRd,(fid,pflName,_pfls[i]->getPointer()));
_pfls[i]->applyLin(1,-1,0);//Converting into C format
}
cpy->applyLin(1,1,0);
INTERP_KERNEL::AutoPtr<char> pflName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
MEDLoaderBase::safeStrCpy(_pfls[i]->getName().c_str(),MED_NAME_SIZE,pflName,opt.getTooLongStrPolicy());
- MEDprofileWr(fid,pflName,_pfls[i]->getNumberOfTuples(),cpy->getConstPointer());
+ MEDFILESAFECALLERWR0(MEDprofileWr,(fid,pflName,_pfls[i]->getNumberOfTuples(),cpy->getConstPointer()));
}
//
int nbOfLocs=_locs.size();
return *_locs[locId];
}
-namespace ParaMEDMEMImpl
+/// @cond INTERNAL
+namespace MEDCouplingImpl
{
class LocFinder
{
const std::string& _pfl;
};
}
+/// @endcond
int MEDFileFieldGlobs::getLocalizationId(const std::string& loc) const
{
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::const_iterator it=std::find_if(_locs.begin(),_locs.end(),ParaMEDMEMImpl::LocFinder(loc));
+ std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::const_iterator it=std::find_if(_locs.begin(),_locs.end(),MEDCouplingImpl::LocFinder(loc));
if(it==_locs.end())
{
std::ostringstream oss; oss << "MEDFileFieldGlobs::getLocalisationId : no such localisation name : \"" << loc << "\" Possible localizations are : ";
const DataArrayInt *MEDFileFieldGlobs::getProfile(const std::string& pflName) const
{
std::string pflNameCpp(pflName);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator it=std::find_if(_pfls.begin(),_pfls.end(),ParaMEDMEMImpl::PflFinder(pflNameCpp));
+ std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator it=std::find_if(_pfls.begin(),_pfls.end(),MEDCouplingImpl::PflFinder(pflNameCpp));
if(it==_pfls.end())
{
std::ostringstream oss; oss << "MEDFileFieldGlobs::getProfile: no such profile name : \"" << pflNameCpp << "\" Possible profiles are : ";
DataArrayInt *MEDFileFieldGlobs::getProfile(const std::string& pflName)
{
std::string pflNameCpp(pflName);
- std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::iterator it=std::find_if(_pfls.begin(),_pfls.end(),ParaMEDMEMImpl::PflFinder(pflNameCpp));
+ std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::iterator it=std::find_if(_pfls.begin(),_pfls.end(),MEDCouplingImpl::PflFinder(pflNameCpp));
if(it==_pfls.end())
{
std::ostringstream oss; oss << "MEDFileFieldGlobs::getProfile: no such profile name : \"" << pflNameCpp << "\" Possible profiles are : ";
* Thus all sequences returned by this method are of the same length equal to number
* of different types of supporting entities.<br>
* A field part can include sub-parts with several different spatial discretizations,
- * \ref ParaMEDMEM::ON_CELLS "ON_CELLS" and \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT"
+ * \ref MEDCoupling::ON_CELLS "ON_CELLS" and \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT"
* for example. Hence, some of the returned sequences contains nested sequences, and an item
* of a nested sequence corresponds to a type of spatial discretization.<br>
* This method allows for iteration over MEDFile DataStructure without any overhead.
* maximal absolute dimension and values returned via the out parameter \a levs are
* dimensions relative to the maximal absolute dimension. <br>
* This method is designed for MEDFileField1TS instances that have a discretization
- * \ref ParaMEDMEM::ON_CELLS "ON_CELLS",
- * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT",
- * \ref ParaMEDMEM::ON_GAUSS_NE "ON_GAUSS_NE".
+ * \ref MEDCoupling::ON_CELLS "ON_CELLS",
+ * \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT",
+ * \ref MEDCoupling::ON_GAUSS_NE "ON_GAUSS_NE".
* Only these 3 discretizations will be taken into account here. If \a this is
- * \ref ParaMEDMEM::ON_NODES "ON_NODES", -1 is returned and \a levs are empty.<br>
+ * \ref MEDCoupling::ON_NODES "ON_NODES", -1 is returned and \a levs are empty.<br>
* This method is useful to make the link between the dimension of the underlying mesh
* and the levels of \a this, because it is possible that the highest dimension of \a this
* field is not equal to the dimension of the underlying mesh.
for(std::vector<TypeOfField>::const_iterator it2=(*it1).begin();it2!=(*it1).end();it2++)
allEnt.insert(*it2);
}
- if(allEnt.size()!=1)
- throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::splitMultiDiscrPerGeoTypes : this field is expected to be defined only on one spatial discretization !");
- if(nbOfMDPGT==0)
- throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::splitMultiDiscrPerGeoTypes : empty field !");
+ if(allEnt.size()!=1)
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::splitMultiDiscrPerGeoTypes : this field is expected to be defined only on one spatial discretization !");
+ if(nbOfMDPGT==0)
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::splitMultiDiscrPerGeoTypes : empty field !");
if(nbOfMDPGT==1)
{
std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> > ret0(1);
med_bool localMesh;
med_int meshnumdt,meshnumit;
INTERP_KERNEL::AutoPtr<char> meshName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
- MEDfieldComputingStepInfo(fid,nasc.getName().c_str(),_csit,&numdt,&numit,&_dt);
- MEDfield23ComputingStepMeshInfo(fid,nasc.getName().c_str(),_csit,&numdt,&numit,&dt,&nmesh,meshName,&localMesh,&meshnumdt,&meshnumit);
+ MEDFILESAFECALLERRD0(MEDfieldComputingStepInfo,(fid,nasc.getName().c_str(),_csit,&numdt,&numit,&_dt));
+ MEDFILESAFECALLERRD0(MEDfield23ComputingStepMeshInfo,(fid,nasc.getName().c_str(),_csit,&numdt,&numit,&dt,&nmesh,meshName,&localMesh,&meshnumdt,&meshnumit));
if(_iteration!=numdt || _order!=numit)
throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::loadBigArraysRecursively : unexpected exception internal error !");
_field_per_mesh.resize(nmesh);
std::vector<DataArrayInt *> idsInPflPerType;
std::vector<DataArrayInt *> idsPerType;
std::vector<int> code,code2;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=mesh->getGenMeshAtLevel(meshDimRelToMax);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m(mesh->getMeshAtLevel(meshDimRelToMax));
if(type!=ON_NODES)
{
m->splitProfilePerType(profile,code,idsInPflPerType,idsPerType);
*/
MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=mesh->getGenMeshAtLevel(meshDimRelToMax,false);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m(mesh->getMeshAtLevel(meshDimRelToMax,false));
const DataArrayInt *d=mesh->getNumberFieldAtLevel(meshDimRelToMax);
const DataArrayInt *e=mesh->getNumberFieldAtLevel(1);
if(meshDimRelToMax==1)
*/
DataArray *MEDFileAnyTypeField1TSWithoutSDA::getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=mesh->getGenMeshAtLevel(meshDimRelToMax);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m(mesh->getMeshAtLevel(meshDimRelToMax));
int meshId=getMeshIdFromMeshName(mesh->getName().c_str());
MEDCouplingAutoRefCountObjectPtr<DataArray> ret=_field_per_mesh[meshId]->getFieldOnMeshAtLevelWithPfl(type,m,pfl,glob,nasc);
ret->setName(nasc.getName().c_str());
* Thus all sequences returned by this method are of the same length equal to number
* of different types of supporting entities.<br>
* A field part can include sub-parts with several different spatial discretizations,
- * \ref ParaMEDMEM::ON_CELLS "ON_CELLS" and \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT"
+ * \ref MEDCoupling::ON_CELLS "ON_CELLS" and \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT"
* for example. Hence, some of the returned sequences contains nested sequences, and an item
* of a nested sequence corresponds to a type of spatial discretization.<br>
* This method allows for iteration over MEDFile DataStructure with a reduced overhead.
* a field part is returned.
* \param [in,out] typesF - a sequence of sequences of types of spatial discretizations.
* A field part can include sub-parts with several different spatial discretizations,
- * \ref ParaMEDMEM::ON_CELLS "ON_CELLS" and
- * \ref ParaMEDMEM::ON_GAUSS_PT "ON_GAUSS_PT" for example.
+ * \ref MEDCoupling::ON_CELLS "ON_CELLS" and
+ * \ref MEDCoupling::ON_GAUSS_PT "ON_GAUSS_PT" for example.
* This sequence is of the same length as \a types.
* \param [in,out] pfls - a sequence returning a profile name per each type of spatial
* discretization. A profile name can be empty.
//
med_int numdt,numit;
med_float dt;
- MEDfieldComputingStepInfo(fid,fieldName.c_str(),1,&numdt,&numit,&dt);
+ MEDFILESAFECALLERRD0(MEDfieldComputingStepInfo,(fid,fieldName.c_str(),1,&numdt,&numit,&dt));
ret->setTime(numdt,numit,dt);
ret->_csit=1;
if(loadAll)
//
med_int numdt,numit;
med_float dt;
- MEDfieldComputingStepInfo(fid,fieldName.c_str(),1,&numdt,&numit,&dt);
+ MEDFILESAFECALLERRD0(MEDfieldComputingStepInfo,(fid,fieldName.c_str(),1,&numdt,&numit,&dt));
ret->setTime(numdt,numit,dt);
ret->_csit=1;
if(loadAll)
{
med_int numdt,numit;
med_float dt;
- MEDfieldComputingStepInfo(fid,fieldName.c_str(),i+1,&numdt,&numit,&dt);
+ MEDFILESAFECALLERRD0(MEDfieldComputingStepInfo,(fid,fieldName.c_str(),i+1,&numdt,&numit,&dt));
if(numdt==iteration && numit==order)
{
found=true;
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
}
- int ncomp=MEDfieldnComponent(fid,fieldIdCFormat+1);
+ int ncomp(MEDfieldnComponent(fid,fieldIdCFormat+1));
INTERP_KERNEL::AutoPtr<char> comp=MEDLoaderBase::buildEmptyString(ncomp*MED_SNAME_SIZE);
INTERP_KERNEL::AutoPtr<char> unit=MEDLoaderBase::buildEmptyString(ncomp*MED_SNAME_SIZE);
INTERP_KERNEL::AutoPtr<char> dtunit=MEDLoaderBase::buildEmptyString(MED_LNAME_SIZE);
INTERP_KERNEL::AutoPtr<char> nomMaa=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
med_bool localMesh;
int nbOfStep;
- MEDfieldInfo(fid,fieldIdCFormat+1,nomcha,nomMaa,&localMesh,&typcha,comp,unit,dtunit,&nbOfStep);
+ MEDFILESAFECALLERRD0(MEDfieldInfo,(fid,fieldIdCFormat+1,nomcha,nomMaa,&localMesh,&typcha,comp,unit,dtunit,&nbOfStep));
fieldName=MEDLoaderBase::buildStringFromFortran(nomcha,MED_NAME_SIZE);
dtunitOut=MEDLoaderBase::buildStringFromFortran(dtunit,MED_LNAME_SIZE);
infos.clear(); infos.resize(ncomp);
}
if(getName().empty())
throw INTERP_KERNEL::Exception("MEDFileField1TS::write : MED file does not accept field with empty name !");
- MEDfieldCr(fid,getName().c_str(),getMEDFileFieldType(),nbComp,comp,unit,getDtUnit().c_str(),getMeshName().c_str());
+ MEDFILESAFECALLERWR0(MEDfieldCr,(fid,getName().c_str(),getMEDFileFieldType(),nbComp,comp,unit,getDtUnit().c_str(),getMeshName().c_str()));
writeGlobals(fid,*this);
contentNotNullBase()->writeLL(fid,*this,*contentNotNullBase());
}
med_int numdt=0,numo=0;
med_int meshIt=0,meshOrder=0;
med_float dt=0.0;
- MEDfieldComputingStepMeshInfo(fid,_name.c_str(),i+1,&numdt,&numo,&dt,&meshIt,&meshOrder);
+ MEDFILESAFECALLERRD0(MEDfieldComputingStepMeshInfo,(fid,_name.c_str(),i+1,&numdt,&numo,&dt,&meshIt,&meshOrder));
switch(fieldTyp)
{
case MED_FLOAT64:
}
if(_name.empty())
throw INTERP_KERNEL::Exception("MEDFileFieldMultiTSWithoutSDA::write : MED file does not accept field with empty name !");
- MEDfieldCr(fid,_name.c_str(),getMEDFileFieldType(),nbComp,comp,unit,getDtUnit().c_str(),getMeshName().c_str());
+ MEDFILESAFECALLERWR0(MEDfieldCr,(fid,_name.c_str(),getMEDFileFieldType(),nbComp,comp,unit,getDtUnit().c_str(),getMeshName().c_str()));
int nbOfTS=_time_steps.size();
for(int i=0;i<nbOfTS;i++)
_time_steps[i]->writeLL(fid,opts,*this);
pushBackTimeStep(*it);
}
+void MEDFileAnyTypeFieldMultiTS::pushBackTimeSteps(MEDFileAnyTypeFieldMultiTS *fmts)
+{
+ if(!fmts)
+ throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::pushBackTimeSteps : Input fmts is NULL !");
+ int nbOfTS(fmts->getNumberOfTS());
+ for(int i=0;i<nbOfTS;i++)
+ {
+ MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TS> elt(fmts->getTimeStepAtPos(i));
+ pushBackTimeStep(elt);
+ }
+}
+
void MEDFileAnyTypeFieldMultiTS::pushBackTimeStep(MEDFileAnyTypeField1TS *f1ts)
{
if(!f1ts)