diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp index d26a3c870760173169f7e3e3f2c0cb0964becaf8..f9fa8c783192da4daf4d6af52f49b13c3bbaa99a 100644 --- a/Common/Gmsh.cpp +++ b/Common/Gmsh.cpp @@ -66,6 +66,7 @@ int GmshSetBoundingBox(double xmin, double xmax, double zmin, double zmax) { SetBoundingBox(xmin, xmax, ymin, ymax, zmin, zmax); + return 1; } int GmshSetOption(std::string category, std::string name, std::string value, int index) diff --git a/Geo/partitionEdge.h b/Geo/partitionEdge.h index 4afe2054033497a3208d5e884646d64f4121dccf..87ff0a7fdd2f6a41da63a328a551e558e8ec2298 100644 --- a/Geo/partitionEdge.h +++ b/Geo/partitionEdge.h @@ -27,16 +27,16 @@ class partitionEdge : public discreteEdge { struct Less_partitionEdge : public std::binary_function<partitionEdge*, partitionEdge*, bool> { - bool operator()(const partitionEdge* e1, const partitionEdge* e2) const{ - if (e1->_partitions.size() < e2->_partitions.size())return true; - if (e1->_partitions.size() > e2->_partitions.size())return false; - for (int i=0;i<e1->_partitions.size();i++){ - if (e1->_partitions[i] < e2->_partitions[i])return true; - if (e1->_partitions[i] > e2->_partitions[i])return false; + bool operator()(const partitionEdge* e1, const partitionEdge* e2) const + { + if (e1->_partitions.size() < e2->_partitions.size()) return true; + if (e1->_partitions.size() > e2->_partitions.size()) return false; + for (unsigned int i = 0; i < e1->_partitions.size(); i++){ + if (e1->_partitions[i] < e2->_partitions[i]) return true; + if (e1->_partitions[i] > e2->_partitions[i]) return false; } return false; } }; - #endif diff --git a/Geo/partitionFace.h b/Geo/partitionFace.h index 53e860fec0f4ae8a13b38c8d1f91ad9a3ddbca41..12bf04c747aad91011ac3c5e9740dbbe809818fe 100644 --- a/Geo/partitionFace.h +++ b/Geo/partitionFace.h @@ -25,16 +25,16 @@ class partitionFace : public discreteFace { struct Less_partitionFace : public std::binary_function<partitionFace*, partitionFace*, bool> { - bool operator()(const partitionFace* e1, const partitionFace* e2) const{ - if (e1->_partitions.size() < e2->_partitions.size())return true; - if (e1->_partitions.size() > e2->_partitions.size())return false; - for (int i=0;i<e1->_partitions.size();i++){ - if (e1->_partitions[i] < e2->_partitions[i])return true; - if (e1->_partitions[i] > e2->_partitions[i])return false; + bool operator()(const partitionFace* e1, const partitionFace* e2) const + { + if (e1->_partitions.size() < e2->_partitions.size()) return true; + if (e1->_partitions.size() > e2->_partitions.size()) return false; + for (unsigned int i = 0; i < e1->_partitions.size(); i++){ + if (e1->_partitions[i] < e2->_partitions[i]) return true; + if (e1->_partitions[i] > e2->_partitions[i]) return false; } return false; } }; - #endif diff --git a/Geo/partitionVertex.h b/Geo/partitionVertex.h index 9427088b6b4189e02a8e54502a102aec37a5e08e..a4c8eb9c3fdb76e9d51e5ed3317decff3a9b9cac 100644 --- a/Geo/partitionVertex.h +++ b/Geo/partitionVertex.h @@ -25,16 +25,16 @@ class partitionVertex : public discreteVertex { struct Less_partitionVertex : public std::binary_function<partitionVertex*, partitionVertex*, bool> { - bool operator()(const partitionVertex* e1, const partitionVertex* e2) const{ - if (e1->_partitions.size() < e2->_partitions.size())return true; - if (e1->_partitions.size() > e2->_partitions.size())return false; - for (int i=0;i<e1->_partitions.size();i++){ - if (e1->_partitions[i] < e2->_partitions[i])return true; - if (e1->_partitions[i] > e2->_partitions[i])return false; + bool operator()(const partitionVertex* e1, const partitionVertex* e2) const + { + if (e1->_partitions.size() < e2->_partitions.size()) return true; + if (e1->_partitions.size() > e2->_partitions.size()) return false; + for (unsigned int i = 0; i < e1->_partitions.size(); i++){ + if (e1->_partitions[i] < e2->_partitions[i]) return true; + if (e1->_partitions[i] > e2->_partitions[i]) return false; } return false; } }; - #endif diff --git a/Mesh/meshPartition.cpp b/Mesh/meshPartition.cpp index e396ef6eec42ba73487ce0a12ba7684f5d8898aa..8856b1e5a791924119bb69349e045ee675cb2747 100644 --- a/Mesh/meshPartition.cpp +++ b/Mesh/meshPartition.cpp @@ -660,8 +660,9 @@ struct MatchBoElemToGrVertex template <class ITERATOR> -void fillit_ ( std::multimap<MFace,MElement*,Less_Face> &faceToElement, - ITERATOR it_beg, ITERATOR it_end){ +void fillit_(std::multimap<MFace,MElement*,Less_Face> &faceToElement, + ITERATOR it_beg, ITERATOR it_end) +{ for (ITERATOR IT = it_beg; IT != it_end ; ++IT){ MElement *el = *IT; for(int j=0;j < el->getNumFaces();j++) { @@ -672,8 +673,9 @@ void fillit_ ( std::multimap<MFace,MElement*,Less_Face> &faceToElement, } template <class ITERATOR> -void fillit_ ( std::multimap<MEdge,MElement*,Less_Edge> &edgeToElement, - ITERATOR it_beg, ITERATOR it_end){ +void fillit_(std::multimap<MEdge,MElement*,Less_Edge> &edgeToElement, + ITERATOR it_beg, ITERATOR it_end) +{ for (ITERATOR IT = it_beg; IT != it_end ; ++IT){ MElement *el = *IT; for(int j=0;j < el->getNumEdges();j++) { @@ -684,8 +686,9 @@ void fillit_ ( std::multimap<MEdge,MElement*,Less_Edge> &edgeToElement, } template <class ITERATOR> -void fillit_ ( std::multimap<MVertex*,MElement*> &vertexToElement, - ITERATOR it_beg, ITERATOR it_end){ +void fillit_(std::multimap<MVertex*,MElement*> &vertexToElement, + ITERATOR it_beg, ITERATOR it_end) +{ for (ITERATOR IT = it_beg; IT != it_end ; ++IT){ MElement *el = *IT; for(int j=0;j < el->getNumVertices();j++) { @@ -695,17 +698,16 @@ void fillit_ ( std::multimap<MVertex*,MElement*> &vertexToElement, }// for every elem of the face } - -void assignPartitionBoundary (GModel *model, - MFace &me, - std::set<partitionFace*, Less_partitionFace> &pfaces, - std::vector<MElement*> &v){ - +void assignPartitionBoundary(GModel *model, + MFace &me, + std::set<partitionFace*, Less_partitionFace> &pfaces, + std::vector<MElement*> &v) +{ std::vector<int> v2; v2.push_back(v[0]->getPartition()); - for (int i=1;i<v.size();i++){ + for (unsigned int i = 1; i < v.size(); i++){ bool found = false; - for (int j=0;j<v2.size();j++){ + for (unsigned int j = 0; j < v2.size(); j++){ if (v[i]->getPartition() == v2[j]){ found = true; break; @@ -715,15 +717,15 @@ void assignPartitionBoundary (GModel *model, } if (v2.size() < 2)return; - partitionFace pe (model, 1, v2); + partitionFace pe(model, 1, v2); std::set<partitionFace*, Less_partitionFace>::iterator it = pfaces.find(&pe); partitionFace *ppe; if (it == pfaces.end()){ - ppe = new partitionFace(model, -pfaces.size()-1, v2); + ppe = new partitionFace(model, -(int)pfaces.size()-1, v2); pfaces.insert (ppe); model->add(ppe); - printf("created partitionFace %d (",ppe->tag()); - for (int i=0;i<v2.size();++i)printf("%d ",v2[i]); + printf("created partitionFace %d (", ppe->tag()); + for (unsigned int i = 0; i < v2.size(); ++i) printf("%d ", v2[i]); printf(")\n"); } else ppe = *it; @@ -732,18 +734,17 @@ void assignPartitionBoundary (GModel *model, me.getVertex(2))); } - -void assignPartitionBoundary (GModel *model, - MEdge &me, - std::set<partitionEdge*, Less_partitionEdge> &pedges, - std::vector<MElement*> &v, - std::set<partitionFace*, Less_partitionFace> &pfaces){ - +void assignPartitionBoundary(GModel *model, + MEdge &me, + std::set<partitionEdge*, Less_partitionEdge> &pedges, + std::vector<MElement*> &v, + std::set<partitionFace*, Less_partitionFace> &pfaces) +{ std::vector<int> v2; v2.push_back(v[0]->getPartition()); - for (int i=1;i<v.size();i++){ + for (unsigned int i = 1; i < v.size(); i++){ bool found = false; - for (int j=0;j<v2.size();j++){ + for (unsigned int j = 0; j < v2.size(); j++){ if (v[i]->getPartition() == v2[j]){ found = true; break; @@ -753,8 +754,7 @@ void assignPartitionBoundary (GModel *model, } if (v2.size() < 2)return; - - partitionFace pf (model, 1,v2); + partitionFace pf(model, 1, v2); std::set<partitionFace*, Less_partitionFace>::iterator itf = pfaces.find(&pf); if (itf != pfaces.end())return; @@ -762,29 +762,29 @@ void assignPartitionBoundary (GModel *model, std::set<partitionEdge*, Less_partitionEdge>::iterator it = pedges.find(&pe); partitionEdge *ppe; if (it == pedges.end()){ - ppe = new partitionEdge(model, -pedges.size()-1, 0, 0, v2); + ppe = new partitionEdge(model, -(int)pedges.size()-1, 0, 0, v2); pedges.insert (ppe); model->add(ppe); - printf("created partitionEdge %d (",ppe->tag()); - for (int i=0;i<v2.size();++i)printf("%d ",v2[i]); + printf("created partitionEdge %d (", ppe->tag()); + for (unsigned int i = 0; i < v2.size(); ++i) printf("%d ", v2[i]); printf(")\n"); } else ppe = *it; ppe->lines.push_back(new MLine (me.getVertex(0),me.getVertex(1))); } -void assignPartitionBoundary (GModel *model, - MVertex *ve, - std::set<partitionVertex*, Less_partitionVertex> &pvertices, - std::vector<MElement*> &v, - std::set<partitionEdge*, Less_partitionEdge> &pedges, - std::set<partitionFace*, Less_partitionFace> &pfaces){ - +void assignPartitionBoundary(GModel *model, + MVertex *ve, + std::set<partitionVertex*, Less_partitionVertex> &pvertices, + std::vector<MElement*> &v, + std::set<partitionEdge*, Less_partitionEdge> &pedges, + std::set<partitionFace*, Less_partitionFace> &pfaces) +{ std::vector<int> v2; v2.push_back(v[0]->getPartition()); - for (int i=1;i<v.size();i++){ + for (unsigned int i = 1; i < v.size(); i++){ bool found = false; - for (int j=0;j<v2.size();j++){ + for (unsigned int j = 0; j < v2.size(); j++){ if (v[i]->getPartition() == v2[j]){ found = true; break; @@ -794,32 +794,31 @@ void assignPartitionBoundary (GModel *model, } if (v2.size() < 2)return; - partitionFace pf (model, 1,v2); + partitionFace pf(model, 1, v2); std::set<partitionFace*, Less_partitionFace>::iterator itf = pfaces.find(&pf); - if (itf != pfaces.end())return; + if (itf != pfaces.end()) return; - partitionEdge pe (model, 1,0,0,v2); + partitionEdge pe(model, 1, 0, 0, v2); std::set<partitionEdge*, Less_partitionEdge>::iterator ite = pedges.find(&pe); - if (ite != pedges.end())return; + if (ite != pedges.end()) return; - partitionVertex pv (model, 1,v2); + partitionVertex pv(model, 1, v2); std::set<partitionVertex*, Less_partitionVertex>::iterator it = pvertices.find(&pv); partitionVertex *ppv; if (it == pvertices.end()){ - ppv = new partitionVertex(model, -pvertices.size()-1,v2); + ppv = new partitionVertex(model, -(int)pvertices.size()-1,v2); pvertices.insert (ppv); model->add(ppv); - printf("created partitionVertex %d (",ppv->tag()); - for (int i=0;i<v2.size();++i)printf("%d ",v2[i]); + printf("created partitionVertex %d (", ppv->tag()); + for (unsigned int i = 0; i < v2.size(); ++i) printf("%d ", v2[i]); printf(")\n"); } else ppv = *it; ppv->points.push_back(new MPoint (ve)); } - -int CreatePartitionBoundaries (GModel *model) { - +int CreatePartitionBoundaries(GModel *model) +{ unsigned numElem[5]; const int meshDim = model->getNumMeshElements(numElem); std::set<partitionEdge*, Less_partitionEdge> pedges; @@ -928,10 +927,10 @@ int CreatePartitionBoundaries (GModel *model) { } } } + + return 1; } - - /******************************************************************************* * * Explicit instantiations of routine MakeGraphDIM