Changeset 13216


Ignore:
Timestamp:
08/31/12 17:23:24 (13 years ago)
Author:
Eric.Larour
Message:

NEW: large change to the code, to adapt to ADOLC requirements.

This change relates to the introduction of template classes and functions for the
Option.h abstract class. This is needed, because we want to make the Matlab
API independent from the libCore objects, which are dependent on the IssmDouble*
ADOLC type (adouble), when the Matlab API is dependent on the IssmPDouble* type (double).

To make them independent, we need to be able to specify at run time Options, Matrix and
Vector objects that hold either IssmDouble or IssmPDouble objects. The only way to do
that is through the use of templated classes for Option.h, Matrix and Vector.

The change gets rid of a lot of useless code (especially in the classes/objects/Options
directory), by introducing template versions of the same code.

The bulk of the changes to src/modules and src/mex modules is to adapt to this
new runtime declaration of templated Matrix, Vector and Option objects.

Location:
issm/trunk-jpl/src
Files:
1 added
13 deleted
197 edited

Legend:

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

    r13056 r13216  
    175175        IssmDouble *resultstimes = NULL;
    176176        IssmDouble *vector_serial= NULL;
    177         Vector*     vector       = NULL;
     177        Vector<IssmDouble>*     vector       = NULL;
    178178        bool   io_gather;
    179179        bool   results_as_patches;
     
    233233                        else if(resultssizes[i]==P0Enum) vectorsize=numberofelements;
    234234                        else _error_("Unkown result size: " << EnumToStringx(resultssizes[i]));
    235                         vector=new Vector(vectorsize);
     235                        vector=new Vector<IssmDouble>(vectorsize);
    236236
    237237                        for(int j=0;j<this->Size();j++){
  • issm/trunk-jpl/src/c/Container/Observations.cpp

    r13073 r13216  
    1919#include "./Observations.h"
    2020#include "../shared/shared.h"
     21#include "../Container/Container.h"
     22#include "../classes/classes.h"
    2123#include "../include/include.h"
    2224#include "../modules/modules.h"
  • issm/trunk-jpl/src/c/Container/Observations.h

    r12468 r13216  
    77
    88#include "../include/include.h"
     9#include "../classes/objects/Options/GenericOption.h"
    910
    1011class Quadtree;
  • issm/trunk-jpl/src/c/Container/Options.cpp

    r13056 r13216  
    1919#include "../io/io.h"
    2020#include "../include/include.h"
     21#include "../classes/classes.h"
    2122#include "../shared/shared.h"
    2223#include "../EnumDefinitions/EnumDefinitions.h"
     
    4041int  Options::AddOption(Option* in_option){
    4142
     43        char* name=NULL;
     44       
    4245        vector<Object*>::iterator object;
    4346        Option* option=NULL;
     
    4750
    4851        /*Also, check the option name*/
    49         if(!in_option->name) _error_("input option has an empty name");
    50         if(strchr(in_option->name,'.')) _error_("Option \"" << in_option->name << "\" has a protected character \".\"");
    51         if(strchr(in_option->name,'[')) _error_("Option \"" << in_option->name << "\" has a protected character \"[\"");
    52         if(strchr(in_option->name,']')) _error_("Option \"" << in_option->name << "\" has a protected character \"]\"");
     52        name=in_option->Name();
     53
     54        if(!name) _error_("input option has an empty name");
     55        if(strchr(name,'.')) _error_("Option \"" << name << "\" has a protected character \".\"");
     56        if(strchr(name,'[')) _error_("Option \"" << name << "\" has a protected character \"[\"");
     57        if(strchr(name,']')) _error_("Option \"" << name << "\" has a protected character \"]\"");
    5358
    5459        /*Finally, check that no option of the same name already exists in the dataset*/
     
    5661
    5762                option=(Option*)(*object);
    58                 if (!strcmp(option->name,in_option->name)){
    59                         _error_("Options \"" << in_option->name << "\" found multiple times");
     63                if (!strcmp(option->Name(),name)){
     64                        _error_("Options \"" << name << "\" found multiple times");
    6065                        break;
    6166                }
     
    6671
    6772        return 1;
    68 }
    69 /*}}}*/
    70 /*FUNCTION Options::Get(int* pvalue, char* name){{{*/
    71 void Options::Get(int* pvalue,const char* name){
    72 
    73         vector<Object*>::iterator object;
    74         Option* option=NULL;
    75 
    76         /*Get option*/
    77         option=GetOption(name);
    78 
    79         /*If the pointer is not NULL, the option has been found*/
    80         if(option){
    81                 option->Get(pvalue);
    82         }
    83         /*Else, the Option does not exist, no default provided*/
    84         else{
    85                 _error_("option of name \"" << name << "\" not found, and no default value has been provided");
    86         }
    87 }
    88 /*}}}*/
    89 /*FUNCTION Options::Get(int* pvalue, char* name,int default_value){{{*/
    90 void Options::Get(int* pvalue,const char* name,int default_value){
    91 
    92         vector<Object*>::iterator object;
    93         Option* option=NULL;
    94 
    95         /*Get option*/
    96         option=GetOption(name);
    97 
    98         /*If the pointer is not NULL, the option has been found*/
    99         if(option){
    100                 option->Get(pvalue);
    101         }
    102         /*Else, the Option does not exist, a default is provided here*/
    103         else{
    104                 *pvalue=default_value;
    105         }
    106 }
    107 /*}}}*/
    108 /*FUNCTION Options::Get(IssmDouble* pvalue, char* name){{{*/
    109 void Options::Get(IssmDouble* pvalue,const char* name){
    110 
    111         vector<Object*>::iterator object;
    112         Option* option=NULL;
    113 
    114         /*Get option*/
    115         option=GetOption(name);
    116 
    117         /*If the pointer is not NULL, the option has been found*/
    118         if(option){
    119                 option->Get(pvalue);
    120         }
    121         /*Else, the Option does not exist, no default provided*/
    122         else{
    123                 _error_("option of name \"" << name << "\" not found, and no default value has been provided");
    124         }
    125 }
    126 /*}}}*/
    127 /*FUNCTION Options::Get(IssmDouble* pvalue, char* name,IssmDouble default_value){{{*/
    128 void Options::Get(IssmDouble* pvalue,const char* name,IssmDouble default_value){
    129 
    130         vector<Object*>::iterator object;
    131         Option* option=NULL;
    132 
    133         /*Get option*/
    134         option=GetOption(name);
    135 
    136         /*If the pointer is not NULL, the option has been found*/
    137         if(option){
    138                 option->Get(pvalue);
    139         }
    140         /*Else, the Option does not exist, a default is provided here*/
    141         else{
    142                 *pvalue=default_value;
    143         }
    144 }
    145 /*}}}*/
    146 /*FUNCTION Options::Get(bool* pvalue, char* name){{{*/
    147 void Options::Get(bool* pvalue,const char* name){
    148 
    149         vector<Object*>::iterator object;
    150         Option* option=NULL;
    151 
    152         /*Get option*/
    153         option=GetOption(name);
    154 
    155         /*If the pointer is not NULL, the option has been found*/
    156         if(option){
    157                 option->Get(pvalue);
    158         }
    159         /*Else, the Option does not exist, no default provided*/
    160         else{
    161                 _error_("option of name \"" << name << "\" not found, and no default value has been provided");
    162         }
    163 }
    164 /*}}}*/
    165 /*FUNCTION Options::Get(bool* pvalue, char* name,bool default_value){{{*/
    166 void Options::Get(bool* pvalue,const char* name,bool default_value){
    167 
    168         vector<Object*>::iterator object;
    169         Option* option=NULL;
    170 
    171         /*Get option*/
    172         option=GetOption(name);
    173 
    174         /*If the pointer is not NULL, the option has been found*/
    175         if(option){
    176                 option->Get(pvalue);
    177         }
    178         /*Else, the Option does not exist, a default is provided here*/
    179         else{
    180                 *pvalue=default_value;
    181         }
    182 }
    183 /*}}}*/
    184 /*FUNCTION Options::Get(char** pvalue, char* name){{{*/
    185 void Options::Get(char** pvalue,const char* name){
    186 
    187         vector<Object*>::iterator object;
    188         Option* option=NULL;
    189         char* outstring=NULL;
    190         int   stringsize;
    191 
    192         /*Get option*/
    193         option=GetOption(name);
    194 
    195         /*If the pointer is not NULL, the option has been found*/
    196         if(option){
    197                 option->Get(pvalue);
    198         }
    199         /*Else, the Option does not exist, no default provided*/
    200         else{
    201                 _error_("option of name \"" << name << "\" not found, and no default value has been provided");
    202         }
    203 
    204 }
    205 /*}}}*/
    206 /*FUNCTION Options::Get(char** pvalue, char* name,char* default_value){{{*/
    207 void Options::Get(char** pvalue,const char* name,const char* default_value){
    208 
    209         vector<Object*>::iterator object;
    210         Option* option=NULL;
    211         char* outstring=NULL;
    212         int   stringsize;
    213 
    214         /*Get option*/
    215         option=GetOption(name);
    216 
    217         /*If the pointer is not NULL, the option has been found*/
    218         if(option){
    219                 option->Get(pvalue);
    220         }
    221         /*Else, the Option does not exist, a default is provided here*/
    222         else{
    223                 stringsize=strlen(default_value)+1;
    224                 outstring=xNew<char>(stringsize);
    225                 xMemCpy<char>(outstring,default_value,stringsize);
    226                 *pvalue=outstring;
    227         }
    228 
    229 }
    230 /*}}}*/
    231 /*FUNCTION Options::Get(char*** ppvalue,int* numel,char* name){{{*/
    232 void Options::Get(char*** ppvalue,int* numel,const char* name){
    233 
    234         vector<Object*>::iterator object;
    235         Option* option=NULL;
    236         Option* option2=NULL;
    237         Options* options=NULL;
    238         int   i;
    239 
    240         /*Get option*/
    241         option=GetOption(name);
    242 
    243         /*If the pointer is not NULL, the option has been found*/
    244         if(option){
    245                 /*If the object is a Cell, copy the strings from its options dataset*/
    246                 if(option->ObjectEnum()==OptionCellEnum){
    247                         if (option->NumEl()) {
    248                                 *ppvalue=xNew<char*>(option->NumEl());
    249                                 if (numel) *numel=option->NumEl();
    250                                 option->Get(&options);
    251                                 for (i=0; i<option->NumEl(); i++) {
    252                                         option2=((Option *)options->GetObjectByOffset(i));
    253                                         if(option2->ObjectEnum()==OptionCharEnum)
    254                                                 option2->Get(&((*ppvalue)[i]));
    255                                         else
    256                                                 ((*ppvalue)[i])=NULL;
    257                                 }
    258                         }
    259                 }
    260                 /*If the object is a Char, copy the strings from its concatenation*/
    261                 else if(option->ObjectEnum()==OptionCharEnum){
    262                         option->Get(ppvalue,numel);
    263                 }
    264                 /*Else: not supported*/
    265                 else{
    266                         _error_("Cannot recover field \"" << name << "\" for an option of type " << EnumToStringx(option->ObjectEnum()));
    267                 }
    268         }
    269         /*Else, the Option does not exist, no default provided*/
    270         else{
    271                 *ppvalue=NULL;
    272                 if (numel) *numel=0;
    273         }
    274 
    275 }
    276 /*}}}*/
    277 /*FUNCTION Options::Get(IssmDouble** pvalue,int* numel,const char* name){{{*/
    278 void Options::Get(IssmDouble** pvalue,int* numel,const char* name){
    279 
    280         vector<Object*>::iterator object;
    281         Option* option=NULL;
    282 
    283         /*Get option*/
    284         option=GetOption(name);
    285 
    286         /*If the pointer is not NULL, the option has been found*/
    287         if(option){
    288                 option->Get(pvalue,numel);
    289         }
    290         /*Else, the Option does not exist, no default provided*/
    291         else{
    292                 _error_("option of name \"" << name << "\" not found, and no default value has been provided");
    293         }
    29473}
    29574/*}}}*/
     
    30483
    30584                option=(Option*)(*object);
    306                 if (!strncmp(name,option->name,strlen(option->name))){
     85                if (!strncmp(name,option->Name(),strlen(option->Name()))){
    30786
    30887                        /*OK, now do we have a complete name? If not, it is a cell or a structure, we need to go further*/
    309                         if(!strcmp(name,option->name)){
     88                        if(!strcmp(name,option->Name())){
    31089                                return option;
    31190                        }
     
    31392                                /*If the object is a Cell, recursive call to its options*/
    31493                                if(option->ObjectEnum()==OptionCellEnum){
    315                                         return ((OptionCell*)option)->values->GetOption(name);
     94                                        GenericOption<Options*>* celloption=(GenericOption<Options*>*)option;
     95                                        return celloption->value->GetOption(name);
    31696                                }
    31797                                /*If the object is a Struct loop over its size and recursive call*/
    31898                                else if(option->ObjectEnum()==OptionStructEnum){
    319                                         for(int i=0;i<option->numel;i++){
    320                                                 _assert_(((OptionStruct*)option)->values[i]);
    321                                                 return ((OptionStruct*)option)->values[i]->GetOption(name);
     99                                        for(int i=0;i<option->NumEl();i++){
     100                                                GenericOption<Options**>* structoption=(GenericOption<Options**>*)option;
     101                                                _assert_(structoption->value[i]);
     102                                                return structoption->value[i]->GetOption(name);
    322103                                        }
    323104                                }
  • issm/trunk-jpl/src/c/Container/Options.h

    r12466 r13216  
    55#ifndef _CONTAINER_OPTIONS_H_
    66#define _CONTAINER_OPTIONS_H_
     7
     8#include "../classes/objects/Options/GenericOption.h"
    79
    810/*forward declarations */
     
    2022                int  AddOption(Option* in_oobject);
    2123                Option* GetOption(const char* name);
    22                 void Get(IssmDouble*  pvalue,const char* name);
    23                 void Get(IssmDouble*  pvalue,const char* name,IssmDouble default_value);
    24                 void Get(int*  pvalue,const char* name);
    25                 void Get(int*  pvalue,const char* name,int default_value);
    26                 void Get(bool*    pvalue,const char* name);
    27                 void Get(bool*    pvalue,const char* name,bool default_value);
    28                 void Get(char**   pvalue,const char* name);
    29                 void Get(char**   pvalue,const char* name,const char* default_value);
    30                 void Get(char***  pvalue,int* numel,const char* name);
    31                 void Get(IssmDouble** pvalue,int* numel,const char* name);
     24               
     25               
     26                template <class OptionType> void Get(OptionType* pvalue,const char* name){ /*{{{*/
     27
     28                        vector<Object*>::iterator object;
     29                        GenericOption<OptionType>* genericoption=NULL;
     30
     31                        /*Get option*/
     32                        genericoption=(GenericOption<OptionType>*)GetOption(name);
     33
     34                        /*If the pointer is not NULL, the option has been found*/
     35                        if(genericoption){
     36                                genericoption->Get(pvalue);
     37                        }
     38                        /*Else, the Option does not exist, no default provided*/
     39                        else{
     40                                _error_("option of name \"" << name << "\" not found, and no default value has been provided");
     41                        }
     42                }
     43                /*}}}*/
     44                template <class OptionType> void Get(OptionType* pvalue,int* pnumel, const char* name){ /*{{{*/
     45
     46                        vector<Object*>::iterator object;
     47                        GenericOption<OptionType>* genericoption=NULL;
     48
     49                        /*Get option*/
     50                        genericoption=(GenericOption<OptionType>*)GetOption(name);
     51
     52                        /*If the pointer is not NULL, the option has been found*/
     53                        if(genericoption){
     54                                genericoption->Get(pvalue);
     55                                *pnumel=genericoption->NumEl();
     56                        }
     57                        /*Else, the Option does not exist, no default provided*/
     58                        else{
     59                                _error_("option of name \"" << name << "\" not found, and no default value has been provided");
     60                        }
     61                }
     62                /*}}}*/
     63                template <class OptionType> void Get(OptionType* pvalue,const char* name,OptionType default_value){ /*{{{*/
     64
     65                        vector<Object*>::iterator object;
     66                        GenericOption<OptionType>* genericoption=NULL;
     67
     68                        /*Get option*/
     69                        genericoption=(GenericOption<OptionType>*)GetOption(name);
     70
     71                        /*If the pointer is not NULL, the option has been found*/
     72                        if(genericoption){
     73                                genericoption->Get(pvalue);
     74                        }
     75                        else{
     76                                *pvalue=default_value;
     77                        }
     78                }
     79                /*}}}*/
     80                template <class OptionType> void Get(OptionType* pvalue,int* pnumel, const char* name,OptionType default_value){ /*{{{*/
     81
     82                        vector<Object*>::iterator object;
     83                        GenericOption<OptionType>* genericoption=NULL;
     84
     85                        /*Get option*/
     86                        genericoption=(GenericOption<OptionType>*)GetOption(name);
     87
     88                        /*If the pointer is not NULL, the option has been found*/
     89                        if(genericoption){
     90                                genericoption->Get(pvalue);
     91                                *pnumel=genericoption->NumEl();
     92                        }
     93                        else{
     94                                *pvalue=default_value;
     95                        }
     96                }
     97                /*}}}*/
     98
    3299};
    33100
  • issm/trunk-jpl/src/c/Container/Parameters.cpp

    r13056 r13216  
    244244}
    245245/*}}}*/
    246 /*FUNCTION Parameters::FindParam(Vector** pvec,int enum_type){{{*/
    247 void Parameters::FindParam(Vector** pvec,int enum_type){ _assert_(this);
     246/*FUNCTION Parameters::FindParam(Vector<IssmDouble>** pvec,int enum_type){{{*/
     247void Parameters::FindParam(Vector<IssmDouble>** pvec,int enum_type){ _assert_(this);
    248248       
    249249        vector<Object*>::iterator object;
     
    262262}
    263263/*}}}*/
    264 /*FUNCTION Parameters::FindParam(Matrix** pmat,int enum_type){{{*/
    265 void Parameters::FindParam(Matrix** pmat,int enum_type){ _assert_(this);
     264/*FUNCTION Parameters::FindParam(Matrix<IssmDouble>** pmat,int enum_type){{{*/
     265void Parameters::FindParam(Matrix<IssmDouble>** pmat,int enum_type){ _assert_(this);
    266266       
    267267        vector<Object*>::iterator object;
     
    406406}
    407407/*}}}*/
    408 /*FUNCTION Parameters::SetParam(Vector* vector,int enum_type);{{{*/
    409 void   Parameters::SetParam(Vector* vector,int enum_type){
     408/*FUNCTION Parameters::SetParam(Vector<IssmDouble>* vector,int enum_type);{{{*/
     409void   Parameters::SetParam(Vector<IssmDouble>* vector,int enum_type){
    410410
    411411        Param* param=NULL;
     
    418418}
    419419/*}}}*/
    420 /*FUNCTION Parameters::SetParam(Matrix* matrix,int enum_type);{{{*/
    421 void   Parameters::SetParam(Matrix* matrix,int enum_type){
     420/*FUNCTION Parameters::SetParam(Matrix<IssmDouble>* matrix,int enum_type);{{{*/
     421void   Parameters::SetParam(Matrix<IssmDouble>* matrix,int enum_type){
    422422
    423423        Param* param=NULL;
  • issm/trunk-jpl/src/c/Container/Parameters.h

    r12746 r13216  
    88
    99/*forward declarations */
    10 class Matrix;
    11 class Vector;
     10template <class doublematrix> class Matrix;
     11template <class doubletype> class Vector;
    1212class Materials;
    1313class Parameters;
     
    4141                void  FindParam(IssmDouble** pIssmDoublearray,int* pM,int* pN,int enum_type);
    4242                void  FindParam(IssmDouble*** parray,int* pM, int** pmdims_array,int** pndims_array,int enum_type);
    43                 void  FindParam(Vector** pvec,int enum_type);
    44                 void  FindParam(Matrix** pmat,int enum_type);
     43                void  FindParam(Vector<IssmDouble>** pvec,int enum_type);
     44                void  FindParam(Matrix<IssmDouble>** pmat,int enum_type);
    4545                void  FindParam(FILE** pfid,int enum_type);
    4646               
     
    5454                void  SetParam(int* intarray,int M,int enum_type);
    5555                void  SetParam(int* intarray,int M,int N,int enum_type);
    56                 void  SetParam(Vector* vec,int enum_type);
    57                 void  SetParam(Matrix* mat,int enum_type);
     56                void  SetParam(Vector<IssmDouble>* vec,int enum_type);
     57                void  SetParam(Matrix<IssmDouble>* mat,int enum_type);
    5858                void  SetParam(FILE* fid,int enum_type);
    5959                void  UnitConversion(int direction_enum);
  • issm/trunk-jpl/src/c/Makefile.am

    r13185 r13216  
    132132                                        ./classes/matrix/ElementVector.cpp\
    133133                                        ./classes/matrix/Matrix.h\
    134                                         ./classes/matrix/Matrix.cpp\
    135134                                        ./classes/matrix/Vector.h\
    136                                         ./classes/matrix/Vector.cpp\
    137135                                        ./classes/objects/Params/Param.h\
    138136                                        ./classes/objects/Params/GenericParam.h\
     
    237235                                        ./toolkits/issm/issmtoolkit.h\
    238236                                        ./toolkits/issm/SeqVec.h\
    239                                         ./toolkits/issm/SeqVec.cpp\
    240237                                        ./toolkits/issm/SeqMat.h\
    241                                         ./toolkits/issm/SeqMat.cpp\
    242238                                        ./toolkits/triangle/triangleincludes.h\
    243239                                        ./toolkitsenums.h\
     
    360356                                        ./solvers/solver_nonlinear.cpp\
    361357                                        ./solvers/solver_newton.cpp\
    362                                         ./classes/objects/Options/Option.cpp\
    363358                                        ./classes/objects/Options/Option.h\
    364                                         ./classes/objects/Options/OptionDouble.cpp\
    365                                         ./classes/objects/Options/OptionDouble.h\
    366                                         ./classes/objects/Options/OptionChar.cpp\
    367                                         ./classes/objects/Options/OptionChar.h\
     359                                        ./classes/objects/Options/GenericOption.h\
    368360                                        ./classes/objects/Options/OptionUtilities.cpp\
    369                                         ./classes/objects/Options/OptionUtilities.h\
    370                                         ./classes/objects/Options/OptionLogical.cpp\
    371                                         ./classes/objects/Options/OptionLogical.h\
    372                                         ./classes/objects/Options/OptionStruct.cpp\
    373                                         ./classes/objects/Options/OptionStruct.h\
    374                                         ./classes/objects/Options/OptionCell.cpp\
    375                                         ./classes/objects/Options/OptionCell.h
     361                                        ./classes/objects/Options/OptionUtilities.h
    376362
    377363#}}}
  • issm/trunk-jpl/src/c/classes/IoModel.cpp

    r13036 r13216  
    879879        /*output: */
    880880        int     code;
    881         Option *option      = NULL;
    882881        char   *name        = NULL;
    883882
     
    889888        switch(code){
    890889                case 3: {//IssmDouble
    891                           IssmDouble *value = NULL;
    892                           value=xNew<IssmDouble>(1);
    893                           FetchData(value,index+1);
    894                           option = new OptionDouble();
    895                           ((OptionDouble*)option)->values = value;
    896                           option->name  = name;
    897                           option->numel = 1;
    898                           option->ndims = 1;
    899                           option->size  = NULL;
    900                           break;
    901                           }
     890                                        GenericOption<IssmDouble*>* option;
     891                                        IssmDouble *value = NULL;
     892                                        value=xNew<IssmDouble>(1);
     893                                        FetchData(value,index+1);
     894                                        option = new GenericOption<IssmDouble*>();
     895                                        option->value = value;
     896                                        option->name  = name;
     897                                        option->numel = 1;
     898                                        option->ndims = 1;
     899                                        option->size  = NULL;
     900                                        /*Assign output pointers: */
     901                                        *poption=option;
     902                                        break;
     903                                }
    902904                case 4: {//char
    903                           char* value = NULL;
    904                           FetchData(&value,index+1);
    905                           option = new OptionChar();
    906                           ((OptionChar*)option)->values = value;
    907                           option->name  = name;
    908                           option->numel = 1;
    909                           option->ndims = 1;
    910                           option->size  = NULL;
    911                           break;
    912                           }
     905                                        GenericOption<char*>* option;
     906                                        char* value = NULL;
     907                                        FetchData(&value,index+1);
     908                                        option = new GenericOption<char*>();
     909                                        option->value = value;
     910                                        option->name  = name;
     911                                        option->numel = 1;
     912                                        option->ndims = 1;
     913                                        option->size  = NULL;
     914                                        *poption=option;
     915                                        break;
     916                                }
    913917                default:
    914918                          _error_("Option of format " << code << " not supported yet");
    915919        }
    916920
    917         /*Assign output pointers: */
    918         *poption=option;
    919921}
    920922/*}}}*/
  • issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp

    r13045 r13216  
    245245
    246246/*ElementMatrix specific routines: */
    247 /*FUNCTION ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){{{*/
    248 void ElementMatrix::AddToGlobal(Matrix* Kff, Matrix* Kfs){
     247/*FUNCTION ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){{{*/
     248void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
    249249
    250250        int i,j;
     
    300300}
    301301/*}}}*/
    302 /*FUNCTION ElementMatrix::AddToGlobal(Matrix* Jff){{{*/
    303 void ElementMatrix::AddToGlobal(Matrix* Jff){
     302/*FUNCTION ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){{{*/
     303void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){
    304304
    305305        int i,j;
  • issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h

    r12899 r13216  
    1515#include "../../EnumDefinitions/EnumDefinitions.h"
    1616class Node;
    17 class Matrix;
     17template <class doublematrix> class Matrix;
    1818class Parameters;
    1919/*}}}*/
     
    6060                /*}}}*/
    6161                /*ElementMatrix specific routines {{{*/
    62                 void AddToGlobal(Matrix* Kff, Matrix* Kfs);
    63                 void AddToGlobal(Matrix* Jff);
     62                void AddToGlobal(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
     63                void AddToGlobal(Matrix<IssmDouble>* Jff);
    6464                void Echo(void);
    6565                void CheckConsistency(void);
  • issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp

    r13036 r13216  
    160160
    161161/*ElementVector specific routines: */
    162 /*FUNCTION ElementVector::AddToGlobal(Vector* pf){{{*/
    163 void ElementVector::AddToGlobal(Vector* pf){
     162/*FUNCTION ElementVector::AddToGlobal(Vector<IssmDouble>* pf){{{*/
     163void ElementVector::AddToGlobal(Vector<IssmDouble>* pf){
    164164
    165165        int i;
     
    184184}
    185185/*}}}*/
    186 /*FUNCTION ElementVector::InsertIntoGlobal(Vector* pf){{{*/
    187 void ElementVector::InsertIntoGlobal(Vector* pf){
     186/*FUNCTION ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){{{*/
     187void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){
    188188
    189189        int i;
  • issm/trunk-jpl/src/c/classes/matrix/ElementVector.h

    r12899 r13216  
    1515#include "../../EnumDefinitions/EnumDefinitions.h"
    1616class Node;
    17 class Vector;
     17template <class doubletype> class Vector;
    1818class Parameters;
    1919/*}}}*/
     
    4242                /*}}}*/
    4343                /*ElementVector specific routines {{{*/
    44                 void AddToGlobal(Vector* pf);
    45                 void InsertIntoGlobal(Vector* pf);
     44                void AddToGlobal(Vector<IssmDouble>* pf);
     45                void InsertIntoGlobal(Vector<IssmDouble>* pf);
    4646                void Echo(void);
    4747                void CheckConsistency(void);
  • issm/trunk-jpl/src/c/classes/matrix/Matrix.h

    r12987 r13216  
    1717#include "../../EnumDefinitions/EnumDefinitions.h"
    1818/*}}}*/
    19 class Vector;
    20 enum matrixtype{PetscMatType, SeqMatType};
    21 
     19
     20enum matrixtype { PetscMatType, SeqMatType };
     21
     22template <class doubletype> class Vector;
     23
     24template <class doubletype>
    2225class Matrix{
    2326
     
    2730                PetscMat *pmatrix;
    2831                #endif
    29                 SeqMat   *smatrix;
     32                SeqMat<doubletype>   *smatrix;
    3033                int       type;
    3134
    32                 /*Matrix constructors, destructors {{{*/
    33                 Matrix();
    34                 #ifdef _HAVE_PETSC_
    35                 Matrix(int M,int N,int type=PetscMatType);
    36                 Matrix(int M,int N,IssmDouble sparsity,int type=PetscMatType);
    37                 Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=PetscMatType);
    38                 Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=PetscMatType);
     35                /*Matrix constructors, destructors*/
     36                /*FUNCTION Matrix(){{{*/
     37                Matrix(){
     38
     39                        #ifdef _HAVE_PETSC_
     40                        pmatrix=NULL;
     41                        #endif
     42                        smatrix=NULL;
     43
     44                        type=PetscMatType; //default
     45                        #ifndef _HAVE_PETSC_
     46                        type=SeqMatType;
     47                        #endif
     48
     49                }
     50                /*}}}*/
     51                /*FUNCTION Matrix(int M,int N,int in_type){{{*/
     52                #ifdef _HAVE_PETSC_
     53                Matrix(int M,int N,int in_type=PetscMatType){
    3954                #else
    40                 Matrix(int M,int N,int type=SeqMatType);
    41                 Matrix(int M,int N,IssmDouble sparsity,int type=SeqMatType);
    42                 Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=SeqMatType);
    43                 Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=SeqMatType);
    44                 #endif
    45                 ~Matrix();
    46                 /*}}}*/
    47                 /*Matrix specific routines {{{*/
    48                 void        Echo(void);
    49                 void        Assemble(void);
    50                 IssmDouble  Norm(NormMode norm_type);
    51                 void        GetSize(int *pM,int*pN);
    52                 void        GetLocalSize(int *pM,int*pN);
    53                 void        MatMult(Vector *X,Vector*AX);
    54                 Matrix     *Duplicate(void);
    55                 IssmDouble *ToSerial(void);
    56                 void        SetValues(int m,int *idxm,int n,int*idxn,IssmDouble*values,InsMode mode);
    57                 void        Convert(MatrixType newtype);
     55                Matrix(int M,int N,int in_type=SeqMatType){
     56                #endif
     57
     58                        #ifdef _HAVE_PETSC_
     59                        pmatrix=NULL;
     60                        #endif
     61                        smatrix=NULL;
     62                        type=in_type;
     63
     64                        if(type==PetscMatType){
     65                                #ifdef _HAVE_PETSC_
     66                                this->pmatrix=new PetscMat(M,N);
     67                                #else
     68                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     69                                #endif
     70                        }
     71                        else if(type==SeqMatType){
     72                                this->smatrix=new SeqMat<doubletype>(M,N);
     73                        }
     74                        else _error_("Matrix type: " << type << " not supported yet!");
     75
     76                }
     77                /*}}}*/
     78                /*FUNCTION Matrix(int M,int N,IssmDouble sparsity,int in_type){{{*/
     79                #ifdef _HAVE_PETSC_
     80                Matrix(int M,int N,IssmDouble sparsity,int in_type=PetscMatType){
     81                #else
     82                Matrix(int M,int N,IssmDouble sparsity,int in_type=SeqMatType){
     83                #endif
     84
     85                        #ifdef _HAVE_PETSC_
     86                        pmatrix=NULL;
     87                        #endif
     88
     89                        smatrix=NULL;
     90                        type=in_type;
     91
     92                        if(type==PetscMatType){
     93                                #ifdef _HAVE_PETSC_
     94                                this->pmatrix=new PetscMat(M,N,sparsity);
     95                                #else
     96                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     97                                #endif
     98                        }
     99                        else if(type==SeqMatType){
     100                                this->smatrix=new SeqMat<doubletype>(M,N,sparsity);
     101                        }
     102                        else _error_("Matrix type: " << type << " not supported yet!");
     103                }
     104                /*}}}*/
     105                /*FUNCTION Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity,int in_type){{{*/
     106                #ifdef _HAVE_PETSC_
     107                Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int in_type=PetscMatType){
     108                #else
     109                Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int in_type=SeqMatType){
     110                #endif
     111
     112                        #ifdef _HAVE_PETSC_
     113                        pmatrix=NULL;
     114                        #endif
     115                        smatrix=NULL;
     116                        type=in_type;
     117
     118                        if(type==PetscMatType){
     119                                #ifdef _HAVE_PETSC_
     120                                this->pmatrix=new PetscMat(serial_mat,M,N,sparsity);
     121                                #else
     122                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     123                                #endif
     124                        }
     125                        else if(type==SeqMatType){
     126                                this->smatrix=new SeqMat<doubletype>(serial_mat,M,N,sparsity);
     127                        }
     128                        else _error_("Matrix type: " << type << " not supported yet!");
     129
     130                }
     131                /*}}}*/
     132                /*FUNCTION Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type){{{*/
     133                #ifdef _HAVE_PETSC_
     134                Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type=PetscMatType){
     135                #else
     136                Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type=SeqMatType){
     137                #endif
     138
     139                        #ifdef _HAVE_PETSC_
     140                        pmatrix=NULL;
     141                        #endif
     142                        smatrix=NULL;
     143                        type=in_type;
     144
     145                        if(type==PetscMatType){
     146                                #ifdef _HAVE_PETSC_
     147                                this->pmatrix=new PetscMat(M,N,connectivity,numberofdofspernode);
     148                                #else
     149                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     150                                #endif
     151                        }
     152                        else if(type==SeqMatType){
     153                                this->smatrix=new SeqMat<doubletype>(M,N,connectivity,numberofdofspernode);
     154                        }
     155                        else _error_("Matrix type: " << type << " not supported yet!");
     156
     157                }
     158                /*}}}*/
     159                /*FUNCTION ~Matrix(){{{*/
     160                ~Matrix(){
     161
     162                        if(type==PetscMatType){
     163                                #ifdef _HAVE_PETSC_
     164                                delete this->pmatrix;
     165                                #else
     166                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     167                                #endif
     168                        }
     169                        else if(type==SeqMatType){
     170                                delete this->smatrix;
     171                        }
     172                        else _error_("Matrix type: " << type << " not supported yet!");
     173
     174                }
     175                /*}}}*/
     176
     177                /*Matrix specific routines:*/
     178                /*FUNCTION Echo{{{*/
     179                void Echo(void){
     180                        _assert_(this);
     181
     182                        if(type==PetscMatType){
     183                                #ifdef _HAVE_PETSC_
     184                                this->pmatrix->Echo();
     185                                #endif
     186                        }
     187                        else if(type==SeqMatType){
     188                                this->smatrix->Echo();
     189                        }
     190                        else _error_("Matrix type: " << type << " not supported yet!");
     191
     192                }
     193                /*}}}*/
     194                /*FUNCTION Assemble{{{*/
     195                void Assemble(void){
     196
     197                        if(type==PetscMatType){
     198                                #ifdef _HAVE_PETSC_
     199                                this->pmatrix->Assemble();
     200                                #endif
     201                        }
     202                        else if(type==SeqMatType){
     203                                this->smatrix->Assemble();
     204                        }
     205                        else{
     206                                _error_("Matrix type: " << type << " not supported yet!");
     207                        }
     208                }
     209                /*}}}*/
     210                /*FUNCTION Norm{{{*/
     211                IssmDouble Norm(NormMode norm_type){
     212
     213                        IssmDouble norm=0;
     214
     215                        if(type==PetscMatType){
     216                                #ifdef _HAVE_PETSC_
     217                                norm=this->pmatrix->Norm(norm_type);
     218                                #endif
     219                        }
     220                        else if(type==SeqMatType){
     221                                norm=this->smatrix->Norm(norm_type);
     222                        }
     223                        else _error_("Matrix type: " << type << " not supported yet!");
     224
     225                        return norm;
     226                }
     227                /*}}}*/
     228                /*FUNCTION GetSize{{{*/
     229                void GetSize(int* pM,int* pN){
     230
     231                        if(type==PetscMatType){
     232                                #ifdef _HAVE_PETSC_
     233                                this->pmatrix->GetSize(pM,pN);
     234                                #endif
     235                        }
     236                        else if(type==SeqMatType){
     237                                this->smatrix->GetSize(pM,pN);
     238                        }
     239                        else _error_("Matrix type: " << type << " not supported yet!");
     240
     241                }
     242                /*}}}*/
     243                /*FUNCTION GetLocalSize{{{*/
     244                void GetLocalSize(int* pM,int* pN){
     245
     246                        if(type==PetscMatType){
     247                                #ifdef _HAVE_PETSC_
     248                                this->pmatrix->GetLocalSize(pM,pN);
     249                                #endif
     250                        }
     251                        else if(type==SeqMatType){
     252                                this->smatrix->GetLocalSize(pM,pN);
     253                        }
     254                        else _error_("Matrix type: " << type << " not supported yet!");
     255
     256                }
     257                /*}}}*/
     258                /*FUNCTION MatMult{{{*/
     259                void MatMult(Vector<doubletype>* X,Vector<doubletype>* AX){
     260
     261                        if(type==PetscMatType){
     262                                #ifdef _HAVE_PETSC_
     263                                this->pmatrix->MatMult(X->pvector,AX->pvector);
     264                                #endif
     265                        }
     266                        else if(type==SeqMatType){
     267                                this->smatrix->MatMult(X->svector,AX->svector);
     268                        }
     269                        else _error_("Matrix type: " << type << " not supported yet!");
     270
     271                }
     272                /*}}}*/
     273                /*FUNCTION Duplicate{{{*/
     274                Matrix* Duplicate(void){
     275
     276                        Matrix* output=NULL;
     277
     278                        output=new Matrix();
     279
     280                        if(type==PetscMatType){
     281                                #ifdef _HAVE_PETSC_
     282                                output->pmatrix=this->pmatrix->Duplicate();
     283                                #endif
     284                        }
     285                        else if(type==SeqMatType){
     286                                output->smatrix=this->smatrix->Duplicate();
     287                        }
     288                        else _error_("Matrix type: " << type << " not supported yet!");
     289
     290                        return output;
     291                }
     292                /*}}}*/
     293                /*FUNCTION ToSerial{{{*/
     294                doubletype* ToSerial(void){
     295
     296                        doubletype* output=NULL;
     297
     298                        if(type==PetscMatType){
     299                                #ifdef _HAVE_PETSC_
     300                                output=this->pmatrix->ToSerial();
     301                                #endif
     302                        }
     303                        else if(type==SeqMatType){
     304                                output=this->smatrix->ToSerial();
     305                        }
     306                        else _error_("Matrix type: " << type << " not supported yet!");
     307
     308
     309                        return output;
     310                }
     311                /*}}}*/
     312                /*FUNCTION SetValues{{{*/
     313                void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode){
     314
     315                        if(type==PetscMatType){
     316                                #ifdef _HAVE_PETSC_
     317                                this->pmatrix->SetValues(m,idxm,n,idxn,values,mode);
     318                                #endif
     319                        }
     320                        else if(type==SeqMatType){
     321                                this->smatrix->SetValues(m,idxm,n,idxn,values,mode);
     322                        }
     323                        else _error_("Matrix type: " << type << " not supported yet!");
     324                }
     325                /*}}}*/
     326                /*FUNCTION Convert{{{*/
     327                void Convert(MatrixType newtype){
     328
     329                        if(type==PetscMatType){
     330                                #ifdef _HAVE_PETSC_
     331                                this->pmatrix->Convert(newtype);
     332                                #endif
     333                        }
     334                        else if(type==SeqMatType){
     335                                this->smatrix->Convert(newtype);
     336                        }
     337                        else{
     338                                _error_("Matrix type: " << type << " not supported yet!");
     339                        }
     340
     341                }
    58342                /*}}}*/
    59343};
  • issm/trunk-jpl/src/c/classes/matrix/Vector.h

    r12987 r13216  
    2121enum vectortype { PetscVecType, SeqVecType };
    2222
     23template <class doubletype>
    2324class Vector{
    2425
     
    2829                PetscVec* pvector;
    2930                #endif
    30                 SeqVec* svector;
     31                SeqVec<doubletype>* svector;
    3132                int     type;
    3233       
    3334
    34                 /*Vector constructors, destructors {{{*/
    35                 Vector();
     35                /*Vector constructors, destructors */
     36                /*FUNCTION Vector(){{{*/
     37                Vector(){
     38
     39                        #ifdef _HAVE_PETSC_
     40                        this->pvector=NULL;
     41                        #endif
     42                        this->svector=NULL;
     43
     44                        type=PetscVecType; //default
     45                        #ifndef _HAVE_PETSC_
     46                        type=SeqVecType;
     47                        #endif
     48
     49                }
     50                /*}}}*/
     51                /*FUNCTION Vector(int M,bool fromlocalsize,int in_type){{{*/
    3652                #ifdef _HAVE_PETSC_
    37                 Vector(Vec petsc_vector);
    38                 Vector(int M,bool fromlocalsize=false,int type=PetscVecType);
    39                 Vector(IssmDouble* serial_vec,int pM,int type=PetscVecType);
     53                Vector(int M,bool fromlocalsize=false,int in_type=PetscVecType){
    4054                #else
    41                 Vector(int M,bool fromlocalsize=false,int type=SeqVecType);
    42                 Vector(IssmDouble* serial_vec,int pM,int type=SeqVecType);
     55                Vector(int M,bool fromlocalsize=false,int in_type=SeqVecType){
    4356                #endif
    4457
    45                 ~Vector();
    46                 /*}}}*/
    47                 /*Vector specific routines {{{*/
    48                 void    Echo(void);
    49                 void    AXPY(Vector *X, IssmDouble a);
    50                 void    AYPX(Vector *X, IssmDouble a);
    51                 void    Assemble(void);
    52                 void    Copy(Vector *to);
    53                 IssmDouble  Dot(Vector *vector);
    54                 Vector *Duplicate(void);
    55                 void    GetValue(IssmDouble *pvalue, int dof);
    56                 void    GetSize(int *pM);
    57                 void    GetLocalSize(int *pM);
    58                 bool    IsEmpty(void);
    59                 IssmDouble  Norm(NormMode norm_type);
    60                 void    PointwiseDivide(Vector  *x,Vector*y);
    61                 void    Scale(IssmDouble scale_factor);
    62                 void    Set(IssmDouble value);
    63                 void    SetValues(int ssize, int *list, IssmDouble*values, InsMode mode);
    64                 void    SetValue(int dof, IssmDouble value, InsMode mode);
    65                 IssmDouble *ToMPISerial(void);
     58                        #ifdef _HAVE_PETSC_
     59                        pvector=NULL;
     60                        #endif
     61                        svector=NULL;
     62                        type=in_type;
     63
     64
     65                        if(type==PetscVecType){
     66                        #ifdef _HAVE_PETSC_
     67                                this->pvector=new PetscVec(M,fromlocalsize);
     68                         #else
     69                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     70                         #endif
     71                        }
     72                        else if(type==SeqVecType){
     73                                this->svector=new SeqVec<doubletype>(M,fromlocalsize);
     74                        }
     75                        else _error_("Vector type: " << type << " not supported yet!");
     76
     77                }
     78                /*}}}*/
     79                /*FUNCTION Vector(doubletype* serial_vec,int M,int in_type){{{*/
     80                #ifdef _HAVE_PETSC_
     81                Vector(doubletype* serial_vec,int M,int in_type=PetscVecType){
     82                #else
     83                Vector(doubletype* serial_vec,int M,int in_type=SeqVecType){
     84                #endif
     85
     86                        #ifdef _HAVE_PETSC_
     87                        pvector=NULL;
     88                        #endif
     89
     90                        svector=NULL;
     91                        type=in_type;
     92
     93                        if(type==PetscVecType){
     94                                #ifdef _HAVE_PETSC_
     95                                this->pvector=new PetscVec(serial_vec,M);
     96                                #else
     97                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     98                                #endif
     99                        }
     100                        else if(type==SeqVecType){
     101                                this->svector=new SeqVec<doubletype>(serial_vec,M);
     102                        }
     103                        else _error_("Vector type: " << type << " not supported yet!");
     104
     105                }
     106                /*}}}*/
     107                /*FUNCTION ~Vector(){{{*/
     108                ~Vector(){
     109
     110                        if(type==PetscVecType){
     111                                #ifdef _HAVE_PETSC_
     112                                delete this->pvector;
     113                                #else
     114                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     115                                #endif
     116                        }
     117                        else if(type==SeqVecType){
     118                                delete this->svector;
     119                        }
     120                        else _error_("Vector type: " << type << " not supported yet!");
     121                }
     122                /*}}}*/
     123                #ifdef _HAVE_PETSC_
     124                /*FUNCTION Vector(Vec petsc_vector){{{*/
     125                Vector(Vec petsc_vector){
     126
     127                        this->type=PetscVecType;
     128                        this->svector=NULL;
     129                        this->pvector=new PetscVec(petsc_vector);
     130
     131                }
     132                /*}}}*/
     133                #endif
     134
     135                /*Vector specific routines*/
     136                /*FUNCTION Echo{{{*/
     137                void Echo(void){
     138
     139                        if(type==PetscVecType){
     140                                #ifdef _HAVE_PETSC_
     141                                this->pvector->Echo();
     142                                #else
     143                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     144                                #endif
     145                        }
     146                        else if(type==SeqVecType){
     147                                this->svector->Echo();
     148                        }
     149                        else _error_("Vector type: " << type << " not supported yet!");
     150
     151                }
     152                /*}}}*/
     153                /*FUNCTION Assemble{{{*/
     154                void Assemble(void){
     155
     156                        if(type==PetscVecType){
     157                                #ifdef _HAVE_PETSC_
     158                                this->pvector->Assemble();
     159                                #else
     160                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     161                                #endif
     162                        }
     163                        else if(type==SeqVecType){
     164                                this->svector->Assemble();
     165                        }
     166                        else _error_("Vector type: " << type << " not supported yet!");
     167
     168                }
     169                /*}}}*/
     170                /*FUNCTION SetValues{{{*/
     171                void SetValues(int ssize, int* list, doubletype* values, InsMode mode){
     172
     173
     174                        if(type==PetscVecType){
     175                                #ifdef _HAVE_PETSC_
     176                                this->pvector->SetValues(ssize,list,values,mode);
     177                                #else
     178                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     179                                #endif
     180                        }
     181                        else if(type==SeqVecType){
     182                                this->svector->SetValues(ssize,list,values,mode);
     183                        }
     184                        else _error_("Vector type: " << type << " not supported yet!");
     185
     186
     187
     188                }
     189                /*}}}*/
     190                /*FUNCTION SetValue{{{*/
     191                void SetValue(int dof, doubletype value, InsMode mode){
     192
     193                        if(type==PetscVecType){
     194                                #ifdef _HAVE_PETSC_
     195                                this->pvector->SetValue(dof,value,mode);
     196                                #else
     197                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     198                                #endif
     199                        }
     200                        else if(type==SeqVecType){
     201                                this->svector->SetValue(dof,value,mode);
     202                        }
     203                        else _error_("Vector type: " << type << " not supported yet!");
     204
     205                }
     206                /*}}}*/
     207                /*FUNCTION GetValue{{{*/
     208                void GetValue(doubletype* pvalue,int dof){
     209
     210
     211                        if(type==PetscVecType){
     212                                #ifdef _HAVE_PETSC_
     213                                this->pvector->GetValue(pvalue,dof);
     214                                #else
     215                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     216                                #endif
     217                        }
     218                        else if(type==SeqVecType){
     219                                this->svector->GetValue(pvalue,dof);
     220                        }
     221                        else _error_("Vector type: " << type << " not supported yet!");
     222
     223                }
     224                /*}}}*/
     225                /*FUNCTION GetSize{{{*/
     226                void GetSize(int* pM){
     227
     228                        if(type==PetscVecType){
     229                                #ifdef _HAVE_PETSC_
     230                                this->pvector->GetSize(pM);
     231                                #else
     232                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     233                                #endif
     234                        }
     235                        else if(type==SeqVecType){
     236                                this->svector->GetSize(pM);
     237                        }
     238                        else _error_("Vector type: " << type << " not supported yet!");
     239
     240                }
     241                /*}}}*/
     242                /*FUNCTION IsEmpty{{{*/
     243                bool IsEmpty(void){
     244
     245                        int M;
     246
     247                        this->GetSize(&M);
     248
     249                        if(M==0)
     250                                return true;
     251                        else
     252                                return false;
     253                }
     254                /*}}}*/
     255                /*FUNCTION GetLocalSize{{{*/
     256                void GetLocalSize(int* pM){
     257
     258
     259                        if(type==PetscVecType){
     260                                #ifdef _HAVE_PETSC_
     261                                this->pvector->GetLocalSize(pM);
     262                                #else
     263                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     264                                #endif
     265                        }
     266                        else if(type==SeqVecType){
     267                                this->svector->GetLocalSize(pM);
     268                        }
     269                        else _error_("Vector type: " << type << " not supported yet!");
     270
     271                }
     272                /*}}}*/
     273                /*FUNCTION Duplicate{{{*/
     274                Vector* Duplicate(void){
     275
     276                        Vector* output=NULL;
     277
     278
     279                        if(type==PetscVecType){
     280                                #ifdef _HAVE_PETSC_
     281                                output=new Vector();
     282                                output->pvector=this->pvector->Duplicate();
     283                                #else
     284                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     285                                #endif
     286                        }
     287                        else if(type==SeqVecType){
     288                                output=new Vector();
     289                                output->svector=this->svector->Duplicate();
     290                        }
     291                        else _error_("Vector type: " << type << " not supported yet!");
     292
     293                        return output;
     294
     295                }
     296                /*}}}*/
     297                /*FUNCTION Set{{{*/
     298                void Set(doubletype value){
     299
     300
     301                        if(type==PetscVecType){
     302                                #ifdef _HAVE_PETSC_
     303                                this->pvector->Set(value);
     304                                #else
     305                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     306                                #endif
     307                        }
     308                        else if(type==SeqVecType){
     309                                this->svector->Set(value);
     310                        }
     311                        else _error_("Vector type: " << type << " not supported yet!");
     312
     313                }
     314                /*}}}*/
     315                /*FUNCTION AXPY{{{*/
     316                void AXPY(Vector* X, doubletype a){
     317
     318
     319                        if(type==PetscVecType){
     320                                #ifdef _HAVE_PETSC_
     321                                this->pvector->AXPY(X->pvector,a);
     322                                #else
     323                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     324                                #endif
     325                        }
     326                        else if(type==SeqVecType){
     327                                this->svector->AXPY(X->svector,a);
     328                        }
     329                        else _error_("Vector type: " << type << " not supported yet!");
     330
     331                }
     332                /*}}}*/
     333                /*FUNCTION AYPX{{{*/
     334                void AYPX(Vector* X, doubletype a){
     335
     336
     337                        if(type==PetscVecType){
     338                                #ifdef _HAVE_PETSC_
     339                                this->pvector->AYPX(X->pvector,a);
     340                                #else
     341                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     342                                #endif
     343                        }
     344                        else if(type==SeqVecType){
     345                                this->svector->AYPX(X->svector,a);
     346                        }
     347                        else _error_("Vector type: " << type << " not supported yet!");
     348
     349
     350                }
     351                /*}}}*/
     352                /*FUNCTION ToMPISerial{{{*/
     353                doubletype* ToMPISerial(void){
     354
     355                        doubletype* vec_serial=NULL;
     356
     357                        if(type==PetscVecType){
     358                                #ifdef _HAVE_PETSC_
     359                                vec_serial=this->pvector->ToMPISerial();
     360                                #else
     361                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     362                                #endif
     363                        }
     364                        else if(type==SeqVecType){
     365                                vec_serial=this->svector->ToMPISerial();
     366                        }
     367                        else _error_("Vector type: " << type << " not supported yet!");
     368
     369                        return vec_serial;
     370
     371                }
     372                /*}}}*/
     373                /*FUNCTION Copy{{{*/
     374                void Copy(Vector* to){
     375
     376
     377                        if(type==PetscVecType){
     378                                #ifdef _HAVE_PETSC_
     379                                this->pvector->Copy(to->pvector);
     380                                #else
     381                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     382                                #endif
     383                        }
     384                        else if(type==SeqVecType){
     385                                this->svector->Copy(to->svector);
     386                        }
     387                        else _error_("Vector type: " << type << " not supported yet!");
     388
     389
     390                }
     391                /*}}}*/
     392                /*FUNCTION Norm{{{*/
     393                doubletype Norm(NormMode norm_type){
     394
     395                        doubletype norm=0;
     396
     397                        if(type==PetscVecType){
     398                                #ifdef _HAVE_PETSC_
     399                                norm=this->pvector->Norm(norm_type);
     400                                #else
     401                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     402                                #endif
     403                        }
     404                        else if(type==SeqVecType){
     405                                norm=this->svector->Norm(norm_type);
     406                        }
     407                        else _error_("Vector type: " << type << " not supported yet!");
     408
     409                        return norm;
     410                }
     411                /*}}}*/
     412                /*FUNCTION Scale{{{*/
     413                void Scale(doubletype scale_factor){
     414
     415
     416                        if(type==PetscVecType){
     417                                #ifdef _HAVE_PETSC_
     418                                this->pvector->Scale(scale_factor);
     419                                #else
     420                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     421                                #endif
     422                        }
     423                        else if(type==SeqVecType){
     424                                this->svector->Scale(scale_factor);
     425                        }
     426                        else _error_("Vector type: " << type << " not supported yet!");
     427
     428                }
     429                /*}}}*/
     430                /*FUNCTION Dot{{{*/
     431                doubletype Dot(Vector* vector){
     432
     433                        doubletype dot;
     434
     435                        if(type==PetscVecType){
     436                                #ifdef _HAVE_PETSC_
     437                                dot=this->pvector->Dot(vector->pvector);
     438                                #else
     439                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     440                                #endif
     441                        }
     442                        else if(type==SeqVecType){
     443                                dot=this->svector->Dot(vector->svector);
     444                        }
     445                        else _error_("Vector type: " << type << " not supported yet!");
     446
     447                        return dot;
     448                }
     449                /*}}}*/
     450                /*FUNCTION PointwiseDivide{{{*/
     451                void PointwiseDivide(Vector* x,Vector* y){
     452
     453
     454                        if(type==PetscVecType){
     455                                #ifdef _HAVE_PETSC_
     456                                this->pvector->PointwiseDivide(x->pvector,y->pvector);
     457                                #else
     458                                _error_("Petsc matrix format not usable, as Petsc has not been compiled!");
     459                                #endif
     460                        }
     461                        else if(type==SeqVecType){
     462                                this->svector->PointwiseDivide(x->svector,y->svector);
     463                        }
     464                        else _error_("Vector type: " << type << " not supported yet!");
     465
     466                }
    66467                /*}}}*/
    67468};
    68 
    69 
    70469#endif //#ifndef _VECTOR_H_
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp

    r13036 r13216  
    126126/*}}}*/
    127127/*FUNCTION BoolElementResult::GetVectorFromResults{{{*/
    128 void BoolElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
     128void BoolElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){
    129129
    130130        _error_("cannot return vector on vertices");
    131131} /*}}}*/
    132132/*FUNCTION BoolElementResult::GetElementVectorFromResults{{{*/
    133 void BoolElementResult::GetElementVectorFromResults(Vector* vector,int dof){
     133void BoolElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){
    134134
    135135        vector->SetValue(dof,value,INS_VAL);
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h

    r12832 r13216  
    4848                /*BoolElementResult management: {{{*/
    4949                int   InstanceEnum();
    50                 void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
    51                 void GetElementVectorFromResults(Vector* vector,int dof);
     50                void GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs);
     51                void GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof);
    5252                /*}}}*/
    5353};
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp

    r13036 r13216  
    127127/*}}}*/
    128128/*FUNCTION DoubleElementResult::GetVectorFromResults{{{1*/
    129 void DoubleElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
     129void DoubleElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){
    130130
    131131        _error_("cannot return vector on vertices");
    132132} /*}}}*/
    133133/*FUNCTION DoubleElementResult::GetElementVectorFromResults{{{1*/
    134 void DoubleElementResult::GetElementVectorFromResults(Vector* vector,int dof){
     134void DoubleElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){
    135135
    136136        vector->SetValue(dof,value,INS_VAL);
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h

    r12832 r13216  
    4848                /*DoubleElementResult management: {{{*/
    4949                int   InstanceEnum();
    50                 void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
    51                 void GetElementVectorFromResults(Vector* vector,int dof);
     50                void GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs);
     51                void GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof);
    5252                /*}}}*/
    5353};
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/ElementResult.h

    r12561 r13216  
    2525                virtual void    PatchFill(int row, Patch* patch)=0;
    2626                virtual int     InstanceEnum()=0;
    27                 virtual void    GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdof)=0;
    28                 virtual void    GetElementVectorFromResults(Vector* vector,int dof)=0;
     27                virtual void    GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdof)=0;
     28                virtual void    GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof)=0;
    2929
    3030};
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp

    r13036 r13216  
    138138/*}}}*/
    139139/*FUNCTION PentaP1ElementResult::GetVectorFromResults{{{*/
    140 void PentaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
     140void PentaP1ElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){
    141141
    142142        IssmDouble data[6];
     
    148148} /*}}}*/
    149149/*FUNCTION PentaP1ElementResult::GetElementVectorFromResults{{{*/
    150 void PentaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
     150void PentaP1ElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){
    151151
    152152        _error_("Result " << EnumToStringx(enum_type) << " is a PentaP1ElementResult and should not write vector of size numberofelemenrs");
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.h

    r12832 r13216  
    4747                /*PentaP1ElementResult management: {{{*/
    4848                int   InstanceEnum();
    49                 void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
    50                 void GetElementVectorFromResults(Vector* vector,int dof);
     49                void GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs);
     50                void GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof);
    5151                /*}}}*/
    5252
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp

    r13036 r13216  
    126126/*}}}*/
    127127/*FUNCTION TriaP1ElementResult::GetVectorFromResults{{{*/
    128 void TriaP1ElementResult::GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs){
     128void TriaP1ElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){
    129129
    130130        IssmDouble data[3];
     
    136136} /*}}}*/
    137137/*FUNCTION TriaP1ElementResult::GetElementVectorFromResults{{{*/
    138 void TriaP1ElementResult::GetElementVectorFromResults(Vector* vector,int dof){
     138void TriaP1ElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){
    139139        _error_("Result " << EnumToStringx(enum_type) << " is a TriaP1ElementResult and should not write vector of size numberofelemenrs");
    140140} /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h

    r12832 r13216  
    4646                /*TriaP1ElementResult management: {{{*/
    4747                int   InstanceEnum();
    48                 void GetVectorFromResults(Vector* vector,int* doflist,int* connectivitylist,int numdofs);
    49                 void GetElementVectorFromResults(Vector* vector,int dof);
     48                void GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs);
     49                void GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof);
    5050                /*}}}*/
    5151
  • issm/trunk-jpl/src/c/classes/objects/Elements/Element.h

    r12927 r13216  
    1616class Parameters;
    1717class Patch;
    18 class Matrix;
    19 class Vector;
     18template <class doublematrix> class Matrix;
     19template <class doubletype> class Vector;
    2020
    2121#include "../../../toolkits/toolkits.h"
     
    3030                virtual void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
    3131                virtual void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
    32                 virtual void   CreateKMatrix(Matrix* Kff, Matrix*  Kfs,Vector* df)=0;
    33                 virtual void   CreatePVector(Vector* pf)=0;
    34                 virtual void   CreateJacobianMatrix(Matrix* Jff)=0;
    35                 virtual void   GetSolutionFromInputs(Vector* solution)=0;
     32                virtual void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>*  Kfs,Vector<IssmDouble>* df)=0;
     33                virtual void   CreatePVector(Vector<IssmDouble>* pf)=0;
     34                virtual void   CreateJacobianMatrix(Matrix<IssmDouble>* Jff)=0;
     35                virtual void   GetSolutionFromInputs(Vector<IssmDouble>* solution)=0;
    3636                virtual int    GetNodeIndex(Node* node)=0;
    3737                virtual int    Sid()=0;
     
    4646                virtual IssmDouble SurfaceArea(void)=0;
    4747                virtual void   InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum)=0;
    48                 virtual void   ComputeBasalStress(Vector* sigma_b)=0;
    49                 virtual void   ComputeStrainRate(Vector* eps)=0;
     48                virtual void   ComputeBasalStress(Vector<IssmDouble>* sigma_b)=0;
     49                virtual void   ComputeStrainRate(Vector<IssmDouble>* eps)=0;
    5050                virtual void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes)=0;
    5151                virtual void   PatchFill(int* pcount, Patch* patch)=0;
     
    6262                virtual int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units)=0;
    6363                virtual void   InputScale(int enum_type,IssmDouble scale_factor)=0;
    64                 virtual void   GetVectorFromInputs(Vector* vector, int name_enum)=0;
    65                 virtual void   GetVectorFromResults(Vector* vector,int id,int enum_in,int interp)=0;
     64                virtual void   GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum)=0;
     65                virtual void   GetVectorFromResults(Vector<IssmDouble>* vector,int id,int enum_in,int interp)=0;
    6666                virtual void   InputArtificialNoise(int enum_type,IssmDouble min,IssmDouble max)=0;
    6767                virtual bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums)=0;
    68                 virtual void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;
     68                virtual void   AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;
    6969                virtual int*   GetHorizontalNeighboorSids(void)=0;
    7070                virtual IssmDouble TimeAdapt()=0;
    7171                virtual void   MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding)=0;
    72                 virtual void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding)=0;
     72                virtual void   PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding)=0;
    7373                virtual void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm)=0;
    7474                virtual void   Delta18oParameterization(void)=0;
    7575                virtual void   SmbGradients()=0;
    76                 virtual int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0;
     76                virtual int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0;
    7777                virtual void   ResetCoordinateSystem()=0;
    78                 virtual void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius)=0;
     78                virtual void   SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius)=0;
    7979
    8080                #ifdef _HAVE_RESPONSES_
     
    9797
    9898                #ifdef _HAVE_CONTROL_
    99                 virtual void   Gradj(Vector* gradient,int control_type,int control_index)=0;
     99                virtual void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index)=0;
    100100                virtual IssmDouble ThicknessAbsMisfit(bool process_units  ,int weight_index)=0;
    101101                virtual IssmDouble SurfaceAbsVelMisfit(bool process_units ,int weight_index)=0;
     
    109109                virtual IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index)=0;
    110110                virtual IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index)=0;
    111                 virtual void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index)=0;
     111                virtual void   ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index)=0;
    112112                virtual void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index)=0;
    113113                virtual void   ControlInputScaleGradient(int enum_type, IssmDouble scale)=0;
    114                 virtual void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data)=0;
     114                virtual void   GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data)=0;
    115115                virtual void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index)=0;
    116116                virtual void   InputControlUpdate(IssmDouble scalar,bool save_parameter)=0;
  • issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp

    r13129 r13216  
    145145/*Other*/
    146146/*FUNCTION Penta::AverageOntoPartition {{{*/
    147 void  Penta::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
     147void  Penta::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
    148148        _error_("Not supported yet!");
    149149}
     
    226226/*}}}*/
    227227/*FUNCTION Penta::ComputeBasalStress {{{*/
    228 void  Penta::ComputeBasalStress(Vector* sigma_b){
     228void  Penta::ComputeBasalStress(Vector<IssmDouble>* sigma_b){
    229229
    230230        int         i,j,ig;
     
    316316/*}}}*/
    317317/*FUNCTION Penta::ComputeStrainRate {{{*/
    318 void  Penta::ComputeStrainRate(Vector* eps){
     318void  Penta::ComputeStrainRate(Vector<IssmDouble>* eps){
    319319
    320320        _error_("Not implemented yet");
     
    410410/*}}}*/
    411411/*FUNCTION Penta::CreateKMatrix {{{*/
    412 void  Penta::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){
     412void  Penta::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df){
    413413
    414414        /*retrieve parameters: */
     
    514514/*}}}*/
    515515/*FUNCTION Penta::CreatePVector {{{*/
    516 void  Penta::CreatePVector(Vector* pf){
     516void  Penta::CreatePVector(Vector<IssmDouble>* pf){
    517517
    518518        /*retrive parameters: */
     
    616616/*}}}*/
    617617/*FUNCTION Penta::CreateJacobianMatrix{{{*/
    618 void  Penta::CreateJacobianMatrix(Matrix* Jff){
     618void  Penta::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){
    619619
    620620        /*retrieve parameters: */
     
    10061006/*}}}*/
    10071007/*FUNCTION Penta::GetSolutionFromInputs{{{*/
    1008 void  Penta::GetSolutionFromInputs(Vector* solution){
     1008void  Penta::GetSolutionFromInputs(Vector<IssmDouble>* solution){
    10091009
    10101010        int analysis_type;
     
    11331133/*}}}*/
    11341134/*FUNCTION Penta::GetVectorFromInputs{{{*/
    1135 void  Penta::GetVectorFromInputs(Vector* vector,int input_enum){
     1135void  Penta::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){
    11361136
    11371137        int doflist1[NUMVERTICES];
     
    11521152/*}}}*/
    11531153/*FUNCTION Penta::GetVectorFromResults{{{*/
    1154 void  Penta::GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp){
     1154void  Penta::GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int enum_in,int interp){
    11551155
    11561156        /*Get result*/
     
    23902390/*}}}*/
    23912391/*FUNCTION Penta::PotentialSheetUngrounding{{{*/
    2392 void  Penta::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){
     2392void  Penta::PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){
    23932393
    23942394        int     i;
     
    29652965/*}}}*/
    29662966/*FUNCTION Penta::UpdatePotentialSheetUngrounding{{{*/
    2967 int Penta::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
     2967int Penta::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
    29682968
    29692969        int i;
     
    30333033/*}}}*/
    30343034/*FUNCTION Penta::SmearFunction {{{*/
    3035 void  Penta::SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
     3035void  Penta::SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
    30363036        _error_("not implemented yet");
    30373037}
     
    42474247/*}}}*/
    42484248/*FUNCTION Penta::GetSolutionFromInputsThermal{{{*/
    4249 void  Penta::GetSolutionFromInputsThermal(Vector* solution){
     4249void  Penta::GetSolutionFromInputsThermal(Vector<IssmDouble>* solution){
    42504250
    42514251        const int    numdof=NDOF1*NUMVERTICES;
     
    42784278/*}}}*/
    42794279/*FUNCTION Penta::GetSolutionFromInputsEnthalpy{{{*/
    4280 void  Penta::GetSolutionFromInputsEnthalpy(Vector* solution){
     4280void  Penta::GetSolutionFromInputsEnthalpy(Vector<IssmDouble>* solution){
    42814281
    42824282        const int    numdof=NDOF1*NUMVERTICES;
     
    44614461#ifdef _HAVE_CONTROL_
    44624462/*FUNCTION Penta::ControlInputGetGradient{{{*/
    4463 void Penta::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){
     4463void Penta::ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){
    44644464
    44654465        int doflist1[NUMVERTICES];
     
    48084808/*}}}*/
    48094809/*FUNCTION Penta::Gradj {{{*/
    4810 void  Penta::Gradj(Vector* gradient,int control_type,int control_index){
     4810void  Penta::Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){
    48114811        /*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
    48124812
     
    48994899/*}}}*/
    49004900/*FUNCTION Penta::GradjDragMacAyeal {{{*/
    4901 void  Penta::GradjDragMacAyeal(Vector* gradient,int control_index){
     4901void  Penta::GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index){
    49024902
    49034903        /*Gradient is 0 if on shelf or not on bed*/
     
    49114911} /*}}}*/
    49124912/*FUNCTION Penta::GradjDragPattyn {{{*/
    4913 void  Penta::GradjDragPattyn(Vector* gradient,int control_index){
     4913void  Penta::GradjDragPattyn(Vector<IssmDouble>* gradient,int control_index){
    49144914
    49154915        int        i,j,ig;
     
    49824982/*}}}*/
    49834983/*FUNCTION Penta::GradjDragStokes {{{*/
    4984 void  Penta::GradjDragStokes(Vector* gradient,int control_index){
     4984void  Penta::GradjDragStokes(Vector<IssmDouble>* gradient,int control_index){
    49854985
    49864986        int        i,j,ig;
     
    50745074/*}}}*/
    50755075/*FUNCTION Penta::GradjBbarMacAyeal {{{*/
    5076 void  Penta::GradjBbarMacAyeal(Vector* gradient,int control_index){
     5076void  Penta::GradjBbarMacAyeal(Vector<IssmDouble>* gradient,int control_index){
    50775077
    50785078        /*This element should be collapsed into a tria element at its base*/
     
    50925092} /*}}}*/
    50935093/*FUNCTION Penta::GradjBbarPattyn {{{*/
    5094 void  Penta::GradjBbarPattyn(Vector* gradient,int control_index){
     5094void  Penta::GradjBbarPattyn(Vector<IssmDouble>* gradient,int control_index){
    50955095
    50965096        /*Gradient is computed on bed only (Bbar)*/
     
    51095109} /*}}}*/
    51105110/*FUNCTION Penta::GradjBbarStokes {{{*/
    5111 void  Penta::GradjBbarStokes(Vector* gradient,int control_index){
     5111void  Penta::GradjBbarStokes(Vector<IssmDouble>* gradient,int control_index){
    51125112
    51135113        /*Gradient is computed on bed only (Bbar)*/
     
    54925492/*}}}*/
    54935493/*FUNCTION Penta::GetVectorFromControlInputs{{{*/
    5494 void  Penta::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){
     5494void  Penta::GetVectorFromControlInputs(Vector<IssmDouble>* vector,int control_enum,int control_index,const char* data){
    54955495
    54965496        int doflist1[NUMVERTICES];
     
    80758075/*}}}*/
    80768076/*FUNCTION Penta::GetSolutionFromInputsDiagnosticHoriz{{{*/
    8077 void  Penta::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){
     8077void  Penta::GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solution){
    80788078
    80798079        const int    numdof=NDOF2*NUMVERTICES;
     
    81178117/*}}}*/
    81188118/*FUNCTION Penta::GetSolutionFromInputsDiagnosticHutter{{{*/
    8119 void  Penta::GetSolutionFromInputsDiagnosticHutter(Vector* solution){
     8119void  Penta::GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solution){
    81208120
    81218121        const int    numdof=NDOF2*NUMVERTICES;
     
    81538153/*}}}*/
    81548154/*FUNCTION Penta::GetSolutionFromInputsDiagnosticVert{{{*/
    8155 void  Penta::GetSolutionFromInputsDiagnosticVert(Vector* solution){
     8155void  Penta::GetSolutionFromInputsDiagnosticVert(Vector<IssmDouble>* solution){
    81568156
    81578157        const int    numdof=NDOF1*NUMVERTICES;
     
    81868186/*}}}*/
    81878187/*FUNCTION Penta::GetSolutionFromInputsDiagnosticStokes{{{*/
    8188 void  Penta::GetSolutionFromInputsDiagnosticStokes(Vector* solution){
     8188void  Penta::GetSolutionFromInputsDiagnosticStokes(Vector<IssmDouble>* solution){
    81898189
    81908190        const int    numdof=NDOF4*NUMVERTICES;
  • issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h

    r13129 r13216  
    7474                /*}}}*/
    7575                /*Element virtual functions definitions: {{{*/
    76                 void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
     76                void   AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
    7777                void   BasalFrictionCreateInput(void);
    78                 void   ComputeBasalStress(Vector* sigma_b);
    79                 void   ComputeStrainRate(Vector* eps);
     78                void   ComputeBasalStress(Vector<IssmDouble>* sigma_b);
     79                void   ComputeStrainRate(Vector<IssmDouble>* eps);
    8080                void   ComputeStressTensor();
    8181                void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    8282                void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    83                 void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
    84                 void   CreatePVector(Vector* pf);
    85                 void   CreateJacobianMatrix(Matrix* Jff);
     83                void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df);
     84                void   CreatePVector(Vector<IssmDouble>* pf);
     85                void   CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
    8686                void   Delta18oParameterization(void);
    8787                void   DeleteResults(void);
    8888                int    GetNodeIndex(Node* node);
    89                 void   GetSolutionFromInputs(Vector* solution);
     89                void   GetSolutionFromInputs(Vector<IssmDouble>* solution);
    9090                IssmDouble GetZcoord(GaussPenta* gauss);
    91                 void   GetVectorFromInputs(Vector* vector,int name_enum);
    92                 void   GetVectorFromResults(Vector* vector,int offset,int name_enum,int interp);
     91                void   GetVectorFromInputs(Vector<IssmDouble>* vector,int name_enum);
     92                void   GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int name_enum,int interp);
    9393               
    9494                int    Sid();
     
    103103                void   InputToResult(int enum_type,int step,IssmDouble time);
    104104                void   MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding);
    105                 void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
     105                void   PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
    106106                void   RequestedOutput(int output_enum,int step,IssmDouble time);
    107107                void   ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results);
     
    114114                IssmDouble SurfaceArea(void);
    115115                void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
    116                 int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
     116                int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
    117117                int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units);
    118118                IssmDouble TimeAdapt();
    119119                int*   GetHorizontalNeighboorSids(void);
    120120                void   ViscousHeatingCreateInput(void);
    121                 void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
     121                void   SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
    122122
    123123                 #ifdef _HAVE_RESPONSES_
     
    142142                IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index);
    143143                void   GradientIndexing(int* indexing,int control_index);
    144                 void   Gradj(Vector* gradient,int control_type,int control_index);
    145                 void   GradjDragMacAyeal(Vector* gradient,int control_index);
    146                 void   GradjDragPattyn(Vector* gradient,int control_index);
    147                 void   GradjDragStokes(Vector* gradient,int control_index);
    148                 void   GradjBbarMacAyeal(Vector* gradient,int control_index);
    149                 void   GradjBbarPattyn(Vector* gradient,int control_index);
    150                 void   GradjBbarStokes(Vector* gradient,int control_index);
    151                 void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
     144                void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index);
     145                void   GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index);
     146                void   GradjDragPattyn(Vector<IssmDouble>* gradient,int control_index);
     147                void   GradjDragStokes(Vector<IssmDouble>* gradient,int control_index);
     148                void   GradjBbarMacAyeal(Vector<IssmDouble>* gradient,int control_index);
     149                void   GradjBbarPattyn(Vector<IssmDouble>* gradient,int control_index);
     150                void   GradjBbarStokes(Vector<IssmDouble>* gradient,int control_index);
     151                void   GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
    152152                void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
    153                 void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index);
     153                void   ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index);
    154154                void   ControlInputScaleGradient(int enum_type,IssmDouble scale);
    155155                void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
     
    183183                void    GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
    184184                void      GetPhi(IssmDouble* phi, IssmDouble*  epsilon, IssmDouble viscosity);
    185                 void      GetSolutionFromInputsEnthalpy(Vector* solutiong);
     185                void      GetSolutionFromInputsEnthalpy(Vector<IssmDouble>* solutiong);
    186186                IssmDouble  GetStabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa);
    187187                void    GetStrainRate3dPattyn(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input);
     
    254254                void           InputUpdateFromSolutionDiagnosticVert( IssmDouble* solutiong);
    255255                void           InputUpdateFromSolutionDiagnosticStokes( IssmDouble* solutiong);
    256                 void             GetSolutionFromInputsDiagnosticHoriz(Vector* solutiong);
    257                 void             GetSolutionFromInputsDiagnosticHutter(Vector* solutiong);
    258                 void             GetSolutionFromInputsDiagnosticStokes(Vector* solutiong);
    259                 void             GetSolutionFromInputsDiagnosticVert(Vector* solutiong);
     256                void             GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solutiong);
     257                void             GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solutiong);
     258                void             GetSolutionFromInputsDiagnosticStokes(Vector<IssmDouble>* solutiong);
     259                void             GetSolutionFromInputsDiagnosticVert(Vector<IssmDouble>* solutiong);
    260260                ElementVector* CreatePVectorCouplingMacAyealStokes(void);
    261261                ElementVector* CreatePVectorCouplingMacAyealStokesViscous(void);
     
    313313                ElementVector* CreatePVectorThermalShelf(void);
    314314                ElementVector* CreatePVectorThermalSheet(void);
    315                 void           GetSolutionFromInputsThermal(Vector* solutiong);
     315                void           GetSolutionFromInputsThermal(Vector<IssmDouble>* solutiong);
    316316                void           InputUpdateFromSolutionThermal( IssmDouble* solutiong);
    317317                void           InputUpdateFromSolutionEnthalpy( IssmDouble* solutiong);
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp

    r13129 r13216  
    125125/*Other*/
    126126/*FUNCTION Tria::AverageOntoPartition {{{*/
    127 void  Tria::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
     127void  Tria::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){
    128128
    129129        bool      already=false;
     
    165165/*}}}*/
    166166/*FUNCTION Tria::CreateKMatrix {{{*/
    167 void  Tria::CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df){
     167void  Tria::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df){
    168168
    169169        /*retreive parameters: */
     
    517517/*}}}*/
    518518/*FUNCTION Tria::CreatePVector {{{*/
    519 void  Tria::CreatePVector(Vector* pf){
     519void  Tria::CreatePVector(Vector<IssmDouble>* pf){
    520520
    521521        /*retrive parameters: */
     
    740740/*}}}*/
    741741/*FUNCTION Tria::CreateJacobianMatrix{{{*/
    742 void  Tria::CreateJacobianMatrix(Matrix* Jff){
     742void  Tria::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){
    743743
    744744        /*retrieve parameters: */
     
    773773/*}}}*/
    774774/*FUNCTION Tria::ComputeBasalStress {{{*/
    775 void  Tria::ComputeBasalStress(Vector* eps){
     775void  Tria::ComputeBasalStress(Vector<IssmDouble>* eps){
    776776        _error_("Not Implemented yet");
    777777}
    778778/*}}}*/
    779779/*FUNCTION Tria::ComputeStrainRate {{{*/
    780 void  Tria::ComputeStrainRate(Vector* eps){
     780void  Tria::ComputeStrainRate(Vector<IssmDouble>* eps){
    781781        _error_("Not Implemented yet");
    782782}
     
    11911191/*}}}*/
    11921192/*FUNCTION Tria::GetSolutionFromInputs{{{*/
    1193 void  Tria::GetSolutionFromInputs(Vector* solution){
     1193void  Tria::GetSolutionFromInputs(Vector<IssmDouble>* solution){
    11941194
    11951195        /*retrive parameters: */
     
    12411241/*}}}*/
    12421242/*FUNCTION Tria::GetVectorFromInputs{{{*/
    1243 void  Tria::GetVectorFromInputs(Vector* vector,int input_enum){
     1243void  Tria::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){
    12441244
    12451245        int doflist1[NUMVERTICES];
     
    12601260/*}}}*/
    12611261/*FUNCTION Tria::GetVectorFromResults{{{*/
    1262 void  Tria::GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp){
     1262void  Tria::GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int enum_in,int interp){
    12631263
    12641264        /*Get result*/
     
    21312131/*}}}*/
    21322132/*FUNCTION Tria::PotentialSheetUngrounding{{{*/
    2133 void  Tria::PotentialSheetUngrounding(Vector* potential_sheet_ungrounding){
     2133void  Tria::PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){
    21342134
    21352135        int     i;
     
    22512251/*}}}*/
    22522252/*FUNCTION Tria::SmearFunction {{{*/
    2253 void  Tria::SmearFunction(Vector*  smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
     2253void  Tria::SmearFunction(Vector<IssmDouble>*  smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){
    22542254        _error_("not implemented yet");
    22552255
     
    25242524/*}}}*/
    25252525/*FUNCTION Tria::UpdatePotentialSheetUngrounding{{{*/
    2526 int Tria::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
     2526int Tria::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){
    25272527
    25282528        int i;
     
    31923192/*}}}*/
    31933193/*FUNCTION Tria::GetSolutionFromInputsDiagnosticHoriz{{{*/
    3194 void  Tria::GetSolutionFromInputsDiagnosticHoriz(Vector* solution){
     3194void  Tria::GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solution){
    31953195
    31963196        const int    numdof=NDOF2*NUMVERTICES;
     
    32313231/*}}}*/
    32323232/*FUNCTION Tria::GetSolutionFromInputsDiagnosticHutter{{{*/
    3233 void  Tria::GetSolutionFromInputsDiagnosticHutter(Vector* solution){
     3233void  Tria::GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solution){
    32343234
    32353235        const int    numdof=NDOF2*NUMVERTICES;
     
    34303430/*}}}*/
    34313431/*FUNCTION Tria::ControlInputGetGradient{{{*/
    3432 void Tria::ControlInputGetGradient(Vector* gradient,int enum_type,int control_index){
     3432void Tria::ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){
    34333433
    34343434        int doflist1[NUMVERTICES];
     
    34893489}/*}}}*/
    34903490/*FUNCTION Tria::Gradj {{{*/
    3491 void  Tria::Gradj(Vector* gradient,int control_type,int control_index){
     3491void  Tria::Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){
    34923492        /*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
    34933493
     
    35533553/*}}}*/
    35543554/*FUNCTION Tria::GradjBGradient{{{*/
    3555 void  Tria::GradjBGradient(Vector* gradient,int weight_index,int control_index){
     3555void  Tria::GradjBGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index){
    35563556
    35573557        int        i,ig;
     
    35933593/*}}}*/
    35943594/*FUNCTION Tria::GradjZGradient{{{*/
    3595 void  Tria::GradjZGradient(Vector* gradient,int weight_index,int control_index){
     3595void  Tria::GradjZGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index){
    35963596
    35973597        int        i,ig;
     
    36333633/*}}}*/
    36343634/*FUNCTION Tria::GradjBMacAyeal{{{*/
    3635 void  Tria::GradjBMacAyeal(Vector* gradient,int control_index){
     3635void  Tria::GradjBMacAyeal(Vector<IssmDouble>* gradient,int control_index){
    36363636
    36373637        /*Intermediaries*/
     
    36903690/*}}}*/
    36913691/*FUNCTION Tria::GradjZMacAyeal{{{*/
    3692 void  Tria::GradjZMacAyeal(Vector* gradient,int control_index){
     3692void  Tria::GradjZMacAyeal(Vector<IssmDouble>* gradient,int control_index){
    36933693
    36943694        /*Intermediaries*/
     
    37473747/*}}}*/
    37483748/*FUNCTION Tria::GradjDragMacAyeal {{{*/
    3749 void  Tria::GradjDragMacAyeal(Vector* gradient,int control_index){
     3749void  Tria::GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index){
    37503750
    37513751        int        i,ig;
     
    38353835/*}}}*/
    38363836/*FUNCTION Tria::GradjDragGradient{{{*/
    3837 void  Tria::GradjDragGradient(Vector* gradient, int weight_index,int control_index){
     3837void  Tria::GradjDragGradient(Vector<IssmDouble>* gradient, int weight_index,int control_index){
    38383838
    38393839        int        i,ig;
     
    38793879/*}}}*/
    38803880/*FUNCTION Tria::GradjDhDtBalancedthickness{{{*/
    3881 void  Tria::GradjDhDtBalancedthickness(Vector* gradient,int control_index){
     3881void  Tria::GradjDhDtBalancedthickness(Vector<IssmDouble>* gradient,int control_index){
    38823882
    38833883        /*Intermediaries*/
     
    38953895/*}}}*/
    38963896/*FUNCTION Tria::GradjVxBalancedthickness{{{*/
    3897 void  Tria::GradjVxBalancedthickness(Vector* gradient,int control_index){
     3897void  Tria::GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index){
    38983898
    38993899        /*Intermediaries*/
     
    39383938/*}}}*/
    39393939/*FUNCTION Tria::GradjVyBalancedthickness{{{*/
    3940 void  Tria::GradjVyBalancedthickness(Vector* gradient,int control_index){
     3940void  Tria::GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index){
    39413941
    39423942        /*Intermediaries*/
     
    52035203/*}}}*/
    52045204/*FUNCTION Tria::GetVectorFromControlInputs{{{*/
    5205 void  Tria::GetVectorFromControlInputs(Vector* vector,int control_enum,int control_index,const char* data){
     5205void  Tria::GetVectorFromControlInputs(Vector<IssmDouble>* vector,int control_enum,int control_index,const char* data){
    52065206
    52075207        int doflist1[NUMVERTICES];
     
    54765476/*}}}*/
    54775477/*FUNCTION Tria::GetSolutionFromInputsHydrology{{{*/
    5478 void  Tria::GetSolutionFromInputsHydrology(Vector* solution){
     5478void  Tria::GetSolutionFromInputsHydrology(Vector<IssmDouble>* solution){
    54795479
    54805480        const int    numdof=NDOF1*NUMVERTICES;
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h

    r13129 r13216  
    7171                /*}}}*/
    7272                /*Element virtual functions definitions: {{{*/
    73                 void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
    74                 void   ComputeBasalStress(Vector* sigma_b);
    75                 void   ComputeStrainRate(Vector* eps);
     73                void   AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
     74                void   ComputeBasalStress(Vector<IssmDouble>* sigma_b);
     75                void   ComputeStrainRate(Vector<IssmDouble>* eps);
    7676                void   ComputeStressTensor();
    7777                void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    7878                void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    79                 void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
    80                 void   CreatePVector(Vector* pf);
    81                 void   CreateJacobianMatrix(Matrix* Jff);
     79                void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df);
     80                void   CreatePVector(Vector<IssmDouble>* pf);
     81                void   CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
    8282                void   Delta18oParameterization(void);
    8383                int    GetNodeIndex(Node* node);
     
    8888                bool   IsNodeOnShelfFromFlags(IssmDouble* flags);
    8989                bool   IsOnWater();
    90                 void   GetSolutionFromInputs(Vector* solution);
    91                 void   GetVectorFromInputs(Vector* vector, int name_enum);
    92                 void   GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp);
     90                void   GetSolutionFromInputs(Vector<IssmDouble>* solution);
     91                void   GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum);
     92                void   GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int enum_in,int interp);
    9393                void   InputArtificialNoise(int enum_type,IssmDouble min, IssmDouble max);
    9494                bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums);
     
    103103                void   MigrateGroundingLine(IssmDouble* oldfloating,IssmDouble* sheet_ungrounding);
    104104                int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units);
    105                 void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
     105                void   PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
    106106                void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm);
    107107                void   RequestedOutput(int output_enum,int step,IssmDouble time);
     
    114114                IssmDouble SurfaceArea(void);
    115115                void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
    116                 int    UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
     116                int    UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
    117117                IssmDouble TimeAdapt();
    118118                int*   GetHorizontalNeighboorSids(void);
    119                 void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
     119                void   SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
    120120
    121121                #ifdef _HAVE_RESPONSES_
     
    141141                IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index);
    142142                void   GradientIndexing(int* indexing,int control_index);
    143                 void   Gradj(Vector* gradient,int control_type,int control_index);
    144                 void   GradjBGradient(Vector* gradient,int weight_index,int control_index);
    145                 void   GradjZGradient(Vector* gradient,int weight_index,int control_index);
    146                 void   GradjBMacAyeal(Vector* gradient,int control_index);
    147                 void   GradjZMacAyeal(Vector* gradient,int control_index);
    148                 void   GradjDragMacAyeal(Vector* gradient,int control_index);
    149                 void   GradjDragStokes(Vector* gradient,int control_index);
    150                 void   GradjDragGradient(Vector* gradient,int weight_index,int control_index);
    151                 void   GradjDhDtBalancedthickness(Vector* gradient,int control_index);
    152                 void   GradjVxBalancedthickness(Vector* gradient,int control_index);
    153                 void   GradjVyBalancedthickness(Vector* gradient,int control_index);
    154                 void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
     143                void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index);
     144                void   GradjBGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index);
     145                void   GradjZGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index);
     146                void   GradjBMacAyeal(Vector<IssmDouble>* gradient,int control_index);
     147                void   GradjZMacAyeal(Vector<IssmDouble>* gradient,int control_index);
     148                void   GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index);
     149                void   GradjDragStokes(Vector<IssmDouble>* gradient,int control_index);
     150                void   GradjDragGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index);
     151                void   GradjDhDtBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
     152                void   GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
     153                void   GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
     154                void   GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
    155155                void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
    156                 void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index);
     156                void   ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index);
    157157                void   ControlInputScaleGradient(int enum_type,IssmDouble scale);
    158158                void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
     
    212212                ElementVector* CreatePVectorDiagnosticHutter(void);
    213213                ElementMatrix* CreateJacobianDiagnosticMacayeal(void);
    214                 void      GetSolutionFromInputsDiagnosticHoriz(Vector* solution);
    215                 void      GetSolutionFromInputsDiagnosticHutter(Vector* solution);
     214                void      GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solution);
     215                void      GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solution);
    216216                void      InputUpdateFromSolutionDiagnosticHoriz( IssmDouble* solution);
    217217                void      InputUpdateFromSolutionDiagnosticHutter( IssmDouble* solution);
     
    232232                ElementVector* CreatePVectorHydrology(void);
    233233                void      CreateHydrologyWaterVelocityInput(void);
    234                 void      GetSolutionFromInputsHydrology(Vector* solution);
     234                void      GetSolutionFromInputsHydrology(Vector<IssmDouble>* solution);
    235235                void      InputUpdateFromSolutionHydrology(IssmDouble* solution);
    236236                #endif
  • issm/trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h

    r12832 r13216  
    2828                int id;
    2929                int enum_type;
    30                 Vector* value;
     30                Vector<IssmDouble>* value;
    3131                int step;
    3232                IssmDouble time;
     
    3535                /*PetscVecExternalResult constructors, destructors: {{{*/
    3636                PetscVecExternalResult();
    37                 PetscVecExternalResult(int id,int enum_type,Vector* value, int step, IssmDouble time);
     37                PetscVecExternalResult(int id,int enum_type,Vector<IssmDouble>* value, int step, IssmDouble time);
    3838                ~PetscVecExternalResult();
    3939                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp

    r13056 r13216  
    174174/*}}}*/
    175175/*FUNCTION BoolInput::GetVectorFromInputs{{{*/
    176 void BoolInput::GetVectorFromInputs(Vector* vector,int* doflist){
     176void BoolInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
    177177
    178178        _error_("not supporte yet!");
  • issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h

    r13056 r13216  
    7878                void Extrude(void);
    7979                void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
    80                 void GetVectorFromInputs(Vector* vector,int* doflist);
     80                void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
    8181                void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
    8282                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp

    r13056 r13216  
    147147}/*}}}*/
    148148/*FUNCTION ControlInput::GetGradient{{{*/
    149 void ControlInput::GetGradient(Vector* gradient_vec,int* doflist){
     149void ControlInput::GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist){
    150150        if(gradient) gradient->GetVectorFromInputs(gradient_vec,doflist);
    151151}/*}}}*/
     
    198198        return gradient->SpawnResult(step,time);
    199199}/*}}}*/
    200 /*FUNCTION ControlInput::GetVectorFromInputs(Vector* vector,int* doflist){{{*/
    201 void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist){
     200/*FUNCTION ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){{{*/
     201void ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
    202202        values->GetVectorFromInputs(vector,doflist);
    203203}/*}}}*/
    204 /*FUNCTION ControlInput::GetVectorFromInputs(Vector* vector,int* doflist,const char* data){{{*/
    205 void ControlInput::GetVectorFromInputs(Vector* vector,int* doflist,const char* data){
     204/*FUNCTION ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist,const char* data){{{*/
     205void ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist,const char* data){
    206206         if(strcmp(data,"value")==0){
    207207                 _assert_(values);
  • issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h

    r13056 r13216  
    8484                void Extrude(void);
    8585                void VerticallyIntegrate(Input* thickness_input);
    86                 void GetVectorFromInputs(Vector* vector,int* doflist,const char* data);
    87                 void GetVectorFromInputs(Vector* vector,int* doflist);
     86                void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist,const char* data);
     87                void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
    8888                void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");};
    8989                ElementResult* SpawnGradient(int step, IssmDouble time);
    90                 void GetGradient(Vector* gradient_vec,int* doflist);
     90                void GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist);
    9191                void ScaleGradient(IssmDouble scale);
    9292                void SetGradient(Input* gradient_in);
  • issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h

    r13056 r13216  
    7979                void Extrude(void){_error_("not implemented yet");};
    8080                void VerticallyIntegrate(Input* thickness_input){_error_("not implemented yet");};
    81                 void GetVectorFromInputs(Vector* vector,int* doflist){_error_("not implemented yet");};
     81                void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){_error_("not implemented yet");};
    8282                void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");};
    8383                ElementResult* SpawnGradient(int step, IssmDouble time){_error_("not implemented yet");};
    84                 void GetGradient(Vector* gradient_vec,int* doflist){_error_("not implemented yet");};
     84                void GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist){_error_("not implemented yet");};
    8585                void ScaleGradient(IssmDouble scale){_error_("not implemented yet");};
    8686                void SetGradient(Input* gradient_in){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp

    r13056 r13216  
    251251/*}}}*/
    252252/*FUNCTION DoubleInput::GetVectorFromInputs{{{*/
    253 void DoubleInput::GetVectorFromInputs(Vector* vector,int* doflist){
     253void DoubleInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
    254254
    255255        _error_("not supporte yet!");
  • issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h

    r13056 r13216  
    7777                void Extrude(void){_error_("not supported yet");};
    7878                void VerticallyIntegrate(Input* thickness_input);
    79                 void GetVectorFromInputs(Vector* vector,int* doflist);
     79                void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
    8080                void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
    8181                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Inputs/Input.h

    r12704 r13216  
    5858                virtual void   VerticallyIntegrate(Input* thickness_input)=0;
    5959                virtual void   Extrude()=0;
    60                 virtual void   GetVectorFromInputs(Vector* vector,int* doflist)=0;
     60                virtual void   GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist)=0;
    6161                virtual void   GetValuesPtr(IssmDouble** pvalues,int* pnum_values)=0;
    6262               
  • issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp

    r13056 r13216  
    180180/*}}}*/
    181181/*FUNCTION IntInput::GetVectorFromInputs{{{*/
    182 void IntInput::GetVectorFromInputs(Vector* vector,int* doflist){
     182void IntInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
    183183
    184184        _error_("not supporte yet!");
  • issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.h

    r13056 r13216  
    7878                void Extrude(void){_error_("not supported yet");};
    7979                void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
    80                 void GetVectorFromInputs(Vector* vector,int* doflist);
     80                void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
    8181                void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
    8282                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp

    r13056 r13216  
    609609/*}}}*/
    610610/*FUNCTION PentaP1Input::GetVectorFromInputs{{{*/
    611 void PentaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
     611void PentaP1Input::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
    612612
    613613        const int numvertices=6;
  • issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h

    r13056 r13216  
    7979                void Extrude(void);
    8080                void VerticallyIntegrate(Input* thickness_input);
    81                 void GetVectorFromInputs(Vector* vector,int* doflist);
     81                void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
    8282                void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
    8383                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp

    r13056 r13216  
    413413/*}}}*/
    414414/*FUNCTION TransientInput::GetVectorFromInputs{{{*/
    415 void TransientInput::GetVectorFromInputs(Vector* vector,int* doflist){
     415void TransientInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
    416416
    417417        IssmDouble time;
  • issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h

    r13056 r13216  
    8181                void Extrude(void);
    8282                void VerticallyIntegrate(Input* thickness_forcing){_error_("not supported yet");};
    83                 void GetVectorFromInputs(Vector* vector,int* doflist);
     83                void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
    8484                void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not supported yet");};
    8585      void GetTimeValues(IssmDouble* values,IssmDouble time){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp

    r13056 r13216  
    340340/*}}}*/
    341341/*FUNCTION TriaP1Input::GetVectorFromInputs{{{*/
    342 void TriaP1Input::GetVectorFromInputs(Vector* vector,int* doflist){
     342void TriaP1Input::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){
    343343
    344344        const int numvertices=3;
  • issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h

    r13056 r13216  
    7979                void Extrude(void){_error_("not supported yet");};
    8080                void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
    81                 void GetVectorFromInputs(Vector* vector,int* doflist);
     81                void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist);
    8282                void GetValuesPtr(IssmDouble** pvalues,int* pnum_values);
    8383                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp

    r13129 r13216  
    228228/*}}}*/
    229229/*FUNCTION Icefront::CreateKMatrix {{{*/
    230 void  Icefront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
     230void  Icefront::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
    231231
    232232        /*No stiffness loads applied, do nothing: */
     
    236236/*}}}*/
    237237/*FUNCTION Icefront::CreatePVector {{{*/
    238 void  Icefront::CreatePVector(Vector* pf){
     238void  Icefront::CreatePVector(Vector<IssmDouble>* pf){
    239239
    240240        /*Checks in debugging mode*/
     
    274274/*}}}*/
    275275/*FUNCTION Icefront::CreateJacobianMatrix{{{*/
    276 void  Icefront::CreateJacobianMatrix(Matrix* Jff){
     276void  Icefront::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){
    277277        this->CreateKMatrix(Jff,NULL);
    278278}
    279279/*}}}*/
    280280/*FUNCTION Icefront::PenaltyCreateKMatrix {{{*/
    281 void  Icefront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs, IssmDouble kmax){
     281void  Icefront::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs, IssmDouble kmax){
    282282        /*do nothing: */
    283283        return;
     
    285285/*}}}*/
    286286/*FUNCTION Icefront::PenaltyCreatePVector{{{*/
    287 void  Icefront::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
     287void  Icefront::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
    288288        /*do nothing: */
    289289        return;
     
    291291/*}}}*/
    292292/*FUNCTION Icefront::PenaltyCreateJacobianMatrix{{{*/
    293 void  Icefront::PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){
     293void  Icefront::PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){
    294294        this->PenaltyCreateKMatrix(Jff,NULL,kmax);
    295295}
  • issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.h

    r13036 r13216  
    6969                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    7070                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    71                 void  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
    72                 void  CreatePVector(Vector* pf);
    73                 void  CreateJacobianMatrix(Matrix* Jff);
    74                 void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
    75                 void  PenaltyCreatePVector(Vector*  pf, IssmDouble kmax);
    76                 void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax);
     71                void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
     72                void  CreatePVector(Vector<IssmDouble>* pf);
     73                void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
     74                void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
     75                void  PenaltyCreatePVector(Vector<IssmDouble>*  pf, IssmDouble kmax);
     76                void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax);
    7777                bool  InAnalysis(int analysis_type);
    7878                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Loads/Load.h

    r12832 r13216  
    1212/*{{{*/
    1313class Object;
    14 class Matrix;
    15 class Vector;
     14template <class doublematrix> class Matrix;
     15template <class doubletype> class Vector;
    1616
    1717#include "../Object.h"
     
    2929                virtual void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
    3030                virtual void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
    31                 virtual void  CreateKMatrix(Matrix* Kff, Matrix* Kfs)=0;
    32                 virtual void  CreatePVector(Vector* pf)=0;
    33                 virtual void  CreateJacobianMatrix(Matrix* Jff)=0;
    34                 virtual void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax)=0;
    35                 virtual void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs, IssmDouble kmax)=0;
    36                 virtual void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax)=0;
     31                virtual void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs)=0;
     32                virtual void  CreatePVector(Vector<IssmDouble>* pf)=0;
     33                virtual void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff)=0;
     34                virtual void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax)=0;
     35                virtual void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs, IssmDouble kmax)=0;
     36                virtual void  PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax)=0;
    3737                virtual bool  InAnalysis(int analysis_type)=0;
    3838                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp

    r13036 r13216  
    251251/*}}}*/
    252252/*FUNCTION Numericalflux::CreateKMatrix {{{*/
    253 void  Numericalflux::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
     253void  Numericalflux::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
    254254
    255255        /*recover some parameters*/
     
    282282/*}}}*/
    283283/*FUNCTION Numericalflux::CreatePVector {{{*/
    284 void  Numericalflux::CreatePVector(Vector* pf){
     284void  Numericalflux::CreatePVector(Vector<IssmDouble>* pf){
    285285
    286286        /*recover some parameters*/
     
    312312/*}}}*/
    313313/*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{*/
    314 void  Numericalflux::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
     314void  Numericalflux::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
    315315
    316316        /*No stiffness loads applied, do nothing: */
     
    320320/*}}}*/
    321321/*FUNCTION Numericalflux::PenaltyCreatePVector{{{*/
    322 void  Numericalflux::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
     322void  Numericalflux::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
    323323
    324324        /*No penalty loads applied, do nothing: */
  • issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h

    r13036 r13216  
    6565                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    6666                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    67                 void  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
    68                 void  CreatePVector(Vector* pf);
    69                 void  CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");};
    70                 void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");};
    71                 void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
    72                 void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
     67                void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
     68                void  CreatePVector(Vector<IssmDouble>* pf);
     69                void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
     70                void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
     71                void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
     72                void  PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
    7373                bool  InAnalysis(int analysis_type);
    7474                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp

    r13073 r13216  
    201201/*}}}*/
    202202/*FUNCTION Pengrid::CreateKMatrix {{{*/
    203 void  Pengrid::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
     203void  Pengrid::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
    204204
    205205        /*No loads applied, do nothing: */
     
    209209/*}}}*/
    210210/*FUNCTION Pengrid::CreatePVector {{{*/
    211 void  Pengrid::CreatePVector(Vector* pf){
     211void  Pengrid::CreatePVector(Vector<IssmDouble>* pf){
    212212
    213213        /*No loads applied, do nothing: */
     
    217217/*}}}*/
    218218/*FUNCTION Pengrid::PenaltyCreateMatrix {{{*/
    219 void  Pengrid::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
     219void  Pengrid::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
    220220
    221221        /*Retrieve parameters: */
     
    250250/*}}}*/
    251251/*FUNCTION Pengrid::PenaltyCreatePVector {{{*/
    252 void  Pengrid::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
     252void  Pengrid::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
    253253
    254254        /*Retrieve parameters: */
  • issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.h

    r13036 r13216  
    7070                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    7171                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    72                 void  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
    73                 void  CreatePVector(Vector* pf);
    74                 void  CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");};
    75                 void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");};
    76                 void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
    77                 void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
     72                void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
     73                void  CreatePVector(Vector<IssmDouble>* pf);
     74                void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
     75                void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
     76                void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
     77                void  PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
    7878                bool  InAnalysis(int analysis_type);
    7979                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp

    r13036 r13216  
    136136/*}}}*/
    137137/*FUNCTION Penpair::CreateKMatrix {{{*/
    138 void  Penpair::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
     138void  Penpair::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
    139139        /*If you code this piece, don't forget that a penalty will be inactive if it is dealing with clone nodes*/
    140140        /*No loads applied, do nothing: */
     
    144144/*}}}*/
    145145/*FUNCTION Penpair::CreatePVector {{{*/
    146 void  Penpair::CreatePVector(Vector* pf){
     146void  Penpair::CreatePVector(Vector<IssmDouble>* pf){
    147147
    148148        /*No loads applied, do nothing: */
     
    152152/*}}}*/
    153153/*FUNCTION Penpair::CreateJacobianMatrix{{{*/
    154 void  Penpair::CreateJacobianMatrix(Matrix* Jff){
     154void  Penpair::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){
    155155        this->CreateKMatrix(Jff,NULL);
    156156}
    157157/*}}}*/
    158158/*FUNCTION Penpair::PenaltyCreateKMatrix {{{*/
    159 void  Penpair::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
     159void  Penpair::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
    160160
    161161        /*Retrieve parameters: */
     
    183183/*}}}*/
    184184/*FUNCTION Penpair::PenaltyCreatePVector {{{*/
    185 void  Penpair::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
     185void  Penpair::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
    186186        /*No loads applied, do nothing: */
    187187        return;
     
    189189/*}}}*/
    190190/*FUNCTION Penpair::PenaltyCreateJacobianMatrix{{{*/
    191 void  Penpair::PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){
     191void  Penpair::PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){
    192192        this->PenaltyCreateKMatrix(Jff,NULL,kmax);
    193193}
  • issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.h

    r13036 r13216  
    5757                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    5858                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    59                 void  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
    60                 void  CreatePVector(Vector* pf);
    61                 void  CreateJacobianMatrix(Matrix* Jff);
    62                 void  PenaltyCreateKMatrix(Matrix* Kff,Matrix* Kfs,IssmDouble kmax);
    63                 void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
    64                 void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax);
     59                void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
     60                void  CreatePVector(Vector<IssmDouble>* pf);
     61                void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
     62                void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff,Matrix<IssmDouble>* Kfs,IssmDouble kmax);
     63                void  PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
     64                void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax);
    6565                bool  InAnalysis(int analysis_type);
    6666                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp

    r13073 r13216  
    309309/*}}}*/
    310310/*FUNCTION Riftfront::PenaltyCreateKMatrix {{{*/
    311 void  Riftfront::PenaltyCreateKMatrix(Matrix* Kff, Matrix* Kfs,IssmDouble kmax){
     311void  Riftfront::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){
    312312
    313313        /*Retrieve parameters: */
     
    335335/*}}}*/
    336336/*FUNCTION Riftfront::PenaltyCreatePVector {{{*/
    337 void  Riftfront::PenaltyCreatePVector(Vector* pf,IssmDouble kmax){
     337void  Riftfront::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){
    338338
    339339        /*Retrieve parameters: */
     
    361361/*}}}*/
    362362/*FUNCTION Riftfront::CreateKMatrix {{{*/
    363 void  Riftfront::CreateKMatrix(Matrix* Kff, Matrix* Kfs){
     363void  Riftfront::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){
    364364        /*do nothing: */
    365365        return;
     
    367367/*}}}*/
    368368/*FUNCTION Riftfront::CreatePVector {{{*/
    369 void  Riftfront::CreatePVector(Vector* pf){
     369void  Riftfront::CreatePVector(Vector<IssmDouble>* pf){
    370370        /*do nothing: */
    371371        return;
  • issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.h

    r13036 r13216  
    7777                void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    7878                void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    79                 void  CreateKMatrix(Matrix* Kff, Matrix* Kfs);
    80                 void  CreatePVector(Vector* pf);
    81                 void  CreateJacobianMatrix(Matrix* Jff){_error_("Not implemented yet");};
    82                 void  PenaltyCreateJacobianMatrix(Matrix* Jff,IssmDouble kmax){_error_("Not implemented yet");};
    83                 void  PenaltyCreateKMatrix(Matrix* Kff, Matrix* kfs, IssmDouble kmax);
    84                 void  PenaltyCreatePVector(Vector* pf, IssmDouble kmax);
     79                void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
     80                void  CreatePVector(Vector<IssmDouble>* pf);
     81                void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
     82                void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
     83                void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
     84                void  PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
    8585                bool  InAnalysis(int analysis_type);
    8686                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp

    r13168 r13216  
    193193/*}}}*/
    194194/*FUNCTION Matdamageice::GetVectorFromInputs{{{*/
    195 void  Matdamageice::GetVectorFromInputs(Vector* vector,int input_enum){
     195void  Matdamageice::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){
    196196
    197197        /*Intermediaries*/
  • issm/trunk-jpl/src/c/classes/objects/Materials/Matdamageice.h

    r13130 r13216  
    4949                void   InputDuplicate(int original_enum,int new_enum);
    5050                void   Configure(Elements* elements);
    51                 void   GetVectorFromInputs(Vector* vector,int input_enum);
     51                void   GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum);
    5252                void   SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
    5353                void   GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon);
  • issm/trunk-jpl/src/c/classes/objects/Materials/Material.h

    r13129 r13216  
    2424                virtual void       InputDuplicate(int original_enum,int new_enum)=0;
    2525                virtual void       Configure(Elements* elements)=0;
    26                 virtual void       GetVectorFromInputs(Vector* vector,int input_enum)=0;
     26                virtual void       GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum)=0;
    2727                virtual void       GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon)=0;
    2828                virtual void       GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon)=0;
  • issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp

    r13129 r13216  
    173173/*}}}*/
    174174/*FUNCTION Matice::GetVectorFromInputs{{{*/
    175 void  Matice::GetVectorFromInputs(Vector* vector,int input_enum){
     175void  Matice::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){
    176176
    177177        /*Intermediaries*/
  • issm/trunk-jpl/src/c/classes/objects/Materials/Matice.h

    r13129 r13216  
    4949                void   InputDuplicate(int original_enum,int new_enum);
    5050                void   Configure(Elements* elements);
    51                 void   GetVectorFromInputs(Vector* vector,int input_enum);
     51                void   GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum);
    5252                void       SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    5353                void       GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon);
  • issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h

    r13129 r13216  
    6767                void   InputDuplicate(int original_enum,int new_enum){_error_("not implemented yet");};
    6868                void   Configure(Elements* elements);
    69                 void   GetVectorFromInputs(Vector* vector,int input_enum){return;}
     69                void   GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){return;}
    7070                void       GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon){_error_("not supported");};
    7171                void       GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon){_error_("not supported");};
  • issm/trunk-jpl/src/c/classes/objects/Node.cpp

    r13073 r13216  
    487487/*}}}*/
    488488/*FUNCTION Node::CreateVecSets {{{*/
    489 void  Node::CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s){
     489void  Node::CreateVecSets(Vector<IssmDouble>* pv_g,Vector<IssmDouble>* pv_f,Vector<IssmDouble>* pv_s){
    490490
    491491        IssmDouble gvalue=1.0; //all nodes are in the g set;
     
    513513/*}}}*/
    514514/*FUNCTION Node::CreateNodalConstraints{{{*/
    515 void  Node::CreateNodalConstraints(Vector* ys){
     515void  Node::CreateNodalConstraints(Vector<IssmDouble>* ys){
    516516
    517517        int i;
     
    794794/*}}}*/
    795795/*FUNCTION Node::VecMerge {{{*/
    796 void   Node::VecMerge(Vector* ug, IssmDouble* vector_serial,int setenum){
     796void   Node::VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum){
    797797
    798798        IssmDouble* values=NULL;
     
    845845/*}}}*/
    846846/*FUNCTION Node::VecReduce {{{*/
    847 void   Node::VecReduce(Vector* vector, IssmDouble* ug_serial,int setenum){
     847void   Node::VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setenum){
    848848
    849849        IssmDouble* values=NULL;
  • issm/trunk-jpl/src/c/classes/objects/Node.h

    r13036 r13216  
    1616class  DataSet;
    1717class  Vertices;
    18 class  Vector;
    19 class  Matrix;
     18template <class doubletype> class  Vector;
     19template <class doubletype> class  Matrix;
    2020#include "../Update.h"
    2121/*}}}*/
     
    6464                /*Node numerical routines {{{*/
    6565                void   Configure(DataSet* nodes,Vertices* vertices);
    66                 void   CreateNodalConstraints(Vector* ys);
     66                void   CreateNodalConstraints(Vector<IssmDouble>* ys);
    6767                void   SetCurrentConfiguration(DataSet* nodes,Vertices* vertices);
    6868                int    Sid(void);
     
    8282                void   DofInFSet(int dof);
    8383                int    GetDof(int dofindex,int setenum);
    84                 void   CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s);
     84                void   CreateVecSets(Vector<IssmDouble>* pv_g,Vector<IssmDouble>* pv_f,Vector<IssmDouble>* pv_s);
    8585                int    GetConnectivity();
    8686                void   GetDofList(int* poutdoflist,int approximation_enum,int setenum);
     
    9898                int    IsGrounded();
    9999                void   UpdateSpcs(IssmDouble* ys);
    100                 void   VecMerge(Vector* ug, IssmDouble* vector_serial,int setenum);
    101                 void   VecReduce(Vector* vector, IssmDouble* ug_serial,int setnum);
     100                void   VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum);
     101                void   VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setnum);
    102102               
    103103                /*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Options/Option.h

    r13036 r13216  
    1818        public:
    1919
    20                 char* name;
    21                 int   numel;
    22                 int   ndims;
    23                 int*  size;
    24 
     20               
    2521                /*Option constructors, destructors {{{*/
    26                 Option();
    27                 ~Option();
     22                Option(){};
     23                ~Option(){};
    2824                /*}}}*/
     25               
    2926                /*Object virtual functions definitions:{{{*/
    30                 virtual void  Echo();
    31                 virtual void  DeepEcho();
    32                 virtual void  DeepEcho(char* indent);
     27                virtual void  Echo()=0;
     28                virtual void  DeepEcho()=0;
     29                virtual void  DeepEcho(char* indent)=0;
    3330                int   Id(){_error_("Not implemented yet");};
    3431                int   MyRank(){_error_("Not implemented yet");};
     
    4239                virtual int   NDims()=0;
    4340                virtual int*  Size()=0;
    44                 virtual void  Get(int* pvalue)=0;
    45                 virtual void  Get(IssmDouble* pvalue)=0;
    46                 virtual void  Get(bool* pvalue)=0;
    47                 virtual void  Get(char** pvalue)=0;
    48                 virtual void  Get(char*** ppvalue,int *pnumel)=0;
    49                 virtual void  Get(IssmDouble** pvalue,int *pnumel)=0;
    50                 virtual void  Get(Options** pvalue)=0;
    51                 virtual void  Get(Options*** ppvalue,int *pnumel)=0;
    5241
    5342};
  • issm/trunk-jpl/src/c/classes/objects/Params/BoolParam.h

    r13129 r13216  
    5353                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
    5454                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
    55                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
    56                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
     55                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
     56                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
    5757                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
    5858
     
    6666                void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    6767                void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    68                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
    69                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
     68                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
     69                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
    7070                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
    7171                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatArrayParam.h

    r13036 r13216  
    5656                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");}
    5757                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims);
    58                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");}
    59                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");}
     58                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Vec");}
     59                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a Mat");}
    6060                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a FILE");}
    6161
     
    6969                void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a int vec array");}
    7070                void  SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a int mat array");}
    71                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");}
    72                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");}
     71                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Vec");}
     72                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a Mat");}
    7373                void  SetValue(FILE* fid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
    7474                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array);
  • issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h

    r13036 r13216  
    5555                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN);
    5656                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
    57                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
    58                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
     57                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
     58                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
    5959                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
    6060
     
    6868                void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");}
    6969                void  SetValue(int* intarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
    70                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
    71                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
     70                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
     71                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
    7272                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
    7373                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/DoubleParam.h

    r13036 r13216  
    5454                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
    5555                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
    56                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
    57                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
     56                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
     57                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
    5858                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
    5959
     
    6767                void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    6868                void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    69                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
    70                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
     69                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
     70                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
    7171                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
    7272                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/DoubleVecParam.h

    r13036 r13216  
    5454                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN);
    5555                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
    56                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
    57                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
     56                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
     57                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
    5858                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
    5959
     
    6767                void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");};
    6868                void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
    69                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
    70                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
     69                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
     70                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
    7171                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
    7272                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/FileParam.h

    r13036 r13216  
    5353                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
    5454                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
    55                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
    56                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
     55                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
     56                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
    5757                void  GetParameterValue(FILE** pfid){*pfid=value;};
    5858
     
    6666                void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    6767                void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    68                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
    69                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
     68                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
     69                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
    7070                void  SetValue(FILE* fid){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
    7171                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/GenericParam.h

    r13186 r13216  
    4747                  _printLine_("   value: " << myP);;
    4848                }
    49                  void  Echo() {DeepEcho();};
     49                void  Echo() {DeepEcho();};
    5050                int   Id(){ return -1; };
    5151                int   MyRank() { extern int my_rank; return my_rank;} ;
     
    7777                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a IssmDouble array");}
    7878                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a matrix array");}
    79                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Vec");}
    80                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Mat");}
     79                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Vec");}
     80                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a Mat");}
    8181                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a FILE");}
    8282
     
    9090                void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a IssmDouble array");}
    9191                void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a IssmDouble array");}
    92                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Vec");}
    93                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Mat");}
     92                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Vec");}
     93                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a Mat");}
    9494                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a FILE");}
    9595                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/IntMatParam.h

    r13036 r13216  
    5555                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");};
    5656                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
    57                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
    58                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
     57                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
     58                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
    5959                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
    6060
     
    6868                void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");};
    6969                void  SetValue(int* intarray,int M,int N);
    70                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
    71                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
     70                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
     71                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
    7272                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
    7373                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/IntParam.h

    r13036 r13216  
    5454                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
    5555                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
    56                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
    57                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
     56                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
     57                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
    5858                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
    5959
     
    6767                void  SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
    6868                void  SetValue(IssmDouble* pIssmDoublearray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");}
    69                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
    70                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
     69                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
     70                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
    7171                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
    7272                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/IntVecParam.h

    r13036 r13216  
    5555                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
    5656                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
    57                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
    58                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
     57                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
     58                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
    5959                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
    6060
     
    6868                void  SetValue(int* intarray,int M);
    6969                void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}
    70                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
    71                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
     70                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
     71                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
    7272                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
    7373                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/MatrixParam.cpp

    r12832 r13216  
    2626}
    2727/*}}}*/
    28 /*FUNCTION MatrixParam::MatrixParam(int enum_type,Matrix* value){{{*/
    29 MatrixParam::MatrixParam(int in_enum_type,Matrix* in_value){
     28/*FUNCTION MatrixParam::MatrixParam(int enum_type,Matrix<IssmDouble>* value){{{*/
     29MatrixParam::MatrixParam(int in_enum_type,Matrix<IssmDouble>* in_value){
    3030
    3131        enum_type=in_enum_type;
     
    8787/*MatrixParam virtual functions definitions: */
    8888/*FUNCTION MatrixParam::GetParameterValue{{{*/
    89 void  MatrixParam::GetParameterValue(Matrix** poutput){
    90         Matrix* output=NULL;
     89void  MatrixParam::GetParameterValue(Matrix<IssmDouble>** poutput){
     90        Matrix<IssmDouble>* output=NULL;
    9191
    9292        if(value){
     
    102102/*}}}*/
    103103/*FUNCTION MatrixParam::SetValue{{{*/
    104 void  MatrixParam::SetValue(Matrix* matrix){
     104void  MatrixParam::SetValue(Matrix<IssmDouble>* matrix){
    105105       
    106106        /*avoid leak: */
  • issm/trunk-jpl/src/c/classes/objects/Params/MatrixParam.h

    r13036 r13216  
    2525                /*just hold 3 values for 3 vertices: */
    2626                int enum_type;
    27                 Matrix* value;
     27                Matrix<IssmDouble>* value;
    2828
    2929        public:
    3030                /*MatrixParam constructors, destructors: {{{*/
    3131                MatrixParam();
    32                 MatrixParam(int enum_type,Matrix* value);
     32                MatrixParam(int enum_type,Matrix<IssmDouble>* value);
    3333                ~MatrixParam();
    3434                /*}}}*/
     
    5454                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
    5555                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
    56                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a vec");}
    57                 void  GetParameterValue(Matrix** poutput);
     56                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a vec");}
     57                void  GetParameterValue(Matrix<IssmDouble>** poutput);
    5858                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
    5959
     
    6767                void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    6868                void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    69                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
    70                 void  SetValue(Matrix* mat);
     69                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
     70                void  SetValue(Matrix<IssmDouble>* mat);
    7171                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
    7272                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/Param.h

    r12744 r13216  
    3838                virtual void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN)=0;
    3939                virtual void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims)=0;
    40                 virtual void  GetParameterValue(Vector** pvec)=0;
    41                 virtual void  GetParameterValue(Matrix** pmat)=0;
     40                virtual void  GetParameterValue(Vector<IssmDouble>** pvec)=0;
     41                virtual void  GetParameterValue(Matrix<IssmDouble>** pmat)=0;
    4242                virtual void  GetParameterValue(FILE** pfid)=0;
    4343               
     
    5151                virtual void  SetValue(int* intarray,int M)=0;
    5252                virtual void  SetValue(int* pintarray,int M,int N)=0;
    53                 virtual void  SetValue(Vector* vec)=0;
    54                 virtual void  SetValue(Matrix* mat)=0;
     53                virtual void  SetValue(Vector<IssmDouble>* vec)=0;
     54                virtual void  SetValue(Matrix<IssmDouble>* mat)=0;
    5555                virtual void  SetValue(FILE* fid)=0;
    5656                virtual void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array)=0;
  • issm/trunk-jpl/src/c/classes/objects/Params/StringArrayParam.h

    r13036 r13216  
    5656                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
    5757                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Vec param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a matrix array");}
    58                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
    59                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
     58                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
     59                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
    6060                void  GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");}
    6161
     
    6969                void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    7070                void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    71                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
    72                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
     71                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
     72                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
    7373                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
    7474                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/StringParam.h

    r13036 r13216  
    5454                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
    5555                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
    56                 void  GetParameterValue(Vector** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
    57                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
     56                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Vec");}
     57                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
    5858                void  GetParameterValue(FILE** pfid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
    5959
     
    6767                void  SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    6868                void  SetValue(int* pintarray,int M,int N){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");}
    69                 void  SetValue(Vector* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
    70                 void  SetValue(Matrix* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
     69                void  SetValue(Vector<IssmDouble>* vec){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Vec");}
     70                void  SetValue(Matrix<IssmDouble>* mat){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a Mat");}
    7171                void  SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");}
    7272                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/TransientParam.h

    r13036 r13216  
    5555                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
    5656                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a matrix array");}
    57                 void  GetParameterValue(Vector** pvec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Vec");}
    58                 void  GetParameterValue(Matrix** pmat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Mat");}
     57                void  GetParameterValue(Vector<IssmDouble>** pvec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Vec");}
     58                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a Mat");}
    5959                void  GetParameterValue(FILE** pfid){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a FILE");}
    6060
     
    6868                void  SetValue(int* intarray,int M){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int vec array");}
    6969                void  SetValue(int* intarray,int M,int N){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int mat array");};
    70                 void  SetValue(Vector* vec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");}
    71                 void  SetValue(Matrix* mat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Mat");}
     70                void  SetValue(Vector<IssmDouble>* vec){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Vec");}
     71                void  SetValue(Matrix<IssmDouble>* mat){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a Mat");}
    7272                void  SetValue(FILE* fid){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");}
    7373                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Params/VectorParam.cpp

    r12832 r13216  
    2727/*}}}*/
    2828/*FUNCTION VectorParam::VectorParam(int enum_type,IssmVector value){{{*/
    29 VectorParam::VectorParam(int in_enum_type,Vector* in_value){
     29VectorParam::VectorParam(int in_enum_type,Vector<IssmDouble>* in_value){
    3030
    3131        enum_type=in_enum_type;
     
    8989/*VectorParam virtual functions definitions: */
    9090/*FUNCTION VectorParam::GetParameterValue{{{*/
    91 void  VectorParam::GetParameterValue(Vector** poutput){
    92         Vector*  output=NULL;
     91void  VectorParam::GetParameterValue(Vector<IssmDouble>** poutput){
     92        Vector<IssmDouble>*  output=NULL;
    9393
    9494        if(value){
     
    105105/*}}}*/
    106106/*FUNCTION VectorParam::SetValue{{{*/
    107 void  VectorParam::SetValue(Vector* vector){
     107void  VectorParam::SetValue(Vector<IssmDouble>* vector){
    108108
    109109        /*avoid leak: */
  • issm/trunk-jpl/src/c/classes/objects/Params/VectorParam.h

    r13036 r13216  
    2525                /*just hold 3 values for 3 vertices: */
    2626                int enum_type;
    27                 Vector* value;
     27                Vector<IssmDouble>* value;
    2828
    2929        public:
    3030                /*VectorParam constructors, destructors: {{{*/
    3131                VectorParam();
    32                 VectorParam(int enum_type,Vector* value);
     32                VectorParam(int enum_type,Vector<IssmDouble>* value);
    3333                ~VectorParam();
    3434                /*}}}*/
     
    5454                void  GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");}
    5555                void  GetParameterValue(IssmDouble*** parray, int* pM,int** pmdims, int** pndims){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}
    56                 void  GetParameterValue(Matrix** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
    57                 void  GetParameterValue(Vector** poutput);
     56                void  GetParameterValue(Matrix<IssmDouble>** pmat){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a Mat");}
     57                void  GetParameterValue(Vector<IssmDouble>** poutput);
    5858                void  GetParameterValue(FILE** pfid){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");}
    5959
     
    6767                void  SetValue(int* intarray,int M){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
    6868                void  SetValue(int* pintarray,int M,int N){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");}
    69                 void  SetValue(Vector* vec);
    70                 void  SetValue(Matrix* mat){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
     69                void  SetValue(Vector<IssmDouble>* vec);
     70                void  SetValue(Matrix<IssmDouble>* mat){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a Mat");}
    7171                void  SetValue(FILE* fid){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");}
    7272                void  SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");}
  • issm/trunk-jpl/src/c/classes/objects/Vertex.cpp

    r12832 r13216  
    199199/*}}}*/
    200200/*FUNCTION Vertex::UpdateVertexPosition {{{*/
    201 void  Vertex::UpdatePosition(Vector* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed){
     201void  Vertex::UpdatePosition(Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed){
    202202
    203203        IssmDouble oldz,newz;
  • issm/trunk-jpl/src/c/classes/objects/Vertex.h

    r12832 r13216  
    1010#include "../classes.h"
    1111class IoModel;
    12 class Vector;
     12template <class doubletype> class Vector;
    1313class Parameters;
    1414#include "../../shared/Exceptions/exceptions.h"
     
    6060                int   Sid(void);
    6161                int   Connectivity(void);
    62                 void  UpdatePosition(Vector* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed);
     62                void  UpdatePosition(Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed);
    6363                /*}}}*/
    6464};
  • issm/trunk-jpl/src/c/classes/objects/objects.h

    r13185 r13216  
    7070/*Option parsing objects: */
    7171#include "./Options/Option.h"
    72 #include "./Options/OptionDouble.h"
    73 #include "./Options/OptionLogical.h"
    74 #include "./Options/OptionChar.h"
    75 #include "./Options/OptionStruct.h"
    76 #include "./Options/OptionCell.h"
     72#include "./Options/GenericOption.h"
    7773#include "./Options/OptionUtilities.h"
    7874
  • issm/trunk-jpl/src/c/io/Disk/diskio.h

    r12832 r13216  
    66#define _DISK_IO_H_
    77
    8 #include "../../classes/objects/objects.h"
    9 #include "../../Container/Container.h"
    10 #include "../../include/include.h"
     8#include <stdio.h>
    119
    1210FILE* pfopen(char* filename,const char* format);
  • issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp

    r13056 r13216  
    481481
    482482/*ISSM objects*/
    483 /*FUNCTION FetchData(Matrix** pmatrix,const mxArray* dataref){{{*/
    484 void FetchData(Matrix** pmatrix,const mxArray* dataref){
    485 
    486         Matrix* outmatrix=NULL;
     483/*FUNCTION FetchData(Matrix<double>** pmatrix,const mxArray* dataref){{{*/
     484void FetchData(Matrix<double>** pmatrix,const mxArray* dataref){
     485
     486        Matrix<double>* outmatrix=NULL;
    487487        int dummy=0;
    488488
     
    502502}
    503503/*}}}*/
    504 /*FUNCTION FetchData(Vector** pvector,const mxArray* dataref){{{*/
    505 void FetchData(Vector** pvector,const mxArray* dataref){
    506 
    507         Vector* vector=NULL;
     504/*FUNCTION FetchData(Vector<double>** pvector,const mxArray* dataref){{{*/
     505void FetchData(Vector<double>** pvector,const mxArray* dataref){
     506
     507        Vector<double>* vector=NULL;
    508508        int dummy;
    509509
    510510        if(mxIsEmpty(dataref)){
    511511                /*Nothing to pick up. Just initialize matrix pointer to NULL: */
    512                 vector=new Vector(0);
     512                vector=new Vector<double>(0);
    513513        }
    514514        else if (mxIsClass(dataref,"double") ){
  • issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp

    r12850 r13216  
    2222/*}}}*/
    2323
    24 Matrix* MatlabMatrixToMatrix(const mxArray* mxmatrix){
     24Matrix<double>* MatlabMatrixToMatrix(const mxArray* mxmatrix){
    2525
    2626        int dummy;
    27         Matrix* matrix=NULL;
     27        Matrix<double>* matrix=NULL;
    2828
    2929        /*allocate matrix object: */
    30         matrix=new Matrix();
     30        matrix=new Matrix<double>();
    3131
    3232        #ifdef _HAVE_PETSC_
  • issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToSeqMat.cpp

    r12365 r13216  
    1919/*}}}*/
    2020
    21 SeqMat* MatlabMatrixToSeqMat(const mxArray* dataref){
     21SeqMat<double>* MatlabMatrixToSeqMat(const mxArray* dataref){
    2222
    23         SeqMat* output=NULL;
     23        SeqMat<double>* output=NULL;
    2424
    25         output=new SeqMat();
     25        output=new SeqMat<double>();
    2626        MatlabMatrixToDoubleMatrix(&output->matrix,&output->M,&output->N,dataref);
    2727        return output;
  • issm/trunk-jpl/src/c/matlab/io/MatlabVectorToSeqVec.cpp

    r12365 r13216  
    1919/*}}}*/
    2020
    21 SeqVec* MatlabVectorToSeqVec(const mxArray* dataref){
     21SeqVec<double>* MatlabVectorToSeqVec(const mxArray* dataref){
    2222
    23         SeqVec* output=NULL;
     23        SeqVec<double>* output=NULL;
    2424
    25         output=new SeqVec();
     25        output=new SeqVec<double>();
    2626        MatlabVectorToDoubleVector(&output->vector,&output->M,dataref);
    2727        return output;
  • issm/trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp

    r12850 r13216  
    2222/*}}}*/
    2323
    24 Vector* MatlabVectorToVector(const mxArray* mxvector){
     24Vector<double>* MatlabVectorToVector(const mxArray* mxvector){
    2525
    2626        int dummy;
    27         Vector* vector=NULL;
     27        Vector<double>* vector=NULL;
    2828
    2929        /*allocate vector object: */
    30         vector=new Vector();
     30        vector=new Vector<double>();
    3131
    3232        #ifdef _HAVE_PETSC_
  • issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp

    r13056 r13216  
    1515#include "./matlabio.h"
    1616
    17 /*FUNCTION OptionDoubleParse {{{*/
    18 OptionDouble* OptionDoubleParse( char* name, const mxArray* prhs[]){
     17GenericOption<double*>* OptionDoubleParse( char* name, const mxArray* prhs[]){ /*{{{*/
    1918
    20         OptionDouble *odouble = NULL;
     19        GenericOption<double*> *odouble = NULL;
    2120
    2221        /*check and parse the name  */
    23         odouble=new OptionDouble;
     22        odouble=new GenericOption<double*>();
    2423        odouble->name =xNew<char>(strlen(name)+1);
    2524        memcpy(odouble->name,name,(strlen(name)+1)*sizeof(char));
     
    2928                _error_("Value of option \"" << odouble->name  << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
    3029        }
    31         FetchData(&odouble->values,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]);
     30        FetchData(&odouble->value,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]);
    3231
    3332        return(odouble);
    3433}/*}}}*/
    35 /*FUNCTION OptionLogicalParse {{{*/
    36 OptionLogical* OptionLogicalParse( char* name, const mxArray* prhs[]){
     34GenericOption<bool*>* OptionLogicalParse( char* name, const mxArray* prhs[]){ /*{{{*/
    3735
    38         OptionLogical *ological = NULL;
     36        GenericOption<bool*> *ological = NULL;
    3937
    4038        /*check and parse the name  */
    41         ological=new OptionLogical;
     39        ological=new GenericOption<bool*>();
    4240        ological->name =xNew<char>(strlen(name)+1);
    4341        memcpy(ological->name,name,(strlen(name)+1)*sizeof(char));
     
    4745                _error_("Value of option \"" << ological->name  << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
    4846        }
    49         FetchData(&ological->values,&ological->numel,&ological->ndims,&ological->size,prhs[0]);
     47        FetchData(&ological->value,&ological->numel,&ological->ndims,&ological->size,prhs[0]);
    5048
    5149        return(ological);
    5250}/*}}}*/
    53 /*FUNCTION OptionCharParse {{{*/
    54 OptionChar* OptionCharParse( char* name, const mxArray* prhs[]){
     51GenericOption<char*>* OptionCharParse( char* name, const mxArray* prhs[]){ /*{{{*/
    5552
    56         OptionChar  *ochar = NULL;
     53        GenericOption<char*>  *ochar = NULL;
    5754
    5855        /*check and parse the name  */
    59         ochar=new OptionChar();
     56        ochar=new GenericOption<char*>();
    6057        ochar->name =xNew<char>(strlen(name)+1);
    6158        memcpy(ochar->name,name,(strlen(name)+1)*sizeof(char));
     
    6562                _error_("Value of option \"" << ochar->name  << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\".");
    6663        }
    67         FetchData(&ochar->values,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]);
     64        FetchData(&ochar->value,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]);
    6865
    6966        return(ochar);
    7067}/*}}}*/
    71 /*FUNCTION OptionStructParse {{{*/
    72 OptionStruct* OptionStructParse( char* name, const mxArray* prhs[]){
     68GenericOption<Options**>* OptionStructParse( char* name, const mxArray* prhs[]){ /*{{{*/
    7369
    7470        int            i;
    7571        char           namei[161];
    76         OptionStruct  *ostruct    = NULL;
    77         Option        *option     = NULL;
     72        Option*                   option      = NULL;
     73        GenericOption<Options**>  *ostruct    = NULL;
    7874        const mwSize  *ipt        = NULL;
    7975        const mxArray *structi;
     
    8177
    8278        /*check and parse the name  */
    83         ostruct=new OptionStruct;
     79        ostruct=new GenericOption<Options**>();
    8480        ostruct->name =xNew<char>(strlen(name)+1);
    8581        memcpy(ostruct->name,name,(strlen(name)+1)*sizeof(char));
     
    9490        ostruct->size =xNew<int>(ostruct->ndims);
    9591        for (i=0; i<ostruct->ndims; i++) ostruct->size[i]=(int)ipt[i];
    96         if (ostruct->numel) ostruct->values=xNew<Options*>(ostruct->numel);
     92        if (ostruct->numel) ostruct->value=xNew<Options*>(ostruct->numel);
    9793
    9894        /*loop through and process each element of the struct array  */
    9995        for (sindex=0; sindex<ostruct->numel; sindex++) {
    100                 ostruct->values[sindex]=new Options;
     96                ostruct->value[sindex]=new Options;
    10197
    10298                /*loop through and process each field for the element  */
     
    106102
    107103                        option=(Option*)OptionParse(namei,&structi);
    108                         ostruct->values[sindex]->AddObject((Object*)option);
     104                        ostruct->value[sindex]->AddObject((Object*)option);
    109105                        option=NULL;
    110106                }
     
    113109        return(ostruct);
    114110}/*}}}*/
    115 /*FUNCTION OptionCellParse {{{*/
    116 OptionCell* OptionCellParse( char* name, const mxArray* prhs[]){
     111GenericOption<Options*>* OptionCellParse( char* name, const mxArray* prhs[]){ /*{{{*/
    117112
    118113        int            i;
     
    120115        char           namei[161];
    121116        char           cstr[81];
    122         OptionCell    *ocell      = NULL;
     117        GenericOption<Options*> *ocell      = NULL;
    123118        Option        *option     = NULL;
    124119        const mwSize  *ipt        = NULL;
     
    127122
    128123        /*check and parse the name  */
    129         ocell=new OptionCell;
     124        ocell=new GenericOption<Options*>();
    130125        ocell->name =xNew<char>(strlen(name)+1);
    131126        memcpy(ocell->name,name,(strlen(name)+1)*sizeof(char));
     
    141136        ocell->size =xNew<int>(ocell->ndims);
    142137        for (i=0; i<ocell->ndims; i++) ocell->size[i]=(int)ipt[i];
    143         ocell->values=new Options;
     138        ocell->value=new Options;
    144139
    145140        /*loop through and process each element of the cell array  */
     
    156151
    157152                option=(Option*)OptionParse(namei,&celli);
    158                 ocell->values->AddObject((Object*)option);
     153                ocell->value->AddObject((Object*)option);
    159154                option=NULL;
    160155        }
     
    163158        return(ocell);
    164159}/*}}}*/
    165 /*FUNCTION OptionParse{{{*/
    166 Option* OptionParse(char* name, const mxArray* prhs[]){
     160Option* OptionParse(char* name, const mxArray* prhs[]){ /*{{{*/
    167161
    168162        Option *option = NULL;
  • issm/trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp

    r12850 r13216  
    217217/*}}}*/
    218218/*FUNCTION WriteData(mxArray** pdataref,Matrix* matrix){{{*/
    219 void WriteData(mxArray** pdataref,Matrix* matrix){
     219void WriteData(mxArray** pdataref,Matrix<double>* matrix){
    220220               
    221221        int      i,j;
     
    255255}
    256256/*}}}*/
    257 /*FUNCTION WriteData(mxArray** pdataref,Vector* vector){{{*/
    258 void WriteData(mxArray** pdataref,Vector* vector){
     257/*FUNCTION WriteData(mxArray** pdataref,Vector<double>* vector){{{*/
     258void WriteData(mxArray** pdataref,Vector<double>* vector){
    259259       
    260260        mxArray* dataref=NULL;
  • issm/trunk-jpl/src/c/matlab/io/matlabio.h

    r12850 r13216  
    1818#include <mex.h>
    1919
    20 void WriteData(mxArray** pdataref,Matrix* matrix);
     20void WriteData(mxArray** pdataref,Matrix<double>* matrix);
    2121void WriteData(mxArray** pdataref,double* matrix, int M,int N);
    2222void WriteData(mxArray** pdataref,int*    matrix, int M,int N);
    23 void WriteData(mxArray** pdataref,Vector* vector);
     23void WriteData(mxArray** pdataref,Vector<double>* vector);
    2424void WriteData(mxArray** pdataref,double* vector, int M);
    2525void WriteData(mxArray** pdataref,int integer);
     
    3535void FetchData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref);
    3636void FetchData(bool** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref);
    37 void FetchData(Matrix** pmatrix,const mxArray* dataref);
     37void FetchData(Matrix<double>** pmatrix,const mxArray* dataref);
    3838void FetchData(int** pvector,int* pM,const mxArray* dataref);
    3939void FetchData(float** pvector,int* pM,const mxArray* dataref);
    4040void FetchData(double** pvector,int* pM,const mxArray* dataref);
    4141void FetchData(bool** pvector,int* pM,const mxArray* dataref);
    42 void FetchData(Vector** pvector,const mxArray* dataref);
     42void FetchData(Vector<double>** pvector,const mxArray* dataref);
    4343void FetchData(char** pstring,const mxArray* dataref);
    4444void FetchData(char** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref);
     
    5252
    5353Option* OptionParse(char* name, const mxArray* prhs[]);
    54 OptionDouble*   OptionDoubleParse( char* name, const mxArray* prhs[]);
    55 OptionLogical*  OptionLogicalParse( char* name, const mxArray* prhs[]);
    56 OptionChar*     OptionCharParse( char* name, const mxArray* prhs[]);
    57 OptionStruct*  OptionStructParse( char* name, const mxArray* prhs[]);
    58 OptionCell*     OptionCellParse( char* name, const mxArray* prhs[]);
     54GenericOption<double*>*   OptionDoubleParse( char* name, const mxArray* prhs[]);
     55GenericOption<bool*>*     OptionLogicalParse( char* name, const mxArray* prhs[]);
     56GenericOption<char*>*     OptionCharParse( char* name, const mxArray* prhs[]);
     57GenericOption<Options**>* OptionStructParse( char* name, const mxArray* prhs[]);
     58GenericOption<Options*>*  OptionCellParse( char* name, const mxArray* prhs[]);
    5959
    6060mxArray* mxGetAssignedField(const mxArray* pmxa_array,int number, const char* field);
     
    6363
    6464/*Matlab to Matrix routines: */
    65 Matrix* MatlabMatrixToMatrix(const mxArray* mxmatrix);
    66 Vector* MatlabVectorToVector(const mxArray* mxvector);
     65Matrix<double>* MatlabMatrixToMatrix(const mxArray* mxmatrix);
     66Vector<double>* MatlabVectorToVector(const mxArray* mxvector);
    6767
    6868/*Matlab to double* routines: */
     
    7474
    7575/*Matlab to SeqMat routines: */
    76 SeqMat* MatlabMatrixToSeqMat(const mxArray* dataref);
    77 SeqVec* MatlabVectorToSeqVec(const mxArray* dataref);
     76SeqMat<double>* MatlabMatrixToSeqMat(const mxArray* dataref);
     77SeqVec<double>* MatlabVectorToSeqVec(const mxArray* dataref);
    7878
    7979/*Matlab to Petsc routines: */
  • issm/trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp

    r12453 r13216  
    2929
    3030        /*output: */
    31         Vector* partition_contributions=NULL;
    32         Vector* partition_areas=NULL;
    33         Vector* vec_average=NULL;
     31        Vector<IssmDouble>* partition_contributions=NULL;
     32        Vector<IssmDouble>* partition_areas=NULL;
     33        Vector<IssmDouble>* vec_average=NULL;
    3434        double* average=NULL;
    3535
     
    4444
    4545        /*allocate: */
    46         partition_contributions=new Vector(npart);
    47         partition_areas=new Vector(npart);
    48         vec_average=new Vector(npart);
     46        partition_contributions=new Vector<IssmDouble>(npart);
     47        partition_areas=new Vector<IssmDouble>(npart);
     48        vec_average=new Vector<IssmDouble>(npart);
    4949
    5050        /*loop on each element, and add contribution of the element to the partition (surface weighted average): */
  • issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.cpp

    r12572 r13216  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void    ComputeBasalStressx( Vector** psigma,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
     12void    ComputeBasalStressx( Vector<IssmDouble>** psigma,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
    1313
    1414        /*Intermediary*/
     
    1919
    2020        /*output: */
    21         Vector* sigma=NULL;
     21        Vector<IssmDouble>* sigma=NULL;
    2222
    2323        /*Recover numberofelements: */
     
    2525
    2626        /*Allocate sigma on numberofelements: */
    27         sigma=new Vector(reCast<int>(numberofelements));
     27        sigma=new Vector<IssmDouble>(reCast<int>(numberofelements));
    2828
    2929        /*Compute basal stress for each element: */
  • issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h

    r12832 r13216  
    1010
    1111/* local prototypes: */
    12 void    ComputeBasalStressx( Vector** pp_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
     12void    ComputeBasalStressx( Vector<IssmDouble>** pp_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
    1313
    1414#endif  /* _COMPUTEBASALSTRESSX_H */
  • issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp

    r11695 r13216  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void    ComputeStrainRatex( Vector** peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
     12void    ComputeStrainRatex( Vector<IssmDouble>** peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){
    1313
    1414        /*Intermediary*/
     
    1919
    2020        /*output: */
    21         Vector* eps=NULL;
     21        Vector<IssmDouble>* eps=NULL;
    2222
    2323        /*Recover numberofelements: */
     
    2525
    2626        /*Allocate eps on numberofelements (only 1 dof): */
    27         eps=new Vector(numberofelements);
     27        eps=new Vector<IssmDouble>(numberofelements);
    2828
    2929        /*Compute basal stress for each element: */
  • issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h

    r12832 r13216  
    1010
    1111/* local prototypes: */
    12 void    ComputeStrainRatex(Vector** eps_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
     12void    ComputeStrainRatex(Vector<IssmDouble>** eps_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
    1313
    1414#endif  /* _COMPUTESTRAINRATEX_H */
  • issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp

    r12450 r13216  
    1111#include "./ContourToMeshx.h"
    1212
    13 int ContourToMeshx( Vector** pin_nod,Vector** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
     13int ContourToMeshx( Vector<IssmDouble>** pin_nod,Vector<IssmDouble>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
    1414
    1515        int noerr=1;
     
    3030
    3131        /*output: */
    32         Vector* in_nod=NULL;
    33         Vector* in_elem=NULL;
     32        Vector<IssmDouble>* in_nod=NULL;
     33        Vector<IssmDouble>* in_elem=NULL;
    3434
    35         in_nod=new Vector(nods);
    36         in_elem=new Vector(nel);
     35        in_nod=new Vector<IssmDouble>(nods);
     36        in_elem=new Vector<IssmDouble>(nel);
    3737
    3838        /*initialize thread parameters: */
  • issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h

    r12832 r13216  
    1616        int nods;
    1717        int edgevalue;
    18         Vector* in_nod;
     18        Vector<IssmDouble>* in_nod;
    1919        double* x;
    2020        double* y;
     
    2424
    2525/* local prototypes: */
    26 int ContourToMeshx( Vector** pin_nods,Vector** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
     26int ContourToMeshx( Vector<IssmDouble>** pin_nods,Vector<IssmDouble>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
    2727
    2828void* ContourToMeshxt(void* vContourToMeshxThreadStruct);
  • issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp

    r12127 r13216  
    3333        double* x=NULL;
    3434        double* y=NULL;
    35         Vector* in_nod=NULL;
     35        Vector<IssmDouble>* in_nod=NULL;
    3636
    3737
  • issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp

    r12121 r13216  
    44#include "./ContourToNodesx.h"
    55
    6 int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){
     6int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){
    77
    88        int i;
     
    1717
    1818        /*output: */
    19         Vector* flags=NULL;
     19        Vector<IssmDouble>* flags=NULL;
    2020
    21         flags=new Vector(nods);
     21        flags=new Vector<IssmDouble>(nods);
    2222
    2323        /*Loop through all contours: */
     
    3939}
    4040
    41 int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
     41int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
    4242
    4343        int i;
     
    5252
    5353        /*output: */
    54         Vector* flags=NULL;
     54        Vector<IssmDouble>* flags=NULL;
    5555
    56         flags=new Vector(nods);
     56        flags=new Vector<IssmDouble>(nods);
    5757
    5858        /*Loop through all contours: */
  • issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h

    r12832 r13216  
    1111
    1212/* local prototypes: */
    13 int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);
    14 int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
     13int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);
     14int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
    1515
    1616#endif /* _CONTOURTONODESX_H */
  • issm/trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp

    r12450 r13216  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void ControlInputGetGradientx( Vector** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
     11void ControlInputGetGradientx( Vector<IssmDouble>** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
    1212
    1313        /*Intermediaries*/
    1414        int  num_controls;
    1515        int *control_type = NULL;
    16         Vector*  gradient=NULL;
     16        Vector<IssmDouble>*  gradient=NULL;
    1717
    1818        /*Retrieve some parameters*/
     
    2121
    2222        /*Allocate and populate gradient*/
    23         gradient=new Vector(num_controls*vertices->NumberOfVertices());
     23        gradient=new Vector<IssmDouble>(num_controls*vertices->NumberOfVertices());
    2424
    2525        for(int i=0;i<num_controls;i++){
  • issm/trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h

    r12832 r13216  
    88#include "../../Container/Container.h"
    99
    10 void    ControlInputGetGradientx( Vector** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
     10void    ControlInputGetGradientx( Vector<IssmDouble>** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
    1111
    1212#endif
  • issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp

    r13073 r13216  
    3030
    3131}
    32 void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* gradient){
     32void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* gradient){
    3333
    3434        /*Serialize gradient*/
  • issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h

    r12832 r13216  
    99
    1010void    ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* gradient);
    11 void    ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* gradient);
     11void    ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* gradient);
    1212
    1313#endif
  • issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp

    r12470 r13216  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void CreateJacobianMatrixx(Matrix** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax){
     12void CreateJacobianMatrixx(Matrix<IssmDouble>** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax){
    1313       
    1414        int      i,connectivity;
     
    1717        Element *element = NULL;
    1818        Load    *load    = NULL;
    19         Matrix*  Jff     = NULL;
     19        Matrix<IssmDouble>*  Jff     = NULL;
    2020
    2121        /*Checks*/
     
    2929
    3030        /*Initialize Jacobian Matrix*/
    31         Jff=new Matrix(fsize,fsize,connectivity,numberofdofspernode);
     31        Jff=new Matrix<IssmDouble>(fsize,fsize,connectivity,numberofdofspernode);
    3232       
    3333        /*Create and assemble matrix*/
  • issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h

    r12832 r13216  
    1010
    1111/* local prototypes: */
    12 void CreateJacobianMatrixx(Matrix** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax);
     12void CreateJacobianMatrixx(Matrix<IssmDouble>** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax);
    1313
    1414#endif  /* _CREATEJACOBIANMATRIXX_H */
  • issm/trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp

    r11679 r13216  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void CreateNodalConstraintsx( Vector** pys, Nodes* nodes,int configuration_type){
     12void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes,int configuration_type){
    1313
    1414        int i;
     
    1818
    1919        /*output: */
    20         Vector* ys=NULL;
     20        Vector<IssmDouble>* ys=NULL;
    2121
    2222        /*figure out how many dofs we have: */
     
    2424
    2525        /*allocate:*/
    26         ys=new Vector(numberofdofs);
     26        ys=new Vector<IssmDouble>(numberofdofs);
    2727
    2828        /*go through all nodes, and for the ones corresponding to this configuration_type, fill the
  • issm/trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.h

    r12832 r13216  
    99
    1010/* local prototypes: */
    11 void CreateNodalConstraintsx( Vector** pys, Nodes* nodes,int configuration_type);
     11void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes,int configuration_type);
    1212
    1313#endif  /* _CREATENODALCONSTRAINTSX_H */
  • issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp

    r13129 r13216  
    254254                case VerticesEnum : return "Vertices";
    255255                case ResultsEnum : return "Results";
     256                case AdolcParamEnum : return "AdolcParam";
    256257                case BoolInputEnum : return "BoolInput";
    257258                case BoolParamEnum : return "BoolParam";
     
    474475                case XYZPEnum : return "XYZP";
    475476                case OptionEnum : return "Option";
     477                case GenericOptionEnum : return "GenericOption";
    476478                case OptionCellEnum : return "OptionCell";
    477479                case OptionCharEnum : return "OptionChar";
  • issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp

    r13056 r13216  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void    GetSolutionFromInputsx( Vector** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters){
     11void    GetSolutionFromInputsx( Vector<IssmDouble>** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters){
    1212
    1313        /*intermediary: */
     
    1919
    2020        /*output: */
    21         Vector* solution=NULL;
     21        Vector<IssmDouble>* solution=NULL;
    2222
    2323        /*retrive parameters: */
     
    2929       
    3030        /*Initialize solution: */
    31         solution=new Vector(gsize);
     31        solution=new Vector<IssmDouble>(gsize);
    3232       
    3333        /*Go through elements and plug solution: */
  • issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h

    r12832 r13216  
    1010
    1111/* local prototypes: */
    12 void GetSolutionFromInputsx( Vector** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
     12void GetSolutionFromInputsx( Vector<IssmDouble>** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
    1313
    1414#endif  /* _GETSOLUTIONFROMINPUTSXX_H */
  • issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp

    r13073 r13216  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void GetVectorFromControlInputsx(Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){
     11void GetVectorFromControlInputsx(Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){
    1212
    1313        int  num_controls;
    1414        int *control_type = NULL;
    15         Vector*  vector=NULL;
     15        Vector<IssmDouble>*  vector=NULL;
    1616
    1717        /*Retrieve some parameters*/
     
    2020
    2121        /*Allocate and populate gradient*/
    22         vector=new Vector(num_controls*vertices->NumberOfVertices());
     22        vector=new Vector<IssmDouble>(num_controls*vertices->NumberOfVertices());
    2323
    2424        for(int i=0;i<num_controls;i++){
     
    4242       
    4343        /*intermediary: */
    44         Vector* vec_vector=NULL;
     44        Vector<IssmDouble>* vec_vector=NULL;
    4545
    4646        GetVectorFromControlInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters,data);
  • issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h

    r13073 r13216  
    99
    1010/* local prototypes: */
    11 void    GetVectorFromControlInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
     11void    GetVectorFromControlInputsx( Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
    1212void    GetVectorFromControlInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
    1313
  • issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp

    r13056 r13216  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void GetVectorFromInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){
     11void GetVectorFromInputsx( Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){
    1212
    1313        int i;
    14         Vector* vector=NULL;
     14        Vector<IssmDouble>* vector=NULL;
    1515
    1616        if(type==VertexEnum){
    1717
    1818                /*Allocate vector*/
    19                 vector=new Vector(vertices->NumberOfVertices());
     19                vector=new Vector<IssmDouble>(vertices->NumberOfVertices());
    2020
    2121                /*Look up in elements*/
     
    4747       
    4848        /*intermediary: */
    49         Vector* vec_vector=NULL;
     49        Vector<IssmDouble>* vec_vector=NULL;
    5050
    5151        GetVectorFromInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters, name, type);
  • issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h

    r12832 r13216  
    99
    1010/* local prototypes: */
    11 void    GetVectorFromInputsx( Vector** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,int type);
     11void    GetVectorFromInputsx( Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,int type);
    1212void    GetVectorFromInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,int type);
    1313
  • issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp

    r13073 r13216  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void Gradjx(Vector** pgradient,IssmDouble** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
     12void Gradjx(Vector<IssmDouble>** pgradient,IssmDouble** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
    1313
    1414        int     i,j,numberofvertices;
     
    1717        IssmDouble  *norm_list     = NULL;
    1818        int     *control_type  = NULL;
    19         Vector  *gradient      = NULL;
    20         Vector **gradient_list = NULL;
     19        Vector<IssmDouble>  *gradient      = NULL;
     20        Vector<IssmDouble> **gradient_list = NULL;
    2121       
    2222        /*retrieve some parameters: */
     
    2626
    2727        /*Allocate gradient_list */
    28         gradient_list = xNew<Vector*>(num_controls);
     28        gradient_list = xNew<Vector<IssmDouble>*>(num_controls);
    2929        norm_list = xNew<IssmDouble>(num_controls);
    3030        for(i=0;i<num_controls;i++){
    31                 gradient_list[i]=new Vector(num_controls*numberofvertices);
     31                gradient_list[i]=new Vector<IssmDouble>(num_controls*numberofvertices);
    3232        }
    33         gradient=new Vector(num_controls*numberofvertices);
     33        gradient=new Vector<IssmDouble>(num_controls*numberofvertices);
    3434
    3535        /*Compute all gradient_list*/
     
    6565        }
    6666        if(pgradient)  *pgradient=gradient;
    67         xDelete<Vector*>(gradient_list);
     67        xDelete<Vector<IssmDouble>*>(gradient_list);
    6868        xDelete<int>(control_type);
    6969}
  • issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.h

    r13073 r13216  
    1010
    1111/* local prototypes: */
    12 void Gradjx(Vector** pgrad_g,IssmDouble** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);
     12void Gradjx(Vector<IssmDouble>** pgrad_g,IssmDouble** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);
    1313
    1414#endif  /* _GRADJX_H */
  • issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp

    r13073 r13216  
    1717        IssmDouble*  vertices_ungrounding             = NULL;
    1818        IssmDouble*  old_floatingice                  = NULL;
    19         Vector*      vec_old_floatingice              = NULL;
     19        Vector<IssmDouble>*      vec_old_floatingice              = NULL;
    2020        Element* element                          = NULL;
    2121       
     
    5555
    5656/*FUNCTION CreateNodesOnFloatingIce {{{*/
    57 Vector* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){
     57Vector<IssmDouble>* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){
    5858
    5959        int     i,numnods;
    60         Vector*   vec_nodes_on_floatingice = NULL;
     60        Vector<IssmDouble>*   vec_nodes_on_floatingice = NULL;
    6161        Node *node                     = NULL;
    6262
    6363        /*First, initialize nodes_on_floatingice, which will track which nodes have changed status: */
    6464        numnods=nodes->NumberOfNodes(configuration_type);
    65         vec_nodes_on_floatingice=new Vector(numnods);
     65        vec_nodes_on_floatingice=new Vector<IssmDouble>(numnods);
    6666
    6767        /*Loop through nodes, and fill vec_nodes_on_floatingice: */
     
    8686        int      i,numberofvertices;
    8787        IssmDouble*  vertices_potentially_ungrounding      = NULL;
    88         Vector*      vec_vertices_potentially_ungrounding  = NULL;
     88        Vector<IssmDouble>*      vec_vertices_potentially_ungrounding  = NULL;
    8989        Element* element                               = NULL;
    9090
    9191        /*Initialize vector with number of vertices*/
    9292        numberofvertices=vertices->NumberOfVertices();
    93         vec_vertices_potentially_ungrounding=new Vector(numberofvertices); //grounded vertex that could start floating
     93        vec_vertices_potentially_ungrounding=new Vector<IssmDouble>(numberofvertices); //grounded vertex that could start floating
    9494
    9595        /*Fill vector vertices_potentially_floating: */
     
    116116        IssmDouble*  nodes_on_floatingice                  = NULL;
    117117        IssmDouble*  elements_neighboring_floatingce      = NULL;
    118         Vector*      vec_elements_neighboring_floatingice = NULL;
    119         Vector*      vec_nodes_on_floatingice              = NULL;
     118        Vector<IssmDouble>*      vec_elements_neighboring_floatingice = NULL;
     119        Vector<IssmDouble>*      vec_nodes_on_floatingice              = NULL;
    120120        Node*    node                                  = NULL;
    121121        Element* element                               = NULL;
     
    134134               
    135135                /*Vector of size number of elements*/
    136                 vec_elements_neighboring_floatingice=new Vector(elements->NumberOfElements(),true);
     136                vec_elements_neighboring_floatingice=new Vector<IssmDouble>(elements->NumberOfElements(),true);
    137137
    138138                /*Figure out if any of the nodes of the element will be floating -> elements neighbouting the floating ice*/
  • issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.h

    r13073 r13216  
    1414void       GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
    1515
    16 Vector*        CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type);
     16Vector<IssmDouble>*        CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type);
    1717IssmDouble*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters);
    1818IssmDouble*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding);
  • issm/trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp

    r12470 r13216  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* solution){
     11void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* solution){
    1212
    1313        IssmDouble* serial_solution=NULL;
  • issm/trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h

    r12832 r13216  
    1010
    1111/* local prototypes: */
    12 void            InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* solution);
     12void            InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* solution);
    1313void        InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* solution);
    1414
    1515//with timestep
    16 void            InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* solution,int timestep);
     16void            InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* solution,int timestep);
    1717void        InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* solution, int timestep);
    1818
  • issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp

    r12450 r13216  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector, int name, int type){
     11void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector, int name, int type){
    1212
    1313        double* serial_vector=NULL;
  • issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h

    r12832 r13216  
    1010
    1111/* local prototypes: */
    12 void    InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* vector, int name,int type);
     12void    InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* vector, int name,int type);
    1313void    InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* vector, int name,int type);
    1414void    InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int* vector, int name,int type);
  • issm/trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.cpp

    r12470 r13216  
    99#include "../../EnumDefinitions/EnumDefinitions.h"
    1010
    11 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector, int name, int type){
     11void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector, int name, int type){
    1212
    1313        IssmDouble* serial_vector=NULL;
  • issm/trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h

    r12832 r13216  
    1010
    1111/* local prototypes: */
    12 void    InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* vector, int name,int type);
     12void    InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* vector, int name,int type);
    1313void    InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,IssmDouble* vector, int name,int type);
    1414void    InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int* vector, int name,int type);
  • issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp

    r13056 r13216  
    1717
    1818/*InterpFromGridToMeshx{{{*/
    19 int InterpFromGridToMeshx( Vector** pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value, int interpenum){
     19int InterpFromGridToMeshx( Vector<IssmDouble>** pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value, int interpenum){
    2020
    2121        /*output: */
    22         Vector* data_mesh=NULL;
     22        Vector<IssmDouble>* data_mesh=NULL;
    2323       
    2424        /*Intermediary*/
     
    4747
    4848        /*Allocate output vector: */
    49         data_mesh=new Vector(nods);
     49        data_mesh=new Vector<IssmDouble>(nods);
    5050
    5151        /*Find out what kind of coordinates (x_in,y_in) have been given is input*/
     
    127127        double *y             = gate->y;
    128128        int     nods          = gate->nods;
    129         Vector *data_mesh     = gate->data_mesh;
     129        Vector<IssmDouble>*data_mesh     = gate->data_mesh;
    130130        double *data          = gate->data;
    131131        double  default_value = gate->default_value;
  • issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h

    r12832 r13216  
    2424        double* x_mesh;
    2525        double* y_mesh;
    26         Vector*     data_mesh;
     26        Vector<IssmDouble>*     data_mesh;
    2727} InterpFromGridToMeshxThreadStruct;
    2828
    29 int    InterpFromGridToMeshx( Vector** pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, int interpenum=BilinearInterpEnum);
     29int    InterpFromGridToMeshx( Vector<IssmDouble>** pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, int interpenum=BilinearInterpEnum);
    3030void*  InterpFromGridToMeshxt(void* vInterpFromGridToMeshxThreadStruct);
    3131bool   findindices(int* pn,int* pm,double* x,int x_rows, double* y,int y_rows, double xgrid,double ygrid);
  • issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.cpp

    r13056 r13216  
    1010#include "../modules.h"
    1111
    12 int InterpFromMesh2dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
     12int InterpFromMesh2dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
    1313                double* default_values,int num_default_values,Contour** contours,int numcontours){
    1414       
    1515        /*Output*/
    16         Vector* data_prime=NULL;
     16        Vector<IssmDouble>* data_prime=NULL;
    1717
    1818        /*Intermediary*/
     
    2727
    2828        /*contours: */
    29         Vector*    vec_incontour=NULL;
     29        Vector<IssmDouble>*    vec_incontour=NULL;
    3030        double*    incontour=NULL;
    3131
     
    7171
    7272        /*Initialize output*/
    73         data_prime=new Vector(nods_prime,false,SeqVecType);
     73        data_prime=new Vector<IssmDouble>(nods_prime,false,SeqVecType);
    7474        if(num_default_values){
    7575                if(num_default_values==1)for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_values[0],INS_VAL);
  • issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dx.h

    r12832 r13216  
    2323        double ymin,ymax;
    2424        int    nods_prime;
    25         Vector*    data_prime;
     25        Vector<IssmDouble>*    data_prime;
    2626        double* x_prime;
    2727        double* y_prime;
     
    3333} InterpFromMesh2dxThreadStruct;
    3434
    35 int InterpFromMesh2dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
     35int InterpFromMesh2dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,
    3636                double* default_values,int num_default_values,Contour** contours,int numcontours);
    3737
  • issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp

    r12864 r13216  
    3232        double  ymax               = gate->ymax;
    3333        int     nods_prime         = gate->nods_prime;
    34         Vector *data_prime         = gate->data_prime;
     34        Vector<IssmDouble>* data_prime         = gate->data_prime;
    3535        double *x_prime            = gate->x_prime;
    3636        double *y_prime            = gate->y_prime;
  • issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp

    r13056 r13216  
    77#include "../../include/include.h"
    88
    9 int InterpFromMeshToMesh3dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value) {
     9int InterpFromMeshToMesh3dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value) {
    1010
    1111        /*Output*/
    12         Vector* data_prime=NULL;
     12        Vector<IssmDouble>* data_prime=NULL;
    1313
    1414        /*Intermediary*/
     
    5454
    5555        /*Initialize output*/
    56         data_prime=new Vector(nods_prime);
     56        data_prime=new Vector<IssmDouble>(nods_prime);
    5757        for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_value,INS_VAL);
    5858
  • issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h

    r12832 r13216  
    99#include "../../classes/objects/objects.h"
    1010
    11 int InterpFromMeshToMesh3dx( Vector** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value);
     11int InterpFromMeshToMesh3dx( Vector<IssmDouble>** pdata_prime,double* index_data, double* x_data, double* y_data, double* z_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, double* z_prime, int nods_prime,double default_value);
    1212
    1313#endif /* _INTERPFROMMESHTOMESH3DX_H */
  • issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp

    r13056 r13216  
    4848
    4949        /*Get output*/
    50         options->Get(&output,"output","prediction");
     50        options->Get(&output,"output",(char*)"prediction");
    5151
    5252        if(strcmp(output,"quadtree")==0){
  • issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp

    r13056 r13216  
    4141
    4242        /*Get output*/
    43         options->Get(&output,"output","prediction");
     43        options->Get(&output,"output",(char*)"prediction");
    4444
    4545        if(strcmp(output,"quadtree")==0){
  • issm/trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp

    r12515 r13216  
    77#include "./Mergesolutionfromftogx.h"
    88
    9 void    Mergesolutionfromftogx( Vector** pug, Vector* uf, Vector* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0){
     9void    Mergesolutionfromftogx( Vector<IssmDouble>** pug, Vector<IssmDouble>* uf, Vector<IssmDouble>* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0){
    1010
    1111        /*output: */
    12         Vector* ug=NULL;
     12        Vector<IssmDouble>* ug=NULL;
    1313
    1414        /*intermediary: */
     
    3434
    3535        /*initialize ug: */
    36         ug=new Vector(gsize);
     36        ug=new Vector<IssmDouble>(gsize);
    3737
    3838        /*Merge f set back into g set: */
  • issm/trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h

    r12832 r13216  
    99
    1010/* local prototypes: */
    11 void    Mergesolutionfromftogx( Vector** pug, Vector* uf, Vector* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false);
     11void    Mergesolutionfromftogx( Vector<IssmDouble>** pug, Vector<IssmDouble>* uf, Vector<IssmDouble>* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false);
    1212
    1313#endif  /* _MERGESOLUTIONFROMFTOGX_H */
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h

    r12470 r13216  
    1111class IoModel;
    1212class Parameters;
     13class DofIndexing;
     14
    1315#include "../../io/io.h"
    1416
  • issm/trunk-jpl/src/c/modules/Orthx/Orthx.cpp

    r13073 r13216  
    55#include "./Orthx.h"
    66
    7 void    Orthx( Vector** pnewgradj, Vector* gradj, Vector* oldgradj){
     7void    Orthx( Vector<IssmDouble>** pnewgradj, Vector<IssmDouble>* gradj, Vector<IssmDouble>* oldgradj){
    88       
    99        /*output: */
    10         Vector* newgradj=NULL;
     10        Vector<IssmDouble>* newgradj=NULL;
    1111
    1212        /*intermediary:*/
  • issm/trunk-jpl/src/c/modules/Orthx/Orthx.h

    r12832 r13216  
    1111
    1212/* local prototypes: */
    13 void    Orthx( Vector** pnewgradj, Vector* gradj, Vector* oldgradj);
     13void    Orthx( Vector<IssmDouble>** pnewgradj, Vector<IssmDouble>* gradj, Vector<IssmDouble>* oldgradj);
    1414
    1515#endif  /* _ORTHX_H */
  • issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp

    r11695 r13216  
    44#include "./PointCloudFindNeighborsx.h"
    55
    6 int PointCloudFindNeighborsx( Vector** pflags,double* x, double* y, int nods, double mindistance,double multithread){
     6int PointCloudFindNeighborsx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread){
    77
    88        /*output: */
    9         Vector* flags=NULL;
    10         flags=new Vector(nods);
     9        Vector<IssmDouble>* flags=NULL;
     10        flags=new Vector<IssmDouble>(nods);
    1111
    1212        /*threading: */
  • issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h

    r12832 r13216  
    1111
    1212/* local prototypes: */
    13 int PointCloudFindNeighborsx( Vector** pflags,double* x, double* y, int nods, double mindistance,double multithread);
     13int PointCloudFindNeighborsx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread);
    1414
    1515/*threading: */
     
    2020        int nods;
    2121        double mindistance;
    22         Vector* flags;
     22        Vector<IssmDouble>* flags;
    2323
    2424
  • issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp

    r12507 r13216  
    1717        int     nods;
    1818        double  mindistance;
    19         Vector*     flags;
     19        Vector<IssmDouble>*     flags;
    2020
    2121        /*recover handle and gate: */
  • issm/trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.cpp

    r12515 r13216  
    1212#include "../../io/io.h"
    1313
    14 void    Reduceloadx( Vector* pf, Matrix* Kfs, Vector* y_s,bool flag_ys0){
     14void    Reduceloadx( Vector<IssmDouble>* pf, Matrix<IssmDouble>* Kfs, Vector<IssmDouble>* y_s,bool flag_ys0){
    1515
    1616        /*intermediary*/
    17         Vector*     y_s0   = NULL;
    18         Vector*     Kfsy_s = NULL;
     17        Vector<IssmDouble>*     y_s0   = NULL;
     18        Vector<IssmDouble>*     Kfsy_s = NULL;
    1919        int         Kfsm,Kfsn;
    2020        int         global_m,global_n;
     
    3232                /*pf = pf - Kfs * y_s;*/
    3333                Kfs->GetLocalSize(&Kfsm,&Kfsn);
    34                 Kfsy_s=new Vector(Kfsm,fromlocalsize);
     34                Kfsy_s=new Vector<IssmDouble>(Kfsm,fromlocalsize);
    3535                if (flag_ys0){
    3636
  • issm/trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.h

    r12832 r13216  
    99
    1010/* local prototypes: */
    11 void    Reduceloadx( Vector* pf, Matrix* Kfs, Vector* ys,bool flag_ys0=false);
     11void    Reduceloadx( Vector<IssmDouble>* pf, Matrix<IssmDouble>* Kfs, Vector<IssmDouble>* ys,bool flag_ys0=false);
    1212
    1313#endif  /* _REDUCELOADX_H */
  • issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp

    r12470 r13216  
    66#include "./Reducevectorgtofx.h"
    77 
    8 void Reducevectorgtofx(Vector** puf, Vector* ug, Nodes* nodes,Parameters* parameters){
     8void Reducevectorgtofx(Vector<IssmDouble>** puf, Vector<IssmDouble>* ug, Nodes* nodes,Parameters* parameters){
    99
    1010        /*output: */
    11         Vector* uf=NULL;
     11        Vector<IssmDouble>* uf=NULL;
    1212
    1313        /*variables: */
     
    2626        else{
    2727                /*allocate: */
    28                 uf=new Vector(fsize);
     28                uf=new Vector<IssmDouble>(fsize);
    2929
    3030                if(nodes->NumberOfNodes(configuration_type)){
  • issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h

    r12832 r13216  
    1010
    1111/* local prototypes: */
    12 void Reducevectorgtofx(Vector** puf, Vector* ug, Nodes* nodes,Parameters* parameters);
     12void Reducevectorgtofx(Vector<IssmDouble>** puf, Vector<IssmDouble>* ug, Nodes* nodes,Parameters* parameters);
    1313
    1414#endif  /* _REDUCEVECTORGTOFX_H */
  • issm/trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp

    r12450 r13216  
    66#include "./Reducevectorgtosx.h"
    77
    8 void Reducevectorgtosx(Vector** pys, Vector* yg, Nodes* nodes,Parameters* parameters){
     8void Reducevectorgtosx(Vector<IssmDouble>** pys, Vector<IssmDouble>* yg, Nodes* nodes,Parameters* parameters){
    99
    1010        /*output: */
    11         Vector* ys=NULL;
     11        Vector<IssmDouble>* ys=NULL;
    1212
    1313        /*variables: */
     
    2626        else{
    2727                /*allocate: */
    28                 ys=new Vector(ssize);
     28                ys=new Vector<IssmDouble>(ssize);
    2929
    3030                if(nodes->NumberOfNodes(configuration_type)){
  • issm/trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h

    r12832 r13216  
    1010
    1111/* local prototypes: */
    12 void Reducevectorgtosx(Vector** pys, Vector* yg, Nodes* nodes,Parameters* parameters);
     12void Reducevectorgtosx(Vector<IssmDouble>** pys, Vector<IssmDouble>* yg, Nodes* nodes,Parameters* parameters);
    1313
    1414#endif  /* _REDUCEVECTORGTOSX_H */
  • issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp

    r13073 r13216  
    2828}
    2929
    30 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector* vector){
     30void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector){
    3131       
    3232        IssmDouble* serial_vector=NULL;
  • issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h

    r13073 r13216  
    99
    1010/* local prototypes: */
    11 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector* vector);
     11void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vector<IssmDouble>* vector);
    1212void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,IssmDouble* vector);
    1313
  • issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp

    r13195 r13216  
    1414#endif
    1515
    16 void    Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters){
     16void    Solverx(Vector<IssmDouble>** puf, Matrix<IssmDouble>* Kff, Vector<IssmDouble>* pf, Vector<IssmDouble>* uf0,Vector<IssmDouble>* df, Parameters* parameters){
    1717
    1818        /*Intermediary: */
     
    2020
    2121        /*output: */
    22         Vector *uf=NULL;
     22        Vector<IssmDouble> *uf=NULL;
    2323
    2424        /*In debugging mode, check that stiffness matrix and load vectors are not NULL (they can be empty)*/
     
    2727
    2828        /*Initialize vector: */
    29         uf=new Vector();
     29        uf=new Vector<IssmDouble>();
    3030
    3131        /*According to matrix type, use specific solvers: */
  • issm/trunk-jpl/src/c/modules/Solverx/Solverx.h

    r13196 r13216  
    1515
    1616/* local prototypes: */
    17 void    Solverx(Vector** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters);
     17void    Solverx(Vector<IssmDouble>** puf, Matrix<IssmDouble>* Kff, Vector<IssmDouble>* pf, Vector<IssmDouble>* uf0,Vector<IssmDouble>* df, Parameters* parameters);
    1818
    1919#ifdef _HAVE_PETSC_
     
    2323#endif
    2424
    25 void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf,Parameters* parameters);
     25void SolverxSeq(SeqVec<IssmDouble>** puf,SeqMat<IssmDouble>* Kff, SeqVec<IssmDouble>* pf,Parameters* parameters);
    2626void SolverxSeq(IssmPDouble *X, IssmPDouble *A, IssmPDouble *B,int n);
    2727
  • issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp

    r13196 r13216  
    2323#endif
    2424
    25 void SolverxSeq(SeqVec** puf,SeqMat* Kff, SeqVec* pf, Parameters* parameters){/*{{{*/
     25void SolverxSeq(SeqVec<IssmDouble>** puf,SeqMat<IssmDouble>* Kff, SeqVec<IssmDouble>* pf, Parameters* parameters){/*{{{*/
    2626
    2727        #ifdef _HAVE_GSL_
    2828        /*Intermediary: */
    2929        int M,N,N2,s;
    30         SeqVec *uf = NULL;
     30        SeqVec<IssmDouble> *uf = NULL;
    3131
    3232        Kff->GetSize(&M,&N);
     
    4141        SolverxSeq(x,Kff->matrix,pf->vector,N);
    4242#endif
    43         uf=new SeqVec(x,N);     
     43        uf=new SeqVec<IssmDouble>(x,N);
    4444        xDelete(x);
    4545
  • issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp

    r13129 r13216  
    258258              else if (strcmp(name,"Vertices")==0) return VerticesEnum;
    259259              else if (strcmp(name,"Results")==0) return ResultsEnum;
     260              else if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum;
    260261              else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
    261262              else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
    262               else if (strcmp(name,"Contour")==0) return ContourEnum;
    263263         else stage=3;
    264264   }
    265265   if(stage==3){
    266               if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
     266              if (strcmp(name,"Contour")==0) return ContourEnum;
     267              else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
    267268              else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
    268269              else if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum;
     
    383384              else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
    384385              else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
    385               else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
    386386         else stage=4;
    387387   }
    388388   if(stage==4){
    389               if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
     389              if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
     390              else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
    390391              else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
    391392              else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
     
    484485              else if (strcmp(name,"XYZP")==0) return XYZPEnum;
    485486              else if (strcmp(name,"Option")==0) return OptionEnum;
     487              else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum;
    486488              else if (strcmp(name,"OptionCell")==0) return OptionCellEnum;
    487489              else if (strcmp(name,"OptionChar")==0) return OptionCharEnum;
  • issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp

    r12515 r13216  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void SystemMatricesx(Matrix** pKff, Matrix** pKfs, Vector** ppf, Vector** 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){
     12void 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){
    1313       
    1414        /*intermediary: */
     
    2121       
    2222        /*output: */
    23         Matrix*    Kff  = NULL;
    24         Matrix*    Kfs  = NULL;
    25         Vector*    pf   = NULL;
    26         Vector*    df=NULL;
     23        Matrix<IssmDouble>*    Kff  = NULL;
     24        Matrix<IssmDouble>*    Kfs  = NULL;
     25        Vector<IssmDouble>*    pf   = NULL;
     26        Vector<IssmDouble>*    df=NULL;
    2727        IssmDouble kmax = 0;
    2828
     
    4949        if(kflag){
    5050
    51                 Kff=new Matrix(fsize,fsize,connectivity,numberofdofspernode);
    52                 Kfs=new Matrix(fsize,ssize,connectivity,numberofdofspernode);
    53                 df=new Vector(fsize);
     51                Kff=new Matrix<IssmDouble>(fsize,fsize,connectivity,numberofdofspernode);
     52                Kfs=new Matrix<IssmDouble>(fsize,ssize,connectivity,numberofdofspernode);
     53                df=new Vector<IssmDouble>(fsize);
    5454
    5555                /*Fill stiffness matrix from elements: */
     
    7373        if(pflag){
    7474
    75                 pf=new Vector(fsize);
     75                pf=new Vector<IssmDouble>(fsize);
    7676
    7777                /*Fill right hand side vector, from elements: */
  • issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.h

    r12832 r13216  
    1010
    1111/* local prototypes: */
    12 void SystemMatricesx(Matrix** pKff, Matrix** pKfs, Vector** ppf, Vector** pdf, IssmDouble* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,
     12void 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,
    1313                        bool kflag=true,bool pflag=true,bool penalty_kflag=true,bool penalty_pflag=true);
    1414
  • issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp

    r12860 r13216  
    2020/*}}}*/
    2121
    22 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
     22void TriMeshx(Matrix<IssmDouble>** pindex,Vector<IssmDouble>** px,Vector<IssmDouble>** py,Matrix<IssmDouble>** psegments,Vector<IssmDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
    2323
    2424        /*indexing: */
     
    2727        /*output: */
    2828        double* index=NULL;
    29         Matrix* index_matrix=NULL;
     29        Matrix<IssmDouble>* index_matrix=NULL;
    3030        double* x=NULL;
    3131        double* y=NULL;
    3232        double* segments=NULL;
    33         Matrix* segments_matrix=NULL;
     33        Matrix<IssmDouble>* segments_matrix=NULL;
    3434        double* segmentmarkerlist=NULL;
    3535
     
    192192
    193193        /*Output : */
    194         index_matrix=new Matrix(index,out.numberoftriangles,3,1,SeqMatType);
     194        index_matrix=new Matrix<IssmDouble>(index,out.numberoftriangles,3,1,SeqMatType);
    195195        *pindex=index_matrix;
    196196       
    197         segments_matrix=new Matrix(segments,out.numberofsegments,3,1,SeqMatType);
     197        segments_matrix=new Matrix<IssmDouble>(segments,out.numberofsegments,3,1,SeqMatType);
    198198        *psegments=segments_matrix;
    199199
    200         *px=new Vector(x,out.numberofpoints,SeqMatType);
    201         *py=new Vector(y,out.numberofpoints,SeqMatType);
    202         *psegmentmarkerlist=new Vector(segmentmarkerlist,out.numberofsegments,SeqMatType);
     200        *px=new Vector<IssmDouble>(x,out.numberofpoints,SeqMatType);
     201        *py=new Vector<IssmDouble>(y,out.numberofpoints,SeqMatType);
     202        *psegmentmarkerlist=new Vector<IssmDouble>(segmentmarkerlist,out.numberofsegments,SeqMatType);
    203203}
  • issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h

    r12832 r13216  
    1111
    1212/* local prototypes: */
    13 void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
     13void TriMeshx(Matrix<IssmDouble>** pindex,Vector<IssmDouble>** px,Vector<IssmDouble>** py,Matrix<IssmDouble>** psegments,Vector<IssmDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
    1414
    1515#endif  /* _TRIMESHX_H */
  • issm/trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp

    r12470 r13216  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector* yg){
     12void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector<IssmDouble>* yg){
    1313       
    1414        int configuration_type;
  • issm/trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h

    r12832 r13216  
    99#include "../../classes/objects/objects.h"
    1010
    11 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector* yg);
     11void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector<IssmDouble>* yg);
    1212
    1313#endif  /* _UPDATESPCSX_H */
  • issm/trunk-jpl/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp

    r12470 r13216  
    1313
    1414        int     i;
    15         Vector*     vz        = NULL;
     15        Vector<IssmDouble>*     vz        = NULL;
    1616        Vertex *vertex    = NULL;
    1717        IssmDouble *thickness = NULL;
     
    2323
    2424        /*Allocate vector*/
    25         vz=new Vector(vertices->NumberOfVertices());
     25        vz=new Vector<IssmDouble>(vertices->NumberOfVertices());
    2626
    2727        /*Update verices new geometry: */
  • issm/trunk-jpl/src/c/modules/VecMergex/VecMergex.cpp

    r12470 r13216  
    99#include "../../toolkits/toolkits.h"
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    11 
    12 void VecMergex(Vector* ug, Vector* uf, Nodes* nodes, Parameters* parameters, int SetEnum){
     11void VecMergex(Vector<IssmDouble>* ug, Vector<IssmDouble>* uf, Nodes* nodes, Parameters* parameters, int SetEnum){
    1312
    1413        /*variables: */
  • issm/trunk-jpl/src/c/modules/VecMergex/VecMergex.h

    r12832 r13216  
    1010
    1111/* local prototypes: */
    12 void VecMergex(Vector* ug, Vector* uf, Nodes* nodes, Parameters* parameters, int SetEnum);
     12void VecMergex(Vector<IssmDouble>* ug, Vector<IssmDouble>* uf, Nodes* nodes, Parameters* parameters, int SetEnum);
    1313
    1414#endif  /* _VECMERGEX_H */
  • issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp

    r13056 r13216  
    6262}
    6363
    64 void xdelete(Matrix** pv){
     64void xdelete(Matrix<IssmDouble>** pv){
    6565       
    6666        if (pv && *pv){
     
    7373}
    7474
    75 void xdelete(Vector** pv){
     75void xdelete(Vector<IssmDouble>** pv){
    7676
    7777        if (pv && *pv){
  • issm/trunk-jpl/src/c/shared/Alloc/alloc.h

    r11679 r13216  
    55#ifndef _ALLOC_H_
    66#define _ALLOC_H_
    7 class Matrix;
    8 class Vector;
     7
     8#include "../../include/include.h"
     9
     10template <class doubletype> class Matrix;
     11template <class doubletype> class Vector;
    912void* xmalloc(int size);
    1013void* xcalloc(int n,int size);
    1114void  xfree(void** pvptr);
    1215void* xrealloc ( void* pv, int size);
    13 void xdelete(Matrix** pvptr);
    14 void xdelete(Vector** pvptr);
     16void xdelete(Matrix<IssmDouble>** pvptr);
     17void xdelete(Vector<IssmDouble>** pvptr);
     18
     19#include "./xNewDelete.h"
    1520
    1621#endif
  • issm/trunk-jpl/src/c/shared/Exp/IsInPoly.cpp

    r12365 r13216  
    1515
    1616/*IsInPoly {{{*/
    17 int IsInPoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
     17int IsInPoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
    1818
    1919        int i;
     
    5656}/*}}}*/
    5757/*IsOutsidePoly {{{*/
    58 int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
     58int IsOutsidePoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){
    5959
    6060        int i,j;
  • issm/trunk-jpl/src/c/shared/Exp/exp.h

    r12832 r13216  
    1010#include "../../toolkits/toolkits.h"
    1111
    12 int IsInPoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
    13 int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
     12int IsInPoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
     13int IsOutsidePoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
    1414int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
    1515int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname);
  • issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp

    r13056 r13216  
    44#include "./GaussPoints.h"
    55#include "../Alloc/alloc.h"
    6 #include "../../io/io.h"
    76#include "../Exceptions/exceptions.h"
    87#include <math.h>
  • issm/trunk-jpl/src/c/solutions/ResetBoundaryConditions.cpp

    r12832 r13216  
    1111       
    1212        /*variables: */
    13         Vector*    yg    = NULL;
     13        Vector<IssmDouble>*    yg    = NULL;
    1414        Nodes *nodes = NULL;
    1515        int    i;
  • issm/trunk-jpl/src/c/solutions/convergence.cpp

    r13056 r13216  
    88#include "../EnumDefinitions/EnumDefinitions.h"
    99
    10 void convergence(bool* pconverged, Matrix* Kff,Vector* pf,Vector* uf,Vector* old_uf,Parameters* parameters){
     10void convergence(bool* pconverged, Matrix<IssmDouble>* Kff,Vector<IssmDouble>* pf,Vector<IssmDouble>* uf,Vector<IssmDouble>* old_uf,Parameters* parameters){
    1111
    1212        /*output*/
     
    1414
    1515        /*intermediary*/
    16         Vector* KU=NULL;
    17         Vector* KUF=NULL;
    18         Vector* KUold=NULL;
    19         Vector* KUoldF=NULL;
    20         Vector* duf=NULL;
     16        Vector<IssmDouble>* KU=NULL;
     17        Vector<IssmDouble>* KUF=NULL;
     18        Vector<IssmDouble>* KUold=NULL;
     19        Vector<IssmDouble>* KUoldF=NULL;
     20        Vector<IssmDouble>* duf=NULL;
    2121        IssmDouble ndu,nduinf,nu;
    2222        IssmDouble nKUF;
  • issm/trunk-jpl/src/c/solutions/gradient_core.cpp

    r13056 r13216  
    1818        IssmDouble  norm_inf;
    1919        IssmDouble *norm_list    = NULL;
    20         Vector*     new_gradient = NULL;
    21         Vector*     gradient     = NULL;
    22         Vector*     old_gradient = NULL;
     20        Vector<IssmDouble>*     new_gradient = NULL;
     21        Vector<IssmDouble>*     gradient     = NULL;
     22        Vector<IssmDouble>*     old_gradient = NULL;
    2323
    2424        /*Compute gradient*/
  • issm/trunk-jpl/src/c/solutions/solutions.h

    r12832 r13216  
    3333
    3434//convergence:
    35 void convergence(bool* pconverged, Matrix* K_ff,Vector* p_f,Vector* u_f,Vector* u_f_old,Parameters* parameters);
     35void convergence(bool* pconverged, Matrix<IssmDouble>* K_ff,Vector<IssmDouble>* p_f,Vector<IssmDouble>* u_f,Vector<IssmDouble>* u_f_old,Parameters* parameters);
    3636bool controlconvergence(IssmDouble J,IssmDouble tol_cm);
    3737bool steadystateconvergence(FemModel* femmodel);
  • issm/trunk-jpl/src/c/solvers/solver_adjoint_linear.cpp

    r12832 r13216  
    1313
    1414        /*intermediary: */
    15         Matrix*  Kff = NULL;
    16         Matrix*  Kfs = NULL;
    17         Vector*  ug  = NULL;
    18         Vector*  uf  = NULL;
    19         Vector*  pf  = NULL;
    20         Vector*  df  = NULL;
    21         Vector*  ys  = NULL;
     15        Matrix<IssmDouble>*  Kff = NULL;
     16        Matrix<IssmDouble>*  Kfs = NULL;
     17        Vector<IssmDouble>*  ug  = NULL;
     18        Vector<IssmDouble>*  uf  = NULL;
     19        Vector<IssmDouble>*  pf  = NULL;
     20        Vector<IssmDouble>*  df  = NULL;
     21        Vector<IssmDouble>*  ys  = NULL;
    2222        int  configuration_type;
    2323
  • issm/trunk-jpl/src/c/solvers/solver_linear.cpp

    r12832 r13216  
    1111
    1212        /*intermediary: */
    13         Matrix*  Kff = NULL;
    14         Matrix*  Kfs = NULL;
    15         Vector*  ug  = NULL;
    16         Vector*  uf  = NULL;
    17         Vector*  pf  = NULL;
    18         Vector*  df  = NULL;
    19         Vector*  ys  = NULL;
     13        Matrix<IssmDouble>*  Kff = NULL;
     14        Matrix<IssmDouble>*  Kfs = NULL;
     15        Vector<IssmDouble>*  ug  = NULL;
     16        Vector<IssmDouble>*  uf  = NULL;
     17        Vector<IssmDouble>*  pf  = NULL;
     18        Vector<IssmDouble>*  df  = NULL;
     19        Vector<IssmDouble>*  ys  = NULL;
    2020        int  configuration_type;
    2121
  • issm/trunk-jpl/src/c/solvers/solver_newton.cpp

    r12832 r13216  
    1818        int    count;
    1919        IssmDouble kmax;
    20         Matrix* Kff = NULL;
    21         Matrix* Kfs    = NULL;
    22         Matrix* Jff = NULL;
    23         Vector* ug  = NULL;
    24         Vector* old_ug = NULL;
    25         Vector* uf  = NULL;
    26         Vector* old_uf = NULL;
    27         Vector* duf = NULL;
    28         Vector* pf  = NULL;
    29         Vector* pJf    = NULL;
    30         Vector* df  = NULL;
    31         Vector* ys  = NULL;
     20        Matrix<IssmDouble>* Kff = NULL;
     21        Matrix<IssmDouble>* Kfs    = NULL;
     22        Matrix<IssmDouble>* Jff = NULL;
     23        Vector<IssmDouble>* ug  = NULL;
     24        Vector<IssmDouble>* old_ug = NULL;
     25        Vector<IssmDouble>* uf  = NULL;
     26        Vector<IssmDouble>* old_uf = NULL;
     27        Vector<IssmDouble>* duf = NULL;
     28        Vector<IssmDouble>* pf  = NULL;
     29        Vector<IssmDouble>* pJf    = NULL;
     30        Vector<IssmDouble>* df  = NULL;
     31        Vector<IssmDouble>* ys  = NULL;
    3232
    3333        /*parameters:*/
  • issm/trunk-jpl/src/c/solvers/solver_nonlinear.cpp

    r12832 r13216  
    1414
    1515        /*intermediary: */
    16         Matrix* Kff = NULL;
    17         Matrix* Kfs = NULL;
    18         Vector* ug  = NULL;
    19         Vector* old_ug = NULL;
    20         Vector* uf  = NULL;
    21         Vector* old_uf = NULL;
    22         Vector* pf  = NULL;
    23         Vector* df  = NULL;
    24         Vector* ys  = NULL;
     16        Matrix<IssmDouble>* Kff = NULL;
     17        Matrix<IssmDouble>* Kfs = NULL;
     18        Vector<IssmDouble>* ug  = NULL;
     19        Vector<IssmDouble>* old_ug = NULL;
     20        Vector<IssmDouble>* uf  = NULL;
     21        Vector<IssmDouble>* old_uf = NULL;
     22        Vector<IssmDouble>* pf  = NULL;
     23        Vector<IssmDouble>* df  = NULL;
     24        Vector<IssmDouble>* ys  = NULL;
    2525       
    2626        Loads* loads=NULL;
  • issm/trunk-jpl/src/c/solvers/solver_stokescoupling_nonlinear.cpp

    r12832 r13216  
    1414
    1515        /*intermediary: */
    16         Matrix*  Kff_horiz = NULL;
    17         Matrix* Kfs_horiz   = NULL;
    18         Vector*  ug_horiz  = NULL;
    19         Vector*  uf_horiz  = NULL;
    20         Vector*  old_uf_horiz = NULL;
    21         Vector*  pf_horiz  = NULL;
    22         Vector*  df_horiz  = NULL;
    23         Matrix*  Kff_vert  = NULL;
    24         Matrix*  Kfs_vert  = NULL;
    25         Vector*  ug_vert   = NULL;
    26         Vector*  uf_vert   = NULL;
    27         Vector*  pf_vert   = NULL;
    28         Vector*  df_vert   = NULL;
    29         Vector*  ys   = NULL;
     16        Matrix<IssmDouble>*  Kff_horiz = NULL;
     17        Matrix<IssmDouble>* Kfs_horiz   = NULL;
     18        Vector<IssmDouble>*  ug_horiz  = NULL;
     19        Vector<IssmDouble>*  uf_horiz  = NULL;
     20        Vector<IssmDouble>*  old_uf_horiz = NULL;
     21        Vector<IssmDouble>*  pf_horiz  = NULL;
     22        Vector<IssmDouble>*  df_horiz  = NULL;
     23        Matrix<IssmDouble>*  Kff_vert  = NULL;
     24        Matrix<IssmDouble>*  Kfs_vert  = NULL;
     25        Vector<IssmDouble>*  ug_vert   = NULL;
     26        Vector<IssmDouble>*  uf_vert   = NULL;
     27        Vector<IssmDouble>*  pf_vert   = NULL;
     28        Vector<IssmDouble>*  df_vert   = NULL;
     29        Vector<IssmDouble>*  ys   = NULL;
    3030        bool converged;
    3131        int  constraints_converged;
  • issm/trunk-jpl/src/c/solvers/solver_thermal_nonlinear.cpp

    r12832 r13216  
    1212
    1313        /*solution : */
    14         Vector* tg=NULL;
    15         Vector* tf=NULL;
    16         Vector* tf_old=NULL;
    17         Vector* ys=NULL;
     14        Vector<IssmDouble>* tg=NULL;
     15        Vector<IssmDouble>* tf=NULL;
     16        Vector<IssmDouble>* tf_old=NULL;
     17        Vector<IssmDouble>* ys=NULL;
    1818        IssmDouble melting_offset;
    1919
    2020        /*intermediary: */
    21         Matrix* Kff=NULL;
    22         Matrix* Kfs=NULL;
    23         Vector* pf=NULL;
    24         Vector* df=NULL;
     21        Matrix<IssmDouble>* Kff=NULL;
     22        Matrix<IssmDouble>* Kfs=NULL;
     23        Vector<IssmDouble>* pf=NULL;
     24        Vector<IssmDouble>* df=NULL;
    2525
    2626        bool converged;
  • issm/trunk-jpl/src/c/toolkits/issm/SeqMat.h

    r12477 r13216  
    11/*!\file:  SeqMat.h
    2  * \brief wrapper to SeqMat objects, which are just wrappers to a simple IssmDouble* buffer.
     2 * \brief wrapper to SeqMat objects, which are just wrappers to a simple IssmDouble or IssmPDouble* buffer.
    33 */
    44
     
    1414#endif
    1515
    16 #include "../toolkitsenums.h"
     16#include "../../shared/Exceptions/exceptions.h"
     17#include "../../shared/MemOps/xMemCpy.h"
     18#include "../../shared/Alloc/alloc.h"
     19#include "../../include/macros.h"
     20#include "./SeqVec.h"
    1721
    1822/*}}}*/
    19 class SeqVec;
    20 
     23
     24/*We need to template this class, in case we want to create Matrices that hold IssmDouble* matrix or IssmPDouble* matrix.
     25  Such matrices would be useful for use without or with the matlab or python interface (which do not care for IssmDouble types,
     26  but only rely on IssmPDouble types)*/
     27
     28template <class doubletype>
    2129class SeqMat{
    2230
     
    2432       
    2533                int M,N;
    26                 IssmDouble* matrix;
    27 
    28                 /*SeqMat constructors, destructors {{{*/
    29                 SeqMat();
    30                 SeqMat(int M,int N);
    31                 SeqMat(int M,int N,IssmDouble sparsity);
    32                 SeqMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity);
    33                 SeqMat(int M,int N,int connectivity,int numberofdofspernode);
    34                 ~SeqMat();
    35                 /*}}}*/
    36                 /*SeqMat specific routines {{{*/
    37                 void Echo(void);
    38                 void Assemble(void);
    39                 IssmDouble Norm(NormMode norm_type);
    40                 void GetSize(int* pM,int* pN);
    41                 void GetLocalSize(int* pM,int* pN);
    42                 void MatMult(SeqVec* X,SeqVec* AX);
    43                 SeqMat* Duplicate(void);
    44                 IssmDouble* ToSerial(void);
    45                 void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode);
    46                 void Convert(MatrixType type);
    47                 /*}}}*/
     34                doubletype* matrix;  /*here, doubletype is either IssmDouble or IssmPDouble*/
     35
     36                /*SeqMat constructors, destructors*/
     37                /*FUNCTION SeqMat(){{{*/
     38                SeqMat(){
     39
     40                        this->M=0;
     41                        this->N=0;
     42                        this->matrix=NULL;
     43                }
     44                /*}}}*/
     45                /*FUNCTION SeqMat(int M,int N){{{*/
     46                SeqMat(int pM,int pN){
     47
     48                        this->M=pM;
     49                        this->N=pN;
     50                        this->matrix=NULL;
     51                        if(M*N) this->matrix=xNewZeroInit<doubletype>(pM*pN);
     52                }
     53                /*}}}*/
     54                /*FUNCTION SeqMat(int M,int N, doubletype sparsity){{{*/
     55                SeqMat(int pM,int pN, doubletype sparsity){
     56
     57                        this->M=pM;
     58                        this->N=pN;
     59                        this->matrix=NULL;
     60                        if(M*N) this->matrix=xNewZeroInit<doubletype>(pM*pN);
     61                }
     62                /*}}}*/
     63                /*FUNCTION SeqMat(doubletype* serial_mat,int M,int N,doubletype sparsity){{{*/
     64                SeqMat(doubletype* serial_mat,int pM,int pN,doubletype sparsity){
     65
     66                        int i,j;
     67
     68                        this->M=pM;
     69                        this->N=pN;
     70                        this->matrix=NULL;
     71                        if(M*N){
     72                                this->matrix=xNewZeroInit<doubletype>(pM*pN);
     73                                xMemCpy<doubletype>(this->matrix,serial_mat,pM*pN);
     74                        }
     75
     76                }
     77                /*}}}*/
     78                /*FUNCTION SeqMat(int M,int N, int connectivity, int numberofdofspernode){{{*/
     79                SeqMat(int pM,int pN, int connectivity,int numberofdofspernode){
     80
     81                        this->M=pM;
     82                        this->N=pN;
     83                        this->matrix=NULL;
     84                        if(M*N) this->matrix=xNewZeroInit<doubletype>(pM*pN);
     85                }
     86                /*}}}*/
     87                /*FUNCTION ~SeqMat(){{{*/
     88                ~SeqMat(){
     89
     90                        xDelete<doubletype>(this->matrix);
     91                        M=0;
     92                        N=0;
     93                }
     94                /*}}}*/
     95
     96                /*SeqMat specific routines */
     97                /*FUNCTION Echo{{{*/
     98                void Echo(void){
     99
     100                        int i,j;
     101                        _printLine_("SeqMat size " << this->M << "-" << this->N);
     102                        for(i=0;i<M;i++){
     103                                for(j=0;j<N;j++){
     104                                        _printString_(this->matrix[N*i+j] << " ");
     105                                }
     106                                _printLine_("");
     107                        }
     108                }
     109                /*}}}*/
     110                /*FUNCTION Assemble{{{*/
     111                void Assemble(void){
     112
     113                        /*do nothing*/
     114
     115                }
     116                /*}}}*/
     117                /*FUNCTION Norm{{{*/
     118                doubletype Norm(NormMode mode){
     119
     120                        doubletype norm;
     121                        doubletype absolute;
     122                        int i,j;
     123
     124                        switch(mode){
     125                                case NORM_INF:
     126                                        norm=0;
     127                                        for(i=0;i<this->M;i++){
     128                                                absolute=0;
     129                                                for(j=0;j<this->N;j++){
     130                                                        absolute+=fabs(this->matrix[N*i+j]);
     131                                                }
     132                                                norm=max(norm,absolute);
     133                                        }
     134                                        return norm;
     135                                        break;
     136                                default:
     137                                        _error_("unknown norm !");
     138                                        break;
     139                        }
     140                }
     141                /*}}}*/
     142                /*FUNCTION GetSize{{{*/
     143                void GetSize(int* pM,int* pN){
     144
     145                        *pM=this->M;
     146                        *pN=this->N;
     147
     148                }
     149                /*}}}*/
     150                /*FUNCTION GetLocalSize{{{*/
     151                void GetLocalSize(int* pM,int* pN){
     152
     153                        *pM=this->M;
     154                        *pN=this->N;
     155
     156                }
     157                /*}}}*/
     158                /*FUNCTION MatMult{{{*/
     159                void MatMult(SeqVec<doubletype>* X,SeqVec<doubletype>* AX){
     160
     161                        int i,j;
     162                        int XM,AXM;
     163                        doubletype dummy;
     164
     165                        X->GetSize(&XM);
     166                        AX->GetSize(&AXM);
     167
     168                        if(M!=AXM)_error_("A and AX should have the same number of rows!");
     169                        if(N!=XM)_error_("A and X should have the same number of columns!");
     170
     171                        for(i=0;i<M;i++){
     172                                dummy=0;
     173                                for(j=0;j<N;j++){
     174                                        dummy+= this->matrix[N*i+j]*X->vector[j];
     175                                }
     176                                AX->vector[i]=dummy;
     177                        }
     178
     179                }
     180                /*}}}*/
     181                /*FUNCTION Duplicate{{{*/
     182                SeqMat* Duplicate(void){
     183
     184                        doubletype dummy=0;
     185
     186                        return new SeqMat(this->matrix,this->M,this->N,dummy);
     187
     188                }
     189                /*}}}*/
     190                /*FUNCTION ToSerial{{{*/
     191                doubletype* ToSerial(void){
     192
     193                        doubletype* buffer=NULL;
     194
     195                        if(this->M*this->N){
     196                                buffer=xNew<doubletype>(this->M*this->N);
     197                                xMemCpy<doubletype>(buffer,this->matrix,this->M*this->N);
     198                        }
     199                        return buffer;
     200
     201                }
     202                /*}}}*/
     203                /*FUNCTION SetValues{{{*/
     204                void SetValues(int m,int* idxm,int n,int* idxn,doubletype* values,InsMode mode){
     205
     206                        int i,j;
     207                        switch(mode){
     208                                case ADD_VAL:
     209                                        for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]+=values[n*i+j];
     210                                        break;
     211                                case INS_VAL:
     212                                        for(i=0;i<m;i++) for(j=0;j<n;j++) this->matrix[N*idxm[i]+idxn[j]]=values[n*i+j];
     213                                        break;
     214                                default:
     215                                        _error_("unknown insert mode!");
     216                                        break;
     217                        }
     218
     219                }
     220                /*}}}*/
     221                /*FUNCTION Convert{{{*/
     222                void Convert(MatrixType type){
     223
     224                        /*do nothing*/
     225
     226                }
     227                /*}}}*/         
    48228
    49229};
    50                
     230
    51231#endif //#ifndef _SEQMAT_H_
  • issm/trunk-jpl/src/c/toolkits/issm/SeqVec.h

    r12477 r13216  
    1414#endif
    1515
    16 #include "../toolkitsenums.h"
     16#include "../../shared/Exceptions/exceptions.h"
     17#include "../../shared/MemOps/xMemCpy.h"
     18#include "../../shared/Alloc/alloc.h"
     19#include "../../include/macros.h"
    1720
    1821/*}}}*/
    1922
     23/*We need to template this class, in case we want to create vectors that hold IssmDouble* matrix or IssmPDouble* matrix.
     24  Such vectors would be useful for use without or with the matlab or python interface (which do not care for IssmDouble types,
     25  but only rely on IssmPDouble types)*/
     26
     27template <class doubletype>
    2028class SeqVec{
    2129
    2230        public:
    2331       
    24                 IssmDouble* vector;
     32                doubletype* vector;
    2533                int M;
    2634
    27                 /*SeqVec constructors, destructors {{{*/
    28                 SeqVec();
    29                 SeqVec(int M,bool fromlocalsize=false);
    30                 SeqVec(IssmDouble* buffer, int M);
    31                 ~SeqVec();
    32                 /*}}}*/
    33                 /*SeqVec specific routines {{{*/
    34                 void Echo(void);
    35                 void Assemble(void);
    36                 void SetValues(int ssize, int* list, IssmDouble* values, InsMode mode);
    37                 void SetValue(int dof, IssmDouble value, InsMode  mode);
    38                 void GetValue(IssmDouble* pvalue, int dof);
    39                 void GetSize(int* pM);
    40                 void GetLocalSize(int* pM);
    41                 SeqVec* Duplicate(void);
    42                 void Set(IssmDouble value);
    43                 void AXPY(SeqVec* X, IssmDouble a);
    44                 void AYPX(SeqVec* X, IssmDouble a);
    45                 IssmDouble* ToMPISerial(void);
    46                 void Copy(SeqVec* to);
    47                 IssmDouble Norm(NormMode norm_type);
    48                 void Scale(IssmDouble scale_factor);
    49                 void PointwiseDivide(SeqVec* x,SeqVec* y);
    50                 IssmDouble Dot(SeqVec* vector);
     35                /*SeqVec constructors, destructors*/
     36                /*FUNCTION SeqVec(){{{*/
     37                SeqVec(){
     38
     39                        this->M=0;
     40                        this->vector=NULL;
     41                }
     42                /*}}}*/
     43                /*FUNCTION SeqVec(int M,bool fromlocalsize){{{*/
     44                SeqVec(int pM,bool fromlocalsize){
     45
     46                        this->M=pM;
     47                        this->vector=NULL;
     48                        if(this->M) this->vector=xNewZeroInit<doubletype>(pM);
     49                }
     50                /*}}}*/
     51                /*FUNCTION SeqVec(doubletype* serial_vec,int M){{{*/
     52                SeqVec(doubletype* buffer,int pM){
     53
     54                        int i,j;
     55
     56                        this->M=pM;
     57                        this->vector=NULL;
     58                        if(this->M){
     59                                this->vector=xNew<doubletype>(pM);
     60                                xMemCpy<doubletype>(this->vector,buffer,pM);
     61                        }
     62                }
     63                /*}}}*/
     64                /*FUNCTION ~SeqVec(){{{*/
     65                ~SeqVec(){
     66                        xDelete<doubletype>(this->vector);
     67                        M=0;
     68                }
     69                /*}}}*/
     70
     71                /*SeqVec specific routines*/
     72                /*FUNCTION Echo{{{*/
     73                void Echo(void){
     74
     75                        int i;
     76                        _printLine_("SeqVec size " << this->M);
     77                        for(i=0;i<M;i++){
     78                                _printString_(vector[i] << "\n ");
     79                        }
     80                }
     81                /*}}}*/
     82                /*FUNCTION Assemble{{{*/
     83                void Assemble(void){
     84
     85                        /*do nothing*/
     86
     87                }
     88                /*}}}*/
     89                /*FUNCTION SetValues{{{*/
     90                void SetValues(int ssize, int* list, doubletype* values, InsMode mode){
     91
     92                        int i;
     93                        switch(mode){
     94                                case ADD_VAL:
     95                                        for(i=0;i<ssize;i++) this->vector[list[i]]+=values[i];
     96                                        break;
     97                                case INS_VAL:
     98                                        for(i=0;i<ssize;i++) this->vector[list[i]]=values[i];
     99                                        break;
     100                                default:
     101                                        _error_("unknown insert mode!");
     102                                        break;
     103                        }
     104
     105                }
     106                /*}}}*/
     107                /*FUNCTION SetValue{{{*/
     108                void SetValue(int dof, doubletype value, InsMode mode){
     109
     110                        switch(mode){
     111                                case ADD_VAL:
     112                                        this->vector[dof]+=value;
     113                                        break;
     114                                case INS_VAL:
     115                                        this->vector[dof]=value;
     116                                        break;
     117                                default:
     118                                        _error_("unknown insert mode!");
     119                                        break;
     120                        }
     121                }
     122                /*}}}*/
     123                /*FUNCTION GetValue{{{*/
     124                void GetValue(doubletype* pvalue,int dof){
     125
     126                        *pvalue=this->vector[dof];
     127
     128                }
     129                /*}}}*/
     130                /*FUNCTION GetSize{{{*/
     131                void GetSize(int* pM){
     132
     133                        *pM=this->M;
     134
     135                }
     136                /*}}}*/
     137                /*FUNCTION GetLocalSize{{{*/
     138                void GetLocalSize(int* pM){
     139
     140                        *pM=this->M;
     141
     142                }
     143                /*}}}*/
     144                /*FUNCTION Duplicate{{{*/
     145                SeqVec* Duplicate(void){
     146
     147                        return new SeqVec(this->vector,this->M);
     148
     149                }
     150                /*}}}*/
     151                /*FUNCTION Set{{{*/
     152                void Set(doubletype value){
     153
     154                        int i;
     155                        for(i=0;i<this->M;i++)this->vector[i]=value;
     156
     157                }
     158                /*}}}*/
     159                /*FUNCTION AXPY{{{*/
     160                void AXPY(SeqVec* X, doubletype a){
     161
     162                        int i;
     163
     164                        /*y=a*x+y where this->vector is y*/
     165                        for(i=0;i<this->M;i++)this->vector[i]=a*X->vector[i]+this->vector[i];
     166
     167                }
     168                /*}}}*/
     169                /*FUNCTION AYPX{{{*/
     170                void AYPX(SeqVec* X, doubletype a){
     171
     172                        int i;
     173
     174                        /*y=x+a*y where this->vector is y*/
     175                        for(i=0;i<this->M;i++)this->vector[i]=X->vector[i]+a*this->vector[i];
     176
     177                }
     178                /*}}}*/
     179                /*FUNCTION ToMPISerial{{{*/
     180                doubletype* ToMPISerial(void){
     181
     182                        doubletype* buffer=NULL;
     183
     184                        if(this->M){
     185                                buffer=xNew<doubletype>(this->M);
     186                                xMemCpy<doubletype>(buffer,this->vector,this->M);
     187                        }
     188                        return buffer;
     189
     190                }
     191                /*}}}*/
     192                /*FUNCTION Copy{{{*/
     193                void Copy(SeqVec* to){
     194
     195                        int i;
     196
     197                        to->M=this->M;
     198                        for(i=0;i<this->M;i++)to->vector[i]=this->vector[i];
     199
     200                }
     201                /*}}}*/
     202                /*FUNCTION Norm{{{*/
     203                doubletype Norm(NormMode mode){
     204
     205                        doubletype norm;
     206                        int i;
     207
     208                        switch(mode){
     209                                case NORM_INF:
     210                                        norm=0; for(i=0;i<this->M;i++)norm=max(norm,fabs(this->vector[i]));
     211                                        return norm;
     212                                        break;
     213                                case NORM_TWO:
     214                                        norm=0;
     215                                        for(i=0;i<this->M;i++)norm+=pow(this->vector[i],2);
     216                                        return sqrt(norm);
     217                                        break;
     218                                default:
     219                                        _error_("unknown norm !");
     220                                        break;
     221                        }
     222                }
     223                /*}}}*/
     224                /*FUNCTION Scale{{{*/
     225                void Scale(doubletype scale_factor){
     226
     227                        int i;
     228                        for(i=0;i<this->M;i++)this->vector[i]=scale_factor*this->vector[i];
     229
     230                }
     231                /*}}}*/
     232                /*FUNCTION Dot{{{*/
     233                doubletype Dot(SeqVec* input){
     234
     235                        int i;
     236
     237                        doubletype dot=0;
     238                        for(i=0;i<this->M;i++)dot+=this->vector[i]*input->vector[i];
     239                        return dot;
     240
     241                }
     242                /*}}}*/
     243                /*FUNCTION PointwiseDivide{{{*/
     244                void PointwiseDivide(SeqVec* x,SeqVec* y){
     245
     246                        int i;
     247                        /*pointwise w=x/y where this->vector is w: */
     248                        for(i=0;i<this->M;i++)this->vector[i]=x->vector[i]/y->vector[i];
     249                }
    51250                /*}}}*/
    52251};
    53 
    54252#endif //#ifndef _SEQVEC_H_
  • issm/trunk-jpl/src/c/toolkits/issm/issmtoolkit.h

    r12477 r13216  
    66#define _ISSM_TOOLKIT_H_
    77
    8 #include "../../include/include.h"
    9 
    108#include "./SeqMat.h"
    119#include "./SeqVec.h"
  • issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp

    r13036 r13216  
    3737
    3838        /* output: */
    39         Vector *in_nod  = NULL;
    40         Vector *in_elem = NULL;
     39        Vector<double> *in_nod  = NULL;
     40        Vector<double> *in_elem = NULL;
    4141
    4242        /*Boot module: */
  • issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp

    r13038 r13216  
    3535
    3636        /* output: */
    37         Vector*  flags=NULL;
     37        Vector<double>*  flags=NULL;
    3838        int  nods;
    3939
  • issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp

    r13036 r13216  
    3737        FetchData(&options,NRHS,nrhs,prhs);
    3838
    39         options->Get(&choles,"holes","no");
     39        options->Get(&choles,"holes",(char*)"no");
    4040        if (!strncmp(choles,"y",1) || !strncmp(choles,"on",2)) holes=true;
    4141
  • issm/trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp

    r13036 r13216  
    3737
    3838        /* output: */
    39         Vector*  data_mesh=NULL;
     39        Vector<double>*  data_mesh=NULL;
    4040
    4141        /*Boot module: */
  • issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp

    r13038 r13216  
    6161
    6262        /* output: */
    63         Vector*  data_prime=NULL;
     63        Vector<double>*  data_prime=NULL;
    6464
    6565        /*Boot module: */
  • issm/trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp

    r13036 r13216  
    5555
    5656        /* output: */
    57         Vector*  data_prime=NULL;
     57        Vector<double>*  data_prime=NULL;
    5858
    5959        /*Boot module: */
  • issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp

    r13036 r13216  
    5656        FetchData(&options,NRHS,nrhs,prhs);
    5757
    58         options->Get(&echo    ,"echo"    ,"off");
    59         options->Get(&deepecho,"deepecho","off");
    60         options->Get(&write   ,"write"   ,"off");
     58        options->Get(&echo    ,"echo"    ,(char*)"off");
     59        options->Get(&deepecho,"deepecho",(char*)"off");
     60        options->Get(&write   ,"write"   ,(char*)"off");
    6161
    6262        /*some checks*/
  • issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp

    r13036 r13216  
    4141        FetchData(&options,NRHS,nrhs,prhs);
    4242
    43         options->Get(&lataxis ,&nlat ,"lataxis" );
     43        options->Get(&lataxis ,&nlat ,(char*)"lataxis");
    4444        if (verbose && lataxis) for (i=0; i<nlat; i++) _printLine_("  lataxis [" << i << "]=" << lataxis[i]);
    45         options->Get(&longaxis,&nlong,"longaxis");
     45        options->Get(&longaxis,&nlong,(char*)"longaxis");
    4646        if (verbose && longaxis) for (i=0; i<nlong; i++) _printLine_("  longaxis[" << i << "]=" << longaxis[i]);
    47         options->Get(&pimages,&nimages,"images");
     47        options->Get(&pimages,&nimages,(char*)"images");
    4848        if (verbose && pimages) for (i=0; i<nimages; i++) _printLine_("  pimages[" << i << "]=\"" << pimages[i] << "\"");
    49         options->Get(&dzip,"zip",0.);
     49        options->Get(&dzip,(char*)"zip",0.);
    5050        if (verbose) _printLine_("  dzip=" << dzip);
    5151
  • issm/trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp

    r12517 r13216  
    1717
    1818        /* output: */
    19         Vector*  flags=NULL;
     19        Vector<double>*  flags=NULL;
    2020
    2121        /*Boot module: */
  • issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp

    r12861 r13216  
    1717
    1818        /* output: */
    19         Matrix *index             = NULL;
    20         Vector *x                 = NULL;
    21         Vector *y                 = NULL;
    22         Matrix *segments          = NULL;
    23         Vector *segmentmarkerlist = NULL;
     19        Matrix<double> *index             = NULL;
     20        Vector<double> *x                 = NULL;
     21        Vector<double> *y                 = NULL;
     22        Matrix<double> *segments          = NULL;
     23        Vector<double> *segmentmarkerlist = NULL;
    2424
    2525        /*Boot module: */
Note: See TracChangeset for help on using the changeset viewer.