Changeset 11322 for issm/trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp
- Timestamp:
- 02/06/12 07:45:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/Numerics/ElementMatrix.cpp
r9320 r11322 245 245 246 246 /*ElementMatrix specific routines: */ 247 /*FUNCTION ElementMatrix::AddToGlobal {{{1*/247 /*FUNCTION ElementMatrix::AddToGlobal(Mat Kff, Mat Kfs){{{1*/ 248 248 void ElementMatrix::AddToGlobal(Mat Kff, Mat Kfs){ 249 249 … … 294 294 } 295 295 /*}}}*/ 296 /*FUNCTION ElementMatrix::AddToGlobal(Mat Jff){{{1*/ 297 void ElementMatrix::AddToGlobal(Mat Jff){ 298 299 int i,j; 300 double* localvalues=NULL; 301 302 /*In debugging mode, check consistency (no NaN, and values not too big)*/ 303 this->CheckConsistency(); 304 305 if(this->dofsymmetrical){ 306 /*only use row dofs to add values into global matrices: */ 307 308 if(this->row_fsize){ 309 /*first, retrieve values that are in the f-set from the g-set values matrix: */ 310 localvalues=(double*)xmalloc(this->row_fsize*this->row_fsize*sizeof(double)); 311 for(i=0;i<this->row_fsize;i++){ 312 for(j=0;j<this->row_fsize;j++){ 313 *(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]); 314 } 315 } 316 /*add local values into global matrix, using the fglobaldoflist: */ 317 MatSetValues(Jff,this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,(const double*)localvalues,ADD_VALUES); 318 319 /*Free ressources:*/ 320 xfree((void**)&localvalues); 321 } 322 323 } 324 else{ 325 _error_(" non dofsymmetrical matrix AddToGlobal routine not support yet!"); 326 } 327 328 } 329 /*}}}*/ 296 330 /*FUNCTION ElementMatrix::CheckConsistency{{{1*/ 297 331 void ElementMatrix::CheckConsistency(void){
Note:
See TracChangeset
for help on using the changeset viewer.