Changeset 13216
- Timestamp:
- 08/31/12 17:23:24 (13 years ago)
- 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 175 175 IssmDouble *resultstimes = NULL; 176 176 IssmDouble *vector_serial= NULL; 177 Vector * vector = NULL;177 Vector<IssmDouble>* vector = NULL; 178 178 bool io_gather; 179 179 bool results_as_patches; … … 233 233 else if(resultssizes[i]==P0Enum) vectorsize=numberofelements; 234 234 else _error_("Unkown result size: " << EnumToStringx(resultssizes[i])); 235 vector=new Vector (vectorsize);235 vector=new Vector<IssmDouble>(vectorsize); 236 236 237 237 for(int j=0;j<this->Size();j++){ -
issm/trunk-jpl/src/c/Container/Observations.cpp
r13073 r13216 19 19 #include "./Observations.h" 20 20 #include "../shared/shared.h" 21 #include "../Container/Container.h" 22 #include "../classes/classes.h" 21 23 #include "../include/include.h" 22 24 #include "../modules/modules.h" -
issm/trunk-jpl/src/c/Container/Observations.h
r12468 r13216 7 7 8 8 #include "../include/include.h" 9 #include "../classes/objects/Options/GenericOption.h" 9 10 10 11 class Quadtree; -
issm/trunk-jpl/src/c/Container/Options.cpp
r13056 r13216 19 19 #include "../io/io.h" 20 20 #include "../include/include.h" 21 #include "../classes/classes.h" 21 22 #include "../shared/shared.h" 22 23 #include "../EnumDefinitions/EnumDefinitions.h" … … 40 41 int Options::AddOption(Option* in_option){ 41 42 43 char* name=NULL; 44 42 45 vector<Object*>::iterator object; 43 46 Option* option=NULL; … … 47 50 48 51 /*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 \"]\""); 53 58 54 59 /*Finally, check that no option of the same name already exists in the dataset*/ … … 56 61 57 62 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"); 60 65 break; 61 66 } … … 66 71 67 72 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 else256 ((*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 }294 73 } 295 74 /*}}}*/ … … 304 83 305 84 option=(Option*)(*object); 306 if (!strncmp(name,option-> name,strlen(option->name))){85 if (!strncmp(name,option->Name(),strlen(option->Name()))){ 307 86 308 87 /*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())){ 310 89 return option; 311 90 } … … 313 92 /*If the object is a Cell, recursive call to its options*/ 314 93 if(option->ObjectEnum()==OptionCellEnum){ 315 return ((OptionCell*)option)->values->GetOption(name); 94 GenericOption<Options*>* celloption=(GenericOption<Options*>*)option; 95 return celloption->value->GetOption(name); 316 96 } 317 97 /*If the object is a Struct loop over its size and recursive call*/ 318 98 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); 322 103 } 323 104 } -
issm/trunk-jpl/src/c/Container/Options.h
r12466 r13216 5 5 #ifndef _CONTAINER_OPTIONS_H_ 6 6 #define _CONTAINER_OPTIONS_H_ 7 8 #include "../classes/objects/Options/GenericOption.h" 7 9 8 10 /*forward declarations */ … … 20 22 int AddOption(Option* in_oobject); 21 23 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 32 99 }; 33 100 -
issm/trunk-jpl/src/c/Container/Parameters.cpp
r13056 r13216 244 244 } 245 245 /*}}}*/ 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){{{*/ 247 void Parameters::FindParam(Vector<IssmDouble>** pvec,int enum_type){ _assert_(this); 248 248 249 249 vector<Object*>::iterator object; … … 262 262 } 263 263 /*}}}*/ 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){{{*/ 265 void Parameters::FindParam(Matrix<IssmDouble>** pmat,int enum_type){ _assert_(this); 266 266 267 267 vector<Object*>::iterator object; … … 406 406 } 407 407 /*}}}*/ 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);{{{*/ 409 void Parameters::SetParam(Vector<IssmDouble>* vector,int enum_type){ 410 410 411 411 Param* param=NULL; … … 418 418 } 419 419 /*}}}*/ 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);{{{*/ 421 void Parameters::SetParam(Matrix<IssmDouble>* matrix,int enum_type){ 422 422 423 423 Param* param=NULL; -
issm/trunk-jpl/src/c/Container/Parameters.h
r12746 r13216 8 8 9 9 /*forward declarations */ 10 class Matrix;11 class Vector;10 template <class doublematrix> class Matrix; 11 template <class doubletype> class Vector; 12 12 class Materials; 13 13 class Parameters; … … 41 41 void FindParam(IssmDouble** pIssmDoublearray,int* pM,int* pN,int enum_type); 42 42 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); 45 45 void FindParam(FILE** pfid,int enum_type); 46 46 … … 54 54 void SetParam(int* intarray,int M,int enum_type); 55 55 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); 58 58 void SetParam(FILE* fid,int enum_type); 59 59 void UnitConversion(int direction_enum); -
issm/trunk-jpl/src/c/Makefile.am
r13185 r13216 132 132 ./classes/matrix/ElementVector.cpp\ 133 133 ./classes/matrix/Matrix.h\ 134 ./classes/matrix/Matrix.cpp\135 134 ./classes/matrix/Vector.h\ 136 ./classes/matrix/Vector.cpp\137 135 ./classes/objects/Params/Param.h\ 138 136 ./classes/objects/Params/GenericParam.h\ … … 237 235 ./toolkits/issm/issmtoolkit.h\ 238 236 ./toolkits/issm/SeqVec.h\ 239 ./toolkits/issm/SeqVec.cpp\240 237 ./toolkits/issm/SeqMat.h\ 241 ./toolkits/issm/SeqMat.cpp\242 238 ./toolkits/triangle/triangleincludes.h\ 243 239 ./toolkitsenums.h\ … … 360 356 ./solvers/solver_nonlinear.cpp\ 361 357 ./solvers/solver_newton.cpp\ 362 ./classes/objects/Options/Option.cpp\363 358 ./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\ 368 360 ./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 376 362 377 363 #}}} -
issm/trunk-jpl/src/c/classes/IoModel.cpp
r13036 r13216 879 879 /*output: */ 880 880 int code; 881 Option *option = NULL;882 881 char *name = NULL; 883 882 … … 889 888 switch(code){ 890 889 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 } 902 904 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 } 913 917 default: 914 918 _error_("Option of format " << code << " not supported yet"); 915 919 } 916 920 917 /*Assign output pointers: */918 *poption=option;919 921 } 920 922 /*}}}*/ -
issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
r13045 r13216 245 245 246 246 /*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){{{*/ 248 void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){ 249 249 250 250 int i,j; … … 300 300 } 301 301 /*}}}*/ 302 /*FUNCTION ElementMatrix::AddToGlobal(Matrix * Jff){{{*/303 void ElementMatrix::AddToGlobal(Matrix * Jff){302 /*FUNCTION ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){{{*/ 303 void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){ 304 304 305 305 int i,j; -
issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h
r12899 r13216 15 15 #include "../../EnumDefinitions/EnumDefinitions.h" 16 16 class Node; 17 class Matrix;17 template <class doublematrix> class Matrix; 18 18 class Parameters; 19 19 /*}}}*/ … … 60 60 /*}}}*/ 61 61 /*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); 64 64 void Echo(void); 65 65 void CheckConsistency(void); -
issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp
r13036 r13216 160 160 161 161 /*ElementVector specific routines: */ 162 /*FUNCTION ElementVector::AddToGlobal(Vector * pf){{{*/163 void ElementVector::AddToGlobal(Vector * pf){162 /*FUNCTION ElementVector::AddToGlobal(Vector<IssmDouble>* pf){{{*/ 163 void ElementVector::AddToGlobal(Vector<IssmDouble>* pf){ 164 164 165 165 int i; … … 184 184 } 185 185 /*}}}*/ 186 /*FUNCTION ElementVector::InsertIntoGlobal(Vector * pf){{{*/187 void ElementVector::InsertIntoGlobal(Vector * pf){186 /*FUNCTION ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){{{*/ 187 void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){ 188 188 189 189 int i; -
issm/trunk-jpl/src/c/classes/matrix/ElementVector.h
r12899 r13216 15 15 #include "../../EnumDefinitions/EnumDefinitions.h" 16 16 class Node; 17 class Vector;17 template <class doubletype> class Vector; 18 18 class Parameters; 19 19 /*}}}*/ … … 42 42 /*}}}*/ 43 43 /*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); 46 46 void Echo(void); 47 47 void CheckConsistency(void); -
issm/trunk-jpl/src/c/classes/matrix/Matrix.h
r12987 r13216 17 17 #include "../../EnumDefinitions/EnumDefinitions.h" 18 18 /*}}}*/ 19 class Vector; 20 enum matrixtype{PetscMatType, SeqMatType}; 21 19 20 enum matrixtype { PetscMatType, SeqMatType }; 21 22 template <class doubletype> class Vector; 23 24 template <class doubletype> 22 25 class Matrix{ 23 26 … … 27 30 PetscMat *pmatrix; 28 31 #endif 29 SeqMat *smatrix;32 SeqMat<doubletype> *smatrix; 30 33 int type; 31 34 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){ 39 54 #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 } 58 342 /*}}}*/ 59 343 }; -
issm/trunk-jpl/src/c/classes/matrix/Vector.h
r12987 r13216 21 21 enum vectortype { PetscVecType, SeqVecType }; 22 22 23 template <class doubletype> 23 24 class Vector{ 24 25 … … 28 29 PetscVec* pvector; 29 30 #endif 30 SeqVec * svector;31 SeqVec<doubletype>* svector; 31 32 int type; 32 33 33 34 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){{{*/ 36 52 #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){ 40 54 #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){ 43 56 #endif 44 57 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 } 66 467 /*}}}*/ 67 468 }; 68 69 70 469 #endif //#ifndef _VECTOR_H_ -
issm/trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.cpp
r13036 r13216 126 126 /*}}}*/ 127 127 /*FUNCTION BoolElementResult::GetVectorFromResults{{{*/ 128 void BoolElementResult::GetVectorFromResults(Vector * vector,int* doflist,int* connectivitylist,int numdofs){128 void BoolElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){ 129 129 130 130 _error_("cannot return vector on vertices"); 131 131 } /*}}}*/ 132 132 /*FUNCTION BoolElementResult::GetElementVectorFromResults{{{*/ 133 void BoolElementResult::GetElementVectorFromResults(Vector * vector,int dof){133 void BoolElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){ 134 134 135 135 vector->SetValue(dof,value,INS_VAL); -
issm/trunk-jpl/src/c/classes/objects/ElementResults/BoolElementResult.h
r12832 r13216 48 48 /*BoolElementResult management: {{{*/ 49 49 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); 52 52 /*}}}*/ 53 53 }; -
issm/trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.cpp
r13036 r13216 127 127 /*}}}*/ 128 128 /*FUNCTION DoubleElementResult::GetVectorFromResults{{{1*/ 129 void DoubleElementResult::GetVectorFromResults(Vector * vector,int* doflist,int* connectivitylist,int numdofs){129 void DoubleElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){ 130 130 131 131 _error_("cannot return vector on vertices"); 132 132 } /*}}}*/ 133 133 /*FUNCTION DoubleElementResult::GetElementVectorFromResults{{{1*/ 134 void DoubleElementResult::GetElementVectorFromResults(Vector * vector,int dof){134 void DoubleElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){ 135 135 136 136 vector->SetValue(dof,value,INS_VAL); -
issm/trunk-jpl/src/c/classes/objects/ElementResults/DoubleElementResult.h
r12832 r13216 48 48 /*DoubleElementResult management: {{{*/ 49 49 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); 52 52 /*}}}*/ 53 53 }; -
issm/trunk-jpl/src/c/classes/objects/ElementResults/ElementResult.h
r12561 r13216 25 25 virtual void PatchFill(int row, Patch* patch)=0; 26 26 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; 29 29 30 30 }; -
issm/trunk-jpl/src/c/classes/objects/ElementResults/PentaP1ElementResult.cpp
r13036 r13216 138 138 /*}}}*/ 139 139 /*FUNCTION PentaP1ElementResult::GetVectorFromResults{{{*/ 140 void PentaP1ElementResult::GetVectorFromResults(Vector * vector,int* doflist,int* connectivitylist,int numdofs){140 void PentaP1ElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){ 141 141 142 142 IssmDouble data[6]; … … 148 148 } /*}}}*/ 149 149 /*FUNCTION PentaP1ElementResult::GetElementVectorFromResults{{{*/ 150 void PentaP1ElementResult::GetElementVectorFromResults(Vector * vector,int dof){150 void PentaP1ElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){ 151 151 152 152 _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 47 47 /*PentaP1ElementResult management: {{{*/ 48 48 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); 51 51 /*}}}*/ 52 52 -
issm/trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.cpp
r13036 r13216 126 126 /*}}}*/ 127 127 /*FUNCTION TriaP1ElementResult::GetVectorFromResults{{{*/ 128 void TriaP1ElementResult::GetVectorFromResults(Vector * vector,int* doflist,int* connectivitylist,int numdofs){128 void TriaP1ElementResult::GetVectorFromResults(Vector<IssmDouble>* vector,int* doflist,int* connectivitylist,int numdofs){ 129 129 130 130 IssmDouble data[3]; … … 136 136 } /*}}}*/ 137 137 /*FUNCTION TriaP1ElementResult::GetElementVectorFromResults{{{*/ 138 void TriaP1ElementResult::GetElementVectorFromResults(Vector * vector,int dof){138 void TriaP1ElementResult::GetElementVectorFromResults(Vector<IssmDouble>* vector,int dof){ 139 139 _error_("Result " << EnumToStringx(enum_type) << " is a TriaP1ElementResult and should not write vector of size numberofelemenrs"); 140 140 } /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/ElementResults/TriaP1ElementResult.h
r12832 r13216 46 46 /*TriaP1ElementResult management: {{{*/ 47 47 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); 50 50 /*}}}*/ 51 51 -
issm/trunk-jpl/src/c/classes/objects/Elements/Element.h
r12927 r13216 16 16 class Parameters; 17 17 class Patch; 18 class Matrix;19 class Vector;18 template <class doublematrix> class Matrix; 19 template <class doubletype> class Vector; 20 20 21 21 #include "../../../toolkits/toolkits.h" … … 30 30 virtual void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0; 31 31 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; 36 36 virtual int GetNodeIndex(Node* node)=0; 37 37 virtual int Sid()=0; … … 46 46 virtual IssmDouble SurfaceArea(void)=0; 47 47 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; 50 50 virtual void PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes)=0; 51 51 virtual void PatchFill(int* pcount, Patch* patch)=0; … … 62 62 virtual int NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units)=0; 63 63 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; 66 66 virtual void InputArtificialNoise(int enum_type,IssmDouble min,IssmDouble max)=0; 67 67 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; 69 69 virtual int* GetHorizontalNeighboorSids(void)=0; 70 70 virtual IssmDouble TimeAdapt()=0; 71 71 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; 73 73 virtual void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm)=0; 74 74 virtual void Delta18oParameterization(void)=0; 75 75 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; 77 77 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; 79 79 80 80 #ifdef _HAVE_RESPONSES_ … … 97 97 98 98 #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; 100 100 virtual IssmDouble ThicknessAbsMisfit(bool process_units ,int weight_index)=0; 101 101 virtual IssmDouble SurfaceAbsVelMisfit(bool process_units ,int weight_index)=0; … … 109 109 virtual IssmDouble RheologyBbarAbsGradient(bool process_units,int weight_index)=0; 110 110 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; 112 112 virtual void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index)=0; 113 113 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; 115 115 virtual void SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index)=0; 116 116 virtual void InputControlUpdate(IssmDouble scalar,bool save_parameter)=0; -
issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
r13129 r13216 145 145 /*Other*/ 146 146 /*FUNCTION Penta::AverageOntoPartition {{{*/ 147 void Penta::AverageOntoPartition(Vector * partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){147 void Penta::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){ 148 148 _error_("Not supported yet!"); 149 149 } … … 226 226 /*}}}*/ 227 227 /*FUNCTION Penta::ComputeBasalStress {{{*/ 228 void Penta::ComputeBasalStress(Vector * sigma_b){228 void Penta::ComputeBasalStress(Vector<IssmDouble>* sigma_b){ 229 229 230 230 int i,j,ig; … … 316 316 /*}}}*/ 317 317 /*FUNCTION Penta::ComputeStrainRate {{{*/ 318 void Penta::ComputeStrainRate(Vector * eps){318 void Penta::ComputeStrainRate(Vector<IssmDouble>* eps){ 319 319 320 320 _error_("Not implemented yet"); … … 410 410 /*}}}*/ 411 411 /*FUNCTION Penta::CreateKMatrix {{{*/ 412 void Penta::CreateKMatrix(Matrix * Kff, Matrix* Kfs,Vector* df){412 void Penta::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df){ 413 413 414 414 /*retrieve parameters: */ … … 514 514 /*}}}*/ 515 515 /*FUNCTION Penta::CreatePVector {{{*/ 516 void Penta::CreatePVector(Vector * pf){516 void Penta::CreatePVector(Vector<IssmDouble>* pf){ 517 517 518 518 /*retrive parameters: */ … … 616 616 /*}}}*/ 617 617 /*FUNCTION Penta::CreateJacobianMatrix{{{*/ 618 void Penta::CreateJacobianMatrix(Matrix * Jff){618 void Penta::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){ 619 619 620 620 /*retrieve parameters: */ … … 1006 1006 /*}}}*/ 1007 1007 /*FUNCTION Penta::GetSolutionFromInputs{{{*/ 1008 void Penta::GetSolutionFromInputs(Vector * solution){1008 void Penta::GetSolutionFromInputs(Vector<IssmDouble>* solution){ 1009 1009 1010 1010 int analysis_type; … … 1133 1133 /*}}}*/ 1134 1134 /*FUNCTION Penta::GetVectorFromInputs{{{*/ 1135 void Penta::GetVectorFromInputs(Vector * vector,int input_enum){1135 void Penta::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){ 1136 1136 1137 1137 int doflist1[NUMVERTICES]; … … 1152 1152 /*}}}*/ 1153 1153 /*FUNCTION Penta::GetVectorFromResults{{{*/ 1154 void Penta::GetVectorFromResults(Vector * vector,int offset,int enum_in,int interp){1154 void Penta::GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int enum_in,int interp){ 1155 1155 1156 1156 /*Get result*/ … … 2390 2390 /*}}}*/ 2391 2391 /*FUNCTION Penta::PotentialSheetUngrounding{{{*/ 2392 void Penta::PotentialSheetUngrounding(Vector * potential_sheet_ungrounding){2392 void Penta::PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){ 2393 2393 2394 2394 int i; … … 2965 2965 /*}}}*/ 2966 2966 /*FUNCTION Penta::UpdatePotentialSheetUngrounding{{{*/ 2967 int Penta::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector * vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){2967 int Penta::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){ 2968 2968 2969 2969 int i; … … 3033 3033 /*}}}*/ 3034 3034 /*FUNCTION Penta::SmearFunction {{{*/ 3035 void Penta::SmearFunction(Vector * smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){3035 void Penta::SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){ 3036 3036 _error_("not implemented yet"); 3037 3037 } … … 4247 4247 /*}}}*/ 4248 4248 /*FUNCTION Penta::GetSolutionFromInputsThermal{{{*/ 4249 void Penta::GetSolutionFromInputsThermal(Vector * solution){4249 void Penta::GetSolutionFromInputsThermal(Vector<IssmDouble>* solution){ 4250 4250 4251 4251 const int numdof=NDOF1*NUMVERTICES; … … 4278 4278 /*}}}*/ 4279 4279 /*FUNCTION Penta::GetSolutionFromInputsEnthalpy{{{*/ 4280 void Penta::GetSolutionFromInputsEnthalpy(Vector * solution){4280 void Penta::GetSolutionFromInputsEnthalpy(Vector<IssmDouble>* solution){ 4281 4281 4282 4282 const int numdof=NDOF1*NUMVERTICES; … … 4461 4461 #ifdef _HAVE_CONTROL_ 4462 4462 /*FUNCTION Penta::ControlInputGetGradient{{{*/ 4463 void Penta::ControlInputGetGradient(Vector * gradient,int enum_type,int control_index){4463 void Penta::ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){ 4464 4464 4465 4465 int doflist1[NUMVERTICES]; … … 4808 4808 /*}}}*/ 4809 4809 /*FUNCTION Penta::Gradj {{{*/ 4810 void Penta::Gradj(Vector * gradient,int control_type,int control_index){4810 void Penta::Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){ 4811 4811 /*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/ 4812 4812 … … 4899 4899 /*}}}*/ 4900 4900 /*FUNCTION Penta::GradjDragMacAyeal {{{*/ 4901 void Penta::GradjDragMacAyeal(Vector * gradient,int control_index){4901 void Penta::GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index){ 4902 4902 4903 4903 /*Gradient is 0 if on shelf or not on bed*/ … … 4911 4911 } /*}}}*/ 4912 4912 /*FUNCTION Penta::GradjDragPattyn {{{*/ 4913 void Penta::GradjDragPattyn(Vector * gradient,int control_index){4913 void Penta::GradjDragPattyn(Vector<IssmDouble>* gradient,int control_index){ 4914 4914 4915 4915 int i,j,ig; … … 4982 4982 /*}}}*/ 4983 4983 /*FUNCTION Penta::GradjDragStokes {{{*/ 4984 void Penta::GradjDragStokes(Vector * gradient,int control_index){4984 void Penta::GradjDragStokes(Vector<IssmDouble>* gradient,int control_index){ 4985 4985 4986 4986 int i,j,ig; … … 5074 5074 /*}}}*/ 5075 5075 /*FUNCTION Penta::GradjBbarMacAyeal {{{*/ 5076 void Penta::GradjBbarMacAyeal(Vector * gradient,int control_index){5076 void Penta::GradjBbarMacAyeal(Vector<IssmDouble>* gradient,int control_index){ 5077 5077 5078 5078 /*This element should be collapsed into a tria element at its base*/ … … 5092 5092 } /*}}}*/ 5093 5093 /*FUNCTION Penta::GradjBbarPattyn {{{*/ 5094 void Penta::GradjBbarPattyn(Vector * gradient,int control_index){5094 void Penta::GradjBbarPattyn(Vector<IssmDouble>* gradient,int control_index){ 5095 5095 5096 5096 /*Gradient is computed on bed only (Bbar)*/ … … 5109 5109 } /*}}}*/ 5110 5110 /*FUNCTION Penta::GradjBbarStokes {{{*/ 5111 void Penta::GradjBbarStokes(Vector * gradient,int control_index){5111 void Penta::GradjBbarStokes(Vector<IssmDouble>* gradient,int control_index){ 5112 5112 5113 5113 /*Gradient is computed on bed only (Bbar)*/ … … 5492 5492 /*}}}*/ 5493 5493 /*FUNCTION Penta::GetVectorFromControlInputs{{{*/ 5494 void Penta::GetVectorFromControlInputs(Vector * vector,int control_enum,int control_index,const char* data){5494 void Penta::GetVectorFromControlInputs(Vector<IssmDouble>* vector,int control_enum,int control_index,const char* data){ 5495 5495 5496 5496 int doflist1[NUMVERTICES]; … … 8075 8075 /*}}}*/ 8076 8076 /*FUNCTION Penta::GetSolutionFromInputsDiagnosticHoriz{{{*/ 8077 void Penta::GetSolutionFromInputsDiagnosticHoriz(Vector * solution){8077 void Penta::GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solution){ 8078 8078 8079 8079 const int numdof=NDOF2*NUMVERTICES; … … 8117 8117 /*}}}*/ 8118 8118 /*FUNCTION Penta::GetSolutionFromInputsDiagnosticHutter{{{*/ 8119 void Penta::GetSolutionFromInputsDiagnosticHutter(Vector * solution){8119 void Penta::GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solution){ 8120 8120 8121 8121 const int numdof=NDOF2*NUMVERTICES; … … 8153 8153 /*}}}*/ 8154 8154 /*FUNCTION Penta::GetSolutionFromInputsDiagnosticVert{{{*/ 8155 void Penta::GetSolutionFromInputsDiagnosticVert(Vector * solution){8155 void Penta::GetSolutionFromInputsDiagnosticVert(Vector<IssmDouble>* solution){ 8156 8156 8157 8157 const int numdof=NDOF1*NUMVERTICES; … … 8186 8186 /*}}}*/ 8187 8187 /*FUNCTION Penta::GetSolutionFromInputsDiagnosticStokes{{{*/ 8188 void Penta::GetSolutionFromInputsDiagnosticStokes(Vector * solution){8188 void Penta::GetSolutionFromInputsDiagnosticStokes(Vector<IssmDouble>* solution){ 8189 8189 8190 8190 const int numdof=NDOF4*NUMVERTICES; -
issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h
r13129 r13216 74 74 /*}}}*/ 75 75 /*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); 77 77 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); 80 80 void ComputeStressTensor(); 81 81 void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 82 82 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); 86 86 void Delta18oParameterization(void); 87 87 void DeleteResults(void); 88 88 int GetNodeIndex(Node* node); 89 void GetSolutionFromInputs(Vector * solution);89 void GetSolutionFromInputs(Vector<IssmDouble>* solution); 90 90 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); 93 93 94 94 int Sid(); … … 103 103 void InputToResult(int enum_type,int step,IssmDouble time); 104 104 void MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding); 105 void PotentialSheetUngrounding(Vector * potential_sheet_ungrounding);105 void PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding); 106 106 void RequestedOutput(int output_enum,int step,IssmDouble time); 107 107 void ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results); … … 114 114 IssmDouble SurfaceArea(void); 115 115 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); 117 117 int NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units); 118 118 IssmDouble TimeAdapt(); 119 119 int* GetHorizontalNeighboorSids(void); 120 120 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); 122 122 123 123 #ifdef _HAVE_RESPONSES_ … … 142 142 IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index); 143 143 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); 152 152 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); 154 154 void ControlInputScaleGradient(int enum_type,IssmDouble scale); 155 155 void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index); … … 183 183 void GetInputValue(IssmDouble* pvalue,Node* node,int enumtype); 184 184 void GetPhi(IssmDouble* phi, IssmDouble* epsilon, IssmDouble viscosity); 185 void GetSolutionFromInputsEnthalpy(Vector * solutiong);185 void GetSolutionFromInputsEnthalpy(Vector<IssmDouble>* solutiong); 186 186 IssmDouble GetStabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa); 187 187 void GetStrainRate3dPattyn(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input); … … 254 254 void InputUpdateFromSolutionDiagnosticVert( IssmDouble* solutiong); 255 255 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); 260 260 ElementVector* CreatePVectorCouplingMacAyealStokes(void); 261 261 ElementVector* CreatePVectorCouplingMacAyealStokesViscous(void); … … 313 313 ElementVector* CreatePVectorThermalShelf(void); 314 314 ElementVector* CreatePVectorThermalSheet(void); 315 void GetSolutionFromInputsThermal(Vector * solutiong);315 void GetSolutionFromInputsThermal(Vector<IssmDouble>* solutiong); 316 316 void InputUpdateFromSolutionThermal( IssmDouble* solutiong); 317 317 void InputUpdateFromSolutionEnthalpy( IssmDouble* solutiong); -
issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
r13129 r13216 125 125 /*Other*/ 126 126 /*FUNCTION Tria::AverageOntoPartition {{{*/ 127 void Tria::AverageOntoPartition(Vector * partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){127 void Tria::AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part){ 128 128 129 129 bool already=false; … … 165 165 /*}}}*/ 166 166 /*FUNCTION Tria::CreateKMatrix {{{*/ 167 void Tria::CreateKMatrix(Matrix * Kff, Matrix* Kfs,Vector* df){167 void Tria::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df){ 168 168 169 169 /*retreive parameters: */ … … 517 517 /*}}}*/ 518 518 /*FUNCTION Tria::CreatePVector {{{*/ 519 void Tria::CreatePVector(Vector * pf){519 void Tria::CreatePVector(Vector<IssmDouble>* pf){ 520 520 521 521 /*retrive parameters: */ … … 740 740 /*}}}*/ 741 741 /*FUNCTION Tria::CreateJacobianMatrix{{{*/ 742 void Tria::CreateJacobianMatrix(Matrix * Jff){742 void Tria::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){ 743 743 744 744 /*retrieve parameters: */ … … 773 773 /*}}}*/ 774 774 /*FUNCTION Tria::ComputeBasalStress {{{*/ 775 void Tria::ComputeBasalStress(Vector * eps){775 void Tria::ComputeBasalStress(Vector<IssmDouble>* eps){ 776 776 _error_("Not Implemented yet"); 777 777 } 778 778 /*}}}*/ 779 779 /*FUNCTION Tria::ComputeStrainRate {{{*/ 780 void Tria::ComputeStrainRate(Vector * eps){780 void Tria::ComputeStrainRate(Vector<IssmDouble>* eps){ 781 781 _error_("Not Implemented yet"); 782 782 } … … 1191 1191 /*}}}*/ 1192 1192 /*FUNCTION Tria::GetSolutionFromInputs{{{*/ 1193 void Tria::GetSolutionFromInputs(Vector * solution){1193 void Tria::GetSolutionFromInputs(Vector<IssmDouble>* solution){ 1194 1194 1195 1195 /*retrive parameters: */ … … 1241 1241 /*}}}*/ 1242 1242 /*FUNCTION Tria::GetVectorFromInputs{{{*/ 1243 void Tria::GetVectorFromInputs(Vector * vector,int input_enum){1243 void Tria::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){ 1244 1244 1245 1245 int doflist1[NUMVERTICES]; … … 1260 1260 /*}}}*/ 1261 1261 /*FUNCTION Tria::GetVectorFromResults{{{*/ 1262 void Tria::GetVectorFromResults(Vector * vector,int offset,int enum_in,int interp){1262 void Tria::GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int enum_in,int interp){ 1263 1263 1264 1264 /*Get result*/ … … 2131 2131 /*}}}*/ 2132 2132 /*FUNCTION Tria::PotentialSheetUngrounding{{{*/ 2133 void Tria::PotentialSheetUngrounding(Vector * potential_sheet_ungrounding){2133 void Tria::PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding){ 2134 2134 2135 2135 int i; … … 2251 2251 /*}}}*/ 2252 2252 /*FUNCTION Tria::SmearFunction {{{*/ 2253 void Tria::SmearFunction(Vector * smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){2253 void Tria::SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius){ 2254 2254 _error_("not implemented yet"); 2255 2255 … … 2524 2524 /*}}}*/ 2525 2525 /*FUNCTION Tria::UpdatePotentialSheetUngrounding{{{*/ 2526 int Tria::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector * vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){2526 int Tria::UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf){ 2527 2527 2528 2528 int i; … … 3192 3192 /*}}}*/ 3193 3193 /*FUNCTION Tria::GetSolutionFromInputsDiagnosticHoriz{{{*/ 3194 void Tria::GetSolutionFromInputsDiagnosticHoriz(Vector * solution){3194 void Tria::GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solution){ 3195 3195 3196 3196 const int numdof=NDOF2*NUMVERTICES; … … 3231 3231 /*}}}*/ 3232 3232 /*FUNCTION Tria::GetSolutionFromInputsDiagnosticHutter{{{*/ 3233 void Tria::GetSolutionFromInputsDiagnosticHutter(Vector * solution){3233 void Tria::GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solution){ 3234 3234 3235 3235 const int numdof=NDOF2*NUMVERTICES; … … 3430 3430 /*}}}*/ 3431 3431 /*FUNCTION Tria::ControlInputGetGradient{{{*/ 3432 void Tria::ControlInputGetGradient(Vector * gradient,int enum_type,int control_index){3432 void Tria::ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index){ 3433 3433 3434 3434 int doflist1[NUMVERTICES]; … … 3489 3489 }/*}}}*/ 3490 3490 /*FUNCTION Tria::Gradj {{{*/ 3491 void Tria::Gradj(Vector * gradient,int control_type,int control_index){3491 void Tria::Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index){ 3492 3492 /*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/ 3493 3493 … … 3553 3553 /*}}}*/ 3554 3554 /*FUNCTION Tria::GradjBGradient{{{*/ 3555 void Tria::GradjBGradient(Vector * gradient,int weight_index,int control_index){3555 void Tria::GradjBGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index){ 3556 3556 3557 3557 int i,ig; … … 3593 3593 /*}}}*/ 3594 3594 /*FUNCTION Tria::GradjZGradient{{{*/ 3595 void Tria::GradjZGradient(Vector * gradient,int weight_index,int control_index){3595 void Tria::GradjZGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index){ 3596 3596 3597 3597 int i,ig; … … 3633 3633 /*}}}*/ 3634 3634 /*FUNCTION Tria::GradjBMacAyeal{{{*/ 3635 void Tria::GradjBMacAyeal(Vector * gradient,int control_index){3635 void Tria::GradjBMacAyeal(Vector<IssmDouble>* gradient,int control_index){ 3636 3636 3637 3637 /*Intermediaries*/ … … 3690 3690 /*}}}*/ 3691 3691 /*FUNCTION Tria::GradjZMacAyeal{{{*/ 3692 void Tria::GradjZMacAyeal(Vector * gradient,int control_index){3692 void Tria::GradjZMacAyeal(Vector<IssmDouble>* gradient,int control_index){ 3693 3693 3694 3694 /*Intermediaries*/ … … 3747 3747 /*}}}*/ 3748 3748 /*FUNCTION Tria::GradjDragMacAyeal {{{*/ 3749 void Tria::GradjDragMacAyeal(Vector * gradient,int control_index){3749 void Tria::GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index){ 3750 3750 3751 3751 int i,ig; … … 3835 3835 /*}}}*/ 3836 3836 /*FUNCTION Tria::GradjDragGradient{{{*/ 3837 void Tria::GradjDragGradient(Vector * gradient, int weight_index,int control_index){3837 void Tria::GradjDragGradient(Vector<IssmDouble>* gradient, int weight_index,int control_index){ 3838 3838 3839 3839 int i,ig; … … 3879 3879 /*}}}*/ 3880 3880 /*FUNCTION Tria::GradjDhDtBalancedthickness{{{*/ 3881 void Tria::GradjDhDtBalancedthickness(Vector * gradient,int control_index){3881 void Tria::GradjDhDtBalancedthickness(Vector<IssmDouble>* gradient,int control_index){ 3882 3882 3883 3883 /*Intermediaries*/ … … 3895 3895 /*}}}*/ 3896 3896 /*FUNCTION Tria::GradjVxBalancedthickness{{{*/ 3897 void Tria::GradjVxBalancedthickness(Vector * gradient,int control_index){3897 void Tria::GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index){ 3898 3898 3899 3899 /*Intermediaries*/ … … 3938 3938 /*}}}*/ 3939 3939 /*FUNCTION Tria::GradjVyBalancedthickness{{{*/ 3940 void Tria::GradjVyBalancedthickness(Vector * gradient,int control_index){3940 void Tria::GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index){ 3941 3941 3942 3942 /*Intermediaries*/ … … 5203 5203 /*}}}*/ 5204 5204 /*FUNCTION Tria::GetVectorFromControlInputs{{{*/ 5205 void Tria::GetVectorFromControlInputs(Vector * vector,int control_enum,int control_index,const char* data){5205 void Tria::GetVectorFromControlInputs(Vector<IssmDouble>* vector,int control_enum,int control_index,const char* data){ 5206 5206 5207 5207 int doflist1[NUMVERTICES]; … … 5476 5476 /*}}}*/ 5477 5477 /*FUNCTION Tria::GetSolutionFromInputsHydrology{{{*/ 5478 void Tria::GetSolutionFromInputsHydrology(Vector * solution){5478 void Tria::GetSolutionFromInputsHydrology(Vector<IssmDouble>* solution){ 5479 5479 5480 5480 const int numdof=NDOF1*NUMVERTICES; -
issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h
r13129 r13216 71 71 /*}}}*/ 72 72 /*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); 76 76 void ComputeStressTensor(); 77 77 void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters); 78 78 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); 82 82 void Delta18oParameterization(void); 83 83 int GetNodeIndex(Node* node); … … 88 88 bool IsNodeOnShelfFromFlags(IssmDouble* flags); 89 89 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); 93 93 void InputArtificialNoise(int enum_type,IssmDouble min, IssmDouble max); 94 94 bool InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums); … … 103 103 void MigrateGroundingLine(IssmDouble* oldfloating,IssmDouble* sheet_ungrounding); 104 104 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); 106 106 void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm); 107 107 void RequestedOutput(int output_enum,int step,IssmDouble time); … … 114 114 IssmDouble SurfaceArea(void); 115 115 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); 117 117 IssmDouble TimeAdapt(); 118 118 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); 120 120 121 121 #ifdef _HAVE_RESPONSES_ … … 141 141 IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index); 142 142 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); 155 155 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); 157 157 void ControlInputScaleGradient(int enum_type,IssmDouble scale); 158 158 void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index); … … 212 212 ElementVector* CreatePVectorDiagnosticHutter(void); 213 213 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); 216 216 void InputUpdateFromSolutionDiagnosticHoriz( IssmDouble* solution); 217 217 void InputUpdateFromSolutionDiagnosticHutter( IssmDouble* solution); … … 232 232 ElementVector* CreatePVectorHydrology(void); 233 233 void CreateHydrologyWaterVelocityInput(void); 234 void GetSolutionFromInputsHydrology(Vector * solution);234 void GetSolutionFromInputsHydrology(Vector<IssmDouble>* solution); 235 235 void InputUpdateFromSolutionHydrology(IssmDouble* solution); 236 236 #endif -
issm/trunk-jpl/src/c/classes/objects/ExternalResults/PetscVecExternalResult.h
r12832 r13216 28 28 int id; 29 29 int enum_type; 30 Vector * value;30 Vector<IssmDouble>* value; 31 31 int step; 32 32 IssmDouble time; … … 35 35 /*PetscVecExternalResult constructors, destructors: {{{*/ 36 36 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); 38 38 ~PetscVecExternalResult(); 39 39 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.cpp
r13056 r13216 174 174 /*}}}*/ 175 175 /*FUNCTION BoolInput::GetVectorFromInputs{{{*/ 176 void BoolInput::GetVectorFromInputs(Vector * vector,int* doflist){176 void BoolInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){ 177 177 178 178 _error_("not supporte yet!"); -
issm/trunk-jpl/src/c/classes/objects/Inputs/BoolInput.h
r13056 r13216 78 78 void Extrude(void); 79 79 void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");}; 80 void GetVectorFromInputs(Vector * vector,int* doflist);80 void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist); 81 81 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values); 82 82 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.cpp
r13056 r13216 147 147 }/*}}}*/ 148 148 /*FUNCTION ControlInput::GetGradient{{{*/ 149 void ControlInput::GetGradient(Vector * gradient_vec,int* doflist){149 void ControlInput::GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist){ 150 150 if(gradient) gradient->GetVectorFromInputs(gradient_vec,doflist); 151 151 }/*}}}*/ … … 198 198 return gradient->SpawnResult(step,time); 199 199 }/*}}}*/ 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){{{*/ 201 void ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){ 202 202 values->GetVectorFromInputs(vector,doflist); 203 203 }/*}}}*/ 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){{{*/ 205 void ControlInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist,const char* data){ 206 206 if(strcmp(data,"value")==0){ 207 207 _assert_(values); -
issm/trunk-jpl/src/c/classes/objects/Inputs/ControlInput.h
r13056 r13216 84 84 void Extrude(void); 85 85 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); 88 88 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");}; 89 89 ElementResult* SpawnGradient(int step, IssmDouble time); 90 void GetGradient(Vector * gradient_vec,int* doflist);90 void GetGradient(Vector<IssmDouble>* gradient_vec,int* doflist); 91 91 void ScaleGradient(IssmDouble scale); 92 92 void SetGradient(Input* gradient_in); -
issm/trunk-jpl/src/c/classes/objects/Inputs/DatasetInput.h
r13056 r13216 79 79 void Extrude(void){_error_("not implemented yet");}; 80 80 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");}; 82 82 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not implemented yet");}; 83 83 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");}; 85 85 void ScaleGradient(IssmDouble scale){_error_("not implemented yet");}; 86 86 void SetGradient(Input* gradient_in){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.cpp
r13056 r13216 251 251 /*}}}*/ 252 252 /*FUNCTION DoubleInput::GetVectorFromInputs{{{*/ 253 void DoubleInput::GetVectorFromInputs(Vector * vector,int* doflist){253 void DoubleInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){ 254 254 255 255 _error_("not supporte yet!"); -
issm/trunk-jpl/src/c/classes/objects/Inputs/DoubleInput.h
r13056 r13216 77 77 void Extrude(void){_error_("not supported yet");}; 78 78 void VerticallyIntegrate(Input* thickness_input); 79 void GetVectorFromInputs(Vector * vector,int* doflist);79 void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist); 80 80 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values); 81 81 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Inputs/Input.h
r12704 r13216 58 58 virtual void VerticallyIntegrate(Input* thickness_input)=0; 59 59 virtual void Extrude()=0; 60 virtual void GetVectorFromInputs(Vector * vector,int* doflist)=0;60 virtual void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist)=0; 61 61 virtual void GetValuesPtr(IssmDouble** pvalues,int* pnum_values)=0; 62 62 -
issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.cpp
r13056 r13216 180 180 /*}}}*/ 181 181 /*FUNCTION IntInput::GetVectorFromInputs{{{*/ 182 void IntInput::GetVectorFromInputs(Vector * vector,int* doflist){182 void IntInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){ 183 183 184 184 _error_("not supporte yet!"); -
issm/trunk-jpl/src/c/classes/objects/Inputs/IntInput.h
r13056 r13216 78 78 void Extrude(void){_error_("not supported yet");}; 79 79 void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");}; 80 void GetVectorFromInputs(Vector * vector,int* doflist);80 void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist); 81 81 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values); 82 82 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.cpp
r13056 r13216 609 609 /*}}}*/ 610 610 /*FUNCTION PentaP1Input::GetVectorFromInputs{{{*/ 611 void PentaP1Input::GetVectorFromInputs(Vector * vector,int* doflist){611 void PentaP1Input::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){ 612 612 613 613 const int numvertices=6; -
issm/trunk-jpl/src/c/classes/objects/Inputs/PentaP1Input.h
r13056 r13216 79 79 void Extrude(void); 80 80 void VerticallyIntegrate(Input* thickness_input); 81 void GetVectorFromInputs(Vector * vector,int* doflist);81 void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist); 82 82 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values); 83 83 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.cpp
r13056 r13216 413 413 /*}}}*/ 414 414 /*FUNCTION TransientInput::GetVectorFromInputs{{{*/ 415 void TransientInput::GetVectorFromInputs(Vector * vector,int* doflist){415 void TransientInput::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){ 416 416 417 417 IssmDouble time; -
issm/trunk-jpl/src/c/classes/objects/Inputs/TransientInput.h
r13056 r13216 81 81 void Extrude(void); 82 82 void VerticallyIntegrate(Input* thickness_forcing){_error_("not supported yet");}; 83 void GetVectorFromInputs(Vector * vector,int* doflist);83 void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist); 84 84 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values){_error_("not supported yet");}; 85 85 void GetTimeValues(IssmDouble* values,IssmDouble time){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.cpp
r13056 r13216 340 340 /*}}}*/ 341 341 /*FUNCTION TriaP1Input::GetVectorFromInputs{{{*/ 342 void TriaP1Input::GetVectorFromInputs(Vector * vector,int* doflist){342 void TriaP1Input::GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist){ 343 343 344 344 const int numvertices=3; -
issm/trunk-jpl/src/c/classes/objects/Inputs/TriaP1Input.h
r13056 r13216 79 79 void Extrude(void){_error_("not supported yet");}; 80 80 void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");}; 81 void GetVectorFromInputs(Vector * vector,int* doflist);81 void GetVectorFromInputs(Vector<IssmDouble>* vector,int* doflist); 82 82 void GetValuesPtr(IssmDouble** pvalues,int* pnum_values); 83 83 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp
r13129 r13216 228 228 /*}}}*/ 229 229 /*FUNCTION Icefront::CreateKMatrix {{{*/ 230 void Icefront::CreateKMatrix(Matrix * Kff, Matrix* Kfs){230 void Icefront::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){ 231 231 232 232 /*No stiffness loads applied, do nothing: */ … … 236 236 /*}}}*/ 237 237 /*FUNCTION Icefront::CreatePVector {{{*/ 238 void Icefront::CreatePVector(Vector * pf){238 void Icefront::CreatePVector(Vector<IssmDouble>* pf){ 239 239 240 240 /*Checks in debugging mode*/ … … 274 274 /*}}}*/ 275 275 /*FUNCTION Icefront::CreateJacobianMatrix{{{*/ 276 void Icefront::CreateJacobianMatrix(Matrix * Jff){276 void Icefront::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){ 277 277 this->CreateKMatrix(Jff,NULL); 278 278 } 279 279 /*}}}*/ 280 280 /*FUNCTION Icefront::PenaltyCreateKMatrix {{{*/ 281 void Icefront::PenaltyCreateKMatrix(Matrix * Kff, Matrix* Kfs, IssmDouble kmax){281 void Icefront::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs, IssmDouble kmax){ 282 282 /*do nothing: */ 283 283 return; … … 285 285 /*}}}*/ 286 286 /*FUNCTION Icefront::PenaltyCreatePVector{{{*/ 287 void Icefront::PenaltyCreatePVector(Vector * pf,IssmDouble kmax){287 void Icefront::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){ 288 288 /*do nothing: */ 289 289 return; … … 291 291 /*}}}*/ 292 292 /*FUNCTION Icefront::PenaltyCreateJacobianMatrix{{{*/ 293 void Icefront::PenaltyCreateJacobianMatrix(Matrix * Jff,IssmDouble kmax){293 void Icefront::PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){ 294 294 this->PenaltyCreateKMatrix(Jff,NULL,kmax); 295 295 } -
issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.h
r13036 r13216 69 69 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 70 70 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); 77 77 bool InAnalysis(int analysis_type); 78 78 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Load.h
r12832 r13216 12 12 /*{{{*/ 13 13 class Object; 14 class Matrix;15 class Vector;14 template <class doublematrix> class Matrix; 15 template <class doubletype> class Vector; 16 16 17 17 #include "../Object.h" … … 29 29 virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0; 30 30 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; 37 37 virtual bool InAnalysis(int analysis_type)=0; 38 38 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp
r13036 r13216 251 251 /*}}}*/ 252 252 /*FUNCTION Numericalflux::CreateKMatrix {{{*/ 253 void Numericalflux::CreateKMatrix(Matrix * Kff, Matrix* Kfs){253 void Numericalflux::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){ 254 254 255 255 /*recover some parameters*/ … … 282 282 /*}}}*/ 283 283 /*FUNCTION Numericalflux::CreatePVector {{{*/ 284 void Numericalflux::CreatePVector(Vector * pf){284 void Numericalflux::CreatePVector(Vector<IssmDouble>* pf){ 285 285 286 286 /*recover some parameters*/ … … 312 312 /*}}}*/ 313 313 /*FUNCTION Numericalflux::PenaltyCreateKMatrix {{{*/ 314 void Numericalflux::PenaltyCreateKMatrix(Matrix * Kff, Matrix* Kfs,IssmDouble kmax){314 void Numericalflux::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){ 315 315 316 316 /*No stiffness loads applied, do nothing: */ … … 320 320 /*}}}*/ 321 321 /*FUNCTION Numericalflux::PenaltyCreatePVector{{{*/ 322 void Numericalflux::PenaltyCreatePVector(Vector * pf,IssmDouble kmax){322 void Numericalflux::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){ 323 323 324 324 /*No penalty loads applied, do nothing: */ -
issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h
r13036 r13216 65 65 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 66 66 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); 73 73 bool InAnalysis(int analysis_type); 74 74 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.cpp
r13073 r13216 201 201 /*}}}*/ 202 202 /*FUNCTION Pengrid::CreateKMatrix {{{*/ 203 void Pengrid::CreateKMatrix(Matrix * Kff, Matrix* Kfs){203 void Pengrid::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){ 204 204 205 205 /*No loads applied, do nothing: */ … … 209 209 /*}}}*/ 210 210 /*FUNCTION Pengrid::CreatePVector {{{*/ 211 void Pengrid::CreatePVector(Vector * pf){211 void Pengrid::CreatePVector(Vector<IssmDouble>* pf){ 212 212 213 213 /*No loads applied, do nothing: */ … … 217 217 /*}}}*/ 218 218 /*FUNCTION Pengrid::PenaltyCreateMatrix {{{*/ 219 void Pengrid::PenaltyCreateKMatrix(Matrix * Kff, Matrix* Kfs,IssmDouble kmax){219 void Pengrid::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){ 220 220 221 221 /*Retrieve parameters: */ … … 250 250 /*}}}*/ 251 251 /*FUNCTION Pengrid::PenaltyCreatePVector {{{*/ 252 void Pengrid::PenaltyCreatePVector(Vector * pf,IssmDouble kmax){252 void Pengrid::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){ 253 253 254 254 /*Retrieve parameters: */ -
issm/trunk-jpl/src/c/classes/objects/Loads/Pengrid.h
r13036 r13216 70 70 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 71 71 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); 78 78 bool InAnalysis(int analysis_type); 79 79 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.cpp
r13036 r13216 136 136 /*}}}*/ 137 137 /*FUNCTION Penpair::CreateKMatrix {{{*/ 138 void Penpair::CreateKMatrix(Matrix * Kff, Matrix* Kfs){138 void Penpair::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){ 139 139 /*If you code this piece, don't forget that a penalty will be inactive if it is dealing with clone nodes*/ 140 140 /*No loads applied, do nothing: */ … … 144 144 /*}}}*/ 145 145 /*FUNCTION Penpair::CreatePVector {{{*/ 146 void Penpair::CreatePVector(Vector * pf){146 void Penpair::CreatePVector(Vector<IssmDouble>* pf){ 147 147 148 148 /*No loads applied, do nothing: */ … … 152 152 /*}}}*/ 153 153 /*FUNCTION Penpair::CreateJacobianMatrix{{{*/ 154 void Penpair::CreateJacobianMatrix(Matrix * Jff){154 void Penpair::CreateJacobianMatrix(Matrix<IssmDouble>* Jff){ 155 155 this->CreateKMatrix(Jff,NULL); 156 156 } 157 157 /*}}}*/ 158 158 /*FUNCTION Penpair::PenaltyCreateKMatrix {{{*/ 159 void Penpair::PenaltyCreateKMatrix(Matrix * Kff, Matrix* Kfs,IssmDouble kmax){159 void Penpair::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){ 160 160 161 161 /*Retrieve parameters: */ … … 183 183 /*}}}*/ 184 184 /*FUNCTION Penpair::PenaltyCreatePVector {{{*/ 185 void Penpair::PenaltyCreatePVector(Vector * pf,IssmDouble kmax){185 void Penpair::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){ 186 186 /*No loads applied, do nothing: */ 187 187 return; … … 189 189 /*}}}*/ 190 190 /*FUNCTION Penpair::PenaltyCreateJacobianMatrix{{{*/ 191 void Penpair::PenaltyCreateJacobianMatrix(Matrix * Jff,IssmDouble kmax){191 void Penpair::PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){ 192 192 this->PenaltyCreateKMatrix(Jff,NULL,kmax); 193 193 } -
issm/trunk-jpl/src/c/classes/objects/Loads/Penpair.h
r13036 r13216 57 57 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 58 58 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); 65 65 bool InAnalysis(int analysis_type); 66 66 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.cpp
r13073 r13216 309 309 /*}}}*/ 310 310 /*FUNCTION Riftfront::PenaltyCreateKMatrix {{{*/ 311 void Riftfront::PenaltyCreateKMatrix(Matrix * Kff, Matrix* Kfs,IssmDouble kmax){311 void Riftfront::PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,IssmDouble kmax){ 312 312 313 313 /*Retrieve parameters: */ … … 335 335 /*}}}*/ 336 336 /*FUNCTION Riftfront::PenaltyCreatePVector {{{*/ 337 void Riftfront::PenaltyCreatePVector(Vector * pf,IssmDouble kmax){337 void Riftfront::PenaltyCreatePVector(Vector<IssmDouble>* pf,IssmDouble kmax){ 338 338 339 339 /*Retrieve parameters: */ … … 361 361 /*}}}*/ 362 362 /*FUNCTION Riftfront::CreateKMatrix {{{*/ 363 void Riftfront::CreateKMatrix(Matrix * Kff, Matrix* Kfs){363 void Riftfront::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){ 364 364 /*do nothing: */ 365 365 return; … … 367 367 /*}}}*/ 368 368 /*FUNCTION Riftfront::CreatePVector {{{*/ 369 void Riftfront::CreatePVector(Vector * pf){369 void Riftfront::CreatePVector(Vector<IssmDouble>* pf){ 370 370 /*do nothing: */ 371 371 return; -
issm/trunk-jpl/src/c/classes/objects/Loads/Riftfront.h
r13036 r13216 77 77 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 78 78 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); 85 85 bool InAnalysis(int analysis_type); 86 86 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Materials/Matdamageice.cpp
r13168 r13216 193 193 /*}}}*/ 194 194 /*FUNCTION Matdamageice::GetVectorFromInputs{{{*/ 195 void Matdamageice::GetVectorFromInputs(Vector * vector,int input_enum){195 void Matdamageice::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){ 196 196 197 197 /*Intermediaries*/ -
issm/trunk-jpl/src/c/classes/objects/Materials/Matdamageice.h
r13130 r13216 49 49 void InputDuplicate(int original_enum,int new_enum); 50 50 void Configure(Elements* elements); 51 void GetVectorFromInputs(Vector * vector,int input_enum);51 void GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum); 52 52 void SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin); 53 53 void GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon); -
issm/trunk-jpl/src/c/classes/objects/Materials/Material.h
r13129 r13216 24 24 virtual void InputDuplicate(int original_enum,int new_enum)=0; 25 25 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; 27 27 virtual void GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon)=0; 28 28 virtual void GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon)=0; -
issm/trunk-jpl/src/c/classes/objects/Materials/Matice.cpp
r13129 r13216 173 173 /*}}}*/ 174 174 /*FUNCTION Matice::GetVectorFromInputs{{{*/ 175 void Matice::GetVectorFromInputs(Vector * vector,int input_enum){175 void Matice::GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){ 176 176 177 177 /*Intermediaries*/ -
issm/trunk-jpl/src/c/classes/objects/Materials/Matice.h
r13129 r13216 49 49 void InputDuplicate(int original_enum,int new_enum); 50 50 void Configure(Elements* elements); 51 void GetVectorFromInputs(Vector * vector,int input_enum);51 void GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum); 52 52 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 53 53 void GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon); -
issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h
r13129 r13216 67 67 void InputDuplicate(int original_enum,int new_enum){_error_("not implemented yet");}; 68 68 void Configure(Elements* elements); 69 void GetVectorFromInputs(Vector * vector,int input_enum){return;}69 void GetVectorFromInputs(Vector<IssmDouble>* vector,int input_enum){return;} 70 70 void GetViscosity2d(IssmDouble* pviscosity, IssmDouble* pepsilon){_error_("not supported");}; 71 71 void GetViscosity3d(IssmDouble* pviscosity3d, IssmDouble* pepsilon){_error_("not supported");}; -
issm/trunk-jpl/src/c/classes/objects/Node.cpp
r13073 r13216 487 487 /*}}}*/ 488 488 /*FUNCTION Node::CreateVecSets {{{*/ 489 void Node::CreateVecSets(Vector * pv_g,Vector* pv_f,Vector* pv_s){489 void Node::CreateVecSets(Vector<IssmDouble>* pv_g,Vector<IssmDouble>* pv_f,Vector<IssmDouble>* pv_s){ 490 490 491 491 IssmDouble gvalue=1.0; //all nodes are in the g set; … … 513 513 /*}}}*/ 514 514 /*FUNCTION Node::CreateNodalConstraints{{{*/ 515 void Node::CreateNodalConstraints(Vector * ys){515 void Node::CreateNodalConstraints(Vector<IssmDouble>* ys){ 516 516 517 517 int i; … … 794 794 /*}}}*/ 795 795 /*FUNCTION Node::VecMerge {{{*/ 796 void Node::VecMerge(Vector * ug, IssmDouble* vector_serial,int setenum){796 void Node::VecMerge(Vector<IssmDouble>* ug, IssmDouble* vector_serial,int setenum){ 797 797 798 798 IssmDouble* values=NULL; … … 845 845 /*}}}*/ 846 846 /*FUNCTION Node::VecReduce {{{*/ 847 void Node::VecReduce(Vector * vector, IssmDouble* ug_serial,int setenum){847 void Node::VecReduce(Vector<IssmDouble>* vector, IssmDouble* ug_serial,int setenum){ 848 848 849 849 IssmDouble* values=NULL; -
issm/trunk-jpl/src/c/classes/objects/Node.h
r13036 r13216 16 16 class DataSet; 17 17 class Vertices; 18 class Vector;19 class Matrix;18 template <class doubletype> class Vector; 19 template <class doubletype> class Matrix; 20 20 #include "../Update.h" 21 21 /*}}}*/ … … 64 64 /*Node numerical routines {{{*/ 65 65 void Configure(DataSet* nodes,Vertices* vertices); 66 void CreateNodalConstraints(Vector * ys);66 void CreateNodalConstraints(Vector<IssmDouble>* ys); 67 67 void SetCurrentConfiguration(DataSet* nodes,Vertices* vertices); 68 68 int Sid(void); … … 82 82 void DofInFSet(int dof); 83 83 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); 85 85 int GetConnectivity(); 86 86 void GetDofList(int* poutdoflist,int approximation_enum,int setenum); … … 98 98 int IsGrounded(); 99 99 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); 102 102 103 103 /*}}}*/ -
issm/trunk-jpl/src/c/classes/objects/Options/Option.h
r13036 r13216 18 18 public: 19 19 20 char* name; 21 int numel; 22 int ndims; 23 int* size; 24 20 25 21 /*Option constructors, destructors {{{*/ 26 Option() ;27 ~Option() ;22 Option(){}; 23 ~Option(){}; 28 24 /*}}}*/ 25 29 26 /*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; 33 30 int Id(){_error_("Not implemented yet");}; 34 31 int MyRank(){_error_("Not implemented yet");}; … … 42 39 virtual int NDims()=0; 43 40 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;52 41 53 42 }; -
issm/trunk-jpl/src/c/classes/objects/Params/BoolParam.h
r13129 r13216 53 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 54 54 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");} 57 57 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 58 58 … … 66 66 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 67 67 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");} 70 70 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 71 71 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 56 56 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a IssmDouble array");} 57 57 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");} 60 60 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << "cannot return a FILE");} 61 61 … … 69 69 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << "cannot hold a int vec array");} 70 70 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");} 73 73 void SetValue(FILE* fid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");} 74 74 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array); -
issm/trunk-jpl/src/c/classes/objects/Params/DoubleMatParam.h
r13036 r13216 55 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN); 56 56 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");} 59 59 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 60 60 … … 68 68 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");} 69 69 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");} 72 72 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 73 73 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 54 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN); 55 55 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");} 58 58 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 59 59 … … 67 67 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 68 68 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");} 71 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 72 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 54 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN); 55 55 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");} 58 58 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 59 59 … … 67 67 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int mat array");}; 68 68 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");} 71 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 72 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 53 53 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 54 54 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");} 57 57 void GetParameterValue(FILE** pfid){*pfid=value;}; 58 58 … … 66 66 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 67 67 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");} 70 70 void SetValue(FILE* fid){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");} 71 71 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 47 47 _printLine_(" value: " << myP);; 48 48 } 49 49 void Echo() {DeepEcho();}; 50 50 int Id(){ return -1; }; 51 51 int MyRank() { extern int my_rank; return my_rank;} ; … … 77 77 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a IssmDouble array");} 78 78 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");} 81 81 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot return a FILE");} 82 82 … … 90 90 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a IssmDouble array");} 91 91 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");} 94 94 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a FILE");} 95 95 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 55 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a matrix array");}; 56 56 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");} 59 59 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 60 60 … … 68 68 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int vec array");}; 69 69 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");} 72 72 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 73 73 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 54 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 55 55 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");} 58 58 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 59 59 … … 67 67 void SetValue(IssmDouble* IssmDoublearray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a IssmDouble array");} 68 68 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");} 71 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 72 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 55 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 56 56 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");} 59 59 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 60 60 … … 68 68 void SetValue(int* intarray,int M); 69 69 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");} 72 72 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 73 73 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 26 26 } 27 27 /*}}}*/ 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){{{*/ 29 MatrixParam::MatrixParam(int in_enum_type,Matrix<IssmDouble>* in_value){ 30 30 31 31 enum_type=in_enum_type; … … 87 87 /*MatrixParam virtual functions definitions: */ 88 88 /*FUNCTION MatrixParam::GetParameterValue{{{*/ 89 void MatrixParam::GetParameterValue(Matrix ** poutput){90 Matrix * output=NULL;89 void MatrixParam::GetParameterValue(Matrix<IssmDouble>** poutput){ 90 Matrix<IssmDouble>* output=NULL; 91 91 92 92 if(value){ … … 102 102 /*}}}*/ 103 103 /*FUNCTION MatrixParam::SetValue{{{*/ 104 void MatrixParam::SetValue(Matrix * matrix){104 void MatrixParam::SetValue(Matrix<IssmDouble>* matrix){ 105 105 106 106 /*avoid leak: */ -
issm/trunk-jpl/src/c/classes/objects/Params/MatrixParam.h
r13036 r13216 25 25 /*just hold 3 values for 3 vertices: */ 26 26 int enum_type; 27 Matrix * value;27 Matrix<IssmDouble>* value; 28 28 29 29 public: 30 30 /*MatrixParam constructors, destructors: {{{*/ 31 31 MatrixParam(); 32 MatrixParam(int enum_type,Matrix * value);32 MatrixParam(int enum_type,Matrix<IssmDouble>* value); 33 33 ~MatrixParam(); 34 34 /*}}}*/ … … 54 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 55 55 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); 58 58 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 59 59 … … 67 67 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 68 68 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); 71 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 72 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 38 38 virtual void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN)=0; 39 39 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; 42 42 virtual void GetParameterValue(FILE** pfid)=0; 43 43 … … 51 51 virtual void SetValue(int* intarray,int M)=0; 52 52 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; 55 55 virtual void SetValue(FILE* fid)=0; 56 56 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 56 56 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 57 57 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");} 60 60 void GetParameterValue(FILE** pfid){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a FILE");} 61 61 … … 69 69 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 70 70 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");} 73 73 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 74 74 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 54 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 55 55 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");} 58 58 void GetParameterValue(FILE** pfid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");} 59 59 … … 67 67 void SetValue(int* intarray,int M){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a int array");} 68 68 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");} 71 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 72 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 55 55 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM,int* pN){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 56 56 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");} 59 59 void GetParameterValue(FILE** pfid){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot return a FILE");} 60 60 … … 68 68 void SetValue(int* intarray,int M){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a int vec array");} 69 69 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");} 72 72 void SetValue(FILE* fid){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");} 73 73 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 27 27 /*}}}*/ 28 28 /*FUNCTION VectorParam::VectorParam(int enum_type,IssmVector value){{{*/ 29 VectorParam::VectorParam(int in_enum_type,Vector * in_value){29 VectorParam::VectorParam(int in_enum_type,Vector<IssmDouble>* in_value){ 30 30 31 31 enum_type=in_enum_type; … … 89 89 /*VectorParam virtual functions definitions: */ 90 90 /*FUNCTION VectorParam::GetParameterValue{{{*/ 91 void VectorParam::GetParameterValue(Vector ** poutput){92 Vector * output=NULL;91 void VectorParam::GetParameterValue(Vector<IssmDouble>** poutput){ 92 Vector<IssmDouble>* output=NULL; 93 93 94 94 if(value){ … … 105 105 /*}}}*/ 106 106 /*FUNCTION VectorParam::SetValue{{{*/ 107 void VectorParam::SetValue(Vector * vector){107 void VectorParam::SetValue(Vector<IssmDouble>* vector){ 108 108 109 109 /*avoid leak: */ -
issm/trunk-jpl/src/c/classes/objects/Params/VectorParam.h
r13036 r13216 25 25 /*just hold 3 values for 3 vertices: */ 26 26 int enum_type; 27 Vector * value;27 Vector<IssmDouble>* value; 28 28 29 29 public: 30 30 /*VectorParam constructors, destructors: {{{*/ 31 31 VectorParam(); 32 VectorParam(int enum_type,Vector * value);32 VectorParam(int enum_type,Vector<IssmDouble>* value); 33 33 ~VectorParam(); 34 34 /*}}}*/ … … 54 54 void GetParameterValue(IssmDouble** pIssmDoublearray,int* pM, int* pN){_error_("Param "<< EnumToStringx(enum_type) << " cannot return a IssmDouble array");} 55 55 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); 58 58 void GetParameterValue(FILE** pfid){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot return a FILE");} 59 59 … … 67 67 void SetValue(int* intarray,int M){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a int array");} 68 68 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");} 71 71 void SetValue(FILE* fid){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");} 72 72 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 199 199 /*}}}*/ 200 200 /*FUNCTION Vertex::UpdateVertexPosition {{{*/ 201 void Vertex::UpdatePosition(Vector * vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed){201 void Vertex::UpdatePosition(Vector<IssmDouble>* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed){ 202 202 203 203 IssmDouble oldz,newz; -
issm/trunk-jpl/src/c/classes/objects/Vertex.h
r12832 r13216 10 10 #include "../classes.h" 11 11 class IoModel; 12 class Vector;12 template <class doubletype> class Vector; 13 13 class Parameters; 14 14 #include "../../shared/Exceptions/exceptions.h" … … 60 60 int Sid(void); 61 61 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); 63 63 /*}}}*/ 64 64 }; -
issm/trunk-jpl/src/c/classes/objects/objects.h
r13185 r13216 70 70 /*Option parsing objects: */ 71 71 #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" 77 73 #include "./Options/OptionUtilities.h" 78 74 -
issm/trunk-jpl/src/c/io/Disk/diskio.h
r12832 r13216 6 6 #define _DISK_IO_H_ 7 7 8 #include "../../classes/objects/objects.h" 9 #include "../../Container/Container.h" 10 #include "../../include/include.h" 8 #include <stdio.h> 11 9 12 10 FILE* pfopen(char* filename,const char* format); -
issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
r13056 r13216 481 481 482 482 /*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){{{*/ 484 void FetchData(Matrix<double>** pmatrix,const mxArray* dataref){ 485 486 Matrix<double>* outmatrix=NULL; 487 487 int dummy=0; 488 488 … … 502 502 } 503 503 /*}}}*/ 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){{{*/ 505 void FetchData(Vector<double>** pvector,const mxArray* dataref){ 506 507 Vector<double>* vector=NULL; 508 508 int dummy; 509 509 510 510 if(mxIsEmpty(dataref)){ 511 511 /*Nothing to pick up. Just initialize matrix pointer to NULL: */ 512 vector=new Vector (0);512 vector=new Vector<double>(0); 513 513 } 514 514 else if (mxIsClass(dataref,"double") ){ -
issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToMatrix.cpp
r12850 r13216 22 22 /*}}}*/ 23 23 24 Matrix * MatlabMatrixToMatrix(const mxArray* mxmatrix){24 Matrix<double>* MatlabMatrixToMatrix(const mxArray* mxmatrix){ 25 25 26 26 int dummy; 27 Matrix * matrix=NULL;27 Matrix<double>* matrix=NULL; 28 28 29 29 /*allocate matrix object: */ 30 matrix=new Matrix ();30 matrix=new Matrix<double>(); 31 31 32 32 #ifdef _HAVE_PETSC_ -
issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToSeqMat.cpp
r12365 r13216 19 19 /*}}}*/ 20 20 21 SeqMat * MatlabMatrixToSeqMat(const mxArray* dataref){21 SeqMat<double>* MatlabMatrixToSeqMat(const mxArray* dataref){ 22 22 23 SeqMat * output=NULL;23 SeqMat<double>* output=NULL; 24 24 25 output=new SeqMat ();25 output=new SeqMat<double>(); 26 26 MatlabMatrixToDoubleMatrix(&output->matrix,&output->M,&output->N,dataref); 27 27 return output; -
issm/trunk-jpl/src/c/matlab/io/MatlabVectorToSeqVec.cpp
r12365 r13216 19 19 /*}}}*/ 20 20 21 SeqVec * MatlabVectorToSeqVec(const mxArray* dataref){21 SeqVec<double>* MatlabVectorToSeqVec(const mxArray* dataref){ 22 22 23 SeqVec * output=NULL;23 SeqVec<double>* output=NULL; 24 24 25 output=new SeqVec ();25 output=new SeqVec<double>(); 26 26 MatlabVectorToDoubleVector(&output->vector,&output->M,dataref); 27 27 return output; -
issm/trunk-jpl/src/c/matlab/io/MatlabVectorToVector.cpp
r12850 r13216 22 22 /*}}}*/ 23 23 24 Vector * MatlabVectorToVector(const mxArray* mxvector){24 Vector<double>* MatlabVectorToVector(const mxArray* mxvector){ 25 25 26 26 int dummy; 27 Vector * vector=NULL;27 Vector<double>* vector=NULL; 28 28 29 29 /*allocate vector object: */ 30 vector=new Vector ();30 vector=new Vector<double>(); 31 31 32 32 #ifdef _HAVE_PETSC_ -
issm/trunk-jpl/src/c/matlab/io/OptionParse.cpp
r13056 r13216 15 15 #include "./matlabio.h" 16 16 17 /*FUNCTION OptionDoubleParse {{{*/ 18 OptionDouble* OptionDoubleParse( char* name, const mxArray* prhs[]){ 17 GenericOption<double*>* OptionDoubleParse( char* name, const mxArray* prhs[]){ /*{{{*/ 19 18 20 OptionDouble*odouble = NULL;19 GenericOption<double*> *odouble = NULL; 21 20 22 21 /*check and parse the name */ 23 odouble=new OptionDouble;22 odouble=new GenericOption<double*>(); 24 23 odouble->name =xNew<char>(strlen(name)+1); 25 24 memcpy(odouble->name,name,(strlen(name)+1)*sizeof(char)); … … 29 28 _error_("Value of option \"" << odouble->name << "\" must be class \"double\", not class \"" << mxGetClassName(prhs[0]) <<"\"."); 30 29 } 31 FetchData(&odouble->value s,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]);30 FetchData(&odouble->value,&odouble->numel,&odouble->ndims,&odouble->size,prhs[0]); 32 31 33 32 return(odouble); 34 33 }/*}}}*/ 35 /*FUNCTION OptionLogicalParse {{{*/ 36 OptionLogical* OptionLogicalParse( char* name, const mxArray* prhs[]){ 34 GenericOption<bool*>* OptionLogicalParse( char* name, const mxArray* prhs[]){ /*{{{*/ 37 35 38 OptionLogical*ological = NULL;36 GenericOption<bool*> *ological = NULL; 39 37 40 38 /*check and parse the name */ 41 ological=new OptionLogical;39 ological=new GenericOption<bool*>(); 42 40 ological->name =xNew<char>(strlen(name)+1); 43 41 memcpy(ological->name,name,(strlen(name)+1)*sizeof(char)); … … 47 45 _error_("Value of option \"" << ological->name << "\" must be class \"logical\", not class \"" << mxGetClassName(prhs[0]) <<"\"."); 48 46 } 49 FetchData(&ological->value s,&ological->numel,&ological->ndims,&ological->size,prhs[0]);47 FetchData(&ological->value,&ological->numel,&ological->ndims,&ological->size,prhs[0]); 50 48 51 49 return(ological); 52 50 }/*}}}*/ 53 /*FUNCTION OptionCharParse {{{*/ 54 OptionChar* OptionCharParse( char* name, const mxArray* prhs[]){ 51 GenericOption<char*>* OptionCharParse( char* name, const mxArray* prhs[]){ /*{{{*/ 55 52 56 OptionChar*ochar = NULL;53 GenericOption<char*> *ochar = NULL; 57 54 58 55 /*check and parse the name */ 59 ochar=new OptionChar();56 ochar=new GenericOption<char*>(); 60 57 ochar->name =xNew<char>(strlen(name)+1); 61 58 memcpy(ochar->name,name,(strlen(name)+1)*sizeof(char)); … … 65 62 _error_("Value of option \"" << ochar->name << "\" must be class \"char\", not class \"" << mxGetClassName(prhs[0]) <<"\"."); 66 63 } 67 FetchData(&ochar->value s,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]);64 FetchData(&ochar->value,&ochar->numel,&ochar->ndims,&ochar->size,prhs[0]); 68 65 69 66 return(ochar); 70 67 }/*}}}*/ 71 /*FUNCTION OptionStructParse {{{*/ 72 OptionStruct* OptionStructParse( char* name, const mxArray* prhs[]){ 68 GenericOption<Options**>* OptionStructParse( char* name, const mxArray* prhs[]){ /*{{{*/ 73 69 74 70 int i; 75 71 char namei[161]; 76 Option Struct *ostruct= NULL;77 Option *option= NULL;72 Option* option = NULL; 73 GenericOption<Options**> *ostruct = NULL; 78 74 const mwSize *ipt = NULL; 79 75 const mxArray *structi; … … 81 77 82 78 /*check and parse the name */ 83 ostruct=new OptionStruct;79 ostruct=new GenericOption<Options**>(); 84 80 ostruct->name =xNew<char>(strlen(name)+1); 85 81 memcpy(ostruct->name,name,(strlen(name)+1)*sizeof(char)); … … 94 90 ostruct->size =xNew<int>(ostruct->ndims); 95 91 for (i=0; i<ostruct->ndims; i++) ostruct->size[i]=(int)ipt[i]; 96 if (ostruct->numel) ostruct->value s=xNew<Options*>(ostruct->numel);92 if (ostruct->numel) ostruct->value=xNew<Options*>(ostruct->numel); 97 93 98 94 /*loop through and process each element of the struct array */ 99 95 for (sindex=0; sindex<ostruct->numel; sindex++) { 100 ostruct->value s[sindex]=new Options;96 ostruct->value[sindex]=new Options; 101 97 102 98 /*loop through and process each field for the element */ … … 106 102 107 103 option=(Option*)OptionParse(namei,&structi); 108 ostruct->value s[sindex]->AddObject((Object*)option);104 ostruct->value[sindex]->AddObject((Object*)option); 109 105 option=NULL; 110 106 } … … 113 109 return(ostruct); 114 110 }/*}}}*/ 115 /*FUNCTION OptionCellParse {{{*/ 116 OptionCell* OptionCellParse( char* name, const mxArray* prhs[]){ 111 GenericOption<Options*>* OptionCellParse( char* name, const mxArray* prhs[]){ /*{{{*/ 117 112 118 113 int i; … … 120 115 char namei[161]; 121 116 char cstr[81]; 122 OptionCell*ocell = NULL;117 GenericOption<Options*> *ocell = NULL; 123 118 Option *option = NULL; 124 119 const mwSize *ipt = NULL; … … 127 122 128 123 /*check and parse the name */ 129 ocell=new OptionCell;124 ocell=new GenericOption<Options*>(); 130 125 ocell->name =xNew<char>(strlen(name)+1); 131 126 memcpy(ocell->name,name,(strlen(name)+1)*sizeof(char)); … … 141 136 ocell->size =xNew<int>(ocell->ndims); 142 137 for (i=0; i<ocell->ndims; i++) ocell->size[i]=(int)ipt[i]; 143 ocell->value s=new Options;138 ocell->value=new Options; 144 139 145 140 /*loop through and process each element of the cell array */ … … 156 151 157 152 option=(Option*)OptionParse(namei,&celli); 158 ocell->value s->AddObject((Object*)option);153 ocell->value->AddObject((Object*)option); 159 154 option=NULL; 160 155 } … … 163 158 return(ocell); 164 159 }/*}}}*/ 165 /*FUNCTION OptionParse{{{*/ 166 Option* OptionParse(char* name, const mxArray* prhs[]){ 160 Option* OptionParse(char* name, const mxArray* prhs[]){ /*{{{*/ 167 161 168 162 Option *option = NULL; -
issm/trunk-jpl/src/c/matlab/io/WriteMatlabData.cpp
r12850 r13216 217 217 /*}}}*/ 218 218 /*FUNCTION WriteData(mxArray** pdataref,Matrix* matrix){{{*/ 219 void WriteData(mxArray** pdataref,Matrix * matrix){219 void WriteData(mxArray** pdataref,Matrix<double>* matrix){ 220 220 221 221 int i,j; … … 255 255 } 256 256 /*}}}*/ 257 /*FUNCTION WriteData(mxArray** pdataref,Vector * vector){{{*/258 void WriteData(mxArray** pdataref,Vector * vector){257 /*FUNCTION WriteData(mxArray** pdataref,Vector<double>* vector){{{*/ 258 void WriteData(mxArray** pdataref,Vector<double>* vector){ 259 259 260 260 mxArray* dataref=NULL; -
issm/trunk-jpl/src/c/matlab/io/matlabio.h
r12850 r13216 18 18 #include <mex.h> 19 19 20 void WriteData(mxArray** pdataref,Matrix * matrix);20 void WriteData(mxArray** pdataref,Matrix<double>* matrix); 21 21 void WriteData(mxArray** pdataref,double* matrix, int M,int N); 22 22 void WriteData(mxArray** pdataref,int* matrix, int M,int N); 23 void WriteData(mxArray** pdataref,Vector * vector);23 void WriteData(mxArray** pdataref,Vector<double>* vector); 24 24 void WriteData(mxArray** pdataref,double* vector, int M); 25 25 void WriteData(mxArray** pdataref,int integer); … … 35 35 void FetchData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref); 36 36 void FetchData(bool** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref); 37 void FetchData(Matrix ** pmatrix,const mxArray* dataref);37 void FetchData(Matrix<double>** pmatrix,const mxArray* dataref); 38 38 void FetchData(int** pvector,int* pM,const mxArray* dataref); 39 39 void FetchData(float** pvector,int* pM,const mxArray* dataref); 40 40 void FetchData(double** pvector,int* pM,const mxArray* dataref); 41 41 void FetchData(bool** pvector,int* pM,const mxArray* dataref); 42 void FetchData(Vector ** pvector,const mxArray* dataref);42 void FetchData(Vector<double>** pvector,const mxArray* dataref); 43 43 void FetchData(char** pstring,const mxArray* dataref); 44 44 void FetchData(char** pmatrix,int* pnumel,int* pndims,int** psize,const mxArray* dataref); … … 52 52 53 53 Option* 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[]);54 GenericOption<double*>* OptionDoubleParse( char* name, const mxArray* prhs[]); 55 GenericOption<bool*>* OptionLogicalParse( char* name, const mxArray* prhs[]); 56 GenericOption<char*>* OptionCharParse( char* name, const mxArray* prhs[]); 57 GenericOption<Options**>* OptionStructParse( char* name, const mxArray* prhs[]); 58 GenericOption<Options*>* OptionCellParse( char* name, const mxArray* prhs[]); 59 59 60 60 mxArray* mxGetAssignedField(const mxArray* pmxa_array,int number, const char* field); … … 63 63 64 64 /*Matlab to Matrix routines: */ 65 Matrix * MatlabMatrixToMatrix(const mxArray* mxmatrix);66 Vector * MatlabVectorToVector(const mxArray* mxvector);65 Matrix<double>* MatlabMatrixToMatrix(const mxArray* mxmatrix); 66 Vector<double>* MatlabVectorToVector(const mxArray* mxvector); 67 67 68 68 /*Matlab to double* routines: */ … … 74 74 75 75 /*Matlab to SeqMat routines: */ 76 SeqMat * MatlabMatrixToSeqMat(const mxArray* dataref);77 SeqVec * MatlabVectorToSeqVec(const mxArray* dataref);76 SeqMat<double>* MatlabMatrixToSeqMat(const mxArray* dataref); 77 SeqVec<double>* MatlabVectorToSeqVec(const mxArray* dataref); 78 78 79 79 /*Matlab to Petsc routines: */ -
issm/trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp
r12453 r13216 29 29 30 30 /*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; 34 34 double* average=NULL; 35 35 … … 44 44 45 45 /*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); 49 49 50 50 /*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 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ComputeBasalStressx( Vector ** psigma,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){12 void ComputeBasalStressx( Vector<IssmDouble>** psigma,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){ 13 13 14 14 /*Intermediary*/ … … 19 19 20 20 /*output: */ 21 Vector * sigma=NULL;21 Vector<IssmDouble>* sigma=NULL; 22 22 23 23 /*Recover numberofelements: */ … … 25 25 26 26 /*Allocate sigma on numberofelements: */ 27 sigma=new Vector (reCast<int>(numberofelements));27 sigma=new Vector<IssmDouble>(reCast<int>(numberofelements)); 28 28 29 29 /*Compute basal stress for each element: */ -
issm/trunk-jpl/src/c/modules/ComputeBasalStressx/ComputeBasalStressx.h
r12832 r13216 10 10 11 11 /* local prototypes: */ 12 void ComputeBasalStressx( Vector ** pp_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters);12 void ComputeBasalStressx( Vector<IssmDouble>** pp_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters); 13 13 14 14 #endif /* _COMPUTEBASALSTRESSX_H */ -
issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.cpp
r11695 r13216 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ComputeStrainRatex( Vector ** peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){12 void ComputeStrainRatex( Vector<IssmDouble>** peps,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,Parameters* parameters){ 13 13 14 14 /*Intermediary*/ … … 19 19 20 20 /*output: */ 21 Vector * eps=NULL;21 Vector<IssmDouble>* eps=NULL; 22 22 23 23 /*Recover numberofelements: */ … … 25 25 26 26 /*Allocate eps on numberofelements (only 1 dof): */ 27 eps=new Vector (numberofelements);27 eps=new Vector<IssmDouble>(numberofelements); 28 28 29 29 /*Compute basal stress for each element: */ -
issm/trunk-jpl/src/c/modules/ComputeStrainRatex/ComputeStrainRatex.h
r12832 r13216 10 10 11 11 /* local prototypes: */ 12 void ComputeStrainRatex(Vector ** eps_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters);12 void ComputeStrainRatex(Vector<IssmDouble>** eps_g,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters); 13 13 14 14 #endif /* _COMPUTESTRAINRATEX_H */ -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp
r12450 r13216 11 11 #include "./ContourToMeshx.h" 12 12 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) {13 int 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) { 14 14 15 15 int noerr=1; … … 30 30 31 31 /*output: */ 32 Vector * in_nod=NULL;33 Vector * in_elem=NULL;32 Vector<IssmDouble>* in_nod=NULL; 33 Vector<IssmDouble>* in_elem=NULL; 34 34 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); 37 37 38 38 /*initialize thread parameters: */ -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h
r12832 r13216 16 16 int nods; 17 17 int edgevalue; 18 Vector * in_nod;18 Vector<IssmDouble>* in_nod; 19 19 double* x; 20 20 double* y; … … 24 24 25 25 /* 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);26 int 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); 27 27 28 28 void* ContourToMeshxt(void* vContourToMeshxThreadStruct); -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
r12127 r13216 33 33 double* x=NULL; 34 34 double* y=NULL; 35 Vector * in_nod=NULL;35 Vector<IssmDouble>* in_nod=NULL; 36 36 37 37 -
issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
r12121 r13216 4 4 #include "./ContourToNodesx.h" 5 5 6 int ContourToNodesx( Vector ** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){6 int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue){ 7 7 8 8 int i; … … 17 17 18 18 /*output: */ 19 Vector * flags=NULL;19 Vector<IssmDouble>* flags=NULL; 20 20 21 flags=new Vector (nods);21 flags=new Vector<IssmDouble>(nods); 22 22 23 23 /*Loop through all contours: */ … … 39 39 } 40 40 41 int ContourToNodesx( Vector ** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){41 int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){ 42 42 43 43 int i; … … 52 52 53 53 /*output: */ 54 Vector * flags=NULL;54 Vector<IssmDouble>* flags=NULL; 55 55 56 flags=new Vector (nods);56 flags=new Vector<IssmDouble>(nods); 57 57 58 58 /*Loop through all contours: */ -
issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h
r12832 r13216 11 11 12 12 /* 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);13 int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue); 14 int ContourToNodesx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue); 15 15 16 16 #endif /* _CONTOURTONODESX_H */ -
issm/trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp
r12450 r13216 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void ControlInputGetGradientx( Vector ** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){11 void ControlInputGetGradientx( Vector<IssmDouble>** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){ 12 12 13 13 /*Intermediaries*/ 14 14 int num_controls; 15 15 int *control_type = NULL; 16 Vector * gradient=NULL;16 Vector<IssmDouble>* gradient=NULL; 17 17 18 18 /*Retrieve some parameters*/ … … 21 21 22 22 /*Allocate and populate gradient*/ 23 gradient=new Vector (num_controls*vertices->NumberOfVertices());23 gradient=new Vector<IssmDouble>(num_controls*vertices->NumberOfVertices()); 24 24 25 25 for(int i=0;i<num_controls;i++){ -
issm/trunk-jpl/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h
r12832 r13216 8 8 #include "../../Container/Container.h" 9 9 10 void ControlInputGetGradientx( Vector ** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters);10 void ControlInputGetGradientx( Vector<IssmDouble>** pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters); 11 11 12 12 #endif -
issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp
r13073 r13216 30 30 31 31 } 32 void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector * gradient){32 void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* gradient){ 33 33 34 34 /*Serialize gradient*/ -
issm/trunk-jpl/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h
r12832 r13216 9 9 10 10 void 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);11 void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* gradient); 12 12 13 13 #endif -
issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp
r12470 r13216 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void CreateJacobianMatrixx(Matrix ** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax){12 void CreateJacobianMatrixx(Matrix<IssmDouble>** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax){ 13 13 14 14 int i,connectivity; … … 17 17 Element *element = NULL; 18 18 Load *load = NULL; 19 Matrix * Jff = NULL;19 Matrix<IssmDouble>* Jff = NULL; 20 20 21 21 /*Checks*/ … … 29 29 30 30 /*Initialize Jacobian Matrix*/ 31 Jff=new Matrix (fsize,fsize,connectivity,numberofdofspernode);31 Jff=new Matrix<IssmDouble>(fsize,fsize,connectivity,numberofdofspernode); 32 32 33 33 /*Create and assemble matrix*/ -
issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h
r12832 r13216 10 10 11 11 /* local prototypes: */ 12 void CreateJacobianMatrixx(Matrix ** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax);12 void CreateJacobianMatrixx(Matrix<IssmDouble>** pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,IssmDouble kmax); 13 13 14 14 #endif /* _CREATEJACOBIANMATRIXX_H */ -
issm/trunk-jpl/src/c/modules/CreateNodalConstraintsx/CreateNodalConstraintsx.cpp
r11679 r13216 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void CreateNodalConstraintsx( Vector ** pys, Nodes* nodes,int configuration_type){12 void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes,int configuration_type){ 13 13 14 14 int i; … … 18 18 19 19 /*output: */ 20 Vector * ys=NULL;20 Vector<IssmDouble>* ys=NULL; 21 21 22 22 /*figure out how many dofs we have: */ … … 24 24 25 25 /*allocate:*/ 26 ys=new Vector (numberofdofs);26 ys=new Vector<IssmDouble>(numberofdofs); 27 27 28 28 /*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 9 9 10 10 /* local prototypes: */ 11 void CreateNodalConstraintsx( Vector ** pys, Nodes* nodes,int configuration_type);11 void CreateNodalConstraintsx( Vector<IssmDouble>** pys, Nodes* nodes,int configuration_type); 12 12 13 13 #endif /* _CREATENODALCONSTRAINTSX_H */ -
issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
r13129 r13216 254 254 case VerticesEnum : return "Vertices"; 255 255 case ResultsEnum : return "Results"; 256 case AdolcParamEnum : return "AdolcParam"; 256 257 case BoolInputEnum : return "BoolInput"; 257 258 case BoolParamEnum : return "BoolParam"; … … 474 475 case XYZPEnum : return "XYZP"; 475 476 case OptionEnum : return "Option"; 477 case GenericOptionEnum : return "GenericOption"; 476 478 case OptionCellEnum : return "OptionCell"; 477 479 case OptionCharEnum : return "OptionChar"; -
issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.cpp
r13056 r13216 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void GetSolutionFromInputsx( Vector ** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters){11 void GetSolutionFromInputsx( Vector<IssmDouble>** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters){ 12 12 13 13 /*intermediary: */ … … 19 19 20 20 /*output: */ 21 Vector * solution=NULL;21 Vector<IssmDouble>* solution=NULL; 22 22 23 23 /*retrive parameters: */ … … 29 29 30 30 /*Initialize solution: */ 31 solution=new Vector (gsize);31 solution=new Vector<IssmDouble>(gsize); 32 32 33 33 /*Go through elements and plug solution: */ -
issm/trunk-jpl/src/c/modules/GetSolutionFromInputsx/GetSolutionFromInputsx.h
r12832 r13216 10 10 11 11 /* local prototypes: */ 12 void GetSolutionFromInputsx( Vector ** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters);12 void GetSolutionFromInputsx( Vector<IssmDouble>** psolution, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters); 13 13 14 14 #endif /* _GETSOLUTIONFROMINPUTSXX_H */ -
issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp
r13073 r13216 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void GetVectorFromControlInputsx(Vector ** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){11 void GetVectorFromControlInputsx(Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){ 12 12 13 13 int num_controls; 14 14 int *control_type = NULL; 15 Vector * vector=NULL;15 Vector<IssmDouble>* vector=NULL; 16 16 17 17 /*Retrieve some parameters*/ … … 20 20 21 21 /*Allocate and populate gradient*/ 22 vector=new Vector (num_controls*vertices->NumberOfVertices());22 vector=new Vector<IssmDouble>(num_controls*vertices->NumberOfVertices()); 23 23 24 24 for(int i=0;i<num_controls;i++){ … … 42 42 43 43 /*intermediary: */ 44 Vector * vec_vector=NULL;44 Vector<IssmDouble>* vec_vector=NULL; 45 45 46 46 GetVectorFromControlInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters,data); -
issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h
r13073 r13216 9 9 10 10 /* local prototypes: */ 11 void GetVectorFromControlInputsx( Vector ** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,const char* data="value");11 void GetVectorFromControlInputsx( Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,const char* data="value"); 12 12 void GetVectorFromControlInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,const char* data="value"); 13 13 -
issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
r13056 r13216 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void GetVectorFromInputsx( Vector ** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){11 void GetVectorFromInputsx( Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){ 12 12 13 13 int i; 14 Vector * vector=NULL;14 Vector<IssmDouble>* vector=NULL; 15 15 16 16 if(type==VertexEnum){ 17 17 18 18 /*Allocate vector*/ 19 vector=new Vector (vertices->NumberOfVertices());19 vector=new Vector<IssmDouble>(vertices->NumberOfVertices()); 20 20 21 21 /*Look up in elements*/ … … 47 47 48 48 /*intermediary: */ 49 Vector * vec_vector=NULL;49 Vector<IssmDouble>* vec_vector=NULL; 50 50 51 51 GetVectorFromInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters, name, type); -
issm/trunk-jpl/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.h
r12832 r13216 9 9 10 10 /* local prototypes: */ 11 void GetVectorFromInputsx( Vector ** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,int name,int type);11 void GetVectorFromInputsx( Vector<IssmDouble>** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,int name,int type); 12 12 void GetVectorFromInputsx( IssmDouble** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,int name,int type); 13 13 -
issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.cpp
r13073 r13216 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void Gradjx(Vector ** pgradient,IssmDouble** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){12 void Gradjx(Vector<IssmDouble>** pgradient,IssmDouble** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){ 13 13 14 14 int i,j,numberofvertices; … … 17 17 IssmDouble *norm_list = NULL; 18 18 int *control_type = NULL; 19 Vector *gradient = NULL;20 Vector **gradient_list = NULL;19 Vector<IssmDouble> *gradient = NULL; 20 Vector<IssmDouble> **gradient_list = NULL; 21 21 22 22 /*retrieve some parameters: */ … … 26 26 27 27 /*Allocate gradient_list */ 28 gradient_list = xNew<Vector *>(num_controls);28 gradient_list = xNew<Vector<IssmDouble>*>(num_controls); 29 29 norm_list = xNew<IssmDouble>(num_controls); 30 30 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); 32 32 } 33 gradient=new Vector (num_controls*numberofvertices);33 gradient=new Vector<IssmDouble>(num_controls*numberofvertices); 34 34 35 35 /*Compute all gradient_list*/ … … 65 65 } 66 66 if(pgradient) *pgradient=gradient; 67 xDelete<Vector *>(gradient_list);67 xDelete<Vector<IssmDouble>*>(gradient_list); 68 68 xDelete<int>(control_type); 69 69 } -
issm/trunk-jpl/src/c/modules/Gradjx/Gradjx.h
r13073 r13216 10 10 11 11 /* local prototypes: */ 12 void Gradjx(Vector ** pgrad_g,IssmDouble** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);12 void Gradjx(Vector<IssmDouble>** pgrad_g,IssmDouble** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters); 13 13 14 14 #endif /* _GRADJX_H */ -
issm/trunk-jpl/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
r13073 r13216 17 17 IssmDouble* vertices_ungrounding = NULL; 18 18 IssmDouble* old_floatingice = NULL; 19 Vector * vec_old_floatingice = NULL;19 Vector<IssmDouble>* vec_old_floatingice = NULL; 20 20 Element* element = NULL; 21 21 … … 55 55 56 56 /*FUNCTION CreateNodesOnFloatingIce {{{*/ 57 Vector * CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){57 Vector<IssmDouble>* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){ 58 58 59 59 int i,numnods; 60 Vector * vec_nodes_on_floatingice = NULL;60 Vector<IssmDouble>* vec_nodes_on_floatingice = NULL; 61 61 Node *node = NULL; 62 62 63 63 /*First, initialize nodes_on_floatingice, which will track which nodes have changed status: */ 64 64 numnods=nodes->NumberOfNodes(configuration_type); 65 vec_nodes_on_floatingice=new Vector (numnods);65 vec_nodes_on_floatingice=new Vector<IssmDouble>(numnods); 66 66 67 67 /*Loop through nodes, and fill vec_nodes_on_floatingice: */ … … 86 86 int i,numberofvertices; 87 87 IssmDouble* vertices_potentially_ungrounding = NULL; 88 Vector * vec_vertices_potentially_ungrounding = NULL;88 Vector<IssmDouble>* vec_vertices_potentially_ungrounding = NULL; 89 89 Element* element = NULL; 90 90 91 91 /*Initialize vector with number of vertices*/ 92 92 numberofvertices=vertices->NumberOfVertices(); 93 vec_vertices_potentially_ungrounding=new Vector (numberofvertices); //grounded vertex that could start floating93 vec_vertices_potentially_ungrounding=new Vector<IssmDouble>(numberofvertices); //grounded vertex that could start floating 94 94 95 95 /*Fill vector vertices_potentially_floating: */ … … 116 116 IssmDouble* nodes_on_floatingice = NULL; 117 117 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; 120 120 Node* node = NULL; 121 121 Element* element = NULL; … … 134 134 135 135 /*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); 137 137 138 138 /*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 14 14 void GroundinglineMigrationx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters); 15 15 16 Vector * CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type);16 Vector<IssmDouble>* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type); 17 17 IssmDouble* PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters); 18 18 IssmDouble* PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding); -
issm/trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.cpp
r12470 r13216 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector * solution){11 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* solution){ 12 12 13 13 IssmDouble* serial_solution=NULL; -
issm/trunk-jpl/src/c/modules/InputUpdateFromSolutionx/InputUpdateFromSolutionx.h
r12832 r13216 10 10 11 11 /* local prototypes: */ 12 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector * solution);12 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* solution); 13 13 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* solution); 14 14 15 15 //with timestep 16 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector * solution,int timestep);16 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* solution,int timestep); 17 17 void InputUpdateFromSolutionx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* solution, int timestep); 18 18 -
issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.cpp
r12450 r13216 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector * vector, int name, int type){11 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector, int name, int type){ 12 12 13 13 double* serial_vector=NULL; -
issm/trunk-jpl/src/c/modules/InputUpdateFromVectorDakotax/InputUpdateFromVectorDakotax.h
r12832 r13216 10 10 11 11 /* local prototypes: */ 12 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector * vector, int name,int type);12 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector, int name,int type); 13 13 void InputUpdateFromVectorDakotax( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,double* vector, int name,int type); 14 14 void 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 9 9 #include "../../EnumDefinitions/EnumDefinitions.h" 10 10 11 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector * vector, int name, int type){11 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector, int name, int type){ 12 12 13 13 IssmDouble* serial_vector=NULL; -
issm/trunk-jpl/src/c/modules/InputUpdateFromVectorx/InputUpdateFromVectorx.h
r12832 r13216 10 10 11 11 /* local prototypes: */ 12 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector * vector, int name,int type);12 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector, int name,int type); 13 13 void InputUpdateFromVectorx( Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* vector, int name,int type); 14 14 void 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 17 17 18 18 /*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){19 int 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){ 20 20 21 21 /*output: */ 22 Vector * data_mesh=NULL;22 Vector<IssmDouble>* data_mesh=NULL; 23 23 24 24 /*Intermediary*/ … … 47 47 48 48 /*Allocate output vector: */ 49 data_mesh=new Vector (nods);49 data_mesh=new Vector<IssmDouble>(nods); 50 50 51 51 /*Find out what kind of coordinates (x_in,y_in) have been given is input*/ … … 127 127 double *y = gate->y; 128 128 int nods = gate->nods; 129 Vector 129 Vector<IssmDouble>*data_mesh = gate->data_mesh; 130 130 double *data = gate->data; 131 131 double default_value = gate->default_value; -
issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h
r12832 r13216 24 24 double* x_mesh; 25 25 double* y_mesh; 26 Vector * data_mesh;26 Vector<IssmDouble>* data_mesh; 27 27 } InterpFromGridToMeshxThreadStruct; 28 28 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);29 int 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); 30 30 void* InterpFromGridToMeshxt(void* vInterpFromGridToMeshxThreadStruct); 31 31 bool 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 10 10 #include "../modules.h" 11 11 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,12 int 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, 13 13 double* default_values,int num_default_values,Contour** contours,int numcontours){ 14 14 15 15 /*Output*/ 16 Vector * data_prime=NULL;16 Vector<IssmDouble>* data_prime=NULL; 17 17 18 18 /*Intermediary*/ … … 27 27 28 28 /*contours: */ 29 Vector * vec_incontour=NULL;29 Vector<IssmDouble>* vec_incontour=NULL; 30 30 double* incontour=NULL; 31 31 … … 71 71 72 72 /*Initialize output*/ 73 data_prime=new Vector (nods_prime,false,SeqVecType);73 data_prime=new Vector<IssmDouble>(nods_prime,false,SeqVecType); 74 74 if(num_default_values){ 75 75 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 23 23 double ymin,ymax; 24 24 int nods_prime; 25 Vector * data_prime;25 Vector<IssmDouble>* data_prime; 26 26 double* x_prime; 27 27 double* y_prime; … … 33 33 } InterpFromMesh2dxThreadStruct; 34 34 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,35 int 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, 36 36 double* default_values,int num_default_values,Contour** contours,int numcontours); 37 37 -
issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp
r12864 r13216 32 32 double ymax = gate->ymax; 33 33 int nods_prime = gate->nods_prime; 34 Vector *data_prime = gate->data_prime;34 Vector<IssmDouble>* data_prime = gate->data_prime; 35 35 double *x_prime = gate->x_prime; 36 36 double *y_prime = gate->y_prime; -
issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp
r13056 r13216 7 7 #include "../../include/include.h" 8 8 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) {9 int 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) { 10 10 11 11 /*Output*/ 12 Vector * data_prime=NULL;12 Vector<IssmDouble>* data_prime=NULL; 13 13 14 14 /*Intermediary*/ … … 54 54 55 55 /*Initialize output*/ 56 data_prime=new Vector (nods_prime);56 data_prime=new Vector<IssmDouble>(nods_prime); 57 57 for (i=0;i<nods_prime;i++) data_prime->SetValue(i,default_value,INS_VAL); 58 58 -
issm/trunk-jpl/src/c/modules/InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h
r12832 r13216 9 9 #include "../../classes/objects/objects.h" 10 10 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);11 int 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); 12 12 13 13 #endif /* _INTERPFROMMESHTOMESH3DX_H */ -
issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
r13056 r13216 48 48 49 49 /*Get output*/ 50 options->Get(&output,"output", "prediction");50 options->Get(&output,"output",(char*)"prediction"); 51 51 52 52 if(strcmp(output,"quadtree")==0){ -
issm/trunk-jpl/src/c/modules/Krigingx/pKrigingx.cpp
r13056 r13216 41 41 42 42 /*Get output*/ 43 options->Get(&output,"output", "prediction");43 options->Get(&output,"output",(char*)"prediction"); 44 44 45 45 if(strcmp(output,"quadtree")==0){ -
issm/trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.cpp
r12515 r13216 7 7 #include "./Mergesolutionfromftogx.h" 8 8 9 void Mergesolutionfromftogx( Vector ** pug, Vector* uf, Vector* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0){9 void Mergesolutionfromftogx( Vector<IssmDouble>** pug, Vector<IssmDouble>* uf, Vector<IssmDouble>* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0){ 10 10 11 11 /*output: */ 12 Vector * ug=NULL;12 Vector<IssmDouble>* ug=NULL; 13 13 14 14 /*intermediary: */ … … 34 34 35 35 /*initialize ug: */ 36 ug=new Vector (gsize);36 ug=new Vector<IssmDouble>(gsize); 37 37 38 38 /*Merge f set back into g set: */ -
issm/trunk-jpl/src/c/modules/Mergesolutionfromftogx/Mergesolutionfromftogx.h
r12832 r13216 9 9 10 10 /* local prototypes: */ 11 void Mergesolutionfromftogx( Vector ** pug, Vector* uf, Vector* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false);11 void Mergesolutionfromftogx( Vector<IssmDouble>** pug, Vector<IssmDouble>* uf, Vector<IssmDouble>* ys, Nodes* nodes, Parameters* parameters, bool flag_ys0=false); 12 12 13 13 #endif /* _MERGESOLUTIONFROMFTOGX_H */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h
r12470 r13216 11 11 class IoModel; 12 12 class Parameters; 13 class DofIndexing; 14 13 15 #include "../../io/io.h" 14 16 -
issm/trunk-jpl/src/c/modules/Orthx/Orthx.cpp
r13073 r13216 5 5 #include "./Orthx.h" 6 6 7 void Orthx( Vector ** pnewgradj, Vector* gradj, Vector* oldgradj){7 void Orthx( Vector<IssmDouble>** pnewgradj, Vector<IssmDouble>* gradj, Vector<IssmDouble>* oldgradj){ 8 8 9 9 /*output: */ 10 Vector * newgradj=NULL;10 Vector<IssmDouble>* newgradj=NULL; 11 11 12 12 /*intermediary:*/ -
issm/trunk-jpl/src/c/modules/Orthx/Orthx.h
r12832 r13216 11 11 12 12 /* local prototypes: */ 13 void Orthx( Vector ** pnewgradj, Vector* gradj, Vector* oldgradj);13 void Orthx( Vector<IssmDouble>** pnewgradj, Vector<IssmDouble>* gradj, Vector<IssmDouble>* oldgradj); 14 14 15 15 #endif /* _ORTHX_H */ -
issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp
r11695 r13216 4 4 #include "./PointCloudFindNeighborsx.h" 5 5 6 int PointCloudFindNeighborsx( Vector ** pflags,double* x, double* y, int nods, double mindistance,double multithread){6 int PointCloudFindNeighborsx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread){ 7 7 8 8 /*output: */ 9 Vector * flags=NULL;10 flags=new Vector (nods);9 Vector<IssmDouble>* flags=NULL; 10 flags=new Vector<IssmDouble>(nods); 11 11 12 12 /*threading: */ -
issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h
r12832 r13216 11 11 12 12 /* local prototypes: */ 13 int PointCloudFindNeighborsx( Vector ** pflags,double* x, double* y, int nods, double mindistance,double multithread);13 int PointCloudFindNeighborsx( Vector<IssmDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread); 14 14 15 15 /*threading: */ … … 20 20 int nods; 21 21 double mindistance; 22 Vector * flags;22 Vector<IssmDouble>* flags; 23 23 24 24 -
issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp
r12507 r13216 17 17 int nods; 18 18 double mindistance; 19 Vector * flags;19 Vector<IssmDouble>* flags; 20 20 21 21 /*recover handle and gate: */ -
issm/trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.cpp
r12515 r13216 12 12 #include "../../io/io.h" 13 13 14 void Reduceloadx( Vector * pf, Matrix* Kfs, Vector* y_s,bool flag_ys0){14 void Reduceloadx( Vector<IssmDouble>* pf, Matrix<IssmDouble>* Kfs, Vector<IssmDouble>* y_s,bool flag_ys0){ 15 15 16 16 /*intermediary*/ 17 Vector * y_s0 = NULL;18 Vector * Kfsy_s = NULL;17 Vector<IssmDouble>* y_s0 = NULL; 18 Vector<IssmDouble>* Kfsy_s = NULL; 19 19 int Kfsm,Kfsn; 20 20 int global_m,global_n; … … 32 32 /*pf = pf - Kfs * y_s;*/ 33 33 Kfs->GetLocalSize(&Kfsm,&Kfsn); 34 Kfsy_s=new Vector (Kfsm,fromlocalsize);34 Kfsy_s=new Vector<IssmDouble>(Kfsm,fromlocalsize); 35 35 if (flag_ys0){ 36 36 -
issm/trunk-jpl/src/c/modules/Reduceloadx/Reduceloadx.h
r12832 r13216 9 9 10 10 /* local prototypes: */ 11 void Reduceloadx( Vector * pf, Matrix* Kfs, Vector* ys,bool flag_ys0=false);11 void Reduceloadx( Vector<IssmDouble>* pf, Matrix<IssmDouble>* Kfs, Vector<IssmDouble>* ys,bool flag_ys0=false); 12 12 13 13 #endif /* _REDUCELOADX_H */ -
issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.cpp
r12470 r13216 6 6 #include "./Reducevectorgtofx.h" 7 7 8 void Reducevectorgtofx(Vector ** puf, Vector* ug, Nodes* nodes,Parameters* parameters){8 void Reducevectorgtofx(Vector<IssmDouble>** puf, Vector<IssmDouble>* ug, Nodes* nodes,Parameters* parameters){ 9 9 10 10 /*output: */ 11 Vector * uf=NULL;11 Vector<IssmDouble>* uf=NULL; 12 12 13 13 /*variables: */ … … 26 26 else{ 27 27 /*allocate: */ 28 uf=new Vector (fsize);28 uf=new Vector<IssmDouble>(fsize); 29 29 30 30 if(nodes->NumberOfNodes(configuration_type)){ -
issm/trunk-jpl/src/c/modules/Reducevectorgtofx/Reducevectorgtofx.h
r12832 r13216 10 10 11 11 /* local prototypes: */ 12 void Reducevectorgtofx(Vector ** puf, Vector* ug, Nodes* nodes,Parameters* parameters);12 void Reducevectorgtofx(Vector<IssmDouble>** puf, Vector<IssmDouble>* ug, Nodes* nodes,Parameters* parameters); 13 13 14 14 #endif /* _REDUCEVECTORGTOFX_H */ -
issm/trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.cpp
r12450 r13216 6 6 #include "./Reducevectorgtosx.h" 7 7 8 void Reducevectorgtosx(Vector ** pys, Vector* yg, Nodes* nodes,Parameters* parameters){8 void Reducevectorgtosx(Vector<IssmDouble>** pys, Vector<IssmDouble>* yg, Nodes* nodes,Parameters* parameters){ 9 9 10 10 /*output: */ 11 Vector * ys=NULL;11 Vector<IssmDouble>* ys=NULL; 12 12 13 13 /*variables: */ … … 26 26 else{ 27 27 /*allocate: */ 28 ys=new Vector (ssize);28 ys=new Vector<IssmDouble>(ssize); 29 29 30 30 if(nodes->NumberOfNodes(configuration_type)){ -
issm/trunk-jpl/src/c/modules/Reducevectorgtosx/Reducevectorgtosx.h
r12832 r13216 10 10 11 11 /* local prototypes: */ 12 void Reducevectorgtosx(Vector ** pys, Vector* yg, Nodes* nodes,Parameters* parameters);12 void Reducevectorgtosx(Vector<IssmDouble>** pys, Vector<IssmDouble>* yg, Nodes* nodes,Parameters* parameters); 13 13 14 14 #endif /* _REDUCEVECTORGTOSX_H */ -
issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp
r13073 r13216 28 28 } 29 29 30 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector * vector){30 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector){ 31 31 32 32 IssmDouble* serial_vector=NULL; -
issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h
r13073 r13216 9 9 10 10 /* local prototypes: */ 11 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector * vector);11 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,Vector<IssmDouble>* vector); 12 12 void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials, Parameters* parameters,IssmDouble* vector); 13 13 -
issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp
r13195 r13216 14 14 #endif 15 15 16 void Solverx(Vector ** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters){16 void Solverx(Vector<IssmDouble>** puf, Matrix<IssmDouble>* Kff, Vector<IssmDouble>* pf, Vector<IssmDouble>* uf0,Vector<IssmDouble>* df, Parameters* parameters){ 17 17 18 18 /*Intermediary: */ … … 20 20 21 21 /*output: */ 22 Vector *uf=NULL;22 Vector<IssmDouble> *uf=NULL; 23 23 24 24 /*In debugging mode, check that stiffness matrix and load vectors are not NULL (they can be empty)*/ … … 27 27 28 28 /*Initialize vector: */ 29 uf=new Vector ();29 uf=new Vector<IssmDouble>(); 30 30 31 31 /*According to matrix type, use specific solvers: */ -
issm/trunk-jpl/src/c/modules/Solverx/Solverx.h
r13196 r13216 15 15 16 16 /* local prototypes: */ 17 void Solverx(Vector ** puf, Matrix* Kff, Vector* pf, Vector* uf0,Vector* df, Parameters* parameters);17 void Solverx(Vector<IssmDouble>** puf, Matrix<IssmDouble>* Kff, Vector<IssmDouble>* pf, Vector<IssmDouble>* uf0,Vector<IssmDouble>* df, Parameters* parameters); 18 18 19 19 #ifdef _HAVE_PETSC_ … … 23 23 #endif 24 24 25 void SolverxSeq(SeqVec ** puf,SeqMat* Kff, SeqVec* pf,Parameters* parameters);25 void SolverxSeq(SeqVec<IssmDouble>** puf,SeqMat<IssmDouble>* Kff, SeqVec<IssmDouble>* pf,Parameters* parameters); 26 26 void SolverxSeq(IssmPDouble *X, IssmPDouble *A, IssmPDouble *B,int n); 27 27 -
issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
r13196 r13216 23 23 #endif 24 24 25 void SolverxSeq(SeqVec ** puf,SeqMat* Kff, SeqVec* pf, Parameters* parameters){/*{{{*/25 void SolverxSeq(SeqVec<IssmDouble>** puf,SeqMat<IssmDouble>* Kff, SeqVec<IssmDouble>* pf, Parameters* parameters){/*{{{*/ 26 26 27 27 #ifdef _HAVE_GSL_ 28 28 /*Intermediary: */ 29 29 int M,N,N2,s; 30 SeqVec *uf = NULL;30 SeqVec<IssmDouble> *uf = NULL; 31 31 32 32 Kff->GetSize(&M,&N); … … 41 41 SolverxSeq(x,Kff->matrix,pf->vector,N); 42 42 #endif 43 uf=new SeqVec (x,N);43 uf=new SeqVec<IssmDouble>(x,N); 44 44 xDelete(x); 45 45 -
issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
r13129 r13216 258 258 else if (strcmp(name,"Vertices")==0) return VerticesEnum; 259 259 else if (strcmp(name,"Results")==0) return ResultsEnum; 260 else if (strcmp(name,"AdolcParam")==0) return AdolcParamEnum; 260 261 else if (strcmp(name,"BoolInput")==0) return BoolInputEnum; 261 262 else if (strcmp(name,"BoolParam")==0) return BoolParamEnum; 262 else if (strcmp(name,"Contour")==0) return ContourEnum;263 263 else stage=3; 264 264 } 265 265 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; 267 268 else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum; 268 269 else if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum; … … 383 384 else if (strcmp(name,"VzMesh")==0) return VzMeshEnum; 384 385 else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum; 385 else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;386 386 else stage=4; 387 387 } 388 388 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; 390 391 else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum; 391 392 else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum; … … 484 485 else if (strcmp(name,"XYZP")==0) return XYZPEnum; 485 486 else if (strcmp(name,"Option")==0) return OptionEnum; 487 else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum; 486 488 else if (strcmp(name,"OptionCell")==0) return OptionCellEnum; 487 489 else if (strcmp(name,"OptionChar")==0) return OptionCharEnum; -
issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
r12515 r13216 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 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){12 void SystemMatricesx(Matrix<IssmDouble>** pKff, Matrix<IssmDouble>** pKfs, Vector<IssmDouble>** ppf, Vector<IssmDouble>** pdf, IssmDouble* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,bool kflag,bool pflag,bool penalty_kflag,bool penalty_pflag){ 13 13 14 14 /*intermediary: */ … … 21 21 22 22 /*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; 27 27 IssmDouble kmax = 0; 28 28 … … 49 49 if(kflag){ 50 50 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); 54 54 55 55 /*Fill stiffness matrix from elements: */ … … 73 73 if(pflag){ 74 74 75 pf=new Vector (fsize);75 pf=new Vector<IssmDouble>(fsize); 76 76 77 77 /*Fill right hand side vector, from elements: */ -
issm/trunk-jpl/src/c/modules/SystemMatricesx/SystemMatricesx.h
r12832 r13216 10 10 11 11 /* 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,12 void 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, 13 13 bool kflag=true,bool pflag=true,bool penalty_kflag=true,bool penalty_pflag=true); 14 14 -
issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
r12860 r13216 20 20 /*}}}*/ 21 21 22 void TriMeshx(Matrix ** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){22 void TriMeshx(Matrix<IssmDouble>** pindex,Vector<IssmDouble>** px,Vector<IssmDouble>** py,Matrix<IssmDouble>** psegments,Vector<IssmDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){ 23 23 24 24 /*indexing: */ … … 27 27 /*output: */ 28 28 double* index=NULL; 29 Matrix * index_matrix=NULL;29 Matrix<IssmDouble>* index_matrix=NULL; 30 30 double* x=NULL; 31 31 double* y=NULL; 32 32 double* segments=NULL; 33 Matrix * segments_matrix=NULL;33 Matrix<IssmDouble>* segments_matrix=NULL; 34 34 double* segmentmarkerlist=NULL; 35 35 … … 192 192 193 193 /*Output : */ 194 index_matrix=new Matrix (index,out.numberoftriangles,3,1,SeqMatType);194 index_matrix=new Matrix<IssmDouble>(index,out.numberoftriangles,3,1,SeqMatType); 195 195 *pindex=index_matrix; 196 196 197 segments_matrix=new Matrix (segments,out.numberofsegments,3,1,SeqMatType);197 segments_matrix=new Matrix<IssmDouble>(segments,out.numberofsegments,3,1,SeqMatType); 198 198 *psegments=segments_matrix; 199 199 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); 203 203 } -
issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h
r12832 r13216 11 11 12 12 /* local prototypes: */ 13 void TriMeshx(Matrix ** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);13 void TriMeshx(Matrix<IssmDouble>** pindex,Vector<IssmDouble>** px,Vector<IssmDouble>** py,Matrix<IssmDouble>** psegments,Vector<IssmDouble>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area); 14 14 15 15 #endif /* _TRIMESHX_H */ -
issm/trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.cpp
r12470 r13216 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 11 12 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector * yg){12 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector<IssmDouble>* yg){ 13 13 14 14 int configuration_type; -
issm/trunk-jpl/src/c/modules/UpdateDynamicConstraintsx/UpdateDynamicConstraintsx.h
r12832 r13216 9 9 #include "../../classes/objects/objects.h" 10 10 11 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector * yg);11 void UpdateDynamicConstraintsx(Constraints* constraints,Nodes* nodes,Parameters* parameters,Vector<IssmDouble>* yg); 12 12 13 13 #endif /* _UPDATESPCSX_H */ -
issm/trunk-jpl/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp
r12470 r13216 13 13 14 14 int i; 15 Vector * vz = NULL;15 Vector<IssmDouble>* vz = NULL; 16 16 Vertex *vertex = NULL; 17 17 IssmDouble *thickness = NULL; … … 23 23 24 24 /*Allocate vector*/ 25 vz=new Vector (vertices->NumberOfVertices());25 vz=new Vector<IssmDouble>(vertices->NumberOfVertices()); 26 26 27 27 /*Update verices new geometry: */ -
issm/trunk-jpl/src/c/modules/VecMergex/VecMergex.cpp
r12470 r13216 9 9 #include "../../toolkits/toolkits.h" 10 10 #include "../../EnumDefinitions/EnumDefinitions.h" 11 12 void VecMergex(Vector* ug, Vector* uf, Nodes* nodes, Parameters* parameters, int SetEnum){ 11 void VecMergex(Vector<IssmDouble>* ug, Vector<IssmDouble>* uf, Nodes* nodes, Parameters* parameters, int SetEnum){ 13 12 14 13 /*variables: */ -
issm/trunk-jpl/src/c/modules/VecMergex/VecMergex.h
r12832 r13216 10 10 11 11 /* local prototypes: */ 12 void VecMergex(Vector * ug, Vector* uf, Nodes* nodes, Parameters* parameters, int SetEnum);12 void VecMergex(Vector<IssmDouble>* ug, Vector<IssmDouble>* uf, Nodes* nodes, Parameters* parameters, int SetEnum); 13 13 14 14 #endif /* _VECMERGEX_H */ -
issm/trunk-jpl/src/c/shared/Alloc/alloc.cpp
r13056 r13216 62 62 } 63 63 64 void xdelete(Matrix ** pv){64 void xdelete(Matrix<IssmDouble>** pv){ 65 65 66 66 if (pv && *pv){ … … 73 73 } 74 74 75 void xdelete(Vector ** pv){75 void xdelete(Vector<IssmDouble>** pv){ 76 76 77 77 if (pv && *pv){ -
issm/trunk-jpl/src/c/shared/Alloc/alloc.h
r11679 r13216 5 5 #ifndef _ALLOC_H_ 6 6 #define _ALLOC_H_ 7 class Matrix; 8 class Vector; 7 8 #include "../../include/include.h" 9 10 template <class doubletype> class Matrix; 11 template <class doubletype> class Vector; 9 12 void* xmalloc(int size); 10 13 void* xcalloc(int n,int size); 11 14 void xfree(void** pvptr); 12 15 void* xrealloc ( void* pv, int size); 13 void xdelete(Matrix** pvptr); 14 void xdelete(Vector** pvptr); 16 void xdelete(Matrix<IssmDouble>** pvptr); 17 void xdelete(Vector<IssmDouble>** pvptr); 18 19 #include "./xNewDelete.h" 15 20 16 21 #endif -
issm/trunk-jpl/src/c/shared/Exp/IsInPoly.cpp
r12365 r13216 15 15 16 16 /*IsInPoly {{{*/ 17 int IsInPoly(Vector * in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){17 int IsInPoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ 18 18 19 19 int i; … … 56 56 }/*}}}*/ 57 57 /*IsOutsidePoly {{{*/ 58 int IsOutsidePoly(Vector * in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){58 int IsOutsidePoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ 59 59 60 60 int i,j; -
issm/trunk-jpl/src/c/shared/Exp/exp.h
r12832 r13216 10 10 #include "../../toolkits/toolkits.h" 11 11 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);12 int IsInPoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue); 13 int IsOutsidePoly(Vector<IssmDouble>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue); 14 14 int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue); 15 15 int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname); -
issm/trunk-jpl/src/c/shared/Numerics/GaussPoints.cpp
r13056 r13216 4 4 #include "./GaussPoints.h" 5 5 #include "../Alloc/alloc.h" 6 #include "../../io/io.h"7 6 #include "../Exceptions/exceptions.h" 8 7 #include <math.h> -
issm/trunk-jpl/src/c/solutions/ResetBoundaryConditions.cpp
r12832 r13216 11 11 12 12 /*variables: */ 13 Vector * yg = NULL;13 Vector<IssmDouble>* yg = NULL; 14 14 Nodes *nodes = NULL; 15 15 int i; -
issm/trunk-jpl/src/c/solutions/convergence.cpp
r13056 r13216 8 8 #include "../EnumDefinitions/EnumDefinitions.h" 9 9 10 void convergence(bool* pconverged, Matrix * Kff,Vector* pf,Vector* uf,Vector* old_uf,Parameters* parameters){10 void convergence(bool* pconverged, Matrix<IssmDouble>* Kff,Vector<IssmDouble>* pf,Vector<IssmDouble>* uf,Vector<IssmDouble>* old_uf,Parameters* parameters){ 11 11 12 12 /*output*/ … … 14 14 15 15 /*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; 21 21 IssmDouble ndu,nduinf,nu; 22 22 IssmDouble nKUF; -
issm/trunk-jpl/src/c/solutions/gradient_core.cpp
r13056 r13216 18 18 IssmDouble norm_inf; 19 19 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; 23 23 24 24 /*Compute gradient*/ -
issm/trunk-jpl/src/c/solutions/solutions.h
r12832 r13216 33 33 34 34 //convergence: 35 void convergence(bool* pconverged, Matrix * K_ff,Vector* p_f,Vector* u_f,Vector* u_f_old,Parameters* parameters);35 void convergence(bool* pconverged, Matrix<IssmDouble>* K_ff,Vector<IssmDouble>* p_f,Vector<IssmDouble>* u_f,Vector<IssmDouble>* u_f_old,Parameters* parameters); 36 36 bool controlconvergence(IssmDouble J,IssmDouble tol_cm); 37 37 bool steadystateconvergence(FemModel* femmodel); -
issm/trunk-jpl/src/c/solvers/solver_adjoint_linear.cpp
r12832 r13216 13 13 14 14 /*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; 22 22 int configuration_type; 23 23 -
issm/trunk-jpl/src/c/solvers/solver_linear.cpp
r12832 r13216 11 11 12 12 /*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; 20 20 int configuration_type; 21 21 -
issm/trunk-jpl/src/c/solvers/solver_newton.cpp
r12832 r13216 18 18 int count; 19 19 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; 32 32 33 33 /*parameters:*/ -
issm/trunk-jpl/src/c/solvers/solver_nonlinear.cpp
r12832 r13216 14 14 15 15 /*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; 25 25 26 26 Loads* loads=NULL; -
issm/trunk-jpl/src/c/solvers/solver_stokescoupling_nonlinear.cpp
r12832 r13216 14 14 15 15 /*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; 30 30 bool converged; 31 31 int constraints_converged; -
issm/trunk-jpl/src/c/solvers/solver_thermal_nonlinear.cpp
r12832 r13216 12 12 13 13 /*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; 18 18 IssmDouble melting_offset; 19 19 20 20 /*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; 25 25 26 26 bool converged; -
issm/trunk-jpl/src/c/toolkits/issm/SeqMat.h
r12477 r13216 1 1 /*!\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. 3 3 */ 4 4 … … 14 14 #endif 15 15 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" 17 21 18 22 /*}}}*/ 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 28 template <class doubletype> 21 29 class SeqMat{ 22 30 … … 24 32 25 33 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 /*}}}*/ 48 228 49 229 }; 50 230 51 231 #endif //#ifndef _SEQMAT_H_ -
issm/trunk-jpl/src/c/toolkits/issm/SeqVec.h
r12477 r13216 14 14 #endif 15 15 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" 17 20 18 21 /*}}}*/ 19 22 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 27 template <class doubletype> 20 28 class SeqVec{ 21 29 22 30 public: 23 31 24 IssmDouble* vector;32 doubletype* vector; 25 33 int M; 26 34 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 } 51 250 /*}}}*/ 52 251 }; 53 54 252 #endif //#ifndef _SEQVEC_H_ -
issm/trunk-jpl/src/c/toolkits/issm/issmtoolkit.h
r12477 r13216 6 6 #define _ISSM_TOOLKIT_H_ 7 7 8 #include "../../include/include.h"9 10 8 #include "./SeqMat.h" 11 9 #include "./SeqVec.h" -
issm/trunk-jpl/src/modules/ContourToMesh/ContourToMesh.cpp
r13036 r13216 37 37 38 38 /* output: */ 39 Vector *in_nod = NULL;40 Vector *in_elem = NULL;39 Vector<double> *in_nod = NULL; 40 Vector<double> *in_elem = NULL; 41 41 42 42 /*Boot module: */ -
issm/trunk-jpl/src/modules/ContourToNodes/ContourToNodes.cpp
r13038 r13216 35 35 36 36 /* output: */ 37 Vector * flags=NULL;37 Vector<double>* flags=NULL; 38 38 int nods; 39 39 -
issm/trunk-jpl/src/modules/Exp2Kml/Exp2Kml.cpp
r13036 r13216 37 37 FetchData(&options,NRHS,nrhs,prhs); 38 38 39 options->Get(&choles,"holes", "no");39 options->Get(&choles,"holes",(char*)"no"); 40 40 if (!strncmp(choles,"y",1) || !strncmp(choles,"on",2)) holes=true; 41 41 -
issm/trunk-jpl/src/modules/InterpFromGridToMesh/InterpFromGridToMesh.cpp
r13036 r13216 37 37 38 38 /* output: */ 39 Vector * data_mesh=NULL;39 Vector<double>* data_mesh=NULL; 40 40 41 41 /*Boot module: */ -
issm/trunk-jpl/src/modules/InterpFromMesh2d/InterpFromMesh2d.cpp
r13038 r13216 61 61 62 62 /* output: */ 63 Vector * data_prime=NULL;63 Vector<double>* data_prime=NULL; 64 64 65 65 /*Boot module: */ -
issm/trunk-jpl/src/modules/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
r13036 r13216 55 55 56 56 /* output: */ 57 Vector * data_prime=NULL;57 Vector<double>* data_prime=NULL; 58 58 59 59 /*Boot module: */ -
issm/trunk-jpl/src/modules/KMLFileRead/KMLFileRead.cpp
r13036 r13216 56 56 FetchData(&options,NRHS,nrhs,prhs); 57 57 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"); 61 61 62 62 /*some checks*/ -
issm/trunk-jpl/src/modules/KMLOverlay/KMLOverlay.cpp
r13036 r13216 41 41 FetchData(&options,NRHS,nrhs,prhs); 42 42 43 options->Get(&lataxis ,&nlat , "lataxis");43 options->Get(&lataxis ,&nlat ,(char*)"lataxis"); 44 44 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"); 46 46 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"); 48 48 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.); 50 50 if (verbose) _printLine_(" dzip=" << dzip); 51 51 -
issm/trunk-jpl/src/modules/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp
r12517 r13216 17 17 18 18 /* output: */ 19 Vector * flags=NULL;19 Vector<double>* flags=NULL; 20 20 21 21 /*Boot module: */ -
issm/trunk-jpl/src/modules/TriMesh/TriMesh.cpp
r12861 r13216 17 17 18 18 /* 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; 24 24 25 25 /*Boot module: */
Note:
See TracChangeset
for help on using the changeset viewer.