Changeset 1192


Ignore:
Timestamp:
07/01/09 08:09:42 (15 years ago)
Author:
Mathieu Morlighem
Message:

minor: only display interpolation progress number of iterations>=e+9

Location:
issm/trunk/src/c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/InterpFromMesh2dx/InterpFromMesh2dx.cpp

    r1189 r1192  
    1717        int i,j;
    1818        int interpolation_type;
     19        bool debug;
    1920        double area;
    2021        double area_1,area_2,area_3;
     
    2728                throw ErrorException(__FUNCT__,"nothing to be done according to the mesh given in input");
    2829        }
     30
     31        /*Set debug to 1 if there are lots of elements*/
     32        debug=(bool)((double)nels_data*(double)nods_prime >= pow(10,9));
    2933
    3034        /*figure out what kind of interpolation is needed*/
     
    5357
    5458        /*Loop over the elements*/
    55         printf("\n      interpolation progress:   %5.2lf %%",0.0);
     59        if (debug) printf("\n      interpolation progress:   %5.2lf %%",0.0);
    5660        for (i=0;i<nels_data;i++){
    5761
    5862                /*display current iteration*/
    59                 if (fmod(i,100)==0){
    60                         printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100);
    61                 }
     63                if (debug && fmod(i,100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100);
    6264
    6365                /*if there is no point inside the domain, go to next iteration*/
     
    104106                }
    105107        }
    106         printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
     108         if (debug) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
    107109
    108110        /*Assign output pointers:*/
  • issm/trunk/src/c/InterpFromMesh3dx/InterpFromMesh3dx.cpp

    r1189 r1192  
    1717        int i,j;
    1818        int interpolation_type;
     19        bool debug;
    1920        double area;
    2021        double area_1,area_2,area_3;
     
    2829                throw ErrorException(__FUNCT__,"nothing to be done according to the mesh given in input");
    2930        }
     31
     32        /*Set debug to 1 if there are lots of elements*/
     33        debug=(bool)((double)nels_data*(double)nods_prime >= pow(10,9));
    3034
    3135        /*figure out what kind of interpolation is needed*/
     
    5458
    5559        /*Loop over the elements*/
    56         printf("\n      interpolation progress:   %5.2lf %%",0.0);
     60        if (debug) printf("\n      interpolation progress:   %5.2lf %%",0.0);
    5761        for (i=0;i<nels_data;i++){
    5862
    5963                /*display current iteration*/
    60                 if (fmod(i,100)==0){
    61                         printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100);
    62                 }
     64                if (debug && fmod(i,100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100);
    6365
    6466                /*if there is no point inside the domain, go to next iteration*/
     
    114116                }
    115117        }
    116         printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
     118        if (debug) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
    117119
    118120        /*Assign output pointers:*/
Note: See TracChangeset for help on using the changeset viewer.