Skip to content
Snippets Groups Projects
Commit 82f05f1e authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix msvc compile

parent d6c1b215
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ CellComplex::CellComplex( std::vector<GEntity*> domain,
_multidim = false;
int dim = 0;
for(int i = 0; i < domain.size(); i++){
for(unsigned int i = 0; i < domain.size(); i++){
GEntity* entity = domain.at(i);
if(i == 0) dim = entity->dim();
if(dim != entity->dim()){
......@@ -258,7 +258,7 @@ CellComplex::~CellComplex()
_ocells[i].clear();
}
for(int i = 0; i < _newcells.size(); i++) delete _newcells.at(i);
for(unsigned int i = 0; i < _newcells.size(); i++) delete _newcells.at(i);
_newcells.clear();
}
......
......@@ -491,7 +491,7 @@ bool Chain::deform(std::map<Cell*, int, Less_Cell>& cellsInChain,
if(cc.empty() || (getDim() == 2 && cc.size() < 2) ) return false;
int inout = cc[0]*bc[0];
for(int i = 0; i < cc.size(); i++){
for(unsigned int i = 0; i < cc.size(); i++){
if(cc[i]*bc[i] != inout) return false;
}
......
......@@ -91,7 +91,7 @@ Homology::Homology(GModel* model, std::vector<int> physicalDomain,
Homology::~Homology(){
delete _cellComplex;
for(int i = 0; i < 4; i++) {
for(int j = 0; j < _generators[i].size(); j++){
for(unsigned int j = 0; j < _generators[i].size(); j++){
Chain* chain = _generators[i].at(j);
//_model->deletePhysicalGroup(chain->getDim(), chain->getNum());
delete chain;
......@@ -368,7 +368,7 @@ std::string Homology::getDomainString()
void Homology::createPViews()
{
for(int i = 0; i < 4; i++){
for(int j = 0; j < _generators[i].size(); j++){
for(unsigned int j = 0; j < _generators[i].size(); j++){
Chain* chain = _generators[i].at(j);
chain->createPView();
}
......
......@@ -38,11 +38,10 @@ double MTriangle::getInnerRadius()
{
#if defined(HAVE_MESH)
double r = 0.;
int n = getNumEdges();
const int n = getNumEdges();
double dist[n];
double k = 0.;
for (int i=0; i<n; i++)
{
for (int i = 0; i < n; i++){
MEdge e = getEdge(i);
dist[i] = e.getVertex(0)->distance(e.getVertex(1));
k += 0.5 * dist[i];
......
......@@ -221,21 +221,21 @@ int RenumberMeshElements( std::vector<MElement*> &elements, meshPartitionOptions
int RenumberMesh(GModel *const model, meshPartitionOptions &options)
{
for (GModel::fiter it = model->firstFace() ; it != model->lastFace() ; ++it){
std::vector<MElement *> temp;
temp.insert(temp.begin(), (*it)->triangles.begin(), (*it)->triangles.end());
RenumberMeshElements(temp, options);
(*it)->triangles.clear();
for (int i=0;i<temp.size();i++) (*it)->triangles.push_back((MTriangle*)temp[i]);
for(unsigned int i = 0; i <temp.size(); i++)
(*it)->triangles.push_back((MTriangle*)temp[i]);
temp.clear();
temp.insert(temp.begin(),(*it)->quadrangles.begin(),(*it)->quadrangles.end());
RenumberMeshElements (temp,options);
(*it)->quadrangles.clear();
for (int i=0;i<temp.size();i++) (*it)->quadrangles.push_back((MQuadrangle*)temp[i]);
for(unsigned int i = 0; i < temp.size(); i++)
(*it)->quadrangles.push_back((MQuadrangle*)temp[i]);
}
for (GModel::riter it = model->firstRegion() ; it != model->lastRegion() ; ++it){
std::vector<MElement *> temp;
......@@ -243,23 +243,21 @@ int RenumberMesh(GModel *const model, meshPartitionOptions &options)
temp.insert(temp.begin(), (*it)->tetrahedra.begin(), (*it)->tetrahedra.end());
RenumberMeshElements(temp, options);
(*it)->tetrahedra.clear();
for (int i=0;i<temp.size();i++) (*it)->tetrahedra.push_back((MTetrahedron*)temp[i]);
for (int i = 0; i < temp.size(); i++)
(*it)->tetrahedra.push_back((MTetrahedron*)temp[i]);
temp.clear();
temp.insert(temp.begin(),(*it)->hexahedra.begin(),(*it)->hexahedra.end());
RenumberMeshElements (temp,options);
(*it)->hexahedra.clear();
for (int i=0;i<temp.size();i++) (*it)->hexahedra.push_back((MHexahedron*)temp[i]);
for (unsigned int i = 0; i < temp.size(); i++)
(*it)->hexahedra.push_back((MHexahedron*)temp[i]);
}
return 1;
}
int PartitionMesh(GModel *const model, meshPartitionOptions &options)
{
Graph graph;
BoElemGrVec boElemGrVec;
int ier;
......
......@@ -71,7 +71,7 @@ static void connectedRegions (std::vector<MElement*> &elements,
std::vector<std::vector<MElement*> > &regions)
{
std::multimap<MEdge,MElement*,Less_Edge> e2e;
for (int i=0;i<elements.size();++i){
for (unsigned int i = 0; i < elements.size(); ++i){
for (int j = 0; j < elements[i]->getNumEdges(); j++){
e2e.insert(std::make_pair(elements[i]->getEdge(j),elements[i]));
}
......@@ -238,7 +238,7 @@ static void partitionRegions(std::vector<MElement*> &elements,
std::vector<std::vector<MElement*> > conRegions;
conRegions.clear();
connectedRegions (regions[k], conRegions);
for (int j=0; j< conRegions.size() ; j++)
for (unsigned int j = 0; j < conRegions.size(); j++)
allRegions.push_back(conRegions[j]);
}
regions.clear();
......@@ -254,7 +254,7 @@ static void printLevel(std::vector<MElement *> &elements, int recur, int region)
double version = 2.0;
std::set<MVertex*> vs;
for (int i=0;i<elements.size();i++){
for (unsigned int i = 0; i < elements.size(); i++){
for (int j = 0; j < elements[i]->getNumVertices(); j++){
vs.insert(elements[i]->getVertex(j));
}
......@@ -277,7 +277,7 @@ static void printLevel(std::vector<MElement *> &elements, int recur, int region)
fprintf(fp,"$EndNodes\n",elements.size());
fprintf(fp,"$Elements\n%d\n", (int)elements.size());
for (int i=0;i<elements.size();i++){
for (unsigned int i = 0; i < elements.size(); i++){
elements[i]->writeMSH(fp, version);
}
fprintf(fp,"$EndElements\n%d\n", (int)elements.size());
......@@ -285,7 +285,8 @@ static void printLevel(std::vector<MElement *> &elements, int recur, int region)
fclose(fp);
}
multiscalePartition::multiscalePartition(std::vector<MElement *> &elements, int nbParts, typeOfPartition method)
multiscalePartition::multiscalePartition(std::vector<MElement *> &elements,
int nbParts, typeOfPartition method)
{
options = CTX::instance()->partitionOptions;
options.num_partitions = nbParts;
......@@ -315,7 +316,8 @@ void multiscalePartition::setNumberOfPartitions(int &nbParts)
}
}
void multiscalePartition::partition(partitionLevel & level, int nbParts, typeOfPartition method)
void multiscalePartition::partition(partitionLevel & level, int nbParts,
typeOfPartition method)
{
#if defined(HAVE_METIS) || defined(HAVE_CHACO)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment