int order=getOrder();
TypeOfField type=getType();
INTERP_KERNEL::NormalizedCellType geoType=getGeoType();
- int profilesize;
med_geometry_type mgeoti;
med_entity_type menti=MEDFileFieldPerMeshPerType::ConvertIntoMEDFileType(type,geoType,mgeoti);
DataArrayDouble *arr=getArray();
oss << "NO GLOBAL INFORMATION !\n";
}
+MEDFieldFieldGlobsReal::~MEDFieldFieldGlobsReal()
+{
+}
+
void MEDFieldFieldGlobsReal::shallowCpyGlobs(const MEDFieldFieldGlobsReal& other)
{
_globals=other._globals;
if(found)
{
nbstep2=nbOfStep;
- _field_type=_field_type=MEDFileUtilities::TraduceFieldType(typcha);
+ _field_type=MEDFileUtilities::TraduceFieldType(typcha);
_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);
void appendGlobs(const MEDFieldFieldGlobsReal& other, double eps) throw(INTERP_KERNEL::Exception);
virtual std::vector<std::string> getPflsReallyUsed() const = 0;
virtual std::vector<std::string> getLocsReallyUsed() const = 0;
+ virtual ~MEDFieldFieldGlobsReal();
//
void loadProfileInFile(med_idt fid, int id, const char *pflName) throw(INTERP_KERNEL::Exception);
void loadProfileInFile(med_idt fid, int id);
int i=0;
for(std::vector<int>::const_iterator it1=famIds.begin();it1!=famIds.end();it1++,i++)
{
- std::string name=getFamilyNameGivenId(*it1);
- fams[i]=name;
+ std::string name2=getFamilyNameGivenId(*it1);
+ fams[i]=name2;
}
_groups[oname]=fams;
}
std::copy(fams.begin(),fams.end(),std::ostream_iterator<std::string>(oss," "));
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
- for(std::vector<std::string>::const_iterator it=grps.begin();it!=grps.end();it++)
+ for(std::vector<std::string>::const_iterator it3=grps.begin();it3!=grps.end();it3++)
{
- std::map< std::string, std::vector<std::string> >::iterator it2=_groups.find(*it);
+ std::map< std::string, std::vector<std::string> >::iterator it2=_groups.find(*it3);
if(it2!=_groups.end())
(*it2).second.push_back(fName);
else
{
- std::vector<std::string> grps(1,fName);
- _groups[*it]=grps;
+ std::vector<std::string> grps2(1,fName);
+ _groups[*it3]=grps2;
}
}
}
else
{
std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > grps2(grps.size());
- for(unsigned int i=0;i<grps.size();i++)
+ for(unsigned int ii=0;ii<grps.size();ii++)
{
- grps2[i]=MEDFileUMeshSplitL1::Renumber(getRevNumberFieldAtLevel(meshDimRelToMaxExt),grps[i]);
- grps2[i]->setName(grps[i]->getName().c_str());
+ grps2[ii]=MEDFileUMeshSplitL1::Renumber(getRevNumberFieldAtLevel(meshDimRelToMaxExt),grps[ii]);
+ grps2[ii]->setName(grps[ii]->getName().c_str());
}
std::vector<const DataArrayInt *> grps3(grps2.begin(),grps2.end());
fam=DataArrayInt::MakePartition(grps3,sz,fidsOfGroups);
return false;
}
}
- std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> > _ms;
+ //std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> > _ms;
return true;
}
MEDFileMesh::clearNonDiscrAttributes();
const DataArrayDouble *coo1=_coords;
if(coo1)
- ((DataArrayDouble *)coo1)->setName("");//This parameter is not discriminant for comparison
+ (const_cast<DataArrayDouble *>(coo1))->setName("");//This parameter is not discriminant for comparison
const DataArrayInt *famc1=_fam_coords;
if(famc1)
- ((DataArrayInt *)famc1)->setName("");//This parameter is not discriminant for comparison
+ (const_cast<DataArrayInt *>(famc1))->setName("");//This parameter is not discriminant for comparison
const DataArrayInt *numc1=_num_coords;
if(numc1)
- ((DataArrayInt *)numc1)->setName("");//This parameter is not discriminant for comparison
+ (const_cast<DataArrayInt *>(numc1))->setName("");//This parameter is not discriminant for comparison
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
{
const MEDFileUMeshSplitL1 *tmp=(*it);
int *bt=bigtab;
for(int i=0;i<nbOfCells;i++,w1++)
{
- int nbOfFaces=0;
+ int nbOfFaces2=0;
for(const int *w=conn+connI[i]+1;w!=conn+connI[i+1];w2++)
{
const int *wend=std::find(w,conn+connI[i+1],-1);
w=wend+1;
else
w=wend;
- nbOfFaces++;
+ nbOfFaces2++;
}
- w1[1]=w1[0]+nbOfFaces;
+ w1[1]=w1[0]+nbOfFaces2;
}
MEDmeshPolyhedronWr(fid,mname,dt,it,timm,MED_CELL,MED_NODAL,nbOfCells+1,tab1,nbOfFaces+1,tab2,bigtab);
}
if(found)
for(int j=0;j<ngro;j++)
{
- std::string cur=MEDLoaderBase::buildStringFromFortran(gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
- ret.push_back(cur);
+ std::string cur2=MEDLoaderBase::buildStringFromFortran(gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
+ ret.push_back(cur2);
}
}
MEDfileClose(fid);
if(nbPdt>0)
{
bool found=false;
- for(int i=0;i<nbPdt && !found;i++)
+ for(int ii=0;ii<nbPdt && !found;ii++)
{
MEDfieldComputingStepInfo(fid,nomcha,1,&numdt,&numo,&dt);
med_int nbOfVal=MEDfieldnValueWithProfile(fid,nomcha,numdt,numo,MED_NODE,MED_NONE,1,MED_COMPACT_PFLMODE,
if(found)
{
infos.resize(ncomp);
- for(int i=0;i<ncomp;i++)
- infos[i]=MEDLoaderBase::buildUnionUnit(comp+i*MED_SNAME_SIZE,MED_SNAME_SIZE,unit+i*MED_SNAME_SIZE,MED_SNAME_SIZE);
+ for(int ii=0;ii<ncomp;ii++)
+ infos[ii]=MEDLoaderBase::buildUnionUnit(comp+ii*MED_SNAME_SIZE,MED_SNAME_SIZE,unit+ii*MED_SNAME_SIZE,MED_SNAME_SIZE);
bool found2=false;
med_int numdt=0,numo=0;
med_float dt=0.0;
std::string cur=MEDLoaderBase::buildStringFromFortran(nomfam,sizeof(nomfam));
for(int j=0;j<ngro;j++)
{
- std::string cur=MEDLoaderBase::buildStringFromFortran(gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
- if(std::find(grps.begin(),grps.end(),cur)!=grps.end())
+ std::string cur2=MEDLoaderBase::buildStringFromFortran(gro+j*MED_LNAME_SIZE,MED_LNAME_SIZE);
+ if(std::find(grps.begin(),grps.end(),cur2)!=grps.end())
{
ret.push_back(numfam);
break;
const int *famPtr=0;
if(families)
famPtr=families->getConstPointer();
- for(int i=0;i<nbOfElem;i++)
+ for(int ii=0;ii<nbOfElem;ii++)
{
int delta=connIdxPtr[1]-connIdxPtr[0];
if(*connPtr==type)
{
conn4MEDFile.insert(conn4MEDFile.end(),connPtr+1,connPtr+delta);
if(families)
- fam4MEDFile.push_back(famPtr[i]);
- renumber.push_back(i+1+renumOffset);
+ fam4MEDFile.push_back(famPtr[ii]);
+ renumber.push_back(ii+1+renumOffset);
ret++;
}
connIdxPtr++;
const int *famPtr=0;
if(families)
famPtr=families->getConstPointer();
- for(int i=0;i<nbOfElem;i++)
+ for(int ii=0;ii<nbOfElem;ii++)
{
int delta=connIdxPtr[1]-connIdxPtr[0];
if(*connPtr==INTERP_KERNEL::NORM_POLYGON)
conn4MEDFile.insert(conn4MEDFile.end(),connPtr+1,connPtr+delta);
connIndex4MEDFile.push_back(connIndex4MEDFile.back()+delta-1);
if(families)
- fam4MEDFile.push_back(famPtr[i]);
- renumber.push_back(i+1+renumOffset);
+ fam4MEDFile.push_back(famPtr[ii]);
+ renumber.push_back(ii+1+renumOffset);
ret++;
}
connIdxPtr++;
const int *famPtr=0;
if(families)
famPtr=families->getConstPointer();
- for(int i=0;i<nbOfElem;i++)
+ for(int ii=0;ii<nbOfElem;ii++)
{
int delta=connIdxPtr[1]-connIdxPtr[0];
if(*connPtr==INTERP_KERNEL::NORM_POLYHED)
}
connIndexRk24MEDFile.push_back(connIndexRk24MEDFile.back()+nbOfFacesOfPolyh);
if(families)
- fam4MEDFile.push_back(famPtr[i]);
- renumber.push_back(i+1+renumOffset);
+ fam4MEDFile.push_back(famPtr[ii]);
+ renumber.push_back(ii+1+renumOffset);
ret++;
}
connIdxPtr++;
//
for(int itId=1;itId<(int)its.size();itId++)
{
- std::list<MEDLoader::MEDFieldDoublePerCellType> fieldPerCellType;
- double time;
- std::vector<std::string> infos;
- MEDLoaderNS::readFieldDoubleDataInMedFile(fileName,meshName,fieldName,its[itId].first,its[itId].second,type,fieldPerCellType,time,infos);
- std::vector<int> familiesToKeep;
- std::vector<INTERP_KERNEL::NormalizedCellType> typesToKeep;
- if(type==ON_CELLS || type==ON_GAUSS_PT || type==ON_GAUSS_NE)
- for(std::list<MEDLoader::MEDFieldDoublePerCellType>::const_iterator iter=fieldPerCellType.begin();iter!=fieldPerCellType.end();iter++)
- typesToKeep.push_back((*iter).getType());
- ret[itId]=MEDLoaderNS::readFieldDoubleLev2(fileName,type,meshDim,cellRenum,m1,infos,fieldName,its[itId].first,its[itId].second,time,fieldPerCellType);
+ std::list<MEDLoader::MEDFieldDoublePerCellType> fieldPerCellType2;
+ double timmee;
+ std::vector<std::string> infoss;
+ MEDLoaderNS::readFieldDoubleDataInMedFile(fileName,meshName,fieldName,its[itId].first,its[itId].second,type,fieldPerCellType2,timmee,infoss);
+ ret[itId]=MEDLoaderNS::readFieldDoubleLev2(fileName,type,meshDim,cellRenum,m1,infoss,fieldName,its[itId].first,its[itId].second,timmee,fieldPerCellType2);
//clean-up
- MEDLoaderNS::releaseMEDFileCoreFrmt<MEDLoader::MEDFieldDoublePerCellType>(fieldPerCellType);
+ MEDLoaderNS::releaseMEDFileCoreFrmt<MEDLoader::MEDFieldDoublePerCellType>(fieldPerCellType2);
}
delete [] cellRenum;
return ret;
}
MEDfileClose(fid);
if(renum)
- ((ParaMEDMEM::MEDCouplingFieldDouble *)f)->decrRef();
+ f->decrRef();
}
/*!
std::string fieldName(f->getName());
if(fieldName.empty())
throw INTERP_KERNEL::Exception("Trying to write a field with no name ! MED file format needs a not empty field name !");
- MEDCouplingUMesh *mesh=dynamic_cast<MEDCouplingUMesh *>((MEDCouplingMesh *)f->getMesh());
+ MEDCouplingUMesh *mesh=dynamic_cast<MEDCouplingUMesh *>(const_cast<MEDCouplingMesh *>(f->getMesh()));
if(mesh)
{
bool isRenumbering;
{
if ( const int * conn = getGibi2MedQuadraticInterlace( type ))
{
- Cell* ma = (Cell*) & aCell;
+ Cell* ma = const_cast<Cell*>(&aCell);
//cout << "###### BEFORE ConvertQuadratic() " << *ma << endl;
vector< Node* > new_nodes( ma->_nodes.size() );
for ( size_t i = 0; i < new_nodes.size(); ++i )
inline void reverse(const Cell & aCell, const vector<pair<int,int> > & swapVec )
{
- Cell* ma = (Cell*) & aCell;
+ Cell* ma = const_cast<Cell*>(&aCell);
for ( unsigned i = 0; i < swapVec.size(); ++i )
std::swap( ma->_nodes[ swapVec[i].first ],
ma->_nodes[ swapVec[i].second ]);
int Group::size() const
{
- int size = 0;
+ int sizze = 0;
if ( !_relocTable.empty() )
- size = _relocTable.size();
+ sizze = _relocTable.size();
else if ( _medGroup )
- size = _medGroup->getNumberOfTuples();
+ sizze = _medGroup->getNumberOfTuples();
else if ( !_cells.empty() )
- size = _cells.size();
+ sizze = _cells.size();
else
for ( size_t i = 0; i < _groups.size(); ++i )
- size += _groups[i]->size();
- return size;
+ sizze += _groups[i]->size();
+ return sizze;
}
//================================================================================
{
if ( manifold )
{
- list<const Cell*>::iterator i = ml.begin();
+ list<const Cell*>::iterator ii = ml.begin();
cout << nbFaceByLink << " faces by 1 link:";
- for( ; i!= ml.end(); i++ )
- cout << "in sub-mesh " << fgm[ *i ]->_name << endl << **i;
+ for( ; ii!= ml.end(); ii++ )
+ cout << "in sub-mesh " << fgm[ *ii ]->_name << endl << **ii;
}
manifold = false;
}
/*!
* \brief CellsByDimIterator constructor
*/
-CellsByDimIterator::CellsByDimIterator( const IntermediateMED & medi, int dim)
+CellsByDimIterator::CellsByDimIterator( const IntermediateMED & medi, int dimm)
{
myImed = & medi;
- init( dim );
+ init( dimm );
}
/*!
* \brief Initialize iteration on cells of given dimention
*/
-void CellsByDimIterator::init(const int dim)
+void CellsByDimIterator::init(const int dimm)
{
myCurType = -1;
myTypeEnd = INTERP_KERNEL::NORM_HEXA20 + 1;
- myDim = dim;
+ myDim = dimm;
}
/*!
* \brief return next set of Cell's of required dimension
*/
int CellsByDimIterator::dim(const bool last) const
{
- int type = myCurType;
+ int typp = myCurType;
if ( !last )
- while ( type < myTypeEnd && myImed->_cellsByType[type].empty() )
- ++type;
- return type < myTypeEnd ? getDimension( TCellType( type )) : 4;
+ while ( typp < myTypeEnd && myImed->_cellsByType[typp].empty() )
+ ++typp;
+ return typp < myTypeEnd ? getDimension( TCellType( typp )) : 4;
}
// END CellsByDimIterator ========================================================
else
{
// pass table
- for ( int i = 0; i < 4; ++i ) next();
+ for ( int ii = 0; ii < 4; ++ii ) next();
}
}
} // for (int itable = 0; itable < nbObjects; itable++)
const char name1[]="AField";
const char name3[]="AMesh1";
MEDCouplingFieldDouble *f1=buildVecFieldOnCells_1();
- ((MEDCouplingMesh *)f1->getMesh())->setName(name3);
+ (const_cast<MEDCouplingMesh *>(f1->getMesh()))->setName(name3);
f1->setName(name1);
f1->setTime(10.,8,9);
double *tmp=f1->getArray()->getPointer();
f1->decrRef();
f1=buildVecFieldOnNodes_1();
f1->setName(name1);
- ((MEDCouplingMesh *)f1->getMesh())->setName(name3);
+ (const_cast<MEDCouplingMesh *>(f1->getMesh()))->setName(name3);
f1->setTime(110.,8,9);
MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
f1->setTime(110.,108,109);
f1->checkCoherency();
const int arr2[6]={2,4,5,3,6,7};
MEDCouplingFieldDouble *f2=f1->buildSubPart(arr2,arr2+6);
- ((MEDCouplingMesh *)f2->getMesh())->setName(f1->getMesh()->getName());
+ (const_cast<MEDCouplingMesh *>(f2->getMesh()))->setName(f1->getMesh()->getName());
MEDLoader::WriteField(fileName,f2,false);//<- false important for the test
//
MEDCouplingFieldDouble *f3=MEDLoader::ReadFieldNode(fileName,f2->getMesh()->getName(),0,f2->getName(),2,7);