Ignore:
Timestamp:
03/24/10 16:53:27 (15 years ago)
Author:
Mathieu Morlighem
Message:

Do not use throw ErrorException -> ISSMERROR macro
Removed all FUNCT definitions (now useless)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Param.cpp

    r2913 r3332  
    2020/*Object constructors and destructor*/
    2121/*FUNCTION Param::constructor {{{1*/
    22 #undef __FUNCT__
    23 #define __FUNCT__  "Param constructor"
    2422Param::Param(int param_id, char* param_name, int param_type){
    2523
     
    3028                (param_type!=DOUBLEVEC) & (param_type!=DOUBLEMAT) & (param_type!=PETSCVEC) & (param_type!=PETSCMAT)
    3129                ){
    32                 throw ErrorException(__FUNCT__,exprintf("%s%i"," unknow parameter type ",param_type));
     30                ISSMERROR(exprintf("%s%i"," unknow parameter type ",param_type));
    3331        }
    3432        stringarray=NULL;
     
    9492
    9593                default:
    96                         throw ErrorException(__FUNCT__,exprintf("%s%i","unknow parameter type ",type));
     94                        ISSMERROR(exprintf("%s%i","unknow parameter type ",type));
    9795        }
    9896}
     
    212210
    213211                default:
    214                         throw ErrorException(__FUNCT__,exprintf("%s%i","unknown parameter type",type));
     212                        ISSMERROR(exprintf("%s%i","unknown parameter type",type));
    215213        }
    216214
     
    221219/*}}}*/
    222220/*FUNCTION Param::Marshall {{{1*/
    223 #undef __FUNCT__
    224 #define __FUNCT__ "Marshall"
    225221
    226222void  Param::Marshall(char** pmarshalled_dataset){
     
    315311               
    316312                default:
    317                         throw ErrorException(__FUNCT__,exprintf("%s%i","unknown parameter type",type));
     313                        ISSMERROR(exprintf("%s%i","unknown parameter type",type));
    318314                        break;
    319315        }
     
    370366
    371367                default:
    372                         throw ErrorException(__FUNCT__,exprintf("%s%i","unknown parameter type",type));
     368                        ISSMERROR(exprintf("%s%i","unknown parameter type",type));
    373369        }
    374370
     
    384380/*}}}*/
    385381/*FUNCTION Param::Echo {{{1*/
    386 #undef __FUNCT__
    387 #define __FUNCT__  "Param echo"
    388382void Param::Echo(void){
    389383
     
    436430
    437431                default:
    438                         throw ErrorException(__FUNCT__,exprintf("%s%i","unknow parameter type ",type));
     432                        ISSMERROR(exprintf("%s%i","unknow parameter type ",type));
    439433        }
    440434}
     
    447441/*}}}*/
    448442/*FUNCTION Param::DeepEcho {{{1*/
    449 #undef __FUNCT__
    450 #define __FUNCT__  "Param Deep Echo"
    451443void Param::DeepEcho(void){
    452444
     
    498490
    499491                default:
    500                         throw ErrorException(__FUNCT__,exprintf("%s%i","unknow parameter type ",type));
     492                        ISSMERROR(exprintf("%s%i","unknow parameter type ",type));
    501493        }
    502494}       
     
    521513/*}}}*/
    522514/*FUNCTION Param::GetParameterValue(Mat* pmat) {{{1*/
    523 #undef __FUNCT__
    524 #define __FUNCT__ "GetParameterValue"
    525515
    526516void  Param::GetParameterValue(Mat* pmat){
     
    528518        Mat  outmat=NULL;
    529519       
    530         if(type!=PETSCMAT)  throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a Petsc mat from a param with type",type));
     520        if(type!=PETSCMAT)  ISSMERROR(exprintf("%s%i"," error message: trying to recover a Petsc mat from a param with type",type));
    531521       
    532522        if(mat){
     
    547537/*}}}*/
    548538/*FUNCTION Param::GetParameterValue(double* pdouble) {{{1*/
    549 #undef __FUNCT__
    550 #define __FUNCT__ "GetParameterValue"
    551539void  Param::GetParameterValue(double* pdouble){
    552540
    553         if(type!=DOUBLE)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a double from a param with type",type));
     541        if(type!=DOUBLE)ISSMERROR(exprintf("%s%i"," error message: trying to recover a double from a param with type",type));
    554542        *pdouble=ddouble;
    555543}
    556544/*}}}*/
    557545/*FUNCTION Param::GetParameterValue(int* pinteger) {{{1*/
    558 #undef __FUNCT__
    559 #define __FUNCT__ "GetParameterValue"
    560546void  Param::GetParameterValue(int* pinteger){
    561547       
    562         if(type!=DOUBLE)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover an integer from a param with type",type));
     548        if(type!=DOUBLE)ISSMERROR(exprintf("%s%i"," error message: trying to recover an integer from a param with type",type));
    563549        *pinteger=(int)ddouble;
    564550}
    565551/*}}}*/
    566552/*FUNCTION Param::GetParameterValue(char** pstring) {{{1*/
    567 #undef __FUNCT__
    568 #define __FUNCT__ "GetParameterValue"
    569553void  Param::GetParameterValue(char** pstring){
    570554       
    571555        char*  outstring=NULL;
    572556       
    573         if(type!=STRING)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a string from a param with type",type));
     557        if(type!=STRING)ISSMERROR(exprintf("%s%i"," error message: trying to recover a string from a param with type",type));
    574558        outstring=(char*)xmalloc((strlen(string)+1)*sizeof(char));
    575559        strcpy(outstring,string);
     
    579563/*}}}*/
    580564/*FUNCTION Param::GetParameterValue(char*** pstringarray) {{{1*/
    581 #undef __FUNCT__
    582 #define __FUNCT__ "GetParameterValue"
    583565void  Param::GetParameterValue(char*** pstringarray){
    584566
    585567        int i;
    586         if(type!=STRINGARRAY)throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a string array from a param with type",type));
     568        if(type!=STRINGARRAY)ISSMERROR(exprintf("%s%i"," error message: trying to recover a string array from a param with type",type));
    587569
    588570        char**  outstringarray=NULL;
     
    597579/*}}}*/
    598580/*FUNCTION Param::GetParameterValue(double** pdoublearray) {{{1*/
    599 #undef __FUNCT__
    600 #define __FUNCT__ "GetParameterValue"
    601581       
    602582void  Param::GetParameterValue(double** pdoublearray){
     
    605585        double* outdoublearray=NULL;
    606586       
    607         if((type!=DOUBLEVEC) & (type!=DOUBLEMAT)) throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a double array from a param with type",type));
     587        if((type!=DOUBLEVEC) & (type!=DOUBLEMAT)) ISSMERROR(exprintf("%s%i"," error message: trying to recover a double array from a param with type",type));
    608588       
    609589        if(type==DOUBLEVEC){
     
    627607/*}}}*/
    628608/*FUNCTION Param::GetParameterValue(Vec* pvec) {{{1*/
    629 #undef __FUNCT__
    630 #define __FUNCT__ "GetParameterValue"
    631609void  Param::GetParameterValue(Vec* pvec){
    632610       
    633611        Vec  outvec=NULL;
    634612       
    635         if(type!=PETSCVEC)  throw ErrorException(__FUNCT__,exprintf("%s%i"," error message: trying to recover a Petsc vec from a param with type",type));
     613        if(type!=PETSCVEC)  ISSMERROR(exprintf("%s%i"," error message: trying to recover a Petsc vec from a param with type",type));
    636614
    637615        if(vec){
     
    657635/*}}}*/
    658636/*FUNCTION Param::SetDouble(double value) {{{1*/
    659 #undef __FUNCT__
    660 #define __FUNCT__ "SetDouble"
    661637void  Param::SetDouble(double value){
    662         if (type!=DOUBLE) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set double for type",type));
     638        if (type!=DOUBLE) ISSMERROR(exprintf("%s%i"," trying to set double for type",type));
    663639        ddouble=value;
    664640}
    665641/*}}}*/
    666642/*FUNCTION Param::SetDouble(int value) {{{1*/
    667 #undef __FUNCT__
    668 #define __FUNCT__ "SetDouble"
    669643void  Param::SetDouble(int value){
    670         if (type!=DOUBLE) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set double for type",type));
     644        if (type!=DOUBLE) ISSMERROR(exprintf("%s%i"," trying to set double for type",type));
    671645        ddouble=(double)value;
    672646}
    673647/*}}}*/
    674648/*FUNCTION Param::SetDoubleMat {{{1*/
    675 #undef __FUNCT__
    676 #define __FUNCT__ "SetDoubleMat"
    677649void  Param::SetDoubleMat(double* value,int pM,int pN){
    678650       
    679         if (type!=DOUBLEMAT) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set doublematrix type",type));
     651        if (type!=DOUBLEMAT) ISSMERROR(exprintf("%s%i"," trying to set doublematrix type",type));
    680652
    681653        this->M=pM;
     
    688660/*}}}*/
    689661/*FUNCTION Param::SetDoubleVec(double* value,int size) {{{1*/
    690 #undef __FUNCT__
    691 #define __FUNCT__ "SetDoubleVec"
    692662void  Param::SetDoubleVec(double* value,int size){
    693         if (type!=DOUBLEVEC) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set doublevecfor type",type));
     663        if (type!=DOUBLEVEC) ISSMERROR(exprintf("%s%i"," trying to set doublevecfor type",type));
    694664       
    695665        M=size;
     
    706676/*}}}*/
    707677/*FUNCTION Param::SetDoubleVec(double* value,int size, int numberofdofs) {{{1*/
    708 #undef __FUNCT__
    709 #define __FUNCT__ "SetDoubleVec"
    710678void  Param::SetDoubleVec(double* value,int size, int numberofdofs){
    711         if (type!=DOUBLEVEC) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set doublevecfor type",type));
     679        if (type!=DOUBLEVEC) ISSMERROR(exprintf("%s%i"," trying to set doublevecfor type",type));
    712680       
    713681        M=size;
     
    720688/*}}}*/
    721689/*FUNCTION Param::SetString {{{1*/
    722 #undef __FUNCT__
    723 #define __FUNCT__ "SetString"
    724690void  Param::SetString(char* value){
    725         if (type!=STRING) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set string for type",type));
     691        if (type!=STRING) ISSMERROR(exprintf("%s%i"," trying to set string for type",type));
    726692        strcpy(string,value);
    727693}
    728694/*}}}*/
    729695/*FUNCTION Param::SetStringArray {{{1*/
    730 #undef __FUNCT__
    731 #define __FUNCT__ "SetStringArray"
    732696void  Param::SetStringArray(char** value,int size){
    733697       
    734698        int i;
    735         if (type!=STRINGARRAY) throw ErrorException(__FUNCT__,exprintf("%s%i"," trying to set string for type",type));
     699        if (type!=STRINGARRAY) ISSMERROR(exprintf("%s%i"," trying to set string for type",type));
    736700        M=size;
    737701        stringarray=(char**)xmalloc(M*sizeof(char*));
     
    744708/*}}}*/
    745709/*FUNCTION Param::SetVec {{{1*/
    746 #undef __FUNCT__
    747 #define __FUNCT__ "SetVec"
    748710void  Param::SetVec(Vec value){
    749711
Note: See TracChangeset for help on using the changeset viewer.