From 918274d0a15f8b81f56330129325a2662353ebd7 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Thu, 18 Aug 2016 12:02:07 +0000 Subject: [PATCH] decrease verbosity of mesh read + fix compile --- Geo/GModel.cpp | 18 +++---- Geo/GModelIO_MSH.cpp | 8 ++-- Geo/GModelIO_MSH2.cpp | 6 +-- Geo/discreteDiskFace.cpp | 81 +++++++++++++++++--------------- Geo/discreteDiskFace.h | 16 +++---- Geo/discreteFace.cpp | 96 +++++++++++++++++++++----------------- Post/PViewDataGModelIO.cpp | 4 +- Post/PViewIO.cpp | 6 +-- 8 files changed, 127 insertions(+), 108 deletions(-) diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index 7756276eff..bbee5dfdc4 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -1977,7 +1977,7 @@ static int connectedSurfaceBoundaries(std::set<MEdge, Less_Edge> &edges, void GModel::alignPeriodicBoundaries() { - Msg::Info("Aligning periodic boundaries"); + Msg::Debug("Aligning periodic boundaries"); // realigning edges @@ -2092,10 +2092,10 @@ void GModel::alignPeriodicBoundaries() for (int iVtx=0;iVtx<nbVtcs;iVtx++) { MVertex* vtx = tgtElmt->getVertex(iVtx); GEntity* ge = vtx->onWhat(); - + std::map<MVertex*,MVertex*>& geV2v = ge->correspondingVertices; std::map<MVertex*,MVertex*>& v2v = tgt->correspondingVertices; - + std::map<MVertex*,MVertex*>::iterator vIter = v2v.find(vtx); if (vIter==v2v.end()) { Msg::Info("Could not find copy of vertex %d in face %d" @@ -2152,7 +2152,7 @@ void GModel::alignPeriodicBoundaries() } } } - Msg::Info("Done aligning periodic boundaries"); + Msg::Debug("Done aligning periodic boundaries"); } void GModel::makeDiscreteRegionsSimplyConnected() @@ -2756,7 +2756,7 @@ void GModel::createTopologyFromFaces(std::vector<discreteFace*> &discFaces, int void makeSimplyConnected(std::map<int, std::vector<MElement*> > elements[11]) { //only for tetras and triangles - Msg::Info("Make simply connected regions and surfaces."); + Msg::Info("Make simply connected regions and surfaces"); std::vector<int> regs; for(std::map<int, std::vector<MElement*> >::iterator it = elements[4].begin(); it != elements[4].end(); it++) @@ -2778,7 +2778,7 @@ void makeSimplyConnected(std::map<int, std::vector<MElement*> > elements[11]) allElements.push_back(elements[4][ri][j]); std::vector<std::vector<MElement*> > conRegions; int nbConRegions = connectedVolumes(allElements, conRegions); - Msg::Info("%d connected regions (reg=%d)\n", nbConRegions, ri); + Msg::Info("%d connected regions (reg=%d)", nbConRegions, ri); unsigned int maxNumEl = 1; for(int j = 0; j < nbConRegions; j++) if(conRegions[j].size() > maxNumEl) @@ -2857,7 +2857,7 @@ void makeSimplyConnected(std::map<int, std::vector<MElement*> > elements[11]) allElements.push_back(elements[2][fi][j]); std::vector<std::vector<MElement*> > conSurfaces; int nbConSurfaces = connectedSurfaces(allElements, conSurfaces); - Msg::Info("%d connected surfaces (reg=%d)\n", nbConSurfaces, fi); + Msg::Info("%d connected surfaces (reg=%d)", nbConSurfaces, fi); unsigned int maxNumEl = 1; for(int j = 0; j < nbConSurfaces; j++) if(conSurfaces[j].size() > maxNumEl) @@ -3950,14 +3950,14 @@ void GModel::computeHomology() } else if(type == "Homology" && !homology->isHomologyComputed(dim)) { homology->findHomologyBasis(dim); - Msg::Info("Homology space basis chains to save: %s.", dims.c_str()); + Msg::Info("Homology space basis chains to save: %s", dims.c_str()); for(unsigned int i = 0; i < dim.size(); i++) { homology->addChainsToModel(dim.at(i)); } } else if(type == "Cohomology" && !homology->isCohomologyComputed(dim)) { homology->findCohomologyBasis(dim); - Msg::Info("Cohomology space basis cochains to save: %s.", dims.c_str()); + Msg::Info("Cohomology space basis cochains to save: %s", dims.c_str()); for(unsigned int i = 0; i < dim.size(); i++) { homology->addCochainsToModel(dim.at(i)); } diff --git a/Geo/GModelIO_MSH.cpp b/Geo/GModelIO_MSH.cpp index d8f64733e2..04fe00a7ac 100644 --- a/Geo/GModelIO_MSH.cpp +++ b/Geo/GModelIO_MSH.cpp @@ -126,7 +126,7 @@ void readMSHPeriodicNodes(FILE *fp, GModel *gm) // we need to continue parsing, otherwise we end up reading on the wrong position bool completePer = s && m; - + char token[6]; fpos_t pos; fgetpos(fp, &pos); @@ -206,12 +206,12 @@ int GModel::readMSH(const std::string &name) } if(format){ binary = true; - Msg::Info("Mesh is in binary format"); + Msg::Debug("Mesh is in binary format"); int one; if(fread(&one, sizeof(int), 1, fp) != 1){ fclose(fp); return 0; } if(one != 1){ swap = true; - Msg::Info("Swapping bytes from binary file"); + Msg::Debug("Swapping bytes from binary file"); } } } @@ -350,7 +350,7 @@ int GModel::readMSH(const std::string &name) if((int)_vertexMapCache.size() == numVertices && ((minVertex == 1 && maxVertex == numVertices) || (minVertex == 0 && maxVertex == numVertices - 1))){ - Msg::Info("Vertex numbering is dense"); + Msg::Debug("Vertex numbering is dense"); _vertexVectorCache.resize(_vertexMapCache.size() + 1); if(minVertex == 1) _vertexVectorCache[0] = 0; diff --git a/Geo/GModelIO_MSH2.cpp b/Geo/GModelIO_MSH2.cpp index 63b7332ac1..123c6d8d5f 100644 --- a/Geo/GModelIO_MSH2.cpp +++ b/Geo/GModelIO_MSH2.cpp @@ -218,12 +218,12 @@ int GModel::_readMSH2(const std::string &name) } if(format){ binary = true; - Msg::Info("Mesh is in binary format"); + Msg::Debug("Mesh is in binary format"); int one; if(fread(&one, sizeof(int), 1, fp) != 1){ fclose(fp); return 0; } if(one != 1){ swap = true; - Msg::Info("Swapping bytes from binary file"); + Msg::Debug("Swapping bytes from binary file"); } } @@ -341,7 +341,7 @@ int GModel::_readMSH2(const std::string &name) if((int)vertexMap.size() == numVertices && ((minVertex == 1 && maxVertex == numVertices) || (minVertex == 0 && maxVertex == numVertices - 1))){ - Msg::Info("Vertex numbering is dense"); + Msg::Debug("Vertex numbering is dense"); vertexVector.resize(vertexMap.size() + 1); if(minVertex == 1) vertexVector[0] = 0; diff --git a/Geo/discreteDiskFace.cpp b/Geo/discreteDiskFace.cpp index 0d5512e30c..86c7cfdbb5 100644 --- a/Geo/discreteDiskFace.cpp +++ b/Geo/discreteDiskFace.cpp @@ -25,9 +25,14 @@ #include "convexLaplaceTerm.h" #include "convexCombinationTerm.h" // #FIXME +#if defined(HAVE_MESH) #include "qualityMeasuresJacobian.h" // #temporary? +#endif + +#if defined(HAVE_OPTHOM) #include "OptHomRun.h" #include "MeshQualityOptimizer.h" +#endif static inline void functionShapes(int p, double Xi[2], double* phi) { @@ -205,7 +210,7 @@ static bool orderVertices(const double &tot_length, const std::vector<MVertex*> (next->z() - first->z()) * (next->z() - first->z()) ); coord.push_back(coord[coord.size()-1] + length / tot_length); - + first = next; } @@ -253,7 +258,7 @@ discreteDiskFace::discreteDiskFace(GFace *gf, triangulation* diskTriangulation, } else vs.push_back(v); } - else vs.push_back(v); + else vs.push_back(v); } if (_order == 2) {// then, interior nodes :-) for (unsigned int ie=0; ie<3; ie++){ // firstly, edge interior nodes :-) @@ -266,14 +271,14 @@ discreteDiskFace::discreteDiskFace(GFace *gf, triangulation* diskTriangulation, discrete_vertices.push_back(mv); ed2nodes[me]=mv; } - else vs.push_back(it->second); + else vs.push_back(it->second); } }// end order == 2 if (_order==1) discrete_triangles[i] = new MTriangle (vs); else if (_order==2) discrete_triangles[i] = new MTriangle6 (vs); - + }// end loop over triangles geoTriangulation = new triangulation(tag(),discrete_triangles,gf); geoTriangulation->fillingHoles = diskTriangulation->fillingHoles; @@ -283,13 +288,13 @@ discreteDiskFace::discreteDiskFace(GFace *gf, triangulation* diskTriangulation, orderVertices(_totLength, _U0, _coords); parametrize(false); buildOct(CAD); - - + + if (!checkOrientationUV()){ Msg::Info("discreteDiskFace:: parametrization is not one-to-one; fixing " "the discrete system."); parametrize(true); - buildOct(CAD); + buildOct(CAD); } putOnView(true,false); printParamMesh(); @@ -365,7 +370,7 @@ bool discreteDiskFace::parametrize(bool one2one) const } } - + for(size_t i = 0; i < discrete_triangles.size(); ++i){ MElement *t = discrete_triangles[i]; for(int j=0; j<t->getNumVertices(); j++){ @@ -480,6 +485,7 @@ bool discreteDiskFace::checkOrientationUV() return true; } else{ +#if defined(HAVE_MESH) double min, max; std::vector<MVertex*> localVertices; localVertices.resize(_N); @@ -496,12 +502,14 @@ bool discreteDiskFace::checkOrientationUV() break; } } +#endif return true; } } - -void discreteDiskFace::optimize(){ +void discreteDiskFace::optimize() +{ +#if defined(HAVE_OPTHOM) // parameters for mesh optimization // -- high order @@ -522,14 +530,14 @@ void discreteDiskFace::optimize(){ std::vector<MElement*> paramTriangles; for(std::map<MVertex*,SPoint3>::iterator it=coordinates.begin(); it!= coordinates.end(); ++it) sp2mv[it->second] = new MVertex(it->second.x(),it->second.y(),0.); - // -- generation of parametric triangles + // -- generation of parametric triangles paramTriangles.resize(discrete_triangles.size() - geoTriangulation->fillingHoles.size()); for(unsigned int i=0; i<discrete_triangles.size() -geoTriangulation->fillingHoles.size(); i++){ discreteDiskFaceTriangle* ct = &_ddft[i]; std::vector<MVertex*> mv; mv.resize(ct->tri->getNumVertices()); for (int j=0; j<ct->tri->getNumVertices(); j++) - mv[j] = sp2mv[ct->p[j]]; + mv[j] = sp2mv[ct->p[j]]; if(_order==1) paramTriangles[i] = new MTriangle(mv); else @@ -556,7 +564,6 @@ void discreteDiskFace::optimize(){ } de.createGeometry(); - // optimization if(_order >1) HighOrderMeshOptimizer(paramDisk, optParams); @@ -578,7 +585,7 @@ void discreteDiskFace::optimize(){ // cleaning delete paramDisk; - +#endif } // (u;v) |-> < (x;y;z); GFace; (u;v) > @@ -734,13 +741,13 @@ void discreteDiskFace::putOnView(bool Xu, bool Ux) { char mybuffer [64]; - + FILE *view_u=NULL, *view_v=NULL, *UVx=NULL, *UVy=NULL, *UVz=NULL; - + if(Xu){ - + sprintf(mybuffer, "param_u_part%d_order%d.pos", initialTriangulation->idNum,_order); view_u = Fopen(mybuffer,"w"); @@ -753,7 +760,7 @@ void discreteDiskFace::putOnView(bool Xu, bool Ux) sprintf(mybuffer, "UVx_part%d_order%d.pos", initialTriangulation->idNum,_order); - + UVx = Fopen(mybuffer,"w"); sprintf(mybuffer, "UVy_part%d_order%d.pos", @@ -764,7 +771,7 @@ void discreteDiskFace::putOnView(bool Xu, bool Ux) initialTriangulation->idNum,_order); UVz = Fopen(mybuffer,"w"); } - + if((Xu && view_u && view_v) || (Ux && UVx && UVy && UVz)){ if(Xu){ fprintf(view_u,"View \"u(X)\"{\n"); @@ -1016,7 +1023,7 @@ static void update(std::map<MVertex*,double> &Close, MVertex *v2, double d){ if (it == Close.end())Close[v2] = d; else if (it->second > d) it->second=d; // printf("DISTANCE COMPUTED %lf\n",d); - + } static MEdge getEdge (MElement *t, MVertex *v){ @@ -1027,7 +1034,7 @@ static MEdge getEdge (MElement *t, MVertex *v){ /* warning static double computeDistanceLinePoint (MVertex *v1, MVertex *v2, MVertex *v){ - SVector3 U = v2->point() - v1->point(); + SVector3 U = v2->point() - v1->point(); SVector3 BA = v2->point() - v->point(); SVector3 xx = crossprod(U,BA); @@ -1043,25 +1050,25 @@ static double computeDistance (MVertex *v1, double d1, MVertex *v2, double d2, M // // x // - + // x^2 + y^2 = d_1^2 // (x-a)^2 + y^2 = d_2^2 - // 2ax - a^2 = d_1^2 - d_2^2 + // 2ax - a^2 = d_1^2 - d_2^2 // printf("%p %p %p\n",v1,v2,v); - + return std::min(d2+v2->distance(v),d1+v1->distance(v)); - - - + + + double a = v2->distance(v1); // center (seed) to compute the distance (put it down) double x0 = 0.5*(d1*d1-d2*d2+a*a)/a; double y0 = -sqrt ( d1*d1 - x0*x0); // printf("a %g x0 %g %g d %g %g\n",a,x0,y0,d1,d2); - + // compute coordinates of v in the same system d1 = v1->distance(v); d2 = v2->distance(v); @@ -1096,16 +1103,16 @@ double triangulation::geodesicDistance () { // printf("computing geodesic distance with %d triangles and %d vertices\n", // tri.size(),v2t.size()); - + std::map<MVertex*,double> Fixed; std::map<MVertex*,double> Close; - + unsigned int N = bord.rbegin()->second.size() ; for (unsigned int i = 0; i< N ; i++) Fixed[bord.rbegin()->second[i]]=0.0; // printf("starting with %d vertices on the boundary\n",Fixed.size()); - + for (size_t i=0;i<tri.size();++i){ MVertex *v0 = tri[i]->getVertex(0); MVertex *v1 = tri[i]->getVertex(1); @@ -1129,8 +1136,8 @@ double triangulation::geodesicDistance () { //double d = computeDistanceLinePoint (v2,v1,v0); double d = computeDistance (v2,0.0,v1,0.0,v0); update(Close,v0,d); - } - } + } + } // printf("starting with %d vertices on the closed set\n",Close.size()); double CLOSEST = 0.0; @@ -1158,7 +1165,7 @@ double triangulation::geodesicDistance () { double d = computeDistance (it->first,it->second,it1->first,it1->second,ed.getVertex(0)); // printf("neigh %d fixed 1 --> d = %g\n",i,d); update(Close, ed.getVertex(0), d); - } + } } // printf("%d %d\n",Fixed.size(),v2t.size()); if (Fixed.size() == v2t.size())break; @@ -1177,14 +1184,14 @@ double triangulation::geodesicDistance () { tri[i]->getVertex(0)->x(),tri[i]->getVertex(0)->y(),tri[i]->getVertex(0)->z(), tri[i]->getVertex(1)->x(),tri[i]->getVertex(1)->y(),tri[i]->getVertex(1)->z(), tri[i]->getVertex(2)->x(),tri[i]->getVertex(2)->y(),tri[i]->getVertex(2)->z(),d0,d1,d2); - + } fprintf(f,"};\n"); fclose(f); */ - + return CLOSEST; - + } diff --git a/Geo/discreteDiskFace.h b/Geo/discreteDiskFace.h index 43f7621cb4..4f24edfb88 100644 --- a/Geo/discreteDiskFace.h +++ b/Geo/discreteDiskFace.h @@ -8,7 +8,7 @@ #include "GmshConfig.h" -#if defined(HAVE_SOLVER) && defined(HAVE_ANN) +#if defined(HAVE_SOLVER) && defined(HAVE_ANN) && defined(HAVE_OPTHOM) #include <list> #include <map> @@ -70,7 +70,7 @@ class triangulation { std::map<MEdge,std::vector<int>,Less_Edge> ed2tri; std::map<double,std::vector<MVertex*> > bord; //border(s) std::set<MEdge,Less_Edge> borderEdg; // border edges - + std::list<GEdge*> my_GEdges; std::set<int> fillingHoles; @@ -78,7 +78,7 @@ class triangulation { double geodesicDistance (); double aspectRatio() - { + { double L = bord.rbegin()->first; if (L == 0.0)return 1.e22; // printf("%12.5E %12.5E\n",L,maxD); @@ -198,7 +198,7 @@ class triangulation { fprintf(f,"};\n"); fclose(f); } - + triangulation() : gf(0) {} triangulation(int id, std::vector<MElement*> input, GFace* gface) : idNum(id), tri(input), gf(gface) { assign(); } @@ -242,13 +242,13 @@ class discreteDiskFace : public GFace { const SVector3 &p, const double &d, double uv[2]) const; - + std::vector<MElement*> discrete_triangles; protected: - // a copy of the mesh that should not be destroyed + // a copy of the mesh that should not be destroyed triangulation* initialTriangulation; triangulation* geoTriangulation;// parametrized triangulation - + std::vector<MVertex*> discrete_vertices; int _order; @@ -264,7 +264,7 @@ class discreteDiskFace : public GFace { mutable discreteDiskFaceTriangle *_ddft; mutable Octree *oct; mutable std::vector<double> _coords; - + }; #endif diff --git a/Geo/discreteFace.cpp b/Geo/discreteFace.cpp index 2253282939..0f94d4cd45 100644 --- a/Geo/discreteFace.cpp +++ b/Geo/discreteFace.cpp @@ -20,7 +20,6 @@ extern "C" { } #endif - discreteFace::discreteFace(GModel *model, int num) : GFace(model, num) { Surface *s = Create_Surface(num, MSH_SURF_DISCRETE); @@ -111,13 +110,12 @@ void discreteFace::secondDer(const SPoint2 ¶m, void discreteFace::createGeometry() { checkAndFixOrientation(); + +#if defined(HAVE_SOLVER) && defined(HAVE_ANN) int order = 1; int nPart = 2; double eta = 5/(2.*3.14); - -#if defined(HAVE_SOLVER) && defined(HAVE_ANN) - if (!_atlas.empty())return; int id=1; @@ -127,8 +125,8 @@ void discreteFace::createGeometry() triangulation* init = new triangulation(-1, tem,this); toSplit.push(init); - if((toSplit.top())->genus()!=0 || (toSplit.top())->aspectRatio() > eta || (toSplit.top())->seamPoint){ - + if((toSplit.top())->genus()!=0 || (toSplit.top())->aspectRatio() > eta || + (toSplit.top())->seamPoint){ while( !toSplit.empty()){ std::vector<triangulation*> part; @@ -276,8 +274,6 @@ void discreteFace::printAtlasMesh(std::vector<MElement*> elm, int I) } - - void discreteFace::printAtlasMesh(discreteDiskFace* ddf, int I) { #if defined(HAVE_SOLVER) && defined(HAVE_ANN) @@ -316,9 +312,8 @@ void discreteFace::printAtlasMesh(discreteDiskFace* ddf, int I) #endif } - -void discreteFace::checkAndFixOrientation(){ - +void discreteFace::checkAndFixOrientation() +{ // first of all, all the triangles have to be oriented in the same way std::map<MEdge,std::vector<MElement*>,Less_Edge> ed2tri; // edge to 1 or 2 triangle(s) @@ -405,7 +400,9 @@ void discreteFace::setupDiscreteVertex(GVertex*dv,MVertex*mv,std::set<MVertex*>* if (trash) trash->insert(mv); } -void discreteFace::setupDiscreteEdge(discreteEdge*de,std::vector<MLine*>mlines,std::set<MVertex*>*trash){ +void discreteFace::setupDiscreteEdge(discreteEdge*de,std::vector<MLine*>mlines, + std::set<MVertex*>*trash) +{ this->model()->add(de);// new GEdge de->lines = mlines;// associated MLine's for(unsigned int i=1; i<mlines.size(); i++){//not the first vertex of the GEdge (neither the last one) @@ -418,10 +415,9 @@ void discreteFace::setupDiscreteEdge(discreteEdge*de,std::vector<MLine*>mlines,s de->reverse(); } - // split old GEdge's -void discreteFace::splitDiscreteEdge ( GEdge *de , GVertex *gv, discreteEdge* newE[2]){ - +void discreteFace::splitDiscreteEdge(GEdge *de , GVertex *gv, discreteEdge* newE[2]) +{ MVertex *vend = de->getEndVertex()->mesh_vertices[0]; newE[0] = new discreteEdge (de->model(),NEWLINE(),de->getBeginVertex(),gv); @@ -469,7 +465,8 @@ void discreteFace::splitDiscreteEdge ( GEdge *de , GVertex *gv, discreteEdge* ne } -void discreteFace::split(triangulation* trian,std::vector<triangulation*> &partition,int nPartitions) +void discreteFace::split(triangulation* trian,std::vector<triangulation*> &partition, + int nPartitions) { #if defined(HAVE_SOLVER) && defined(HAVE_ANN) && defined(HAVE_METIS) @@ -559,12 +556,9 @@ void discreteFace::split(triangulation* trian,std::vector<triangulation*> &parti for(int i=0; i<nPartitions; i++)// new triangulation of the connected parts partition.push_back(new triangulation(i, elem[i],this)); - - #endif } - void discreteFace::updateTopology(std::vector<triangulation*>&partition) { #if defined(HAVE_SOLVER) && defined(HAVE_ANN) && defined(HAVE_METIS) @@ -696,7 +690,6 @@ void discreteFace::updateTopology(std::vector<triangulation*>&partition) #endif } - void discreteFace::fillHoles(triangulation* trian) { #if defined(HAVE_SOLVER) && defined(HAVE_ANN) @@ -758,6 +751,7 @@ void discreteFace::fillHoles(triangulation* trian) void discreteFace::bisectionEdg(triangulation* trian) { +#if defined(HAVE_SOLVER) && defined(HAVE_ANN) std::map<MEdge,double,Less_Edge> ed2angle; std::map<double,std::vector<MEdge> > ed2refine; /* @@ -791,12 +785,14 @@ void discreteFace::bisectionEdg(triangulation* trian) }// end for unsigned ed2refine.erase(key); }// end for it - +#endif } -bool discreteFace::checkEdges(triangulation* trian,std::map<double,std::vector<MEdge> >& ed2refine,std::map<MEdge,double,Less_Edge>& ed2angle) +bool discreteFace::checkEdges(triangulation* trian, + std::map<double,std::vector<MEdge> >& ed2refine, + std::map<MEdge,double,Less_Edge>& ed2angle) { - +#if defined(HAVE_SOLVER) && defined(HAVE_ANN) for(unsigned int i=0; i<trian->tri.size(); i++){ MElement* t = trian->tri[i]; std::vector<MEdge> eds; @@ -827,12 +823,17 @@ bool discreteFace::checkEdges(triangulation* trian,std::map<double,std::vector<M }// end for j }//end for tri return !(ed2refine.empty()); +#else + return false; +#endif } -bool discreteFace::checkEdgesBis(triangulation* trian,std::map<double,std::vector<MEdge> >& ed2refine,std::map<MEdge,double,Less_Edge>& ed2angle) +bool discreteFace::checkEdgesBis(triangulation* trian, + std::map<double,std::vector<MEdge> >& ed2refine, + std::map<MEdge,double,Less_Edge>& ed2angle) { - +#if defined(HAVE_SOLVER) && defined(HAVE_ANN) for(unsigned int i=0; i<trian->tri.size(); i++){ MElement* t = trian->tri[i]; std::vector<MEdge> eds; @@ -859,10 +860,14 @@ bool discreteFace::checkEdgesBis(triangulation* trian,std::map<double,std::vecto }// end for j }//end for tri return !(ed2refine.empty()); +#else + return false; +#endif } - -MEdge discreteFace::lepp(triangulation* trian,MEdge ed){ +MEdge discreteFace::lepp(triangulation* trian,MEdge ed) +{ +#if defined(HAVE_SOLVER) && defined(HAVE_ANN) std::vector<int> intri = trian->ed2tri[ed]; bool isTerminal = false; while(intri.size()>1 && !isTerminal){ @@ -879,10 +884,15 @@ MEdge discreteFace::lepp(triangulation* trian,MEdge ed){ else isTerminal = true; }// end while return ed; +#else + return MEdge(); +#endif } -void discreteFace::refineTriangles(triangulation* trian,MEdge ed,std::vector<MEdge>&ed2update){ - +void discreteFace::refineTriangles(triangulation* trian,MEdge ed, + std::vector<MEdge>&ed2update) +{ +#if defined(HAVE_SOLVER) && defined(HAVE_ANN) SPoint3 mid = ed.barycenter(); MVertex* mv = new MVertex(mid.x(),mid.y(),mid.z()); trian->vert.insert(mv); @@ -968,10 +978,15 @@ void discreteFace::refineTriangles(triangulation* trian,MEdge ed,std::vector<MEd trian->borderEdg.insert(t00->getEdge(2)); trian->borderEdg.insert(t01->getEdge(1)); } +#endif } -void discreteFace::updateEd2refine(triangulation* trian,std::map<MEdge,double,Less_Edge>&ed2angle,std::vector<MEdge>&ed2update,std::map<double,std::vector<MEdge> >&ed2refine){ - +void discreteFace::updateEd2refine(triangulation* trian, + std::map<MEdge,double,Less_Edge>&ed2angle, + std::vector<MEdge>&ed2update, + std::map<double,std::vector<MEdge> >&ed2refine) +{ +#if defined(HAVE_SOLVER) && defined(HAVE_ANN) for(unsigned int i=0; i<ed2update.size(); i++){ MEdge current = ed2update[i]; std::vector<int> intri = trian->ed2tri[current]; @@ -1002,12 +1017,15 @@ void discreteFace::updateEd2refine(triangulation* trian,std::map<MEdge,double,Le }//end for j } }// end for i - +#endif } - -void discreteFace::updateEd2refineBis(triangulation* trian,std::map<MEdge,double,Less_Edge>&ed2angle,std::vector<MEdge>&ed2update,std::map<double,std::vector<MEdge> >&ed2refine){ - +void discreteFace::updateEd2refineBis(triangulation* trian, + std::map<MEdge,double,Less_Edge>&ed2angle, + std::vector<MEdge>&ed2update, + std::map<double,std::vector<MEdge> >&ed2refine) +{ +#if defined(HAVE_SOLVER) && defined(HAVE_ANN) for(unsigned int i=0; i<ed2update.size(); i++){ MEdge current = ed2update[i]; std::vector<int> intri = trian->ed2tri[current]; @@ -1033,7 +1051,7 @@ void discreteFace::updateEd2refineBis(triangulation* trian,std::map<MEdge,double }//end for j } }// end for i - +#endif } void discreteFace::addTriangle(triangulation* trian, MTriangle* t) @@ -1049,12 +1067,6 @@ void discreteFace::addTriangle(triangulation* trian, MTriangle* t) #endif } - -// delete all discrete disk faces -//void discreteFace::deleteAtlas() { -//} -//--------------------------------------------------------- - void discreteFace::writeGEO(FILE *fp) { fprintf(fp, "Discrete Face(%d) = {",tag()); diff --git a/Post/PViewDataGModelIO.cpp b/Post/PViewDataGModelIO.cpp index 7f56927ad3..84f9eda3b9 100644 --- a/Post/PViewDataGModelIO.cpp +++ b/Post/PViewDataGModelIO.cpp @@ -58,8 +58,8 @@ bool PViewDataGModel::readMSH(const std::string &viewName, const std::string &fi int step, double time, int partition, int numComp, int numEnt, const std::string &interpolationScheme) { - Msg::Info("Reading view `%s' step %d (time %g) partition %d: %d records", - viewName.c_str(), step, time, partition, numEnt); + Msg::Debug("Reading view `%s' step %d (time %g) partition %d: %d records", + viewName.c_str(), step, time, partition, numEnt); while(step >= (int)_steps.size()) _steps.push_back(new stepData<double>(GModel::current(), numComp)); diff --git a/Post/PViewIO.cpp b/Post/PViewIO.cpp index b2f1e8ebc9..49cd161339 100644 --- a/Post/PViewIO.cpp +++ b/Post/PViewIO.cpp @@ -128,12 +128,12 @@ bool PView::readMSH(const std::string &fileName, int fileIndex) } if(format){ binary = true; - Msg::Info("View data is in binary format"); + Msg::Debug("View data is in binary format"); int one; if(fread(&one, sizeof(int), 1, fp) != 1){ fclose(fp); return 0; } if(one != 1){ swap = true; - Msg::Info("Swapping bytes from binary file"); + Msg::Debug("Swapping bytes from binary file"); } } } @@ -141,7 +141,7 @@ bool PView::readMSH(const std::string &fileName, int fileIndex) std::string name; if(!fgets(str, sizeof(str), fp)){ fclose(fp); return false; } name = ExtractDoubleQuotedString(str, sizeof(str)); - Msg::Info("Reading interpolation scheme '%s'", name.c_str()); + Msg::Debug("Reading interpolation scheme '%s'", name.c_str()); PViewData::removeInterpolationScheme(name); int numTypes; if(fscanf(fp, "%d", &numTypes) != 1){ fclose(fp); return false; } -- GitLab