diff --git a/Geo/GEdge.cpp b/Geo/GEdge.cpp index ed24140ebd00f12825eeb1bca72f07dafd817d02..81baf9f855638d886e416afcf41bcf789c5562bf 100644 --- a/Geo/GEdge.cpp +++ b/Geo/GEdge.cpp @@ -317,8 +317,6 @@ bool GEdge::XYZToU(const double X, const double Y, const double Z, double uMin = uu.low(); double uMax = uu.high(); - // printf("dans GEdge uMin=%g, uMax=%g \n", uMin, uMax); - SVector3 Q(X, Y, Z), P; double init[NumInitGuess]; diff --git a/Geo/GEdge.h b/Geo/GEdge.h index 7fe10d796e0bf2374d5c76a16a3608486d421c3c..9efe5be4bdab72c9992da8f198870b0f0dec7cc1 100644 --- a/Geo/GEdge.h +++ b/Geo/GEdge.h @@ -11,6 +11,7 @@ #include <vector> #include <set> #include <stdio.h> +#include "GmshMessage.h" #include "GEntity.h" #include "GVertex.h" #include "SVector3.h" @@ -125,9 +126,11 @@ class GEdge : public GEntity { void setTooSmall(bool b) { _tooSmall = b; } bool isMeshDegenerated() const { - if (_tooSmall) printf("too small \n"); + if (_tooSmall) + Msg::Debug("degenerated mesh on edge %d: too small", tag()); if (v0 == v1 && mesh_vertices.size() < 2) - printf("mesh_vertices.size() = %d \n", (int)mesh_vertices.size()); + Msg::Debug("degenerated mesh on edge %d: %d mesh vertices", tag(), + (int)mesh_vertices.size()); return _tooSmall || (v0 == v1 && mesh_vertices.size() < 2); } diff --git a/Graphics/drawGraph2d.cpp b/Graphics/drawGraph2d.cpp index 73a6429cfee0061b99a273d88851e1389c779c12..5a44adc7c7d50ec2e974571a2392b3f0a2459447 100644 --- a/Graphics/drawGraph2d.cpp +++ b/Graphics/drawGraph2d.cpp @@ -62,9 +62,15 @@ static bool getGraphData(PView *p, std::vector<double> &x, double &xmin, } else if(opt->type == PViewOptions::Plot2DTime){ numy = 0; - for(int ent = 0; ent < data->getNumEntities(0); ent++) - for(int i = 0; i < data->getNumElements(0, ent); i++) - if(data->getDimension(0, ent, i) < 2) numy++; + for(int ent = 0; ent < data->getNumEntities(0); ent++){ + if(data->skipEntity(0, ent)) continue; + for(int ele = 0; ele < data->getNumElements(0, ent); ele++){ + if(data->skipElement(0, ent, ele, true)) continue; + if(opt->skipElement(data->getType(0, ent, ele))) continue; + if(data->getDimension(0, ent, ele) >= 2) continue; + numy++; + } + } } if(!numy) return false; @@ -76,49 +82,51 @@ static bool getGraphData(PView *p, std::vector<double> &x, double &xmin, numy = 0; for(int ent = 0; ent < data->getNumEntities(0); ent++){ - for(int i = 0; i < data->getNumElements(0, ent); i++){ - int dim = data->getDimension(0, ent, i); - if(dim < 2){ - int numNodes = data->getNumNodes(0, ent, i); - // reorder the nodes for high order line elements - std::vector<int> reorder(numNodes); - if(numNodes < 3){ - for(int j = 0; j < numNodes; j++) - reorder[j] = j; - } - else{ - reorder[0] = 0; - reorder[numNodes - 1] = 1; - for(int j = 1; j < numNodes - 1; j++) - reorder[j] = 1 + j; - } - for(int ts = space ? opt->timeStep : 0; ts < opt->timeStep + 1; ts++){ - int numComp = data->getNumComponents(ts, ent, i); - for(int j = 0; j < numNodes; j++){ - double val[9], xyz[3]; - data->getNode(ts, ent, i, reorder[j], xyz[0], xyz[1], xyz[2]); - for(int k = 0; k < numComp; k++) - data->getValue(ts, ent, i, reorder[j], k, val[k]); - double vy = ComputeScalarRep(numComp, val); - if(space){ - // store offset to origin + distance to first point - if(x.empty()){ - p0 = SPoint3(xyz[0], xyz[1], xyz[2]); - x.push_back(ComputeScalarRep(3, xyz)); - } - else{ - x.push_back(x[0] + p0.distance(SPoint3(xyz[0], xyz[1], xyz[2]))); - } - y[0].push_back(vy); + if(data->skipEntity(0, ent)) continue; + for(int ele = 0; ele < data->getNumElements(0, ent); ele++){ + if(data->skipElement(0, ent, ele, true)) continue; + if(opt->skipElement(data->getType(0, ent, ele))) continue; + if(data->getDimension(0, ent, ele) >= 2) continue; + int numNodes = data->getNumNodes(0, ent, ele); + // reorder the nodes for high order line elements + std::vector<int> reorder(numNodes); + if(numNodes < 3){ + for(int j = 0; j < numNodes; j++) + reorder[j] = j; + } + else{ + reorder[0] = 0; + reorder[numNodes - 1] = 1; + for(int j = 1; j < numNodes - 1; j++) + reorder[j] = 1 + j; + } + for(int ts = space ? opt->timeStep : 0; ts < opt->timeStep + 1; ts++){ + if(!data->hasTimeStep(ts)) continue; + int numComp = data->getNumComponents(ts, ent, ele); + for(int j = 0; j < numNodes; j++){ + double val[9], xyz[3]; + data->getNode(ts, ent, ele, reorder[j], xyz[0], xyz[1], xyz[2]); + for(int k = 0; k < numComp; k++) + data->getValue(ts, ent, ele, reorder[j], k, val[k]); + double vy = ComputeScalarRep(numComp, val); + if(space){ + // store offset to origin + distance to first point + if(x.empty()){ + p0 = SPoint3(xyz[0], xyz[1], xyz[2]); + x.push_back(ComputeScalarRep(3, xyz)); } else{ - if(!numy) x.push_back(data->getTime(ts)); - y[numy].push_back(vy); + x.push_back(x[0] + p0.distance(SPoint3(xyz[0], xyz[1], xyz[2]))); } + y[0].push_back(vy); + } + else{ + if(!numy) x.push_back(data->getTime(ts)); + y[numy].push_back(vy); } } - numy++; } + numy++; } } diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp index d127982ea99b49bcb94ecf50d90091f6d475d691..7483a0fb9d2523555631a1c0709dd966f90406ed 100644 --- a/Mesh/meshGFace.cpp +++ b/Mesh/meshGFace.cpp @@ -415,7 +415,7 @@ static bool meshGenerator(GFace *gf, int RECUR_ITER, } } else - printf("edge %d degenerated mesh \n", (*ite)->tag()); + Msg::Info("Degenerated mesh on edge %d", (*ite)->tag()); ++ite; } @@ -959,7 +959,7 @@ static bool buildConsecutiveListOfVertices(GFace *gf, GEdgeLoop &gel, bool seam = ges.ge->isSeam(gf); - if (seam)printf("face %d has seam %d\n",gf->tag(),ges.ge->tag()); + if (seam) printf("face %d has seam %d\n", gf->tag(), ges.ge->tag()); Range<double> range = ges.ge->parBounds(0); diff --git a/Solver/linearSystemCSR.h b/Solver/linearSystemCSR.h index 3db4c5fffa7e0b45c1faca1570d8f7f0476ea8b4..a6ff91c600dfc7ae07116bd214b52f9c0453b079 100644 --- a/Solver/linearSystemCSR.h +++ b/Solver/linearSystemCSR.h @@ -70,8 +70,8 @@ class linearSystemCSR : public linearSystem<scalar> { CSRList_Add(_a, &val); CSRList_Add(_ai, &ic); CSRList_Add(_ptr, &zero); - // The pointers may have been modified - // if there has been a reallocation in CSRList_Add + // The pointers may have been modified if there has been a + // reallocation in CSRList_Add ptr = (INDEX_TYPE*) _ptr->array; ai = (INDEX_TYPE*) _ai->array;