Changeset 12509


Ignore:
Timestamp:
06/22/12 11:21:55 (13 years ago)
Author:
Mathieu Morlighem
Message:

replaced all printf to _printString and _printLine

Location:
issm/trunk-jpl/src/c/objects/Bamg
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/objects/Bamg/BamgVertex.cpp

    r12493 r12509  
    1313        void BamgVertex::Echo(void){
    1414
    15                 printf("Vertex:\n");
    16                 printf("  integer   coordinates i.x: %i, i.y: %i\n",i.x,i.y);
    17                 printf("  Euclidean coordinates r.x: %g, r.y: %g\n",r.x,r.y);
    18                 printf("  ReferenceNumber = %i\n",ReferenceNumber);
     15                _printLine_("Vertex:");
     16                _printLine_("  integer   coordinates i.x: " << i.x << ", i.y: " << i.y);
     17                _printLine_("  Euclidean coordinates r.x: " << r.x << ", r.y: " << r.y);
     18                _printLine_("  ReferenceNumber = " << ReferenceNumber);
    1919                m.Echo();
    2020
  • issm/trunk-jpl/src/c/objects/Bamg/Edge.cpp

    r12493 r12509  
    2626        /*FUNCTION Edge::Echo {{{*/
    2727        void Edge::Echo(void){
    28                 printf("Edge:\n");
    29                 printf("   pointers towards two vertices: %p %p\n",v[0],v[1]);
    30                 printf("   ReferenceNumber = %i\n",ReferenceNumber);
    31                 printf("   GeomEdgeHook = %p\n",GeomEdgeHook);
    32                 printf("   two adjacent edges on the same curve: %p %p\n",adj[0],adj[1]);
     28                _printLine_("Edge:");
     29                _printLine_("   pointers towards two vertices: " << v[0] << " " << v[1]);
     30                _printLine_("   ReferenceNumber = " << ReferenceNumber);
     31                _printLine_("   GeomEdgeHook = " << GeomEdgeHook);
     32                _printLine_("   two adjacent edges on the same curve: " << adj[0] << " " << adj[1]);
    3333        }
    3434        /*}}}*/
  • issm/trunk-jpl/src/c/objects/Bamg/EigenMetric.cpp

    r12365 r12509  
    114114        void EigenMetric::Echo(void){
    115115
    116                 printf("EigenMetric:\n");
    117                 printf("   lambda1: %g\n",lambda1);
    118                 printf("   lambda2: %g\n",lambda2);
    119                 printf("   v.x: %g\n",v.x);
    120                 printf("   v.y: %g\n",v.y);
     116                _printLine_("EigenMetric:");
     117                _printLine_("   lambda1: " << lambda1);
     118                _printLine_("   lambda2: " << lambda2);
     119                _printLine_("   v.x: " << v.x);
     120                _printLine_("   v.y: " << v.y);
    121121
    122122                return;
  • issm/trunk-jpl/src/c/objects/Bamg/Geometry.cpp

    r12493 r12509  
    4848        Geometry::~Geometry() {
    4949                /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/~Geometry)*/
    50                 if(NbRef>0){   printf("Trying to delete geometry and NbRef>0, probably due to an error"); return;}
     50                if(NbRef>0){   _printString_("Trying to delete geometry and NbRef>0, probably due to an error"); return;}
    5151                if(vertices)   delete [] vertices;  vertices=0;
    5252                if(edges)      delete [] edges;     edges=0;
     
    8181                //Vertices
    8282                if (bamggeom->Vertices){
    83                         if(verbose>5) printf("      processing Vertices\n");
     83                        if(verbose>5) _printLine_("      processing Vertices");
    8484                        if (bamggeom->VerticesSize[1]!=3) _error2_("Vertices should have 3 columns");
    8585                        vertices = new GeomVertex[nbv];
     
    126126                        double* verticeslength=NULL;
    127127
    128                         if(verbose>5) printf("      processing Edges\n");
     128                        if(verbose>5) _printLine_("      processing Edges");
    129129                        if (bamggeom->EdgesSize[1]!=3) _error2_("Edges should have 3 columns");
    130130                        edges = new GeomEdge[nbe];
     
    181181                //hVertices
    182182                if(bamgopts->hVertices && bamgopts->hVerticesSize[0]==nbv){
    183                         if(verbose>5) printf("      processing hVertices\n");
     183                        if(verbose>5) _printLine_("      processing hVertices");
    184184                        for (i=0;i< nbv;i++){
    185185                                if (!isnan(bamgopts->hVertices[i])){
     
    191191                //MetricVertices
    192192                if(bamgopts->metric && bamgopts->metric[0]==nbv){
    193                         if(verbose>5) printf("      processing MetricVertices\n");
     193                        if(verbose>5) _printLine_("      processing MetricVertices");
    194194                        for (i=0;i< nbv;i++) {
    195195                                vertices[i].m = Metric((double)bamgopts->metric[i*3+0],(double)bamgopts->metric[i*3+1],(double)bamgopts->metric[i*3+2]);
     
    199199                //MaxCornerAngle
    200200                if (bamgopts->MaxCornerAngle){
    201                         if(verbose>5) printf("      processing MaxCornerAngle\n");
     201                        if(verbose>5) _printLine_("      processing MaxCornerAngle");
    202202                        MaxCornerAngle=bamgopts->MaxCornerAngle*Pi/180;
    203203                }
     
    205205                //TangentAtEdges
    206206                if (bamggeom->TangentAtEdges){
    207                         if(verbose>5) printf("      processing TangentAtEdges");
     207                        if(verbose>5) _printString_("      processing TangentAtEdges");
    208208                        if (bamggeom->TangentAtEdgesSize[1]!=4) _error2_("TangentAtEdges should have 4 columns");
    209209                        int n,i,j,k;
     
    224224                //Corners
    225225                if(bamggeom->Corners){
    226                         if(verbose>5) printf("      processing Corners");
     226                        if(verbose>5) _printString_("      processing Corners");
    227227                        if (bamggeom->CornersSize[1]!=1) _error2_("Corners should have 1 column");
    228228                        n=bamggeom->CornersSize[0];
     
    238238                //RequiredVertices
    239239                if(bamggeom->RequiredVertices){
    240                         if(verbose>5) printf("      processing RequiredVertices\n");
     240                        if(verbose>5) _printLine_("      processing RequiredVertices");
    241241                        if (bamggeom->RequiredVerticesSize[1]!=1) _error2_("RequiredVertices should have 1 column");
    242242                        n=bamggeom->RequiredVerticesSize[0];
     
    250250                //RequiredEdges
    251251                if(bamggeom->RequiredEdges){
    252                         if(verbose>5) printf("      processing RequiredEdges\n");
     252                        if(verbose>5) _printLine_("      processing RequiredEdges");
    253253                        if (bamggeom->RequiredEdgesSize[1]!=1) _error2_("RequiredEdges should have 1 column");
    254254                        n=bamggeom->RequiredEdgesSize[0];
     
    262262                //SubDomain
    263263                if(bamggeom->SubDomains){
    264                         if(verbose>5) printf("      processing SubDomains\n");
     264                        if(verbose>5) _printLine_("      processing SubDomains");
    265265                        if (bamggeom->SubDomainsSize[1]!=4) _error2_("SubDomains should have 4 columns");
    266266                        nbsubdomains=bamggeom->SubDomainsSize[0];
     
    294294
    295295                /*Vertices*/
    296                 if(verbose>5) printf("      writing Vertices\n");
     296                if(verbose>5) _printLine_("      writing Vertices");
    297297                bamggeom->VerticesSize[0]=nbv;
    298298                bamggeom->VerticesSize[1]=3;
     
    310310
    311311                /*Edges*/
    312                 if(verbose>5) printf("      writing Edges\n");
     312                if(verbose>5) _printLine_("      writing Edges");
    313313                bamggeom->EdgesSize[0]=nbe;
    314314                bamggeom->EdgesSize[1]=3;
     
    328328
    329329                /*RequiredEdges*/
    330                 if(verbose>5) printf("      writing %i RequiredEdges\n",nbreq);
     330                if(verbose>5) _printLine_("      writing " << nbreq << " RequiredEdges");
    331331                bamggeom->RequiredEdgesSize[0]=nbreq;
    332332                bamggeom->RequiredEdgesSize[1]=1;
     
    345345
    346346                /*RequiredVertices*/
    347                 if(verbose>5) printf("      writing %i RequiredVertices\n",nbreqv);
     347                if(verbose>5) _printLine_("      writing " << nbreqv << " RequiredVertices");
    348348                bamggeom->RequiredVerticesSize[0]=nbreqv;
    349349                bamggeom->RequiredVerticesSize[1]=1;
     
    360360
    361361                /*SubDomains*/
    362                 if(verbose>5) printf("      writing SubDomains\n");
     362                if(verbose>5) _printLine_("      writing SubDomains");
    363363                bamggeom->SubDomainsSize[0]=nbsubdomains;
    364364                bamggeom->SubDomainsSize[1]=4;
     
    374374
    375375                /*TangentAtEdges*/
    376                 if(verbose>5) printf("      writing TangentAtEdges\n");
     376                if(verbose>5) _printLine_("      writing TangentAtEdges");
    377377                bamggeom->TangentAtEdgesSize[0]=nbtan;
    378378                bamggeom->TangentAtEdgesSize[1]=4;
     
    403403        void Geometry::Echo(void){
    404404
    405                 printf("Geometry:\n");
    406                 printf("   nbv  (number of vertices) : %i\n",nbv);
    407                 printf("   nbe  (number of edges)    : %i\n",nbe);
    408                 printf("   nbsubdomains: %i\n",nbsubdomains);
    409                 printf("   nbcurves: %i\n",nbcurves);
    410                 printf("   vertices: %p\n",vertices);
    411                 printf("   edges: %p\n",edges);
    412                 printf("   quadtree: %p\n",quadtree);
    413                 printf("   subdomains: %p\n",subdomains);
    414                 printf("   curves: %p\n",curves);
    415                 printf("   pmin (x,y): (%g %g)\n",pmin.x,pmin.y);
    416                 printf("   pmax (x,y): (%g %g)\n",pmax.x,pmax.y);
    417                 printf("   coefIcoor: %g\n",coefIcoor);
    418                 printf("   MaxCornerAngle: %g\n",MaxCornerAngle);
     405                _printLine_("Geometry:");
     406                _printLine_("   nbv  (number of vertices) : " << nbv);
     407                _printLine_("   nbe  (number of edges)    : " << nbe);
     408                _printLine_("   nbsubdomains: " << nbsubdomains);
     409                _printLine_("   nbcurves: " << nbcurves);
     410                _printLine_("   vertices: " << vertices);
     411                _printLine_("   edges: " << edges);
     412                _printLine_("   quadtree: " << quadtree);
     413                _printLine_("   subdomains: " << subdomains);
     414                _printLine_("   curves: " << curves);
     415                _printLine_("   pmin (x,y): (" << pmin.x << " " << pmin.y << ")");
     416                _printLine_("   pmax (x,y): (" << pmax.x << " " << pmax.y << ")");
     417                _printLine_("   coefIcoor: " << coefIcoor);
     418                _printLine_("   MaxCornerAngle: " << MaxCornerAngle);
    419419
    420420                return;
     
    527527                        /*if there is a vertex found that is to close to vertices[i] -> error*/
    528528                        if( v && Norme1(v->r - vertices[i].r) < eps ){
    529                                 printf("reference numbers: %i %i\n",v->ReferenceNumber,vertices[i].ReferenceNumber);
    530                                 printf("Id: %i\n",i+1);
     529                                _printLine_("reference numbers: " << v->ReferenceNumber << " " << vertices[i].ReferenceNumber);
     530                                _printLine_("Id: " << i+1);
    531531                                delete [] next_p;
    532532                                delete [] head_v;
     
    870870                        if (bge<=0) {
    871871                                if(NbTry) {
    872                                         printf("Fatal Error: on the class Mesh before call Geometry::ProjectOnCurve\n");
    873                                         printf("That bug might come from:\n");
    874                                         printf(" 1)  a mesh edge  containing more than %i geometrical edges\n",mxe/2);
    875                                         printf(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before\n");
    876                                         printf("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)\n");
     872                                        _printLine_("Fatal Error: on the class Mesh before call Geometry::ProjectOnCurve");
     873                                        _printLine_("That bug might come from:");
     874                                        _printLine_(" 1)  a mesh edge  containing more than " << mxe/2 << " geometrical edges");
     875                                        _printLine_(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before");
     876                                        _printLine_("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)");
    877877                                        _error2_("see above");
    878878                                }
     
    887887                while (eg1 != (GeomEdge*) vg1  &&  (*eg1)(direction1) != (GeomVertex*) vg1) {
    888888                        if(tge>=mxe ) {
    889                                 printf("WARNING: on the class Mesh before call Geometry::ProjectOnCurve is having issues (isn't it Eric?)\n");
     889                                _printLine_("WARNING: on the class Mesh before call Geometry::ProjectOnCurve is having issues (isn't it Eric?)");
    890890                                NbTry++;
    891891                                if (NbTry<2) goto retry;
    892                                 printf("Fatal Error: on the class Mesh before call Geometry::ProjectOnCurve\n");
    893                                 printf("That bug might come from:\n");
    894                                 printf(" 1)  a mesh edge  contening more than %i geometrical edges\n",mxe/2);
    895                                 printf(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before\n");
    896                                 printf("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)\n");
     892                                _printLine_("Fatal Error: on the class Mesh before call Geometry::ProjectOnCurve");
     893                                _printLine_("That bug might come from:");
     894                                _printLine_(" 1)  a mesh edge  contening more than " << mxe/2 << " geometrical edges");
     895                                _printLine_(" 2)  code bug : be sure that we call   Mesh::SetVertexFieldOn() before");
     896                                _printLine_("To solve the problem do a coarsening of the geometrical mesh or change the constant value of mxe (dangerous)");
    897897                                _error2_("see above");
    898898                        }
  • issm/trunk-jpl/src/c/objects/Bamg/ListofIntersectionTriangles.cpp

    r12493 r12509  
    167167                        //x.Echo();
    168168                        //y.Echo();
    169                         //printf("cx = %g, cy=%g\n",cx,cy);
     169                        //_printLine_("cx = " << cx << ", cy=" << cy);
    170170
    171171                        si += sint;
     
    186186                        MaxNbSeg *= 2;
    187187                        if (verbosity>3){
    188                                 printf("   reshape lSegsI from %i to %i\n",mneo,MaxNbSeg);
     188                                _printLine_("   reshape lSegsI from " << mneo << " to " << MaxNbSeg);
    189189                        }
    190190                        _assert_(lSegsI && NbSeg<MaxNbSeg);
     
    211211                for (int i=0;i<MaxSize;i++) nw[i] = lIntTria[i];       
    212212                long int verbosity=0;
    213                 if(verbosity>3) printf("   ListofIntersectionTriangles  ReShape Maxsize %i -> %i\n",MaxSize,MaxNbSeg);
     213                if(verbosity>3) _printLine_("   ListofIntersectionTriangles  ReShape Maxsize " << MaxSize << " -> " << MaxNbSeg);
    214214                MaxSize = newsize;
    215215                delete [] lIntTria;// remove old
  • issm/trunk-jpl/src/c/objects/Bamg/Mesh.cpp

    r12507 r12509  
    2929                if(bamggeom->Edges==NULL) {
    3030                        /*Recreate geometry if needed*/
    31                         printf("WARNING: mesh present but no geometry found. Reconstructing...\n");
     31                        _printLine_("WARNING: mesh present but no geometry found. Reconstructing...");
    3232                        BuildGeometryFromMesh(bamgopts);
    3333                        Gh.PostRead();
     
    101101                          if (kk[i]>=0) kk[i]=k++;
    102102                        }
    103                   printf("   number of vertices %i, remove = %i\n",k,Tho.nbv - k);
    104                   printf("   number of triangles %i, remove = %i\n",kt,nbInT-kt);
    105                   printf("   number of New boundary edge %i\n",nbNewBedge);
     103                  _printLine_("   number of vertices " << k << ", remove = " << Tho.nbv - k);
     104                  _printLine_("   number of triangles " << kt << ", remove = " << nbInT-kt);
     105                  _printLine_("   number of New boundary edge " << nbNewBedge);
    106106                  long imaxnbv =k;
    107107                  Init(imaxnbv);
     
    280280
    281281                //Vertices
    282                 if (verbose) printf("Reading vertices (%i)\n",nbv);
     282                if (verbose) _printLine_("Reading vertices (" << nbv << ")");
    283283                vertices=xNew<BamgVertex>(nbv);
    284284                orderedvertices=xNew<BamgVertex*>(nbv);
     
    294294
    295295                //Triangles
    296                 if (verbose) printf("Reading triangles (%i)\n",nbt);
     296                if (verbose) _printLine_("Reading triangles (" << nbt << ")");
    297297                triangles =new Triangle[maxnbt]; //we cannot allocate only nbt triangles since
    298298                nodeflags=xNew<bool>(nbv);
     
    310310
    311311                /*Recreate geometry: */
    312                 if (verbose) printf("Building Geometry\n");
     312                if (verbose) _printLine_("Building Geometry");
    313313                BuildGeometryFromMesh();
    314                 if (verbose) printf("Completing geometry\n");
     314                if (verbose) _printLine_("Completing geometry");
    315315                Gh.PostRead();
    316316
     
    319319                for(i=0;i<nbv;i++){
    320320                        if(!nodeflags[i]){
    321                                 printf("Vertex %i does not belong to any element\n",i+1);
     321                                _printLine_("Vertex " << i+1 << " does not belong to any element");
    322322                                isorphan=true;
    323323                        }
     
    346346                //Vertices
    347347                if(bamgmesh->Vertices){
    348                         if(verbose>5) printf("      processing Vertices\n");
     348                        if(verbose>5) _printLine_("      processing Vertices");
    349349
    350350                        vertices=xNew<BamgVertex>(nbv);
     
    367367                //Triangles
    368368                if(bamgmesh->Triangles){
    369                         if(verbose>5) printf("      processing Triangles\n");
     369                        if(verbose>5) _printLine_("      processing Triangles");
    370370                        triangles =new Triangle[maxnbt]; //we cannot allocate only nbt triangles since
    371371                        //other triangles will be added for each edge
     
    385385                //Quadrilaterals
    386386                if(bamgmesh->Quadrilaterals){
    387                         if(verbose>5) printf("      processing Quadrilaterals\n");
     387                        if(verbose>5) _printLine_("      processing Quadrilaterals");
    388388                        long i1,i2,i3,i4,iref;
    389389                        triangles =new Triangle[nbt];
     
    407407                //VerticesOnGeomEdge
    408408                if(bamgmesh->VerticesOnGeomEdge){
    409                         if(verbose>5) printf("      processing VerticesOnGeomEdge\n");
     409                        if(verbose>5) _printLine_("      processing VerticesOnGeomEdge");
    410410                        NbVerticesOnGeomEdge=bamgmesh->VerticesOnGeomEdgeSize[0];
    411411                        VerticesOnGeomEdge= new  VertexOnGeom[NbVerticesOnGeomEdge] ;
     
    422422                //VerticesOnGeomVertex
    423423                if(bamgmesh->VerticesOnGeomVertexSize[0]){
    424                         if(verbose>5) printf("      processing VerticesOnGeomVertex\n");
     424                        if(verbose>5) _printLine_("      processing VerticesOnGeomVertex");
    425425                        NbVerticesOnGeomVertex=bamgmesh->VerticesOnGeomVertexSize[0];
    426426                        VerticesOnGeomVertex  = new  VertexOnGeom[NbVerticesOnGeomVertex] ;
     
    438438                        double* len=NULL;
    439439
    440                         if(verbose>5) printf("      processing Edges\n");
     440                        if(verbose>5) _printLine_("      processing Edges");
    441441                        nbe=bamgmesh->EdgesSize[0];
    442442                        edges= new Edge[nbe];
     
    498498                //EdgeOnGeomEdge
    499499                if(bamgmesh->EdgesOnGeomEdge){
    500                         if(verbose>5) printf("      processing EdgesOnGeomEdge\n");
     500                        if(verbose>5) _printLine_("      processing EdgesOnGeomEdge");
    501501                        int i1,i2,i,j;
    502502                        i2=bamgmesh->EdgesOnGeomEdgeSize[0];
     
    515515                if(bamgmesh->SubDomains){
    516516                        long i3,head,direction;
    517                         if(verbose>5) printf("      processing SubDomains\n");
     517                        if(verbose>5) _printLine_("      processing SubDomains");
    518518                        nbsubdomains=bamgmesh->SubDomainsSize[0];
    519519                        subdomains = new SubDomain [ nbsubdomains ];
     
    584584
    585585                /*Vertices*/
    586                 if(verbose>5) printf("      writing Vertices\n");
     586                if(verbose>5) _printLine_("      writing Vertices");
    587587                bamgmesh->VerticesSize[0]=nbv;
    588588                bamgmesh->VerticesSize[1]=3;
     
    597597
    598598                /*Edges*/
    599                 if(verbose>5) printf("      writing Edges\n");
     599                if(verbose>5) _printLine_("      writing Edges");
    600600                bamgmesh->EdgesSize[0]=nbe;
    601601                bamgmesh->EdgesSize[1]=3;
     
    614614
    615615                /*Element edges*/
    616                 if(verbose>5) printf("      writing element edges\n");
     616                if(verbose>5) _printLine_("      writing element edges");
    617617                SetOfEdges4* edge4=new SetOfEdges4(nbt*3,nbv);
    618618                double* elemedge=NULL;
     
    670670
    671671                /*IssmSegments*/
    672                 if(verbose>5) printf("      writing IssmSegments\n");
     672                if(verbose>5) _printLine_("      writing IssmSegments");
    673673                bamgmesh->IssmSegmentsSize[0]=NumIssmSegments;
    674674                bamgmesh->IssmSegmentsSize[1]=4;
     
    713713
    714714                /*Triangles*/
    715                 if(verbose>5) printf("      writing Triangles\n");
     715                if(verbose>5) _printLine_("      writing Triangles");
    716716                k=nbInT-nbq*2;
    717717                num=0;
     
    734734
    735735                /*Quadrilaterals*/
    736                 if(verbose>5) printf("      writing Quadrilaterals\n");
     736                if(verbose>5) _printLine_("      writing Quadrilaterals");
    737737                bamgmesh->QuadrilateralsSize[0]=nbq;
    738738                bamgmesh->QuadrilateralsSize[1]=5;
     
    755755
    756756                /*SubDomains*/
    757                 if(verbose>5) printf("      writing SubDomains\n");
     757                if(verbose>5) _printLine_("      writing SubDomains");
    758758                bamgmesh->SubDomainsSize[0]=nbsubdomains;
    759759                bamgmesh->SubDomainsSize[1]=4;
     
    769769
    770770                /*SubDomainsFromGeom*/
    771                 if(verbose>5) printf("      writing SubDomainsFromGeom\n");
     771                if(verbose>5) _printLine_("      writing SubDomainsFromGeom");
    772772                bamgmesh->SubDomainsFromGeomSize[0]=Gh.nbsubdomains;
    773773                bamgmesh->SubDomainsFromGeomSize[1]=4;
     
    783783
    784784                /*VerticesOnGeomVertex*/
    785                 if(verbose>5) printf("      writing VerticesOnGeomVertex\n");
     785                if(verbose>5) _printLine_("      writing VerticesOnGeomVertex");
    786786                bamgmesh->VerticesOnGeomVertexSize[0]=NbVerticesOnGeomVertex;
    787787                bamgmesh->VerticesOnGeomVertexSize[1]=2;
     
    797797
    798798                /*VertexOnGeomEdge*/
    799                 if(verbose>5) printf("      writing VerticesOnGeomEdge\n");
     799                if(verbose>5) _printLine_("      writing VerticesOnGeomEdge");
    800800                bamgmesh->VerticesOnGeomEdgeSize[0]=NbVerticesOnGeomEdge;
    801801                bamgmesh->VerticesOnGeomEdgeSize[1]=3;
     
    814814
    815815                /*EdgesOnGeomEdge*/
    816                 if(verbose>5) printf("      writing EdgesOnGeomEdge\n");
     816                if(verbose>5) _printLine_("      writing EdgesOnGeomEdge");
    817817                k=0;
    818818                for (i=0;i<nbe;i++){
     
    834834
    835835                /*Element Connectivity*/
    836                 if(verbose>5) printf("      writing Element connectivity\n");
     836                if(verbose>5) _printLine_("      writing Element connectivity");
    837837                bamgmesh->ElementConnectivitySize[0]=nbt-nbtout;
    838838                bamgmesh->ElementConnectivitySize[1]=3;
     
    854854
    855855                /*ElementNodal Connectivity*/
    856                 if(verbose>5) printf("      writing Nodal element connectivity\n");
     856                if(verbose>5) _printLine_("      writing Nodal element connectivity");
    857857                bamgmesh->NodalElementConnectivitySize[0]=nbv;
    858858                bamgmesh->NodalElementConnectivitySize[1]=connectivitymax_1;
     
    869869
    870870                /*Nodal Connectivity*/
    871                 if(verbose>5) printf("      writing Nodal connectivity\n");
     871                if(verbose>5) _printLine_("      writing Nodal connectivity");
    872872                //chaining algorithm (again...)
    873873                int* head_2=NULL;
     
    921921
    922922                /*Cracked vertices*/
    923                 if(verbose>5) printf("      writing Cracked vertices\n");
     923                if(verbose>5) _printLine_("      writing Cracked vertices");
    924924                bamgmesh->CrackedVerticesSize[0]=NbCrackedVertices;
    925925                bamgmesh->CrackedVerticesSize[1]=2;
     
    933933
    934934                /*Cracked vertices*/
    935                 if(verbose>5) printf("      writing Cracked vertices\n");
     935                if(verbose>5) _printLine_("      writing Cracked vertices");
    936936                bamgmesh->CrackedEdgesSize[0]=NbCrackedEdges;
    937937                bamgmesh->CrackedEdgesSize[1]=4;
     
    961961                int  i,j;
    962962
    963                 if(bamgopts->verbose>3) printf("      processing metric\n");
     963                if(bamgopts->verbose>3) _printLine_("      processing metric");
    964964                double hmin = Max(bamgopts->hmin,MinimalHmin());
    965965                double hmax = Min(bamgopts->hmax,MaximalHmax());
     
    12641264
    12651265                //display info
    1266                 if (verbose > 1)  printf("   BoundAnisotropy by %g\n",anisomax);
     1266                if (verbose > 1)  _printLine_("   BoundAnisotropy by " << anisomax);
    12671267
    12681268                double h1=1.e30,h2=1e-30;
     
    12911291                //display info
    12921292                if (verbose>2){
    1293                         printf("      input:  Hmin = %g, Hmax = %g, factor of anisotropy max  = %g\n",pow(h2,-0.5),pow(h1,-0.5),pow(rx,0.5));
    1294                         printf("      output: Hmin = %g, Hmax = %g, factor of anisotropy max  = %g\n",pow(hn2,-0.5),pow(hn1,-0.5),pow(rnx,0.5));
     1293                        _printLine_("      input:  Hmin = " << pow(h2,-0.5)  << ", Hmax = " << pow(h1,-0.5) << ", factor of anisotropy max  = " << pow(rx,0.5));
     1294                        _printLine_("      output: Hmin = " << pow(hn2,-0.5) << ", Hmax = " << pow(hn1,-0.5)<< ", factor of anisotropy max  = " <<pow(rnx,0.5));
    12951295                }
    12961296        }
     
    13141314
    13151315                //display info
    1316                 if (verbose>1) printf("   construction of the geometry from the 2d mesh\n");
     1316                if (verbose>1) _printLine_("   construction of the geometry from the 2d mesh");
    13171317
    13181318                //check that the mesh is not empty
     
    13741374                                //else (see 3 lines above), the edge has been called more than twice: return error
    13751375                                else {
    1376                                         printf("The edge (%i,%i) belongs to more than 2 triangles (%i)\n",GetId(triangles[i][VerticesOfTriangularEdge[j][0]]),GetId(triangles[i][VerticesOfTriangularEdge[j][1]]),k);
    1377                                         printf("Edge %i of triangle %i\n",j,i);
    1378                                         printf("Edge %i of triangle %i\n",(-st[k]+2)%3,(-st[k]+2)/3);
    1379                                         printf("Edge %i of triangle %i\n",triangles[(-st[k]+2)/3].NuEdgeTriangleAdj((int)((-st[k]+2)%3)),GetId(triangles[(-st[k]+2)/3].TriangleAdj((int)((-st[k]+2)%3))));
     1376                                        _printLine_("The edge (" << GetId(triangles[i][VerticesOfTriangularEdge[j][0]]) << "," << GetId(triangles[i][VerticesOfTriangularEdge[j][1]]) << ") belongs to more than 2 triangles (" << k << ")");
     1377                                        _printLine_("Edge " << j << " of triangle " << i);
     1378                                        _printLine_("Edge " << (-st[k]+2)%3 << " of triangle " << (-st[k]+2)/3);
     1379                                        _printLine_("Edge " << triangles[(-st[k]+2)/3].NuEdgeTriangleAdj((int)((-st[k]+2)%3)) << " of triangle " << GetId(triangles[(-st[k]+2)/3].TriangleAdj((int)((-st[k]+2)%3))));
    13801380                                        _error2_("An edge belongs to more than 2 triangles");
    13811381                                }       
     
    13891389                //display info
    13901390                if(verbose>5) {
    1391                         printf("         info on Mesh:\n");
    1392                         printf("            - number of vertices    = %i \n",nbv);
    1393                         printf("            - number of triangles   = %i \n",nbt);
    1394                         printf("            - number of given edges = %i \n",nbe);
    1395                         printf("            - number of all edges   = %i \n",nbedges);
    1396                         printf("            - Euler number 1 - nb of holes = %i \n"  ,nbt-nbedges+nbv);
     1391                        _printLine_("         info on Mesh:");
     1392                        _printLine_("            - number of vertices    = " << nbv);
     1393                        _printLine_("            - number of triangles   = " << nbt);
     1394                        _printLine_("            - number of given edges = " << nbe);
     1395                        _printLine_("            - number of all edges   = " << nbedges);
     1396                        _printLine_("            - Euler number 1 - nb of holes = " << nbt-nbedges+nbv);
    13971397                }
    13981398
     
    14251425
    14261426                        //display info
    1427                         if(verbose>4) printf("   Construction of the edges %i\n",nbe);
     1427                        if(verbose>4) _printLine_("   Construction of the edges " << nbe);
    14281428
    14291429                        for (i=0;i<nbedges;i++){
     
    14511451                                                edges[add].ReferenceNumber=edgessave[i].ReferenceNumber;                     
    14521452                                                edges[add].GeomEdgeHook=edgessave[i].GeomEdgeHook; //  HACK to get required edges
    1453                                                 printf("oh no...\n");
     1453                                                _printLine_("oh no...");
    14541454                                        }
    14551455                                        else
     
    15661566                        }
    15671567                }
    1568                 if (verbose> 3) printf("      The Number of sub domain = %i\n",nbsubdomains);
     1568                if (verbose> 3) _printLine_("      The Number of sub domain = " << nbsubdomains);
    15691569
    15701570                //build subdomains
     
    16181618                Gh.nbsubdomains = nbsubdomains;
    16191619                Gh.subdomains = new GeomSubDomain[nbsubdomains];
    1620                 if (verbose>3) printf("   number of vertices = %i\n   number of edges = %i\n",Gh.nbv,Gh.nbe);
     1620                if (verbose>3) _printLine_("   number of vertices = " << Gh.nbv << "\n   number of edges = " << Gh.nbe);
    16211621                NbVerticesOnGeomVertex = Gh.nbv;
    16221622                VerticesOnGeomVertex = new VertexOnGeom[NbVerticesOnGeomVertex];
     
    17901790                //display infos
    17911791                if(verbose>1) {
    1792                         printf("   Construction of Metric: number of field: %i (nbt=%i, nbv=%i)\n",nbsol,nbt,nbv);
     1792                        _printLine_("   Construction of Metric: number of field: " << nbsol << " (nbt=" << nbt << ", nbv=" << nbv << ")");
    17931793                }
    17941794
     
    18621862
    18631863                        //display info
    1864                         if(verbose>2) printf("      Solution %i, Min = %g, Max = %g, Delta = %g\n",nusol,smin,smax,sdelta);
     1864                        if(verbose>2) _printLine_("      Solution " << nusol << ", Min = " << smin << ", Max = " << smax << ", Delta = " << sdelta);
    18651865
    18661866                        //skip constant field
    18671867                        if (sdelta < 1.0e-10*Max(absmax,1e-20)){
    1868                                 printf("      Solution %i is constant, skipping...\n",nusol);
     1868                                _printLine_("      Solution " << nusol << " is constant, skipping...");
    18691869                                continue;
    18701870                        }
     
    19921992                //display infos
    19931993                if(verbose>1) {
    1994                         printf("   Construction of Metric: number of field: %i (nbt=%i, nbv=%i)\n",nbsol,nbt,nbv);
     1994                        _printLine_("   Construction of Metric: number of field: " << nbsol << " (nbt=" << nbt << ", nbv=" << nbv << ")");
    19951995                }
    19961996
     
    20752075
    20762076                        //display info
    2077                         if(verbose>2) printf("      Solution %i, Min = %g, Max = %g, Delta = %g, number of fields = %i\n",nusol,smin,smax,sdelta,nbsol);
     2077                        if(verbose>2) _printLine_("      Solution " << nusol << ", Min = " << smin << ", Max = " << smax << ", Delta = " << sdelta << ", number of fields = " << nbsol);
    20782078
    20792079                        //skip constant field
    20802080                        if (sdelta < 1.0e-10*Max(absmax,1e-20) ){
    2081                                 if (verbose>2) printf("      Solution %i is constant, skipping...\n",nusol);
     2081                                if (verbose>2) _printLine_("      Solution " << nusol << " is constant, skipping...");
    20822082                                continue;
    20832083                        }
     
    22642264                //Return if no edge is cracked
    22652265                if(k==0) return;
    2266                 if (verbose>4) printf("      number of Cracked Edges = %i\n",k);
     2266                if (verbose>4) _printLine_("      number of Cracked Edges = " << k);
    22672267
    22682268                //Initialize Cracked edge
     
    23052305
    23062306                //Add new vertices
    2307                 if (verbose>4) printf("      number of Cracked Vertices = %i\n",NbCrackedVertices);
     2307                if (verbose>4) _printLine_("      number of Cracked Vertices = " << NbCrackedVertices);
    23082308                if (NbCrackedVertices){
    23092309                        CrackedVertices=xNew<long>(2*NbCrackedVertices);
     
    23742374                                        }
    23752375                                }
    2376                                 //printf("%i -> %i %i %i, edge [%i->%i %i->%i]\n",element_renu[GetId(ta.t)],GetId((*ta.t)[0])+1,GetId((*ta.t)[1])+1,GetId((*ta.t)[2])+1,i1,j1,i2,j2);
     2376                                //_printLine_("" << element_renu[GetId(ta.t)] << " -> " << GetId((*ta.t)[0])+1 << " " << GetId((*ta.t)[1])+1 << " " << GetId((*ta.t)[2])+1 << ", edge [" << i1 << "->" << j1 << " " << i2 << "->" << j2 << "]");
    23772377                                ta = Next(ta).Adj();
    23782378                                if (count++>50) _error2_("Maximum number of iteration exceeded");
     
    23982398                int i;
    23992399
    2400                 printf("Mesh Echo:\n");
    2401                 printf("   nbv = %i\n",nbv);
    2402                 printf("   nbt = %i\n",nbt);
    2403                 printf("   nbe = %i\n",nbe);
    2404                 printf("   nbq = %i\n",nbq);
    2405                 printf("   index:\n");
     2400                _printLine_("Mesh Echo:");
     2401                _printLine_("   nbv = " << nbv);
     2402                _printLine_("   nbt = " << nbt);
     2403                _printLine_("   nbe = " << nbe);
     2404                _printLine_("   nbq = " << nbq);
     2405                _printLine_("   index:");
    24062406                for (i=0;i<nbt;i++){
    24072407                        _printLine_("   " << setw(4) << i+1 << ": ["
     
    24102410                                                << setw(4) << (((BamgVertex *)triangles[i](0))?GetId(triangles[i][2])+1:0) << "]");
    24112411                }
    2412                 printf("   coordinates:\n");
     2412                _printLine_("   coordinates:");
    24132413                for (i=0;i<nbv;i++){
    24142414                        _printLine_("   " << setw(4) << i+1 << ": [" << vertices[i].r.x << " " << vertices[i].r.y << "]");
     
    24262426
    24272427                        //display
    2428                         if (verbose > 2) printf("   ForceBoundary  nb of edge: %i\n",nbe);
     2428                        if (verbose > 2) _printLine_("   ForceBoundary  nb of edge: " << nbe);
    24292429
    24302430                        //check that there is no triangle with 0 determinant
     
    24572457                                Nbswap +=  vertices[j].Optim(1,0);
    24582458                        }
    2459                         if (verbose > 3) printf("      number of inforced edge = %i, number of swap= %i\n",nbfe,Nbswap);
     2459                        if (verbose > 3) _printLine_("      number of inforced edge = " << nbfe << ", number of swap= " << Nbswap);
    24602460                }
    24612461        /*}}}*/
     
    24672467
    24682468                if (verbose >2){
    2469                         if (OutSide) printf("   Find all external sub-domain\n");
    2470                         else printf("   Find all internal sub-domain\n");
     2469                        if (OutSide) _printLine_("   Find all external sub-domain");
     2470                        else _printLine_("   Find all internal sub-domain");
    24712471                  }
    24722472                short * HeapArete = new short[nbt];
     
    26132613                                                                 }//while (t)
    26142614                                                                }
    2615                                                         if(verbose>4) printf("      Number of removes subdomains (OutSideMesh) = %i\n",nbsubdomains-j);
     2615                                                        if(verbose>4) _printLine_("      Number of removes subdomains (OutSideMesh) = " << nbsubdomains-j);
    26162616                                                        nbsubdomains=j;
    26172617                                                  }
     
    26922692
    26932693                                if (inew < nbsubdomains) {
    2694                                         if (verbose>5) printf("WARNING: %i SubDomains are being removed\n",nbsubdomains-inew);
     2694                                        if (verbose>5) _printLine_("WARNING: " << nbsubdomains-inew << " SubDomains are being removed");
    26952695                                        nbsubdomains=inew;}
    26962696
     
    28002800
    28012801                //Display info
    2802                 if (verbose>2) printf("   Insert initial %i vertices\n",nbv);
     2802                if (verbose>2) _printLine_("   Insert initial " << nbv << " vertices");
    28032803
    28042804                //Compute integer coordinates for the existing vertices
     
    28912891                /*Now, add the vertices One by One*/
    28922892                long NbSwap=0;
    2893                 if (verbose>3) printf("   Begining of insertion process...\n");
     2893                if (verbose>3) _printLine_("   Begining of insertion process...");
    28942894
    28952895                for (int icount=2; icount<nbv; icount++) {
     
    29142914                //Display info
    29152915                if (verbose>3) {
    2916                         printf("      NbSwap of insertion: %i\n",NbSwap);
    2917                         printf("      NbSwap/nbv:          %i\n",NbSwap/nbv);
     2916                        _printLine_("      NbSwap of insertion: " << NbSwap);
     2917                        _printLine_("      NbSwap/nbv:          " << NbSwap/nbv);
    29182918                }
    29192919
     
    29292929                         NbSwap += orderedvertices[is1]->Optim(0,0);
    29302930                        if (verbose>3) {
    2931                                 printf("      Optim Loop: %i\n",Nbloop);
    2932                                 printf("      NbSwap/nbv:          %i\n",NbSwap/nbv);
     2931                                _printLine_("      Optim Loop: " << Nbloop);
     2932                                _printLine_("      NbSwap/nbv:          " << NbSwap/nbv);
    29332933                        }
    29342934                        if(!NbSwap) break;
     
    29532953
    29542954                //display info if required
    2955                 if (verbose>5) printf("      Try to Insert %i new points\n",nbvnew);
     2955                if (verbose>5) _printLine_("      Try to Insert " << nbvnew << " new points");
    29562956
    29572957                //return if no new points
     
    30033003                }
    30043004                if (verbose>3) {
    3005                         printf("         number of new points: %i\n",iv);
    3006                         printf("         number of to close (?) points: %i\n",nbv-iv);
    3007                         printf("         number of swap after: %i\n",NbSwap);
     3005                        _printLine_("         number of new points: " << iv);
     3006                        _printLine_("         number of to close (?) points: " << nbv-iv);
     3007                        _printLine_("         number of swap after: " << NbSwap);
    30083008                }
    30093009                nbv = iv;
    30103010
    30113011                for (i=nbvold;i<nbv;i++) NbSwap += vertices[i].Optim(1); 
    3012                 if (verbose>3) printf("   NbSwap=%i\n",NbSwap);
     3012                if (verbose>3) _printLine_("   NbSwap=" << NbSwap);
    30133013
    30143014                NbTSwap +=  NbSwap ;
     
    30563056                        if (!e[i]){
    30573057                                kk++;
    3058                                 if(kk<10) printf("BUG: the geometrical edge %i is on no edge curve\n",i);
     3058                                if(kk<10) _printLine_("BUG: the geometrical edge " << i << " is on no edge curve");
    30593059                        }
    30603060                }
     
    30703070                long int verbose=0;
    30713071
    3072                 if (verbose>2) printf("MakeQuadrangles costheta = %g\n",costheta);
     3072                if (verbose>2) _printLine_("MakeQuadrangles costheta = " << costheta);
    30733073
    30743074                if (costheta >1) {
    3075                         if (verbose>5) printf("   do nothing: costheta > 1\n");
     3075                        if (verbose>5) _printLine_("   do nothing: costheta > 1");
    30763076                }
    30773077
     
    31003100                        nbq = kk;
    31013101                        if (verbose>2){
    3102                                 printf("   number of quadrilaterals    = %i\n",nbq);
    3103                                 printf("   number of triangles         = %i\n",nbt-nbtout- nbq*2);
    3104                                 printf("   number of outside triangles = %i\n",nbtout);
     3102                                _printLine_("   number of quadrilaterals    = " << nbq);
     3103                                _printLine_("   number of triangles         = " << nbt-nbtout- nbq*2);
     3104                                _printLine_("   number of outside triangles = " << nbtout);
    31053105                        }
    31063106                        delete [] qq;
     
    31283128
    31293129                const  double maxsubdiv2 = maxsubdiv*maxsubdiv;
    3130                 if(verbose>1) printf("   Limit the subdivision of a edges in the new mesh by %g\n",maxsubdiv);
     3130                if(verbose>1) _printLine_("   Limit the subdivision of a edges in the new mesh by " << maxsubdiv);
    31313131                // for all the edges
    31323132                // if the len of the edge is to long
     
    31713171                }
    31723172                if(verbose>3){
    3173                         printf("      number of metric changes = %i, maximum number of subdivision of a edges before change = %g\n",nbchange,pow(lmax,0.5));
     3173                        _printLine_("      number of metric changes = " << nbchange << ", maximum number of subdivision of a edges before change = " << pow(lmax,0.5));
    31743174                }
    31753175        }
     
    32253225                /*First, insert old points if requested*/
    32263226                if (KeepVertices && (&Bh != this) && (nbv+Bh.nbv< maxnbv)){
    3227                         if (verbose>5) printf("         Inserting initial mesh points\n");
     3227                        if (verbose>5) _printLine_("         Inserting initial mesh points");
    32283228                        for (i=0;i<Bh.nbv;i++){
    32293229                                BamgVertex &bv=Bh[i];
     
    32443244                // Big loop (most time consuming)
    32453245                int iter=0;
    3246                 if (verbose>5) printf("         Big loop\n");
     3246                if (verbose>5) _printLine_("         Big loop");
    32473247                do {
    32483248                        /*Update variables*/
     
    34753475        // find extrema coordinates of vertices pmin,pmax
    34763476        long i;
    3477         if(verbose>2) printf("      Reconstruct mesh of %i vertices\n",nbv);
     3477        if(verbose>2) _printLine_("      Reconstruct mesh of " << nbv << " vertices");
    34783478
    34793479        //initialize orderedvertices
     
    35323532        //Display info if required
    35333533        if(verbose>5) {
    3534                 printf("         info of Mesh:\n");
    3535                 printf("            - number of vertices    = %i \n",nbv);
    3536                 printf("            - number of triangles   = %i \n",nbt);
    3537                 printf("            - number of given edges = %i \n",nbe);
    3538                 printf("            - number of all edges   = %i \n"  ,edge4->nb());
    3539                 printf("            - Euler number 1 - nb of holes = %i \n"  ,nbt-edge4->nb()+nbv);
     3534                _printLine_("         info of Mesh:");
     3535                _printLine_("            - number of vertices    = " << nbv << " ");
     3536                _printLine_("            - number of triangles   = " << nbt << " ");
     3537                _printLine_("            - number of given edges = " << nbe << " ");
     3538                _printLine_("            - number of all edges   = " << edge4->nb());
     3539                _printLine_("            - Euler number 1 - nb of holes = " << nbt-edge4->nb()+nbv);
    35403540        }
    35413541
     
    35543554                                if (k<10) {
    35553555                                        //print only 10 edges
    3556                                         printf("Lost boundary edges %i : %i %i\n",i,edge4->i(i),edge4->j(i));
     3556                                        _printLine_("Lost boundary edges " << i << " : " << edge4->i(i) << " " << edge4->j(i));
    35573557                                }
    35583558                                else if (k==10){
    3559                                         printf("Other lost boundary edges not shown...\n");
     3559                                        _printLine_("Other lost boundary edges not shown...");
    35603560                                }
    35613561                        }
     
    37453745                                        /*Check that the 2 vertices are on geometry AND required*/
    37463746                                        if(!edges[i][j].GeomEdgeHook->IsRequiredVertex()){
    3747                                                 printf("ReconstructExistingMesh error message: problem with the edge number %i: [%i %i]\n",i+1,GetId(edges[i][0])+1,GetId(edges[i][1])+1);
    3748                                                 printf("This edge is on geometrical edge number %i\n",Gh.GetId(edges[i].GeomEdgeHook)+1);
     3747                                                _printLine_("ReconstructExistingMesh error message: problem with the edge number " << i+1 << ": [" << GetId(edges[i][0])+1 << " " << GetId(edges[i][1])+1 << "]");
     3748                                                _printLine_("This edge is on geometrical edge number " << Gh.GetId(edges[i].GeomEdgeHook)+1);
    37493749                                                if (edges[i][j].GeomEdgeHook->OnGeomVertex())
    3750                                                  printf("the vertex number %i of this edge is a geometric BamgVertex number %i\n",GetId(edges[i][j])+1,Gh.GetId(edges[i][j].GeomEdgeHook->gv)+1);
     3750                                                 _printLine_("the vertex number " << GetId(edges[i][j])+1 << " of this edge is a geometric BamgVertex number " << Gh.GetId(edges[i][j].GeomEdgeHook->gv)+1);
    37513751                                                else if (edges[i][j].GeomEdgeHook->OnGeomEdge())
    3752                                                  printf("the vertex number %i of this edge is a geometric Edge number %i\n",GetId(edges[i][j])+1,Gh.GetId(edges[i][j].GeomEdgeHook->ge)+1);
     3752                                                 _printLine_("the vertex number " << GetId(edges[i][j])+1 << " of this edge is a geometric Edge number " << Gh.GetId(edges[i][j].GeomEdgeHook->ge)+1);
    37533753                                                else
    3754                                                  printf("Its pointer is %p\n",edges[i][j].GeomEdgeHook);
    3755 
    3756                                                 printf("This edge is on geometry and has no adjacent edge (open curve) and one of the tip is not required\n");
     3754                                                 _printLine_("Its pointer is " << edges[i][j].GeomEdgeHook);
     3755
     3756                                                _printLine_("This edge is on geometry and has no adjacent edge (open curve) and one of the tip is not required");
    37573757                                                _error2_("See above (might be cryptic...)");
    37583758                                        }
     
    38423842                long it,ie,i;
    38433843
    3844                 printf("renumbering triangles\n");
     3844                _printLine_("renumbering triangles");
    38453845                for ( it=0;it<nbt;it++)
    38463846                 triangles[it].Renumbering(vertices,ve,renu);
    38473847
    3848                 printf("renumbering edges\n");
     3848                _printLine_("renumbering edges");
    38493849                for ( ie=0;ie<nbe;ie++)
    38503850                 edges[ie].Renumbering(vertices,ve,renu);
    38513851
    3852                 printf("renumbering vertices on geom\n");
     3852                _printLine_("renumbering vertices on geom");
    38533853                for (i=0;i< NbVerticesOnGeomVertex;i++)
    38543854                  {
     
    38583858                  }
    38593859
    3860                 printf("renumbering vertices on edge\n");
     3860                _printLine_("renumbering vertices on edge");
    38613861                for (i=0;i< NbVerticesOnGeomEdge;i++)
    38623862                  {
     
    38663866                  }
    38673867
    3868                 printf("renumbering vertices on Bth vertex\n");
     3868                _printLine_("renumbering vertices on Bth vertex");
    38693869                for (i=0;i< NbVertexOnBThVertex;i++)
    38703870                  {
     
    39563956                                number_of_errors++;
    39573957                                if (number_of_errors<20){
    3958                                         printf("Area of Triangle %i < 0 (det=%i)\n",i+1,triangles[i].det);
     3958                                        _printLine_("Area of Triangle " << i+1 << " < 0 (det=" << triangles[i].det << ")");
    39593959                                }
    39603960                        }
     
    40244024        gammamn=sqrt(gammamn);
    40254025        gammamx=sqrt(gammamx);   
    4026         printf("   Adaptmesh info:\n");
    4027         printf("      number of triangles = %i\n",nt);
    4028         printf("      hmin = %g, hmax=%g\n",hmin,hmax);
    4029         printf("      area = %g, M area = %g, M area/( |Khat| nt) = %g\n",area,Marea, Marea/(aireKh*nt));
    4030         printf("      infinite-regularity(?): min = %g, max = %g\n",gammamn,gammamx);
    4031         printf("      anisomax = %g, beta max = %g, min = %g\n",pow(alpha2,0.5),1./pow(beta/aireKh,0.5), 1./pow(beta0/aireKh,0.5));
     4026        _printLine_("   Adaptmesh info:");
     4027        _printLine_("      number of triangles = " << nt);
     4028        _printLine_("      hmin = " << hmin << ", hmax=" << hmax);
     4029        _printLine_("      area = " << area << ", M area = " << Marea << ", M area/( |Khat| nt) = " << Marea/(aireKh*nt));
     4030        _printLine_("      infinite-regularity(?): min = " << gammamn << ", max = " << gammamx);
     4031        _printLine_("      anisomax = " << pow(alpha2,0.5) << ", beta max = " << 1./pow(beta/aireKh,0.5) << ", min = " << 1./pow(beta0/aireKh,0.5));
    40324032}
    40334033/*}}}*/
     
    40634063                        }
    40644064                } 
    4065         printf(" --- Histogram of the unit mesh,  nb of edges = %i\n",nbedges);
    4066         printf("      length of edge in   | %% of edge  | Nb of edges \n");
    4067         printf("      --------------------+-------------+-------------\n");
     4065        _printLine_(" --- Histogram of the unit mesh,  nb of edges = " << nbedges);
     4066        _printLine_("      length of edge in   | %% of edge  | Nb of edges ");
     4067        _printLine_("      --------------------+-------------+-------------");
    40684068        for   (i=0;i<=kmax;i++){
    40694069                if (i==0) _printString_( "      " << setw(10) << 0.);
    40704070                else      _printString_( "      " << setw(10) << exp(lmin+i/delta));
    4071                 if (i==kmax) printf("          +inf   ");
     4071                if (i==kmax) _printString_("          +inf   ");
    40724072                else      _printString_( "      " << setw(10) << exp(lmin+(i+1)/delta));
    40734073                _printLine_("|  " << setw(10) << (long((10000. * histo[i])/ nbedges)/100.) << " |");
    4074                 printf("  %i\n",histo[i]);
    4075         }
    4076         printf("      --------------------+-------------+-------------\n");
     4074                _printLine_("  " << histo[i]);
     4075        }
     4076        _printLine_("      --------------------+-------------+-------------");
    40774077}
    40784078/*}}}*/
     
    41004100        for ( k=0;k<NbVerticesOnGeomEdge;k++ )
    41014101         tstart[ GetId(VerticesOnGeomEdge[k].meshvertex)]=&vide;
    4102         if(verbose>2) printf("   SmoothingVertex: nb Iteration = %i, Omega=%g\n",nbiter,omega);
     4102        if(verbose>2) _printLine_("   SmoothingVertex: nb Iteration = " << nbiter << ", Omega=" << omega);
    41034103        for (k=0;k<nbiter;k++)
    41044104          {
     
    41124112                  if (tstart[i] != &vide) // not a boundary vertex
    41134113                        NbSwap += vertices[i].Optim(1);
    4114                 if (verbose>3) printf("      move max = %g, iteration = %i, nb of swap = %i\n",pow(delta,0.5),k,NbSwap);
     4114                if (verbose>3) _printLine_("      move max = " << pow(delta << ", iteration = " << 0.5) << ", nb of swap = " << k);
    41154115          }
    41164116
     
    41264126
    41274127        if(raisonmax<1.1) return;
    4128         if(verbose > 1) printf("   Mesh::SmoothMetric raisonmax = %g\n",raisonmax);
     4128        if(verbose > 1) _printLine_("   Mesh::SmoothMetric raisonmax = " << raisonmax);
    41294129        CreateSingleVertexToTriangleConnectivity();
    41304130        long i,j,kch,kk,ip;
     
    41924192                Exchange(first_np_or_next_t0,first_np_or_next_t1);
    41934193        }
    4194         if(verbose>2) printf("      number of iterations = %i\n",kch);
     4194        if(verbose>2) _printLine_("      number of iterations = " << kch);
    41954195        delete [] first_np_or_next_t0;
    41964196        delete [] first_np_or_next_t1;
     
    43824382                                                                                ||   (bb=Area2( t[0].r , A.r    , t[2].r )) < 0.0 
    43834383                                                                                ||   (cc=Area2( t[0].r , t[1].r , A.r    )) < 0.0)){
    4384                                                         printf("%i not in triangle %i In= %i %g %g %g %g\n",ke + nbvold,i,!!t.link,aa,bb,cc,dd);
     4384                                                        _printLine_("" << ke + nbvold << " not in triangle " << i << " In= " << !!t.link << " " << aa << " " << bb << " " << cc << " " << dd);
    43854385                                                        _error2_("Number of triangles with P2 interpolation Problem");
    43864386                                                }
     
    43904390                                                                                ||   (bb=Area2( tt[0].r , A.r     , tt[2].r )) < 0
    43914391                                                                                ||   (cc=Area2( tt[0].r , tt[1].r , A.r     )) < 0)){
    4392                                                         printf("%i not in triangle %i In= %i %g %g %g %g\n",ke + nbvold,ii,!!tt.link,aa,bb,cc,dd);
     4392                                                        _printLine_("" << ke + nbvold << " not in triangle " << ii << " In= " << !!tt.link << " " << aa << " " << bb << " " << cc << " " << dd);
    43934393                                                        _error2_("Number of triangles with P2 interpolation Problem");
    43944394                                                }
     
    46854685
    46864686                if (verbose>2){
    4687                         printf("   number of quadrilaterals    = %i\n",nbq);
    4688                         printf("   number of triangles         = %i\n",nbt-nbtout- nbq*2);
    4689                         printf("   number of outside triangles = %i\n",nbtout);
     4687                        _printLine_("   number of quadrilaterals    = " << nbq);
     4688                        _printLine_("   number of triangles         = " << nbt-nbtout- nbq*2);
     4689                        _printLine_("   number of outside triangles = " << nbtout);
    46904690                }
    46914691
     
    47544754                        Triangle *tcvi = TriangleFindFromCoord(vi.i,det3);
    47554755                        if (tcvi && !tcvi->link) {
    4756                                 printf("problem inserting point in SplitInternalEdgeWithBorderVertices (tcvj && !tcvj->link)\n");
     4756                                _printLine_("problem inserting point in SplitInternalEdgeWithBorderVertices (tcvj && !tcvj->link)");
    47574757                        }
    47584758
     
    47674767        }
    47684768        if (verbose>3) {
    4769                 printf("   number of points: %i\n",iv);
    4770                 printf("   number of swap to  split internal edges with border vertices: %i\n",NbSwap);
     4769                _printLine_("   number of points: " << iv);
     4770                _printLine_("   number of swap to  split internal edges with border vertices: " << NbSwap);
    47714771                nbv = iv;
    47724772        }
    47734773}
    4774 if (NbSplitEdge>nbv-nbvold) printf("WARNING: not enough vertices  to split all internal edges, we lost %i edges...\n",NbSplitEdge - ( nbv-nbvold));
    4775 if (verbose>2) printf("SplitInternalEdgeWithBorderVertices: Number of splited edge %i\n",NbSplitEdge);
     4774if (NbSplitEdge>nbv-nbvold) _printLine_("WARNING: not enough vertices  to split all internal edges, we lost " << NbSplitEdge - ( nbv-nbvold) << " edges...");
     4775if (verbose>2) _printLine_("SplitInternalEdgeWithBorderVertices: Number of splited edge " << NbSplitEdge);
    47764776
    47774777return  NbSplitEdge;
     
    49434943
    49444944        //Vertices
    4945         if(verbose) printf("Reading vertices (%i)\n",nbv);
     4945        if(verbose) _printLine_("Reading vertices (" << nbv << ")");
    49464946        for (i=0;i<nbv;i++){
    49474947                vertices[i].r.x=x[i];
     
    52555255
    52565256                //Insert points inside existing triangles
    5257                 if (verbose>4) printf("      -- current number of vertices = %i\n",nbv);
    5258                 if (verbose>3) printf("      Creating initial Constrained Delaunay Triangulation...\n");
    5259                 if (verbose>3) printf("         Inserting boundary points\n");
     5257                if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
     5258                if (verbose>3) _printLine_("      Creating initial Constrained Delaunay Triangulation...");
     5259                if (verbose>3) _printLine_("         Inserting boundary points");
    52605260                Insert();
    52615261
    52625262                //Force the boundary
    5263                 if (verbose>3) printf("         Forcing boundaries\n");
     5263                if (verbose>3) _printLine_("         Forcing boundaries");
    52645264                ForceBoundary();
    52655265
    52665266                //Extract SubDomains
    5267                 if (verbose>3) printf("         Extracting subdomains\n");
     5267                if (verbose>3) _printLine_("         Extracting subdomains");
    52685268                FindSubDomain();
    52695269
    5270                 if (verbose>3) printf("      Inserting internal points\n");
     5270                if (verbose>3) _printLine_("      Inserting internal points");
    52715271                NewPoints(*this,bamgopts,0) ;
    5272                 if (verbose>4) printf("      -- current number of vertices = %i\n",nbv);
     5272                if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
    52735273        }
    52745274        /*}}}*/
     
    53735373                                        int nc=ei.GeomEdgeHook->CurveNumber;
    53745374                                       
    5375                                         //printf("Dealing with curve number %i\n",nc);
    5376                                         //printf("edge on geometry is same as GhCurve? %s\n",(ei.GeomEdgeHook==Gh.curves[nc].FirstEdge || ei.GeomEdgeHook==Gh.curves[nc].LastEdge)?"yes":"no");
     5375                                        //_printLine_("Dealing with curve number " << nc);
     5376                                        //_printLine_("edge on geometry is same as GhCurve? " << (ei.GeomEdgeHook==Gh.curves[nc].FirstEdge || ei.GeomEdgeHook==Gh.curves[nc].LastEdge)?"yes":"no");
    53775377                                        //if(ei.GeomEdgeHook==Gh.curves[nc].FirstEdge || ei.GeomEdgeHook==Gh.curves[nc].LastEdge){
    5378                                         //      printf("Do we have the right extremity? curve first vertex -> %s\n",((GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex])?"yes":"no");
    5379                                         //      printf("Do we have the right extremity? curve last  vertex -> %s\n",((GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex])?"yes":"no");
     5378                                        //      _printLine_("Do we have the right extremity? curve first vertex -> " << ((GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].FirstEdge)[Gh.curves[nc].FirstVertexIndex])?"yes":"no");
     5379                                        //      _printLine_("Do we have the right extremity? curve last  vertex -> " << ((GeomVertex *)*ei[je].GeomEdgeHook==&(*Gh.curves[nc].LastEdge)[Gh.curves[nc].LastVertexIndex])?"yes":"no");
    53805380                                        //}
    53815381                                        //BUG FIX from original bamg
     
    55855585
    55865586                //Insert points inside existing triangles
    5587                 if (verbose>4) printf("      -- current number of vertices = %i\n",nbv);
    5588                 if (verbose>3) printf("      Creating initial Constrained Delaunay Triangulation...\n");
    5589                 if (verbose>3) printf("         Inserting boundary points\n");
     5587                if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
     5588                if (verbose>3) _printLine_("      Creating initial Constrained Delaunay Triangulation...");
     5589                if (verbose>3) _printLine_("         Inserting boundary points");
    55905590                Insert();
    55915591
    55925592                //Force the boundary
    5593                 if (verbose>3) printf("         Forcing boundaries\n");
     5593                if (verbose>3) _printLine_("         Forcing boundaries");
    55945594                ForceBoundary();
    55955595
    55965596                //Extract SubDomains
    5597                 if (verbose>3) printf("         Extracting subdomains\n");
     5597                if (verbose>3) _printLine_("         Extracting subdomains");
    55985598                FindSubDomain();
    55995599
    5600                 if (verbose>3) printf("      Inserting internal points\n");
     5600                if (verbose>3) _printLine_("      Inserting internal points");
    56015601                NewPoints(BTh,bamgopts,KeepVertices) ;
    5602                 if (verbose>4) printf("      -- current number of vertices = %i\n",nbv);
     5602                if (verbose>4) _printLine_("      -- current number of vertices = " << nbv);
    56035603        }
    56045604        /*}}}*/
  • issm/trunk-jpl/src/c/objects/Bamg/Metric.cpp

    r12493 r12509  
    7272        void Metric::Echo(void){
    7373
    74                 printf("Metric:\n");
    75                 printf("   [a11 a21 a22]: [%g %g %g]\n",a11,a21,a22);
     74                _printLine_("Metric:");
     75                _printLine_("   [a11 a21 a22]: [" << a11 << " " << a21 << " " << a22 << "]");
    7676
    7777                return;
     
    201201                LastMetricInterpole.lab=l;
    202202                LastMetricInterpole.opt=i;
    203                 if (i>200 && kkk++<10) printf("WARNING: LengthInterpole: ( i=%i l=%i sss=%g ) %g\n",i,l,sss,sstop);
     203                if (i>200 && kkk++<10) _printLine_("WARNING: LengthInterpole: ( i=" << i << " l=" << l << " sss=" << sss << " ) " << sstop);
    204204                return l;
    205205        }
  • issm/trunk-jpl/src/c/objects/Bamg/Triangle.cpp

    r12493 r12509  
    107107                int i;
    108108
    109                 printf("Triangle:\n");
    110                 printf("   vertices pointer towards three vertices\n");
    111                 printf("      vertices[0] vertices[1] vertices[2] = %p %p %p\n",vertices[0],vertices[1],vertices[2]);
    112                 printf("   adj pointer towards three adjacent triangles\n");
    113                 printf("      adj[0] adj[1] adj[2] = %p %p %p\n",adj[0],adj[1],adj[2]);
    114                 printf("   det (integer triangle determinant) = %i\n",det);
     109                _printLine_("Triangle:");
     110                _printLine_("   vertices pointer towards three vertices");
     111                _printLine_("      vertices[0] vertices[1] vertices[2] = " << vertices[0] << " " << vertices[1] << " " << vertices[2]);
     112                _printLine_("   adj pointer towards three adjacent triangles");
     113                _printLine_("      adj[0] adj[1] adj[2] = " << adj[0] << " " << adj[1] << " " << adj[2]);
     114                _printLine_("   det (integer triangle determinant) = " << det);
    115115                if (link){
    116                         printf("   link (pointer toward duplicate triangle)= %p\n",link);
     116                        _printLine_("   link (pointer toward duplicate triangle)= " << link);
    117117                }
    118118                else{
    119                         printf("   color = %i\n",color);
    120                 }
    121 
    122                 printf("\nThree vertices:\n");
     119                        _printLine_("   color = " << color);
     120                }
     121
     122                _printLine_("\nThree vertices:");
    123123                for(i=0;i<3;i++){
    124124                        if (vertices[i]){
     
    126126                        }
    127127                        else{
    128                                 printf("   vertex %i does not exist\n",i+1);
     128                                _printLine_("   vertex " << i+1 << " does not exist");
    129129                        }
    130130                }
Note: See TracChangeset for help on using the changeset viewer.