Changeset 6027
- Timestamp:
- 09/24/10 11:56:20 (15 years ago)
- Location:
- issm/trunk/src/c/objects/Numerics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Numerics/ElementMatrix.cpp
r6021 r6027 250 250 251 251 /*ElementMatrix specific routines: */ 252 /*FUNCTION ElementMatrix::AddValues{{{1*/253 void ElementMatrix::AddValues(double* Ke_gg){254 255 if(Ke_gg){256 for (int i=0;i<this->nrows;i++){257 for(int j=0;j<this->ncols;j++){258 *(this->values+this->ncols*i+j)+=*(Ke_gg+this->ncols*i+j);259 }260 }261 }262 }263 /*}}}*/264 252 /*FUNCTION ElementMatrix::AddToGlobal{{{1*/ 265 253 void ElementMatrix::AddToGlobal(Mat Kgg, Mat Kff, Mat Kfs){ … … 327 315 } 328 316 /*}}}*/ 317 /*FUNCTION ElementMatrix::Transpose{{{1*/ 318 void ElementMatrix::Transpose(void){ 319 320 /*Intermediaries*/ 321 double *values_copy=NULL; 322 int temp; 323 324 /*Transpose indices*/ 325 if(!dofsymmetrical){ 326 ISSMERROR("not supported yet"); 327 } 328 329 /*Transpose values*/ 330 values_copy=(double*)xmalloc(this->nrows*this->ncols*sizeof(double)); 331 memcpy(values_copy,this->values,this->nrows*this->ncols*sizeof(double)); 332 for (int i=0;i<this->nrows;i++) for(int j=0;j<this->ncols;j++) this->values[j*this->nrows+i]=values_copy[i*this->ncols+j]; 333 334 /*Update sizes*/ 335 temp=this->nrows; 336 this->nrows=this->ncols; 337 this->ncols=temp; 338 339 /*Clean up and return*/ 340 xfree((void**)&values_copy); 341 } 342 /*}}}*/ 329 343 /*FUNCTION ElementMatrix::Echo{{{1*/ 330 344 void ElementMatrix::Echo(void){ -
issm/trunk/src/c/objects/Numerics/ElementMatrix.h
r6021 r6027 58 58 /*}}}*/ 59 59 /*ElementMatrix specific routines {{{1*/ 60 void AddValues(double* Ke_gg);61 60 void AddToGlobal(Mat Kgg, Mat Kff, Mat Kfs); 62 61 void Echo(void); 63 62 void CheckConsistency(void); 63 void Transpose(void); 64 64 void Init(ElementMatrix* Ke); 65 65 /*}}}*/ -
issm/trunk/src/c/objects/Numerics/ElementVector.cpp
r5989 r6027 170 170 171 171 /*ElementVector specific routines: */ 172 /*FUNCTION ElementVector::AddValues(double* Ke_gg){{{1*/173 void ElementVector::AddValues(double* pe_gg){174 175 int i,j;176 177 if(pe_gg){178 for (i=0;i<this->nrows;i++){179 this->values[i]+=pe_gg[i];180 }181 }182 }183 /*}}}*/184 172 /*FUNCTION ElementVector::AddToGlobal(Vec pg, Vec pf){{{1*/ 185 173 void ElementVector::AddToGlobal(Vec pg, Vec pf){ -
issm/trunk/src/c/objects/Numerics/ElementVector.h
r5986 r6027 41 41 /*}}}*/ 42 42 /*ElementVector specific routines {{{1*/ 43 void AddValues(double* pe_gg);44 43 void AddToGlobal(Vec pg, Vec pf); 45 44 void Echo(void);
Note:
See TracChangeset
for help on using the changeset viewer.