Changeset 25910
- Timestamp:
- 12/21/20 18:01:22 (4 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/matrix
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp
r20827 r25910 271 271 void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/ 272 272 273 int i,j;274 IssmDouble* localvalues=NULL;275 276 273 /*Check that Kff has been alocated in debugging mode*/ 277 274 _assert_(Kff); … … 291 288 if(this->row_fsize){ 292 289 /*first, retrieve values that are in the f-set from the g-set values matrix: */ 293 localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);294 for(i =0;i<this->row_fsize;i++){295 for( j=0;j<this->row_fsize;j++){290 IssmDouble* localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize); 291 for(int i=0;i<this->row_fsize;i++){ 292 for(int j=0;j<this->row_fsize;j++){ 296 293 localvalues[this->row_fsize*i+j]=this->values[this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]]; 297 294 } … … 307 304 if((this->row_ssize!=0) && (this->row_fsize!=0)){ 308 305 /*first, retrieve values that are in the f and s-set from the g-set values matrix: */ 309 localvalues=xNew<IssmDouble>(this->row_fsize*this->row_ssize);310 for(i =0;i<this->row_fsize;i++){311 for( j=0;j<this->row_ssize;j++){306 IssmDouble* localvalues=xNew<IssmDouble>(this->row_fsize*this->row_ssize); 307 for(int i=0;i<this->row_fsize;i++){ 308 for(int j=0;j<this->row_ssize;j++){ 312 309 localvalues[this->row_ssize*i+j]=this->values[this->ncols*this->row_flocaldoflist[i]+this->row_slocaldoflist[j]]; 313 310 } … … 328 325 void ElementMatrix::AddToGlobal(Matrix<IssmDouble>* Jff){/*{{{*/ 329 326 330 int i,j;331 IssmDouble* localvalues=NULL;332 333 327 /*Check that Jff is not NULL*/ 334 328 _assert_(Jff); … … 342 336 if(this->row_fsize){ 343 337 /*first, retrieve values that are in the f-set from the g-set values matrix: */ 344 localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize);345 for(i =0;i<this->row_fsize;i++){346 for( j=0;j<this->row_fsize;j++){347 *(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]);338 IssmDouble* localvalues=xNew<IssmDouble>(this->row_fsize*this->row_fsize); 339 for(int i=0;i<this->row_fsize;i++){ 340 for(int j=0;j<this->row_fsize;j++){ 341 localvalues[this->row_fsize*i+j]=this->values[this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]]; 348 342 } 349 343 } -
issm/trunk-jpl/src/c/classes/matrix/ElementVector.cpp
r20827 r25910 238 238 void ElementVector::InsertIntoGlobal(Vector<IssmDouble>* pf){/*{{{*/ 239 239 240 int i;241 IssmDouble* localvalues=NULL;242 243 240 if(this->fsize){ 244 241 /*first, retrieve values that are in the f-set from the g-set values vector: */ 245 localvalues=xNew<IssmDouble>(this->fsize);246 for(i =0;i<this->fsize;i++){242 IssmDouble* localvalues=xNew<IssmDouble>(this->fsize); 243 for(int i=0;i<this->fsize;i++){ 247 244 localvalues[i]=this->values[this->flocaldoflist[i]]; 248 245 }
Note:
See TracChangeset
for help on using the changeset viewer.