Changeset 13622


Ignore:
Timestamp:
10/11/12 11:23:47 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: cosmetics, removing all deboule blank lines and indent single white lines correctly

Location:
issm/trunk-jpl/src/c
Files:
288 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Container/Constraints.cpp

    r13604 r13622  
    5454                numberofconstraints=localconstraints;
    5555        #endif
    56        
    5756
    5857        return numberofconstraints;
  • issm/trunk-jpl/src/c/Container/DataSet.cpp

    r13056 r13622  
    3030/*FUNCTION DataSet::DataSet(){{{*/
    3131DataSet::DataSet(){
    32        
     32
    3333        sorted=0;
    3434        sorted_ids=NULL;
     
    4040DataSet::DataSet(int dataset_enum){
    4141        enum_type=dataset_enum;
    42        
     42
    4343        sorted=0;
    4444        sorted_ids=NULL;
     
    130130void DataSet::DeepEcho(){
    131131
    132 
    133132        vector<Object*>::iterator object;
    134133
  • issm/trunk-jpl/src/c/Container/Elements.cpp

    r13612 r13622  
    6565/*FUNCTION Elements::DeleteResults{{{*/
    6666void Elements::DeleteResults(void){
    67        
     67
    6868        for (int i=0;i<this->Size();i++){
    6969                Element* element=(Element*)this->GetObjectByOffset(i);
     
    108108         * We will use the Patch object, which will store all of the information needed, and will be able
    109109         * to output itself to disk on its own. See object/Patch.h for format of this object.*/
    110        
     110
    111111        /*First, determine maximum number of vertices, nodes, and number of results: */
    112112        numrows=0;
     
    167167
    168168        int i;
    169        
     169
    170170        int my_rank;
    171171        int num_procs;
     
    184184        int    rank;
    185185        int    minrank;
    186        
     186
    187187        /*recover my_rank:*/
    188188        my_rank=IssmComm::GetRank();
  • issm/trunk-jpl/src/c/Container/Inputs.cpp

    r13056 r13622  
    207207/*FUNCTION Inputs::ConstrainMin{{{*/
    208208void  Inputs::ConstrainMin(int constrain_enum, IssmDouble minimum){
    209            
     209
    210210        Input* constrain_input=NULL;
    211211        /*Find x and y inputs: */
     
    407407/*FUNCTION Inputs::AXPY{{{*/
    408408void  Inputs::AXPY(int MeshYEnum, IssmDouble scalar, int MeshXEnum){
    409            
     409
    410410        Input* xinput=NULL;
    411411        Input* yinput=NULL;
  • issm/trunk-jpl/src/c/Container/Loads.cpp

    r13604 r13622  
    7070        #endif
    7171
    72 
    7372        return numberofloads;
    7473}
  • issm/trunk-jpl/src/c/Container/Nodes.cpp

    r13612 r13622  
    6666        int* alltruedofs=NULL;
    6767        int  numnodes=0;
    68        
     68
    6969        /*recover my_rank:*/
    7070        my_rank=IssmComm::GetRank();
     
    235235
    236236        int i;
    237        
     237
    238238        int   numdofs=0;
    239239        int   allnumdofs;
     
    271271
    272272        int i;
    273        
     273
    274274        int   numnodes=0;
    275275        int   allnumnodes=0;
     
    326326                /*sid starts at 0*/
    327327                max_sid++;
    328        
     328
    329329                /*return*/
    330330                return max_sid;
     
    337337        int my_rank;
    338338        int        sid;
    339        
     339
    340340        /*recover my_rank:*/
    341341        my_rank=IssmComm::GetRank();
  • issm/trunk-jpl/src/c/Container/Options.cpp

    r13216 r13622  
    4242
    4343        char* name=NULL;
    44        
     44
    4545        vector<Object*>::iterator object;
    4646        Option* option=NULL;
  • issm/trunk-jpl/src/c/Container/Parameters.cpp

    r13425 r13622  
    5353/*FUNCTION Parameters::FindParam(bool* pbool,int enum_type){{{*/
    5454void Parameters::FindParam(bool* pbool,int enum_type){ _assert_(this);
    55        
     55
    5656        vector<Object*>::iterator object;
    5757        Param* param=NULL;
     
    7070/*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{*/
    7171void Parameters::FindParam(int* pinteger,int enum_type){ _assert_(this);
    72        
     72
    7373        vector<Object*>::iterator object;
    7474        Param* param=NULL;
     
    8787/*FUNCTION Parameters::FindParam(IssmDouble* pscalar, int enum_type){{{*/
    8888void Parameters::FindParam(IssmDouble* pscalar, int enum_type){ _assert_(this);
    89        
     89
    9090        vector<Object*>::iterator object;
    9191        Param* param=NULL;
     
    121121/*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{*/
    122122void Parameters::FindParam(char** pstring,int enum_type){ _assert_(this);
    123        
     123
    124124        vector<Object*>::iterator object;
    125125        Param* param=NULL;
     
    139139/*FUNCTION Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){{{*/
    140140void Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){ _assert_(this);
    141        
     141
    142142        vector<Object*>::iterator object;
    143143        Param* param=NULL;
     
    229229/*FUNCTION Parameters::FindParam(IssmDouble*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){{{*/
    230230void Parameters::FindParam(IssmDouble*** parray,int* pM,int** pmdims_array,int** pndims_array,int enum_type){ _assert_(this);
    231        
     231
    232232        vector<Object*>::iterator object;
    233233        Param* param=NULL;
     
    246246/*FUNCTION Parameters::FindParam(Vector<IssmDouble>** pvec,int enum_type){{{*/
    247247void Parameters::FindParam(Vector<IssmDouble>** pvec,int enum_type){ _assert_(this);
    248        
     248
    249249        vector<Object*>::iterator object;
    250250        Param* param=NULL;
     
    264264/*FUNCTION Parameters::FindParam(Matrix<IssmDouble>** pmat,int enum_type){{{*/
    265265void Parameters::FindParam(Matrix<IssmDouble>** pmat,int enum_type){ _assert_(this);
    266        
     266
    267267        vector<Object*>::iterator object;
    268268        Param* param=NULL;
     
    320320
    321321        Param* param=NULL;
    322        
     322
    323323        /*first, figure out if the param has already been created: */
    324324        param=(Param*)this->FindParamObject(enum_type);
     
    332332
    333333        Param* param=NULL;
    334        
     334
    335335        /*first, figure out if the param has already been created: */
    336336        param=(Param*)this->FindParamObject(enum_type);
     
    344344
    345345        Param* param=NULL;
    346        
     346
    347347        /*first, figure out if the param has already been created: */
    348348        param=(Param*)this->FindParamObject(enum_type);
     
    356356
    357357        Param* param=NULL;
    358        
     358
    359359        /*first, figure out if the param has already been created: */
    360360        param=(Param*)this->FindParamObject(enum_type);
     
    368368
    369369        Param* param=NULL;
    370        
     370
    371371        /*first, figure out if the param has already been created: */
    372372        param=(Param*)this->FindParamObject(enum_type);
     
    380380
    381381        Param* param=NULL;
    382        
     382
    383383        /*first, figure out if the param has already been created: */
    384384        param=(Param*)this->FindParamObject(enum_type);
     
    392392
    393393        Param* param=NULL;
    394        
     394
    395395        /*first, figure out if the param has already been created: */
    396396        param=(Param*)this->FindParamObject(enum_type);
     
    428428
    429429        Param* param=NULL;
    430        
     430
    431431        /*first, figure out if the param has already been created: */
    432432        param=(Param*)this->FindParamObject(enum_type);
     
    440440
    441441        Param* param=NULL;
    442        
     442
    443443        /*first, figure out if the param has already been created: */
    444444        param=(Param*)this->FindParamObject(enum_type);
  • issm/trunk-jpl/src/c/Container/Results.cpp

    r12365 r13622  
    6666/*FUNCTION Results::Write{{{*/
    6767void Results::Write(Parameters* parameters){
    68        
     68
    6969        int         i;
    7070        FILE       *fid          = NULL;
  • issm/trunk-jpl/src/c/Container/Vertices.cpp

    r13612 r13622  
    4949        int *truepids    = NULL;
    5050        int *alltruepids = NULL;
    51        
     51
    5252        /*recover my_rank:*/
    5353        my_rank=IssmComm::GetRank();
     
    119119        int* ranks=NULL;
    120120        int* minranks=NULL;
    121        
     121
    122122        /*recover num_procs:*/
    123123        num_procs=IssmComm::GetSize();
     
    186186        int my_rank;
    187187        int        sid;
    188        
     188
    189189        /*recover my_rank:*/
    190190        my_rank=IssmComm::GetRank();
  • issm/trunk-jpl/src/c/classes/DofIndexing.cpp

    r13413 r13622  
    164164        _printLine_("   ssize: " << ssize);
    165165        _printLine_("   clone: " << clone);
    166        
     166
    167167        _printLine_("   set membership: f,s sets ");
    168168        for(i=0;i<gsize;i++){
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r13616 r13622  
    8888        this->parameters->FindParam(&outbinfilename,OutputFileNameEnum);
    8989        pfclose(output_fid,outbinfilename);
    90        
     90
    9191        /*Write lock file if requested: */
    9292        this->parameters->FindParam(&waitonlock,SettingsWaitonlockEnum);
     
    214214/*FUNCTION FemModel::OutputResults {{{*/
    215215void FemModel::OutputResults(void){
    216        
     216
    217217        _pprintLine_("write results to disk:");
    218218
     
    253253        int solution_type;
    254254        void (*solutioncore)(FemModel*)=NULL; //core solution function pointer
    255        
     255
    256256        _pprintLine_("call computational core:");
    257257
  • issm/trunk-jpl/src/c/classes/Hook.cpp

    r13413 r13622  
    126126                output->offsets = xNew<int>(output->num);
    127127        }
    128        
     128
    129129        for(int i=0;i<output->num;i++){
    130130                output->objects[i] = this->objects[i];
     
    182182/*FUNCTION Hook::delivers{{{*/
    183183Object* Hook::delivers(void){
    184        
     184
    185185        /*first, check that we only have one T object in our object list: */
    186186        if (this->num!=1) _error_("trying to delivery a single hook object when hook holds " << this->num << " objects" << "\n");
  • issm/trunk-jpl/src/c/classes/IoModel.cpp

    r13612 r13622  
    2828        this->independents=NULL;
    2929        this->constants=NULL;
    30        
     30
    3131        this->my_elements=NULL;
    3232        this->my_nodes=NULL;
     
    3434        this->singlenodetoelementconnectivity=NULL;
    3535        this->numbernodetoelementconnectivity=NULL;
    36        
     36
    3737        this->nodecounter=0;
    3838        this->loadcounter=0;
     
    6868        this->singlenodetoelementconnectivity=NULL;
    6969        this->numbernodetoelementconnectivity=NULL;
    70        
     70
    7171        this->nodecounter=0;
    7272        this->loadcounter=0;
     
    205205void IoModel::DeclareIndependents(void){
    206206
    207 
    208207        int         i;
    209208        bool        autodiff                = false;
     
    217216        bool        keep=false;
    218217
    219 
    220218        /*Initialize array detecting whether data[i] is an independent AD mode variable: */
    221219        this->independents=xNew<bool>(MaximumNumberOfEnums);
     
    226224
    227225                this->FetchData(&numberofvertices,MeshNumberofverticesEnum);
    228                
     226
    229227                #ifdef _HAVE_ADOLC_
    230228
     
    266264        else this->independent_objects=NULL;
    267265
    268 
    269266}
    270267/*}}}*/
     
    283280                dataenum=va_arg(ap, int);
    284281                _assert_(dataenum<MaximumNumberOfEnums);
    285                
     282
    286283                /*do not erase independent variables for the AD mode computations!: */
    287284                if (!this->independents[dataenum]) xDelete<IssmDouble>(this->data[dataenum]);
     
    300297
    301298        int my_rank;
    302        
     299
    303300        /*record descriptions; */
    304301        int record_enum;
     
    323320        /*Go find in the binary file, the position of the data we want to fetch: */
    324321        if(my_rank==0){ //cpu 0{{{
    325        
     322
    326323                /*First set FILE* position to the beginning of the file: */
    327324                fseek(this->fid,0,SEEK_SET);
     
    339336                        }
    340337                        else{
    341                        
     338
    342339                                /* Read the record length and the data type code: */
    343340                                fread(&record_length,sizeof(int),1,this->fid);
    344341                                fread(&record_code,sizeof(int),1,this->fid);
    345                                        
     342
    346343                                #ifdef _HAVE_MPI_
    347344                                /*Tell other cpus what we are doing: */
     
    352349                                MPI_Bcast(&record_length,1,MPI_INT,0,IssmComm::GetComm()); 
    353350                                #endif
    354                                
     351
    355352                                switch(record_code){
    356353                                        case 1:
     
    416413                                                        string[0]='\0';
    417414                                                }
    418                                                
     415
    419416                                                /*Add string to parameters: */
    420417                                                this->constants->AddObject(new StringParam(record_enum,string));
     
    478475                                        /*boolean. get it from cpu 0 */
    479476                                        MPI_Bcast(&booleanint,1,MPI_INT,0,IssmComm::GetComm());
    480                                                
     477
    481478                                        /*create BoolParam: */
    482479                                        this->constants->AddObject(new BoolParam(record_enum,(bool)booleanint)); //cast to a boolean
     
    486483                                        /*integer. get it from cpu 0 */
    487484                                        MPI_Bcast(&integer,1,MPI_INT,0,IssmComm::GetComm());
    488                                                
     485
    489486                                        /*create IntParam: */
    490487                                        this->constants->AddObject(new IntParam(record_enum,integer));
     
    494491                                        /*scalar. get it from cpu 0 */
    495492                                        MPI_Bcast(&scalar,1,MPI_DOUBLE,0,IssmComm::GetComm());
    496                                                
     493
    497494                                        /*create DoubleParam: */
    498495                                        this->constants->AddObject(new DoubleParam(record_enum,scalar));
     
    530527                                }
    531528
    532 
    533529                        }
    534530                }
     
    541537
    542538        int my_rank;
    543        
    544539
    545540        /*output: */
    546541        int   booleanint;
    547542        int   code;
    548        
     543
    549544        /*recover my_rank:*/
    550545        my_rank=IssmComm::GetRank();
    551546
    552        
    553547        /*Set file pointer to beginning of the data: */
    554548        fid=this->SetFilePointerToData(&code,NULL,data_enum);
    555549
    556550        if(code!=1)_error_("expecting a boolean for enum " << EnumToStringx(data_enum));
    557        
     551
    558552        /*We have to read a boolean from disk. */
    559553        if(my_rank==0){ 
     
    578572        int   integer;
    579573        int   code;
    580        
     574
    581575        /*recover my_rank:*/
    582576        my_rank=IssmComm::GetRank();
    583        
     577
    584578        /*Set file pointer to beginning of the data: */
    585579        fid=this->SetFilePointerToData(&code,NULL,data_enum);
    586        
     580
    587581        if(code!=2)_error_("expecting an integer for enum " << EnumToStringx(data_enum));
    588        
     582
    589583        /*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */
    590584        if(my_rank==0){ 
     
    603597void  IoModel::FetchData(IssmDouble* pscalar,int data_enum){
    604598
    605 
    606599        int my_rank;
    607        
    608600
    609601        /*output: */
    610602        IssmPDouble   scalar;
    611603        int      code;
    612        
     604
    613605        /*recover my_rank:*/
    614606        my_rank=IssmComm::GetRank();
     
    616608        /*Set file pointer to beginning of the data: */
    617609        fid=this->SetFilePointerToData(&code,NULL,data_enum);
    618        
     610
    619611        if(code!=3)_error_("expecting a IssmDouble for enum " << EnumToStringx(data_enum));
    620        
     612
    621613        /*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */
    622614        if(my_rank==0){
     
    629621        /*Assign output pointers: */
    630622        *pscalar=scalar;
    631                  
     623
    632624}
    633625/*}}}*/
     
    636628
    637629        int my_rank;
    638        
    639630
    640631        /*output: */
     
    642633        int   string_size;
    643634        int code=0;
    644        
     635
    645636        /*recover my_rank:*/
    646637        my_rank=IssmComm::GetRank();
     
    648639        /*Set file pointer to beginning of the data: */
    649640        fid=this->SetFilePointerToData(&code,NULL,data_enum);
    650        
     641
    651642        if(code!=4)_error_("expecting a string for enum " << EnumToStringx(data_enum));
    652        
     643
    653644        /*Now fetch: */
    654        
     645
    655646        /*We have to read a string from disk. First read the dimensions of the string, then the string: */
    656647        if(my_rank==0){ 
     
    679670                string[0]='\0';
    680671        }
    681 
    682672
    683673        /*Assign output pointers: */
     
    697687        int code=0;
    698688        int vector_type=0;
    699        
     689
    700690        /*recover my_rank:*/
    701691        my_rank=IssmComm::GetRank();
     
    705695
    706696        if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
    707        
     697
    708698        /*Now fetch: */
    709699
     
    733723                        if(fread(matrix,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
    734724                }
    735                
     725
    736726                #ifdef _HAVE_MPI_
    737727                MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,IssmComm::GetComm());
     
    771761        int code=0;
    772762        int vector_type=0;
    773        
     763
    774764        /*recover my_rank:*/
    775765        my_rank=IssmComm::GetRank();
     
    778768        fid=this->SetFilePointerToData(&code,&vector_type,data_enum);
    779769        if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));
    780        
     770
    781771        /*Now fetch: */
    782772
     
    832822
    833823        int my_rank;
    834        
     824
    835825        int i;
    836826
     
    838828        int   numstrings=0;
    839829        char** strings=NULL;
    840        
     830
    841831        /*intermediary: */
    842832        char* string=NULL;
    843833        int   string_size;
    844834        int   code;
    845        
     835
    846836        /*recover my_rank:*/
    847837        my_rank=IssmComm::GetRank();
     
    849839        /*Set file pointer to beginning of the data: */
    850840        fid=this->SetFilePointerToData(&code,NULL,data_enum);
    851        
     841
    852842        if(code!=9)_error_("expecting a string array for enum " << EnumToStringx(data_enum));
    853        
     843
    854844        /*We have to read a bunch of strings from disk. First read the number of strings, and allocate: */
    855845        if(my_rank==0){ 
     
    867857                /*Go through strings, and read: */
    868858                for(i=0;i<numstrings;i++){
    869                        
     859
    870860                        if(my_rank==0){ 
    871861                                if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string ");
     
    917907        IssmPDouble *matrix = NULL;
    918908        int     code;
    919        
     909
    920910        /*recover my_rank:*/
    921911        my_rank=IssmComm::GetRank();
     
    924914        fid=this->SetFilePointerToData(&code,NULL,data_enum);
    925915        if(code!=8)_error_("expecting a IssmDouble mat array for enum " << EnumToStringx(data_enum));
    926        
     916
    927917        /*Now fetch: */
    928918        if(my_rank==0){ 
     
    1000990        int     code;
    1001991        char   *name        = NULL;
    1002        
     992
    1003993        /*First get option name*/
    1004994        this->FetchData(&name,index);
     
    10511041        /*Go through the entire list of enums and fetch the corresponding data. Add it to the iomodel->data dataset. Everything
    10521042         *we fetch is a IssmDouble* : */
    1053        
     1043
    10541044        va_start(ap,num);
    10551045        for(i=0; i<num; i++){
    1056                
     1046
    10571047                dataenum=va_arg(ap, int);
    1058                
     1048
    10591049                if (this->independents[dataenum]){
    10601050                        /*this data has already been checked out! Continue: */
     
    10951085        int     nel;
    10961086        int     numberofelements;
    1097 
    10981087
    10991088        /*variables being fetched: */
     
    12821271        int        lastindex,index;
    12831272        int        record_length;
    1284        
     1273
    12851274        /*recover my_rank:*/
    12861275        my_rank=IssmComm::GetRank();
  • issm/trunk-jpl/src/c/classes/Patch.cpp

    r13612 r13622  
    119119        MPI_Status  status;
    120120        #endif
    121        
     121
    122122        /*recover my_rank:*/
    123123        my_rank=IssmComm::GetRank();
  • issm/trunk-jpl/src/c/classes/bamg/AdjacentTriangle.cpp

    r12821 r13622  
    88
    99namespace bamg {
    10 
    1110
    1211        /*Constructors/Destructors*/
  • issm/trunk-jpl/src/c/classes/bamg/BamgQuadtree.cpp

    r13530 r13622  
    428428                  }
    429429
    430 
    431430                if ( n0 > 0)
    432431                  { 
  • issm/trunk-jpl/src/c/classes/bamg/EigenMetric.cpp

    r12821 r13622  
    2929                b=-a11-a22;
    3030                delta=b*b - 4*(a11*a22-a21*a21);
    31 
    3231
    3332                /*Compute norm of M to avoid round off errors*/
  • issm/trunk-jpl/src/c/classes/bamg/Geometry.cpp

    r13530 r13622  
    173173                        }
    174174                        delete [] verticeslength;
    175                        
     175
    176176                }
    177177                else{
     
    905905                }
    906906
    907 
    908907                if ((*eg0)(direction0)==(GeomVertex*)vg0)
    909908                 vg0=VertexOnGeom(*(BamgVertex*) vg0,*eg0,direction0); //vg0 = absisce
  • issm/trunk-jpl/src/c/classes/bamg/ListofIntersectionTriangles.cpp

    r13530 r13622  
    319319                                ilast=NewItem(t,ba[0],ba[1],ba[2]); }
    320320                }  //  outside departure
    321 
    322 
    323321
    324322                // recherche the intersection of [a,b] with Bh Mesh.
     
    392390                                Icoor2 detbij = bamg::det((*t)[i],(*t)[j],b);
    393391
    394 
    395392                                if (detbij >= 0) { //we find the triangle contening b
    396393                                        dt[0]=bamg::det((*t)[1],(*t)[2],b);
  • issm/trunk-jpl/src/c/classes/bamg/Mesh.cpp

    r13530 r13622  
    200200                          VertexOnBThEdge=0;
    201201                         }
    202 
    203202
    204203                  if(nbe)
     
    12451244                tt[2]->SetSingleVertexToTriangleConnectivity();
    12461245
    1247 
    12481246                // swap if the point s is on a edge
    12491247                if(izerodet>=0) {
     
    15741572                //initialize subdomains[isd].head as 0
    15751573                for (isd=0;isd<nbsubdomains;isd++) subdomains[isd].head =0;
    1576                  
     1574
    15771575                k=0;
    15781576                for (it=0;it<nbt;it++){
     
    25392537                        delete [] HeapArete;
    25402538                        delete [] HeapTriangle;
    2541 
    25422539
    25432540                        if (OutSide|| !Gh.subdomains || !Gh.nbsubdomains )
     
    26952692                                        nbsubdomains=inew;}
    26962693
    2697 
    26982694                                        for (it=0;it<nbt;it++)
    26992695                                         if ( mark[it] ==-1 )
     
    30753071                        if (verbose>5) _printLine_("   do nothing: costheta > 1");
    30763072                }
    3077 
    30783073
    30793074                        long nbqq = (nbt*3)/2;
     
    42734268                        newedges[ie].adj[1]=newedges + ie +1;
    42744269                        R2 A = edges[i][0],B = edges[i][1];
    4275 
    42764270
    42774271                        kk += (i == edge4->SortAndAdd(GetId(edges[i][0]),GetId(edges[i][1])));
     
    43434337                nbv = k;
    43444338
    4345 
    43464339                kedge = new long[3*nbt+1];
    43474340                ksplitarray = new long[nbt+1];
     
    44124405                                const Triangle & tt = ta;
    44134406
    4414 
    44154407                                const BamgVertex & v0 = t[VerticesOfTriangularEdge[j][0]];
    44164408                                const BamgVertex & v1 = t[VerticesOfTriangularEdge[j][1]];
     
    46484640                  BTh.vertices[i].m =  BTh.vertices[i].m*2.;
    46494641
    4650 
    46514642                ret = 2;
    46524643                if (nbt>= maxnbt) goto Error; // bug
     
    50014992                                _assert_(nbv<maxnbv);
    50024993                                vertices[nbv]=Gh[i];
    5003                                
     4994
    50044995                                //Add pointer from geometry (Gh) to vertex from mesh (Th)
    50054996                                Gh[i].MeshVertexHook=vertices+nbv;
     
    51965187                                                                                va = vb;
    51975188                                                                        }
    5198                                                                        
     5189
    51995190                                                                        /*We just added one edge to the curve: Go to the next one*/
    52005191                                                                        lcurve = lcurveb;
     
    53715362                                        /*Get curve number*/
    53725363                                        int nc=ei.GeomEdgeHook->CurveNumber;
    5373                                        
     5364
    53745365                                        //_printLine_("Dealing with curve number " << nc);
    53755366                                        //_printLine_("edge on geometry is same as GhCurve? " << (ei.GeomEdgeHook==Gh.curves[nc].FirstEdge || ei.GeomEdgeHook==Gh.curves[nc].LastEdge)?"yes":"no");
     
    54195410                                /*Get edge of Bth with index iedge*/
    54205411                                Edge &ei = BTh.edges[iedge];
    5421                        
     5412
    54225413                                /*Initialize variables*/
    54235414                                double Lstep=0,Lcurve=0;    // step between two points   (phase==1)
     
    55365527                                                }// for(;;) end of the curve
    55375528                                        }
    5538 
    55395529
    55405530                                        if (phase){ // construction of the last edge
     
    57875777                BamgVertex & s2= (*t2)[OppositeVertex[a2]];
    57885778
    5789 
    57905779                Icoor2 dets2 = det(*pva,*pvb,s2);
    57915780                Icoor2 det1=t1->det , det2=t2->det ;
  • issm/trunk-jpl/src/c/classes/bamg/Metric.cpp

    r13036 r13622  
    1616        /*FUNCTION Metric::Metric(double a){{{*/
    1717        Metric::Metric(double a): a11(1/(a*a)),a21(0),a22(1/(a*a)){
    18        
     18
    1919        }/*}}}*/
    2020        /*FUNCTION Metric::Metric(double a,double b,double c){{{*/
    2121        Metric::Metric(double a,double b,double c) :a11(a),a21(b),a22(c){
    22        
     22
    2323        }/*}}}*/
    2424        /*FUNCTION Metric::Metric(const double  a[3],const  Metric& m0, const  Metric& m1,const  Metric&  m2 ){{{*/
  • issm/trunk-jpl/src/c/classes/bamg/Triangle.cpp

    r13530 r13622  
    424424                                                                         sinb12 = double(det2),
    425425                                                                         sinba2 = double(t2->det);
    426 
    427426
    428427                                                 // angle b12 > angle ba2 => cotg(angle b12) < cotg(angle ba2)
  • issm/trunk-jpl/src/c/classes/bamg/VertexOnVertex.cpp

    r12821 r13622  
    1717        /*FUNCTION VertexOnVertex::VertexOnVertex(BamgVertex * w,BamgVertex *bw){{{*/
    1818        VertexOnVertex::VertexOnVertex(BamgVertex * w,BamgVertex *bw) :v(w),bv(bw){
    19        
     19
    2020        }/*}}}*/
    2121
  • issm/trunk-jpl/src/c/classes/dakota/DakotaPlugin.cpp

    r13548 r13622  
    1414 * the entire computations.
    1515 */
    16 
    1716
    1817#ifdef HAVE_CONFIG_H
     
    7776                memcpy(variable_descriptor,label.c_str(),(strlen(label.c_str())+1)*sizeof(char));
    7877
    79                
    8078                variable_descriptors[i]=variable_descriptor;
    8179        }
     
    109107} // namespace SIM
    110108
    111 
    112109#endif //only works if dakota library has been compiled in.
  • issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp

    r13216 r13622  
    230230/*FUNCTION ElementMatrix::~ElementMatrix(){{{*/
    231231ElementMatrix::~ElementMatrix(){
    232        
     232
    233233        xDelete<IssmDouble>(this->values);
    234234        xDelete<int>(this->gglobaldoflist);
     
    278278                }
    279279
    280 
    281280                if((this->row_ssize!=0) && (this->row_fsize!=0)){
    282281                        /*first, retrieve values that are in the f and s-set from the g-set values matrix: */
  • issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp

    r13216 r13622  
    139139        /*fill values with 0: */
    140140        this->values=xNewZeroInit<IssmDouble>(this->nrows);
    141        
     141
    142142        /*g list*/
    143143        this->gglobaldoflist=GetGlobalDofList(nodes,numnodes,GsetEnum,approximation);
     
    151151/*FUNCTION ElementVector::~ElementVector(){{{*/
    152152ElementVector::~ElementVector(){
    153        
     153
    154154        xDelete<IssmDouble>(this->values);
    155155        xDelete<int>(this->gglobaldoflist);
     
    181181                xDelete<IssmDouble>(localvalues);
    182182        }
    183        
     183
    184184}
    185185/*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Constraints/SpcDynamic.cpp

    r13414 r13622  
    4141}
    4242/*}}}*/
    43                
     43
    4444/*Object virtual functions definitions:*/
    4545/*FUNCTION SpcDynamic::Echo {{{*/
     
    111111/*FUNCTION SpcDynamic::GetNodeId {{{*/
    112112int   SpcDynamic::GetNodeId(){
    113        
     113
    114114        return nodeid;
    115115}
  • issm/trunk-jpl/src/c/classes/objects/Constraints/SpcStatic.cpp

    r13414 r13622  
    4040}
    4141/*}}}*/
    42                
     42
    4343/*Object virtual functions definitions:*/
    4444/*FUNCTION SpcStatic::Echo {{{*/
     
    112112/*FUNCTION SpcStatic::GetNodeId {{{*/
    113113int   SpcStatic::GetNodeId(){
    114        
     114
    115115        return nodeid;
    116116}
  • issm/trunk-jpl/src/c/classes/objects/Constraints/SpcTransient.cpp

    r13414 r13622  
    5454}
    5555/*}}}*/
    56                
     56
    5757/*Object virtual functions definitions:*/
    5858/*FUNCTION SpcTransient::Echo {{{*/
     
    9797/*FUNCTION SpcTransient::InAnalysis{{{*/
    9898bool SpcTransient::InAnalysis(int in_analysis_type){
    99        
     99
    100100        if (in_analysis_type==this->analysis_type) return true;
    101101        else return false;
     
    114114        /*Chase through nodes and find the node to which this SpcTransient applys: */
    115115        node=(Node*)nodes->GetObjectById(NULL,nodeid);
    116        
     116
    117117        if(node){ //in case the spc is dealing with a node on another cpu
    118118
     
    159159/*FUNCTION SpcTransient::GetNodeId {{{*/
    160160int   SpcTransient::GetNodeId(){
    161        
     161
    162162        return nodeid;
    163163}
     
    168168}
    169169/*}}}*/
    170 
  • issm/trunk-jpl/src/c/classes/objects/DependentObject.cpp

    r13608 r13622  
    4141}
    4242/*}}}*/
    43 
    4443
    4544/*Object virtual functions definitions:*/
     
    10099                parameters->SetParam(this->index,IndexEnum);
    101100        }
    102        
     101
    103102        ::Responsex(poutput_value,elements,nodes,vertices,loads,materials,parameters,this->name,false,0);
    104103
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp

    r13414 r13622  
    110110/*FUNCTION BoolElementResult::PatchFill{{{*/
    111111void BoolElementResult::PatchFill(int row, Patch* patch){
    112        
     112
    113113         /*Here, we fill the result information into the patch object. First, let's remember what is in a row
    114114          * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp

    r13414 r13622  
    100100/*FUNCTION DoubleElementResult::ProcessUnits{{{*/
    101101void DoubleElementResult::ProcessUnits(Parameters* parameters){
    102        
     102
    103103        this->value=UnitConversion(this->value,IuToExtEnum,this->enum_type);
    104104
     
    112112/*FUNCTION DoubleElementResult::PatchFill{{{*/
    113113void DoubleElementResult::PatchFill(int row, Patch* patch){
    114        
     114
    115115         /*Here, we fill the result information into the patch object. First, let's remember what is in a row
    116116          * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp

    r13414 r13622  
    7070/*FUNCTION PentaP1ElementResult::copy{{{*/
    7171Object* PentaP1ElementResult::copy() {
    72        
     72
    7373        return new PentaP1ElementResult(this->enum_type,this->values,this->step,this->time);
    7474
     
    111111/*FUNCTION PentaP1ElementResult::ProcessUnits{{{*/
    112112void PentaP1ElementResult::ProcessUnits(Parameters* parameters){
    113        
     113
    114114        UnitConversion(this->values,6,IuToExtEnum,this->enum_type);
    115115
     
    123123/*FUNCTION PentaP1ElementResult::PatchFill{{{*/
    124124void PentaP1ElementResult::PatchFill(int row, Patch* patch){
    125        
     125
    126126         /*Here, we fill the result information into the patch object. First, let's remember what is in a row
    127127          * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp

    r13414 r13622  
    4949/*FUNCTION TriaP1ElementResult::DeepEcho{{{*/
    5050void TriaP1ElementResult::DeepEcho(void){
    51                
     51
    5252        _printLine_("TriaP1ElementResult:");
    5353        _printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
     
    6969/*FUNCTION TriaP1ElementResult::copy{{{*/
    7070Object* TriaP1ElementResult::copy() {
    71        
     71
    7272        return new TriaP1ElementResult(this->enum_type,this->values,this->step,this->time);
    7373
     
    9999/*FUNCTION TriaP1ElementResult::ProcessUnits{{{*/
    100100void TriaP1ElementResult::ProcessUnits(Parameters* parameters){
    101        
     101
    102102        UnitConversion(this->values,3,IuToExtEnum,this->enum_type);
    103103
     
    111111/*FUNCTION TriaP1ElementResult::PatchFill{{{*/
    112112void TriaP1ElementResult::PatchFill(int row, Patch* patch){
    113        
     113
    114114         /*Here, we fill the result information into the patch object. First, let's remember what is in a row
    115115          * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
  • issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp

    r13528 r13622  
    8282        this->inputs=new Inputs();
    8383        this->results=new Results();
    84        
     84
    8585        /*initialize pointers:*/
    8686        this->nodes=NULL;
     
    186186        GaussPenta* gauss=NULL;
    187187
    188 
    189188        /* Basal friction can only be found at the base of an ice sheet: */
    190189        if (!IsOnBed() || IsFloating()){
     
    199198        Input* vz_input=inputs->GetInput(VzEnum);                         _assert_(vz_input);
    200199
    201 
    202200        /*Build friction element, needed later: */
    203201        friction=new Friction("3d",inputs,matpar,DiagnosticHorizAnalysisEnum);
     
    216214                count++;
    217215        }
    218        
     216
    219217        /*Create PentaVertex input, which will hold the basal friction:*/
    220218        this->inputs->AddInput(new PentaP1Input(BasalFrictionEnum,&basalfriction[0]));
     
    257255        /*retrieve some parameters: */
    258256        this->parameters->FindParam(&stokesreconditioning,DiagnosticStokesreconditioningEnum);
    259        
     257
    260258        if(!IsOnBed()){
    261259                //put zero
     
    364362                sigma_yz[iv]=2*viscosity*epsilon[5];
    365363        }
    366        
     364
    367365        /*Add Stress tensor components into inputs*/
    368366        this->inputs->AddInput(new PentaP1Input(StressTensorxxEnum,&sigma_xx[0]));
     
    381379
    382380        int analysis_counter;
    383        
     381
    384382        /*go into parameters and get the analysis_counter: */
    385383        parametersin->FindParam(&analysis_counter,AnalysisCounterEnum);
     
    421419        _assert_(this->nodes && this->material && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
    422420        /*}}}*/
    423        
     421
    424422        /*Skip if water element*/
    425423        if(IsOnWater()) return;
     
    652650
    653651        int i;
    654        
     652
    655653        _printLine_("Penta:");
    656654        _printLine_("   id: " << id);
     
    11911189/*FUNCTION Penta::Sid {{{*/
    11921190int    Penta::Sid(){
    1193        
     1191
    11941192        return sid;
    11951193
     
    12511249        /*Check that name is an element input*/
    12521250        if (!IsInput(name)) return;
    1253        
     1251
    12541252        if ((code==5) || (code==1)){ //boolean
    12551253                this->inputs->AddInput(new BoolInput(name,reCast<bool,IssmDouble>(scalar)));
     
    18731871                penta=penta->GetUpperElement(); _assert_(penta->Id()!=this->id);
    18741872        }
    1875        
     1873
    18761874        /*Free ressources:*/
    18771875        xDelete<int>(doflist);
     
    18971895        /*Add input to the element: */
    18981896        this->inputs->AddInput(new PentaP1Input(enum_type,values));
    1899        
     1897
    19001898        /*Free ressources:*/
    19011899        xDelete<int>(doflist);
     
    19371935                penta=penta->GetUpperElement(); _assert_(penta->Id()!=this->id);
    19381936        }
    1939        
     1937
    19401938        /*Free ressources:*/
    19411939        xDelete<int>(doflist);
     
    21702168        rho_ice=matpar->GetRhoIce();
    21712169        density=rho_ice/rho_water;
    2172        
     2170
    21732171        /*go through vertices, and update inputs, considering them to be PentaVertex type: */
    21742172        for(i=0;i<NUMVERTICES;i++){
     
    22112209                }
    22122210        }
    2213        
     2211
    22142212   /*Add basal melting rate if element just ungrounded*/
    22152213        if(!this->IsFloating() && elementonshelf==true){
     
    22932291        /*recover pointer: */
    22942292        count=*pcount;
    2295                
     2293
    22962294        /*will be needed later: */
    22972295        for(i=0;i<6;i++) vertices_ids[i]=nodes[i]->GetVertexId(); //vertices id start at column 3 of the patch.
     
    25022500/*FUNCTION Penta::RequestedOutput{{{*/
    25032501void Penta::RequestedOutput(int output_enum,int step,IssmDouble time){
    2504                        
     2502
    25052503        if(IsInput(output_enum)){
    25062504                /*just transfer this input to results, and we are done: */
     
    26772675        GetInputListOnVertices(&a_neg[0],SurfaceforcingsANegEnum);
    26782676        GetInputListOnVertices(&b_neg[0],SurfaceforcingsBNegEnum);
    2679        
     2677
    26802678   /*Recover surface elevatio at vertices: */
    26812679        GetInputListOnVertices(&h[0],ThicknessEnum);
     
    26852683   rho_ice=matpar->GetRhoIce();
    26862684   rho_water=matpar->GetRhoFreshwater();
    2687                        
     2685
    26882686   // loop over all vertices
    26892687 for(i=0;i<NUMVERTICES;i++){
     
    27912789        minz=xyz_list[0][2];
    27922790        maxz=xyz_list[0][2];
    2793        
     2791
    27942792        for(i=1;i<NUMVERTICES;i++){
    27952793                if (xyz_list[i][0]<minx)minx=xyz_list[i][0];
     
    29732971                if (reCast<bool,IssmDouble>(vertices_potentially_ungrounding[nodes[i]->Sid()])){
    29742972                        vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
    2975                
     2973
    29762974                        /*If node was not on ice shelf, we flipped*/
    29772975                        if(nodes_on_iceshelf[nodes[i]->Sid()]==0){
     
    30133011        for (int iv=0;iv<NUMVERTICES;iv++){
    30143012                gauss->GaussVertex(iv);
    3015                
     3013
    30163014                thickness_input->GetInputValue(&thickness,gauss);
    30173015
     
    30193017                material->GetViscosity3dStokes(&viscosity,&epsilon[0]);
    30203018                GetPhi(&phi, &epsilon[0], viscosity);
    3021                
    30223019
    30233020                viscousheating[iv]=phi*thickness;
     
    32743271
    32753272        if(IsOnWater() || !IsOnSurface()) return 0.;
    3276        
     3273
    32773274        GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
    32783275
     
    32863283        smb_input->GetInputAverage(&smb);
    32873284        Total_Smb=rho_ice*base*smb;// smb on element in kg s-1
    3288        
     3285
    32893286        /*Process units: */
    32903287        Total_Smb=UnitConversion(Total_Smb,IuToExtEnum,TotalSmbEnum);// smb on element in GigaTon yr-1
    3291        
     3288
    32923289        /*Return: */
    32933290        return Total_Smb;
     
    32993296/*FUNCTION Penta::CreateKMatrixEnthalpy {{{*/
    33003297ElementMatrix* Penta::CreateKMatrixEnthalpy(void){
    3301        
     3298
    33023299        /*compute all stiffness matrices for this element*/
    33033300        ElementMatrix* Ke1=CreateKMatrixEnthalpyVolume();
    33043301        ElementMatrix* Ke2=CreateKMatrixEnthalpyShelf();
    33053302        ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
    3306        
     3303
    33073304        /*clean-up and return*/
    33083305        delete Ke1;
     
    35043501
    35053502                gauss->GaussPoint(ig);
    3506                
     3503
    35073504                GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
    35083505                GetNodalFunctionsP1(&basis[0], gauss);
    3509                                
     3506
    35103507                D_scalar=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(rho_ice*heatcapacity);
    35113508                if(reCast<bool,IssmDouble>(dt)) D_scalar=dt*D_scalar;
     
    35163513                                        &Ke->values[0],1);
    35173514        }
    3518        
     3515
    35193516        /*Clean up and return*/
    35203517        delete gauss;
     
    35363533/*FUNCTION Penta::CreateKMatrixThermal {{{*/
    35373534ElementMatrix* Penta::CreateKMatrixThermal(void){
    3538        
     3535
    35393536        /*compute all stiffness matrices for this element*/
    35403537        ElementMatrix* Ke1=CreateKMatrixThermalVolume();
    35413538        ElementMatrix* Ke2=CreateKMatrixThermalShelf();
    35423539        ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
    3543        
     3540
    35443541        /*clean-up and return*/
    35453542        delete Ke1;
     
    37033700ElementMatrix* Penta::CreateKMatrixThermalShelf(void){
    37043701
    3705 
    37063702        /*Constants*/
    37073703        const int    numdof=NDOF1*NUMVERTICES;
     
    37373733
    37383734                gauss->GaussPoint(ig);
    3739                
     3735
    37403736                GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
    37413737                GetNodalFunctionsP1(&basis[0], gauss);
    3742                                
     3738
    37433739                D_scalar=gauss->weight*Jdet2d*rho_water*mixed_layer_capacity*thermal_exchange_velocity/(heatcapacity*rho_ice);
    37443740                if(reCast<bool,IssmDouble>(dt)) D_scalar=dt*D_scalar;
     
    37493745                                        &Ke->values[0],1);
    37503746        }
    3751        
     3747
    37523748        /*Clean up and return*/
    37533749        delete gauss;
     
    44094405        GetInputListOnVertices(&pressure[0],PressureEnum);
    44104406        Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_input);
    4411        
     4407
    44124408        this->inputs->GetInputValue(&converged,ConvergedEnum);
    44134409        if(converged){
     
    44184414                        //if(waterfraction[i]>1) _error_("Water fraction >1 found in solution vector");
    44194415                }
    4420                        
     4416
    44214417                this->inputs->AddInput(new PentaP1Input(EnthalpyEnum,values));
    44224418                this->inputs->AddInput(new PentaP1Input(WaterfractionEnum,waterfraction));
     
    44734469                input=(Input*)material->inputs->GetInput(MaterialsRheologyZEnum);
    44744470        }
    4475                
     4471
    44764472        else{
    44774473                input=inputs->GetInput(enum_type);
     
    55335529        new_input = new PentaP1Input(control_enum,values);
    55345530
    5535 
    55365531        if(control_enum==MaterialsRheologyBbarEnum){
    55375532                input=(Input*)material->inputs->GetInput(control_enum); _assert_(input);
     
    55535548/*FUNCTION Penta::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);{{{*/
    55545549void  Penta::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
    5555        
     5550
    55565551        int i,j;
    55575552
     
    55805575                                        IssmDouble  surface[6];
    55815576                                        IssmDouble  bed[6];
    5582                                        
     5577
    55835578                                        /*retrieve inputs: */
    55845579                                        GetInputListOnVertices(&thickness_init[0],ThicknessEnum);
     
    56655660/*FUNCTION Penta::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type);{{{*/
    56665661void  Penta::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
    5667        
     5662
    56685663        int i,j,t;
    56695664        TransientInput* transientinput=NULL;
     
    56795674
    56805675                case VertexEnum:
    5681                        
     5676
    56825677                        /*Create transient input: */
    5683                                                
     5678
    56845679                        parameters->FindParam(&yts,ConstantsYtsEnum);
    56855680
     
    57525747/*FUNCTION Penta::CreateKMatrixCouplingMacAyealPattyn{{{*/
    57535748ElementMatrix* Penta::CreateKMatrixCouplingMacAyealPattyn(void){
    5754        
     5749
    57555750        /*compute all stiffness matrices for this element*/
    57565751        ElementMatrix* Ke1=CreateKMatrixCouplingMacAyealPattynViscous();
    57575752        ElementMatrix* Ke2=CreateKMatrixCouplingMacAyealPattynFriction();
    57585753        ElementMatrix* Ke=new ElementMatrix(Ke1,Ke2);
    5759        
     5754
    57605755        /*clean-up and return*/
    57615756        delete Ke1;
     
    58645859        const int numdof      = NDOF2 *NUMVERTICES;
    58655860        const int numdoftotal = NDOF4 *NUMVERTICES;
    5866        
     5861
    58675862        /*Intermediaries */
    58685863        int       i,j,ig,analysis_type;
     
    59335928                DL_scalar=alpha2*gauss->weight*Jdet2d;
    59345929                for (i=0;i<2;i++) DL[i][i]=DL_scalar;
    5935                
     5930
    59365931                /*  Do the triple producte tL*D*L: */
    59375932                TripleMultiply( &L[0][0],2,numdof,1,
     
    61656160                DLStokesMacAyeal[2][2]=-alpha2_gauss*gauss->weight*Jdet2d*bed_normal[0]*bed_normal[2];
    61666161                DLStokesMacAyeal[3][3]=-alpha2_gauss*gauss->weight*Jdet2d*bed_normal[1]*bed_normal[2];
    6167                
     6162
    61686163                TripleMultiply( &LMacAyealStokes[0][0],8,numdof2dm,1,
    61696164                                        &DLMacAyealStokes[0][0],8,8,0,
     
    67006695        /*Constants*/
    67016696        const int numdof   = NDOF2*NUMVERTICES;
    6702        
     6697
    67036698        /*Intermediaries */
    67046699        int       i,j,ig;
     
    67516746                        alpha2=pow((IssmDouble)10,MOUNTAINKEXPONENT);
    67526747                }
    6753                
     6748
    67546749                DL_scalar=alpha2*gauss->weight*Jdet;
    67556750                for (i=0;i<2;i++) DL[i][i]=DL_scalar;
    6756                
     6751
    67576752                TripleMultiply( &L[0][0],2,numdof,1,
    67586753                                        &DL[0][0],2,2,0,
     
    69266921        /*DO NOT Transform Coordinate System: this stiffness matrix is already expressed in tangential coordinates*/
    69276922        //TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum);
    6928        
     6923
    69296924        /*Clean up and return*/
    69306925        delete gauss;
     
    69356930/*FUNCTION Penta::CreateKMatrixDiagnosticVert {{{*/
    69366931ElementMatrix* Penta::CreateKMatrixDiagnosticVert(void){
    6937        
     6932
    69386933        /*compute all stiffness matrices for this element*/
    69396934        ElementMatrix* Ke1=CreateKMatrixDiagnosticVertVolume();
     
    78167811ElementVector* Penta::CreatePVectorDiagnosticVertBase(void){
    78177812
    7818 
    78197813        /*Constants*/
    78207814        const int    numdof=NDOF1*NUMVERTICES;
     
    84158409                penta=penta->GetUpperElement(); _assert_(penta->Id()!=this->id);
    84168410        }
    8417        
     8411
    84188412        /*Free ressources:*/
    84198413        xDelete<int>(doflist);
     
    86878681/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticPattyn {{{*/
    86888682void  Penta::InputUpdateFromSolutionDiagnosticPattyn(IssmDouble* solution){
    8689        
     8683
    86908684        const int    numdof=NDOF2*NUMVERTICES;
    86918685
     
    88558849/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticHutter {{{*/
    88568850void  Penta::InputUpdateFromSolutionDiagnosticHutter(IssmDouble* solution){
    8857        
     8851
    88588852        const int    numdof=NDOF2*NUMVERTICES;
    88598853
     
    89208914
    89218915        const int numdof=NDOF1*NUMVERTICES;
    8922        
     8916
    89238917        int      i;
    89248918        int      approximation;
     
    89378931        int*     doflist      = NULL;
    89388932
    8939 
    89408933        /*Get the approximation and do nothing if the element in Stokes or None*/
    89418934        inputs->GetInputValue(&approximation,ApproximationEnum);
     
    90229015/*FUNCTION Penta::InputUpdateFromSolutionDiagnosticStokes {{{*/
    90239016void  Penta::InputUpdateFromSolutionDiagnosticStokes(IssmDouble* solution){
    9024        
     9017
    90259018        const int numdof=NDOF4*NUMVERTICES;
    90269019
     
    90629055        for(i=0;i<NUMVERTICES;i++) pressure[i]=pressure[i]*stokesreconditioning;
    90639056        for(i=0;i<NUMVERTICES;i++) vel[i]=pow( pow(vx[i],2.0) + pow(vy[i],2.0) + pow(vz[i],2.0) , 0.5);
    9064        
     9057
    90659058        /*Now, we have to move the previous inputs  to old
    90669059         * status, otherwise, we'll wipe them off: */
     
    91329125/*}}}*/
    91339126#endif
    9134 
  • issm/trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp

    r13129 r13622  
    4949        /*intermediary: */
    5050        int matpar_id;
    51        
     51
    5252        /*retrieve parameters: */
    5353        iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
  • issm/trunk-jpl/src/c/classes/objects/Elements/PentaRef.cpp

    r13036 r13622  
    699699        IssmDouble l1l2l3[NUMNODESP1_2d];
    700700
    701 
    702701        /*Get l1l2l3 in actual coordinate system: */
    703702        l1l2l3[0]=gauss->coord1*(1-gauss->coord4)/2.0;
     
    812811        IssmDouble l1l2l3[NUMNODESP1_2d];
    813812
    814 
    815813        /*Get l1l2l3 in actual coordinate system: */
    816814        l1l2l3[0]=gauss->coord1*(1-gauss->coord4)/2.0;
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp

    r13521 r13622  
    4242        :TriaRef(nummodels)
    4343        ,TriaHook(nummodels,index+1,iomodel){
    44                
     44
    4545                int i;
    4646                /*id: */
     
    175175        _assert_(this->nodes && this->material && this->matpar && this->parameters && this->inputs);
    176176        /*}}}*/
    177        
     177
    178178        /*Skip if water element*/
    179179        if(IsOnWater()) return;
     
    499499
    500500                gauss->GaussPoint(ig);
    501                
     501
    502502                GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
    503503                D=gauss->weight*Jdet;
     
    528528        _assert_(this->nodes && this->material && this->matpar && this->parameters && this->inputs);
    529529        /*}}}*/
    530        
     530
    531531        /*Skip if water element*/
    532532        if(IsOnWater()) return;
     
    691691        /*Constants*/
    692692        const int    numdof=NDOF1*NUMVERTICES;
    693        
     693
    694694        /*Intermediaries */
    695695        int        i,j,ig;
     
    714714                slope_input=inputs->GetInput(BedEnum);     _assert_(slope_input);
    715715        }
    716                
     716
    717717        /* Start  looping on the number of gaussian points: */
    718718        gauss=new GaussTria(2);
     
    820820                sigma_xy[iv]=2*viscosity*epsilon[2];
    821821        }
    822        
     822
    823823        /*Add Stress tensor components into inputs*/
    824824        this->inputs->AddInput(new TriaP1Input(StressTensorxxEnum,&sigma_xx[0]));
     
    835835/*FUNCTION Tria::Configure {{{*/
    836836void  Tria::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
    837        
     837
    838838        /*go into parameters and get the analysis_counter: */
    839839        int analysis_counter;
     
    894894        _printLine_("neighboor sids: ");
    895895        _printLine_(" " << horizontalneighborsids[0] << " " << horizontalneighborsids[1] << " " << horizontalneighborsids[2]);
    896        
     896
    897897        return;
    898898}
     
    946946        this->parameters->FindParam(&Delta18oSurfaceLgm,SurfaceforcingsDelta18oSurfaceEnum,(finaltime-(21000*yts)));
    947947        this->parameters->FindParam(&Delta18oSurfaceTime,SurfaceforcingsDelta18oSurfaceEnum,time);
    948        
     948
    949949        /*Compute the temperature and precipitation*/
    950950        for(int iv=0;iv<NUMVERTICES;iv++){
     
    10271027        x2=xyz_list[1][0]; y2=xyz_list[1][1];
    10281028        x3=xyz_list[2][0]; y3=xyz_list[2][1];
    1029  
     1029
    10301030        _assert_(x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1>0);
    10311031        return (x2*y3 - y2*x3 + x1*y2 - y1*x2 + x3*y1 - y3*x1)/2;
     
    12841284/*FUNCTION Tria::Id {{{*/
    12851285int    Tria::Id(){
    1286        
     1286
    12871287        return id;
    12881288
     
    12911291/*FUNCTION Tria::Sid {{{*/
    12921292int    Tria::Sid(){
    1293        
     1293
    12941294        return sid;
    12951295
     
    14041404         * object out of the input, with the additional step and time information: */
    14051405        this->results->AddObject((Object*)input->SpawnResult(step,time));
    1406        
     1406
    14071407        #ifdef _HAVE_CONTROL_
    14081408        if(input->ObjectEnum()==ControlInputEnum){
     
    14521452        IssmDouble yts;
    14531453        int        num_cm_responses;
    1454    
     1454
    14551455        /*Get parameters: */
    14561456        iomodel->Constant(&yts,ConstantsYtsEnum);
     
    17191719        /*Check that name is an element input*/
    17201720        if (!IsInput(name)) return;
    1721        
     1721
    17221722        if ((code==5) || (code==1)){ //boolean
    17231723                this->inputs->AddInput(new BoolInput(name,reCast<bool>(scalar)));
     
    17461746        int    numberofelements;
    17471747        IssmDouble yts;
    1748 
    17491748
    17501749        /*Fetch parameters: */
     
    18611860/*FUNCTION Tria::IsOnBed {{{*/
    18621861bool Tria::IsOnBed(){
    1863        
     1862
    18641863        bool onbed;
    18651864        inputs->GetInputValue(&onbed,MeshElementonbedEnum);
     
    19841983        rho_ice=matpar->GetRhoIce();
    19851984        density=rho_ice/rho_water;
    1986        
     1985
    19871986        /*go through vertices, and update inputs, considering them to be TriaVertex type: */
    19881987        for(i=0;i<NUMVERTICES;i++){
     
    20252024                }
    20262025        }
    2027        
     2026
    20282027   /*Add basal melting rate if element just ungrounded*/
    20292028        if(!this->IsFloating() && elementonshelf==true){
     
    20812080        /*recover pointer: */
    20822081        row=*prow;
    2083                
     2082
    20842083        for(i=0;i<3;i++) vertices_ids[i]=nodes[i]->GetVertexId(); //vertices id start at column 3 of the patch.
    20852084
     
    22832282        GetInputListOnVertices(&a_neg[0],SurfaceforcingsANegEnum);
    22842283        GetInputListOnVertices(&b_neg[0],SurfaceforcingsBNegEnum);
    2285        
     2284
    22862285   /*Recover surface elevatio at vertices: */
    22872286        GetInputListOnVertices(&h[0],ThicknessEnum);
     
    22912290   rho_ice=matpar->GetRhoIce();
    22922291   rho_water=matpar->GetRhoFreshwater();
    2293                        
     2292
    22942293   // loop over all vertices
    22952294   for(i=0;i<NUMVERTICES;i++){
     
    23192318/*FUNCTION Tria::SetCurrentConfiguration {{{*/
    23202319void  Tria::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
    2321        
     2320
    23222321        /*go into parameters and get the analysis_counter: */
    23232322        int analysis_counter;
     
    25402539                if (reCast<bool>(vertices_potentially_ungrounding[nodes[i]->Sid()])){
    25412540                        vec_nodes_on_iceshelf->SetValue(nodes[i]->Sid(),1,INS_VAL);
    2542                
     2541
    25432542                        /*If node was not on ice shelf, we flipped*/
    25442543                        if(nodes_on_iceshelf[nodes[i]->Sid()]==0){
     
    28492848        smb_input->GetInputAverage(&smb);                                                                                                                                                                                               // average smb on element in m ice s-1
    28502849   Total_Smb=rho_ice*base*smb;                                                                                                                                                                                                                  // smb on element in kg s-1
    2851        
     2850
    28522851        /*Process units: */
    28532852        Total_Smb=UnitConversion(Total_Smb,IuToExtEnum,TotalSmbEnum);                                                                                                                           // smb on element in GigaTon yr-1
    2854        
     2853
    28552854        /*Return: */
    28562855        return Total_Smb;
     
    28672866        ElementMatrix* Ke2=CreateKMatrixDiagnosticMacAyealFriction();
    28682867        ElementMatrix* Ke =new ElementMatrix(Ke1,Ke2);
    2869        
     2868
    28702869        /*clean-up and return*/
    28712870        delete Ke1;
     
    29912990                DL_scalar=alpha2*gauss->weight*Jdet;
    29922991                for (i=0;i<2;i++) DL[i][i]=DL_scalar;
    2993                
     2992
    29942993                TripleMultiply( &L[0][0],2,numdof,1,
    29952994                                        &DL[0][0],2,2,0,
     
    32783277/*FUNCTION Tria::InputUpdateFromSolutionDiagnosticHoriz {{{*/
    32793278void  Tria::InputUpdateFromSolutionDiagnosticHoriz(IssmDouble* solution){
    3280        
     3279
    32813280        const int numdof=NDOF2*NUMVERTICES;
    32823281
     
    32913290        IssmDouble    pressure[NUMVERTICES];
    32923291        IssmDouble    thickness[NUMVERTICES];
    3293        
     3292
    32943293        /*Get dof list: */
    32953294        GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
     
    33413340/*FUNCTION Tria::InputUpdateFromSolutionDiagnosticHutter {{{*/
    33423341void  Tria::InputUpdateFromSolutionDiagnosticHutter(IssmDouble* solution){
    3343        
     3342
    33443343        const int numdof=NDOF2*NUMVERTICES;
    3345        
     3344
    33463345        int       i;
    33473346        int*      doflist=NULL;
     
    33543353        IssmDouble    pressure[NUMVERTICES];
    33553354        IssmDouble    thickness[NUMVERTICES];
    3356        
     3355
    33573356        /*Get dof list: */
    33583357        GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
     
    38003799                /*Build alpha_complement_list: */
    38013800                friction->GetAlphaComplement(&alpha_complement, gauss,VxEnum,VyEnum,VzEnum);
    3802        
     3801
    38033802                dragcoefficient_input->GetInputValue(&drag, gauss);
    38043803                adjointx_input->GetInputValue(&lambda, gauss);
     
    38123811                        grade_g_gaussian[i]=-2*drag*alpha_complement*((lambda*vx+mu*vy))*Jdet*gauss->weight*basis[i];
    38133812                }
    3814                
     3813
    38153814                /*Add gradje_g_gaussian vector to gradje_g: */
    38163815                for(i=0;i<NUMVERTICES;i++){
     
    39303929                GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
    39313930                GetNodalFunctions(basis, gauss);
    3932                
     3931
    39333932                adjoint_input->GetInputDerivativeValue(&Dlambda[0],&xyz_list[0][0],gauss);
    39343933                thickness_input->GetInputValue(&thickness, gauss);
     
    41974196        Input* vxobs_input  =inputs->GetInput(InversionVxObsEnum);     _assert_(vxobs_input);
    41984197        Input* vyobs_input  =inputs->GetInput(InversionVyObsEnum);     _assert_(vyobs_input);
    4199        
     4198
    42004199        /* Start  looping on the number of gaussian points: */
    42014200        gauss=new GaussTria(4);
     
    53035302        /* compute VelocityFactor */
    53045303        VelocityFactor= n_man*CR*CR*rho_water*g/mu_water;
    5305        
     5304
    53065305        gauss=new GaussTria();
    53075306        for (int iv=0;iv<NUMVERTICES;iv++){
     
    54765475                else  for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*basal_melting_g*basis[i];
    54775476        }
    5478                
     5477
    54795478        /*Clean up and return*/
    54805479        delete gauss;
     
    55485547/*FUNCTION Tria::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);{{{*/
    55495548void  Tria::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
    5550        
     5549
    55515550        int i,j;
    55525551
     
    55745573                                        IssmDouble  surface[3];
    55755574                                        IssmDouble  bed[3];
    5576                                        
     5575
    55775576                                        /*retrieve inputs: */
    55785577                                        GetInputListOnVertices(&thickness_init[0],ThicknessEnum);
     
    56475646/*FUNCTION Tria::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type);{{{*/
    56485647void  Tria::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
    5649        
     5648
    56505649        int i,j,t;
    56515650        TransientInput* transientinput=NULL;
     
    56615660
    56625661                case VertexEnum:
    5663                        
     5662
    56645663                        /*Create transient input: */
    5665                                                
     5664
    56665665                        parameters->FindParam(&yts,ConstantsYtsEnum);
    56675666                        for(t=0;t<ncols;t++){ //ncols is the number of times
     
    58895888        /*Constants*/
    58905889        const int    numdof=NDOF1*NUMVERTICES;
    5891        
     5890
    58925891        /*Intermediaries */
    58935892        int        i,j,ig;
     
    59055904        Input* basal_melting_input=inputs->GetInput(BasalforcingsMeltingRateEnum);          _assert_(basal_melting_input);
    59065905        Input* dhdt_input=inputs->GetInput(BalancethicknessThickeningRateEnum);             _assert_(dhdt_input);
    5907        
     5906
    59085907        /* Start  looping on the number of gaussian points: */
    59095908        gauss=new GaussTria(2);
  • issm/trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp

    r13129 r13622  
    5050        /*retrieve parameters: */
    5151        iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
    52        
     52
    5353        this->numanalyses=in_numanalyses;
    5454        this->hnodes= new Hook*[in_numanalyses];
  • issm/trunk-jpl/src/c/classes/objects/Elements/TriaRef.cpp

    r13036 r13622  
    319319        y3=*(xyz_list+NUMNODES*2+1);
    320320
    321 
    322321        *(J+NDOF2*0+0)=0.5*(x2-x1);
    323322        *(J+NDOF2*1+0)=SQRT3/6.0*(2*x3-x1-x2);
  • issm/trunk-jpl/src/c/classes/objects/IndependentObject.cpp

    r13612 r13622  
    7777} /*}}}*/
    7878
    79 
    8079/*IndependentObject methods: */
    8180/*FUNCTION IndependentObject::FetchIndependent{{{*/
     
    8483        int my_rank;
    8584        FILE* fid=NULL;
    86        
     85
    8786        /*recover my_rank:*/
    8887        my_rank=IssmComm::GetRank();
    8988
    9089        #ifdef _HAVE_ADOLC_ //cannot come here unless you are running AD mode, from DeclaredIndependents:
    91        
     90
    9291        /*Branch according to the type of variable: */
    9392        if(type==0){ /*scalar: {{{*/
     
    111110                /*Now, before we even broadcast this to other nodes, declare the scalar  as an independent variable!: */
    112111                scalar<<=pscalar;
    113                
     112
    114113                #ifdef _HAVE_MPI_
    115114                MPI_Bcast(&scalar,1,MPI_DOUBLE,0,IssmComm::GetComm());
    116115                #endif
    117 
    118116
    119117                /*Ok, we are almost done. scalar is now an independent variable. We don't want this variable to be fetched again in the
     
    122120                 space for it: */
    123121                scalar_slot=xNew<IssmDouble>(1); *scalar_slot=scalar;
    124                
     122
    125123                iomodel->data[name]=scalar_slot;
    126124                iomodel->independents[name]=true;
    127125
    128 
    129126        } /*}}}*/
    130127        else if(type==1){ /* vector: {{{*/
    131                
     128
    132129                FILE* fid=NULL;
    133130                int M,N;
     
    136133                int code=0;
    137134                int vector_type=0;
    138                
     135
    139136                /*Set file pointer to beginning of the data: */
    140137                fid=iomodel->SetFilePointerToData(&code,&vector_type,name);
    141138                if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(name));
    142                
     139
    143140                /*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */
    144141                /*numberofelements: */
     
    165162                        if(my_rank==0){ 
    166163                                if(fread(buffer,M*N*sizeof(IssmPDouble),1,fid)!=1) _error_("could not read matrix ");
    167                                
     164
    168165                                /*Now, before we even broadcast this to other nodes, declare the whole matrix as a independent variable!: */
    169166                                for (int i=0;i<M*N;++i) matrix[i]<<=buffer[i];  /*we use the <<= ADOLC overloaded operator to declare the independency*/
     
    172169                        MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,IssmComm::GetComm());
    173170                        #endif
    174                        
     171
    175172                        xDelete<IssmPDouble>(buffer);
    176173                }
     
    205202
    206203        int i;
    207        
     204
    208205        /*Branch according to the type of variable: */
    209206        if(type==0){ /*scalar:*/
  • issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp

    r13414 r13622  
    6262/*FUNCTION BoolInput::copy{{{*/
    6363Object* BoolInput::copy() {
    64        
     64
    6565        return new BoolInput(this->enum_type,this->value);
    6666
    6767}
    6868/*}}}*/
    69        
     69
    7070/*BoolInput management*/
    7171/*FUNCTION BoolInput::InstanceEnum{{{*/
     
    9393/*FUNCTION BoolInput::SpawnResult{{{*/
    9494ElementResult* BoolInput::SpawnResult(int step, IssmDouble time){
    95        
     95
    9696        return new BoolElementResult(this->enum_type,this->value,step,time);
    9797
  • issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp

    r13414 r13622  
    9393/*FUNCTION ControlInput::copy{{{*/
    9494Object* ControlInput::copy() {
    95        
     95
    9696        ControlInput* output=NULL;
    9797
     
    109109}
    110110/*}}}*/
    111        
     111
    112112/*ControlInput management*/
    113113/*FUNCTION ControlInput::InstanceEnum{{{*/
  • issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.cpp

    r13414 r13622  
    6464/*FUNCTION DatasetInput::copy{{{*/
    6565Object* DatasetInput::copy() {
    66        
     66
    6767        DatasetInput* output=NULL;
    6868
     
    8989}
    9090/*}}}*/
    91        
     91
    9292/*DatasetInput management*/
    9393/*FUNCTION DatasetInput::InstanceEnum{{{*/
     
    111111        if(index<0 || index > inputs->Size()-1) _error_("index requested (" << index << ") exceeds dataset size (" << inputs->Size() << ")");
    112112        Input* input=(Input*)this->inputs->GetObjectByOffset(index);
    113        
     113
    114114        input->GetInputValue(pvalue,gauss);
    115115}
  • issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp

    r13414 r13622  
    6262/*FUNCTION DoubleInput::copy{{{*/
    6363Object* DoubleInput::copy() {
    64        
     64
    6565        return new DoubleInput(this->enum_type,this->value);
    6666
    6767}
    6868/*}}}*/
    69        
     69
    7070/*DoubleInput management*/
    7171/*FUNCTION DoubleInput::InstanceEnum{{{*/
  • issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp

    r13414 r13622  
    5757/*FUNCTION IntInput::copy{{{*/
    5858Object* IntInput::copy() {
    59        
     59
    6060        return new IntInput(this->enum_type,this->value);
    6161
     
    9292/*FUNCTION IntInput::SpawnResult{{{*/
    9393ElementResult* IntInput::SpawnResult(int step, IssmDouble time){
    94        
     94
    9595        _error_("not supported yet!");
    9696
  • issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp

    r13414 r13622  
    7171}
    7272/*}}}*/
    73        
     73
    7474/*PentaP1Input management*/
    7575/*FUNCTION PentaP1Input::copy{{{*/
    7676Object* PentaP1Input::copy() {
    77        
     77
    7878        return new PentaP1Input(this->enum_type,this->values);
    7979
     
    357357/*FUNCTION PentaP1Input::ConstrainMin{{{*/
    358358void PentaP1Input::ConstrainMin(IssmDouble minimum){
    359        
     359
    360360        int i;
    361361        const int numnodes=6;
     
    425425/*FUNCTION PentaP1Input::Scale{{{*/
    426426void PentaP1Input::Scale(IssmDouble scale_factor){
    427        
     427
    428428        int i;
    429429        const int numnodes=6;
     
    464464        int i;
    465465        const int numnodes=6;
    466                
     466
    467467        if(!xIsNan<IssmDouble>(cm_min)) for(i=0;i<numnodes;i++)if (this->values[i]<cm_min)this->values[i]=cm_min;
    468468        if(!xIsNan<IssmDouble>(cm_max)) for(i=0;i<numnodes;i++)if (this->values[i]>cm_max)this->values[i]=cm_max;
  • issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp

    r13577 r13622  
    103103}
    104104/*}}}*/
    105        
     105
    106106/*TransientInput management*/
    107107/*FUNCTION TransientInput::InstanceEnum{{{*/
     
    216216        /*Retrieve interpolated values for this time step: */
    217217        Input* input=GetTimeInput(time);
    218                    
     218
    219219        /*Call input function*/
    220220        input->GetInputDerivativeValue(p,xyz_list,gauss);
     
    231231/*FUNCTION TransientInput::GetInputAverage{{{*/
    232232void TransientInput::GetInputAverage(IssmDouble* pvalue){
    233        
     233
    234234        IssmDouble time;
    235235
     
    242242        /*Call input function*/
    243243        input->GetInputAverage(pvalue);
    244                            
     244
    245245        delete input;
    246246
     
    296296   /*Retrieve interpolated values for this time step: */
    297297        Input* input=GetTimeInput(time);
    298                    
     298
    299299        /*Call input function*/
    300300        input->SquareMin(psquaremin,process_units,parameters);
    301                            
     301
    302302        delete input;
    303303
     
    318318        /*Call input function*/
    319319        infnorm=input->InfinityNorm();
    320                            
     320
    321321        /*Clean-up and return*/
    322322        delete input;
     
    335335   /*Retrieve interpolated values for this time step: */
    336336        Input* input=GetTimeInput(time);
    337                    
     337
    338338        /*Call input function*/
    339339        max=input->Max();
    340                            
     340
    341341        delete input;
    342342
     
    400400        /*Call input function*/
    401401        minabs=input->MinAbs();
    402                            
     402
    403403        /*Clean-up and return*/
    404404        delete input;
     
    416416        /*Retrieve interpolated values for this time step: */
    417417        Input* input=GetTimeInput(time);
    418                    
     418
    419419        /*Call input function*/
    420420        input->GetVectorFromInputs(vector,doflist);
    421                            
     421
    422422        delete input;
    423423
     
    430430        int        found;
    431431        int        offset;
    432        
     432
    433433        Input *input  = NULL;
    434434        Input *input1 = NULL;
    435435        Input *input2 = NULL;
    436        
     436
    437437        /*go through the timesteps, and figure out which interval we
    438438         *fall within. Then interpolate the values on this interval: */
  • issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp

    r13414 r13622  
    7373/*FUNCTION TriaP1Input::copy{{{*/
    7474Object* TriaP1Input::copy() {
    75        
     75
    7676        return new TriaP1Input(this->enum_type,this->values);
    7777
    7878}
    7979/*}}}*/
    80        
     80
    8181/*TriaP1Input management*/
    8282/*FUNCTION TriaP1Input::InstanceEnum{{{*/
     
    208208/*FUNCTION TriaP1Input::ContrainMin{{{*/
    209209void TriaP1Input::ConstrainMin(IssmDouble minimum){
    210        
     210
    211211        int i;
    212212        const int numnodes=3;
     
    276276/*FUNCTION TriaP1Input::Scale{{{*/
    277277void TriaP1Input::Scale(IssmDouble scale_factor){
    278        
     278
    279279        int i;
    280280        const int numnodes=3;
     
    327327        int i;
    328328        const int numnodes=3;
    329                
     329
    330330        if(!xIsNan<IssmDouble>(cm_min)) for(i=0;i<numnodes;i++)if (this->values[i]<cm_min)this->values[i]=cm_min;
    331331        if(!xIsNan<IssmDouble>(cm_max)) for(i=0;i<numnodes;i++)if (this->values[i]>cm_max)this->values[i]=cm_max;
  • issm/trunk-jpl/src/c/classes/objects/KML/KML_Document.cpp

    r13056 r13622  
    125125}
    126126/*}}}*/
    127 
  • issm/trunk-jpl/src/c/classes/objects/KML/KML_LatLonBox.cpp

    r13056 r13622  
    4343/*FUNCTION KML_LatLonBox::Echo {{{*/
    4444void  KML_LatLonBox::Echo(){
    45 
    4645
    4746        _printLine_("KML_LatLonBox:");
  • issm/trunk-jpl/src/c/classes/objects/KML/KML_Polygon.cpp

    r13036 r13622  
    250250                        }
    251251
    252 
    253252                else if (!strncmp(kstri,"<",1))
    254253                        KML_Geometry::Read(fid,kstri);
  • issm/trunk-jpl/src/c/classes/objects/KML/KML_StyleSelector.cpp

    r13056 r13622  
    9393}
    9494/*}}}*/
    95 
  • issm/trunk-jpl/src/c/classes/objects/KML/KML_SubStyle.cpp

    r13036 r13622  
    9393}
    9494/*}}}*/
    95 
  • issm/trunk-jpl/src/c/classes/objects/KML/KML_Unknown.cpp

    r13056 r13622  
    7979                valuei=xNew<char>(strlen(value)+1);
    8080                memcpy(valuei,value,(strlen(value)+1)*sizeof(char));
    81        
     81
    8282                vtoken=strtok(valuei,nl);
    8383                if(flag) _pprintString_(indent << "         value: \"" << vtoken);
    84    
     84
    8585                while (vtoken=strtok(NULL,nl))
    8686                        if(flag) _pprintString_("\n" << indent << "                 " << vtoken);
     
    110110                valuei=xNew<char>(strlen(value)+1);
    111111                memcpy(valuei,value,(strlen(value)+1)*sizeof(char));
    112        
     112
    113113                vtoken=strtok(valuei,nl);
    114114                fprintf(filout,"%s  %s\n",indent,vtoken);
    115    
     115
    116116                while (vtoken=strtok(NULL,nl))
    117117                        fprintf(filout,"%s  %s\n",indent,vtoken);
  • issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp

    r13414 r13622  
    5252        int  icefront_node_ids[NUMVERTICESQUA]; //initialize with largest size
    5353        int  icefront_fill;
    54        
     54
    5555        /*find parameters: */
    5656        iomodel->Constant(&dim,MeshDimensionEnum);
     
    9090        /*Fill*/
    9191        icefront_fill=reCast<int>(iomodel->Data(DiagnosticIcefrontEnum)[segment_width*i+segment_width-1]);
    92        
     92
    9393        /*Ok, we have everything to build the object: */
    9494        this->id=icefront_id;
     
    104104        this->inputs->AddInput(new IntInput(FillEnum,icefront_fill));
    105105        this->inputs->AddInput(new IntInput(TypeEnum,in_icefront_type));
    106        
     106
    107107        //parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this.
    108108        this->parameters=NULL;
     
    111111        this->matpar= NULL;
    112112}
    113 
    114113
    115114/*}}}*/
     
    166165/*FUNCTION Icefront::copy {{{*/
    167166Object* Icefront::copy() {
    168        
     167
    169168        Icefront* icefront=NULL;
    170169
     
    666665        int* doflist=NULL;
    667666
    668        
    669667        /*recover type: */
    670668        inputs->GetInputValue(&type,TypeEnum);
     
    672670        /*Some checks for debugging*/
    673671        _assert_(nodes);
    674                
     672
    675673        /*How many nodes? :*/
    676674        if(type==MacAyeal2dIceFrontEnum || type==MacAyeal3dIceFrontEnum)
     
    678676        else
    679677         numberofnodes=4;
    680        
     678
    681679        /*Figure out size of doflist: */
    682680        for(i=0;i<numberofnodes;i++){
  • issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp

    r13414 r13622  
    175175        _printLine_("   inputs");
    176176        inputs->DeepEcho();
    177        
     177
    178178}               
    179179/*}}}*/
     
    192192/*FUNCTION Numericalflux::copy {{{*/
    193193Object* Numericalflux::copy() {
    194        
     194
    195195        Numericalflux* numericalflux=NULL;
    196196
     
    404404                for(i=0;i<numdof;i++) for(j=0;j<numdof;j++) Ke->values[i*numdof+j]+=Ke_g2[i][j];
    405405        }
    406        
     406
    407407        /*Clean up and return*/
    408408        delete gauss;
  • issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp

    r13414 r13622  
    1919#include "../../../Container/Container.h"
    2020/*}}}*/
    21        
     21
    2222/*Element macros*/
    2323#define NUMVERTICES   1
     
    3434        this->hmatpar=NULL;
    3535        this->matpar=NULL;
    36        
     36
    3737        /*not active, not zigzagging: */
    3838        active=0;
     
    6464        this->id=id;
    6565        this->analysis_type=in_analysis_type;
    66        
     66
    6767        /*hooks: */
    6868        pengrid_node_id=iomodel->nodecounter+index+1;
     
    9999}
    100100/*}}}*/
    101                        
     101
    102102/*Object virtual functions definitions:*/
    103103/*FUNCTION Pengrid::Echo {{{*/
     
    134134/*FUNCTION Icefront::copy {{{*/
    135135Object* Pengrid::copy() {
    136        
     136
    137137        Pengrid* pengrid=NULL;
    138138
     
    395395        /*recover pointers: */
    396396        Penta* penta=(Penta*)element;
    397        
     397
    398398        /*check that pengrid is not a clone (penalty to be added only once)*/
    399399        if (node->IsClone()){
     
    409409        //Recover our data:
    410410        parameters->FindParam(&penalty_lock,ThermalPenaltyLockEnum);
    411        
     411
    412412        //Compute pressure melting point
    413413        t_pmp=matpar->TMeltingPoint(pressure);
     
    421421                new_active=0;
    422422        }
    423 
    424423
    425424        //Figure out stability of this penalty
     
    450449/*FUNCTION Pengrid::PenaltyCreateKMatrixDiagnosticStokes {{{*/
    451450ElementMatrix* Pengrid::PenaltyCreateKMatrixDiagnosticStokes(IssmDouble kmax){
    452        
     451
    453452        const int numdof = NUMVERTICES *NDOF4;
    454453        IssmDouble    slope[2];
     
    499498        penta->GetInputValue(&temperature,node,TemperatureEnum);
    500499        parameters->FindParam(&penalty_factor,ThermalPenaltyFactorEnum);
    501        
     500
    502501        /*Compute pressure melting point*/
    503502        t_pmp=matpar->GetMeltingPoint()-matpar->GetBeta()*pressure;
     
    533532/*FUNCTION Pengrid::PenaltyCreatePVectorMelting {{{*/
    534533ElementVector* Pengrid::PenaltyCreatePVectorMelting(IssmDouble kmax){
    535        
     534
    536535        const int numdof=NUMVERTICES*NDOF1;
    537536        IssmDouble pressure;
  • issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp

    r13414 r13622  
    3434/*FUNCTION Penpair::creation {{{*/
    3535Penpair::Penpair(int penpair_id, int* penpair_node_ids,int in_analysis_type){
    36        
     36
    3737        this->id=penpair_id;
    3838        this->analysis_type=in_analysis_type;
     
    4040        this->parameters=NULL;
    4141        this->nodes=NULL;
    42        
     42
    4343        return;
    4444}
     
    6161        _printLine_("   analysis_type: " << EnumToStringx(analysis_type));
    6262        hnodes->Echo();
    63        
     63
    6464        return;
    6565}
     
    8787/*FUNCTION Penpair::copy {{{*/
    8888Object* Penpair::copy() {
    89        
     89
    9090        Penpair* penpair=NULL;
    9191
     
    107107}
    108108/*}}}*/
    109                
     109
    110110/*Load virtual functions definitions:*/
    111111/*FUNCTION Penpair::Configure {{{*/
     
    264264/*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticMacAyealPattyn {{{*/
    265265ElementMatrix* Penpair::PenaltyCreateKMatrixDiagnosticMacAyealPattyn(IssmDouble kmax){
    266        
     266
    267267        const int numdof=NUMVERTICES*NDOF2;
    268268        IssmDouble penalty_offset;
     
    291291/*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticStokes {{{*/
    292292ElementMatrix* Penpair::PenaltyCreateKMatrixDiagnosticStokes(IssmDouble kmax){
    293        
     293
    294294        const int numdof=NUMVERTICES*NDOF4;
    295295        IssmDouble penalty_offset;
     
    311311        Ke->values[5*numdof+1]=-kmax*pow((IssmDouble)10.0,penalty_offset);
    312312        Ke->values[5*numdof+5]=+kmax*pow((IssmDouble)10.0,penalty_offset);
    313        
     313
    314314        Ke->values[2*numdof+2]=+kmax*pow((IssmDouble)10.0,penalty_offset);
    315315        Ke->values[2*numdof+6]=-kmax*pow((IssmDouble)10.0,penalty_offset);
  • issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp

    r13414 r13622  
    9797        //intialize inputs, and add as many inputs per element as requested:
    9898        this->inputs=new Inputs();
    99                
     99
    100100        riftfront_type=SegmentRiftfrontEnum;
    101101        riftfront_fill = reCast<int,IssmDouble>(*(iomodel->Data(RiftsRiftstructEnum)+RIFTINFOSIZE*i+7));
     
    109109        this->inputs->AddInput(new DoubleInput(FractionIncrementEnum,riftfront_fractionincrement));
    110110        this->inputs->AddInput(new BoolInput(SegmentOnIceShelfEnum,riftfront_shelf));
    111        
     111
    112112        //parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this.
    113113        this->parameters=NULL;
     
    115115        this->elements= NULL;
    116116        this->matpar= NULL;
    117                
     117
    118118}
    119119/*}}}*/
     
    137137        IssmDouble friction,fractionincrement;
    138138
    139        
    140139        /*recover some inputs first: */
    141140        input=(Input*)this->inputs->GetInput(FillEnum); input->GetInputValue(&fill);
     
    165164        _printLine_("   state: " << state);
    166165        _printLine_("   frozen: " << (frozen ? "true":"false"));
    167                
     166
    168167}
    169168/*}}}*/
     
    195194/*FUNCTION Riftfront::copy {{{*/
    196195Object* Riftfront::copy() {
    197        
     196
    198197        Riftfront* riftfront=NULL;
    199198
     
    234233        riftfront->length=this->length;
    235234        riftfront->fraction=this->fraction;
    236        
     235
    237236        return riftfront;
    238237
    239238}
    240239/*}}}*/
    241                
     240
    242241/*Update virtual functions definitions:*/
    243242/*FUNCTION Riftfront::InputUpdateFromConstant(bool constant,int name) {{{*/
     
    275274}
    276275/*}}}*/
    277 
    278276
    279277/*Load virtual functions definitions:*/
     
    596594                if(this->state==OpenEnum)this->active=0;
    597595                if(this->state==ClosedEnum)this->active=1;
    598                
     596
    599597                /*this segment is like frozen, no instability here: */
    600598                *punstable=0;
    601599                return 1;
    602600        }
    603 
    604601
    605602        /*recover parameters: */
     
    723720        /*If we are zigzag locked, same thing: */
    724721        if(this->counter>this->penalty_lock)penetration=-1;
    725        
     722
    726723        /*assign output pointer: */
    727724        *ppenetration=penetration;
     
    762759        /*Now, we return penetration only if we are active!: */
    763760        if(this->active==0)penetration=0;
    764        
     761
    765762        /*assign output pointer: */
    766763        *ppenetration=penetration;
     
    770767/*FUNCTION Riftfront::PotentialUnstableConstraint {{{*/
    771768int   Riftfront::PotentialUnstableConstraint(int* punstable){
    772 
    773769
    774770        const int   numnodes        = 2;
  • issm/trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp

    r13414 r13622  
    1515#include "../../../shared/shared.h"
    1616#include "../../../include/include.h"
    17                
     17
    1818/*Matdamageice constructors and destructor*/
    1919/*FUNCTION Matdamageice::Matdamageice(){{{*/
     
    299299         * return g, initial viscosity.
    300300         */
    301        
     301
    302302        /*output: */
    303303        IssmDouble viscosity3d;
     
    341341                        else{
    342342                                e=(n-1)/2/n;
    343                        
     343
    344344                                viscosity3d=B/(2*pow(A,e));
    345345                        }
     
    370370         * return g, initial viscosity.
    371371         */
    372        
     372
    373373        /*output: */
    374374        IssmDouble viscosity3d;
     
    387387        Z=GetZ();
    388388        B=Z*GetB();
    389        
     389
    390390        if (n==1){
    391391                /*Viscous behaviour! viscosity3d=B: */
     
    440440         * return mu20, initial viscosity.
    441441         */
    442        
     442
    443443        /*output: */
    444444        IssmDouble viscosity_complement;
     
    468468                else{
    469469                        e=(n-1)/(2*n);
    470                
     470
    471471                        viscosity_complement=1/(2*pow(A,e));
    472472                }
     
    480480        _assert_(n>0);
    481481        _assert_(viscosity_complement>0);
    482                
     482
    483483        /*Return: */
    484484        *pviscosity_complement=viscosity_complement;
     
    496496         * return mu20, initial viscosity.
    497497         */
    498        
     498
    499499        /*output: */
    500500        IssmDouble viscosity_complement;
     
    524524                else{
    525525                        e=(n-1)/(2*n);
    526                
     526
    527527                        viscosity_complement=B/(2*pow(A,e));
    528528                }
     
    536536        _assert_(n>0);
    537537        _assert_(viscosity_complement>0);
    538                
     538
    539539        /*Return: */
    540540        *pviscosity_complement=viscosity_complement;
     
    700700                default: _error_("type " << type << " (" << EnumToStringx(type) << ") not implemented yet");
    701701        }
    702 
    703 
    704702
    705703}
  • issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp

    r13414 r13622  
    1515#include "../../../shared/shared.h"
    1616#include "../../../include/include.h"
    17                
     17
    1818/*Matice constructors and destructor*/
    1919/*FUNCTION Matice::Matice(){{{*/
     
    277277         * return g, initial viscosity.
    278278         */
    279        
     279
    280280        /*output: */
    281281        IssmDouble viscosity3d;
     
    318318                        else{
    319319                                e=(n-1)/2/n;
    320                        
     320
    321321                                viscosity3d=B/(2*pow(A,e));
    322322                        }
     
    347347         * return g, initial viscosity.
    348348         */
    349        
     349
    350350        /*output: */
    351351        IssmDouble viscosity3d;
     
    363363        B=GetB();
    364364        n=GetN();
    365        
     365
    366366        if (n==1){
    367367                /*Viscous behaviour! viscosity3d=B: */
     
    416416         * return mu20, initial viscosity.
    417417         */
    418        
     418
    419419        /*output: */
    420420        IssmDouble viscosity_complement;
     
    444444                else{
    445445                        e=(n-1)/(2*n);
    446                
     446
    447447                        viscosity_complement=1/(2*pow(A,e));
    448448                }
     
    456456        _assert_(n>0);
    457457        _assert_(viscosity_complement>0);
    458                
     458
    459459        /*Return: */
    460460        *pviscosity_complement=viscosity_complement;
     
    621621        }
    622622
    623 
    624 
    625623}
    626624/*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp

    r13414 r13622  
    1515#include "../../../include/include.h"
    1616#include "../../../EnumDefinitions/EnumDefinitions.h"
    17                
     17
    1818/*Matpar constructors and destructor*/
    1919/*FUNCTION Matpar::Matpar() {{{*/
     
    3939        iomodel->Constant(&this->thermal_exchange_velocity,MaterialsThermalExchangeVelocityEnum);
    4040        iomodel->Constant(&this->g,ConstantsGEnum);
    41        
     41
    4242        iomodel->Constant(&this->hydro_CR,HydrologyCREnum);
    4343        iomodel->Constant(&this->kn,HydrologyKnEnum);
     
    244244/*FUNCTION Matpar::GetRhoIce {{{*/
    245245IssmDouble Matpar::GetRhoIce(){
    246        
     246
    247247        return rho_ice;
    248248}
     
    323323        /*Ouput*/
    324324        IssmDouble temperature,waterfraction;
    325        
     325
    326326        if(enthalpy<PureIceEnthalpy(pressure)){
    327327                temperature=referencetemperature+enthalpy/heatcapacity;
     
    343343        /*Ouput*/
    344344        IssmDouble enthalpy;
    345        
     345
    346346        if(temperature<TMeltingPoint(pressure)){
    347347                enthalpy=heatcapacity*(temperature-referencetemperature);
  • issm/trunk-jpl/src/c/classes/objects/Node.cpp

    r13612 r13622  
    167167        _printLine_("   inputs:      " << inputs);
    168168
    169 
    170169}
    171170/*}}}*/
     
    182181        _printLine_("   inputs");
    183182
    184 
    185183}
    186184/*}}}*/
     
    232230        int count=0;
    233231        int count2=0;
    234                
     232
    235233        if(approximation_enum==NoneApproximationEnum){
    236234                if(setenum==GsetEnum)for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=indexing.gdoflist[i];
     
    294292        int count=0;
    295293        int count2=0;
    296                
     294
    297295        if(approximation_enum==NoneApproximationEnum){
    298296                if(setenum==GsetEnum)for(i=0;i<this->indexing.gsize;i++) outdoflist[i]=i;
     
    468466                /*g set: */
    469467                pv_g->SetValue(indexing.gdoflist[i],gvalue,INS_VAL);
    470                
     468
    471469                /*f set: */
    472470                value=(IssmDouble)this->indexing.f_set[i];
     
    478476
    479477        }
    480 
    481478
    482479}
     
    500497                        }
    501498                }
    502                
     499
    503500                /*Add values into constraint vector: */
    504501                ys->SetValues(this->indexing.ssize,this->indexing.sdoflist,values,INS_VAL);
     
    508505        xDelete<IssmDouble>(values);
    509506
    510 
    511507}
    512508/*}}}*/
     
    533529/*FUNCTION Node::FreezeDof{{{*/
    534530void  Node::FreezeDof(int dof){
    535        
     531
    536532        DofInSSet(dof-1); //with 0 displacement for this dof.
    537533
     
    562558        /*Get number of degrees of freedom in a node, for a certain set (g,f or s-set)
    563559         *and for a certain approximation type: */
    564        
     560
    565561        int i;
    566562        int numdofs=0;
     
    639635/*FUNCTION Node::IsClone {{{*/
    640636int   Node::IsClone(){
    641        
     637
    642638        return indexing.clone;
    643639
     
    668664/*FUNCTION Node::IsFloating {{{*/
    669665int   Node::IsFloating(){
    670        
     666
    671667        bool onshelf;
    672668
     
    872868        if(setenum==FsetEnum) this->indexing.InitSet(setenum);
    873869        if(setenum==SsetEnum) this->indexing.InitSet(setenum);
    874        
     870
    875871        /*For clone nodfs, don't distribute dofs, we will get them from another cpu in UpdateCloneDofs!*/
    876872        if(indexing.clone){
     
    905901/*FUNCTION Node::OffsetDofs{{{*/
    906902void  Node::OffsetDofs(int dofcount,int setenum){
    907        
     903
    908904        int i;
    909        
     905
    910906        if(indexing.clone){
    911907                /*This node is a clone, don't off_set the dofs!: */
     
    980976
    981977        int my_rank;
    982        
     978
    983979        /*recover my_rank:*/
    984980        my_rank=IssmComm::GetRank();
  • issm/trunk-jpl/src/c/classes/objects/Params/BoolParam.cpp

    r13414 r13622  
    6565/*FUNCTION BoolParam::copy{{{*/
    6666Object* BoolParam::copy() {
    67        
     67
    6868        return new BoolParam(this->enum_type,this->value);
    6969
  • issm/trunk-jpl/src/c/classes/objects/Params/DataSetParam.cpp

    r13608 r13622  
    6666/*FUNCTION DataSetParam::copy{{{*/
    6767Object* DataSetParam::copy() {
    68        
     68
    6969        return new DataSetParam(this->enum_type,this->value);
    7070
  • issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.cpp

    r13414 r13622  
    7777                xDelete<IssmDouble>(matrix);
    7878        }
    79        
     79
    8080        xDelete<IssmDouble*>(array);
    8181        return;
     
    100100        int m,n;
    101101        IssmDouble* matrix=NULL;
    102        
     102
    103103        _printLine_("DoubleMatArrayParam:");
    104104        _printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
     
    130130/*FUNCTION DoubleMatArrayParam::copy{{{*/
    131131Object* DoubleMatArrayParam::copy() {
    132        
     132
    133133        return new DoubleMatArrayParam(this->enum_type,this->array, this->M, this->mdim_array,this->ndim_array);
    134134
     
    150150        int*     out_ndim_array=NULL;
    151151
    152 
    153152        out_M=this->M;
    154153        if(out_M){
     
    181180        }
    182181
    183 
    184182        /*Assign output pointers:*/
    185183        if(pout_M) *pout_M=out_M;
     
    216214        this->mdim_array=xNew<int>(M);
    217215        this->ndim_array=xNew<int>(M);
    218        
     216
    219217        xMemCpy<int>(this->mdim_array,in_mdim_array,M);
    220218        xMemCpy<int>(this->ndim_array,in_ndim_array,M);
  • issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.cpp

    r13414 r13622  
    5858
    5959        int i,j;
    60        
     60
    6161        _printLine_("DoubleMatParam:");
    6262        _printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
     
    8181/*FUNCTION DoubleMatParam::copy{{{*/
    8282Object* DoubleMatParam::copy() {
    83        
     83
    8484        return new DoubleMatParam(this->enum_type,this->value,this->M,this->N);
    8585
  • issm/trunk-jpl/src/c/classes/objects/Params/DoubleParam.cpp

    r13414 r13622  
    6262/*FUNCTION DoubleParam::copy{{{*/
    6363Object* DoubleParam::copy() {
    64        
     64
    6565        return new DoubleParam(this->enum_type,this->value);
    6666
  • issm/trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.cpp

    r13414 r13622  
    5757
    5858        int i;
    59        
     59
    6060        _printLine_("DoubleVecParam:");
    6161        _printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
     
    7878/*FUNCTION DoubleVecParam::copy{{{*/
    7979Object* DoubleVecParam::copy() {
    80        
     80
    8181        return new DoubleVecParam(this->enum_type,this->values,this->M);
    8282
  • issm/trunk-jpl/src/c/classes/objects/Params/FileParam.cpp

    r13414 r13622  
    6565/*FUNCTION FileParam::copy{{{*/
    6666Object* FileParam::copy() {
    67        
     67
    6868        return new FileParam(this->enum_type,this->value);
    6969
  • issm/trunk-jpl/src/c/classes/objects/Params/IntMatParam.cpp

    r13414 r13622  
    5858
    5959        int i,j;
    60        
     60
    6161        _printLine_("IntMatParam:");
    6262        _printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
     
    8181/*FUNCTION IntMatParam::copy{{{*/
    8282Object* IntMatParam::copy() {
    83        
     83
    8484        return new IntMatParam(this->enum_type,this->value,this->M,this->N);
    8585
  • issm/trunk-jpl/src/c/classes/objects/Params/IntParam.cpp

    r13414 r13622  
    6565/*FUNCTION IntParam::copy{{{*/
    6666Object* IntParam::copy() {
    67        
     67
    6868        return new IntParam(this->enum_type,this->value);
    6969
  • issm/trunk-jpl/src/c/classes/objects/Params/IntVecParam.cpp

    r13414 r13622  
    7373
    7474        int i;
    75        
     75
    7676        _printLine_("IntVecParam:");
    7777        _printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
     
    9494/*FUNCTION IntVecParam::copy{{{*/
    9595Object* IntVecParam::copy() {
    96        
     96
    9797        return new IntVecParam(this->enum_type,this->values,this->M);
    9898
  • issm/trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp

    r13414 r13622  
    7373/*FUNCTION MatrixParam::copy{{{*/
    7474Object* MatrixParam::copy() {
    75        
     75
    7676        return new MatrixParam(this->enum_type,this->value);
    7777
     
    9797/*FUNCTION MatrixParam::SetValue{{{*/
    9898void  MatrixParam::SetValue(Matrix<IssmDouble>* matrix){
    99        
     99
    100100        /*avoid leak: */
    101101        xdelete(&value);
    102        
     102
    103103        /*copy: */
    104104        value=matrix->Duplicate();
  • issm/trunk-jpl/src/c/classes/objects/Params/StringArrayParam.cpp

    r13414 r13622  
    4646        }
    4747        else value=NULL;
    48        
     48
    4949}
    5050/*}}}*/
    5151/*FUNCTION StringArrayParam::~StringArrayParam(){{{*/
    5252StringArrayParam::~StringArrayParam(){
    53                
     53
    5454        int i;
    55        
     55
    5656        char* string=NULL;
    5757        for(i=0;i<this->numstrings;i++){
     
    9595/*FUNCTION StringArrayParam::copy{{{*/
    9696Object* StringArrayParam::copy() {
    97        
     97
    9898        return new StringArrayParam(this->enum_type,this->value,this->numstrings);
    9999
     
    104104/*FUNCTION StringArrayParam::GetParameterValue{{{*/
    105105void  StringArrayParam::GetParameterValue(char*** pstringarray,int* pM){
    106        
     106
    107107        int   i;
    108108        char** outstrings=NULL;
     
    140140/*FUNCTION StringArrayParam::SetValue{{{*/
    141141void  StringArrayParam::SetValue(char** stringarray,int M){
    142        
     142
    143143        int   i;
    144144        char *string     = NULL;
  • issm/trunk-jpl/src/c/classes/objects/Params/StringParam.cpp

    r13414 r13622  
    3333        xMemCpy<char>(value,in_value,(strlen(in_value)+1));
    3434
    35        
    3635}
    3736/*}}}*/
     
    6766/*FUNCTION StringParam::copy{{{*/
    6867Object* StringParam::copy() {
    69        
     68
    7069        return new StringParam(this->enum_type,this->value);
    7170
     
    7675/*FUNCTION StringParam::GetParameterValue{{{*/
    7776void  StringParam::GetParameterValue(char** pstring){
    78        
     77
    7978        char* outstring=NULL;
    8079        int   stringsize;
     
    9695/*FUNCTION StringParam::SetValue{{{*/
    9796void  StringParam::SetValue(char* string){
    98        
     97
    9998        int   stringsize;
    100        
     99
    101100        /*avoid leak: */
    102101        xDelete<char>(this->value);
  • issm/trunk-jpl/src/c/classes/objects/Params/TransientParam.cpp

    r13414 r13622  
    6262
    6363        int i,j;
    64        
     64
    6565        _printLine_("TransientParam:");
    6666        _printLine_("   enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")");
     
    8383/*FUNCTION TransientParam::copy{{{*/
    8484Object* TransientParam::copy() {
    85        
     85
    8686        return new TransientParam(this->enum_type,this->values,this->timesteps,this->N);
    8787
  • issm/trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp

    r13414 r13622  
    7575/*FUNCTION VectorParam::copy{{{*/
    7676Object* VectorParam::copy() {
    77        
     77
    7878        return new VectorParam(this->enum_type,this->value);
    7979
     
    103103        /*avoid leak: */
    104104        xdelete(&value);
    105        
     105
    106106        /*copy: */
    107107        value=vector->Duplicate();
  • issm/trunk-jpl/src/c/classes/objects/Vertex.cpp

    r13612 r13622  
    132132        /*retrieve current pid*/
    133133        int pidcount=*ppidcount;
    134        
     134
    135135        /*This vertex is a clone! Don't distribute pids, it will get them from another cpu!*/
    136136        if(this->clone) return;
     
    146146/*FUNCTION Vertex::OffsetPids{{{*/
    147147void  Vertex::OffsetPids(int pidcount){
    148        
     148
    149149        /*This vertex is a clone, don't offset the pids*/
    150150        if(this->clone) return;
     
    179179
    180180        int my_rank;
    181        
     181
    182182        /*recover my_rank:*/
    183183        my_rank=IssmComm::GetRank();
     
    194194}
    195195/*}}}*/
    196 
  • issm/trunk-jpl/src/c/io/Disk/WriteLockFile.cpp

    r13612 r13622  
    1313        /*recover my_rank:*/
    1414        my_rank=IssmComm::GetRank();
    15        
     15
    1616        /* output: */
    1717        FILE* fid=NULL;
  • issm/trunk-jpl/src/c/io/Disk/pfopen.cpp

    r13606 r13622  
    1616
    1717        FILE* fid=NULL;
    18        
     18
    1919        /*Open handle to data on disk: */
    2020        fid=fopen(filename,format);
     
    2323        return fid;
    2424}
    25 
  • issm/trunk-jpl/src/c/io/PrintfFunction.cpp

    r13612 r13622  
    1919        //variable list of arguments
    2020        va_list args;
    21        
     21
    2222        /*recover my_rank:*/
    2323        my_rank=IssmComm::GetRank();
     
    5454int PrintfFunction(const string & message){
    5555        int  my_rank;
    56        
     56
    5757        /*recover my_rank:*/
    5858        my_rank=IssmComm::GetRank();
  • issm/trunk-jpl/src/c/matlab/io/CheckNumMatlabArguments.cpp

    r13056 r13622  
    99#endif
    1010
    11 
    1211#include "../../shared/Exceptions/exceptions.h"
    1312#include "../../include/include.h"
     
    1514
    1615int CheckNumMatlabArguments(int nlhs,int NLHS, int nrhs,int NRHS, const char* __FUNCT__, void (*function)( void )){
    17        
     16
    1817        /*checks on arguments on the matlab side: */
    1918        if (nrhs==0 && nlhs==0) {
  • issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp

    r13378 r13622  
    5050                _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
    5151        }
    52                        
     52
    5353        /*Assign output pointers:*/
    5454        *pmatrix=outmatrix;
     
    9797                _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
    9898        }
    99                        
     99
    100100        /*Assign output pointers:*/
    101101        *pmatrix=outmatrix;
     
    252252                _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
    253253        }
    254                        
     254
    255255        /*Assign output pointers:*/
    256256        *pmatrix=outmatrix;
     
    390390        char* outstring=NULL;
    391391
    392 
    393392        /*Ok, the string should be coming directly from the matlab workspace: */
    394393        if (!mxIsClass(dataref,"char")){
     
    398397                /*Recover the string:*/
    399398                int stringlen;
    400                
     399
    401400                stringlen = mxGetM(dataref)*mxGetN(dataref)+1;
    402401                outstring =xNew<char>(stringlen);
     
    430429                _error_("Input parameter of class " << mxGetClassName(dataref) << " not supported yet");
    431430        }
    432                        
     431
    433432        /*Assign output pointers:*/
    434433        *pmatrix=outmatrix;
  • issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp

    r13056 r13622  
    3131                rows=mxGetM(mxmatrix);
    3232                cols=mxGetN(mxmatrix);
    33                
     33
    3434                if(rows*cols){
    3535                        matrix=xNewZeroInit<double>(rows*cols);
     
    5555                rows=mxGetM(mxmatrix);
    5656                cols=mxGetN(mxmatrix);
    57                
     57
    5858                /*Create serial matrix: */
    5959                if(rows*cols){
  • issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp

    r13216 r13622  
    1919#include "../../include/include.h"
    2020#include "../../toolkits/toolkits.h"
    21        
     21
    2222/*}}}*/
    2323
     
    3535        matrix->smatrix=MatlabMatrixToSeqMat(mxmatrix);
    3636        #endif
    37        
     37
    3838        return matrix;
    3939}
  • issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToPetscMat.cpp

    r12850 r13622  
    22 * \brief: convert a sparse or dense matlab matrix to a serial Petsc matrix:
    33 */
    4 
    54
    65#ifdef HAVE_CONFIG_H
     
    5150        int *idxm = NULL;
    5251        int *idxn = NULL;
    53        
     52
    5453        /*Ok, first check if we are dealing with a sparse or full matrix: */
    5554        if (mxIsSparse(mxmatrix)){
  • issm/trunk-jpl/src/c/matlab/io/MatlabNArrayToNArray.cpp

    r13378 r13622  
    22 * \brief: convert a sparse or dense matlab n-dimensional array to cpp n-dimensional array
    33 */
    4 
    54
    65#ifdef HAVE_CONFIG_H
     
    6867                /*Dealing with dense matrix: recover pointer and size: */
    6968                mxmatrix_ptr=(double*)mxGetPr(mxmatrix);
    70                
     69
    7170                /*Create serial matrix: */
    7271                matrix=xNewZeroInit<double>(numel);
     
    141140                /*Dealing with dense matrix: recover pointer and size: */
    142141                mxmatrix_ptr=(bool*)mxGetData(mxmatrix);
    143                
     142
    144143                /*Create serial matrix: */
    145144                matrix=xNew<bool>(numel);
     
    212211                /*Dealing with dense matrix: recover pointer and size: */
    213212                mxmatrix_ptr=mxGetChars(mxmatrix);
    214                
     213
    215214                /*Create serial matrix: */
    216215                matrix=xNew<char>(numel+1);
  • issm/trunk-jpl/src/c/matlab/io/MatlabVectorToDoubleVector.cpp

    r13056 r13622  
    22 * \brief: convert a sparse or dense matlab vector to a serial vector:
    33 */
    4 
    54
    65#ifdef HAVE_CONFIG_H
     
    98#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    109#endif
    11 
    1210
    1311#include <string.h>
     
    4442                cols=mxGetN(mxvector);
    4543                nnz=mxGetNzmax(mxvector);
    46                
     44
    4745                /*Check that input is actualy a vector*/
    4846                if (cols!=1) _error_("input vector of size " << rows << "x" << cols << " should have only one column");
  • issm/trunk-jpl/src/c/matlab/io/MatlabVectorToPetscVec.cpp

    r12850 r13622  
    22 * \brief: convert a sparse or dense matlab vector to a serial Petsc vector:
    33 */
    4 
    54
    65#ifdef HAVE_CONFIG_H
     
    2524        int dummy;
    2625        PetscVec* vector=new PetscVec();
    27        
     26
    2827        MatlabVectorToPetscVec(&vector->vector,&dummy, mxvector);
    2928
     
    5150        /*petsc indices: */
    5251        int* idxm=NULL;
    53        
     52
    5453        /*Ok, first check if we are dealing with a sparse or full vector: */
    5554        if (mxIsSparse(mxvector)){
  • issm/trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp

    r13216 r13622  
    1919#include "../../include/include.h"
    2020#include "../../toolkits/toolkits.h"
    21        
     21
    2222/*}}}*/
    2323
     
    3535        vector->svector=MatlabVectorToSeqVec(mxvector);
    3636        #endif
    37        
     37
    3838        return vector;
    3939}
  • issm/trunk-jpl/src/c/matlab/io/PrintfFunction.cpp

    r13612 r13622  
    1919        int         string_size;
    2020        int  my_rank;
    21        
     21
    2222        /*recover my_rank:*/
    2323        my_rank=IssmComm::GetRank();
  • issm/trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp

    r13447 r13622  
    2020        mxArray *dataref  = NULL;
    2121        double  *tmatrix  = NULL;
    22                
     22
    2323        if(matrix){
    2424                /*create the matlab matrixwith Matlab's memory manager */   
     
    6767/*FUNCTION WriteData(mxArray** pdataref,double* vector, int M){{{*/
    6868void WriteData(mxArray** pdataref,double* vector, int M){
    69        
     69
    7070        mxArray* dataref       = NULL;
    7171        double*  vector_matlab = NULL;
     
    225225/*FUNCTION WriteData(mxArray** pdataref,SeqMat<double>* matrix){{{*/
    226226void WriteData(mxArray** pdataref,SeqMat<double>* matrix){
    227                
     227
    228228        int      i,j;
    229229        int      rows,cols;
     
    231231        double  *matrix_ptr  = NULL;
    232232        double  *tmatrix_ptr = NULL;
    233        
     233
    234234        if(matrix){
    235                
     235
    236236                matrix_ptr=matrix->ToSerial();
    237237                matrix->GetSize(&rows,&cols);
     
    244244                        }
    245245                }
    246                
     246
    247247                /*create matlab matrix: */
    248248                dataref=mxCreateDoubleMatrix(0,0,mxREAL);
     
    263263/*FUNCTION WriteData(mxArray** pdataref,SeqVec<double>* vector){{{*/
    264264void WriteData(mxArray** pdataref,SeqVec<double>* vector){
    265        
     265
    266266        mxArray* dataref=NULL;
    267267        double*  vector_ptr=NULL;
    268268        double*  vector_matlab=NULL;
    269269        int      rows;
    270        
     270
    271271        if(vector){
    272272                /*call toolkit routine: */
    273273                vector_ptr=vector->ToMPISerial();
    274274                vector->GetSize(&rows);
    275                
     275
    276276                /*now create the matlab vector with Matlab's memory manager */
    277277                vector_matlab=(double*)mxMalloc(rows*sizeof(double));
     
    299299        mxArray* field = NULL;
    300300
    301 
    302301        /*Convert field*/
    303302        WriteData(&field,fieldpointer,M,N);
  • issm/trunk-jpl/src/c/matlab/io/mxGetAssignedField.cpp

    r12013 r13622  
    2020        //output
    2121        mxArray* mxfield=NULL;
    22        
     22
    2323        //input
    2424        mxArray    *inputs[2];
  • issm/trunk-jpl/src/c/modules/AddExternalResultx/AddExternalResultx.cpp

    r13380 r13622  
    88#include "../../io/io.h"
    99#include "../../classes/objects/objects.h"
    10                
     10
    1111void AddExternalResultx( DataSet* results, int enumtype, IssmDouble value){
    1212        /* Add new result in into results*/
  • issm/trunk-jpl/src/c/modules/AverageFilterx/AverageFilterx.cpp

    r12450 r13622  
    1111
    1212int AverageFilterx(double** pimageout,double* image, int lines,int samps,int smooth){
    13        
     13
    1414        double      temp;
    1515        int         numvalues;
  • issm/trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp

    r13216 r13622  
    1818#include "../modules.h"
    1919
    20                        
    2120void AverageOntoPartitionx(double** paverage, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* vertex_response){
    2221
  • issm/trunk-jpl/src/c/modules/Chacox/Chacox.cpp

    r12511 r13622  
    2121{
    2222        #ifdef _HAVE_CHACO_ //only works if Chaco library has been compiled in.
    23        
    24        
     23
    2524        extern int Using_Main;  /* is main routine being called? */
    2625        extern char *PARAMS_FILENAME;   /* name of file with parameter updates */
     
    6261        int i,tvwgt;
    6362        double tgoal;
    64 
    65 
    6663
    6764        if (DEBUG_TRACE > 0) {
     
    187184                _printLine_("<Leaving main>");
    188185        }
    189        
     186
    190187        return(0);
    191 
    192188
    193189        #else //ifdef _HAVE_CHACO_
  • issm/trunk-jpl/src/c/modules/Chacox/chaco_seconds.cpp

    r11236 r13622  
    88#endif
    99
     10double chaco_seconds(void){
    1011
    11 
    12 double chaco_seconds(void){
    13    
    1412        double    curtime;
    1513
     
    2220         *is defined in the <sys/time.h> and <sys/resource.h> header files. Leaving it
    2321         *for reference in case we have a problem here in the future*/
    24  
     22
    2523    getrusage(RUSAGE_SELF, &rusage);
    2624    curtime = ((rusage.ru_utime.tv_sec + rusage.ru_stime.tv_sec) +
  • issm/trunk-jpl/src/c/modules/Chacox/input_parse.cpp

    r12511 r13622  
    44
    55#include "./Chacox.h"
    6 
    76
    87#undef __FUNCT__
  • issm/trunk-jpl/src/c/modules/Chacox/user_params.cpp

    r9320 r13622  
    1414#endif
    1515
    16 
    1716#ifdef _HAVE_CHACO_ //only works if dakota library has been compiled in.
    1817
     
    2120#define  TRUE  1
    2221#define  FALSE 0
    23 
    2422
    2523/* Input and ouput control parameters */
     
    3432int       PROMPT = FALSE;        /* Prompt for input? (TRUE/FALSE) */
    3533int       PRINT_HEADERS = FALSE; /* Print pretty output headers (TRUE/FALSE) */
    36 
    3734
    3835/* Eigenvector calculation parameters */
     
    5754int       TIME_KERNELS = FALSE; /* Time numerical kernels? (TRUE/FALSE) */
    5855
    59 
    6056/* Other parameters for spectral methods */
    6157
     
    6965int       OPT3D_NTRIES = 5;     /* # local opts to look for global min in opt3d */
    7066
    71 
    7267/* Kernighan--Lin/Fiduccia--Mattheyses parameters */
    7368
     
    7873int       KL_UNDO_LIST = TRUE;  /* Only resort changed vtxs? (TRUE/FALSE) */
    7974double    KL_IMBALANCE = 0.0;   /* Fractional imbalance allowed by KL */
    80 
    8175
    8276/* Coarsening parameters */
     
    9185int       KL_ONLY_BNDY = TRUE;     /* Start moving vtxs on boundary? (TRUE/FALSE) */
    9286
    93 
    9487/* Parameters for post-processing options */
    9588
     
    9790int       INTERNAL_VERTICES = FALSE;    /* ... to up internal vtxs? (TRUE/FALSE) */
    9891int       REFINE_MAP = FALSE;           /* ... to reduce hops? (TRUE/FALSE) */
    99 
    10092
    10193/* Architecture and simulator parameters */
     
    129121char     *PARAMS_FILENAME = "User_Params";      /* File of parameter changes */
    130122
    131 
    132123/* Parameters that control debugging output */
    133124
     
    151142int       DEBUG_MACH_PARAMS = 0;/* Print computed machine params? (0..1) */
    152143
    153 
    154144#endif //ifdef _HAVE_CHACO_
  • issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp

    r13216 r13622  
    3838        /*Assign output pointers: */
    3939        *psigma=sigma;
    40        
     40
    4141}
  • issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp

    r13216 r13622  
    3838        /*Assign output pointers: */
    3939        *peps=eps;
    40        
     40
    4141}
  • issm/trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp

    r12515 r13622  
    2424        /*Get analysis type: */
    2525        parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
    26        
     26
    2727        if(VerboseMProcessor()) _pprintLine_("      Configuring elements...");
    2828        for (i=0;i<elements->Size();i++){
     
    4444                }
    4545        }
    46        
     46
    4747        if(VerboseMProcessor()) _pprintLine_("      Configuring materials...");
    4848        for (i=0;i<materials->Size();i++){
  • issm/trunk-jpl/src/c/modules/ConstraintsStatex/ConstraintsStatex.cpp

    r13412 r13622  
    4141                converged=1;
    4242        }
    43                
     43
    4444        /*Assign output pointers: */
    4545        *pconverged=converged;
  • issm/trunk-jpl/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp

    r13590 r13622  
    1515int RiftIsPresent(Loads* loads,int configuration_type){
    1616
    17 
    1817        int i;
    19        
     18
    2019        int found=0;
    2120        int mpi_found=0;
     
    5049        RiftConstrain(&num_unstable_constraints,loads,configuration_type);
    5150        if(num_unstable_constraints==0)converged=1;
    52        
     51
    5352        if(RiftIsFrozen(loads,configuration_type)){
    5453                converged=1;
     
    6968
    7069        int                     i;
    71        
     70
    7271        /* generic object pointer: */
    7372        Riftfront* riftfront=NULL;
     
    7776        int sum_num_unstable_constraints;
    7877        int num_unstable_constraints=0;
    79                
     78
    8079        /*Enforce constraints: */
    8180        for (i=0;i<loads->Size();i++){
     
    10099        num_unstable_constraints=sum_num_unstable_constraints;
    101100        #endif
    102        
     101
    103102        /*Assign output pointers: */
    104103        *pnum_unstable_constraints=num_unstable_constraints;
     
    110109
    111110        int                     i;
    112        
     111
    113112        /* generic object pointer: */
    114113        Load*      load=NULL;
     
    121120
    122121                if (RiftfrontEnum==loads->GetEnum(i)){
    123                        
     122
    124123                        load=(Load*)loads->GetObjectByOffset(i);
    125124                        if(load->InAnalysis(configuration_type)){
     
    133132                }
    134133        }
    135        
     134
    136135        /*Is there just one found? that would mean we have frozen! : */
    137136        #ifdef _HAVE_MPI_
     
    148147
    149148        int                     i;
    150        
     149
    151150        /* generic object pointer: */
    152151        Load*      load=NULL;
     
    160159                        load=(Load*)loads->GetObjectByOffset(i);
    161160                        if(load->InAnalysis(configuration_type)){
    162                                
     161
    163162                                riftfront=(Riftfront*)load;
    164163                                riftfront->FreezeConstraints();
     
    176175
    177176        int i;
    178        
     177
    179178        Riftfront* riftfront=NULL;
    180179        int found=0;
     
    207206int RiftIsPreStable(Loads* loads){
    208207
    209 
    210208        int i;
    211        
     209
    212210        Riftfront* riftfront=NULL;
    213211        int found=0;
     
    246244void RiftSetPreStable(Loads* loads){
    247245
    248 
    249246        int i;
    250        
     247
    251248        Riftfront* riftfront=NULL;
    252249        int found=0;
     
    268265
    269266        int                     i;
    270        
     267
    271268        /* generic object pointer: */
    272269        Riftfront* riftfront=NULL;
     
    275272        int sum_num_unstable_constraints;
    276273        int num_unstable_constraints=0;
    277                
     274
    278275        /*Enforce constraints: */
    279276        for (i=0;i<loads->Size();i++){
     
    294291        num_unstable_constraints=sum_num_unstable_constraints;
    295292        #endif
    296        
     293
    297294        /*Assign output pointers: */
    298295        *pnum_unstable_constraints=num_unstable_constraints;
     
    304301
    305302        int                     i;
    306        
     303
    307304        /* generic object pointer: */
    308305        Riftfront* riftfront=NULL;
     
    346343
    347344        int                     i;
    348        
     345
    349346        /* generic object pointer: */
    350347        Riftfront* riftfront=NULL;
  • issm/trunk-jpl/src/c/modules/ConstraintsStatex/ThermalIsPresent.cpp

    r13590 r13622  
    2727                }
    2828        }
    29        
     29
    3030        #ifdef _HAVE_MPI_
    3131        MPI_Reduce (&found,&mpi_found,1,MPI_INT,MPI_SUM,0,IssmComm::GetComm() );
  • issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp

    r13229 r13622  
    77#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    88#endif
    9 
    109
    1110#include "./ContourToMeshx.h"
     
    2726        num=_NUMTHREADS_;
    2827        #endif
    29 
    3028
    3129        /*output: */
  • issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp

    r13229 r13622  
    1212
    1313void* ContourToMeshxt(void* vpthread_handle){
    14        
     14
    1515        int noerr=1;
    1616
  • issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp

    r13229 r13622  
    3434        /*Assign output pointers: */
    3535        *pflags=flags;
    36        
     36
    3737        return 1;
    3838}
  • issm/trunk-jpl/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp

    r13073 r13622  
    1616        IssmDouble *scalar_list = NULL;
    1717        IssmDouble  scalar;
    18 
    1918
    2019        /*Retrieve some parameters*/
  • issm/trunk-jpl/src/c/modules/CostFunctionx/CostFunctionx.cpp

    r13073 r13622  
    2121        /*output: */
    2222        IssmDouble J,Jplus;
    23        
     23
    2424        /*Recover parameters*/
    2525        parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
  • issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp

    r13216 r13622  
    1111
    1212void CreateJacobianMatrixx(Matrix<IssmDouble>** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax){
    13        
     13
    1414        int      i,connectivity;
    1515        int      numberofdofspernode;
     
    3030        /*Initialize Jacobian Matrix*/
    3131        Jff=new Matrix<IssmDouble>(fsize,fsize,connectivity,numberofdofspernode);
    32        
     32
    3333        /*Create and assemble matrix*/
    3434        for(i=0;i<elements->Size();i++){
  • issm/trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp

    r13216 r13622  
    1313
    1414        int i;
    15        
     15
    1616        /*intermediary: */
    1717        int  numberofdofs;
  • issm/trunk-jpl/src/c/modules/DakotaResponsesx/DakotaResponsesx.cpp

    r13612 r13622  
    1616#include "../../toolkits/toolkits.h"
    1717#include "../modules.h"
    18 
    1918
    2019void DakotaResponsesx(double* d_responses,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,char** responses_descriptors,int numresponsedescriptors,int d_numresponses){
     
    4342        //watch out, we have more d_numresponses than numresponsedescriptors, because the responses have been expanded if they were scaled.
    4443        //because we don't know the d_responses descriptors (the scaled ones) we can't key off them, so we will key off the responses_descriptors: */
    45                
     44
    4645        for(i=0;i<numresponsedescriptors;i++){
    47                
     46
    4847                flag=DescriptorIndex(root,&index,responses_descriptors[i]);
    4948
     
    7776                        //Responsex(responses_pointer,elements,nodes, vertices,loads,materials, parameters,root,process_units);
    7877                        Responsex(&femmodel_response,elements,nodes, vertices,loads,materials, parameters,root,process_units,0);//0 is the index for weights
    79                        
     78
    8079                        if(my_rank==0){
    8180                                /*plug response: */
     
    9392                }
    9493                else if (flag==RegularEnum){
    95                        
     94
    9695                        /*perfectly normal response function: */
    9796                        Responsex(&femmodel_response,elements,nodes, vertices,loads,materials, parameters,root,process_units,0);//0 is the weight index
     
    108107        }
    109108
    110 
    111109        /*Synthesize echo: {{{*/
    112110        if(my_rank==0){
  • issm/trunk-jpl/src/c/modules/Delta18oParameterizationx/Delta18oParameterizationx.cpp

    r12748 r13622  
    1515  int    i;
    1616  Element* element = NULL;
    17  
     17
    1818  /*Compute temperature and precipitation fields: */
    1919  for(i=0;i<elements->Size();i++){
  • issm/trunk-jpl/src/c/modules/ElementConnectivityx/ElementConnectivityx.cpp

    r12450 r13622  
    4141         * Once we get the neighbouring elements, figure out if they share a segment with the current element. If so,
    4242         * plug them in the connectivity, unless they are already there.: */
    43        
     43
    4444        for(n=0;n<nel;n++){
    4545
     
    4747
    4848                for(i=0;i<3;i++){
    49                
     49
    5050                        node=(int)*(elements+n*3+i); //already matlab indexed, elements comes directly from the workspace.
    5151                        index=node-1;
     
    5858                                connectedelement=*(nodeconnectivity+width*index+j);
    5959                                connectedelementindex=(int)(connectedelement-1); //go from matlab indexing to c indexing.
    60                                
     60
    6161                                if(hascommondedge(elements+n*3+0,elements+connectedelementindex*3+0)){
    6262                                        /*Ok, this connected element has a commond edge  with element, plug it into elementconnectivity, unless
     
    8080        *pelementconnectivity=elementconnectivity;
    8181}
    82                                
    8382
    8483int hascommondedge(double* element1,double* element2){
  • issm/trunk-jpl/src/c/modules/ElementResponsex/ElementResponsex.cpp

    r13612 r13622  
    1111
    1212void ElementResponsex( IssmDouble* presponse, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,int response_enum,bool process_units){
    13        
    1413
    1514        int my_rank;
  • issm/trunk-jpl/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp

    r13056 r13622  
    295295        return(iret);
    296296}
    297 
  • issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp

    r13216 r13622  
    2727        gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
    2828        if (gsize==0) _error_("Allocating a Vec of size 0 as gsize=0 for configuration: " << EnumToStringx(configuration_type));
    29        
     29
    3030        /*Initialize solution: */
    3131        solution=new Vector<IssmDouble>(gsize);
    32        
     32
    3333        /*Go through elements and plug solution: */
    3434        for (i=0;i<elements->Size();i++){
  • issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp

    r13216 r13622  
    3737
    3838void GetVectorFromControlInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){
    39        
     39
    4040        /*output: */
    4141        IssmDouble* vector=NULL;
    42        
     42
    4343        /*intermediary: */
    4444        Vector<IssmDouble>* vec_vector=NULL;
  • issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp

    r13216 r13622  
    4242
    4343void GetVectorFromInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){
    44        
     44
    4545        /*output: */
    4646        IssmDouble* vector=NULL;
    47        
     47
    4848        /*intermediary: */
    4949        Vector<IssmDouble>* vec_vector=NULL;
  • issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp

    r13216 r13622  
    1919        Vector<IssmDouble>  *gradient      = NULL;
    2020        Vector<IssmDouble> **gradient_list = NULL;
    21        
     21
    2222        /*retrieve some parameters: */
    2323        parameters->FindParam(&num_controls,InversionNumControlParametersEnum);   _assert_(num_controls);
  • issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp

    r13590 r13622  
    1919        Vector<IssmDouble>*      vec_old_floatingice              = NULL;
    2020        Element* element                          = NULL;
    21        
     21
    2222        if(VerboseModule()) _pprintLine_("   Migrating grounding line");
    23        
     23
    2424        /*retrieve parameters: */
    2525        parameters->FindParam(&migration_style,GroundinglineMigrationEnum);
     
    121121        Element* element                               = NULL;
    122122
    123 
    124123        /*recover parameters: */
    125124        parameters->FindParam(&analysis_type,AnalysisTypeEnum);
     
    132131        nflipped=1; //bootstrap
    133132        while(nflipped){
    134                
     133
    135134                /*Vector of size number of elements*/
    136135                vec_elements_neighboring_floatingice=new Vector<IssmDouble>(elements->NumberOfElements(),true);
     
    155154                }
    156155                vec_nodes_on_floatingice->Assemble();
    157                
     156
    158157                #ifdef _HAVE_MPI_
    159158                MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,IssmComm::GetComm());
  • issm/trunk-jpl/src/c/modules/HoleFillerx/HoleFillerx.cpp

    r12520 r13622  
    1010
    1111int HoleFillerx(double** pimageout,double* image, int lines,int samps,int smooth){
    12        
     12
    1313        FILE                    *fp1;
    1414        unsigned long   filesize;
     
    2929        float                   ssw, wsw, wnw, nnw;     
    3030        float                   sum;
    31        
     31
    3232        time_t                  t1, t2;
    3333
     
    4545        image2 = xNew<double>(lines*samps);
    4646        memcpy(image2,image,lines*samps*sizeof(double));
    47        
     47
    4848        for ( i = 0; i < lines; i++ ){
    4949                for ( j = 0; j < samps; j++ ){
     
    8484
    8585        again2:
    86        
     86
    8787        #ifdef _DEBUG2_
    8888                counter=0;
     
    9999                fflush( stdout );
    100100        #endif
    101        
     101
    102102        afterfirst2:
    103103
     
    128128
    129129                        /* For void edge pixels: */                     
    130                        
     130
    131131                        nsteps = 0.0; ssteps = 0.0; esteps = 0.0; wsteps = 0.0;
    132132                        nwsteps = 0.0; nesteps = 0.0; swsteps = 0.0; sesteps = 0.0;
     
    139139                        ssw = 0.0; wsw = 0.0; wnw = 0.0; nnw = 0.0;
    140140
    141 
    142141/** NSEW **/
    143142                        for ( ii = i - 1; ii >= 0; ii-- ){   /* North */
     
    150149                                if ( *(image2+ii*samps+j) != 0 ){ south = *(image2+ii*samps+j); ssteps = ii - i; break;}
    151150                        }
    152                                
     151
    153152                        for ( jj = j - 1; jj >= 0; jj-- ){   /* West */
    154153                                if ( jj <= 0 ) { west = 0; wsteps = 0; break;}
    155154                                if ( *(image2+i*samps+jj) != 0 ){ west = *(image2+i*samps+jj); wsteps = j - jj; break;}
    156155                        }
    157                                
     156
    158157                        for ( jj = j + 1; jj < samps; jj++ ){ /* East */
    159158                                if ( jj >= samps-1 ){ east = 0; esteps = 0; break;}
     
    161160                        }
    162161
    163                                
    164162/** Diagonals  **/                                             
    165163                        /* Southeast */
     
    169167                                if ( *(image2+ii*samps+jj) != 0 ){ se = *(image2+ii*samps+jj); sesteps = 1.4142 * k; break;}
    170168                        }
    171                        
     169
    172170                        /* Northeast */
    173171                        for ( k = 1; k < infinit; k++ ){
     
    176174                                if ( *(image2+ii*samps+jj) != 0 ){ ne = *(image2+ii*samps+jj); nesteps = 1.4142 * k; break;}
    177175                        }
    178                        
     176
    179177                        /* Northwest */
    180178                        for ( k = 1; k < infinit; k++ ){
     
    183181                                if ( *(image2+ii*samps+jj) != 0 ){ nw = *(image2+ii*samps+jj); nwsteps = 1.4142 * k; break;}
    184182                        }
    185                        
     183
    186184                        /* Southwest */
    187185                        for ( k = 1; k < infinit; k++ ){
     
    198196                                if ( *(image2+ii*samps+jj) != 0 ){ nne = *(image2+ii*samps+jj); nnesteps = 2.2361 * k; break;}
    199197                        }
    200                        
     198
    201199                        /* ENE */
    202200                        for ( k = 1; k < infinit; k++ ){
     
    205203                                if ( *(image2+ii*samps+jj) != 0 ){ ene = *(image2+ii*samps+jj); enesteps = 2.2361 * k; break;}
    206204                        }
    207                        
     205
    208206                        /* ESE */
    209207                        for ( k = 1; k < infinit; k++ ){
     
    212210                                if ( *(image2+ii*samps+jj) != 0 ){ ese = *(image2+ii*samps+jj); esesteps = 2.2361 * k; break;}
    213211                        }
    214                        
     212
    215213                        /* SSE */
    216214                        for ( k = 1; k < infinit; k++ ){
     
    226224                                if ( *(image2+ii*samps+jj) != 0 ){ ssw = *(image2+ii*samps+jj); sswsteps = 2.2361 * k; break;}
    227225                        }
    228                        
     226
    229227                        /* WSW */
    230228                        for ( k = 1; k < infinit; k++ ){
     
    233231                                if ( *(image2+ii*samps+jj) != 0 ){ wsw = *(image2+ii*samps+jj); wswsteps = 2.2361 * k; break;}
    234232                        }
    235                        
     233
    236234                        /* WNW */
    237235                        for ( k = 1; k < infinit; k++ ){
     
    240238                                if ( *(image2+ii*samps+jj) != 0 ){ wnw = *(image2+ii*samps+jj); wnwsteps = 2.2361 * k; break;}
    241239                        }
    242                        
     240
    243241                        /* NNW */
    244242                        for ( k = 1; k < infinit; k++ ){
     
    247245                                if ( *(image2+ii*samps+jj) != 0 ){ nnw = *(image2+ii*samps+jj); nnwsteps = 2.2361 * k; break;}
    248246                        }
    249                        
     247
    250248                        elev = 0; range = 0;
    251249/*NSEW*/                       
     
    259257                        if ( swsteps > 0.5 ){ elev +=    sw / swsteps; range +=  1.00 / swsteps;}
    260258                        if ( sesteps > 0.5 ){ elev +=    se / sesteps; range +=  1.00 / sesteps;}
    261                        
     259
    262260/*Other 8*/
    263261                        if ( nnesteps > 0.5 ){ elev += nne / nnesteps; range +=  1.00 / nnesteps;}
     
    269267                        if ( wnwsteps > 0.5 ){ elev += wnw / wnwsteps; range +=  1.00 / wnwsteps;}
    270268                        if ( nnwsteps > 0.5 ){ elev += nnw / nnwsteps; range +=  1.00 / nnwsteps;}
    271                                                                        
     269
    272270                        //temp = ( elev / range ) + 0.5 ;
    273271                        temp = ( elev / range );
     
    275273                        //if ( temp > 10000 ) temp = 10000;
    276274                        //if ( temp <     0 ) temp =     0;
    277                        
     275
    278276                        #ifdef _DEBUG2_
    279277                                //_printLine_(temp << " " << elev << " " << range << " ");
     
    284282        }
    285283
    286 
    287 
    288284        for ( i = 0; i < lines; i++ ){
    289285                for ( j = 0; j < samps; j++ ){
     
    292288        }
    293289
    294 
    295290        for ( i = 0; i < lines; i++ ){
    296291                for ( j = 0; j < samps; j++ ){
     
    298293                }
    299294        }
    300        
     295
    301296        if ( smooth == 0 ) goto there2;         
    302                
    303                
     297
    304298/************************ SMOOTH THE RESULT ***********************/           
    305                
     299
    306300        image4 = xNew<double>(lines*samps);
    307301        memcpy(image4,image3,lines*samps*sizeof(double));
    308 
    309302
    310303        for ( i = 0; i < lines; i++ ) {
    311304                for ( j = 0; j < samps; j++ ) {
    312305                        if ( *(image4+i*samps+j) != 0 ) { *(image3+i*samps+j) = *(image2+i*samps+j) ; continue; }
    313 
    314306
    315307                        for ( k = 1; k < infinit; k++ ) { /* Find the smallest box size with data */
     
    324316                                }
    325317                        }
    326                
     318
    327319                        k_nowset:
    328320                        k = k / 4; if ( k < 1 ) k = 1; /* Errrrr.  Make it fourth size */
     
    343335        }
    344336
    345                
    346337there2:         
    347 
    348338
    349339        /*Allocate output image: */
     
    352342
    353343        time(&t2);     
    354        
     344
    355345        #ifdef _DEBUG2_
    356346                _printString_( "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b" );
     
    358348                printf ( "\n");
    359349        #endif
    360        
     350
    361351        end:
    362352
  • issm/trunk-jpl/src/c/modules/InputDuplicatex/InputDuplicatex.cpp

    r4967 r13622  
    1010
    1111void InputDuplicatex(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters,int original_enum, int new_enum){
    12        
     12
    1313        /*Go through elemnets, and ask to reinitialie the input: */
    1414        int      i;
  • issm/trunk-jpl/src/c/modules/InputUpdateFromConstantx/InputUpdateFromConstantx.cpp

    r12470 r13622  
    2323                load->InputUpdateFromConstant(constant,name);
    2424        }
    25        
     25
    2626        for(i=0;i<materials->Size();i++){
    2727                Material* material=(Material*)materials->GetObjectByOffset(i);
     
    3030}
    3131void InputUpdateFromConstantx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int    constant, int name){
    32        
     32
    3333        int i;
    3434
     
    4343                load->InputUpdateFromConstant(constant,name);
    4444        }
    45        
     45
    4646        for(i=0;i<materials->Size();i++){
    4747                Material* material=(Material*)materials->GetObjectByOffset(i);
     
    6363                load->InputUpdateFromConstant(constant,name);
    6464        }
    65        
     65
    6666        for(i=0;i<materials->Size();i++){
    6767                Material* material=(Material*)materials->GetObjectByOffset(i);
  • issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp

    r13590 r13622  
    1414        int     i,j,k,l;
    1515        int     dummy;
    16        
     16
    1717        int     numberofvertices;
    1818        int     nrows;
     
    3535
    3636        for(i=0;i<numvariables;i++){
    37        
     37
    3838                descriptor=variables_descriptors[i];
    3939
    4040                /*From descriptor, figure out if the variable is scaled, indexed, nodal, or just a simple variable: */
    4141                if (strncmp(descriptor,"scaled_",7)==0){
    42                        
     42
    4343                        /*Variable is scaled. Determine root name of variable (ex: scaled_DragCoefficient_1 -> DragCoefficient). Allocate distributed_values and fill the
    4444                         * distributed_values with the next npart variables: */
    45                        
     45
    4646                        //strcpy(root,strstr(descriptor,"_")+1); *strstr(root,"_")='\0';
    4747                        memcpy(root,strstr(descriptor,"_")+1,(strlen(strstr(descriptor,"_")+1)+1)*sizeof(char));
    4848                        *strstr(root,"_")='\0';
    49 
    5049
    5150                        distributed_values=xNew<double>(npart);
     
    8281                                PetscSynchronizedFlush(IssmComm::GetComm());
    8382                        #endif
    84                          
    8583
    8684                        /*Update inputs using the parameter matrix: */
  • issm/trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp

    r13216 r13622  
    2323}
    2424
    25 
    2625void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* solution){
    2726
  • issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp

    r13216 r13622  
    2121}
    2222
    23        
    2423void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* vector, int name, int type){
    2524
     
    4645
    4746void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int* vector, int name, int type){
    48        
     47
    4948        int i;
    5049
  • issm/trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp

    r13216 r13622  
    2121}
    2222
    23        
    2423void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* vector, int name, int type){
    2524
     
    4645
    4746void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int* vector, int name, int type){
    48        
     47
    4948        int i;
    5049
  • issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp

    r13229 r13622  
    2121        /*output: */
    2222        SeqVec<IssmPDouble>* data_mesh=NULL;
    23        
     23
    2424        /*Intermediary*/
    2525        double* x=NULL;
     
    312312        _assert_(x2>x1 && y2>y1);
    313313        _assert_(x<=x2 && x>=x1 && y<=y2 && y>=y1);
    314        
     314
    315315        double xm=(x2-x1)/2;
    316316        double ym=(y2-y1)/2;
  • issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp

    r13229 r13622  
    1414                        double* x_prime, double* y_prime, int nods_prime,
    1515                        double* default_values,int num_default_values,Contour<IssmPDouble>** contours,int numcontours){
    16        
     16
    1717        /*Output*/
    1818        SeqVec<IssmPDouble>* data_prime=NULL;
  • issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp

    r13229 r13622  
    1818        int                            my_thread   = handle->id;
    1919        int                            num_threads = handle->num;
    20        
     20
    2121        /*recover parameters :*/
    2222        int     interpolation_type      = gate->interpolation_type;
  • issm/trunk-jpl/src/c/modules/InterpFromMeshToGridx/InterpFromMeshToGridx.cpp

    r13056 r13622  
    6969                }
    7070        }
    71        
     71
    7272        /*Get extreme coordinates of the grid*/
    7373        if (xflip){
  • issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp

    r13056 r13622  
    1515int InterpFromMeshToMesh2dx(double** pdata_interp,int* index_data,double* x_data,double* y_data,int nods_data,int nels_data,
    1616                        double* data,int M_data,int N_data,double* x_interp,double* y_interp,int N_interp,Options* options){
    17        
     17
    1818        /*Output*/
    1919        double* data_interp=NULL;
  • issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp

    r13056 r13622  
    1111
    1212void IoModelToConstraintsx(Constraints* constraints,IoModel* iomodel,int vector_enum,int analysis_type){
    13        
    1413
    1514        /*intermediary: */
     
    4847                /*static: just create Constraints objects*/
    4948                count=0;
    50        
     49
    5150                /*Create Constraints from x,y,z: */
    5251                for (i=0;i<numberofvertices;i++){
    53                        
     52
    5453                        /*keep only this partition's nodes:*/
    5554                        if((iomodel->my_vertices[i])){
     
    7877                /*Create constraints from x,y,z: */
    7978                for (i=0;i<numberofvertices;i++){
    80                        
     79
    8180                        /*keep only this partition's nodes:*/
    8281                        if((iomodel->my_vertices[i])){
  • issm/trunk-jpl/src/c/modules/KMLFileReadx/KMLFileReadx.cpp

    r12520 r13622  
    6565        return(kfil);
    6666}
    67 
  • issm/trunk-jpl/src/c/modules/KMLOverlayx/KMLOverlayx.cpp

    r12519 r13622  
    7979        kdoc=NULL;
    8080
    81 
    8281/*  write kml file  */
    8382
     
    9594        return;
    9695}
    97 
  • issm/trunk-jpl/src/c/modules/Kml2Expx/Kml2Expx.cpp

    r13056 r13622  
    6969        return(iret);
    7070}
    71 
  • issm/trunk-jpl/src/c/modules/MassFluxx/MassFluxx.cpp

    r13590 r13622  
    1616        int      element_id;
    1717        bool     ispresent=false;
    18        
     18
    1919        /*output: */
    2020        IssmDouble mass_flux=0;
     
    4444        segments=array[counter-1]; //matlab to "C" indexing
    4545        num_segments=mdims_array[counter-1];
    46        
     46
    4747        /*Go through segments, and then elements, and figure out which elements belong to a segment.
    4848         * When we find one, use the element to compute the mass flux on the segment: */
     
    7272        xDelete<int>(ndims_array);
    7373        xDelete<IssmDouble*>(array);
    74        
     74
    7575        /*Assign output pointers: */
    7676        *pmass_flux=mass_flux;
  • issm/trunk-jpl/src/c/modules/MaxAbsVxx/MaxAbsVxx.cpp

    r13590 r13622  
    1010
    1111void MaxAbsVxx( IssmDouble* pmaxabsvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
    12        
     12
    1313        int i;
    1414        IssmDouble maxabsvx;
     
    2020                Element* element=(Element*)elements->GetObjectByOffset(i);
    2121                element->MaxAbsVx(&element_maxabsvx,process_units); //go pick up the maximum velocity in the inputs
    22        
     22
    2323                if(i==0)maxabsvx=element_maxabsvx; //initialize maxabsvx
    2424                else{
  • issm/trunk-jpl/src/c/modules/MaxAbsVyx/MaxAbsVyx.cpp

    r13590 r13622  
    1010
    1111void MaxAbsVyx( IssmDouble* pmaxabsvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
    12        
     12
    1313        int i;
    1414        IssmDouble maxabsvy;
     
    1616        IssmDouble element_maxabsvy;
    1717
    18 
    1918        /*Go through elements, and request velocity: */
    2019        for(i=0;i<elements->Size();i++){
    2120                Element* element=(Element*)elements->GetObjectByOffset(i);
    2221                element->MaxAbsVy(&element_maxabsvy,process_units); //go pick up the maximum velocity in the inputs
    23        
     22
    2423                if(i==0)maxabsvy=element_maxabsvy; //initialize maxabsvy
    2524                else{
  • issm/trunk-jpl/src/c/modules/MaxAbsVzx/MaxAbsVzx.cpp

    r13590 r13622  
    1010
    1111void MaxAbsVzx( IssmDouble* pmaxabsvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
    12        
     12
    1313        int i;
    1414        IssmDouble maxabsvz;
     
    2020                Element* element=(Element*)elements->GetObjectByOffset(i);
    2121                element->MaxAbsVz(&element_maxabsvz,process_units); //go pick up the minimum velocity in the inputs
    22        
     22
    2323                if(i==0)maxabsvz=element_maxabsvz; //initialize maxabsvz
    2424                else{
  • issm/trunk-jpl/src/c/modules/MaxVelx/MaxVelx.cpp

    r13590 r13622  
    1111
    1212void MaxVelx( IssmDouble* pmaxvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
    13        
     13
    1414        int i;
    1515        IssmDouble maxvel;
     
    2121                Element* element=(Element*)elements->GetObjectByOffset(i);
    2222                element->MaxVel(&element_maxvel,process_units); //go pick up the maximum velocity in the inputs
    23        
     23
    2424                if(i==0)maxvel=element_maxvel; //initialize maxvel
    2525                else{
  • issm/trunk-jpl/src/c/modules/MaxVxx/MaxVxx.cpp

    r13590 r13622  
    1010
    1111void MaxVxx( IssmDouble* pmaxvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
    12        
     12
    1313        int i;
    1414        IssmDouble maxvx;
     
    2020                Element* element=(Element*)elements->GetObjectByOffset(i);
    2121                element->MaxVx(&element_maxvx,process_units); //go pick up the minimum velocity in the inputs
    22        
     22
    2323                if(i==0)maxvx=element_maxvx; //initialize maxvx
    2424                else{
  • issm/trunk-jpl/src/c/modules/MaxVyx/MaxVyx.cpp

    r13590 r13622  
    2020                Element* element=(Element*)elements->GetObjectByOffset(i);
    2121                element->MaxVy(&element_maxvy,process_units); //go pick up the minimum velocity in the inputs
    22        
     22
    2323                if(i==0)maxvy=element_maxvy; //initialize maxvy
    2424                else{
  • issm/trunk-jpl/src/c/modules/MaxVzx/MaxVzx.cpp

    r13590 r13622  
    1111
    1212void MaxVzx( IssmDouble* pmaxvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
    13        
     13
    1414        int i;
    1515        IssmDouble maxvz;
     
    2121                Element* element=(Element*)elements->GetObjectByOffset(i);
    2222                element->MaxVz(&element_maxvz,process_units); //go pick up the minimum velocity in the inputs
    23        
     23
    2424                if(i==0)maxvz=element_maxvz; //initialize maxvz
    2525                else{
  • issm/trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp

    r13216 r13622  
    4040                VecMergex(ug,uf,nodes,parameters,FsetEnum);
    4141        }
    42        
     42
    4343        /*Merge s set back into g set: */
    4444        if(ssize){
  • issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegment.cpp

    r13220 r13622  
    33
    44#include "./MeshProfileIntersectionx.h"
    5                
     5
    66void ElementSegment(DataSet* segments_dataset,int el,double* xnodes,double* ynodes,double* xsegment,double* ysegment){
    77
     
    1414        double beta1,beta2;
    1515        double gamma1,gamma2;
    16        
     16
    1717        int    edge1,edge2,edge3;
    1818
     
    2121        double xfinal[2],yfinal[2];
    2222
    23        
    2423        /*edge 1: */
    2524        xel[0]=xnodes[0];  yel[0]=ynodes[0]; xel[1]=xnodes[1];  yel[1]=ynodes[1];
     
    4140        }
    4241        else if(    ((edge1==IntersectEnum) && (edge2==IntersectEnum)) || ((edge2==IntersectEnum) && (edge3==IntersectEnum)) || ((edge3==IntersectEnum) && (edge1==IntersectEnum))   ){
    43        
     42
    4443                /*segment interscts 2 opposite edges of our triangle, at 2 segment coordinates, pick up the lowest (coord1) and highest (coord2): */
    4544                if((edge1==IntersectEnum) && (edge2==IntersectEnum)) {coord1=min(alpha1,beta1); coord2=max(alpha1,beta1);}
     
    7776                        coord2=1.0;
    7877                }
    79                
     78
    8079                xfinal[0]=xsegment[0]+coord1*(xsegment[1]-xsegment[0]);
    8180                xfinal[1]=xsegment[0]+coord2*(xsegment[1]-xsegment[0]);
  • issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/ElementSegmentsIntersection.cpp

    r8303 r13622  
    33
    44#include "./MeshProfileIntersectionx.h"
    5                
     5
    66void ElementSegmentsIntersection(DataSet* segments_dataset,int el, double* xnodes,double* ynodes,double* xc,double* yc,int numnodes){
    77
  • issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp

    r13220 r13622  
    3232        /*Loop through all contours: */
    3333        for (i=0;i<numcontours;i++){
    34                
     34
    3535                /*retrieve contour info: */
    3636                contouri=*(contours+i);
     
    4141                /*determine segmentsi and numsegsi for this contour and the mesh intersection: */
    4242                MeshSegmentsIntersection(&segmentsi,&numsegsi,index,x,y,nel,nods,xc,yc,numnodes);
    43                
     43
    4444                /*save segmentsi: */
    4545                allsegments[i]=segmentsi;
  • issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/MeshSegmentsIntersection.cpp

    r13220 r13622  
    1212        Segment<double>* segment=NULL;
    1313        int     numsegs;
    14        
     14
    1515        /*intermediary: */
    1616        DataSet* segments_dataset=NULL;
     
    3535        for(i=0;i<numsegs;i++){
    3636                Segment<double>* segment=(Segment<double>*)segments_dataset->GetObjectByOffset(i);
    37                
     37
    3838                /*x1,y1,x2,y2 then element_id: */
    3939                *(segments+5*i+0)=segment->x1;
  • issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/NodeInElement.cpp

    r8303 r13622  
    1919        y3=ynodes[2];
    2020
    21 
    2221        /*compute determinant: */
    2322        det=x1*y2-x1*y3-x3*y2-x2*y1+x2*y3+x3*y1;
    24        
     23
    2524        /*area coordinates: */
    2625        lambda1=((y2-y3)*(x-x3)+(x3-x2)*(y-y3))/det;
  • issm/trunk-jpl/src/c/modules/MeshProfileIntersectionx/SegmentIntersect.cpp

    r12155 r13622  
    1111        double alpha=-1;
    1212        double beta=-1;
    13        
     13
    1414        double xA,xB,xC,xD,yA,yB,yC,yD;
    1515        double O2A[2],O2B[2],O1C[2],O1D[2];
     
    2929        O1C[0]=xC -(xA/2+xB/2); O1C[1]=yC -(yA/2+yB/2);
    3030        O1D[0]=xD -(xA/2+xB/2); O1D[1]=yD -(yA/2+yB/2);
    31 
    3231
    3332        n1[0]=yA-yB; n1[1]=xB-xA;  //normal vector to segA
  • issm/trunk-jpl/src/c/modules/MinVelx/MinVelx.cpp

    r13590 r13622  
    1111
    1212void MinVelx( IssmDouble* pminvel, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
    13        
     13
    1414        int i;
    1515        IssmDouble minvel;
     
    2121                Element* element=(Element*)elements->GetObjectByOffset(i);
    2222                element->MinVel(&element_minvel,process_units); //go pick up the minimum velocity in the inputs
    23        
     23
    2424                if(i==0)minvel=element_minvel; //initialize minvel
    2525                else{
  • issm/trunk-jpl/src/c/modules/MinVxx/MinVxx.cpp

    r13590 r13622  
    1010
    1111void MinVxx( IssmDouble* pminvx, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
    12        
     12
    1313        int i;
    1414        IssmDouble minvx;
     
    2020                Element* element=(Element*)elements->GetObjectByOffset(i);
    2121                element->MinVx(&element_minvx,process_units); //go pick up the minimum velocity in the inputs
    22        
     22
    2323                if(i==0)minvx=element_minvx; //initialize minvx
    2424                else{
  • issm/trunk-jpl/src/c/modules/MinVyx/MinVyx.cpp

    r13590 r13622  
    1010
    1111void MinVyx( IssmDouble* pminvy, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
    12        
     12
    1313        int i;
    1414        IssmDouble minvy;
     
    2020                Element* element=(Element*)elements->GetObjectByOffset(i);
    2121                element->MinVy(&element_minvy,process_units); //go pick up the minimum velocity in the inputs
    22        
     22
    2323                if(i==0)minvy=element_minvy; //initialize minvy
    2424                else{
  • issm/trunk-jpl/src/c/modules/MinVzx/MinVzx.cpp

    r13590 r13622  
    1010
    1111void MinVzx( IssmDouble* pminvz, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters,bool process_units){
    12        
     12
    1313        int i;
    1414        IssmDouble minvz;
     
    2020                Element* element=(Element*)elements->GetObjectByOffset(i);
    2121                element->MinVz(&element_minvz,process_units); //go pick up the minimum velocity in the inputs
    22        
     22
    2323                if(i==0)minvz=element_minvz; //initialize minvz
    2424                else{
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp

    r13550 r13622  
    1414
    1515void CreateParametersAutodiff(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type){
    16        
     16
    1717        int         i;
    1818        Parameters *parameters       = NULL;
     
    2626        int*        indices=NULL;
    2727        int         num_indices;
    28        
     28
    2929        IssmDouble* xp=NULL;
    3030        IssmDouble* xp_backup=NULL;
    3131        int         num_ind,local_num_ind;
    3232        DataSet*    dependent_objects=NULL;
    33        
     33
    3434        /*Get parameters: */
    3535        parameters=*pparameters;
     
    3737        /*retrieve some parameters: */
    3838        iomodel->Constant(&autodiff_analysis,AutodiffIsautodiffEnum);
    39        
     39
    4040        if(autodiff_analysis){
    4141
    4242                #ifdef _HAVE_ADOLC_
    43        
     43
    4444                /*Copy some parameters from IoModel to parameters dataset: */
    4545                parameters->AddObject(iomodel->CopyConstantObject(AutodiffKeepEnum));
     
    4848                iomodel->Constant(&autodiff_driver,AutodiffDriverEnum);
    4949                parameters->AddObject(iomodel->CopyConstantObject(AutodiffDriverEnum));
    50                
     50
    5151                if(strcmp(autodiff_driver,"fos_forward")==0){
    5252                        parameters->AddObject(iomodel->CopyConstantObject(AutodiffFosForwardIndexEnum));
     
    6666                dependent_objects=new DataSet();
    6767                num_dep=0;
    68                
     68
    6969                if(num_dependent_objects){
    7070                        iomodel->FetchData(&names,&dummy,&dummy,AutodiffDependentObjectNamesEnum);
     
    114114                #endif
    115115        }
    116                
     116
    117117        #ifdef _HAVE_ADOLC_
    118118                /*initialize a placeholder to store solver pointers: {{{*/
     
    129129                /*}}}*/
    130130        #endif
    131        
     131
    132132        /*Assign output pointer: */
    133133        *pparameters=parameters;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp

    r12832 r13622  
    1111
    1212        int    stabilization;   
    13        
     13
    1414        /*Fetch parameters: */
    1515        iomodel->Constant(&stabilization,BalancethicknessStabilizationEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp

    r13073 r13622  
    3131        /*Create loads if they do not exist yet*/
    3232        if(!loads) loads = new Loads();
    33        
     33
    3434        /*Loads only in DG*/
    3535        if (stabilization==3){
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateConstraintsBedSlope.cpp

    r12832 r13622  
    1515        /*Output*/
    1616        Constraints* constraints = NULL;
    17        
     17
    1818        /*Recover pointer: */
    1919        constraints=*pconstraints;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp

    r12832 r13622  
    3131        /*Create nodes if they do not exist yet*/
    3232        if(!nodes) nodes = new Nodes();
    33        
     33
    3434        /*Continuous Galerkin partition of nodes: */
    3535        NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
    36        
     36
    3737        /*First fetch data: */
    3838        iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
     
    4040        for (i=0;i<numberofvertices;i++){
    4141                if(iomodel->my_vertices[i]){
    42                        
     42
    4343                        /*Add node to nodes dataset: */
    4444                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,BedSlopeAnalysisEnum));
     
    4949        /*Clean fetched data: */
    5050        iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
    51        
     51
    5252        /*Assign output pointer: */
    5353        *pnodes=nodes;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/BedSlope/UpdateElementsBedSlope.cpp

    r12832 r13622  
    4242                iomodel->FetchDataToInput(elements,MeshElementonsurfaceEnum);
    4343        }
    44        
     44
    4545        /*Free data: */
    4646        iomodel->DeleteData(1,MeshElementsEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp

    r13283 r13622  
    1313
    1414void CreateParametersControl(Parameters** pparameters,IoModel* iomodel,int solution_type,int analysis_type){
    15        
     15
    1616        int         i;
    1717        Parameters *parameters       = NULL;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp

    r13119 r13622  
    2525        bool   control_analysis;
    2626
    27        
    2827        /*Fetch parameters: */
    2928        iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
     
    6564                }
    6665        }
    67        
     66
    6867        /*Free data: */
    6968        iomodel->DeleteData(1+4+6,MeshElementsEnum,InversionControlParametersEnum,InversionCostFunctionsCoefficientsEnum,InversionMinParametersEnum,InversionMaxParametersEnum,BalancethicknessThickeningRateEnum,VxEnum,VyEnum,FrictionCoefficientEnum,MaterialsRheologyBEnum,MaterialsRheologyZEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateDataSets.cpp

    r13277 r13622  
    1515#include "./ModelProcessorx.h"
    1616
    17 
    1817void CreateDataSets(Elements** pelements,Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads,Parameters** pparameters,IoModel* iomodel,char* rootpath,const int solution_type,const int analysis_type,const int nummodels,int analysis_counter){
    1918
     
    2221        Materials  *materials  = NULL;
    2322        Parameters *parameters = NULL;
    24                        
     23
    2524        /*Create elements, vertices and materials, independent of analysis_type: */
    2625        CreateElementsVerticesAndMaterials(pelements, pvertices, pmaterials, iomodel,nummodels);
     
    4039                        UpdateElementsDiagnosticHoriz(elements,iomodel,analysis_counter,analysis_type);
    4140                        break;
    42                
     41
    4342                case DiagnosticVertAnalysisEnum:
    4443                        CreateNodesDiagnosticVert(pnodes, iomodel);
     
    4746                        UpdateElementsDiagnosticVert(elements,iomodel,analysis_counter,analysis_type);
    4847                        break;
    49        
     48
    5049                case DiagnosticHutterAnalysisEnum:
    5150                        CreateNodesDiagnosticHutter(pnodes, iomodel);
     
    5554                        break;
    5655                #endif
    57                
     56
    5857                #ifdef _HAVE_HYDROLOGY_
    5958                case HydrologyAnalysisEnum:
     
    7271                        UpdateElementsThermal(elements,iomodel,analysis_counter,analysis_type);
    7372                        break;
    74        
     73
    7574                case EnthalpyAnalysisEnum:
    7675                        CreateNodesEnthalpy(pnodes, iomodel);
     
    7978                        UpdateElementsEnthalpy(elements,iomodel,analysis_counter,analysis_type);
    8079                        break;
    81                
     80
    8281                case MeltingAnalysisEnum:
    8382                        CreateNodesMelting(pnodes, iomodel);
     
    122121                #endif
    123122
    124 
    125123                default:
    126124                        _error_("analysis_type: " << EnumToStringx(analysis_type) << " not supported yet!");
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp

    r13129 r13622  
    4141        vertices  = new Vertices();
    4242        materials = new Materials();
    43        
     43
    4444        /*First, partition elements and vertices. Nodes will partitioned on a per analysis_type basis. If partitining already done, ignore: */
    4545        ElementsAndVerticesPartitioning(&iomodel->my_elements,&iomodel->my_vertices,iomodel);
    46        
     46
    4747        iomodel->FetchData(2,MeshElementsEnum,MeshElementconnectivityEnum);
    4848        #ifdef _HAVE_3D_
     
    5050        #endif
    5151        if(control_analysis)iomodel->FetchData(3,InversionControlParametersEnum,InversionMinParametersEnum,InversionMaxParametersEnum);
    52        
     52
    5353        /*Create elements*/
    5454        for (i=0;i<numberofelements;i++){
     
    6262                }
    6363        }
    64        
     64
    6565        /*Create materials*/
    6666        switch(materials_type){
     
    8484        /*Add new constant material property to materials, at the end: */
    8585        materials->AddObject(new Matpar(numberofelements+1,iomodel));//put it at the end of the materials
    86        
     86
    8787        /*Create vertices: */
    8888
     
    9090        iomodel->FetchData(6,MeshElementsEnum,MeshXEnum,MeshYEnum,MeshZEnum,BedEnum,ThicknessEnum);
    9191        CreateNumberNodeToElementConnectivity(iomodel);
    92        
     92
    9393        for (i=0;i<numberofvertices;i++){
    9494
    9595                /*vertices and nodes (same number, as we are running continuous galerkin formulation): */
    9696                if(iomodel->my_vertices[i]){
    97                        
     97
    9898                        /*Add vertex to vertices dataset: */
    9999                        vertices->AddObject(new Vertex(i+1,i,i,iomodel));
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r13486 r13622  
    88#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    99#endif
    10 
    1110
    1211#include "../../Container/Container.h"
     
    2019
    2120void CreateParameters(Parameters** pparameters,IoModel* iomodel,char* rootpath,const int solution_type,int analysis_type,int analysis_counter){
    22        
     21
    2322        int         i,j,m,k;
    2423        int         numoutputs;
     
    4544        /*Initialize dataset: */
    4645        parameters = new Parameters();
    47                
     46
    4847        /*Copy some constants from iomodel */
    4948        parameters->AddObject(iomodel->CopyConstantObject(MeshDimensionEnum));
     
    151150        if(numoutputs)parameters->AddObject(new IntVecParam(SteadystateRequestedOutputsEnum,requestedoutputs,numoutputs));
    152151        iomodel->DeleteData(requestedoutputs,SteadystateRequestedOutputsEnum);
    153        
     152
    154153        iomodel->FetchData(&requestedoutputs,&numoutputs,NULL,PrognosticRequestedOutputsEnum);
    155154        parameters->AddObject(new IntParam(PrognosticNumRequestedOutputsEnum,numoutputs));
    156155        if(numoutputs)parameters->AddObject(new IntVecParam(PrognosticRequestedOutputsEnum,requestedoutputs,numoutputs));
    157156        iomodel->DeleteData(requestedoutputs,PrognosticRequestedOutputsEnum);
    158                
    159        
     157
    160158        /*Deal with mass flux segments: {{{*/
    161159        iomodel->FetchData(&qmu_mass_flux_present,QmuMassFluxSegmentsPresentEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp

    r13483 r13622  
    1717        /*variable declarations: {{{*/
    1818        int i,j,k;
    19        
     19
    2020        Parameters* parameters = NULL;
    2121        int      second_count;
    22        
     22
    2323        int*     part=NULL;
    2424        double*  dpart=NULL;
     
    3535        char* qmuerrname=NULL;
    3636        char* qmuoutname=NULL;
    37        
     37
    3838        //descriptors:
    3939        char tag[50];
    40        
    41                        
     40
    4241        int      M;
    4342        int      m,n;
     
    5049
    5150        /*}}}*/
    52        
     51
    5352        /*recover parameters : */
    5453        parameters=*pparameters;
     
    9291                /*Deal with partitioning: {{{*/
    9392                /*partition vertices in iomodel->qmu_npart parts, unless a partition is already present: */
    94                
     93
    9594                parameters->AddObject(iomodel->CopyConstantObject(QmuNumberofpartitionsEnum));
    9695                iomodel->FetchData(&dpart,NULL,NULL,QmuPartitionEnum);
     
    107106                /*}}}*/
    108107                /*Deal with data needed because of qmu variables: {{{*/
    109                
     108
    110109                for(i=0;i<numvariabledescriptors;i++){
    111110
     
    113112                                /*Ok, we are dealing with a variable that is distributed over nodes. Recover the name of the variable (ex: scaled_Thickness): */
    114113                                sscanf(variabledescriptors[i],"scaled_%s",tag);
    115                                
     114
    116115                                /*Recover data: */
    117116                                iomodel->FetchData(&dakota_parameter,&nrows,&ncols,StringToEnumx(tag));
     
    124123                                        parameters->AddObject(new DoubleTransientMatParam(StringToEnumx(tag),dakota_parameter,nrows,ncols));
    125124                                }
    126                                
     125
    127126                                /*Free ressources:*/
    128127                                xDelete<double>(dakota_parameter);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp

    r13283 r13622  
    6464        /*Create constraints if they do not exist yet*/
    6565        if(!constraints) constraints = new Constraints();
    66        
     66
    6767        /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
    6868        if(!ismacayealpattyn & !isstokes & !isl1l2){
     
    7070                return;
    7171        }
    72        
     72
    7373        /*Constraints: fetch data: */
    7474        iomodel->FetchData(&spcvx,&Mx,&Nx,DiagnosticSpcvxEnum);
     
    324324                }
    325325        }
    326          
     326
    327327        /*Free data: */
    328328        iomodel->DeleteData(spcvx,DiagnosticSpcvxEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp

    r13283 r13622  
    5858                return;
    5959        }
    60        
     60
    6161        /*Create pressure loads as boundary conditions. Pay attention to the partitioning if we are running in parallel (the nodes
    6262         * referenced by a certain load must belong to the cluster node): */
     
    7070        /*First load data:*/
    7171        for (i=0;i<numberofpressureloads;i++){
    72                
     72
    7373                /*Retrieve element to which this icefront belongs: */
    7474                if (dim==2) segment_width=4;
     
    7878                /*Now, if this element is not in the partition, pass: */
    7979                if(!iomodel->my_elements[element]) continue;
    80                
     80
    8181                /*Do not create ice front if Hutter or Stokes elements*/
    8282                if (reCast<int,IssmDouble>(*(elements_type+element))==HutterApproximationEnum) continue;
     
    132132        iomodel->DeleteData(pressureload,DiagnosticIcefrontEnum);
    133133
    134 
    135134        /*Create Penpair for penalties: */
    136135        iomodel->FetchData(&penalties,&numpenalties,NULL,DiagnosticVertexPairingEnum);
    137        
     136
    138137        for(i=0;i<numpenalties;i++){
    139138
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp

    r13051 r13622  
    3535        /*First create nodes*/
    3636        if(!nodes) nodes = new Nodes();
    37        
     37
    3838        /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
    3939        if(!ismacayealpattyn & !isstokes & !isl1l2){
     
    4848        iomodel->FetchData(9,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,FlowequationBordermacayealEnum,FlowequationBorderstokesEnum,
    4949                                MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MaskVertexonwaterEnum,FlowequationVertexEquationEnum,DiagnosticReferentialEnum);
    50        
     50
    5151        for (i=0;i<numberofvertices;i++){
    5252
    5353                if(iomodel->my_vertices[i]){
    54                        
     54
    5555                        /*Add node to nodes dataset: */
    5656                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,DiagnosticHorizAnalysisEnum));
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp

    r13129 r13622  
    8585        elements->InputDuplicate(VxEnum,InversionVxObsEnum);
    8686        if(dakota_analysis)elements->InputDuplicate(VxEnum,QmuVxEnum);
    87        
     87
    8888        elements->InputDuplicate(VyEnum,VyPicardEnum);
    8989        elements->InputDuplicate(VyEnum,InversionVyObsEnum);
    9090        if(dakota_analysis)elements->InputDuplicate(VyEnum,QmuVyEnum);
    91        
     91
    9292        if(dim==3){
    9393                elements->InputDuplicate(VzEnum,VzPicardEnum);
     
    9595                if(dakota_analysis)elements->InputDuplicate(VzEnum,QmuVzEnum);
    9696        }
    97        
     97
    9898        /*Free data: */
    9999        iomodel->DeleteData(2,MeshElementsEnum,FlowequationElementEquationEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp

    r13073 r13622  
    7575        /*Free data: */
    7676        iomodel->DeleteData(3,DiagnosticSpcvxEnum,DiagnosticSpcvyEnum,FlowequationVertexEquationEnum);
    77        
     77
    7878        /*Assign output pointer: */
    7979        *pconstraints=constraints;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp

    r12832 r13622  
    2121        /*Create loads if they do not exist yet*/
    2222        if(!loads) loads = new Loads();
    23        
     23
    2424        /*Assign output pointer: */
    2525        *ploads=loads;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticHutter/UpdateElementsDiagnosticHutter.cpp

    r12832 r13622  
    1919        bool   ishutter;
    2020
    21        
    2221        /*Fetch data needed: */
    2322        iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
     
    3837                }
    3938        }
    40        
     39
    4140        iomodel->FetchDataToInput(elements,ThicknessEnum);
    4241        iomodel->FetchDataToInput(elements,GeometryHydrostaticRatioEnum);
    43        
     42
    4443        /*Free data: */
    4544        iomodel->DeleteData(2,MeshElementsEnum,FlowequationElementEquationEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp

    r12832 r13622  
    4242        /*Continuous Galerkin partition of nodes: */
    4343        NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
    44        
     44
    4545        /*First fetch data: */
    4646        iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
     
    5757        /*Clean fetched data: */
    5858        iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
    59        
     59
    6060        /*Assign output pointer: */
    6161        *pnodes=nodes;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp

    r12832 r13622  
    5454        /*Free data: */
    5555        iomodel->DeleteData(1,MeshElementsEnum);
    56        
     56
    5757}
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/DistributeNumDofs.cpp

    r13056 r13622  
    66#include "../../include/include.h"
    77#include "../../EnumDefinitions/EnumDefinitions.h"
    8        
     8
    99void DistributeNumDofs(DofIndexing* index,int analysis_type,IssmDouble* vertices_type){
    1010
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp

    r13612 r13622  
    106106
    107107                        my_elements[i]=true;
    108                        
     108
    109109                        /*Now that we are here, we can also start building the list of vertices belonging to this cpu partition: we use
    110110                         *the  element index to do this. For each element n, we know index[n][0:2] holds the indices (matlab indexing)
     
    114114                        my_vertices[reCast<int>(*(elements+elements_width*i+1))-1]=1;
    115115                        my_vertices[reCast<int>(*(elements+elements_width*i+2))-1]=1;
    116                        
     116
    117117                        if(elements_width==6){
    118118                                my_vertices[reCast<int>(*(elements+elements_width*i+3))-1]=1;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp

    r13283 r13622  
    2323        IssmDouble heatcapacity;
    2424        IssmDouble referencetemperature;
    25        
     25
    2626        /*Output*/
    2727        IssmDouble *spcvector  = NULL;
     
    8585                /*Create constraints from x,y,z: */
    8686                for (i=0;i<numberofvertices;i++){
    87                        
     87
    8888                        /*keep only this partition's nodes:*/
    8989                        if((iomodel->my_vertices[i])){
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateLoadsEnthalpy.cpp

    r12832 r13622  
    2222        if(!loads) loads = new Loads();
    2323
    24 
    2524        /*Assign output pointer: */
    2625        *ploads=loads;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp

    r12832 r13622  
    2525        /*Fetch parameters: */
    2626        iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
    27        
     27
    2828        /*Recover pointer: */
    2929        nodes=*pnodes;
     
    4040        for (i=0;i<numberofvertices;i++){
    4141                if(iomodel->my_vertices[i]){
    42                        
     42
    4343                        /*Add node to nodes dataset: */
    4444                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,EnthalpyAnalysisEnum));
     
    4949        /*Clean fetched data: */
    5050        iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
    51        
     51
    5252        /*Assign output pointer: */
    5353        *pnodes=nodes;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp

    r12832 r13622  
    5959        iomodel->FetchDataToInput(elements,VyEnum);
    6060        iomodel->FetchDataToInput(elements,VzEnum);
    61        
     61
    6262        /*Free data: */
    6363        iomodel->DeleteData(4,MeshElementsEnum,TemperatureEnum,WaterfractionEnum,PressureEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateConstraintsHydrology.cpp

    r12832 r13622  
    2323        if(!constraints) constraints = new Constraints();
    2424        IoModelToConstraintsx(constraints,iomodel,HydrologySpcwatercolumnEnum,HydrologyAnalysisEnum);
    25        
     25
    2626        /*Assign output pointer: */
    2727        *pconstraints=constraints;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp

    r12832 r13622  
    2525        /*Fetch parameters: */
    2626        iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
    27        
     27
    2828        /*Recover pointer: */
    2929        nodes=*pnodes;
     
    4646        }
    4747        iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
    48        
     48
    4949        /*Assign output pointer: */
    5050        *pnodes=nodes;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp

    r12832 r13622  
    1717
    1818        int    numberofelements;
    19        
     19
    2020        /*Fetch data needed: */
    2121        iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateConstraintsMelting.cpp

    r12832 r13622  
    1616        int i;
    1717        int count;
    18        
     18
    1919        /*Intermediary*/
    2020        Constraints* constraints = NULL;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp

    r12832 r13622  
    2222        /*DataSets: */
    2323        Nodes*    nodes = NULL;
    24        
     24
    2525        /*Fetch parameters: */
    2626        iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
     
    4040
    4141                if(iomodel->my_vertices[i]){
    42                        
     42
    4343                        /*Add node to nodes dataset: */
    4444                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,MeltingAnalysisEnum));
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp

    r12832 r13622  
    5555        iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
    5656        iomodel->FetchDataToInput(elements,PressureEnum);
    57        
     57
    5858        /*Free data: */
    5959        iomodel->DeleteData(1,MeshElementsEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp

    r13432 r13622  
    2121        int   i,analysis_type,dim,verbose;
    2222        bool  isthermal,isprognostic,isdiagnostic,isgroundingline,isenthalpy;
    23        
     23
    2424        /*output: */
    2525        Elements    *elements    = NULL;
     
    3131        Parameters  *parameters  = NULL;
    3232
    33        
    3433        /*Initialize IoModel from input file*/
    3534        IoModel* iomodel = new IoModel(IOMODEL);
     
    6766                if(solution_type==SteadystateSolutionEnum && analysis_type==MeltingAnalysisEnum && isenthalpy==true) continue;
    6867                if(solution_type==SteadystateSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isenthalpy==false) continue;
    69        
     68
    7069                if(VerboseMProcessor()) _pprintLine_("   creating datasets for analysis " << EnumToStringx(analysis_type));
    7170                CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,&parameters,iomodel,rootpath,solution_type,analysis_type,nummodels,i);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp

    r13056 r13622  
    2222
    2323void  NodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, bool continuous){
    24        
     24
    2525        /*First thing, this is a new partition for a new analysis_type, therefore, to avoid a leak, erase the nodes partition that might come through pmy_nodes: */
    2626        xDelete<bool>(*pmy_nodes);
     
    5151}
    5252
    53 
    5453void  DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel){
    5554
     
    6261         * the nodes and the vertices. The vertices are similar to continuous galerkin, but the nodes partitioning involves edges, which mess up sorting of
    6362         * ids. */
    64        
     63
    6564        int i,j;
    6665        int    dim;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp

    r12832 r13622  
    1111
    1212        int stabilization;
    13        
     13
    1414        /*Fetch parameters: */
    1515        iomodel->Constant(&stabilization,PrognosticStabilizationEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp

    r13283 r13622  
    2525        /*DataSet*/
    2626        Loads*    loads    = NULL;
    27        
     27
    2828        /*Fetch parameters: */
    2929        iomodel->Constant(&stabilization,PrognosticStabilizationEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/SortDataSets.cpp

    r12832 r13622  
    1414#include "../../EnumDefinitions/EnumDefinitions.h"
    1515#include "./ModelProcessorx.h"
    16 
    1716
    1817void SortDataSets(Elements** pelements,Nodes** pnodes,Vertices** pvertices, Loads** ploads, Materials** pmaterials, Constraints** pconstraints, Parameters** pparameters){
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateConstraintsSurfaceSlope.cpp

    r12832 r13622  
    1515        /*Output*/
    1616        Constraints* constraints = NULL;
    17        
     17
    1818        /*Recover pointer: */
    1919        constraints=*pconstraints;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp

    r12832 r13622  
    3131        /*Create nodes if they do not exist yet*/
    3232        if(!nodes) nodes = new Nodes();
    33        
     33
    3434        /*Continuous Galerkin partition of nodes: */
    3535        NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
    36        
     36
    3737        /*First fetch data: */
    3838        iomodel->FetchData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
     
    4141
    4242                if(iomodel->my_vertices[i]){
    43                        
     43
    4444                        /*Add node to nodes dataset: */
    4545                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,SurfaceSlopeAnalysisEnum));
     
    5050        /*Clean fetched data: */
    5151        iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
    52        
     52
    5353        /*Assign output pointer: */
    5454        *pnodes=nodes;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp

    r12832 r13622  
    3737        iomodel->FetchDataToInput(elements,BedEnum);
    3838        iomodel->FetchDataToInput(elements,MaskElementonwaterEnum);
    39        
     39
    4040        if (dim==3){
    4141                iomodel->FetchDataToInput(elements,MeshElementonbedEnum);
    4242                iomodel->FetchDataToInput(elements,MeshElementonsurfaceEnum);
    4343        }
    44        
     44
    4545        /*Free data: */
    4646        iomodel->DeleteData(1,MeshElementsEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp

    r12832 r13622  
    1818        int count;
    1919        int    dim;
    20        
     20
    2121        /*Output*/
    2222        Constraints* constraints = NULL;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateLoadsThermal.cpp

    r13056 r13622  
    4040
    4141        for (i=0;i<numberofvertices;i++){
    42        
     42
    4343                /*keep only this partition's nodes:*/
    4444                if((iomodel->my_vertices[i]==1)){
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp

    r12832 r13622  
    4949        /*Clean fetched data: */
    5050        iomodel->DeleteData(6,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
    51        
     51
    5252        /*Assign output pointer: */
    5353        *pnodes=nodes;
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp

    r12832 r13622  
    6060        iomodel->FetchDataToInput(elements,VyEnum);
    6161        iomodel->FetchDataToInput(elements,VzEnum);
    62        
     62
    6363        if(dakota_analysis){
    6464                elements->InputDuplicate(TemperatureEnum,QmuTemperatureEnum);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/UpdateCounters.cpp

    r12832 r13622  
    2626        constraints=*pconstraints;
    2727
    28 
    2928        if(nodes) iomodel->nodecounter=nodes->NumberOfNodes();
    3029        else iomodel->nodecounter=0;
     
    3231        if(loads)iomodel->loadcounter=loads->NumberOfLoads();
    3332        else iomodel->loadcounter=0;
    34        
     33
    3534        if(constraints)iomodel->constraintcounter=constraints->NumberOfConstraints();
    3635        else iomodel->constraintcounter=0;
  • issm/trunk-jpl/src/c/modules/NodeConnectivityx/NodeConnectivityx.cpp

    r13056 r13622  
    3434        double* connectivity=NULL;
    3535
    36 
    37 
    3836        /*Allocate connectivity: */
    3937        connectivity=xNewZeroInit<double>(nods*width);
     
    4644
    4745                for(i=0;i<3;i++){
    48                
     46
    4947                        node=(int)*(elements+n*3+i); //already matlab indexed, elements comes directly from the workspace.
    5048                        index=node-1;
    5149
    5250                        num_elements=(int)*(connectivity+width*index+maxels); //retrieve number of elements already  plugged into the connectivity of this node.
    53                        
     51
    5452                        already_plugged=0;
    5553                        for(j=0;j<num_elements;j++){
     
    6462                        *(connectivity+width*index+num_elements)=element;
    6563                        *(connectivity+width*index+maxels)=(double)(num_elements+1);
    66                        
     64
    6765                }
    6866        }
  • issm/trunk-jpl/src/c/modules/NodesDofx/NodesDofx.cpp

    r8816 r13622  
    1515        int found=0;
    1616        int i;
    17        
     17
    1818        /*Do we have any nodes for this analysis type? :*/
    1919        if(nodes->NumberOfNodes(configuration_type)){
  • issm/trunk-jpl/src/c/modules/Orthx/Orthx.cpp

    r13216 r13622  
    66
    77void    Orthx( Vector<IssmDouble>** pnewgradj, Vector<IssmDouble>* gradj, Vector<IssmDouble>* oldgradj){
    8        
     8
    99        /*output: */
    1010        Vector<IssmDouble>* newgradj=NULL;
  • issm/trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp

    r13612 r13622  
    1515#include "../../io/io.h"
    1616#include "../../classes/objects/objects.h"
    17                
     17
    1818void OutputResultsx(Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results* results){
    1919
     
    2626        char*       solutiontypestring      = NULL;
    2727        bool        dakota_analysis         = false;
    28        
     28
    2929        /*retrieve parameters: */
    3030        parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
    31        
     31
    3232        /*recover my_rank:*/
    3333        my_rank=IssmComm::GetRank();
     
    5454        /*Now, open file for writing, if not already done: */
    5555        if(!parameters->Exist(OutputFilePointerEnum)){
    56                
     56
    5757                /*We don't have a file pointer. Retrieve the output file name and open it for writing:*/
    5858                parameters->FindParam(&outputfilename,OutputfilenameEnum);
     
    7272                }
    7373                xDelete<char>(outputfilename);
    74                
     74
    7575                /*Add file pointer in parameters for further calls to OutputResultsx: */
    7676                parameters->SetParam(fid,OutputFilePointerEnum);
  • issm/trunk-jpl/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp

    r13612 r13622  
    5959                numanalyses=0;
    6060                while ( fgets(line, sizeof line, fid) ){
    61                
     61
    6262                        /*skip comments and empty lines: */
    6363                        if ((line[0]=='%') || (line[0]=='\n') || (line[0]==' ') || (line[0]=='\t') || (line[0]=='\r'))continue;
    64                
     64
    6565                        /*Get rid of end of line: */
    6666                        line[strlen(line)-1]='\0';
    67                
     67
    6868                        if (line[0]=='+'){ /*this is the analysis line: */
    6969                                analyses[numanalyses]=StringToEnumx(&line[1]);  //skip the '+'
  • issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp

    r13229 r13622  
    2424        my_thread=handle->id;
    2525        num_threads=handle->num;
    26        
     26
    2727        /*recover parameters :*/
    2828        x=gate->x;
     
    5757                        if (j==i)continue;
    5858                        distance=sqrt(pow(x[i]-x[j],2)+ pow(y[i]-y[j],2));
    59                        
     59
    6060                        if(distance<=mindistance){
    6161
     
    7474        /*Free ressources:*/
    7575        xDelete<bool>(already);
    76        
     76
    7777        return NULL;
    7878}
  • issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp

    r12704 r13622  
    3535  IssmDouble PDup, PDCUT = 2.0;    // PDcut: rain/snow cutoff temperature (C)
    3636  IssmDouble tstar; // monthly mean surface temp
    37  
     37
    3838  IssmDouble* pdds=NULL;
    3939  IssmDouble* pds=NULL;
    4040  Element* element = NULL;
    41  
     41
    4242  pdds=xNew<IssmDouble>(NPDMAX+1);
    4343  pds=xNew<IssmDouble>(NPDCMAX+1);
    44  
     44
    4545  // initialize PDD (creation of a lookup table)
    4646  tstep = 0.1;
     
    5555
    5656  itm = reCast<int,IssmDouble>((2*siglim/DT + 1.5));
    57  
     57
    5858  if (itm >= NPDMAX){
    5959    _printLine_("increase NPDMAX in massBalance.cpp");
     
    7373  }
    7474  pdds[itm+1] = siglim + DT;
    75  
     75
    7676  //*********compute PD(T) : snow/precip fraction. precipitation falling as snow
    7777  tstepc = 0.1;
     
    100100  pds[itm+1] = 0.;
    101101  //     *******END initialize PDD
    102  
     102
    103103  for(i=0;i<elements->Size();i++){
    104104    element=(Element*)elements->GetObjectByOffset(i);
     
    108108  xDelete<IssmDouble>(pdds);
    109109  xDelete<IssmDouble>(pds);
    110  
     110
    111111}
  • issm/trunk-jpl/src/c/modules/PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.cpp

    r3913 r13622  
    1515        RecursivePropagation(pool, connectivity,index, flags);
    1616}
    17 
    1817
    1918void RecursivePropagation(double* pool, double* connectivity, int index, double* flags){
  • issm/trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.cpp

    r13216 r13622  
    4949        }
    5050
    51 
    5251        /*Free ressources and return*/
    5352        xdelete(&y_s0);
  • issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp

    r13216 r13622  
    55
    66#include "./Reducevectorgtofx.h"
    7  
     7
    88void Reducevectorgtofx(Vector<IssmDouble>** puf, Vector<IssmDouble>* ug, Nodes* nodes,Parameters* parameters){
    99
  • issm/trunk-jpl/src/c/modules/RequestedDependentsx/RequestedDependentsx.cpp

    r13483 r13622  
    1010
    1111void RequestedDependentsx(Results* results,Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters){
    12 
    13 
    1412
    1513        int         i;
  • issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp

    r13216 r13622  
    2929
    3030void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector){
    31        
     31
    3232        IssmDouble* serial_vector=NULL;
    3333
  • issm/trunk-jpl/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp

    r13056 r13622  
    1515
    1616        #ifdef _HAVE_SHAPELIB_ //only works if Shapelib library has been compiled in.
    17        
     17
    1818        double  cm,sp;
    1919
     
    3333
    3434        #ifdef _HAVE_SHAPELIB_ //only works if Shapelib library has been compiled in.
    35        
     35
    3636        int     i,j,k,iret=0;
    3737        int     lwidth=1;
     
    611611        #endif
    612612}
    613 
  • issm/trunk-jpl/src/c/modules/SmbGradientsx/SmbGradientsx.cpp

    r12677 r13622  
    1818
    1919  int    i;
    20  
     20
    2121  Element* element = NULL;
    22  
     22
    2323  for(i=0;i<elements->Size();i++){
    2424    element=(Element*)elements->GetObjectByOffset(i);
  • issm/trunk-jpl/src/c/modules/SmearFunctionx/SmearFunctionx.cpp

    r13599 r13622  
    1111
    1212void SmearFunctionx(Vec* psmearedvector,double (*WeightFunction)(double distance,double radius), int SmearedFieldEnum, double radius,Elements* elements,Nodes* nodes, Parameters* parameters){
    13        
     13
    1414        Element *element = NULL;
    1515        Vec x=NULL;
     
    2929        gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
    3030        smearedvector=NewVec(gsize,IssmComm::GetComm());
    31        
     31
    3232        x=NewVec(gsize,IssmComm::GetComm());
    3333        y=NewVec(gsize,IssmComm::GetComm());
     
    3838        }
    3939
    40 
    41 
    4240        /*Fill smearedvector vector: */
    4341        for (i=0;i<elements->Size();i++){
     
    4644        }
    4745
    48 
    4946        VecAssemblyBegin(smearedvector);
    5047        VecAssemblyEnd(smearedvector);
    51        
     48
    5249        /*Assign output pointers: */
    5350        *psmearedvector=smearedvector;
    5451
    5552}
    56 
  • issm/trunk-jpl/src/c/modules/Solverx/DofTypesToIndexSet.cpp

    r13591 r13622  
    1212#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1313#endif
    14        
     14
    1515void DofTypesToIndexSet(IS* pisv, IS* pisp, Vec df,int typeenum){
    1616
     
    6262                }
    6363                VecRestoreArray(df,&df_local);
    64                
     64
    6565                /*Create indices sets: */
    6666                #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)
  • issm/trunk-jpl/src/c/modules/Solverx/SolverxPetsc.cpp

    r13599 r13622  
    2020        Vec uf0_vector = NULL;
    2121        Vec df_vector  = NULL;
    22        
     22
    2323        if(uf0) uf0_vector = uf0->vector;
    2424        if(df)  df_vector  = df->vector;
     
    148148        if(VerboseSolver())KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);
    149149        KSPSolve(ksp,pf,uf);
    150        
     150
    151151        /*Check convergence*/
    152152        KSPGetIterationNumber(ksp,&iteration_number);
     
    155155        /*Free resources:*/
    156156        KSPFree(&ksp);
    157                
     157
    158158        /*Assign output pointers:*/
    159159        *puf=uf;
  • issm/trunk-jpl/src/c/modules/SpcNodesx/SpcNodesx.cpp

    r9298 r13622  
    1313
    1414        for(int i=0;i<constraints->Size();i++){
    15        
     15
    1616                Constraint* constraint=(Constraint*)constraints->GetObjectByOffset(i);
    1717
  • issm/trunk-jpl/src/c/modules/SurfaceAreax/SurfaceAreax.cpp

    r13590 r13622  
    1212
    1313void SurfaceAreax( IssmDouble* pS, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters){
    14        
     14
    1515        /*Intermediary*/
    1616        Element* element=NULL;
     
    2020        IssmDouble S=0;
    2121        IssmDouble S_sum;
    22        
     22
    2323        /*Compute gradients: */
    2424        for (i=0;i<elements->Size();i++){
  • issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp

    r13216 r13622  
    1111
    1212void SystemMatricesx(Matrix<IssmDouble>** pKff, Matrix<IssmDouble>** pKfs, Vector<IssmDouble>** ppf, Vector<IssmDouble>** pdf, IssmDouble* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool kflag,bool pflag,bool penalty_kflag,bool penalty_pflag){
    13        
     13
    1414        /*intermediary: */
    1515        int      i,j;
     
    1919        Element *element = NULL;
    2020        Load    *load    = NULL;
    21        
     21
    2222        /*output: */
    2323        Matrix<IssmDouble>*    Kff  = NULL;
     
    7070                df->Assemble();
    7171        }
    72        
     72
    7373        if(pflag){
    7474
     
    106106        }
    107107
    108        
    109108        if(penalty_pflag){
    110109
  • issm/trunk-jpl/src/c/modules/TimeAdaptx/TimeAdaptx.cpp

    r13590 r13622  
    2424        /*Go through elements, and figure out the minimum of the time steps for each element (using CFL criterion): */
    2525        element=(Element*)elements->GetObjectByOffset(0); min_dt=element->TimeAdapt();
    26        
     26
    2727        for (i=1;i<elements->Size();i++){
    2828                element=(Element*)elements->GetObjectByOffset(i);
  • issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp

    r13227 r13622  
    7676                }
    7777        }
    78        
     78
    7979        /*fill in the point attribute list: */
    8080        in.pointattributelist = xNew<REAL>(in.numberofpoints*in.numberofpointattributes);
    8181        for (i=0;i<in.numberofpoints;i++) in.pointattributelist[i] = 0.0;
    82        
     82
    8383        /*fill in the point marker list: */
    8484        in.pointmarkerlist = xNew<int>(in.numberofpoints);
     
    9696                in.numberofsegments+=contour->nods-1;
    9797        }
    98        
     98
    9999        in.segmentlist = xNew<int>(in.numberofsegments*2);
    100100        in.segmentmarkerlist = xNewZeroInit<int>(in.numberofsegments);
     
    128128                counter++;
    129129        }
    130        
     130
    131131        /*Build regions: */
    132132        in.numberofregions = 0;
     
    194194        index_matrix=new SeqMat<IssmPDouble>(index,out.numberoftriangles,3,1.0);
    195195        *pindex=index_matrix;
    196        
     196
    197197        segments_matrix=new SeqMat<IssmPDouble>(segments,out.numberofsegments,3,1.0);
    198198        *psegments=segments_matrix;
  • issm/trunk-jpl/src/c/modules/TriaSearchx/TriaSearchx.cpp

    r12832 r13622  
    4040                //Get current point coordinates
    4141                r.x=x0[i]; r.y=y0[i];
    42                
     42
    4343                I=Th.R2ToI2(r);
    4444
  • issm/trunk-jpl/src/c/modules/UpdateConstraintsx/UpdateConstraintsx.cpp

    r12520 r13622  
    2323        /*start module: */
    2424        if(VerboseModule()) _pprintLine_("   Updating constraints for time: " << time);
    25        
     25
    2626        /*First, update dof constraints in nodes, using constraints: */
    2727        SpcNodesx(nodes,constraints,parameters,analysis_type);
  • issm/trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp

    r13216 r13622  
    1111
    1212void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector<IssmDouble>* yg){
    13        
     13
    1414        int configuration_type;
    1515        IssmDouble* yg_serial=NULL;
  • issm/trunk-jpl/src/c/modules/VecMergex/VecMergex.cpp

    r13216 r13622  
    1818        /*retrieve parameters: */
    1919        parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
    20        
     20
    2121        /*serialize uf: */
    2222        uf_serial=uf->ToMPISerial();
    23 
    2423
    2524        /*Do we have any nodes for this configuration? :*/
  • issm/trunk-jpl/src/c/python/io/CheckNumPythonArguments.cpp

    r13056 r13622  
    88#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    99#endif
    10 
    1110
    1211#define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
     
    2322        /*figure out size of tuple in input: */
    2423        size=PyTuple_Size(inputs);
    25        
     24
    2625        /*check on requested size: */
    2726        if (size==0){
  • issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp

    r13484 r13622  
    4747
    4848        bool boolean;
    49        
     49
    5050        /*check this is indeed a subtype of long type: */
    5151        if(!PyBool_Check(py_boolean))_error_("expecting a boolean in input!");
     
    5656        /*simple copy: */
    5757        *pboolean=boolean;
    58        
     58
    5959}
    6060/*}}}*/
     
    7474        dims=PyArray_DIMS((PyArrayObject*)py_matrix);
    7575        M=dims[0]; N=dims[1];
    76        
     76
    7777        if (M && N) {
    7878                /*retrieve internal value: */
     
    110110        dims=PyArray_DIMS((PyArrayObject*)py_matrix);
    111111        M=dims[0]; N=dims[1];
    112        
     112
    113113        if (M && N) {
    114114                /*retrieve internal value: */
     
    143143        dims=PyArray_DIMS((PyArrayObject*)py_vector);
    144144        M=dims[0];
    145        
     145
    146146        if (M) {
    147147                /*retrieve internal value: */
     
    336336        /*convert from bytes to string: */
    337337        string=PyBytes_AS_STRING(py_bytes);
    338        
     338
    339339        *pstring=string;
    340340}
  • issm/trunk-jpl/src/c/python/io/WritePythonData.cpp

    r13447 r13622  
    2424/*FUNCTION WriteData(PyObject* py_tuple,int index,int integer){{{*/
    2525void WriteData(PyObject* py_tuple, int index, int integer){
    26        
     26
    2727        PyTuple_SetItem(py_tuple, index, PyInt_FromSsize_t(integer));
    2828
     
    3030/*FUNCTION WriteData(PyObject* py_tuple,int index,char* string){{{*/
    3131void WriteData(PyObject* py_tuple, int index, char* string){
    32        
     32
    3333        PyTuple_SetItem(py_tuple, index, PyUnicode_FromString(string));
    3434
     
    4848/*FUNCTION WriteData(PyObject* py_tuple,int index){{{*/
    4949void WriteData(PyObject* py_tuple, int index){
    50        
     50
    5151        PyTuple_SetItem(py_tuple, index, Py_None);
    5252
     
    118118/*FUNCTION WriteData(PyObject* py_tuple,int index,SeqMat<double>* matrix){{{*/
    119119void WriteData(PyObject* py_tuple,int index,SeqMat<double>* matrix){
    120        
     120
    121121        int M,N;
    122122        double* buffer=NULL;
    123123        npy_intp dims[2]={0,0};
    124124        PyObject* array=NULL;
    125        
     125
    126126        buffer=matrix->ToSerial();
    127127        matrix->GetSize(&M,&N);
     
    129129        dims[1]=(npy_intp)N;
    130130        array=PyArray_SimpleNewFromData(2,dims,NPY_DOUBLE,buffer);
    131        
     131
    132132        PyTuple_SetItem(py_tuple, index, array);
    133133
     
    135135/*FUNCTION WriteData(PyObject* py_tuple,int index,SeqVec<double>* vector){{{*/
    136136void WriteData(PyObject* py_tuple,int index,SeqVec<double>* vector){
    137        
     137
    138138        int M;
    139139        double* buffer=NULL;
    140140        npy_intp dim=10;
    141141        PyObject* array=NULL;
    142        
     142
    143143        buffer=vector->ToMPISerial();
    144144        vector->GetSize(&M);
    145145        dim=(npy_intp)M;
    146146        array=PyArray_SimpleNewFromData(1,&dim,NPY_DOUBLE,buffer);
    147        
     147
    148148        PyTuple_SetItem(py_tuple, index, array);
    149149}
  • issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp

    r13251 r13622  
    1111 * the allocation routines described here do not work.
    1212 */
    13 
    1413
    1514#ifdef HAVE_CONFIG_H
     
    2827
    2928void xdelete(Matrix<IssmDouble>** pv){
    30        
     29
    3130        if (pv && *pv){
    3231                /*There is no mxDelete in the Matlab API -> using delete trips up Matlab. So we
  • issm/trunk-jpl/src/c/shared/Elements/GetGlobalDofList.cpp

    r12437 r13622  
    99        int* ndof_list=NULL;
    1010        int *doflist = NULL;
    11 
    1211
    1312        if(numnodes){
  • issm/trunk-jpl/src/c/shared/Elements/GetLocalDofList.cpp

    r12437 r13622  
    1515                ndof_list=xNew<int>(numnodes);
    1616                ngdof_list_cumulative=xNew<int>(numnodes);
    17 
    1817
    1918                /*Get number of dofs per node, and total for this given set*/
  • issm/trunk-jpl/src/c/shared/Elements/Paterson.cpp

    r12475 r13622  
    1010
    1111IssmDouble Paterson(IssmDouble temperature){
    12        
     12
    1313        /*output: */
    1414        IssmDouble B;
     
    2929//      % fittedmodel=fit(Temp,B,'cubicspline');
    3030//      % B=fittedmodel(temperature);
    31 
    3231
    3332        if(T<=-45.0){
     
    7069        return B;
    7170}
    72 
    73 
    74 
  • issm/trunk-jpl/src/c/shared/Elements/PddSurfaceMassBalance.cpp

    r12988 r13622  
    1111
    1212  int    iqj,imonth, j;
    13  
     13
    1414  IssmDouble saccu;     // yearly surface accumulation
    1515  IssmDouble smelt;     // yearly melt
     
    1919  IssmDouble runoff; //meltwater only, does not include rain
    2020  IssmDouble sconv; //rhow_rain/rhoi / 12 months
    21  
     21
    2222  IssmDouble density;
    2323  IssmDouble lapser=6.5/1000., sealev=0.;    // lapse rate. degrees per meter. 7.5 lev's 99 paper, 9 Marshall 99 paper
     
    2727  IssmDouble st;             // elevation between altitude of the temp record and current altitude
    2828  IssmDouble sp;             // elevation between altitude of the prec record and current altitude
    29  
     29
    3030  // PDD and PD constants and variables
    3131  IssmDouble siglim;          // sigma limit for the integration which is equal to 2.5 sigmanorm
     
    3535  IssmDouble DT = 0.02;
    3636  IssmDouble pddt, pd; // pd: snow/precip fraction, precipitation falling as snow
    37  
     37
    3838  IssmDouble q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist.
    3939  IssmDouble qm = 0.;        // snow part of the precipitation
     
    4242  IssmDouble pdd = 0.;     
    4343  IssmDouble frzndd = 0.; 
    44  
     44
    4545  IssmDouble tstar;          // monthly mean surface temp
    4646  IssmDouble Tsum= 0.;       // average summer (JJA) temperature
    4747  IssmDouble Tsurf = 0.;     // average annual temperature   
    48  
    4948
    5049  IssmDouble deltm=1./12.;
    5150  int    ismon[12]={11,0,1,2,3,4,5,6,7,8,9,10};
    52  
     51
    5352  IssmDouble snwm;  // snow that could have been melted in a year.
    5453  IssmDouble snwmf; //  ablation factor for snow per positive degree day.
    5554  IssmDouble smf;   //  ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002).
    56  
     55
    5756  IssmDouble dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr
    5857  IssmDouble supice,supcap,diffndd;
    5958  IssmDouble fsupT=0.5,  fsupndd=0.5;  // Tsurf mode factors for supice
    6059  IssmDouble pddtj, hmx2;
    61  
     60
    6261  sconv=(rho_water/rho_ice)/12.; //rhow_rain/rhoi / 12 months
    6362
     
    6867  siglim0c = siglimc/DT + 0.5;
    6968  PDup = siglimc+PDCUT;
    70  
     69
    7170  // seasonal loop
    7271    for (iqj = 0; iqj < 12; iqj++){
    7372      imonth =  ismon[iqj];
    74  
     73
    7574      st=(s-s0t)/1000.;
    7675      tstar = monthlytemperatures[imonth] - lapser *max(st,sealev);
    7776      Tsurf = tstar*deltm+Tsurf;       
    78      
     77
    7978      /*********compute PD ****************/
    8079      if (tstar < PDup){
     
    8382      else {
    8483        pd = 0.;}
    85      
     84
    8685      /******exp des/elev precip reduction*******/
    8786      sp=(s-s0p)/1000.; // deselev effect is wrt chng in topo
    8887      if (sp>0.0){q = exp(-desfac*sp);}
    8988      else {q = 1.0;}
    90      
     89
    9190      qmt= qmt + monthlyprec[imonth]*sconv;  //*sconv to convert in m of ice equivalent per month
    9291      qmpt= q*monthlyprec[imonth]*sconv;           
    9392      qmp= qmp + qmpt;
    9493      qm= qm + qmpt*pd;
    95      
     94
    9695      /*********compute PDD************/
    9796      // ndd(month)=-(tstar-pdd(month)) since ndd+pdd gives expectation of
     
    105104      else{frzndd = frzndd - tstar*deltm; }
    106105  } // end of seasonal loop
    107  
     106
    108107  //******************************************************************
    109108    saccu = qm;
    110109    prect = qmp;     // total precipitation during 1 year taking into account des. ef.
    111110    Tsum=Tsum/3;
    112    
     111
    113112    /***** determine PDD factors *****/
    114113    if(Tsum< -1.) {
     
    126125    snwmf=0.95*snwmf;
    127126    smf=0.95*smf;
    128    
     127
    129128    /*****  compute PDD ablation and refreezing *****/
    130129    pddt = pdd *365;
    131130    snwm = snwmf*pddt;       // snow that could have been melted in a year
    132131    hmx2 = min(h,dfrz);   // refreeze active layer max depth: dfrz
    133    
     132
    134133    if(snwm < saccu) {
    135134      water=prect-saccu + snwm; //water=rain + snowmelt
     
    147146      //     hold the meltwater around for refreezing? And melt-time will have
    148147      //     low seasonal frzndd
    149      
     148
    150149      //      Superimposed ice :  Pfeffer et al. 1991, Tarasov 2002
    151      
     150
    152151      supice= min(hmx2*CovrLm*frzndd+2.2*(saccu-snwm), water); // superimposed ice
    153152      supcap=min(2.2*(saccu-snwm),water);
     
    172171    //     does supice make sense when H< 0.1m? then d=thermoactive ice layer ////
    173172    //     < 0.1
    174    
     173
    175174    //     make more sense to just use residual pdd-ndd except that pdd
    176175    //     residual not clear yet
     
    197196    if(Tsurf<0) {
    198197      Tsurf= min(Tsurf+fsupT*diffndd , 0.);}
    199    
     198
    200199    B = -smelt+saccu;
    201200    B = B/yts;
    202201    pddtj=pddt;
    203  
     202
    204203  return B;
    205204}
  • issm/trunk-jpl/src/c/shared/Exceptions/Exceptions.cpp

    r13612 r13622  
    2929
    3030ErrorException::~ErrorException() throw(){
    31        
     31
    3232        int num_procs;
    33        
     33
    3434        /*recover num_procs:*/
    3535        num_procs=IssmComm::GetSize();
     
    4545
    4646void ErrorException::Report() const{
    47        
     47
    4848        int my_rank;
    4949        int num_procs;
    50        
     50
    5151        /*recover my_rank and num_procs:*/
    5252        my_rank=IssmComm::GetRank();
    5353        num_procs=IssmComm::GetSize();
    54 
    55 
    5654
    5755        if (function_name=="" || file_line==0){ //WINDOWS
  • issm/trunk-jpl/src/c/shared/Exceptions/exprintf.cpp

    r12500 r13622  
    55 * ErrorException(exprintf("%s%i\n","test failed for id:",id));
    66 */
    7 
    87
    98#include <stdarg.h>
  • issm/trunk-jpl/src/c/shared/Exp/DomainOutlineWrite.cpp

    r13353 r13622  
    1212
    1313int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname){
    14        
     14
    1515        /*Error management: */
    1616        int noerr=1;
     
    3333                fprintf(fid,"%s %s\n","##","Icon:0");
    3434                fprintf(fid,"%s %s %s %s\n","#","Points","Count","Value");
    35                
     35
    3636                /*Write number of profile vertices: */
    3737                fprintf(fid,"%u %s\n",profnvertices[counter]  ,"1.");
    38        
     38
    3939                /*Write next line: */
    4040                fprintf(fid,"%s %s %s %s %s\n","#","X","pos","Y","pos");
  • issm/trunk-jpl/src/c/shared/Exp/IsInPoly.cpp

    r13220 r13622  
    1818        int i, j, c = 0;
    1919        double n1, n2, normp, scalar;
    20        
     20
    2121        /*first test, are they colinear? if yes, is the point in the middle of the segment*/
    2222        if (edgevalue != 2 ){
  • issm/trunk-jpl/src/c/shared/Exp/IsInPolySerial.cpp

    r13367 r13622  
    55#include <math.h>
    66
    7 
    87#include "./exp.h"
    9 
    108
    119int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue){
  • issm/trunk-jpl/src/c/shared/Numerics/BrentSearch.cpp

    r13056 r13622  
    4040        maxiter=optpars->maxiter;
    4141        cm_jump=optpars->cm_jump;
    42        
     42
    4343        /*initialize counter and get response at the boundaries*/
    4444        iter=0;
  • issm/trunk-jpl/src/c/shared/Numerics/IsInputConverged.cpp

    r13056 r13622  
    2020        /*output: */
    2121        IssmDouble eps;
    22        
     22
    2323        /*intermediary: */
    2424        IssmDouble *newvalues     = NULL;
  • issm/trunk-jpl/src/c/shared/Numerics/OptimalSearch.cpp

    r13056 r13622  
    3838        x2       =optpars->xmax;
    3939        maxiter  =optpars->maxiter;
    40        
     40
    4141        //get the value of the function at the first boundary
    4242        fx1= (*f)(x1,optargs);
  • issm/trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp

    r13056 r13622  
    1616
    1717char* OptionsFromAnalysis(Parameters* parameters,int analysis_type){
    18        
     18
    1919        /*output: */
    2020        char*   outstring=NULL;
  • issm/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp

    r13521 r13622  
    4040}
    4141
    42 
    4342IssmDouble UnitConversionScaleFactor(int type_enum){
    4443
    4544        IssmDouble yts=365.0*24.0*3600.0;
    46        
     45
    4746        IssmDouble scale;
    4847        switch(type_enum){
  • issm/trunk-jpl/src/c/shared/Numerics/cross.cpp

    r12476 r13622  
    2020
    2121}
    22 
  • issm/trunk-jpl/src/c/shared/Sorting/binary_search.cpp

    r13579 r13622  
    4747                        }
    4848                }
    49                          
     49
    5050                //did we find the target?
    5151                if (*mid == target) {
     
    6060        /*Assign output pointers:*/
    6161        *poffset=offset;
    62        
     62
    6363        /*Return result: */
    6464        return found;
  • issm/trunk-jpl/src/c/shared/String/DescriptorIndex.cpp

    r13056 r13622  
    1818
    1919int  DescriptorIndex(char* root, int* pindex,char* descriptor){ //We assume root has already been allocated, and we just have to copy into it.
    20        
     20
    2121        char * pch=NULL;
    2222
  • issm/trunk-jpl/src/c/shared/Threads/LaunchThread.cpp

    r13056 r13622  
    3131        pthread_t      *threads = NULL;
    3232        pthread_handle *handles = NULL;
    33        
     33
    3434        /*dynamically allocate: */
    3535        threads=xNew<pthread_t>(num_threads);
     
    5252                }
    5353        }
    54        
     54
    5555        /*Free ressources:*/
    5656        xDelete<pthread_t>(threads);
     
    6262        handle.id=0;
    6363        handle.num=1;
    64        
     64
    6565        function((void*)&handle);
    6666        #endif
  • issm/trunk-jpl/src/c/shared/Threads/PartitionRange.cpp

    r9320 r13622  
    1616        int i0=-1;
    1717        int i1=-1;
    18        
     18
    1919        int step;
    2020        int i;
    21 
    2221
    2322        /*distribute elements across threads :*/
     
    2928        }
    3029
    31 
    3230        /*Assign output pointers:*/
    3331        *pi0=i0;
  • issm/trunk-jpl/src/c/shared/TriMesh/AssociateSegmentToElement.cpp

    r8301 r13622  
    66
    77int AssociateSegmentToElement(double** psegments,int nseg, double* index,int nel){
    8        
     8
    99        /*Error management: */
    1010        int i;
     
    3030        return noerr;
    3131}
    32 
    33 
  • issm/trunk-jpl/src/c/shared/TriMesh/OrderSegments.cpp

    r11202 r13622  
    66
    77int OrderSegments(double** psegments,int nseg, double* index,int nel){
    8        
     8
    99        /*Error management: */
    1010        int i;
     
    1818        /*element indices: */
    1919        int el;
    20 
    2120
    2221        /*Recover segments: */
  • issm/trunk-jpl/src/c/shared/TriMesh/SplitMeshForRifts.cpp

    r13248 r13622  
    1212        x and y of size nodsx1
    1313        segments of size nsegsx3*/
    14        
     14
    1515        /*Error management: */
    1616        int noerr=1;
    17        
     17
    1818        int i,j,k,l;
    1919        int node;
     
    2323        int* riftsegments=NULL;
    2424        int* flags=NULL;
    25        
     25
    2626        int  NumGridElementListOnOneSideOfRift;
    2727        int* GridElementListOnOneSideOfRift=NULL;
     
    5555        for (i=0;i<nriftsegs;i++){
    5656                for (j=0;j<2;j++){
    57        
     57
    5858                        node=riftsegments[4*i+j+2];
    5959                        if(flags[node-1]){
     
    6666
    6767                        if(IsGridOnRift(riftsegments,nriftsegs,node)){
    68                        
     68
    6969                                DetermineGridElementListOnOneSideOfRift(&NumGridElementListOnOneSideOfRift,&GridElementListOnOneSideOfRift,i,nriftsegs,riftsegments,node,index,nel);
    70                        
     70
    7171                                /*Summary: we have for node, a list of elements
    7272                                 * (GridElementListOnOneSideOfRift, of size
  • issm/trunk-jpl/src/c/shared/TriMesh/TriMeshUtils.cpp

    r13363 r13622  
    1717        /*Does this node belong to 4 elements, or just 2? If it belongs to 4 elements, it is inside a rift,
    1818         *if it belongs to 2 elements, it is on the tip of a rift, or it has already been split across the rift (see below).*/
    19        
     19
    2020        int i;
    2121        int j;
     
    119119/*FUNCTION RiftSegmentsFromSegments{{{*/
    120120void RiftSegmentsFromSegments(int* pnriftsegs, int** priftsegments, int nel, double* index, int nsegs,double* segments){
    121        
     121
    122122        int i,counter;
    123123        int el,el2;
    124        
     124
    125125        int  nriftsegs;
    126126        int* riftsegments=NULL;
     
    179179
    180180        xDelete<int>(riftsegments_uncompressed);
    181        
     181
    182182        /*Assign output pointers: */
    183183        *priftsegments=riftsegments;
     
    344344        *psegmentmarkerlist=segmentmarkerlist;
    345345        *pnsegs=nsegs;
    346        
     346
    347347        return noerr;
    348348}/*}}}*/
     
    384384        double *segmentmarkerlist = NULL;
    385385        int numsegs;
    386        
     386
    387387        /*output: */
    388388        int      new_numsegs;
     
    460460/*FUNCTION PairRiftElements{{{*/
    461461int PairRiftElements(int** priftsnumpairs, double*** priftspairs,int numrifts,int* riftsnumsegments, double** riftssegments,double* x,double* y){
    462 
    463462
    464463        int noerr=1;
     
    693692        int i;
    694693        int noerr=1;
    695        
     694
    696695        /*output: */
    697696        int riftflag=0;
     
    717716/*FUNCTION OrderRifts{{{*/
    718717int OrderRifts(double** priftstips, double** riftssegments,double** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y,int nods,int nels){
    719        
     718
    720719        int noerr=1;
    721720        int i,j,k,counter;
     
    747746                riftpairs=riftspairs[i];
    748747                numsegs=riftsnumsegments[i];
    749        
     748
    750749                /*Allocate copy of riftsegments and riftpairs,
    751750                 *as well as ordering vector: */
     
    793792                                }
    794793                        }
    795                
     794
    796795                        if (node4==node2){
    797796                                /*node2 is a tip*/
     
    818817                                node1=(int)*(riftsegments+3*j+0);
    819818                                node2=(int)*(riftsegments+3*j+1);
    820                                
     819
    821820                                if ((node1==node) || (node2==node)){
    822821                                        /*Ok, this segment is connected to node, plug its index into order, unless we already plugged it before: */
     
    851850                        *(riftpairs_copy+2*j+1)=*(riftpairs+2*order[j]+1);
    852851                }
    853                
     852
    854853                for (j=0;j<numsegs;j++){
    855854                        *(riftsegments+3*j+0)=*(riftsegments_copy+3*j+0);
     
    873872int PenaltyPairs(double*** priftspenaltypairs,int** priftsnumpenaltypairs,int numrifts,double** riftssegments,
    874873                int* riftsnumsegs,double** riftspairs,double* riftstips,double* x,double* y){
    875                
    876874
    877875        int noerr=1;
     
    906904                /*allocate riftpenaltypairs, and riftnumpenaltypairs: */
    907905                if((numsegs/2-1)!=0)riftpenaltypairs=xNewZeroInit<double>((numsegs/2-1)*RIFTPENALTYPAIRSWIDTH);
    908                
     906
    909907                /*Go through only one flank of the rifts, not counting the tips: */
    910908                counter=0;
     
    997995                        *(riftpenaltypairs+j*7+5)=*(riftpenaltypairs+j*7+5)/magnitude;
    998996                }
    999                
     997
    1000998                riftspenaltypairs[i]=riftpenaltypairs;
    1001999                riftsnumpenaltypairs[i]=(numsegs/2-1);
     
    10351033        y=*py;
    10361034        nods=*pnods;
    1037 
    10381035
    10391036        for (i=0;i<num_seg;i++){
  • issm/trunk-jpl/src/c/shared/Wrapper/ModuleBoot.cpp

    r13231 r13622  
    1313
    1414int ModuleBoot(void){
    15        
     15
    1616        /*Some test for MPI_Init crash with mpich2 1.4 on larsen, just ignore*/
    1717        #ifdef _HAVE_PETSC_
  • issm/trunk-jpl/src/c/solutions/diagnostic_core.cpp

    r13621 r13622  
    9595        }
    9696
    97 
    9897        if(save_results){
    9998                if(VerboseSolution()) _pprintLine_("   saving results");
  • issm/trunk-jpl/src/c/solvers/solver_nonlinear.cpp

    r13325 r13622  
    2323        Vector<IssmDouble>* df  = NULL;
    2424        Vector<IssmDouble>* ys  = NULL;
    25        
     25
    2626        Loads* loads=NULL;
    2727        bool converged;
  • issm/trunk-jpl/src/c/solvers/solver_stokescoupling_nonlinear.cpp

    r13216 r13622  
    4242        femmodel->parameters->FindParam(&max_nonlinear_iterations,DiagnosticMaxiterEnum);
    4343        UpdateConstraintsx(femmodel->nodes,femmodel->constraints,femmodel->parameters);
    44        
     44
    4545        count=1;
    4646        converged=false;
     
    5656                femmodel->SetCurrentConfiguration(DiagnosticHorizAnalysisEnum);
    5757                femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
    58        
     58
    5959                //Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)
    6060                InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug_horiz);
     
    7777                femmodel->SetCurrentConfiguration(DiagnosticVertAnalysisEnum);
    7878                femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
    79                
     79
    8080                /*solve: */
    8181                SystemMatricesx(&Kff_vert, &Kfs_vert, &pf_vert,  &df_vert,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
  • issm/trunk-jpl/src/c/solvers/solver_thermal_nonlinear.cpp

    r13216 r13622  
    3535        bool lowmem=0;
    3636        int  configuration_type;
    37 
    3837
    3938        /*Recover parameters: */
     
    7675
    7776                InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,converged,ConvergedEnum);
    78                
     77
    7978                if(converged)break;
    8079        }
  • issm/trunk-jpl/src/c/toolkits/mpi/patches/DetermineLocalSize.cpp

    r13612 r13622  
    2626        MPI_Comm_size(comm,&num_procs);
    2727
    28        
    2928        /*We are  not bound by any library, just use what seems most logical*/
    3029        num_local_rows=xNew<int>(num_procs);   
     
    3635                num_local_rows[i]=(int)floor((double)global_size/(double)num_procs);
    3736        }
    38        
     37
    3938        /*There may be some rows left. Distribute evenly.*/
    4039        row_rest=global_size - num_procs*(int)floor((double)global_size/(double)num_procs);
     
    4342        }
    4443        local_size=num_local_rows[my_rank];
    45        
     44
    4645        /*free ressources: */
    4746        xDelete<int>(num_local_rows);
  • issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp

    r13596 r13622  
    4646        int* idxm=NULL;
    4747        int* idxn=NULL;
    48        
     48
    4949        if(M)idxm=xNew<int>(M);
    5050        if(N)idxn=xNew<int>(N);
     
    5252        for(i=0;i<M;i++)idxm[i]=i;
    5353        for(i=0;i<N;i++)idxn[i]=i;
    54 
    5554
    5655        this->matrix=NewMat(M,N,sparsity,IssmComm::GetComm());
     
    6665/*FUNCTION PetscMat::PetscMat(int M,int N, int connectivity, int numberofdofspernode){{{*/
    6766PetscMat::PetscMat(int M,int N, int connectivity,int numberofdofspernode){
    68        
     67
    6968        this->matrix=NewMat(M,N,connectivity,numberofdofspernode,IssmComm::GetComm());
    7069
     
    9998IssmDouble PetscMat::Norm(NormMode mode){
    10099
    101 
    102100        IssmDouble norm=0;
    103101        _assert_(this->matrix);
    104102        MatNorm(this->matrix,ISSMToPetscNormMode(mode),&norm);
    105        
     103
    106104        return norm;
    107105
  • issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscVec.cpp

    r13599 r13622  
    2929/*FUNCTION PetscVec::PetscVec(int M,bool fromlocalsize){{{*/
    3030PetscVec::PetscVec(int M,bool fromlocalsize){
    31        
     31
    3232        this->vector=NewVec(M,IssmComm::GetComm(),fromlocalsize);
    3333
     
    7979/*FUNCTION PetscVec::Assemble{{{*/
    8080void PetscVec::Assemble(void){
    81                
     81
    8282        _assert_(this->vector);
    8383        VecAssemblyBegin(this->vector);
     
    8888/*FUNCTION PetscVec::SetValues{{{*/
    8989void PetscVec::SetValues(int ssize, int* list, IssmDouble* values, InsMode mode){
    90        
     90
    9191        _assert_(this->vector);
    9292        VecSetValues(this->vector,ssize,list,values,ISSMToPetscInsertMode(mode));
     
    128128/*FUNCTION PetscVec::Duplicate{{{*/
    129129PetscVec* PetscVec::Duplicate(void){
    130        
     130
    131131        PetscVec* output=NULL;
    132132        _assert_(this->vector);
     
    165165/*FUNCTION PetscVec::ToMPISerial{{{*/
    166166IssmDouble* PetscVec::ToMPISerial(void){
    167        
     167
    168168        IssmDouble* vec_serial=NULL;
    169169        VecToMPISerial(&vec_serial, this->vector,IssmComm::GetComm());
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp

    r13612 r13622  
    33 *  lower row and upper row from a matrix a cpu owns.
    44 */
    5 
    65
    76#ifdef HAVE_CONFIG_H
     
    1918        int my_rank;
    2019        int num_procs;
    21        
     20
    2221        /*recover my_rank and num_procs:*/
    2322        MPI_Comm_size(comm,&num_procs);
     
    2625        /*output: */
    2726        int lower_row,upper_row;
    28        
     27
    2928        /*intermediary :*/
    3029        int i;
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscInsertMode.cpp

    r13056 r13622  
    22 * \brief: convert InsertMode from ISSM to Petsc
    33 */
    4 
    54
    65#ifdef HAVE_CONFIG_H
     
    1918#include "../../../shared/shared.h"
    2019
    21 
    2220InsertMode ISSMToPetscInsertMode(InsMode mode){
    2321
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscMatrixType.cpp

    r13056 r13622  
    22 * \brief: convert MatrixType from ISSM to Petsc
    33 */
    4 
    54
    65#ifdef HAVE_CONFIG_H
     
    1918#include "../../../shared/shared.h"
    2019
    21 
    2220MatType ISSMToPetscMatrixType(MatrixType type){
    2321
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/ISSMToPetscNormMode.cpp

    r13056 r13622  
    22 * \brief: convert NormMode from ISSM to Petsc
    33 */
    4 
    54
    65#ifdef HAVE_CONFIG_H
     
    1918#include "../../../shared/shared.h"
    2019
    21 
    2220NormType ISSMToPetscNormMode(NormMode mode){
    2321
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/KSPFree.cpp

    r9826 r13622  
    88#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    99#endif
    10 
    1110
    1211/*Petsc includes: */
     
    2625
    2726}
    28 
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/MatFree.cpp

    r9826 r13622  
    88#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    99#endif
    10 
    1110
    1211/*Petsc includes: */
     
    2625
    2726}
    28 
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/MatMultPatch.cpp

    r13612 r13622  
    4343
    4444int MatMultCompatible(Mat A,Vec x,COMM comm){
    45        
     45
    4646        /*error management*/
    47        
     47
    4848        int local_m,local_n;
    4949        int lower_row,upper_row,range;
     
    5151        int sumresult;
    5252        int num_procs;
    53        
     53
    5454        /*recover num_procs:*/
    5555        MPI_Comm_size(comm,&num_procs);
     
    5757        MatGetLocalSize(A,&local_m,&local_n);;
    5858        VecGetLocalSize(x,&range);;
    59        
     59
    6060        if (local_n!=range)result=0;
    61        
     61
    6262        /*synchronize result: */
    6363        MPI_Reduce (&result,&sumresult,1,MPI_INT,MPI_SUM,0,comm );
     
    8181        /*output: */
    8282        Vec outvector=NULL;
    83        
     83
    8484        /*Create outvector with local size m*/
    8585        VecCreate(comm,&outvector); ;
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/MatToSerial.cpp

    r13612 r13622  
    99#endif
    1010
    11 
    1211#include "../petscincludes.h"
    1312#include "../../../shared/shared.h"
     
    1817        int my_rank;
    1918        int num_procs;
    20        
     19
    2120        /*Petsc variables*/
    2221        PetscInt lower_row,upper_row;
     
    2827        double* local_matrix=NULL; /*matrix local to each node used for temporary holding matrix values*/
    2928        int buffer[3];
    30        
     29
    3130        /*recover my_rank and num_procs:*/
    3231        MPI_Comm_size(comm,&num_procs);
     
    3534        /*Output*/
    3635        double* outmatrix=NULL;
    37        
     36
    3837        /*get matrix size: */
    3938        MatGetSize(matrix,&M,&N);
     
    4342        upper_row--;
    4443        range=upper_row-lower_row+1;
    45        
     44
    4645        /*Local and global allocation*/
    4746        if (my_rank==0)outmatrix=xNew<double>(M*N);
    48        
     47
    4948        if (range){
    5049                local_matrix=xNew<double>(N*range);
    5150                idxm=xNew<int>(range); 
    5251                idxn=xNew<int>(N); 
    53          
     52
    5453                for (i=0;i<N;i++){
    5554                        *(idxn+i)=i;
     
    5857                        *(idxm+i)=lower_row+i;
    5958                }
    60        
     59
    6160                MatGetValues(matrix,range,idxm,N,idxn,local_matrix);     
    6261        }
     
    6463        /*Now each node holds its local_matrix containing range rows.
    6564         * We send these rows to the matrix on node 0*/
    66        
     65
    6766        for (i=1;i<num_procs;i++){
    6867                if (my_rank==i){
     
    8281                memcpy(outmatrix,local_matrix,N*range*sizeof(double));
    8382        }
    84        
     83
    8584        /*Assign output pointer: */
    8685        *poutmatrix=outmatrix;
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp

    r13602 r13622  
    3434        m=DetermineLocalSize(M,comm);
    3535        n=DetermineLocalSize(N,comm);
    36        
     36
    3737        nnz=(int)((double)M*(double)N*sparsity); //number of non zeros.
    3838        d_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
     
    6262        m=DetermineLocalSize(M,comm);
    6363        n=DetermineLocalSize(N,comm);
    64        
     64
    6565        nnz=(int)((double)M*(double)N*sparsity); //number of non zeros.
    6666        d_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
     
    112112        /*preallocation  according to type: */
    113113        MatGetType(outmatrix,&type);
    114        
     114
    115115        #if _PETSC_MAJOR_ == 2
    116116        if((strcmp(type,"mpiaij")==0) || (strcmp(type,"aijmumps")==0)){
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/NewVec.cpp

    r13602 r13622  
    3232                local_size=DetermineLocalSize(size,comm);
    3333        }
    34        
     34
    3535        VecCreate(comm,&vector);
    36        
     36
    3737        VecSetSizes(vector,local_size,PETSC_DECIDE);
    3838        VecSetFromOptions(vector);
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscMatrixToDoubleMatrix.cpp

    r12431 r13622  
    22 * \brief: convert a sparse or dense Petsc matrix into a matlab matrix
    33 */
    4 
    54
    65#ifdef HAVE_CONFIG_H
     
    1918/*Petsc includes: */
    2019#include "../../../shared/shared.h"
    21 
    2220
    2321void PetscMatrixToDoubleMatrix(double** pmatrix, int* prows, int* pcols,Mat petsc_matrix){
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp

    r11466 r13622  
    5353        }
    5454
    55 
    5655        #if _PETSC_MAJOR_ >= 3
    5756        PetscOptionsGetString(PETSC_NULL,"-pc_factor_mat_solver_package",&option[0],100,&flag);
     
    6160        #endif
    6261
    63        
    6462        PetscOptionsGetString(PETSC_NULL,"-issm_option_solver",&option[0],100,&flag);
    6563        if (strcmp(option,"stokes")==0){
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp

    r13571 r13622  
    2121void PetscOptionsInsertMultipleString(char* options_string){
    2222
    23 
    2423        /*The list of options is going to be pairs of the type "-option option_value"*/
    2524        #if _PETSC_MAJOR_ == 2
     
    3534        int first_token=1;
    3635
    37 
    3836        PetscTokenCreate(options_string,' ',&token);
    3937        for (;;){
    40                
    4138
    4239                /*Read next tokens*/
     
    4542                }
    4643                PetscTokenFind(token,&second);
    47                
     44
    4845                if (!first){
    4946                        /*We are at the end of options*/
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/VecDuplicatePatch.cpp

    r9320 r13622  
    88#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    99#endif
    10 
    1110
    1211/*Petsc includes: */
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/VecFree.cpp

    r9826 r13622  
    88#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    99#endif
    10 
    1110
    1211/*Petsc includes: */
     
    2524
    2625}
    27 
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/VecMerge.cpp

    r13056 r13622  
    2222
    2323        int i;
    24        
     24
    2525        /*Petsc matrix*/
    2626        int lower_row,upper_row,range;
     
    5757                VecSetValues(A,range,idxm,values,INSERT_VALUES);
    5858        }
    59        
     59
    6060        /*Assemble vector*/
    6161        VecAssemblyBegin(A);
  • issm/trunk-jpl/src/c/toolkits/petsc/patches/VecToMPISerial.cpp

    r13612 r13622  
    99#endif
    1010
    11 
    1211#include "../petscincludes.h"
    1312#include "../../../shared/shared.h"
    1413
    1514int VecToMPISerial(double** pgathered_vector, Vec vector,COMM comm){
    16        
     15
    1716        int i;
    1817        int num_procs;
     
    2524        int * idxn=NULL;
    2625        int buffer[3];
    27        
     26
    2827        /*intermediary results*/
    2928        double* local_vector=NULL;
     
    3130        /*input*/
    3231        int vector_size;
    33        
     32
    3433        /*Output*/
    3534        double* gathered_vector=NULL; //Global vector holding the final assembled vector on all nodes.
    36        
     35
    3736        /*recover my_rank and num_procs*/
    3837        MPI_Comm_size(comm,&num_procs);
     
    4746        /*Allocate gathered vector on all nodes .*/
    4847        gathered_vector=xNew<double>(vector_size);
    49        
     48
    5049        /*Allocate local vectors*/
    5150        VecGetOwnershipRange(vector,&lower_row,&upper_row);
     
    8988        /*Assign output pointers: */
    9089        *pgathered_vector=gathered_vector;
    91        
     90
    9291        /*free ressources: */
    9392        xDelete<int>(idxn);
    9493        xDelete<double>(local_vector);
    95        
     94
    9695        return 1;
    9796}
  • issm/trunk-jpl/src/c/toolkits/plapack/patches/CyclicalFactorization.cpp

    r12431 r13622  
    33*/
    44#include <math.h>
    5 
    65
    76#include "../../../shared/shared.h"
     
    109
    1110int CyclicalFactorization(int* pnprows,int* pnpcols,int num_procs){
    12        
     11
    1312        int nprows,npcols;
    1413        int last_diff;
     
    6564*/
    6665int SmallestPrimeFactor(int* output,int input){
    67        
     66
    6867        int found=0;
    6968        int i;
  • issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackInvertMatrix.cpp

    r13598 r13622  
    1414
    1515void PlapackInvertMatrixLocalCleanup(PLA_Obj* pa,PLA_Template* ptempl,double** parrayA,int** pidxnA,MPI_Comm* pcomm_2d);
    16        
     16
    1717int PlapackInvertMatrix(Mat* A,Mat* inv_A,int status,int con,COMM comm){
    1818        /*inv_A does not yet exist, inv_A was just allocated, that's all*/
     
    2626        int lower_row,upper_row,range,this_range,this_lower_row;
    2727        MatType type;
    28        
     28
    2929        /*Plapack: */
    3030        MPI_Datatype   datatype;
     
    4242        int* idxnA=NULL;
    4343        int d_nz,o_nz;
    44        
     44
    4545        /*Feedback to client*/
    4646        int computation_status; 
     
    9292        /* Set the datatype */
    9393        datatype = MPI_DOUBLE;
    94        
     94
    9595        /* Copy A into a*/
    9696        PLA_Matrix_create(datatype,mA,nA,templ,PLA_ALIGN_FIRST,PLA_ALIGN_FIRST,&a); 
     
    127127        xDelete<double>(arrayA);
    128128        xDelete<int>(idxnA);
    129        
     129
    130130        /*Finalize PLAPACK*/
    131131        PLA_Finalize();
  • issm/trunk-jpl/src/c/toolkits/plapack/patches/PlapackToPetsc.cpp

    r13598 r13622  
    88int PlapackToPetsc(Mat* A,int local_mA,int local_nA,int mA,int nA,MatType type,PLA_Obj a,PLA_Template templ,int nprows,int npcols,int nb,COMM comm){
    99
    10        
    1110        int i;
    1211
     
    2221        double* local_buffer=NULL;
    2322
    24 
    2523        /*Create matrix A (right now, we just have an allocated pointer A*/
    2624        if (strcasecmp_eq(type,MATMPIAIJ)){
     
    3331                MatCreateMPIDense(comm,local_mA,local_nA, mA,nA,PETSC_NULL,A);
    3432        }
    35        
     33
    3634        MatGetOwnershipRange(*A,&lower_row,&upper_row);
    3735        upper_row--;
    3836        range=upper_row-lower_row+1;
    39        
     37
    4038        /*Build the Plapack row and column indices corresponding to the local_buffer stored in a.
    4139          We need those indices to directly plug local_buffer into the Petsc matrix A. We do not
     
    4341          problem size becomes big. We rely therefore on MatAssembly from Petsc to gather the plapack
    4442          matrix into a Petsc Matrix.*/
    45        
     43
    4644        /*Vector physically based block cyclic distribution: */
    4745        row_nodes=xNew<int>(mA);
     
    8280        /*Get local buffer: */
    8381        PLA_Obj_local_buffer(a,(void**)&local_buffer);
    84        
     82
    8583        /*Insert into invA matrix. Use col oriented insertion, for Plapack is column oriented*/
    8684        MatSetOption(*A,MAT_COLUMN_ORIENTED);
Note: See TracChangeset for help on using the changeset viewer.