SET(MEDCOUPLING_BUILD_DOC @MEDCOUPLING_BUILD_DOC@)
SET(MEDCOUPLING_BUILD_TESTS @MEDCOUPLING_BUILD_TESTS@)
SET(MEDCOUPLING_BUILD_GUI @MEDCOUPLING_BUILD_GUI@)
+SET(MEDCOUPLING_USE_64BIT_IDS @MEDCOUPLING_USE_64BIT_IDS@)
# Advanced options
{
DataArrayMedInt* medIntArray = DataArrayMedInt::New();
if ( sizeof( med_int ) == sizeof( INT ))
- {
- medIntArray->useArray( reinterpret_cast<const med_int*>(intVec.data()), /*owner=*/false, DeallocType::CPP_DEALLOC, intVec.size(), /*nbComp=*/1 );
- }
+ {
+ medIntArray->useArray( reinterpret_cast<const med_int*>(intVec.data()), /*owner=*/false, DeallocType::CPP_DEALLOC, intVec.size(), /*nbComp=*/1 );
+ }
else
- {
- medIntArray->alloc( intVec.size(), 1 );
- std::copy( intVec.begin(), intVec.end(), medIntArray->getPointer() );
- }
+ {
+ medIntArray->alloc( intVec.size(), 1 );
+ std::copy( intVec.begin(), intVec.end(), medIntArray->getPointer() );
+ }
return medIntArray;
}
MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceSize,(fid,meshName.c_str(),_name.c_str(),dt,it,MED_NODE,MED_NONE,&ncor));
if(ncor>0)
{
- MCAuto<DataArrayInt> da(DataArrayInt::New());
+ MCAuto<DataArrayMedInt> da(DataArrayMedInt::New());
da->alloc(ncor*2);
MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceRd,(fid,meshName.c_str(),_name.c_str(),dt,it,MED_NODE,MED_NONE,da->getPointer()));
da->applyLin(1,-1);
da->rearrange(2);
- MCAuto<MEDFileEquivalenceNode> node(new MEDFileEquivalenceNode(this,da));
+ MCAuto<MEDFileEquivalenceNode> node(new MEDFileEquivalenceNode(this,FromMedIntArray<int>(da)));
_node=node;
}
_cell=MEDFileEquivalenceCell::Load(fid,this);
int MEDFileEquivalences::PresenceOfEquivalences(med_idt fid, const std::string& meshName)
{
med_int nequ(MEDnEquivalence(fid,meshName.c_str()));
- return nequ;
+ return FromMedInt<int>(nequ);
}
MEDFileEquivalences *MEDFileEquivalences::Load(med_idt fid, int nbOfEq, MEDFileMesh *owner)
{
INTERP_KERNEL::AutoPtr<char> equ(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
INTERP_KERNEL::AutoPtr<char> desc(MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE));
- int nstep,nocstpncor;
+ med_int nstep,nocstpncor;
MEDFILESAFECALLERRD0(MEDequivalenceInfo,(fid,meshName.c_str(),i+1,equ,desc,&nstep,&nocstpncor));
std::string eqName(MEDLoaderBase::buildStringFromFortran(equ,MED_NAME_SIZE)),eqDescName(MEDLoaderBase::buildStringFromFortran(desc,MED_COMMENT_SIZE));
MCAuto<MEDFileEquivalencePair> eqv(MEDFileEquivalencePair::Load(ret,fid,eqName,eqDescName));
INTERP_KERNEL::AutoPtr<char> name(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
MEDLoaderBase::safeStrCpy(meshName.c_str(),MED_NAME_SIZE,meshName2,getFather()->getMesh()->getTooLongStrPolicy());
MEDLoaderBase::safeStrCpy(equName.c_str(),MED_NAME_SIZE,name,getFather()->getMesh()->getTooLongStrPolicy());
- MCAuto<DataArrayInt> da2(da->deepCopy()); da2->rearrange(1); da2->applyLin(1,1); da2->rearrange(2);
+ MCAuto<DataArrayMedInt> da2(DataArrayMedInt::Copy(da)); da2->rearrange(1); da2->applyLin(1,1); da2->rearrange(2);
MEDFILESAFECALLERWR0(MEDequivalenceCorrespondenceWr,(fid,meshName2,name,dt,it,medtype,medgt,ToMedInt(da2->getNumberOfTuples()),da2->begin()));
}
MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceSize,(fid,meshName.c_str(),name.c_str(),dt,it,MED_CELL,typmai[i],&ncor));
if(ncor>0)
{
- MCAuto<DataArrayInt> da(DataArrayInt::New());
+ MCAuto<DataArrayMedInt> da(DataArrayMedInt::New());
da->alloc(ncor*2);
MEDFILESAFECALLERRD0(MEDequivalenceCorrespondenceRd,(fid,meshName.c_str(),name.c_str(),dt,it,MED_CELL,typmai[i],da->getPointer()));
da->applyLin(1,-1);
da->rearrange(2);
- MCAuto<MEDFileEquivalenceCellType> ct(new MEDFileEquivalenceCellType(getFather(),typmai2[i],da));
+ MCAuto<MEDFileEquivalenceCellType> ct(new MEDFileEquivalenceCellType(getFather(),typmai2[i],FromMedIntArray<int>(da)));
_types.push_back(ct);
}
}
MEDFileFields::MEDFileFields(med_idt fid, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities)
try:MEDFileFieldGlobsReal(fid)
{
- int nbFields(MEDnField(fid));
+ med_int nbFields(MEDnField(fid));
_fields.resize(nbFields);
med_field_type typcha;
for(int i=0;i<nbFields;i++)
mm=ms->getMeshWithName(getMeshName());
}
//
- _field_per_mesh[0]=MEDFileFieldPerMesh::NewOnRead(fid,this,0,meshnumdt,meshnumit,nasc,mm,entities);
+ _field_per_mesh[0]=MEDFileFieldPerMesh::NewOnRead(fid,this,0,FromMedInt<int>(meshnumdt),FromMedInt<int>(meshnumit),nasc,mm,entities);
_nb_of_tuples_to_be_allocated=0;
_field_per_mesh[0]->loadOnlyStructureOfDataRecursively(fid,_nb_of_tuples_to_be_allocated,nasc);
}
med_int numdt,numit;
med_float dt;
MEDFILESAFECALLERRD0(MEDfieldComputingStepInfo,(fid,fieldName.c_str(),1,&numdt,&numit,&dt));
- ret->setTime(numdt,numit,dt);
+ ret->setTime(FromMedInt<int>(numdt),FromMedInt<int>(numit),dt);
ret->_csit=1;
if(loadAll)
ret->loadStructureAndBigArraysRecursively(fid,*((const MEDFileAnyTypeField1TSWithoutSDA*)ret),ms,entities);
med_int numdt,numit;
med_float dt;
MEDFILESAFECALLERRD0(MEDfieldComputingStepInfo,(fid,fieldName.c_str(),1,&numdt,&numit,&dt));
- ret->setTime(numdt,numit,dt);
+ ret->setTime(FromMedInt<int>(numdt),FromMedInt<int>(numit),dt);
ret->_csit=1;
if(loadAll)
ret->loadStructureAndBigArraysRecursively(fid,*((const MEDFileAnyTypeField1TSWithoutSDA*)ret),ms,entities);
{
if(checkFieldId)
{
- int nbFields=MEDnField(fid);
+ med_int nbFields=MEDnField(fid);
if(fieldIdCFormat>=nbFields)
{
std::ostringstream oss; oss << "MEDFileAnyTypeField1TS::LocateField2(fileName) : in file \'" << FileNameFromFID(fid) << "\' number of fields is " << nbFields << " ! Trying to request for id " << fieldIdCFormat << " !";
throw INTERP_KERNEL::Exception(oss.str());
}
}
- int ncomp(MEDfieldnComponent(fid,fieldIdCFormat+1));
+ med_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> nomcha(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
INTERP_KERNEL::AutoPtr<char> nomMaa(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
med_bool localMesh;
- int nbOfStep;
+ med_int 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);
for(int j=0;j<ncomp;j++)
infos[j]=MEDLoaderBase::buildUnionUnit((char *)comp+j*MED_SNAME_SIZE,MED_SNAME_SIZE,(char *)unit+j*MED_SNAME_SIZE,MED_SNAME_SIZE);
- return nbOfStep;
+ return FromMedInt<int>(nbOfStep);
}
/*!
*/
int MEDFileAnyTypeField1TS::LocateField(med_idt fid, const std::string& fieldName, int& posCFormat, med_field_type& typcha, std::vector<std::string>& infos, std::string& dtunitOut, std::string& meshName)
{
- int nbFields=MEDnField(fid);
+ med_int nbFields=MEDnField(fid);
bool found=false;
std::vector<std::string> fns(nbFields);
int nbOfStep2(-1);
if(id>=(int)_pfls.size())
_pfls.resize(id+1);
MCAuto<DataArrayMedInt> miPfl=DataArrayMedInt::New();
- int lgth(MEDprofileSizeByName(fid,pflName.c_str()));
+ med_int lgth(MEDprofileSizeByName(fid,pflName.c_str()));
miPfl->setName(pflName);
miPfl->alloc(lgth,1);
MEDFILESAFECALLERRD0(MEDprofileRd,(fid,pflName.c_str(),miPfl->getPointer()));
void MEDFileFieldGlobs::loadProfileInFile(med_idt fid, int i)
{
INTERP_KERNEL::AutoPtr<char> pflName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
- int sz;
+ med_int sz;
MEDFILESAFECALLERRD0(MEDprofileInfo,(fid,i+1,pflName,&sz));
std::string pflCpp=MEDLoaderBase::buildStringFromFortran(pflName,MED_NAME_SIZE);
if(i>=(int)_pfls.size())
void MEDFileFieldGlobs::loadAllGlobals(med_idt fid, const MEDFileEntities *entities)
{
- int nProfil=MEDnProfile(fid);
+ med_int nProfil=MEDnProfile(fid);
for(int i=0;i<nProfil;i++)
loadProfileInFile(fid,i);
- int sz=MEDnLocalization(fid);
+ med_int sz=MEDnLocalization(fid);
_locs.resize(sz);
for(int i=0;i<sz;i++)
{
{
med_geometry_type geotype;
med_geometry_type sectiongeotype;
- int nsectionmeshcell;
+ med_int nsectionmeshcell, dim, nb_gauss_pt;
INTERP_KERNEL::AutoPtr<char> geointerpname(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
INTERP_KERNEL::AutoPtr<char> sectionmeshname(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
- MEDlocalizationInfoByName(fid,locName.c_str(),&geotype,&_dim,&_nb_gauss_pt,geointerpname,sectionmeshname,&nsectionmeshcell,§iongeotype);
+ MEDlocalizationInfoByName(fid,locName.c_str(),&geotype,&dim,&nb_gauss_pt,geointerpname,sectionmeshname,&nsectionmeshcell,§iongeotype);
+ _dim=FromMedInt<int>(dim);
+ _nb_gauss_pt=FromMedInt<int>(nb_gauss_pt);
_gt=new MEDFileGTKeeperSta((INTERP_KERNEL::NormalizedCellType)(std::distance(typmai3,std::find(typmai3,typmai3+34,geotype))));
const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(getGeoType()));
_nb_node_per_cell=cm.getNumberOfNodes();
{
med_geometry_type geotype;
med_geometry_type sectiongeotype;
- int nsectionmeshcell;
+ med_int nsectionmeshcell,dim,nb_gauss_pt;
INTERP_KERNEL::AutoPtr<char> locName(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
INTERP_KERNEL::AutoPtr<char> geointerpname(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
INTERP_KERNEL::AutoPtr<char> sectionmeshname(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
- MEDFILESAFECALLERRD0(MEDlocalizationInfo,(fid,id+1,locName,&geotype,&_dim,&_nb_gauss_pt,geointerpname,sectionmeshname,&nsectionmeshcell,§iongeotype));
+ MEDFILESAFECALLERRD0(MEDlocalizationInfo,(fid,id+1,locName,&geotype,&dim,&nb_gauss_pt,geointerpname,sectionmeshname,&nsectionmeshcell,§iongeotype));
+ _dim=FromMedInt<int>(dim);
+ _nb_gauss_pt=FromMedInt<int>(nb_gauss_pt);
_name=locName;
std::string sectionName(MEDLoaderBase::buildStringFromFortran(sectionmeshname,MED_NAME_SIZE));
if(sectionName.empty())
const MEDFileUMesh *section(entities2->getSupMeshWithName(sectionName));
_gt=new MEDFileGTKeeperDyn(um,section,se);
{
- int dummy;
- MEDFILESAFECALLERRD0(MEDmeshGeotypeParameter,(fid,geotype,&dummy,&_nb_node_per_cell));
+ med_int dummy, nb_node_per_cell;
+ MEDFILESAFECALLERRD0(MEDmeshGeotypeParameter,(fid,geotype,&dummy,&nb_node_per_cell));
+ _nb_node_per_cell=FromMedInt<int>(nb_node_per_cell);
}
}
_ref_coo.resize(_dim*_nb_node_per_cell);
{
med_entity_type mentiCpy(menti);
INTERP_KERNEL::AutoPtr<char> locname(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
- int nbi,tmp1;
+ med_int nbi,tmp1;
med_int nbValsInFile(MEDfieldnValueWithProfileByName(fid,fieldName.c_str(),iteration,order,menti,mgeoti,_profile.c_str(),MED_COMPACT_PFLMODE,&tmp1,locname,&nbi));
if(nbValsInFile==0 && menti==MED_CELL)
{//
if(!_profile.empty())
throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerTypePerDisc::goReadZeValuesInFile : not implemented !");
INTERP_KERNEL::AutoPtr<char> pflname(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE)),locname(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
- int profilesize,nbi;
- int overallNval(MEDfieldnValueWithProfile(fid,fieldName.c_str(),iteration,order,menti,mgeoti,ToMedInt(_profile_it+1),MED_COMPACT_PFLMODE,pflname,&profilesize,locname,&nbi));
+ med_int profilesize,nbi;
+ med_int overallNval(MEDfieldnValueWithProfile(fid,fieldName.c_str(),iteration,order,menti,mgeoti,FromIdType<int>(_profile_it+1),MED_COMPACT_PFLMODE,pflname,&profilesize,locname,&nbi));
const SlicePartDefinition *spd(dynamic_cast<const SlicePartDefinition *>(pd));
if(spd)
{
INTERP_KERNEL::AutoPtr<char> locname(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
INTERP_KERNEL::AutoPtr<char> pflname(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
std::string fieldName(nasc.getName()),meshName(getMeshName());
- int iteration(getIteration()),order(getOrder()),profilesize,nbi;
+ med_int iteration(getIteration()),order(getOrder()),profilesize,nbi;
TypeOfField type(getType());
med_geometry_type mgeoti;
med_entity_type menti;
_father->entriesForMEDfile(type,mgeoti,menti);
- int zeNVal(MEDfieldnValueWithProfile(fid,fieldName.c_str(),iteration,order,menti,mgeoti,ToMedInt(_profile_it+1),MED_COMPACT_PFLMODE,pflname,&profilesize,locname,&nbi));
+ med_int zeNVal(MEDfieldnValueWithProfile(fid,fieldName.c_str(),iteration,order,menti,mgeoti,FromIdType<int>(_profile_it+1),MED_COMPACT_PFLMODE,pflname,&profilesize,locname,&nbi));
if(zeNVal==0 && type==ON_CELLS)
{//eheh maybe there's a surprise :)
- int zeNVal1(MEDfieldnValueWithProfile(fid,fieldName.c_str(),iteration,order,MED_DESCENDING_FACE,mgeoti,ToMedInt(_profile_it+1),MED_COMPACT_PFLMODE,pflname,&profilesize,locname,&nbi));
+ med_int zeNVal1(MEDfieldnValueWithProfile(fid,fieldName.c_str(),iteration,order,MED_DESCENDING_FACE,mgeoti,FromIdType<int>(_profile_it+1),MED_COMPACT_PFLMODE,pflname,&profilesize,locname,&nbi));
if(zeNVal1==0)
{
- int zeNVal2(MEDfieldnValueWithProfile(fid,fieldName.c_str(),iteration,order,MED_DESCENDING_EDGE,mgeoti,ToMedInt(_profile_it+1),MED_COMPACT_PFLMODE,pflname,&profilesize,locname,&nbi));
+ med_int zeNVal2(MEDfieldnValueWithProfile(fid,fieldName.c_str(),iteration,order,MED_DESCENDING_EDGE,mgeoti,FromIdType<int>(_profile_it+1),MED_COMPACT_PFLMODE,pflname,&profilesize,locname,&nbi));
if(zeNVal2!=0)
zeNVal=zeNVal2;
}
INTERP_KERNEL::AutoPtr<char> locName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
med_geometry_type mgeoti;
med_entity_type menti(ConvertIntoMEDFileType(type,geoType,mgeoti));
- int nbProfiles(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),menti,mgeoti,pflName,locName));
+ med_int nbProfiles(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),menti,mgeoti,pflName,locName));
_field_pm_pt_pd.resize(nbProfiles);
for(int i=0;i<nbProfiles;i++)
{
}
if(type==ON_CELLS)
{
- int nbProfiles2(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_NODE_ELEMENT,mgeoti,pflName,locName));
+ med_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));
}
return ;
// dark side of the force.
{
- int nbProfiles1(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_DESCENDING_FACE,mgeoti,pflName,locName));
- int nbProfiles2(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_DESCENDING_EDGE,mgeoti,pflName,locName));
+ med_int nbProfiles1(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_DESCENDING_FACE,mgeoti,pflName,locName));
+ med_int nbProfiles2(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_DESCENDING_EDGE,mgeoti,pflName,locName));
if(nbProfiles1==0 && nbProfiles2==0)
return ;// OK definitely nothing in field
menti=nbProfiles1>=nbProfiles2?MED_DESCENDING_FACE:MED_DESCENDING_EDGE;//not enough words to describe the beauty
_se.takeRef(se);
INTERP_KERNEL::AutoPtr<char> pflName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
INTERP_KERNEL::AutoPtr<char> locName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
- int nbProfiles(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_STRUCT_ELEMENT,_se->getDynGT(),pflName,locName));
+ med_int nbProfiles(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_STRUCT_ELEMENT,_se->getDynGT(),pflName,locName));
_field_pm_pt_pd.resize(nbProfiles);
for(int i=0;i<nbProfiles;i++)
{
INTERP_KERNEL::AutoCppPtr<MFFPMIter> iter0(MFFPMIter::NewCell(entities));
for(iter0->begin();!iter0->finished();iter0->next())
{
- int nbProfile (MEDfield23nProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_CELL ,typmai[iter0->current()],meshCsit+1,meshName,pflName,locName));
+ med_int nbProfile (MEDfield23nProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_CELL ,typmai[iter0->current()],meshCsit+1,meshName,pflName,locName));
std::string name0(MEDLoaderBase::buildStringFromFortran(meshName,MED_NAME_SIZE+1));
- int nbProfile2(MEDfield23nProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_NODE_ELEMENT,typmai[iter0->current()],meshCsit+1,meshName,pflName,locName));
+ med_int nbProfile2(MEDfield23nProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_NODE_ELEMENT,typmai[iter0->current()],meshCsit+1,meshName,pflName,locName));
std::string name1(MEDLoaderBase::buildStringFromFortran(meshName,MED_NAME_SIZE+1));
if(nbProfile>0 || nbProfile2>0)
{
}
if(MFFPMIter::IsPresenceOfNode(entities))
{
- int nbProfile(MEDfield23nProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_NODE,MED_NONE,meshCsit+1,meshName,pflName,locName));
+ med_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);
std::vector<int> dynGT(entities->getDynGTAvail());
for(std::vector<int>::const_iterator it=dynGT.begin();it!=dynGT.end();it++)
{
- int nbPfl(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_STRUCT_ELEMENT,*it,pflName,locName));
+ med_int nbPfl(MEDfieldnProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_STRUCT_ELEMENT,*it,pflName,locName));
if(nbPfl>0)
{
_field_pm_pt.push_back(MEDFileFieldPerMeshPerTypeDyn::NewOnRead(fid,this,entities,*it,nasc));
iter0=MFFPMIter::NewCell(entities);
for(iter0->begin();!iter0->finished();iter0->next())
{
- int nbProfile (MEDfield23nProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_DESCENDING_FACE,typmai[iter0->current()],meshCsit+1,meshName,pflName,locName));
+ med_int nbProfile (MEDfield23nProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_DESCENDING_FACE,typmai[iter0->current()],meshCsit+1,meshName,pflName,locName));
std::string name0(MEDLoaderBase::buildStringFromFortran(meshName,MED_NAME_SIZE+1));
- int nbProfile2(MEDfield23nProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_DESCENDING_EDGE,typmai[iter0->current()],meshCsit+1,meshName,pflName,locName));
+ med_int nbProfile2(MEDfield23nProfile(fid,nasc.getName().c_str(),getIteration(),getOrder(),MED_DESCENDING_EDGE,typmai[iter0->current()],meshCsit+1,meshName,pflName,locName));
std::string name1(MEDLoaderBase::buildStringFromFortran(meshName,MED_NAME_SIZE+1));
if(nbProfile>0 || nbProfile2>0)
{
{
case MED_FLOAT64:
{
- _time_steps[i]=MEDFileField1TSWithoutSDA::New(getName(),getMeshName(),i+1,numdt,numo,_infos);
+ _time_steps[i]=MEDFileField1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt<int>(numdt),FromMedInt<int>(numo),_infos);
break;
}
case MED_INT32:
{
- _time_steps[i]=MEDFileIntField1TSWithoutSDA::New(getName(),getMeshName(),i+1,numdt,numo,_infos);
+ _time_steps[i]=MEDFileIntField1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt<int>(numdt),FromMedInt<int>(numo),_infos);
break;
}
case MED_FLOAT32:
{
- _time_steps[i]=MEDFileFloatField1TSWithoutSDA::New(getName(),getMeshName(),i+1,numdt,numo,_infos);
+ _time_steps[i]=MEDFileFloatField1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt<int>(numdt),FromMedInt<int>(numo),_infos);
break;
}
case MED_INT:
{
if(sizeof(med_int)==sizeof(int))
{
- _time_steps[i]=MEDFileIntField1TSWithoutSDA::New(getName(),getMeshName(),i+1,numdt,numo,_infos);
+ _time_steps[i]=MEDFileIntField1TSWithoutSDA::New(getName(),getMeshName(),i+1,FromMedInt<int>(numdt),FromMedInt<int>(numo),_infos);
break;
}
}
MEDFileJointOneStep::MEDFileJointOneStep(med_idt fid, const std::string& mName, const std::string& jointName, int num)
{
- int order, iteration, ncorrespondence;
+ med_int order, iteration, ncorrespondence;
MEDFILESAFECALLERRD0(MEDsubdomainComputingStepInfo,(fid, mName.c_str(), jointName.c_str(), num, &order, &iteration, &ncorrespondence));
- MEDFileJointOneStep::setOrder(order);
- MEDFileJointOneStep::setIteration(iteration);
+ MEDFileJointOneStep::setOrder(FromMedInt<int>(order));
+ MEDFileJointOneStep::setIteration(FromMedInt<int>(iteration));
for ( int cur_it = 1; cur_it <= ncorrespondence; ++cur_it )
{
- int num_entity;
+ med_int num_entity;
med_entity_type loc_ent_type, rem_ent_type;
med_geometry_type loc_geo_type, rem_geo_type;
MEDFILESAFECALLERRD0(MEDsubdomainCorrespondenceSizeInfo,(fid, mName.c_str(), jointName.c_str(), order, iteration, cur_it,
INTERP_KERNEL::AutoPtr<char> joint_name=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
INTERP_KERNEL::AutoPtr<char> desc_name=MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE);
INTERP_KERNEL::AutoPtr<char> rem_mesh_name=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
- int domain_number=0, nstep=0, nocstpncorrespondence=0;
+ med_int domain_number=0, nstep=0, nocstpncorrespondence=0;
MEDFILESAFECALLERRD0(MEDsubdomainJointInfo,(fid,mName.c_str(), curJoint, joint_name, desc_name, &domain_number,rem_mesh_name,
&nstep, &nocstpncorrespondence));
setLocalMeshName(mName);
setRemoteMeshName(MEDLoaderBase::buildStringFromFortran(rem_mesh_name,MED_NAME_SIZE));
setDescription(MEDLoaderBase::buildStringFromFortran(desc_name,MED_COMMENT_SIZE));
setJointName(MEDLoaderBase::buildStringFromFortran(joint_name,MED_NAME_SIZE));
- setDomainNumber(domain_number);
+ setDomainNumber(FromMedInt<int>(domain_number));
for(int cur_step=1; cur_step <= nstep; ++cur_step)
{
MEDFileJointOneStep *cor=MEDFileJointOneStep::New(fid, mName.c_str(), getJointName(), cur_step);
MEDFileJoints::MEDFileJoints(med_idt fid, const std::string& meshName)
{
- int num_joint=MEDnSubdomainJoint(fid, meshName.c_str() );
+ med_int num_joint=MEDnSubdomainJoint(fid, meshName.c_str() );
for(int i = 1; i <= num_joint; i++)
_joints.push_back(MEDFileJoint::New(fid,meshName,i));
}
loaderl2.loadAll(fid,mid,mName,dt,it,mrs);
dispatchLoadedPart(fid,loaderl2,mName,mrs);
// Structure element part...
- int nModels(-1);
+ med_int nModels(-1);
{
med_bool chgt=MED_FALSE,trsf=MED_FALSE;
nModels=MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_STRUCT_ELEMENT,MED_GEO_ALL,MED_CONNECTIVITY,MED_NODAL,&chgt,&trsf);
std::vector<std::string> MeshCls::getAxisInfoOnMesh(med_idt fid, const std::string& mName, MEDCoupling::MEDCouplingMeshType& meshType, MEDCoupling::MEDCouplingAxisType& axType, int& nstep, int& Mdim, MEDFileString& description, MEDFileString& dtunit, MEDFileString& univName) const
{
med_mesh_type type_maillage;
- med_int spaceDim;
+ med_int spaceDim, meshDim, nbSteps;
med_sorting_type stype;
med_axis_type axistype;
- int naxis(MEDmeshnAxis(fid,getID()));
+ med_int naxis(MEDmeshnAxis(fid,getID()));
INTERP_KERNEL::AutoPtr<char> nameTmp(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
INTERP_KERNEL::AutoPtr<char> axisname(MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE));
INTERP_KERNEL::AutoPtr<char> axisunit(MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE));
INTERP_KERNEL::AutoPtr<char> univTmp(MEDLoaderBase::buildEmptyString(MED_LNAME_SIZE));
- if(MEDmeshInfo(fid,getID(),nameTmp,&spaceDim,&Mdim,&type_maillage,description.getPointer(),dtunit.getPointer(),
- &stype,&nstep,&axistype,axisname,axisunit)!=0)
+ if(MEDmeshInfo(fid,getID(),nameTmp,&spaceDim,&meshDim,&type_maillage,description.getPointer(),dtunit.getPointer(),
+ &stype,&nbSteps,&axistype,axisname,axisunit)!=0)
throw INTERP_KERNEL::Exception("A problem has been detected when trying to get info on mesh !");
+ Mdim=FromMedInt<int>(meshDim);
+ nstep=FromMedInt<int>(nbSteps);
MEDmeshUniversalNameRd(fid,nameTmp,univName.getPointer());// do not protect MEDFILESAFECALLERRD0 call : Thanks to fra.med.
axType=MEDFileMeshL2::TraduceAxisType(axistype);
switch(type_maillage)
INTERP_KERNEL::AutoPtr<char> msn(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
INTERP_KERNEL::AutoPtr<char> zeDescription(MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE));
med_axis_type medAxType;
- int nAxis(MEDsupportMeshnAxis(fid,getID()));
+ med_int nAxis(MEDsupportMeshnAxis(fid,getID()));
INTERP_KERNEL::AutoPtr<char> axisName(new char[MED_SNAME_SIZE*nAxis+1]),axisUnit(new char[MED_SNAME_SIZE*nAxis+1]);
- int spaceDim(0),meshDim(0);
+ med_int spaceDim(0),meshDim(0);
MEDFILESAFECALLERRD0(MEDsupportMeshInfo,(fid,getID(),msn,&spaceDim,&meshDim,zeDescription,&medAxType,axisName,axisUnit));
std::string descriptionCpp(MEDLoaderBase::buildStringFromFortran(zeDescription,MED_COMMENT_SIZE));
description.set(descriptionCpp.c_str());
int ret=-1;
med_sorting_type stype;
std::vector<std::string> ms;
- int nstep;
+ med_int nstep;
med_axis_type axistype;
for(int i=0;i<n && found==0;i++)
{
- int naxis(MEDmeshnAxis(fid,i+1));
+ med_int naxis(MEDmeshnAxis(fid,i+1));
INTERP_KERNEL::AutoPtr<char> axisname(MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE)),axisunit(MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE));
MEDFILESAFECALLERRD0(MEDmeshInfo,(fid,i+1,nommaa,&spaceDim,&dim,&type_maillage,maillage_description,dtunit,&stype,&nstep,&axistype,axisname,axisunit));
dtunit1=MEDLoaderBase::buildStringFromFortran(dtunit,sizeof(dtunit));
}
if(found==0)
{//last chance ! Is it a support mesh ?
- int nbSM(MEDnSupportMesh(fid));
+ med_int nbSM(MEDnSupportMesh(fid));
for(int i=0;i<nbSM && found==0;i++)
{
- int naxis(MEDsupportMeshnAxis(fid,i+1));
+ med_int naxis(MEDsupportMeshnAxis(fid,i+1));
INTERP_KERNEL::AutoPtr<char> axisname(MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE)),axisunit(MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE));
MEDFILESAFECALLERRD0(MEDsupportMeshInfo,(fid,i+1,nommaa,&spaceDim,&dim,maillage_description,&axistype,axisname,axisunit));
std::string cur(MEDLoaderBase::buildStringFromFortran(nommaa,sizeof(nommaa)));
med_int numdt,numit;
med_float dtt;
MEDFILESAFECALLERRD0(MEDmeshComputationStepInfo,(fid,mName.c_str(),1,&numdt,&numit,&dtt));
- dt=numdt; it=numit;
+ dt=FromMedInt<int>(numdt); it=FromMedInt<int>(numit);
return new MeshCls(ret);
}
case 2:
med_int numfam;
med_int nfam=MEDnFamily(fid,meshName.c_str());
std::vector< std::pair<std::string,std::pair<mcIdType,std::vector<std::string> > > > crudeFams(nfam);
- for(med_int i=0;i<nfam;i++)
+ for(int i=0;i<nfam;i++)
{
med_int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
med_int natt=MEDnFamily23Attribute(fid,meshName.c_str(),i+1);
{
int spaceDim((int)infosOnComp.size());
med_bool changement,transformation;
- int nCoords(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&changement,&transformation));
+ med_int nCoords(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&changement,&transformation));
_coords=DataArrayDouble::New();
_coords->alloc(nCoords,spaceDim);
double *coordsPtr(_coords->getPointer());
void MEDFileUMeshL2::loadPartCoords(med_idt fid, const std::vector<std::string>& infosOnComp, const std::string& mName, int dt, int it, mcIdType nMin, mcIdType nMax)
{
med_bool changement,transformation;
- int spaceDim((int)infosOnComp.size()),nCoords(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&changement,&transformation));
+ med_int spaceDim((int)infosOnComp.size()),nCoords(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&changement,&transformation));
_coords=DataArrayDouble::New();
mcIdType nbNodesToLoad(nMax-nMin);
_coords->alloc(nbNodesToLoad,spaceDim);
{
med_data_type dataTypeReq=GetDataTypeCorrespondingToSpaceId(i);
med_bool chgt=MED_FALSE,trsf=MED_FALSE;
- int nbOfElt(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,dataTypeReq,MED_NO_CMODE,&chgt,&trsf));
+ med_int nbOfElt(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,dataTypeReq,MED_NO_CMODE,&chgt,&trsf));
MCAuto<DataArrayDouble> da=DataArrayDouble::New();
da->alloc(nbOfElt,1);
da->setInfoOnComponent(0,infosOnComp[i]);
MCAuto<DataArrayIdType> stGrid=FromMedIntArray<mcIdType>(miStGrid);
_clmesh->setNodeGridStructure(stGrid->begin(),stGrid->end());
med_bool chgt=MED_FALSE,trsf=MED_FALSE;
- int nbNodes(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&chgt,&trsf));
+ med_int nbNodes(MEDmeshnEntity(fid,mName.c_str(),dt,it,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&chgt,&trsf));
MCAuto<DataArrayDouble> da=DataArrayDouble::New();
da->alloc(nbNodes,infosOnComp.size());
da->setInfoOnComponents(infosOnComp);
MEDFileMeshSupports::MEDFileMeshSupports(med_idt fid)
{
- int nbSM(MEDnSupportMesh(fid));
+ med_int nbSM(MEDnSupportMesh(fid));
_supports.resize(nbSM);
for(int i=0;i<nbSM;i++)
{
INTERP_KERNEL::AutoPtr<char> msn(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
INTERP_KERNEL::AutoPtr<char> description(MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE));
med_axis_type axType;
- int nAxis(MEDsupportMeshnAxis(fid,i+1));
+ med_int nAxis(MEDsupportMeshnAxis(fid,i+1));
INTERP_KERNEL::AutoPtr<char> axisName(new char[MED_SNAME_SIZE*nAxis+1]),axisUnit(new char[MED_SNAME_SIZE*nAxis+1]);
- int spaceDim(0),meshDim(0);
+ med_int spaceDim(0),meshDim(0);
MEDFILESAFECALLERRD0(MEDsupportMeshInfo,(fid,i+1,msn,&spaceDim,&meshDim,description,&axType,axisName,axisUnit));
std::string name(MEDLoaderBase::buildStringFromFortran(msn,MED_NAME_SIZE));
_supports[i]=MEDFileUMesh::New(fid,name);
#include "MEDFileParameter.hxx"
#include "MEDFileSafeCaller.txx"
#include "MEDLoaderBase.hxx"
+#include "MEDFileBasis.hxx"
#include "InterpKernelAutoPtr.hxx"
std::ostringstream oss; oss << "MEDFileParameterDouble1TS::finishLoading : no specified time step (" << dt << "," << it << ") ! Time steps available : ";
for(int i=0;i<nbOfSteps;i++)
{
- int locDt,locIt;
+ med_int locDt,locIt;
double tim;
MEDFILESAFECALLERRD0(MEDparameterComputationStepInfo,(fid,name.c_str(),i+1,&locDt,&locIt,&tim));
if(dt==locDt && it==locIt)
{
- _iteration=locDt; _order=locIt; _time=tim;
+ _iteration=FromMedInt<int>(locDt); _order=FromMedInt<int>(locIt); _time=tim;
MEDFILESAFECALLERRD0(MEDparameterValueRd,(fid,name.c_str(),_iteration,_order,reinterpret_cast<unsigned char *const>(&_arr)));
return ;
}
void MEDFileParameterDouble1TSWTI::finishLoading(med_idt fid, const std::string& name, int timeStepId)
{
- int locDt,locIt;
+ med_int locDt,locIt;
double dt;
MEDFILESAFECALLERRD0(MEDparameterComputationStepInfo,(fid,name.c_str(),timeStepId+1,&locDt,&locIt,&dt));
- _iteration=locDt; _order=locIt; _time=dt;
+ _iteration=FromMedInt<int>(locDt); _order=FromMedInt<int>(locIt); _time=dt;
MEDFILESAFECALLERRD0(MEDparameterValueRd,(fid,name.c_str(),_iteration,_order,reinterpret_cast<unsigned char *const>(&_arr)));
}
{
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
- int nbPar=MEDnParameter(fid);
+ med_int nbPar=MEDnParameter(fid);
std::ostringstream oss; oss << "MEDFileParameterDouble1TS : no double param name \"" << paramName << "\" ! Double Parameters available are : ";
INTERP_KERNEL::AutoPtr<char> pName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
INTERP_KERNEL::AutoPtr<char> descName=MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE);
med_parameter_type paramType;
for(int i=0;i<nbPar;i++)
{
- int nbOfSteps;
+ med_int nbOfSteps;
MEDFILESAFECALLERRD0(MEDparameterInfo,(fid,i+1,pName,¶mType,descName,unitName,&nbOfSteps));
std::string paramNameCpp=MEDLoaderBase::buildStringFromFortran(pName,MED_NAME_SIZE);
if(paramNameCpp==paramName && paramType==MED_FLOAT64)
_dt_unit=MEDLoaderBase::buildStringFromFortran(unitName,MED_SNAME_SIZE);
_name=paramNameCpp;
_desc_name=MEDLoaderBase::buildStringFromFortran(descName,MED_COMMENT_SIZE);
- finishLoading(fid,_name,dt,it,nbOfSteps);
+ finishLoading(fid,_name,dt,it,FromMedInt<int>(nbOfSteps));
return ;
}
else
{
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
- int nbPar=MEDnParameter(fid);
+ med_int nbPar=MEDnParameter(fid);
std::ostringstream oss; oss << "MEDFileParameterDouble1TS : no double param name \"" << paramName << "\" ! Double Parameters available are : ";
INTERP_KERNEL::AutoPtr<char> pName=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
INTERP_KERNEL::AutoPtr<char> descName=MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE);
med_parameter_type paramType;
for(int i=0;i<nbPar;i++)
{
- int nbOfSteps;
+ med_int nbOfSteps;
MEDFILESAFECALLERRD0(MEDparameterInfo,(fid,i+1,pName,¶mType,descName,unitName,&nbOfSteps));
std::string paramNameCpp=MEDLoaderBase::buildStringFromFortran(pName,MED_NAME_SIZE);
if(paramNameCpp==paramName && paramType==MED_FLOAT64)
{
MEDFileUtilities::CheckFileForRead(fileName);
MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY);
- int nbPar=MEDnParameter(fid);
+ med_int nbPar=MEDnParameter(fid);
if(nbPar<1)
{
std::ostringstream oss2; oss2 << "No parameter in file \"" << fileName << "\" !";
INTERP_KERNEL::AutoPtr<char> descName=MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE);
INTERP_KERNEL::AutoPtr<char> unitName=MEDLoaderBase::buildEmptyString(MED_SNAME_SIZE);
med_parameter_type paramType;
- int nbOfSteps;
+ med_int nbOfSteps;
MEDFILESAFECALLERRD0(MEDparameterInfo,(fid,1,pName,¶mType,descName,unitName,&nbOfSteps));
std::string paramNameCpp=MEDLoaderBase::buildStringFromFortran(pName,MED_NAME_SIZE);
if(paramType==MED_FLOAT64)
MEDFileParameterMultiTS::MEDFileParameterMultiTS(med_idt fid)
{
- int nbPar(MEDnParameter(fid));
+ med_int nbPar(MEDnParameter(fid));
if(nbPar<1)
{
std::ostringstream oss; oss << "MEDFileParameterMultiTS : no parameter in file \"" << FileNameFromFID(fid) << "\" !" ;
INTERP_KERNEL::AutoPtr<char> descName(MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE));
INTERP_KERNEL::AutoPtr<char> unitName(MEDLoaderBase::buildEmptyString(MED_SNAME_SIZE));
med_parameter_type paramType;
- int nbOfSteps;
+ med_int nbOfSteps;
MEDFILESAFECALLERRD0(MEDparameterInfo,(fid,1,pName,¶mType,descName,unitName,&nbOfSteps));
std::string paramNameCpp(MEDLoaderBase::buildStringFromFortran(pName,MED_NAME_SIZE));
_dt_unit=MEDLoaderBase::buildStringFromFortran(unitName,MED_SNAME_SIZE);
_name=paramNameCpp;
_desc_name=MEDLoaderBase::buildStringFromFortran(descName,MED_COMMENT_SIZE);
- finishLoading(fid,paramType,nbOfSteps);
+ finishLoading(fid,paramType,FromMedInt<int>(nbOfSteps));
}
MEDFileParameterMultiTS::MEDFileParameterMultiTS(med_idt fid, const std::string& paramName)
{
- int nbPar(MEDnParameter(fid));
+ med_int nbPar(MEDnParameter(fid));
std::ostringstream oss; oss << "MEDFileParameterDouble1TS : no double param name \"" << paramName << "\" ! Double Parameters available are : ";
INTERP_KERNEL::AutoPtr<char> pName(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
INTERP_KERNEL::AutoPtr<char> descName(MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE));
med_parameter_type paramType;
for(int i=0;i<nbPar;i++)
{
- int nbOfSteps;
+ med_int nbOfSteps;
MEDFILESAFECALLERRD0(MEDparameterInfo,(fid,i+1,pName,¶mType,descName,unitName,&nbOfSteps));
std::string paramNameCpp(MEDLoaderBase::buildStringFromFortran(pName,MED_NAME_SIZE));
if(paramNameCpp==paramName)
_dt_unit=MEDLoaderBase::buildStringFromFortran(unitName,MED_SNAME_SIZE);
_name=paramNameCpp;
_desc_name=MEDLoaderBase::buildStringFromFortran(descName,MED_COMMENT_SIZE);
- finishLoading(fid,paramType,nbOfSteps);
+ finishLoading(fid,paramType,FromMedInt<int>(nbOfSteps));
return ;
}
else
_param_per_ts.resize(nbOfSteps);
for(int i=0;i<nbOfSteps;i++)
{
- int dt,it;
+ med_int dt,it;
double tim;
MEDFILESAFECALLERRD0(MEDparameterComputationStepInfo,(fid,_name.c_str(),i+1,&dt,&it,&tim));
switch(typ)
{
case MED_FLOAT64:
- _param_per_ts[i]=MEDFileParameterDouble1TSWTI::New(dt,it,tim);
+ _param_per_ts[i]=MEDFileParameterDouble1TSWTI::New(FromMedInt<int>(dt),FromMedInt<int>(it),tim);
_param_per_ts[i]->readValue(fid,_name.c_str());
break;
/*case MED_INT32;
MEDFileParameters::MEDFileParameters(med_idt fid)
{
- int nbPar=MEDnParameter(fid);
+ med_int nbPar=MEDnParameter(fid);
_params.resize(nbPar);
INTERP_KERNEL::AutoPtr<char> pName(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
INTERP_KERNEL::AutoPtr<char> descName(MEDLoaderBase::buildEmptyString(MED_COMMENT_SIZE));
med_parameter_type paramType;
for(int i=0;i<nbPar;i++)
{
- int nbOfSteps;
+ med_int nbOfSteps;
MEDFILESAFECALLERRD0(MEDparameterInfo,(fid,i+1,pName,¶mType,descName,unitName,&nbOfSteps));
std::string paramNameCpp(MEDLoaderBase::buildStringFromFortran(pName,MED_NAME_SIZE));
_params[i]=MEDFileParameterMultiTS::New(fid,paramNameCpp);
std::string modelName(getModelName());
INTERP_KERNEL::AutoPtr<char> constattname(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE)),profilename(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
med_attribute_type constatttype;
- int nbCompo;
+ med_int nbCompo;
med_entity_type met;
med_int miPflSz;
MEDFILESAFECALLERRD0(MEDstructElementConstAttInfo,(fid,modelName.c_str(),idCstAtt+1,constattname,&constatttype,&nbCompo,&met,profilename,&miPflSz));
_tof=MEDFileMesh::ConvertFromMEDFileEntity(met);
//
_val=MEDFileStructureElement::BuildFrom(constatttype);
- nbCompo=MEDFileStructureElement::EffectiveNbCompo(constatttype,nbCompo);
+ nbCompo=MEDFileStructureElement::EffectiveNbCompo(constatttype,FromMedInt<int>(nbCompo));
mcIdType pflSz = miPflSz;
if(pflSz==0 && getProfile().empty())
{
med_attribute_type varatttype;
{
//int pflSz;
- MEDFILESAFECALLERRD0(MEDstructElementVarAttInfo,(fid,modelName.c_str(),idVarAtt+1,varattname,&varatttype,&_nb_compo));
+ med_int nbComp;
+ MEDFILESAFECALLERRD0(MEDstructElementVarAttInfo,(fid,modelName.c_str(),idVarAtt+1,varattname,&varatttype,&nbComp));
+ _nb_compo=FromMedInt<int>(nbComp);
}
setName(MEDLoaderBase::buildStringFromFortran(varattname,MED_NAME_SIZE));
_gen=MEDFileStructureElement::BuildFrom(varatttype);
INTERP_KERNEL::AutoPtr<char> modelName(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE)),supportMeshName(MEDLoaderBase::buildEmptyString(MED_NAME_SIZE));
med_geometry_type sgeoType;
med_entity_type entiyType;
- int nConsAttr(0),nVarAttr(0);
+ med_int nConsAttr(0),nVarAttr(0);
{
med_bool anyPfl;
- int nnode(0),ncell(0);
- MEDFILESAFECALLERRD0(MEDstructElementInfo,(fid,idSE+1,modelName,&_id_type,&_dim,supportMeshName,&entiyType,&nnode,&ncell,&sgeoType,&nConsAttr,&anyPfl,&nVarAttr));
+ med_int nnode(0),ncell(0),dim(0);
+ med_geometry_type idType;
+ MEDFILESAFECALLERRD0(MEDstructElementInfo,(fid,idSE+1,modelName,&idType,&dim,supportMeshName,&entiyType,&nnode,&ncell,&sgeoType,&nConsAttr,&anyPfl,&nVarAttr));
+ _id_type=(int)idType;
+ _dim=FromMedInt<int>(dim);
}
_name=MEDLoaderBase::buildStringFromFortran(modelName,MED_NAME_SIZE);
_sup_mesh_name=MEDLoaderBase::buildStringFromFortran(supportMeshName,MED_NAME_SIZE);
MEDFileStructureElements::MEDFileStructureElements(med_idt fid, const MEDFileMeshSupports *ms)
{
- int nbSE(MEDnStructElement(fid));
+ med_int nbSE(MEDnStructElement(fid));
_elems.resize(nbSE);
for(int i=0;i<nbSE;i++)
_elems[i]=MEDFileStructureElement::New(fid,i,ms);
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
oss << " has been detected readable but ";
- int major,minor,release;
+ med_int major,minor,release;
MEDfileNumVersionRd(fid,&major,&minor,&release);
if(major<2 || (major==2 && minor<2))
{
std::string MEDCoupling::MEDFileWritable::FileNameFromFID(med_idt fid)
{
- int lgth(MEDfileName(fid,0,0));
+ med_int lgth(MEDfileName(fid,0,0));
if(lgth<=0)
return std::string();
INTERP_KERNEL::AutoPtr<char> tmp(new char[lgth+1]);
med_mesh_type type_maillage;
med_int Sdim,Mdim;
std::string trueMeshName;
- med_int meshId=getIdFromMeshName(fid,meshName,trueMeshName);
+ int meshId=FromMedInt<int>(getIdFromMeshName(fid,meshName,trueMeshName));
INTERP_KERNEL::AutoPtr<char> dt_unit=MEDLoaderBase::buildEmptyString(MED_LNAME_SIZE);
med_sorting_type sortingType;
med_int nstep;
med_axis_type axisType;
- int naxis(MEDmeshnAxis(fid,meshId));
+ med_int naxis(MEDmeshnAxis(fid,meshId));
INTERP_KERNEL::AutoPtr<char> axisname=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
INTERP_KERNEL::AutoPtr<char> axisunit=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
MEDFILESAFECALLERRD0(MEDmeshInfo,(fid,meshId,nommaa,&Sdim,&Mdim,&type_maillage,maillage_description,dt_unit,&sortingType,&nstep,&axisType,axisname,axisunit));
{
med_geometry_type curMedType=typmai[i];
med_bool changement,transformation;
- int curNbOfElemM(MEDmeshnEntity(fid,nommaa,numdt,numit,MED_CELL,curMedType,MED_CONNECTIVITY,MED_NODAL,&changement,&transformation));
- int curNbOfElemF(MEDmeshnEntity(fid,nommaa,numdt,numit,MED_CELL,curMedType,MED_CONNECTIVITY,MED_NODAL,&changement,&transformation));//limitation
- int curNbOfElem;
+ med_int curNbOfElemM(MEDmeshnEntity(fid,nommaa,numdt,numit,MED_CELL,curMedType,MED_CONNECTIVITY,MED_NODAL,&changement,&transformation));
+ med_int curNbOfElemF(MEDmeshnEntity(fid,nommaa,numdt,numit,MED_CELL,curMedType,MED_CONNECTIVITY,MED_NODAL,&changement,&transformation));//limitation
+ med_int curNbOfElem;
med_entity_type whichEntity;
MEDLoaderNS::dispatchElems(curNbOfElemM,curNbOfElemF,curNbOfElem,whichEntity);
if(curNbOfElem>0)
return ret;
}
-med_int MEDLoaderNS::getIdFromMeshName(med_idt fid, const std::string& meshName, std::string& trueMeshName)
+int MEDLoaderNS::getIdFromMeshName(med_idt fid, const std::string& meshName, std::string& trueMeshName)
{
if(meshName.empty())
{
throw INTERP_KERNEL::Exception(os2.str().c_str());
}
trueMeshName=meshName;
- return ToMedInt( iter-meshes.begin()+1 );
+ return (int)( iter-meshes.begin()+1 );
}
std::vector<std::string> MEDLoaderNS::getMeshNamesFid(med_idt fid)
std::vector<std::string> ret(n);
for(int i=0;i<n;i++)
{
- int naxis(MEDmeshnAxis(fid,i+1));
+ med_int naxis(MEDmeshnAxis(fid,i+1));
INTERP_KERNEL::AutoPtr<char> axisname=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
INTERP_KERNEL::AutoPtr<char> axisunit=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
- int nstep;
+ med_int nstep;
MEDFILESAFECALLERRD0(MEDmeshInfo,(fid,i+1,nommaa,&space_dim,&mesh_dim,&type_maillage,maillage_description,dtunit,&stype,&nstep,&axistype,axisname,axisunit));
std::string cur=MEDLoaderBase::buildStringFromFortran(nommaa,sizeof(nommaa));
ret[i]=cur;
/*!
* This methods allows to merger all entities and to considerate only cell types.
*/
-void MEDLoaderNS::dispatchElems(int nbOfElemCell, int nbOfElemFace, int& nbOfElem, med_entity_type& whichEntity)
+void MEDLoaderNS::dispatchElems(med_int nbOfElemCell, med_int nbOfElemFace, med_int& nbOfElem, med_entity_type& whichEntity)
{
if(nbOfElemCell>=nbOfElemFace)
{
med_err ret(MEDlibraryNumVersion(&majj,&minn,&rell));
if(ret!=0)
throw INTERP_KERNEL::Exception("MEDFileVersion : fail to call MEDlibraryNumVersion ! It looks very bad !");
- major=majj;
- minor=minn;
- release=rell;
+ major=FromMedInt<int>(majj);
+ minor=FromMedInt<int>(minn);
+ release=FromMedInt<int>(rell);
}
/*!
* - the space dimension
* - the number of nodes
*/
-std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > MEDCoupling::GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, int& numberOfNodes)
+std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > MEDCoupling::GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, mcIdType& numberOfNodes)
{
MEDFileUtilities::AutoFid fid(MEDCoupling::OpenMEDFileForRead(fileName));
std::set<int> poss;
char maillage_description[MED_COMMENT_SIZE+1];
med_mesh_type type_maillage;
std::string trueMeshName;
- med_int meshId=MEDLoaderNS::getIdFromMeshName(fid,meshName,trueMeshName);
+ int meshId=MEDLoaderNS::getIdFromMeshName(fid,meshName,trueMeshName);
INTERP_KERNEL::AutoPtr<char> dt_unit=MEDLoaderBase::buildEmptyString(MED_LNAME_SIZE);
med_sorting_type sortingType;
- med_int nstep;
+ med_int nstep, mDim, sDim;
med_axis_type axisType;
- int naxis(MEDmeshnAxis(fid,meshId));
+ med_int naxis(MEDmeshnAxis(fid,meshId));
INTERP_KERNEL::AutoPtr<char> axisname=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
INTERP_KERNEL::AutoPtr<char> axisunit=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
- MEDFILESAFECALLERRD0(MEDmeshInfo,(fid,meshId,nommaa,&spaceDim,&meshDim,&type_maillage,maillage_description,dt_unit,&sortingType,&nstep,&axisType,axisname,axisunit));
+ MEDFILESAFECALLERRD0(MEDmeshInfo,(fid,meshId,nommaa,&sDim,&mDim,&type_maillage,maillage_description,dt_unit,&sortingType,&nstep,&axisType,axisname,axisunit));
+ meshDim=FromMedInt<int>(mDim);
+ spaceDim=FromMedInt<int>(sDim);
if(type_maillage!=MED_UNSTRUCTURED_MESH)
{
std::ostringstream oss; oss << "GetUMeshGlobalInfo : Mesh \""<< meshName << "\" in file \"" << fileName;
for(int i=0;i<MED_N_CELL_FIXED_GEO;i++)
{
med_geometry_type curMedType=typmai[i];
- int curNbOfElemM(MEDmeshnEntity(fid,nommaa,numdt,numit,MED_CELL,curMedType,MED_CONNECTIVITY,MED_NODAL,&changement,&transformation));
+ med_int curNbOfElemM(MEDmeshnEntity(fid,nommaa,numdt,numit,MED_CELL,curMedType,MED_CONNECTIVITY,MED_NODAL,&changement,&transformation));
if(curNbOfElemM>0)
{
INTERP_KERNEL::NormalizedCellType typp=typmai2[i];
{
ret[maxLev-dims[i]].push_back(geoTypes[i]);
}
- numberOfNodes=MEDmeshnEntity(fid,nommaa,numdt,numit,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&changement,&transformation);
+ numberOfNodes=ToIdType(MEDmeshnEntity(fid,nommaa,numdt,numit,MED_NODE,MED_NONE,MED_COORDINATE,MED_NO_CMODE,&changement,&transformation));
return ret;
}
med_int numfam;
for(int i=0;i<nfam;i++)
{
- int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
+ med_int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
med_int natt=MEDnFamily23Attribute(fid,meshName.c_str(),i+1);
INTERP_KERNEL::AutoPtr<med_int> attide=new med_int[natt];
INTERP_KERNEL::AutoPtr<med_int> attval=new med_int[natt];
med_int numfam;
for(int i=0;i<nfam;i++)
{
- int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
+ med_int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
med_int natt=MEDnFamily23Attribute(fid,meshName.c_str(),i+1);
INTERP_KERNEL::AutoPtr<med_int> attide=new med_int[natt];
INTERP_KERNEL::AutoPtr<med_int> attval=new med_int[natt];
bool found=false;
for(int i=0;i<nfam && !found;i++)
{
- int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
+ med_int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
med_int natt=MEDnFamily23Attribute(fid,meshName.c_str(),i+1);
INTERP_KERNEL::AutoPtr<med_int> attide=new med_int[natt];
INTERP_KERNEL::AutoPtr<med_int> attval=new med_int[natt];
med_int numfam;
for(int i=0;i<nfam;i++)
{
- int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
+ med_int ngro=MEDnFamilyGroup(fid,meshName.c_str(),i+1);
med_int natt=MEDnFamily23Attribute(fid,meshName.c_str(),i+1);
INTERP_KERNEL::AutoPtr<med_int> attide=new med_int[natt];
INTERP_KERNEL::AutoPtr<med_int> attval=new med_int[natt];
MEDFILESAFECALLERRD0(MEDfieldInfo,(fid,i+1,nomcha,maa_ass,&localmesh,&typcha,comp,unit,dt_unit,&nbPdt));
std::string curFieldName=MEDLoaderBase::buildStringFromFortran(nomcha,MED_NAME_SIZE+1);
std::string curMeshName=MEDLoaderBase::buildStringFromFortran(maa_ass,MED_NAME_SIZE+1);
- int profilesize,nbi;
+ med_int profilesize,nbi;
if(curMeshName==meshName)
{
bool found=false;
std::string curMeshName=MEDLoaderBase::buildStringFromFortran(maa_ass,MED_NAME_SIZE+1);
if(nbPdt>0)
{
- int profilesize,nbi;
+ med_int profilesize,nbi;
MEDFILESAFECALLERRD0(MEDfieldComputingStepInfo,(fid,nomcha,1,&numdt,&numo,&dt));
med_int nbOfVal(MEDfieldnValueWithProfile(fid,nomcha,numdt,numo,MED_NODE,MED_NONE,1,MED_COMPACT_PFLMODE,
pflname,&profilesize,locname,&nbi));
{
for(int k=0;k<nbPdt;k++)
{
- int profilesize,nbi;
+ med_int profilesize,nbi;
MEDFILESAFECALLERRD0(MEDfieldComputingStepInfo,(fid,nomcha,k+1,&numdt,&numo,&dt));
med_int nbOfVal(MEDfieldnValueWithProfile(fid,nomcha,numdt,numo,MED_CELL,typmai[j],1,MED_COMPACT_PFLMODE,
pflname,&profilesize,locname,&nbi));
{
for(int k=0;k<nbPdt;k++)
{
- int profilesize,nbi;
+ med_int profilesize,nbi;
MEDFILESAFECALLERRD0(MEDfieldComputingStepInfo,(fid,nomcha,k+1,&numdt,&numo,&dt));
med_int nbOfVal(MEDfieldnValueWithProfile(fid,nomcha,numdt,numo,MED_NODE,MED_NONE,1,MED_COMPACT_PFLMODE,
pflname,&profilesize,locname,&nbi));
#include "MEDCouplingRefCountObject.hxx"
#include "NormalizedUnstructuredMesh.hxx"
#include "MCAuto.hxx"
+#include "MCIdType.hxx"
#include <list>
#include <vector>
MEDLOADER_EXPORT void MEDFileVersion(int& major, int& minor, int& release);
MEDLOADER_EXPORT void CheckFileForRead(const std::string& fileName);
MEDLOADER_EXPORT std::vector<std::string> GetMeshNames(const std::string& fileName);
- MEDLOADER_EXPORT std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, int& numberOfNodes);
+ MEDLOADER_EXPORT std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, mcIdType& numberOfNodes);
MEDLOADER_EXPORT std::vector< std::pair<std::string,std::string> > GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName);
MEDLOADER_EXPORT std::vector<std::string> GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName);
MEDLOADER_EXPORT std::vector<std::string> GetMeshGroupsNames(const std::string& fileName, const std::string& meshName);
namespace MEDLoaderNS
{
int readUMeshDimFromFile(const std::string& fileName, const std::string& meshName, std::vector<int>& possibilities);
- void dispatchElems(int nbOfElemCell, int nbOfElemFace, int& nbOfElem, med_entity_type& whichEntity);
+ void dispatchElems(med_int nbOfElemCell, med_int nbOfElemFace, med_int& nbOfElem, med_entity_type& whichEntity);
template<class T>
void writeFieldWithoutReadingAndMappingOfMeshInFile(const std::string& fileName, const typename MEDCoupling::Traits<T>::FieldType *f, bool writeFromScratch);
- med_int getIdFromMeshName(med_idt fid, const std::string& meshName, std::string& trueMeshName);
+ int getIdFromMeshName(med_idt fid, const std::string& meshName, std::string& trueMeshName);
std::vector<std::string> getMeshNamesFid(med_idt fid);
}
PyObject *GetUMeshGlobalInfoSwig(const std::string& fileName, const std::string& meshName)
{
- int meshDim,spaceDim,numberOfNodes;
+ int meshDim,spaceDim;
+ mcIdType numberOfNodes;
std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > res=MEDCoupling::GetUMeshGlobalInfo(fileName,meshName,meshDim,spaceDim,numberOfNodes);
PyObject *ret=PyTuple_New(4);
PyObject *elt0=PyList_New(res.size());
PyTuple_SetItem(ret,0,elt0);
PyTuple_SetItem(ret,1,SWIG_From_int(meshDim));
PyTuple_SetItem(ret,2,SWIG_From_int(spaceDim));
- PyTuple_SetItem(ret,3,SWIG_From_int(numberOfNodes));
+ PyTuple_SetItem(ret,3,SWIG_From_long(numberOfNodes));
return ret;
}
{
for (int j=0; j<lggeom; j++)
{
- int profilesize=0,nbi=0;
+ med_int profilesize=0,nbi=0;
med_entity_type enttype=ENTITYTYPE[ie];
//enttype=MED_NODE;enttype=MED_CELL;enttype=MED_NODE_ELEMENT;
char pflname[MED_NAME_SIZE+1]="";
MEDFileUMesh *ParaMEDFileUMesh::NewPrivate(med_idt fid, int iPart, int nbOfParts, const std::string& fileName, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
MCAuto<MEDFileUMesh> ret;
- int meshDim, spaceDim, numberOfNodes;
+ int meshDim, spaceDim;
+ mcIdType numberOfNodes;
std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > typesDistrib(GetUMeshGlobalInfo(fileName,mName,meshDim,spaceDim,numberOfNodes));
std::vector<INTERP_KERNEL::NormalizedCellType> types;
std::vector<mcIdType> distrib;