MEDPARTITIONER::ConnectZone::ConnectZone():
_name("")
,_description("")
- ,_distant_domain_number(0)
,_local_domain_number(0)
+ ,_distant_domain_number(0)
,_node_corresp(0)
,_face_corresp(0)
{
MEDPARTITIONER::ConnectZone::ConnectZone(const ConnectZone & myConnectZone):
_name(myConnectZone._name)
,_description(myConnectZone._description)
- ,_distant_domain_number(myConnectZone._distant_domain_number)
,_local_domain_number(myConnectZone._local_domain_number)
+ ,_distant_domain_number(myConnectZone._distant_domain_number)
,_node_corresp(myConnectZone._node_corresp)
,_face_corresp(myConnectZone._face_corresp)
,_entity_corresp(myConnectZone._entity_corresp)
/*!
* Method contributing to the distant cell graph
*/
-MEDPARTITIONER::JointFinder::JointFinder(const MeshCollection& mc):_mesh_collection(mc), _topology(mc.getTopology()),_domain_selector(mc.getParaDomainSelector())
+MEDPARTITIONER::JointFinder::JointFinder(const MeshCollection& mc):_mesh_collection(mc),_domain_selector(mc.getParaDomainSelector()),_topology(mc.getTopology())
{
}
//retrieving target data for storage in commonDistantNodes array
std::vector<int> localCorrespondency;
RecvIntVec(localCorrespondency, targetProc);
- for (int i=0; i<localCorrespondency.size()/2; i++)
+ for (std::size_t i=0; i<localCorrespondency.size()/2; i++)
{
_distant_node_cell[isource][itarget].insert(std::make_pair(localCorrespondency[2*i],localCorrespondency[2*i+1]));
}
{
for (int itarget=0; itarget<nbdomain; itarget++)
{
- for (int i=0; i<_node_node[itarget][isource].size(); i++)
+ for (std::size_t i=0; i<_node_node[itarget][isource].size(); i++)
std::cout << " nn" << _domain_selector->rank() << itarget << "|" << isource << "|" << i << "|" <<
_node_node[itarget][isource][i].first << "-" <<
_node_node[itarget][isource][i].second;
Topology* topology,
bool family_splitting,
bool create_empty_groups)
- : _name(initialCollection._name),
- _topology(topology),
+ : _topology(topology),
_owns_topology(false),
_driver(0),
_domain_selector( initialCollection._domain_selector ),
_i_non_empty_mesh(-1),
+ _name(initialCollection._name),
_driver_type(MEDPARTITIONER::MedXml),
_subdomain_boundary_creates(false),
_family_splitting(family_splitting),
//treating families
////////////////////
- if (MyGlobals::_Is0verbose)
- if (isParallelMode())
- std::cout << "ParallelMode on " << topology->nbDomain() << " Domains" << std::endl;
- else
- std::cout << "NOT ParallelMode on " << topology->nbDomain() << " Domains" << std::endl;
-
+ if (MyGlobals::_Is0verbose)
+ {
+ if (isParallelMode())
+ std::cout << "ParallelMode on " << topology->nbDomain() << " Domains" << std::endl;
+ else
+ std::cout << "NOT ParallelMode on " << topology->nbDomain() << " Domains" << std::endl;
+ }
if (MyGlobals::_Is0verbose>10)
std::cout<<"treating cell and face families"<<std::endl;
_topology->convertGlobalCellList(&globalids[0],size,&ilocalnew[0],&ipnew[0]);
new2oldIds[iold].resize(nbNewDomain);
- for (int i=0; i<ilocalnew.size(); i++)
+ for (int i=0; i<(int)ilocalnew.size(); i++)
{
new2oldIds[iold][ipnew[i]].push_back(i);
}
{
std::vector<const ParaMEDMEM::MEDCouplingUMesh*> meshes;
- for (int i=0; i< splitMeshes[inew].size();i++)
+ for (int i=0;i<(int)splitMeshes[inew].size();i++)
if (splitMeshes[inew][i]!=0)
if (splitMeshes[inew][i]->getNumberOfCells()>0)
meshes.push_back(splitMeshes[inew][i]);
_mesh[inew]->zipCoords();
}
}
- for (int i=0; i< splitMeshes[inew].size(); i++)
- if (splitMeshes[inew][i]!=0) splitMeshes[inew][i]->decrRef();
+ for (int i=0;i<(int)splitMeshes[inew].size();i++)
+ if (splitMeshes[inew][i]!=0)
+ splitMeshes[inew][i]->decrRef();
}
if (MyGlobals::_Verbose>300)
std::cout << "proc " << rank << " : castCellMeshes end fusing" << std::endl;
coords=meshTwo.getCoords();
for (int inode=0; inode<nv2; inode++)
{
- double* coordsPtr=coords->getPointer()+inode*3;
+ double* coordsPtr2=coords->getPointer()+inode*3;
vector<int> elems;
- tree->getElementsAroundPoint(coordsPtr,elems);
+ tree->getElementsAroundPoint(coordsPtr2,elems);
if (elems.size()==0) continue;
nodeIds[inode]=elems[0];
}
//are incremented for each target node
//the face is considered as going to target domains if the counter of the domain
//is equal to the number of nodes
- for (int inode=0; inode<nodes.size(); inode++)
+ for (int inode=0; inode<(int)nodes.size(); inode++)
{
typedef multimap<pair<int,int>,pair<int,int> >::const_iterator MI;
int mynode=nodes[inode];
for (map<int,int>::iterator iter=faces.begin(); iter!=faces.end(); iter++)
{
- if (iter->second==nodes.size())
+ if (iter->second==(int)nodes.size())
//cvw eligible but may be have to be face of a cell of this->getMesh()[inew]?
//it is not sure here...
//done before writeMedfile on option?... see filterFaceOnCell()
for (int inew=0; inew<newSize; inew++)
{
if (_domain_selector->isMyDomain(iold) && !_domain_selector->isMyDomain(inew))
- if (splitMeshes[inew][iold] != 0)
- {
- _domain_selector->sendMesh(*(splitMeshes[inew][iold]), _domain_selector->getProcessorID(inew));
- }
- else
- {
- _domain_selector->sendMesh(*(empty), _domain_selector->getProcessorID(inew));
- }
+ {
+ if (splitMeshes[inew][iold] != 0)
+ {
+ _domain_selector->sendMesh(*(splitMeshes[inew][iold]), _domain_selector->getProcessorID(inew));
+ }
+ else
+ {
+ _domain_selector->sendMesh(*(empty), _domain_selector->getProcessorID(inew));
+ }
+ }
if (!_domain_selector->isMyDomain(iold) && _domain_selector->isMyDomain(inew))
_domain_selector->recvMesh(splitMeshes[inew][iold], _domain_selector->getProcessorID(iold));
}
vector<int> c;
vector<int> cI;
tmpMesh->getNodeIdsNearPoints(targetCoords->getConstPointer(),targetMesh.getNumberOfCells(),1e-10,c,cI);
- if (cI.size()!= targetMesh.getNumberOfCells()+1)
+ if ((int)cI.size()!= targetMesh.getNumberOfCells()+1)
throw INTERP_KERNEL::Exception("Error in source/target projection");
for (int itargetnode=0; itargetnode<targetMesh.getNumberOfCells();itargetnode++)
{
toArray=_map_dataarray_int.find(cle)->second->getPointer();
}
tmpMesh->getNodeIdsNearPoints(targetCoords->getConstPointer(),targetSize,1e-10,c,cI);
- if (cI.size()!=targetSize+1)
+ if ((int)cI.size()!=targetSize+1)
throw INTERP_KERNEL::Exception("Error in source/target projection");
for (int itargetnode=0; itargetnode<targetSize; itargetnode++)
{
throw INTERP_KERNEL::Exception("file does not comply with any recognized format");
}
}
- for ( int idomain = 0; idomain < _mesh.size(); ++idomain )
+ for ( int idomain = 0; idomain < (int)_mesh.size(); ++idomain )
if ( _mesh[idomain] && _mesh[idomain]->getNumberOfNodes() > 0 )
_i_non_empty_mesh = idomain;
}
{
try
{
- _driver=new MeshCollectionMedXmlDriver(this); //cvwat02
- _driver->read ( (char*)filename.c_str(), _domain_selector );
+ _driver=new MeshCollectionMedXmlDriver(this);
+ _driver->read ( filename.c_str(), _domain_selector );
_driver_type = MedXml;
}
catch(...)
{ // Handle all exceptions
- if ( _driver ) delete _driver; _driver=0;
+ delete _driver;
throw INTERP_KERNEL::Exception("file .xml does not comply with any recognized format");
}
}
try
{
_driver=new MeshCollectionMedXmlDriver(this);
- _driver->read ( (char*)nameFileXml.c_str(), _domain_selector );
+ _driver->read ( nameFileXml.c_str(), _domain_selector );
_driver_type = MedXml;
}
catch(...)
try
{
_driver=new MeshCollectionMedAsciiDriver(this);
- _driver->read ( (char*)filename.c_str(), _domain_selector );
+ _driver->read ( filename.c_str(), _domain_selector );
_driver_type=MedAscii;
}
catch(...)
}
}
// find non-empty domain mesh
- for ( int idomain = 0; idomain < _mesh.size(); ++idomain )
+ for ( int idomain = 0; idomain < (int)_mesh.size(); ++idomain )
if ( _mesh[idomain] && _mesh[idomain]->getNumberOfNodes() > 0 )
_i_non_empty_mesh = idomain;
* \param meshname name of the mesh that is to be read
*/
MEDPARTITIONER::MeshCollection::MeshCollection(const std::string& filename, const std::string& meshname)
- : _name(meshname),
- _topology(0),
+ : _topology(0),
_owns_topology(true),
_driver(0),
_domain_selector( 0 ),
_i_non_empty_mesh(-1),
+ _name(meshname),
_driver_type(MEDPARTITIONER::MedXml),
_subdomain_boundary_creates(false),
_family_splitting(false),
MEDPARTITIONER::MeshCollection::~MeshCollection()
{
- for (int i=0; i<_mesh.size();i++)
+ for (int i=0; i<(int)_mesh.size();i++)
if (_mesh[i]!=0) _mesh[i]->decrRef();
- for (int i=0; i<_cell_family_ids.size();i++)
+ for (int i=0; i<(int)_cell_family_ids.size();i++)
if (_cell_family_ids[i]!=0)
_cell_family_ids[i]->decrRef();
- for (int i=0; i<_face_mesh.size();i++)
+ for (int i=0; i<(int)_face_mesh.size();i++)
if (_face_mesh[i]!=0)
_face_mesh[i]->decrRef();
- for (int i=0; i<_face_family_ids.size();i++)
+ for (int i=0; i<(int)_face_family_ids.size();i++)
if (_face_family_ids[i]!=0)
_face_family_ids[i]->decrRef();
if (MyGlobals::_Verbose>200)
std::cout << "proc " << rank << " : TO BE READ getField : " << descriptionIold << std::endl;
std::string description, fileName, meshName, fieldName;
- int idomain, typeField, DT, IT, entity;
- idomain=iold;
+ int typeField, DT, IT, entity;
fileName=MyGlobals::_File_Names[iold];
if (MyGlobals::_Verbose>10)
std::cout << "proc " << MyGlobals::_Rank << " : in " << fileName << " " << iold << " " << descriptionIold << std::endl;
int nbfiles=MyGlobals::_File_Names.size(); //nb domains
std::vector<std::string> r2;
//from allgatherv then vector(procs) of serialised vector(fields) of vector(description) data
- for (int i=0; i<_field_descriptions.size(); i++)
+ for (int i=0; i<(int)_field_descriptions.size(); i++)
{
std::vector<std::string> r1=DeserializeToVectorOfString(_field_descriptions[i]);
- for (int i=0; i<r1.size(); i++)
- r2.push_back(r1[i]);
+ for (int ii=0; ii<(int)r1.size(); ii++)
+ r2.push_back(r1[ii]);
}
//here vector(procs*fields) of serialised vector(description) data
_field_descriptions=r2;
throw INTERP_KERNEL::Exception("incoherent number of fields references in all files .med\n");
}
_field_descriptions.resize(nbfields/nbfiles);
- for (int i=0; i<_field_descriptions.size(); i++)
+ for (int i=0; i<(int)_field_descriptions.size(); i++)
{
std::string str=_field_descriptions[i];
str=EraseTagSerialized(str,"idomain=");
int ii=inodesFace[i];
if (ii<0)
std::cout << "isFaceOncell problem inodeface<0" << std::endl;
- for (int j=0; j<inodesCell.size(); j++)
+ for (int j=0; j<(int)inodesCell.size(); j++)
{
if (ii==inodesCell[j])
{
ParaMEDMEM::DataArrayDouble* fromArray,
std::string nameArrayTo,
std::string descriptionField);
+ private:
//link to mesh_collection topology
Topology* _topology;
//Splitting tag
node=xmlNewChild(root_node,0,BAD_CAST "splitting",0);
node2=xmlNewChild(node,0,BAD_CAST "subdomain",0);
- sprintf(buff, "%d", _collection->getMesh().size());
+ sprintf(buff, "%d", (int)_collection->getMesh().size());
xmlNewProp(node2, BAD_CAST "number", BAD_CAST buff);
node2=xmlNewChild(node,0,BAD_CAST "global_numbering",0);
xmlNewProp(node2, BAD_CAST "present", BAD_CAST "yes");
* \brief Constructor. Find out my rank and world size
*/
MEDPARTITIONER::ParaDomainSelector::ParaDomainSelector(bool mesure_memory)
- :_rank(0),_world_size(1), _nb_result_domains(-1), _mesure_memory(mesure_memory),
- _init_time(0.0), _init_memory(0), _max_memory(0)
+ :_rank(0),_world_size(1), _nb_result_domains(-1), _init_time(0.0),
+ _mesure_memory(mesure_memory), _init_memory(0), _max_memory(0)
{
#ifdef HAVE_MPI2
MPI_Comm_size(MPI_COMM_WORLD,&_world_size) ;
_nb_vert_of_procs[0] = 0; // base = 0
for (int i=0; i<nb_domains; ++i)
{
- int rank = getProcessorID(i);
- _nb_vert_of_procs[rank+1] += all_nb_elems[i*2];
+ int rankk = getProcessorID(i);
+ _nb_vert_of_procs[rankk+1] += all_nb_elems[i*2];
}
- for (int i=1; i<_nb_vert_of_procs.size(); ++i)
+ for (std::size_t i=1; i<_nb_vert_of_procs.size(); ++i)
_nb_vert_of_procs[i] += _nb_vert_of_procs[i-1]; // to CSR format : cumulated
if (MyGlobals::_Is0verbose>200)
evaluateMemory();
if (_nb_vert_of_procs.empty())
throw INTERP_KERNEL::Exception("_nb_vert_of_procs not set");
- return (int*) & _nb_vert_of_procs[0];
+ return const_cast<int*>(& _nb_vert_of_procs[0]);
}
/*!
// ---------------
std::vector<int> index_size_of_proc( nbProcs() ); // index sizes - 1
- for ( int i = 1; i < _nb_vert_of_procs.size(); ++i )
+ for ( std::size_t i = 1; i < _nb_vert_of_procs.size(); ++i )
index_size_of_proc[i-1] = _nb_vert_of_procs[ i ] - _nb_vert_of_procs[ i-1 ];
int index_size = 1 + _cell_shift_by_domain.back();
int *graph_index = new int[ index_size ];
const int *index = graph->getGraph()->getIndex();
- int *proc_index_displacement = (int*) & _nb_vert_of_procs[0];
+ int *proc_index_displacement = const_cast<int*>( & _nb_vert_of_procs[0] );
MPI_Allgatherv((void*) (index+1), // send local index except first 0 (or 1)
index_size_of_proc[_rank], // index size on this proc
#endif
// check that the set nbs of cell pairs are correct,
// namely that each joint is treated on one proc only
- for ( int j = 0; j < _nb_cell_pairs_by_joint.size(); ++j )
+ for ( std::size_t j = 0; j < _nb_cell_pairs_by_joint.size(); ++j )
if ( _nb_cell_pairs_by_joint[j] != send_buf[j] && send_buf[j]>0 )
throw INTERP_KERNEL::Exception("invalid nb of cell pairs");
}
used_memory = (( si.totalram - si.freeram + si.totalswap - si.freeswap ) * si.mem_unit ) / 1024;
#endif
if ( used_memory > _max_memory )
- ((ParaDomainSelector*) this)->_max_memory = used_memory;
+ _max_memory = used_memory;
if ( !_init_memory )
- ((ParaDomainSelector*) this)->_init_memory = used_memory;
+ _init_memory = used_memory;
}
return _max_memory - _init_memory;
}
double _init_time;
bool _mesure_memory;
- int _init_memory;
- int _max_memory;
+ mutable int _init_memory;
+ mutable int _max_memory;
};
}
#endif
_nb_nodes[idomain]=meshes[idomain]->getNumberOfNodes();
INTERP_KERNEL::HashMap <int,std::pair<int,int> > local2distant;
_node_loc_to_glob[idomain].resize(_nb_nodes[idomain]);
- for (int icz=0; icz<cz.size(); icz++)
+ for (std::size_t icz=0; icz<cz.size(); icz++)
{
if (cz[icz]->getLocalDomainNumber() == idomain &&
cz[icz]->getLocalDomainNumber()>cz[icz]->getDistantDomainNumber())
bool MEDPARTITIONER::TestArg(const char *arg, const char *argExpected, std::string& argValue)
{
argValue="";
- int i;
+ std::size_t i;
for (i=0; i<strlen(arg); i++)
{
if (arg[i]=='=')
if (arg[i]!=argExpected[i])
return false;
}
- for (int j=i+1; j<strlen(arg); j++)
+ for (std::size_t j=i+1; j<strlen(arg); j++)
argValue+=arg[j];
return true;
}
{
std::vector<std::string> vec=DeserializeToVectorOfString(fromStr);
std::vector<std::string> res;
- for (int i=0; i<vec.size(); i++)
+ for (std::size_t i=0; i<vec.size(); i++)
{
if (vec[i].find(tag)==std::string::npos)
res.push_back(vec[i]);
std::istringstream iss(enTete.substr(foundSizeVector+1,posmax-foundSizeVector));
iss >> sizeVector;
std::string keymap=enTete.substr(foundKey+7,foundSizeVector-foundKey-7);
- for (int i=1; i<=sizeVector; i++)
- res[keymap].push_back(vs[i]); //add unconditionnaly,so merge duplicates in second vector
+ for (int ii=1; ii<=sizeVector; ii++)
+ res[keymap].push_back(vs[ii]); //add unconditionnaly,so merge duplicates in second vector
}
return res;
}
std::vector<std::string> res;
std::vector<std::string> meshNames=MEDLoader::GetMeshNames(myfile.c_str());
- for (int i=0; i<meshNames.size(); i++)
+ for (std::size_t i=0; i<meshNames.size(); i++)
{
std::vector<std::string> fieldNames=
MEDLoader::GetAllFieldNamesOnMesh(myfile.c_str(),meshNames[i].c_str());
- for (int j = 0; j < fieldNames.size(); j++)
+ for (std::size_t j = 0; j < fieldNames.size(); j++)
{
std::vector< ParaMEDMEM::TypeOfField > typeFields=
MEDLoader::GetTypesOfField(myfile.c_str(), meshNames[i].c_str(), fieldNames[j].c_str());
- for (int k = 0; k < typeFields.size(); k++)
+ for (std::size_t k = 0; k < typeFields.size(); k++)
{
std::vector< std::pair< int, int > > its=
MEDLoader::GetFieldIterations(typeFields[k], myfile.c_str(), meshNames[i].c_str(), fieldNames[j].c_str());
if (MyGlobals::_Is0verbose>100)
std::cout<< "fieldName " << fieldNames[j] << " typeField " << typeFields[k] << " its.size() " << its.size() << std::endl;
- for (int m = 0; m < its.size(); m++)
+ for (std::size_t m = 0; m < its.size(); m++)
{
std::vector<std::string> resi;
resi.push_back("fileName="); resi.back()+=myfile;
std::vector<std::string> res=DeserializeToVectorOfString(s0);
if (res.size()!=myVector.size())
throw INTERP_KERNEL::Exception("Problem in (de)serialise VectorOfString incoherent sizes");
- for (int i=0; i<myVector.size(); i++)
+ for (std::size_t i=0; i<myVector.size(); i++)
if (res[i]!=myVector[i])
throw INTERP_KERNEL::Exception("Problem in (de)serialise VectorOfString incoherent elements");
}
{
if (res.size()!=myVector.size())
throw INTERP_KERNEL::Exception("Problem in SendAndReceiveVectorOfString incoherent sizes");
- for (int i=1; i<myVector.size(); i++) //first is different
- if (res[i]!=myVector[i])
+ for (std::size_t ii=1; ii<myVector.size(); ii++) //first is different
+ if (res[i]!=myVector[ii])
throw INTERP_KERNEL::Exception("Problem in SendAndReceiveVectorOfString incoherent elements");
}
else
int jj=-1;
for (int j=0; j<world_size; j++)
{
- for (int i=0; i<myVector.size(); i++)
+ for (int i=0; i<(int)myVector.size(); i++)
{
jj=jj+1;
if (i==0)
MPI_Wait(&requete1, &statut);
//Traitement sequentiel dependant de "y"
//...=f(y)
- int nb=0;
+ int nbb=0;
for (int i=0; i<taille; ++i)
- if (y[i]==k) nb++;
- if (nb==taille) ok++;
+ if (y[i]==k)
+ nbb++;
+ if (nbb==taille)
+ ok++;
if (MyGlobals::_Verbose>9)
{
res="0K";
- if (nb!=taille)
+ if (nbb!=taille)
res="KO";
std::cout << res << k << " ";
}
MPI_Wait(&requete1, &statut1);
//Traitement sequentiel dependant de "y"
//...=f(y)
- int nb=0;
+ int nbb=0;
for (int i=0; i<taille; ++i)
- if (y[i]==k+befo) nb++;
- if (nb==taille) ok++;
+ if (y[i]==k+befo)
+ nbb++;
+ if (nbb==taille)
+ ok++;
if (MyGlobals::_Verbose>9)
{
- res="0K"+IntToStr(rank); if (nb!=taille) res="KO"+IntToStr(rank);
+ res="0K"+IntToStr(rank);
+ if (nbb!=taille)
+ res="KO"+IntToStr(rank);
std::cout << res << k << " ";
}
MPI_Wait(&requete0, &statut2);
MPI_Wait(&requete1, &statut1);
//Traitement sequentiel dependant de "y"
//...=f(y)
- int nb=0;
+ int nbb=0;
for (int i=0; i<size; ++i)
- if (y[i]==k+befo) nb++;
- if (nb==size) ok++;
+ if (y[i]==k+befo)
+ nbb++;
+ if (nbb==size)
+ ok++;
if (MyGlobals::_Verbose>9)
{
res="0K"+IntToStr(rank);
- if (nb!=size)
+ if (nbb!=size)
res="KO"+IntToStr(rank);
std::cout << res << k << " ";
}
if (false) //(_verbose)
{
- cout<<"\nnb coor "<<(_ni+1)*(_nj+1)*(_nk+1)*3<<" "<<coor.size()<<endl;
- for (int i=0; i<coor.size(); i++) cout<<coor[i]<<" ";
- cout<<endl;
- cout<<"\nnb conn "<<(_ni)*(_nj)*(_nk)*8<<" "<<conn.size()<<endl;
- for (int i=0; i<conn.size(); i=i+8)
+ cout<< "\nnb coor " << (_ni+1)*(_nj+1)*(_nk+1)*3 << " " << coor.size() << endl;
+ for (int i=0; i<(int)coor.size(); i++)
+ cout << coor[i] << " ";
+ cout << endl;
+ cout << "\nnb conn " << (_ni)*(_nj)*(_nk)*8 << " " << conn.size() << endl;
+ for (int i=0; i<(int)conn.size(); i=i+8)
{
- for (int j=0; j<8; j++) cout<<conn[i+j]<<" ";
- cout<<endl;
+ for (int j=0; j<8; j++)
+ cout << conn[i+j] << " ";
+ cout << endl;
}
- cout<<endl;
+ cout << endl;
}
MEDCouplingUMesh *mesh=MEDCouplingUMesh::New();
if (false) //(_verbose)
{
cout<<"\nnb coor "<<(_ni+1)*(_nj+1)*3<<" "<<coor.size()<<endl;
- for (int i=0; i<coor.size(); i++) cout<<coor[i]<<" ";
+ for (int i=0; i<(int)coor.size(); i++)
+ cout << coor[i] << " ";
cout<<endl;
cout<<"\nnb conn "<<(_ni)*(_nj)*4<<" "<<conn.size()<<endl;
- for (int i=0; i<conn.size(); i=i+4)
+ for (int i=0; i<(int)conn.size(); i=i+4)
{
for (int j=0; j<4; j++) cout<<conn[i+j]<<" ";
cout<<endl;
if (false) //(_verbose)
{
cout<<"\nnb coor "<<(_ni+1)*(_nj+1)*3<<" "<<coor.size()<<endl;
- for (int i=0; i<coor.size(); i++) cout<<coor[i]<<" ";
+ for (int i=0; i<(int)coor.size(); i++)
+ cout << coor[i] << " ";
cout<<endl;
cout<<"\nnb conn "<<(_ni)*(_nj)*4<<" "<<conn.size()<<endl;
- for (int i=0; i<conn.size(); i=i+4)
+ for (int i=0; i<(int)conn.size(); i=i+4)
{
- for (int j=0; j<4; j++) cout<<conn[i+j]<<" ";
- cout<<endl;
+ for (int j=0; j<4; j++)
+ cout << conn[i+j] << " ";
+ cout << endl;
}
- cout<<endl;
+ cout << endl;
}
MEDCouplingUMesh *mesh=MEDCouplingUMesh::New();
}
m->decrRef();
- MEDFileUMesh * mf;
- mf->New(_fileName.c_str(),_meshName.c_str(),-1,-1);
+ MEDFileUMesh * mf = MEDFileUMesh::New(_fileName.c_str(),_meshName.c_str(),-1,-1);
vector<int> lev;
lev=mf->getNonEmptyLevels();
if (_verbose)
std::vector<ParaMEDMEM::MEDCouplingUMesh*>cellMeshes=collection.getMesh();
CPPUNIT_ASSERT_EQUAL(5, (int) cellMeshes.size());
int nbcells=0;
- for (int i = 0; i < cellMeshes.size(); i++) nbcells+=cellMeshes[i]->getNumberOfCells();
+ for (std::size_t i = 0; i < cellMeshes.size(); i++)
+ nbcells+=cellMeshes[i]->getNumberOfCells();
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells);
std::vector<ParaMEDMEM::MEDCouplingUMesh*>faceMeshes=collection.getFaceMesh();
CPPUNIT_ASSERT_EQUAL(5, (int) faceMeshes.size());
int nbfaces=0;
- for (int i = 0; i < faceMeshes.size(); i++) nbfaces+=faceMeshes[i]->getNumberOfCells();
+ for (std::size_t i=0; i < faceMeshes.size(); i++)
+ nbfaces+=faceMeshes[i]->getNumberOfCells();
CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), nbfaces);
//merge split meshes and test equality
CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), fusedCell->getNumberOfCells());
meshes.resize(0);
- for (int i = 0; i < corr.size(); i++) corr[i]->decrRef();
+ for (std::size_t i = 0; i < corr.size(); i++)
+ corr[i]->decrRef();
corr.resize(0);
meshes.push_back(faceMesh);
refusedFaceMesh->tryToShareSameCoordsPermute(*faceMesh, 1e-9);
MEDCouplingUMesh* fusedFace=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr);
CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), fusedFace->getNumberOfCells());
- for (int i = 0; i < corr.size(); i++) corr[i]->decrRef();
+ for (std::size_t i = 0; i < corr.size(); i++)
+ corr[i]->decrRef();
fusedFace->decrRef();
refusedFaceMesh->decrRef();
faceMesh->decrRef();
{
cout<<"\nf1 : "<<f1->reprZip();
cout<<"\nf2 : "<<f2->reprZip(); //field2->advancedRepradvancedRepr();
- for (int i = 0; i < corr.size(); i++) cout<<"\ncorr "<<i<<" : "<<corr[i]->reprZip();
+ for (std::size_t i = 0; i < corr.size(); i++)
+ cout << "\ncorr " << i << " : " << corr[i]->reprZip();
}
int nbequal=0;
}
CPPUNIT_ASSERT_EQUAL(nbcells*nbcomp, nbequal);
- for (int i = 0; i < corr.size(); i++) corr[i]->decrRef();
+ for (std::size_t i = 0; i < corr.size(); i++)
+ corr[i]->decrRef();
field1->decrRef();
field2->decrRef();
fusedCell->decrRef();
DataArrayDouble* f2=field2->getArray();
if (_verbose)
{
- cout<<"\nf1 : "<<f1->reprZip(); //123.4 for 12th cell,3rd component, 4th gausspoint
- cout<<"\nf2 : "<<f2->reprZip(); //field2->advancedRepradvancedRepr();
- for (int i = 0; i < corr.size(); i++) cout<<"\ncorr "<<i<<" : "<<corr[i]->reprZip();
+ cout << "\nf1 : " << f1->reprZip(); //123.4 for 12th cell,3rd component, 4th gausspoint
+ cout << "\nf2 : " << f2->reprZip(); //field2->advancedRepradvancedRepr();
+ for (std::size_t i = 0; i < corr.size(); i++)
+ cout << "\ncorr " << i << " : " << corr[i]->reprZip();
}
int nbequal=0;
}
CPPUNIT_ASSERT_EQUAL(nbcells*nbcomp*nbptgauss, nbequal);
- for (int i = 0; i < corr.size(); i++) corr[i]->decrRef();
+ for (std::size_t i = 0; i < corr.size(); i++)
+ corr[i]->decrRef();
field1->decrRef();
field2->decrRef();
fusedCell->decrRef();
r2=SelectTagsInVectorOfString(r2,"meshName=");
if (r2.size()==(collection.getMesh()).size())
{
- for (int i=0; i<r2.size(); i++) r2[i]=EraseTagSerialized(r2[i],"ioldDomain=");
+ for (std::size_t i=0; i<r2.size(); i++)
+ r2[i]=EraseTagSerialized(r2[i],"ioldDomain=");
r2=DeleteDuplicatesInVectorOfString(r2);
if (r2.size()==1)
{
r2=SelectTagsInVectorOfString(r1,"fieldName=");
r2=SelectTagsInVectorOfString(r2,"nbComponents=");
//may be yes? or not?
- for (int i=0; i<r2.size(); i++) r2[i]=EraseTagSerialized(r2[i],"ioldFieldDouble=");
+ for (std::size_t i=0; i<r2.size(); i++)
+ r2[i]=EraseTagSerialized(r2[i],"ioldFieldDouble=");
r2=DeleteDuplicatesInVectorOfString(r2);
- for (int i=0; i<r2.size(); i++) finalInformations.push_back(r2[i]);
+ for (std::size_t i=0; i<r2.size(); i++)
+ finalInformations.push_back(r2[i]);
MyGlobals::_General_Informations=finalInformations;
if (MyGlobals::_Is0verbose)