Changeset 6322


Ignore:
Timestamp:
10/15/10 11:58:26 (15 years ago)
Author:
Mathieu Morlighem
Message:

New ISSMPRINTF macro behaves like displaystring

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

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/include/macros.h

    r4518 r6322  
    1616/*}}}*/
    1717
    18 /*Printing macro: call MPI_Barrier in debugging mode so that prints are synchronized*/
     18/* _printf_ {{{1*/
     19/*Printing macro: only cpu number 0 */
    1920#define _printf_(...) PrintfFunction(__VA_ARGS__)
    20 
     21/*}}}*/
     22/* ISSMPRINTF {{{1*/
     23/*Printing macro with flag*/
     24#define ISSMPRINTF(flag,...) if(flag) PrintfFunction(__VA_ARGS__)
     25/*}}}*/
     26/* ISSMERROR {{{1*/
    2127/*Error exception macro*/
    2228#ifdef _INTEL_WIN_
     
    2733  throw ErrorException(__FILE__,__func__,__LINE__,exprintf(__VA_ARGS__))
    2834#endif
    29 
     35/*}}}*/
     36/* ISSMASSERT {{{1*/
    3037/*Assertion macro: do nothing if macro _ISSM_DEBUG_ undefined*/
    3138#ifdef _ISSM_DEBUG_
     
    3643  ((void) 0)
    3744#endif
    38 
     45/*}}}*/
     46/* MODULEBOOT/MODULEEND {{{1*/
    3947/*The following macros hide the error exception handling in a matlab module. Just put
    4048 * MODULEBOOT(); and MODULEEND(); at the beginning and end of a module, and c++ exceptions
     
    7078        }
    7179#endif
    72 
     80/*}}}*/
    7381
    7482#endif
  • issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp

    r6305 r6322  
    4242                analysis_type=analysis_type_list[i];
    4343       
    44                 if (VerbModProc()) _printf_("   create datasets for analysis %s\n",EnumToString(analysis_type));
     44                ISSMPRINTF(VerboseMProcessor(),"   create datasets for analysis %s\n",EnumToString(analysis_type));
    4545                CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,&parameters,iomodel,IOMODEL,solution_type,analysis_type,nummodels,i);
    4646        }
  • issm/trunk/src/c/objects/FemModel.cpp

    r6305 r6322  
    4848        for(i=0;i<nummodels;i++){
    4949
    50                 if(VerbModProc()) _printf_("   Processing finite element model of analysis %s:\n",EnumToString(analysis_type_list[i]));
     50                printf("\n");
     51                ISSMPRINTF(VerboseMProcessor(),"   Processing finite element model of analysis %s:\n",EnumToString(analysis_type_list[i]));
    5152                analysis_type=analysis_type_list[i];
    5253                this->SetCurrentConfiguration(analysis_type);
    5354       
    5455                if(i==0){
    55                         if(VerbModProc()) _printf_("      create vertex degrees of freedom\n");
     56                        ISSMPRINTF(VerboseMProcessor(),"      create vertex degrees of freedom\n");
    5657                        VerticesDofx(vertices,parameters); //only call once, we only have one set of vertices
    5758                }
    5859
    59                 if(VerbModProc()) _printf_("      resolve node constraints\n");
     60                ISSMPRINTF(VerboseMProcessor(),"      resolve node constraints\n");
    6061                SpcNodesx(nodes,constraints,analysis_type);
    6162       
    62                 if(VerbModProc()) _printf_("      create nodal degrees of freedom\n");
     63                ISSMPRINTF(VerboseMProcessor(),"      create nodal degrees of freedom\n");
    6364                NodesDofx(nodes,parameters,analysis_type);
    6465       
    65                 if(VerbModProc()) _printf_("      create nodal constraints vector\n");
     66                ISSMPRINTF(VerboseMProcessor(),"      create nodal constraints vector\n");
    6667                CreateNodalConstraintsx(&m_ys[i],nodes,analysis_type);
    6768
    68                 if(VerbModProc()) _printf_("      create node sets\n");
     69                ISSMPRINTF(VerboseMProcessor(),"      create node sets\n");
    6970                BuildNodeSetsx(&m_nodesets[i], nodes,analysis_type);
    7071
    71                 if(VerbModProc()) _printf_("      configuring element and loads\n");
     72                ISSMPRINTF(VerboseMProcessor(),"      configuring element and loads\n");
    7273                ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters);
    7374        }
  • issm/trunk/src/c/solutions/convergence.cpp

    r6305 r6322  
    4444
    4545        /*Display solver caracteristics*/
    46         if (VerbConverge()){
     46        if (VerboseConvergence()){
    4747
    4848                //compute KUF = KU - F = K*U - F
     
    8080        //print
    8181        if(res<eps_res){
    82                 if (VerbConverge()) _printf_("%-50s%g%s%g%s\n","   mechanical equilibrium convergence criterion",res*100," < ",eps_res*100," %");
     82                ISSMPRINTF(VerboseConvergence(),"%-50s%g%s%g%s\n","   mechanical equilibrium convergence criterion",res*100," < ",eps_res*100," %");
    8383                converged=1;
    8484        }
    8585        else{
    86                 if (VerbConverge()) _printf_("%-50s%g%s%g%s\n","   mechanical equilibrium convergence criterion",res*100," > ",eps_res*100," %");
     86                ISSMPRINTF(VerboseConvergence(),"%-50s%g%s%g%s\n","   mechanical equilibrium convergence criterion",res*100," > ",eps_res*100," %");
    8787                converged=0;
    8888        }
    8989
    9090        /*Relative criterion (optional)*/
    91         if (!isnan(eps_rel) || (VerbConverge())){
     91        if (!isnan(eps_rel) || (VerboseConvergence())){
    9292
    9393                //compute norm(du)/norm(u)
     
    103103                if (!isnan(eps_rel)){
    104104                        if((ndu/nu)<eps_rel){
    105                                 if (VerbConverge()) _printf_("%-50s%g%s%g%s\n","   Convergence criterion: norm(du)/norm(u)",ndu/nu*100," < ",eps_rel*100," %");
     105                                ISSMPRINTF(VerboseConvergence(),"%-50s%g%s%g%s\n","   Convergence criterion: norm(du)/norm(u)",ndu/nu*100," < ",eps_rel*100," %");
    106106                        }
    107107                        else{
    108                                 if (VerbConverge()) _printf_("%-50s%g%s%g%s\n","   Convergence criterion: norm(du)/norm(u)",ndu/nu*100," > ",eps_rel*100," %");
     108                                ISSMPRINTF(VerboseConvergence(),"%-50s%g%s%g%s\n","   Convergence criterion: norm(du)/norm(u)",ndu/nu*100," > ",eps_rel*100," %");
    109109                                converged=0;
    110110                        }
     
    115115
    116116        /*Absolute criterion (Optional) = max(du)*/
    117         if (!isnan(eps_abs) || (VerbConverge())){
     117        if (!isnan(eps_abs) || (VerboseConvergence())){
    118118
    119119                //compute max(du)
     
    128128                if (!isnan(eps_abs)){
    129129                        if ((nduinf*yts)<eps_abs){
    130                                 if (VerbConverge()) _printf_("%-50s%g%s%g%s\n","   Convergence criterion: max(du)",nduinf*yts," < ",eps_abs," m/yr");
     130                                ISSMPRINTF(VerboseConvergence(),"%-50s%g%s%g%s\n","   Convergence criterion: max(du)",nduinf*yts," < ",eps_abs," m/yr");
    131131                        }
    132132                        else{
    133                                 if (VerbConverge()) _printf_("%-50s%g%s%g%s\n","   Convergence criterion: max(du)",nduinf*yts," > ",eps_abs," m/yr");
     133                                ISSMPRINTF(VerboseConvergence(),"%-50s%g%s%g%s\n","   Convergence criterion: max(du)",nduinf*yts," > ",eps_abs," m/yr");
    134134                                converged=0;
    135135                        }
Note: See TracChangeset for help on using the changeset viewer.