Changeset 14656
- Timestamp:
- 04/19/13 10:35:57 (12 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 16 added
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
r14655 r14656 547 547 XYZPEnum, 548 548 /*}}}*/ 549 /*Toolkits{{{1*/ 550 DenseEnum, 551 MpiDenseEnum, 552 SeqEnum, 553 MpiEnum, 554 /*}}}*/ 549 555 /*Options{{{1*/ 550 556 OptionEnum, -
issm/trunk-jpl/src/c/Makefile.am
r14650 r14656 220 220 ./toolkits/metis/metisincludes.h\ 221 221 ./toolkits/issm/issmtoolkit.h\ 222 ./toolkits/issm/SeqVec.h\ 223 ./toolkits/issm/SeqMat.h\ 222 ./toolkits/issm/IssmToolkitUtils.h\ 223 ./toolkits/issm/IssmToolkitUtils.cpp\ 224 ./toolkits/issm/IssmAbsMat.h\ 225 ./toolkits/issm/IssmAbsVec.h\ 226 ./toolkits/issm/IssmDenseMat.h\ 227 ./toolkits/issm/IssmMat.h\ 228 ./toolkits/issm/IssmMpiDenseMat.h\ 229 ./toolkits/issm/IssmMpiVec.h\ 230 ./toolkits/issm/IssmSeqVec.h\ 231 ./toolkits/issm/IssmVec.h\ 224 232 ./toolkits/triangle/triangleincludes.h\ 225 233 ./toolkitsenums.h\ -
issm/trunk-jpl/src/c/classes/ToolkitOptions.cpp
r14635 r14656 32 32 33 33 return TokenValue(toolkitoptions,"toolkit"); 34 35 }/*}}}*/ 36 char* ToolkitOptions::GetToolkitOptionValue(char* option){ /*{{{*/ 37 38 return TokenValue(toolkitoptions,option); 34 39 35 40 }/*}}}*/ -
issm/trunk-jpl/src/c/classes/ToolkitOptions.h
r14635 r14656 26 26 static void Init(char* options); 27 27 static char* GetToolkitType(void); 28 static char* GetToolkitOptionValue(char* option); 28 29 }; 29 30 -
issm/trunk-jpl/src/c/classes/matrix/Matrix.h
r13880 r14656 18 18 /*}}}*/ 19 19 20 enum matrixtype { PetscMatType, SeqMatType };20 enum matrixtype { PetscMatType, IssmMatType }; 21 21 22 22 template <class doubletype> class Vector; … … 27 27 public: 28 28 29 int type; 29 30 #ifdef _HAVE_PETSC_ 30 PetscMat *pmatrix;31 PetscMat *pmatrix; 31 32 #endif 32 SeqMat<doubletype> *smatrix; 33 int type; 33 IssmMat<doubletype> *imatrix; 34 34 35 35 /*Matrix constructors, destructors*/ 36 36 /*FUNCTION Matrix(){{{*/ 37 37 Matrix(){ 38 InitCheckAndSetType(); 39 } 40 /*}}}*/ 41 /*FUNCTION Matrix(int M,int N){{{*/ 42 Matrix(int M,int N){ 43 44 InitCheckAndSetType(); 45 46 if(type==PetscMatType){ 47 #ifdef _HAVE_PETSC_ 48 this->pmatrix=new PetscMat(M,N); 49 #endif 50 } 51 else{ 52 this->imatrix=new IssmMat<doubletype>(M,N); 53 } 54 55 } 56 /*}}}*/ 57 /*FUNCTION Matrix(int m,int n,int M,int N,int* d_nnz,int* o_nnz){{{*/ 58 Matrix(int m,int n,int M,int N,int* d_nnz,int* o_nnz){ 59 60 InitCheckAndSetType(); 61 62 if(type==PetscMatType){ 63 #ifdef _HAVE_PETSC_ 64 this->pmatrix=new PetscMat(m,n,M,N,d_nnz,o_nnz); 65 #endif 66 } 67 else{ 68 this->imatrix=new IssmMat<doubletype>(m,n,M,N,d_nnz,o_nnz); 69 } 70 71 } 72 /*}}}*/ 73 /*FUNCTION Matrix(int M,int N,IssmDouble sparsity){{{*/ 74 Matrix(int M,int N,double sparsity){ 75 76 InitCheckAndSetType(); 77 78 if(type==PetscMatType){ 79 #ifdef _HAVE_PETSC_ 80 this->pmatrix=new PetscMat(M,N,sparsity); 81 #endif 82 } 83 else{ 84 this->imatrix=new IssmMat<doubletype>(M,N,sparsity); 85 } 86 } 87 /*}}}*/ 88 /*FUNCTION Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity){{{*/ 89 Matrix(IssmPDouble* serial_mat,int M,int N,IssmPDouble sparsity){ 90 91 InitCheckAndSetType(); 92 93 if(type==PetscMatType){ 94 #ifdef _HAVE_PETSC_ 95 this->pmatrix=new PetscMat(serial_mat,M,N,sparsity); 96 #endif 97 } 98 else{ 99 this->imatrix=new IssmMat<doubletype>(serial_mat,M,N,sparsity); 100 } 101 102 } 103 /*}}}*/ 104 /*FUNCTION Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type){{{*/ 105 Matrix(int M,int N,int connectivity,int numberofdofspernode){ 106 107 InitCheckAndSetType(); 108 109 if(type==PetscMatType){ 110 #ifdef _HAVE_PETSC_ 111 this->pmatrix=new PetscMat(M,N,connectivity,numberofdofspernode); 112 #endif 113 } 114 else{ 115 this->imatrix=new IssmMat<doubletype>(M,N,connectivity,numberofdofspernode); 116 } 117 118 } 119 /*}}}*/ 120 /*FUNCTION ~Matrix(){{{*/ 121 ~Matrix(){ 122 123 if(type==PetscMatType){ 124 #ifdef _HAVE_PETSC_ 125 delete this->pmatrix; 126 #endif 127 } 128 else delete this->imatrix; 129 130 } 131 /*}}}*/ 132 /*FUNCTION InitCheckAndSetType(){{{*/ 133 void InitCheckAndSetType(void){ 134 135 char* toolkittype=NULL; 38 136 39 137 #ifdef _HAVE_PETSC_ 40 138 pmatrix=NULL; 41 139 #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){ 54 #else 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); 140 imatrix=NULL; 141 142 /*retrieve toolkittype: */ 143 toolkittype=ToolkitOptions::GetToolkitType(); 144 145 /*set matrix type: */ 146 if (strcmp(toolkittype,"petsc")==0){ 147 #ifdef _HAVE_PETSC_ 148 type=PetscMatType; 67 149 #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,int M,int N,int* d_nnz,int* o_nnz,int type){{{*/ 79 #ifdef _HAVE_PETSC_ 80 Matrix(int m,int n,int M,int N,int* d_nnz,int* o_nnz,int in_type=PetscMatType){ 81 #else 82 Matrix(int m,int n,int M,int N,int* d_nnz,int* o_nnz,int in_type=SeqMatType){ 83 #endif 84 85 #ifdef _HAVE_PETSC_ 86 pmatrix=NULL; 87 #endif 88 smatrix=NULL; 89 type=in_type; 90 91 if(type==PetscMatType){ 92 #ifdef _HAVE_PETSC_ 93 this->pmatrix=new PetscMat(m,n,M,N,d_nnz,o_nnz); 94 #else 95 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 96 #endif 97 } 98 else if(type==SeqMatType){ 99 this->smatrix=new SeqMat<doubletype>(m,n,M,N,d_nnz,o_nnz); 100 } 101 else _error_("Matrix type: " << type << " not supported yet!"); 102 103 } 104 /*}}}*/ 105 /*FUNCTION Matrix(int M,int N,IssmDouble sparsity,int in_type){{{*/ 106 #ifdef _HAVE_PETSC_ 107 Matrix(int M,int N,double sparsity,int in_type=PetscMatType){ 108 #else 109 Matrix(int M,int N,double sparsity,int in_type=SeqMatType){ 110 #endif 111 112 #ifdef _HAVE_PETSC_ 113 pmatrix=NULL; 114 #endif 115 116 smatrix=NULL; 117 type=in_type; 118 119 if(type==PetscMatType){ 120 #ifdef _HAVE_PETSC_ 121 this->pmatrix=new PetscMat(M,N,sparsity); 122 #else 123 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 124 #endif 125 } 126 else if(type==SeqMatType){ 127 this->smatrix=new SeqMat<doubletype>(M,N,sparsity); 128 } 129 else _error_("Matrix type: " << type << " not supported yet!"); 130 } 131 /*}}}*/ 132 /*FUNCTION Matrix(IssmDouble* serial_mat, int M,int N,IssmDouble sparsity,int in_type){{{*/ 133 #ifdef _HAVE_PETSC_ 134 Matrix(IssmPDouble* serial_mat,int M,int N,IssmPDouble sparsity,int in_type=PetscMatType){ 135 #else 136 Matrix(IssmPDouble* serial_mat,int M,int N,IssmPDouble sparsity,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(serial_mat,M,N,sparsity); 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>(serial_mat,M,N,sparsity); 154 } 155 else _error_("Matrix type: " << type << " not supported yet!"); 156 157 } 158 /*}}}*/ 159 /*FUNCTION Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type){{{*/ 160 #ifdef _HAVE_PETSC_ 161 Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type=PetscMatType){ 162 #else 163 Matrix(int M,int N,int connectivity,int numberofdofspernode,int in_type=SeqMatType){ 164 #endif 165 166 #ifdef _HAVE_PETSC_ 167 pmatrix=NULL; 168 #endif 169 smatrix=NULL; 170 type=in_type; 171 172 if(type==PetscMatType){ 173 #ifdef _HAVE_PETSC_ 174 this->pmatrix=new PetscMat(M,N,connectivity,numberofdofspernode); 175 #else 176 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 177 #endif 178 } 179 else if(type==SeqMatType){ 180 this->smatrix=new SeqMat<doubletype>(M,N,connectivity,numberofdofspernode); 181 } 182 else _error_("Matrix type: " << type << " not supported yet!"); 183 184 } 185 /*}}}*/ 186 /*FUNCTION ~Matrix(){{{*/ 187 ~Matrix(){ 188 189 if(type==PetscMatType){ 190 #ifdef _HAVE_PETSC_ 191 delete this->pmatrix; 192 #endif 193 } 194 else if(type==SeqMatType){ 195 delete this->smatrix; 196 } 197 198 } 150 _error_("cannot create petsc matrix without PETSC compiled!"); 151 #endif 152 } 153 else if(strcmp(toolkittype,"issm")==0){ 154 /*let this choice stand:*/ 155 type=IssmMatType; 156 } 157 else _error_("unknow toolkit type "); 158 159 /*Free ressources: */ 160 xDelete<char>(toolkittype); 161 } 162 163 199 164 /*}}}*/ 200 165 … … 209 174 #endif 210 175 } 211 else if(type==SeqMatType){ 212 this->smatrix->Echo(); 213 } 214 else _error_("Matrix type: " << type << " not supported yet!"); 176 else{ 177 this->imatrix->Echo(); 178 } 215 179 216 180 } … … 224 188 #endif 225 189 } 226 else if(type==SeqMatType){ 227 //this->smatrix->AllocationInfo(); 228 } 229 else _error_("Matrix type: " << type << " not supported yet!"); 190 else{ 191 this->imatrix->AllocationInfo(); 192 } 230 193 }/*}}}*/ 231 194 /*FUNCTION Assemble{{{*/ … … 237 200 #endif 238 201 } 239 else if(type==SeqMatType){ 240 this->smatrix->Assemble(); 241 } 242 else{ 243 _error_("Matrix type: " << type << " not supported yet!"); 202 else{ 203 this->imatrix->Assemble(); 244 204 } 245 205 } … … 255 215 #endif 256 216 } 257 else if(type==SeqMatType){ 258 norm=this->smatrix->Norm(norm_type); 259 } 260 else _error_("Matrix type: " << type << " not supported yet!"); 217 else{ 218 norm=this->imatrix->Norm(norm_type); 219 } 261 220 262 221 return norm; … … 271 230 #endif 272 231 } 273 else if(type==SeqMatType){ 274 this->smatrix->GetSize(pM,pN); 275 } 276 else _error_("Matrix type: " << type << " not supported yet!"); 232 else{ 233 this->imatrix->GetSize(pM,pN); 234 } 277 235 278 236 } … … 286 244 #endif 287 245 } 288 else if(type==SeqMatType){ 289 this->smatrix->GetLocalSize(pM,pN); 290 } 291 else _error_("Matrix type: " << type << " not supported yet!"); 246 else{ 247 this->imatrix->GetLocalSize(pM,pN); 248 } 292 249 293 250 } … … 301 258 #endif 302 259 } 303 else if(type==SeqMatType){ 304 this->smatrix->MatMult(X->svector,AX->svector); 305 } 306 else _error_("Matrix type: " << type << " not supported yet!"); 260 else{ 261 this->imatrix->MatMult(X->ivector,AX->ivector); 262 } 307 263 308 264 } … … 318 274 #endif 319 275 } 320 else if(type==SeqMatType){ 321 output->smatrix=this->smatrix->Duplicate(); 322 } 323 else _error_("Matrix type: " << type << " not supported yet!"); 276 else{ 277 output->imatrix=this->imatrix->Duplicate(); 278 } 324 279 325 280 return output; … … 336 291 #endif 337 292 } 338 else if(type==SeqMatType){ 339 output=this->smatrix->ToSerial(); 340 } 341 else _error_("Matrix type: " << type << " not supported yet!"); 293 else{ 294 output=this->imatrix->ToSerial(); 295 } 342 296 343 297 return output; … … 352 306 #endif 353 307 } 354 else if(type==SeqMatType){ 355 this->smatrix->SetValues(m,idxm,n,idxn,values,mode); 356 } 357 else _error_("Matrix type: " << type << " not supported yet!"); 308 else{ 309 this->imatrix->SetValues(m,idxm,n,idxn,values,mode); 310 } 358 311 } 359 312 /*}}}*/ … … 366 319 #endif 367 320 } 368 else if(type==SeqMatType){ 369 this->smatrix->Convert(newtype); 370 } 371 else{ 372 _error_("Matrix type: " << type << " not supported yet!"); 321 else{ 322 this->imatrix->Convert(newtype); 373 323 } 374 324 -
issm/trunk-jpl/src/c/classes/matrix/Vector.h
r14433 r14656 16 16 #include "../../toolkits/toolkits.h" 17 17 #include "../../EnumDefinitions/EnumDefinitions.h" 18 19 18 /*}}}*/ 20 19 21 enum vectortype { PetscVecType, SeqVecType };20 enum vectortype { PetscVecType, IssmVecType }; 22 21 23 22 template <class doubletype> … … 30 29 PetscVec* pvector; 31 30 #endif 32 SeqVec<doubletype>* svector;31 IssmVec<doubletype>* ivector; 33 32 34 33 /*Vector constructors, destructors */ 35 /*FUNCTION Vector(){{{*/ 36 Vector(){ 37 38 #ifdef _HAVE_PETSC_ 39 this->pvector=NULL; 40 #endif 41 this->svector=NULL; 42 43 type=PetscVecType; //default 44 #ifndef _HAVE_PETSC_ 45 type=SeqVecType; 46 #endif 47 48 } 49 /*}}}*/ 50 /*FUNCTION Vector(int M,bool fromlocalsize,int in_type){{{*/ 34 Vector(){ /*{{{*/ 35 36 InitCheckAndSetType(); 37 } 38 /*}}}*/ 39 Vector(int M,bool fromlocalsize=false){ /*{{{*/ 40 41 InitCheckAndSetType(); 42 43 if(type==PetscVecType){ 44 #ifdef _HAVE_PETSC_ 45 this->pvector=new PetscVec(M,fromlocalsize); 46 #endif 47 } 48 else this->ivector=new IssmVec<doubletype>(M,fromlocalsize); 49 50 } 51 /*}}}*/ 52 Vector(int m,int M){ /*{{{*/ 53 54 InitCheckAndSetType(); 55 56 if(type==PetscVecType){ 57 #ifdef _HAVE_PETSC_ 58 this->pvector=new PetscVec(m,M); 59 #endif 60 } 61 else this->ivector=new IssmVec<doubletype>(m,M); 62 } 63 /*}}}*/ 64 Vector(doubletype* serial_vec,int M){ /*{{{*/ 65 66 InitCheckAndSetType(); 67 68 if(type==PetscVecType){ 69 #ifdef _HAVE_PETSC_ 70 this->pvector=new PetscVec(serial_vec,M); 71 #endif 72 } 73 else this->ivector=new IssmVec<doubletype>(serial_vec,M); 74 } 75 /*}}}*/ 76 ~Vector(){ /*{{{*/ 77 78 if(type==PetscVecType){ 79 #ifdef _HAVE_PETSC_ 80 delete this->pvector; 81 #endif 82 } 83 else delete this->ivector; 84 } 85 /*}}}*/ 51 86 #ifdef _HAVE_PETSC_ 52 Vector(int M,bool fromlocalsize=false,int in_type=PetscVecType){ 53 #else 54 Vector(int M,bool fromlocalsize=false,int in_type=SeqVecType){ 87 Vector(Vec petsc_vector){ /*{{{*/ 88 89 this->type=PetscVecType; 90 this->ivector=NULL; 91 this->pvector=new PetscVec(petsc_vector); 92 93 } 94 /*}}}*/ 55 95 #endif 96 void InitCheckAndSetType(void){ /*{{{*/ 97 98 char* toolkittype=NULL; 56 99 57 100 #ifdef _HAVE_PETSC_ 58 101 pvector=NULL; 59 102 #endif 60 svector=NULL; 61 type=in_type; 62 63 if(type==PetscVecType){ 64 #ifdef _HAVE_PETSC_ 65 this->pvector=new PetscVec(M,fromlocalsize); 66 #else 67 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 68 #endif 69 } 70 else if(type==SeqVecType){ 71 this->svector=new SeqVec<doubletype>(M,fromlocalsize); 72 } 73 else _error_("Vector type: " << type << " not supported yet!"); 74 75 } 76 /*}}}*/ 77 /*FUNCTION Vector(int m,int M,int in_type){{{*/ 78 #ifdef _HAVE_PETSC_ 79 Vector(int m,int M,int in_type=PetscVecType){ 80 #else 81 Vector(int m,int M,int in_type=SeqVecType){ 82 #endif 83 84 #ifdef _HAVE_PETSC_ 85 pvector=NULL; 86 #endif 87 svector=NULL; 88 type=in_type; 89 90 if(type==PetscVecType){ 91 #ifdef _HAVE_PETSC_ 92 this->pvector=new PetscVec(m,M); 93 #else 94 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 95 #endif 96 } 97 else if(type==SeqVecType){ 98 this->svector=new SeqVec<doubletype>(m,M); 99 } 100 else _error_("Vector type: " << type << " not supported yet!"); 101 102 } 103 /*}}}*/ 104 /*FUNCTION Vector(doubletype* serial_vec,int M,int in_type){{{*/ 105 #ifdef _HAVE_PETSC_ 106 Vector(doubletype* serial_vec,int M,int in_type=PetscVecType){ 107 #else 108 Vector(doubletype* serial_vec,int M,int in_type=SeqVecType){ 109 //} for vim 110 #endif 111 112 #ifdef _HAVE_PETSC_ 113 pvector=NULL; 114 #endif 115 116 svector=NULL; 117 type=in_type; 118 119 if(type==PetscVecType){ 120 #ifdef _HAVE_PETSC_ 121 this->pvector=new PetscVec(serial_vec,M); 103 ivector=NULL; 104 105 /*retrieve toolkittype: */ 106 toolkittype=ToolkitOptions::GetToolkitType(); 107 108 /*set vector type: */ 109 if (strcmp(toolkittype,"petsc")==0){ 110 #ifdef _HAVE_PETSC_ 111 type=PetscVecType; 122 112 #else 123 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 124 #endif 125 } 126 else if(type==SeqVecType){ 127 this->svector=new SeqVec<doubletype>(serial_vec,M); 128 } 129 else _error_("Vector type: " << type << " not supported yet!"); 130 131 } 132 /*}}}*/ 133 /*FUNCTION ~Vector(){{{*/ 134 ~Vector(){ 135 136 if(type==PetscVecType){ 137 #ifdef _HAVE_PETSC_ 138 delete this->pvector; 139 #endif 140 } 141 else if(type==SeqVecType){ 142 delete this->svector; 143 } 144 } 145 /*}}}*/ 146 #ifdef _HAVE_PETSC_ 147 /*FUNCTION Vector(Vec petsc_vector){{{*/ 148 Vector(Vec petsc_vector){ 149 150 this->type=PetscVecType; 151 this->svector=NULL; 152 this->pvector=new PetscVec(petsc_vector); 153 154 } 155 /*}}}*/ 156 #endif 113 _error_("cannot create petsc vector without PETSC compiled!"); 114 #endif 115 } 116 else if(strcmp(toolkittype,"issm")==0){ 117 /*let this choice stand:*/ 118 type=IssmVecType; 119 } 120 else _error_("unknow toolkit type "); 121 122 /*Free ressources: */ 123 xDelete<char>(toolkittype); 124 } 125 126 127 /*}}}*/ 157 128 158 129 /*Vector specific routines*/ … … 163 134 #ifdef _HAVE_PETSC_ 164 135 this->pvector->Echo(); 165 #else 166 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 167 #endif 168 } 169 else if(type==SeqVecType){ 170 this->svector->Echo(); 171 } 172 else _error_("Vector type: " << type << " not supported yet!"); 136 #endif 137 } 138 else this->ivector->Echo(); 173 139 174 140 } … … 180 146 #ifdef _HAVE_PETSC_ 181 147 this->pvector->Assemble(); 182 #else 183 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 184 #endif 185 } 186 else if(type==SeqVecType){ 187 this->svector->Assemble(); 188 } 189 else _error_("Vector type: " << type << " not supported yet!"); 148 #endif 149 } 150 else this->ivector->Assemble(); 190 151 191 152 } … … 196 157 #ifdef _HAVE_PETSC_ 197 158 this->pvector->SetValues(ssize,list,values,mode); 198 #else 199 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 200 #endif 201 } 202 else if(type==SeqVecType){ 203 this->svector->SetValues(ssize,list,values,mode); 204 } 205 else _error_("Vector type: " << type << " not supported yet!"); 159 #endif 160 } 161 else this->ivector->SetValues(ssize,list,values,mode); 206 162 207 163 } … … 213 169 #ifdef _HAVE_PETSC_ 214 170 this->pvector->SetValue(dof,value,mode); 215 #else 216 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 217 #endif 218 } 219 else if(type==SeqVecType){ 220 this->svector->SetValue(dof,value,mode); 221 } 222 else _error_("Vector type: " << type << " not supported yet!"); 171 #endif 172 } 173 else this->ivector->SetValue(dof,value,mode); 223 174 224 175 } … … 230 181 #ifdef _HAVE_PETSC_ 231 182 this->pvector->GetValue(pvalue,dof); 232 #else 233 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 234 #endif 235 } 236 else if(type==SeqVecType){ 237 this->svector->GetValue(pvalue,dof); 238 } 239 else _error_("Vector type: " << type << " not supported yet!"); 183 #endif 184 } 185 else this->ivector->GetValue(pvalue,dof); 240 186 241 187 } … … 247 193 #ifdef _HAVE_PETSC_ 248 194 this->pvector->GetSize(pM); 249 #else 250 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 251 #endif 252 } 253 else if(type==SeqVecType){ 254 this->svector->GetSize(pM); 255 } 256 else _error_("Vector type: " << type << " not supported yet!"); 195 #endif 196 } 197 else this->ivector->GetSize(pM); 257 198 258 199 } 259 200 /*}}}*/ 260 201 /*FUNCTION IsEmpty{{{*/ 261 bool IsEmpty(void){_assert_(this); 262 202 bool IsEmpty(void){ 263 203 int M; 264 204 205 _assert_(this); 265 206 this->GetSize(&M); 266 207 … … 277 218 #ifdef _HAVE_PETSC_ 278 219 this->pvector->GetLocalSize(pM); 279 #else 280 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 281 #endif 282 } 283 else if(type==SeqVecType){ 284 this->svector->GetLocalSize(pM); 285 } 286 else _error_("Vector type: " << type << " not supported yet!"); 220 #endif 221 } 222 else this->ivector->GetLocalSize(pM); 287 223 288 224 } … … 292 228 293 229 Vector* output=NULL; 294 295 if(type==PetscVecType){ 296 #ifdef _HAVE_PETSC_ 297 output=new Vector(); 230 231 output=new Vector(); 232 233 if(type==PetscVecType){ 234 #ifdef _HAVE_PETSC_ 298 235 output->pvector=this->pvector->Duplicate(); 299 #else 300 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 301 #endif 302 } 303 else if(type==SeqVecType){ 304 output=new Vector(); 305 output->svector=this->svector->Duplicate(); 306 } 307 else _error_("Vector type: " << type << " not supported yet!"); 236 #endif 237 } 238 else output->ivector=this->ivector->Duplicate(); 308 239 309 240 return output; … … 317 248 #ifdef _HAVE_PETSC_ 318 249 this->pvector->Set(value); 319 #else 320 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 321 #endif 322 } 323 else if(type==SeqVecType){ 324 this->svector->Set(value); 325 } 326 else _error_("Vector type: " << type << " not supported yet!"); 250 #endif 251 } 252 else this->ivector->Set(value); 327 253 328 254 } … … 334 260 #ifdef _HAVE_PETSC_ 335 261 this->pvector->AXPY(X->pvector,a); 336 #else 337 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 338 #endif 339 } 340 else if(type==SeqVecType){ 341 this->svector->AXPY(X->svector,a); 342 } 343 else _error_("Vector type: " << type << " not supported yet!"); 262 #endif 263 } 264 else this->ivector->AXPY(X->ivector,a); 344 265 345 266 } … … 351 272 #ifdef _HAVE_PETSC_ 352 273 this->pvector->AYPX(X->pvector,a); 353 #else 354 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 355 #endif 356 } 357 else if(type==SeqVecType){ 358 this->svector->AYPX(X->svector,a); 359 } 360 else _error_("Vector type: " << type << " not supported yet!"); 361 274 #endif 275 } 276 else this->ivector->AYPX(X->ivector,a); 362 277 } 363 278 /*}}}*/ 364 279 /*FUNCTION ToMPISerial{{{*/ 365 doubletype* ToMPISerial(void){ _assert_(this);280 doubletype* ToMPISerial(void){ 366 281 367 282 doubletype* vec_serial=NULL; 368 283 284 _assert_(this); 369 285 if(type==PetscVecType){ 370 286 #ifdef _HAVE_PETSC_ 371 287 vec_serial=this->pvector->ToMPISerial(); 372 #else 373 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 374 #endif 375 } 376 else if(type==SeqVecType){ 377 vec_serial=this->svector->ToMPISerial(); 378 } 379 else _error_("Vector type: " << type << " not supported yet!"); 288 #endif 289 } 290 else vec_serial=this->ivector->ToMPISerial(); 380 291 381 292 return vec_serial; … … 389 300 #ifdef _HAVE_PETSC_ 390 301 this->pvector->Copy(to->pvector); 391 #else 392 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 393 #endif 394 } 395 else if(type==SeqVecType){ 396 this->svector->Copy(to->svector); 397 } 398 else _error_("Vector type: " << type << " not supported yet!"); 399 302 #endif 303 } 304 else this->ivector->Copy(to->ivector); 400 305 } 401 306 /*}}}*/ … … 408 313 #ifdef _HAVE_PETSC_ 409 314 norm=this->pvector->Norm(norm_type); 410 #else 411 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 412 #endif 413 } 414 else if(type==SeqVecType){ 415 norm=this->svector->Norm(norm_type); 416 } 417 else _error_("Vector type: " << type << " not supported yet!"); 418 315 #endif 316 } 317 else norm=this->ivector->Norm(norm_type); 419 318 return norm; 420 319 } … … 426 325 #ifdef _HAVE_PETSC_ 427 326 this->pvector->Scale(scale_factor); 428 #else 429 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 430 #endif 431 } 432 else if(type==SeqVecType){ 433 this->svector->Scale(scale_factor); 434 } 435 else _error_("Vector type: " << type << " not supported yet!"); 436 327 #endif 328 } 329 else this->ivector->Scale(scale_factor); 437 330 } 438 331 /*}}}*/ … … 445 338 #ifdef _HAVE_PETSC_ 446 339 dot=this->pvector->Dot(vector->pvector); 447 #else 448 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 449 #endif 450 } 451 else if(type==SeqVecType){ 452 dot=this->svector->Dot(vector->svector); 453 } 454 else _error_("Vector type: " << type << " not supported yet!"); 455 340 #endif 341 } 342 else dot=this->ivector->Dot(vector->ivector); 456 343 return dot; 457 344 } … … 463 350 #ifdef _HAVE_PETSC_ 464 351 this->pvector->PointwiseDivide(x->pvector,y->pvector); 465 #else 466 _error_("Petsc matrix format not usable, as Petsc has not been compiled!"); 467 #endif 468 } 469 else if(type==SeqVecType){ 470 this->svector->PointwiseDivide(x->svector,y->svector); 471 } 472 else _error_("Vector type: " << type << " not supported yet!"); 473 352 #endif 353 } 354 else this->ivector->PointwiseDivide(x->ivector,y->ivector); 474 355 } 475 356 /*}}}*/ -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.cpp
r13762 r14656 10 10 #include "./ContourToMeshx.h" 11 11 12 int ContourToMeshx( SeqVec<double>** pin_nod,SeqVec<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {12 int ContourToMeshx(IssmSeqVec<double>** pin_nod,IssmSeqVec<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) { 13 13 14 14 /*Contour:*/ … … 24 24 25 25 /*output: */ 26 SeqVec<double>* in_nod=NULL;27 SeqVec<double>* in_elem=NULL;28 in_nod = new SeqVec<double>(nods);29 in_elem = new SeqVec<double>(nel);26 IssmSeqVec<double>* in_nod=NULL; 27 IssmSeqVec<double>* in_elem=NULL; 28 in_nod = new IssmSeqVec<double>(nods); 29 in_elem = new IssmSeqVec<double>(nel); 30 30 31 31 /*initialize thread parameters: */ -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshx.h
r13623 r14656 15 15 int nods; 16 16 int edgevalue; 17 SeqVec<double> *in_nod;17 IssmSeqVec<double> *in_nod; 18 18 double *x; 19 19 double *y; … … 22 22 23 23 /* local prototypes: */ 24 int ContourToMeshx( SeqVec<double>** pin_nods,SeqVec<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);24 int ContourToMeshx(IssmSeqVec<double>** pin_nods,IssmSeqVec<double>** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue); 25 25 26 26 void* ContourToMeshxt(void* vContourToMeshxThreadStruct); -
issm/trunk-jpl/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
r13622 r14656 33 33 double* x=NULL; 34 34 double* y=NULL; 35 SeqVec<double>* in_nod=NULL;35 IssmSeqVec<double>* in_nod=NULL; 36 36 37 37 /*recover handle and gate: */ -
issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
r13813 r14656 4 4 #include "./ContourToNodesx.h" 5 5 6 int ContourToNodesx( SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){6 int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue){ 7 7 8 8 int i; … … 15 15 16 16 /*output: */ 17 SeqVec<IssmPDouble>* flags=NULL;18 flags=new SeqVec<IssmPDouble>(nods);17 IssmSeqVec<IssmPDouble>* flags=NULL; 18 flags=new IssmSeqVec<IssmPDouble>(nods); 19 19 20 20 /*Loop through all contours: */ … … 35 35 } 36 36 37 int ContourToNodesx( SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){37 int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){ 38 38 39 39 /*Contour:*/ … … 43 43 44 44 /*output: */ 45 SeqVec<IssmPDouble>* flags=NULL;46 flags=new SeqVec<IssmPDouble>(nods);45 IssmSeqVec<IssmPDouble>* flags=NULL; 46 flags=new IssmSeqVec<IssmPDouble>(nods); 47 47 48 48 /*Loop through all contours: */ -
issm/trunk-jpl/src/c/modules/ContourToNodesx/ContourToNodesx.h
r13229 r14656 10 10 11 11 /* local prototypes: */ 12 int ContourToNodesx( SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue);13 int ContourToNodesx( SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);12 int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, Contour<IssmPDouble>** contours,int numcontours,int edgevalue); 13 int ContourToNodesx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue); 14 14 15 15 #endif /* _CONTOURTONODESX_H */ -
issm/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
r14655 r14656 519 519 case XYEnum : return "XY"; 520 520 case XYZPEnum : return "XYZP"; 521 case DenseEnum : return "Dense"; 522 case MpiDenseEnum : return "MpiDense"; 523 case SeqEnum : return "Seq"; 524 case MpiEnum : return "Mpi"; 521 525 case OptionEnum : return "Option"; 522 526 case GenericOptionEnum : return "GenericOption"; -
issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
r13787 r14656 17 17 18 18 /*InterpFromGridToMeshx{{{*/ 19 int InterpFromGridToMeshx( SeqVec<IssmPDouble>** 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(IssmSeqVec<IssmPDouble>** 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 SeqVec<IssmPDouble>* data_mesh=NULL;22 IssmSeqVec<IssmPDouble>* data_mesh=NULL; 23 23 24 24 /*Intermediary*/ … … 46 46 47 47 /*Allocate output vector: */ 48 data_mesh=new SeqVec<IssmPDouble>(nods);48 data_mesh=new IssmSeqVec<IssmPDouble>(nods); 49 49 50 50 /*Find out what kind of coordinates (x_in,y_in) have been given is input*/ … … 126 126 double *y = gate->y; 127 127 int nods = gate->nods; 128 SeqVec<IssmPDouble>*data_mesh = gate->data_mesh;128 IssmSeqVec<IssmPDouble>*data_mesh = gate->data_mesh; 129 129 double *data = gate->data; 130 130 double default_value = gate->default_value; -
issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h
r13229 r14656 24 24 double* x_mesh; 25 25 double* y_mesh; 26 SeqVec<IssmPDouble>* data_mesh;26 IssmSeqVec<IssmPDouble>* data_mesh; 27 27 } InterpFromGridToMeshxThreadStruct; 28 28 29 int InterpFromGridToMeshx( SeqVec<IssmPDouble>** 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(IssmSeqVec<IssmPDouble>** 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
r13787 r14656 10 10 #include "../modules.h" 11 11 12 int InterpFromMesh2dx( SeqVec<IssmPDouble>** pdata_prime,12 int InterpFromMesh2dx(IssmSeqVec<IssmPDouble>** pdata_prime, 13 13 double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, 14 14 double* x_prime, double* y_prime, int nods_prime, … … 16 16 17 17 /*Output*/ 18 SeqVec<IssmPDouble>* data_prime=NULL;18 IssmSeqVec<IssmPDouble>* data_prime=NULL; 19 19 20 20 /*Intermediary*/ … … 26 26 27 27 /*contours: */ 28 SeqVec<IssmPDouble> *vec_incontour = NULL;28 IssmSeqVec<IssmPDouble> *vec_incontour = NULL; 29 29 double *incontour = NULL; 30 30 … … 70 70 71 71 /*Initialize output*/ 72 data_prime=new SeqVec<IssmPDouble>(nods_prime);72 data_prime=new IssmSeqVec<IssmPDouble>(nods_prime); 73 73 if(num_default_values){ 74 74 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
r13623 r14656 22 22 double ymin,ymax; 23 23 int nods_prime; 24 SeqVec<IssmPDouble> *data_prime;24 IssmSeqVec<IssmPDouble> *data_prime; 25 25 double *x_prime; 26 26 double *y_prime; … … 31 31 } InterpFromMesh2dxThreadStruct; 32 32 33 int InterpFromMesh2dx( SeqVec<IssmPDouble>** 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,33 int InterpFromMesh2dx(IssmSeqVec<IssmPDouble>** 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, 34 34 double* default_values,int num_default_values,Contour<IssmPDouble>** contours,int numcontours); 35 35 -
issm/trunk-jpl/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp
r13622 r14656 32 32 double ymax = gate->ymax; 33 33 int nods_prime = gate->nods_prime; 34 SeqVec<IssmPDouble>* data_prime = gate->data_prime;34 IssmSeqVec<IssmPDouble>* 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
r13229 r14656 7 7 #include "../../include/include.h" 8 8 9 int InterpFromMeshToMesh3dx( SeqVec<IssmPDouble>** 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( IssmSeqVec<IssmPDouble>** 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 SeqVec<IssmPDouble>* data_prime=NULL;12 IssmSeqVec<IssmPDouble>* data_prime=NULL; 13 13 14 14 /*Intermediary*/ … … 54 54 55 55 /*Initialize output*/ 56 data_prime=new SeqVec<IssmPDouble>(nods_prime);56 data_prime=new IssmSeqVec<IssmPDouble>(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
r13229 r14656 9 9 #include "../../classes/objects/objects.h" 10 10 11 int InterpFromMeshToMesh3dx( SeqVec<IssmPDouble>** 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(IssmSeqVec<IssmPDouble>** 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/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp
r13229 r14656 4 4 #include "./PointCloudFindNeighborsx.h" 5 5 6 int PointCloudFindNeighborsx( SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread){6 int PointCloudFindNeighborsx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread){ 7 7 8 8 /*output: */ 9 SeqVec<IssmPDouble>* flags=NULL;10 flags=new SeqVec<IssmPDouble>(nods);9 IssmSeqVec<IssmPDouble>* flags=NULL; 10 flags=new IssmSeqVec<IssmPDouble>(nods); 11 11 12 12 /*threading: */ -
issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.h
r13623 r14656 10 10 11 11 /* local prototypes: */ 12 int PointCloudFindNeighborsx( SeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread);12 int PointCloudFindNeighborsx(IssmSeqVec<IssmPDouble>** pflags,double* x, double* y, int nods, double mindistance,double multithread); 13 13 14 14 /*threading: */ … … 19 19 int nods; 20 20 double mindistance; 21 SeqVec<IssmPDouble>* flags;21 IssmSeqVec<IssmPDouble>* flags; 22 22 23 23 } PointCloudFindNeighborsThreadStruct; -
issm/trunk-jpl/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp
r13622 r14656 17 17 int nods; 18 18 double mindistance; 19 SeqVec<IssmPDouble>* flags;19 IssmSeqVec<IssmPDouble>* flags; 20 20 21 21 /*recover handle and gate: */ -
issm/trunk-jpl/src/c/modules/Solverx/Solverx.cpp
r13762 r14656 37 37 break;} 38 38 #endif 39 case SeqMatType:{40 SolverxSeq(&uf-> svector,Kff->smatrix,pf->svector,parameters);39 case IssmMatType:{ 40 SolverxSeq(&uf->ivector,Kff->imatrix,pf->ivector,parameters); 41 41 break;} 42 42 default: -
issm/trunk-jpl/src/c/modules/Solverx/Solverx.h
r13767 r14656 13 13 14 14 #include "../../classes/objects/objects.h" 15 #include "../../toolkits/toolkits.h" 15 16 16 17 /* local prototypes: */ … … 23 24 #endif 24 25 25 void SolverxSeq( SeqVec<IssmDouble>** puf,SeqMat<IssmDouble>* Kff, SeqVec<IssmDouble>* pf,Parameters* parameters);26 void SolverxSeq(IssmVec<IssmDouble>** puf,IssmMat<IssmDouble>* Kff, IssmVec<IssmDouble>* pf,Parameters* parameters); 26 27 void SolverxSeq(IssmPDouble **pX, IssmPDouble *A, IssmPDouble *B,int n); 27 28 void SolverxSeq(IssmPDouble *X, IssmPDouble *A, IssmPDouble *B,int n); -
issm/trunk-jpl/src/c/modules/Solverx/SolverxSeq.cpp
r13813 r14656 20 20 #endif 21 21 22 void SolverxSeq(SeqVec<IssmDouble>** puf,SeqMat<IssmDouble>* Kff, SeqVec<IssmDouble>* pf, Parameters* parameters){/*{{{*/ 22 void SolverxSeq(IssmVec<IssmDouble>** pout,IssmMat<IssmDouble>* Kffin, IssmVec<IssmDouble>* pfin, Parameters* parameters){/*{{{*/ 23 24 /*First off, we assume that the type of IssmVec is IssmSeqVec and the type of IssmMat is IssmDenseMat. So downcast: */ 25 IssmSeqVec<IssmDouble>* pf=(IssmSeqVec<IssmDouble>*)pfin->vector; 26 IssmDenseMat<IssmDouble>* Kff=(IssmDenseMat<IssmDouble>*)Kffin->matrix; 23 27 24 28 #ifdef _HAVE_GSL_ 25 29 /*Intermediary: */ 26 30 int M,N,N2; 27 SeqVec<IssmDouble> *uf = NULL;31 IssmSeqVec<IssmDouble> *uf = NULL; 28 32 29 33 Kff->GetSize(&M,&N); … … 42 46 #endif 43 47 44 uf=new SeqVec<IssmDouble>(x,N);48 uf=new IssmSeqVec<IssmDouble>(x,N); 45 49 xDelete(x); 46 50 47 51 /*Assign output pointers:*/ 48 *puf=uf; 52 IssmVec<IssmDouble>* out=new IssmVec<IssmDouble>(); 53 out->matrix=(IssmAbsMat<IssmDouble>*)uf; 54 *pout=out; 49 55 50 56 #else -
issm/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
r14655 r14656 532 532 else if (strcmp(name,"XY")==0) return XYEnum; 533 533 else if (strcmp(name,"XYZP")==0) return XYZPEnum; 534 else if (strcmp(name,"Dense")==0) return DenseEnum; 535 else if (strcmp(name,"MpiDense")==0) return MpiDenseEnum; 536 else if (strcmp(name,"Seq")==0) return SeqEnum; 537 else if (strcmp(name,"Mpi")==0) return MpiEnum; 534 538 else if (strcmp(name,"Option")==0) return OptionEnum; 535 539 else if (strcmp(name,"GenericOption")==0) return GenericOptionEnum; -
issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
r14222 r14656 22 22 /*}}}*/ 23 23 24 void TriMeshx( SeqMat<int>** pindex,SeqVec<IssmPDouble>** px,SeqVec<IssmPDouble>** py,SeqMat<int>** psegments,SeqVec<int>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){24 void TriMeshx(IssmDenseMat<int>** pindex,IssmSeqVec<IssmPDouble>** px,IssmSeqVec<IssmPDouble>** py,IssmDenseMat<int>** psegments,IssmSeqVec<int>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){ 25 25 26 26 #if !defined(_HAVE_TRIANGLE_) … … 32 32 /*output: */ 33 33 int *index = NULL; 34 SeqMat<int> *index_matrix = NULL;34 IssmDenseMat<int> *index_matrix = NULL; 35 35 double *x = NULL; 36 36 double *y = NULL; 37 37 int *segments = NULL; 38 SeqMat<int> *segments_matrix = NULL;38 IssmDenseMat<int> *segments_matrix = NULL; 39 39 int *segmentmarkerlist = NULL; 40 40 … … 197 197 198 198 /*Output : */ 199 index_matrix=new SeqMat<int>(index,out.numberoftriangles,3,1);199 index_matrix=new IssmDenseMat<int>(index,out.numberoftriangles,3,1); 200 200 *pindex=index_matrix; 201 201 202 segments_matrix=new SeqMat<int>(segments,out.numberofsegments,3,1);202 segments_matrix=new IssmDenseMat<int>(segments,out.numberofsegments,3,1); 203 203 *psegments=segments_matrix; 204 204 205 *px=new SeqVec<IssmPDouble>(x,out.numberofpoints);206 *py=new SeqVec<IssmPDouble>(y,out.numberofpoints);207 *psegmentmarkerlist=new SeqVec<int>(segmentmarkerlist,out.numberofsegments);205 *px=new IssmSeqVec<IssmPDouble>(x,out.numberofpoints); 206 *py=new IssmSeqVec<IssmPDouble>(y,out.numberofpoints); 207 *psegmentmarkerlist=new IssmSeqVec<int>(segmentmarkerlist,out.numberofsegments); 208 208 #endif 209 209 } -
issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.h
r14222 r14656 11 11 12 12 /* local prototypes: */ 13 void TriMeshx( SeqMat<int>** pindex,SeqVec<IssmPDouble>** px,SeqVec<IssmPDouble>** py,SeqMat<int>** psegments,SeqVec<int>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);13 void TriMeshx(IssmDenseMat<int>** pindex,IssmSeqVec<IssmPDouble>** px,IssmSeqVec<IssmPDouble>** py,IssmDenseMat<int>** psegments,IssmSeqVec<int>** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area); 14 14 15 15 #endif /* _TRIMESHX_H */ -
issm/trunk-jpl/src/c/shared/Exp/exp.h
r14551 r14656 18 18 /*IsInPoly {{{*/ 19 19 template <class doubletype> 20 int IsInPoly( SeqVec<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){20 int IsInPoly(IssmSeqVec<doubletype>* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue){ 21 21 22 22 int i; -
issm/trunk-jpl/src/c/toolkits/issm/issmtoolkit.h
r13216 r14656 6 6 #define _ISSM_TOOLKIT_H_ 7 7 8 #include "./SeqMat.h" 9 #include "./SeqVec.h" 8 #include "./IssmAbsMat.h" 9 #include "./IssmAbsVec.h" 10 #include "./IssmDenseMat.h" 11 #include "./IssmMat.h" 12 #include "./IssmMpiDenseMat.h" 13 #include "./IssmMpiVec.h" 14 #include "./IssmSeqVec.h" 15 #include "./IssmVec.h" 10 16 11 17 #endif -
issm/trunk-jpl/src/m/enum/EnumDefinitions.py
r14655 r14656 5029 5029 return StringToEnum('XYZP')[0] 5030 5030 5031 def DenseEnum(): 5032 """ 5033 DENSEENUM - Enum of Dense 5034 5035 Usage: 5036 macro=DenseEnum() 5037 """ 5038 5039 return StringToEnum('Dense')[0] 5040 5041 def MpiDenseEnum(): 5042 """ 5043 MPIDENSEENUM - Enum of MpiDense 5044 5045 Usage: 5046 macro=MpiDenseEnum() 5047 """ 5048 5049 return StringToEnum('MpiDense')[0] 5050 5051 def SeqEnum(): 5052 """ 5053 SEQENUM - Enum of Seq 5054 5055 Usage: 5056 macro=SeqEnum() 5057 """ 5058 5059 return StringToEnum('Seq')[0] 5060 5061 def MpiEnum(): 5062 """ 5063 MPIENUM - Enum of Mpi 5064 5065 Usage: 5066 macro=MpiEnum() 5067 """ 5068 5069 return StringToEnum('Mpi')[0] 5070 5031 5071 def OptionEnum(): 5032 5072 """ … … 5127 5167 """ 5128 5168 5129 return 51 15130 5169 return 515 5170 -
issm/trunk-jpl/src/m/enum/MaximumNumberOfEnums.m
r14655 r14656 9 9 % macro=MaximumNumberOfEnums() 10 10 11 macro=51 1;11 macro=515; -
issm/trunk-jpl/src/wrappers/ContourToMesh/ContourToMesh.cpp
r13447 r14656 40 40 41 41 /* output: */ 42 SeqVec<double> *in_nod = NULL;43 SeqVec<double> *in_elem = NULL;42 IssmSeqVec<double> *in_nod = NULL; 43 IssmSeqVec<double> *in_elem = NULL; 44 44 45 45 /*Boot module: */ -
issm/trunk-jpl/src/wrappers/ContourToNodes/ContourToNodes.cpp
r13353 r14656 25 25 26 26 /* output: */ 27 SeqVec<double> *flags = NULL;27 IssmSeqVec<double> *flags = NULL; 28 28 29 29 /*Boot module: */ -
issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.cpp
r13923 r14656 42 42 43 43 /* output: */ 44 SeqVec<double>* data_mesh=NULL;44 IssmSeqVec<double>* data_mesh=NULL; 45 45 46 46 /*Boot module: */ -
issm/trunk-jpl/src/wrappers/InterpFromMesh2d/InterpFromMesh2d.cpp
r13236 r14656 60 60 61 61 /* output: */ 62 SeqVec<double> *data_prime = NULL;62 IssmSeqVec<double> *data_prime = NULL; 63 63 64 64 /*Boot module: */ -
issm/trunk-jpl/src/wrappers/InterpFromMeshToMesh3d/InterpFromMeshToMesh3d.cpp
r13236 r14656 60 60 61 61 /* output: */ 62 SeqVec<double>* data_prime=NULL;62 IssmSeqVec<double>* data_prime=NULL; 63 63 64 64 /*Boot module: */ -
issm/trunk-jpl/src/wrappers/MeshProfileIntersection/MeshProfileIntersection.cpp
r14220 r14656 76 76 //contours 77 77 FetchData(&domain,FILENAME); 78 // MeshProfileIntersectionx should be modified to take DataSet directly (and perhaps SeqMat andSeqVec).78 // MeshProfileIntersectionx should be modified to take DataSet directly (and perhaps IssmDenseMat and IssmSeqVec). 79 79 numcontours=domain->Size(); 80 80 contours=xNew<Contour<double>*>(numcontours); -
issm/trunk-jpl/src/wrappers/PointCloudFindNeighbors/PointCloudFindNeighbors.cpp
r13236 r14656 27 27 28 28 /* output: */ 29 SeqVec<double> *flags = NULL;29 IssmSeqVec<double> *flags = NULL; 30 30 31 31 /*Boot module: */ -
issm/trunk-jpl/src/wrappers/TriMesh/TriMesh.cpp
r14221 r14656 22 22 23 23 /* output: */ 24 SeqMat<int> *index = NULL;25 SeqVec<double> *x = NULL;26 SeqVec<double> *y = NULL;27 SeqMat<int> *segments = NULL;28 SeqVec<int> *segmentmarkerlist = NULL;24 IssmDenseMat<int> *index = NULL; 25 IssmSeqVec<double> *x = NULL; 26 IssmSeqVec<double> *y = NULL; 27 IssmDenseMat<int> *segments = NULL; 28 IssmSeqVec<int> *segmentmarkerlist = NULL; 29 29 30 30 /*Boot module: */ -
issm/trunk-jpl/src/wrappers/matlab/Makefile.am
r14467 r14656 23 23 ./io/MatlabVectorToDoubleVector.cpp\ 24 24 ./io/MatlabMatrixToDoubleMatrix.cpp\ 25 ./io/MatlabMatrixTo SeqMat.cpp\26 ./io/MatlabVectorTo SeqVec.cpp25 ./io/MatlabMatrixToIssmDenseMat.cpp\ 26 ./io/MatlabVectorToIssmSeqVec.cpp 27 27 28 28 if PETSC -
issm/trunk-jpl/src/wrappers/matlab/io/MatlabMatrixToMatrix.cpp
r13749 r14656 25 25 matrix->pmatrix=MatlabMatrixToPetscMat(mxmatrix); 26 26 #else 27 matrix->smatrix=MatlabMatrixTo SeqMat(mxmatrix);27 matrix->smatrix=MatlabMatrixToIssmDenseMat(mxmatrix); 28 28 #endif 29 29 -
issm/trunk-jpl/src/wrappers/matlab/io/MatlabVectorToVector.cpp
r13749 r14656 25 25 vector->pvector=MatlabVectorToPetscVec(mxvector); 26 26 #else 27 vector->svector=MatlabVectorTo SeqVec(mxvector);27 vector->svector=MatlabVectorToIssmSeqVec(mxvector); 28 28 #endif 29 29 -
issm/trunk-jpl/src/wrappers/matlab/io/WriteMatlabData.cpp
r14221 r14656 221 221 } 222 222 /*}}}*/ 223 /*FUNCTION WriteData(mxArray** pdataref, SeqMat<double>* matrix){{{*/224 void WriteData(mxArray** pdataref, SeqMat<double>* matrix){223 /*FUNCTION WriteData(mxArray** pdataref,IssmDenseMat<double>* matrix){{{*/ 224 void WriteData(mxArray** pdataref,IssmDenseMat<double>* matrix){ 225 225 226 226 int i,j; … … 259 259 } 260 260 /*}}}*/ 261 /*FUNCTION WriteData(mxArray** pdataref, SeqVec<double>* vector){{{*/262 void WriteData(mxArray** pdataref, SeqVec<double>* vector){261 /*FUNCTION WriteData(mxArray** pdataref,IssmSeqVec<double>* vector){{{*/ 262 void WriteData(mxArray** pdataref,IssmSeqVec<double>* vector){ 263 263 264 264 mxArray* dataref=NULL; … … 290 290 } 291 291 /*}}}*/ 292 /*FUNCTION WriteData(mxArray** pdataref, SeqMat<int>* matrix){{{*/293 void WriteData(mxArray** pdataref, SeqMat<int>* matrix){292 /*FUNCTION WriteData(mxArray** pdataref,IssmDenseMat<int>* matrix){{{*/ 293 void WriteData(mxArray** pdataref,IssmDenseMat<int>* matrix){ 294 294 295 295 int i,j; … … 328 328 } 329 329 /*}}}*/ 330 /*FUNCTION WriteData(mxArray** pdataref, SeqVec<int>* vector){{{*/331 void WriteData(mxArray** pdataref, SeqVec<int>* vector){330 /*FUNCTION WriteData(mxArray** pdataref,IssmSeqVec<int>* vector){{{*/ 331 void WriteData(mxArray** pdataref,IssmSeqVec<int>* vector){ 332 332 333 333 mxArray* dataref=NULL; -
issm/trunk-jpl/src/wrappers/matlab/io/matlabio.h
r14221 r14656 16 16 #include "../../c/Container/Container.h" 17 17 #include "../../c/include/include.h" 18 #include "../../c/toolkits/toolkits.h" 18 19 19 void WriteData(mxArray** pdataref, SeqMat<int>* matrix);20 void WriteData(mxArray** pdataref, SeqMat<double>* matrix);20 void WriteData(mxArray** pdataref,IssmDenseMat<int>* matrix); 21 void WriteData(mxArray** pdataref,IssmDenseMat<double>* matrix); 21 22 void WriteData(mxArray** pdataref,double* matrix, int M,int N); 22 23 void WriteData(mxArray** pdataref,int* matrix, int M,int N); 23 void WriteData(mxArray** pdataref, SeqVec<int>* vector);24 void WriteData(mxArray** pdataref, SeqVec<double>* vector);24 void WriteData(mxArray** pdataref,IssmSeqVec<int>* vector); 25 void WriteData(mxArray** pdataref,IssmSeqVec<double>* vector); 25 26 void WriteData(mxArray** pdataref,double* vector, int M); 26 27 void WriteData(mxArray** pdataref,int integer); … … 82 83 int MatlabNArrayToNArray(char** pmatrix,int* pmatrix_numel,int* pmatrix_ndims,int** pmatrix_size,const mxArray* mxmatrix); 83 84 84 /*Matlab to SeqMat routines: */85 SeqMat<double>* MatlabMatrixToSeqMat(const mxArray* dataref);86 SeqVec<double>* MatlabVectorToSeqVec(const mxArray* dataref);85 /*Matlab to IssmDenseMat routines: */ 86 IssmDenseMat<double>* MatlabMatrixToIssmDenseMat(const mxArray* dataref); 87 IssmSeqVec<double>* MatlabVectorToIssmSeqVec(const mxArray* dataref); 87 88 88 89 /*Matlab to Petsc routines: */ -
issm/trunk-jpl/src/wrappers/python/io/WritePythonData.cpp
r14234 r14656 129 129 } 130 130 /*}}}*/ 131 /*FUNCTION WriteData(PyObject* py_tuple,int index, SeqMat<double>* matrix){{{*/132 void WriteData(PyObject* py_tuple,int index, SeqMat<double>* matrix){131 /*FUNCTION WriteData(PyObject* py_tuple,int index,IssmDenseMat<double>* matrix){{{*/ 132 void WriteData(PyObject* py_tuple,int index,IssmDenseMat<double>* matrix){ 133 133 134 134 int M,N; … … 147 147 148 148 }/*}}}*/ 149 /*FUNCTION WriteData(PyObject* py_tuple,int index, SeqVec<double>* vector){{{*/150 void WriteData(PyObject* py_tuple,int index, SeqVec<double>* vector){149 /*FUNCTION WriteData(PyObject* py_tuple,int index,IssmSeqVec<double>* vector){{{*/ 150 void WriteData(PyObject* py_tuple,int index,IssmSeqVec<double>* vector){ 151 151 152 152 int M; … … 164 164 } 165 165 /*}}}*/ 166 /*FUNCTION WriteData(PyObject* py_tuple,int index, SeqMat<int>* matrix){{{*/167 void WriteData(PyObject* py_tuple,int index, SeqMat<int>* matrix){166 /*FUNCTION WriteData(PyObject* py_tuple,int index,IssmDenseMat<int>* matrix){{{*/ 167 void WriteData(PyObject* py_tuple,int index,IssmDenseMat<int>* matrix){ 168 168 169 169 int M,N; … … 187 187 188 188 }/*}}}*/ 189 /*FUNCTION WriteData(PyObject* py_tuple,int index, SeqVec<int>* vector){{{*/190 void WriteData(PyObject* py_tuple,int index, SeqVec<int>* vector){189 /*FUNCTION WriteData(PyObject* py_tuple,int index,IssmSeqVec<int>* vector){{{*/ 190 void WriteData(PyObject* py_tuple,int index,IssmSeqVec<int>* vector){ 191 191 192 192 int M; … … 209 209 } 210 210 /*}}}*/ 211 /*FUNCTION WriteData(PyObject* py_tuple,int index, SeqMat<bool>* matrix){{{*/212 void WriteData(PyObject* py_tuple,int index, SeqMat<bool>* matrix){211 /*FUNCTION WriteData(PyObject* py_tuple,int index,IssmDenseMat<bool>* matrix){{{*/ 212 void WriteData(PyObject* py_tuple,int index,IssmDenseMat<bool>* matrix){ 213 213 214 214 int M,N; … … 227 227 228 228 }/*}}}*/ 229 /*FUNCTION WriteData(PyObject* py_tuple,int index, SeqVec<bool>* vector){{{*/230 void WriteData(PyObject* py_tuple,int index, SeqVec<bool>* vector){229 /*FUNCTION WriteData(PyObject* py_tuple,int index,IssmSeqVec<bool>* vector){{{*/ 230 void WriteData(PyObject* py_tuple,int index,IssmSeqVec<bool>* vector){ 231 231 232 232 int M; -
issm/trunk-jpl/src/wrappers/python/io/pythonio.h
r14234 r14656 23 23 void WriteData(PyObject* py_tuple,int index, char* string); 24 24 void WriteData(PyObject* py_tuple,int index); 25 void WriteData(PyObject* py_tuple,int index, SeqMat<double>* matrix);26 void WriteData(PyObject* py_tuple,int index, SeqVec<double>* vector);27 void WriteData(PyObject* py_tuple,int index, SeqMat<int>* matrix);28 void WriteData(PyObject* py_tuple,int index, SeqVec<int>* vector);29 void WriteData(PyObject* py_tuple,int index, SeqMat<bool>* matrix);30 void WriteData(PyObject* py_tuple,int index, SeqVec<bool>* vector);25 void WriteData(PyObject* py_tuple,int index, IssmDenseMat<double>* matrix); 26 void WriteData(PyObject* py_tuple,int index, IssmSeqVec<double>* vector); 27 void WriteData(PyObject* py_tuple,int index, IssmDenseMat<int>* matrix); 28 void WriteData(PyObject* py_tuple,int index, IssmSeqVec<int>* vector); 29 void WriteData(PyObject* py_tuple,int index, IssmDenseMat<bool>* matrix); 30 void WriteData(PyObject* py_tuple,int index, IssmSeqVec<bool>* vector); 31 31 void WriteData(PyObject* py_tuple,int index, BamgGeom* bamggeom); 32 32 void WriteData(PyObject* py_tuple,int index, BamgMesh* bamgmesh);
Note:
See TracChangeset
for help on using the changeset viewer.