Changeset 25436
- Timestamp:
- 08/21/20 08:37:13 (5 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
r25379 r25436 1451 1451 1452 1452 /* Start looping on the number of gaussian points: */ 1453 for(int ig=gauss->begin();ig<gauss->end();ig++){ 1454 gauss->GaussPoint(ig); 1453 while(gauss->next()){ 1455 1454 1456 1455 friction->GetAlpha2(&alpha2,gauss); … … 1532 1531 /* Start looping on the number of gaussian points: */ 1533 1532 Gauss* gauss=element->NewGauss(xyz_list,xyz_list_boundary,3); 1534 for(int ig=gauss->begin();ig<gauss->end();ig++){ 1535 gauss->GaussPoint(ig); 1533 while(gauss->next()){ 1536 1534 1537 1535 this->GetBSSAFriction(B,element,dim,xyz_list,gauss); … … 1599 1597 /* Start looping on the number of gaussian points: */ 1600 1598 Gauss* gauss = element->NewGauss(2); 1601 for(int ig=gauss->begin();ig<gauss->end();ig++){ 1602 gauss->GaussPoint(ig); 1599 while(gauss->next()){ 1603 1600 1604 1601 element->JacobianDeterminant(&Jdet,xyz_list,gauss); … … 1713 1710 /* Start looping on the number of gaussian points: */ 1714 1711 Gauss* gauss=element->NewGauss(2); 1715 for(int ig=gauss->begin();ig<gauss->end();ig++){ 1716 1717 gauss->GaussPoint(ig); 1712 while(gauss->next()){ 1718 1713 1719 1714 element->JacobianDeterminant(&Jdet,xyz_list,gauss); … … 1783 1778 /*Start looping on Gaussian points*/ 1784 1779 Gauss* gauss=element->NewGauss(xyz_list,xyz_list_front,3); 1785 for(int ig=gauss->begin();ig<gauss->end();ig++){ 1786 1787 gauss->GaussPoint(ig); 1780 while(gauss->next()){ 1788 1781 thickness_input->GetInputValue(&thickness,gauss); 1789 1782 sealevel_input->GetInputValue(&sealevel,gauss); -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r25415 r25436 230 230 break; 231 231 case P1Enum: 232 for(int i=0;i<NUMVERTICES;i++){ 233 if(xIsNan<IssmDouble>(values[i])) values[i] = 0.; 234 if(xIsNan<IssmDouble>(values_min[i])) values_min[i] = 0.; 235 if(xIsNan<IssmDouble>(values_max[i])) values_max[i] = 0.; 236 } 232 237 control_input->SetControl(interpolation_enum,NUMVERTICES,&vertexlids[0],values,values_min,values_max); 233 238 break; -
issm/trunk-jpl/src/c/classes/gauss/Gauss.h
r20827 r25436 11 11 IssmDouble weight; 12 12 13 virtual 13 virtual ~Gauss(){}; 14 14 virtual int begin(void)=0; 15 15 virtual void Echo(void)=0; 16 16 virtual int end(void)=0; 17 virtual bool next(void)=0; 17 18 virtual int Enum(void)=0; 18 19 virtual void GaussNode(int finitelement,int iv)=0; -
issm/trunk-jpl/src/c/classes/gauss/GaussPenta.cpp
r24119 r25436 16 16 GaussPenta::GaussPenta(){/*{{{*/ 17 17 18 ig = -1; 18 19 numgauss=-1; 19 20 … … 34 35 35 36 /*Intermediaries*/ 36 int ighoriz,igvert; 37 int numgauss_horiz; 38 int numgauss_vert; 39 IssmDouble *coords1_horiz = NULL; 40 IssmDouble *coords2_horiz = NULL; 41 IssmDouble *coords3_horiz = NULL; 37 int numgauss_horiz; 38 int numgauss_vert; 39 IssmDouble *coords1_horiz = NULL; 40 IssmDouble *coords2_horiz = NULL; 41 IssmDouble *coords3_horiz = NULL; 42 42 IssmDouble *weights_horiz = NULL; 43 double *coords_vert= NULL;44 double *weights_vert = NULL;43 double *coords_vert = NULL; 44 double *weights_vert = NULL; 45 45 46 46 /*Get gauss points*/ … … 50 50 51 51 /*Allocate GaussPenta fields*/ 52 ig = -1; 52 53 numgauss=numgauss_horiz*numgauss_vert; 53 54 coords1=xNew<IssmDouble>(numgauss); … … 58 59 59 60 /*Combine Horizontal and vertical points*/ 60 for (ighoriz=0; ighoriz<numgauss_horiz; ighoriz++){61 for (igvert=0; igvert<numgauss_vert; igvert++){61 for(int ighoriz=0; ighoriz<numgauss_horiz; ighoriz++){ 62 for(int igvert=0; igvert<numgauss_vert; igvert++){ 62 63 coords1[numgauss_vert*ighoriz+igvert]=coords1_horiz[ighoriz]; 63 64 coords2[numgauss_vert*ighoriz+igvert]=coords2_horiz[ighoriz]; … … 92 93 93 94 /*Get Segment gauss points*/ 95 ig = -1; 94 96 numgauss=order; 95 97 GaussLegendreLinear(&seg_coords,&seg_weights,numgauss); … … 166 168 } 167 169 170 this->ig = -1; 171 168 172 } 169 173 /*}}}*/ … … 182 186 183 187 /*Allocate GaussPenta fields*/ 188 this->ig = -1; 184 189 numgauss=order_horiz*order_vert; 185 190 coords1=xNew<IssmDouble>(numgauss); … … 236 241 GaussPenta::GaussPenta(int index,IssmDouble r1,IssmDouble r2,bool mainlyfloating,int order){/*{{{*/ 237 242 238 /*239 * ^240 * |241 * 1|\242 * | \243 * | \244 * | \245 * | \246 * | \247 * | +(x,y) \248 * | \249 * +---------------+-->250 * 0 1251 *252 */253 int ig;254 243 IssmDouble x,y; 255 244 IssmDouble xy_list[3][2]; … … 263 252 xy_list[2][0]=0; xy_list[2][1]=r2; 264 253 265 for(i g=0;ig<this->numgauss;ig++){266 x = this->coords1[i g]*xy_list[0][0] + this->coords2[ig]*xy_list[1][0] + this->coords3[ig]*xy_list[2][0];267 y = this->coords1[i g]*xy_list[0][1] + this->coords2[ig]*xy_list[1][1] + this->coords3[ig]*xy_list[2][1];254 for(int ii=0;ii<this->numgauss;ii++){ 255 x = this->coords1[ii]*xy_list[0][0] + this->coords2[ii]*xy_list[1][0] + this->coords3[ii]*xy_list[2][0]; 256 y = this->coords1[ii]*xy_list[0][1] + this->coords2[ii]*xy_list[1][1] + this->coords3[ii]*xy_list[2][1]; 268 257 269 258 switch(index){ 270 259 case 0: 271 this->coords1[i g] = 1.-x-y;272 this->coords2[i g] = x;273 this->coords3[i g] = y;260 this->coords1[ii] = 1.-x-y; 261 this->coords2[ii] = x; 262 this->coords3[ii] = y; 274 263 break; 275 264 case 1: 276 this->coords1[i g] = y;277 this->coords2[i g] = 1.-x-y;278 this->coords3[i g] = x;265 this->coords1[ii] = y; 266 this->coords2[ii] = 1.-x-y; 267 this->coords3[ii] = x; 279 268 break; 280 269 case 2: 281 this->coords1[i g] = x;282 this->coords2[i g] = y;283 this->coords3[i g] = 1.-x-y;270 this->coords1[ii] = x; 271 this->coords2[ii] = y; 272 this->coords3[ii] = 1.-x-y; 284 273 break; 285 274 default: 286 275 _error_("index "<<index<<" not supported yet"); 287 276 } 288 this->weights[i g] = this->weights[ig]*r1*r2;277 this->weights[ii] = this->weights[ii]*r1*r2; 289 278 } 290 279 this->coords4=xNew<IssmDouble>(numgauss); 291 for(i g=0;ig<numgauss;ig++) this->coords4[ig]=-1.0;280 for(int ii=0;ii<numgauss;ii++) this->coords4[ii]=-1.0; 292 281 } 293 282 else{ … … 303 292 304 293 //gauss1->Echo(); 305 for(i g=0;ig<gauss1->numgauss;ig++){306 x = gauss1->coords1[i g]*xy_list[0][0] + gauss1->coords2[ig]*xy_list[1][0] + gauss1->coords3[ig]*xy_list[2][0];307 y = gauss1->coords1[i g]*xy_list[0][1] + gauss1->coords2[ig]*xy_list[1][1] + gauss1->coords3[ig]*xy_list[2][1];294 for(int ii=0;ii<gauss1->numgauss;ii++){ 295 x = gauss1->coords1[ii]*xy_list[0][0] + gauss1->coords2[ii]*xy_list[1][0] + gauss1->coords3[ii]*xy_list[2][0]; 296 y = gauss1->coords1[ii]*xy_list[0][1] + gauss1->coords2[ii]*xy_list[1][1] + gauss1->coords3[ii]*xy_list[2][1]; 308 297 309 298 switch(index){ 310 299 case 0: 311 gauss1->coords1[i g] = 1.-x-y;312 gauss1->coords2[i g] = x;313 gauss1->coords3[i g] = y;300 gauss1->coords1[ii] = 1.-x-y; 301 gauss1->coords2[ii] = x; 302 gauss1->coords3[ii] = y; 314 303 break; 315 304 case 1: 316 gauss1->coords1[i g] = y;317 gauss1->coords2[i g] = 1.-x-y;318 gauss1->coords3[i g] = x;305 gauss1->coords1[ii] = y; 306 gauss1->coords2[ii] = 1.-x-y; 307 gauss1->coords3[ii] = x; 319 308 break; 320 309 case 2: 321 gauss1->coords1[i g] = x;322 gauss1->coords2[i g] = y;323 gauss1->coords3[i g] = 1.-x-y;310 gauss1->coords1[ii] = x; 311 gauss1->coords2[ii] = y; 312 gauss1->coords3[ii] = 1.-x-y; 324 313 break; 325 314 default: 326 315 _error_("index "<<index<<" not supported yet"); 327 316 } 328 gauss1->weights[i g] = gauss1->weights[ig]*r1*(1-r2);317 gauss1->weights[ii] = gauss1->weights[ii]*r1*(1-r2); 329 318 } 330 319 //gauss1->Echo(); … … 334 323 335 324 //gauss2->Echo(); 336 for(i g=0;ig<gauss2->numgauss;ig++){337 x = gauss2->coords1[i g]*xy_list[0][0] + gauss2->coords2[ig]*xy_list[1][0] + gauss2->coords3[ig]*xy_list[2][0];338 y = gauss2->coords1[i g]*xy_list[0][1] + gauss2->coords2[ig]*xy_list[1][1] + gauss2->coords3[ig]*xy_list[2][1];325 for(int ii=0;ii<gauss2->numgauss;ii++){ 326 x = gauss2->coords1[ii]*xy_list[0][0] + gauss2->coords2[ii]*xy_list[1][0] + gauss2->coords3[ii]*xy_list[2][0]; 327 y = gauss2->coords1[ii]*xy_list[0][1] + gauss2->coords2[ii]*xy_list[1][1] + gauss2->coords3[ii]*xy_list[2][1]; 339 328 340 329 switch(index){ 341 330 case 0: 342 gauss2->coords1[i g] = 1.-x-y;343 gauss2->coords2[i g] = x;344 gauss2->coords3[i g] = y;331 gauss2->coords1[ii] = 1.-x-y; 332 gauss2->coords2[ii] = x; 333 gauss2->coords3[ii] = y; 345 334 break; 346 335 case 1: 347 gauss2->coords1[i g] = y;348 gauss2->coords2[i g] = 1.-x-y;349 gauss2->coords3[i g] = x;336 gauss2->coords1[ii] = y; 337 gauss2->coords2[ii] = 1.-x-y; 338 gauss2->coords3[ii] = x; 350 339 break; 351 340 case 2: 352 gauss2->coords1[i g] = x;353 gauss2->coords2[i g] = y;354 gauss2->coords3[i g] = 1.-x-y;341 gauss2->coords1[ii] = x; 342 gauss2->coords2[ii] = y; 343 gauss2->coords3[ii] = 1.-x-y; 355 344 break; 356 345 default: 357 346 _error_("index "<<index<<" not supported yet"); 358 347 } 359 gauss2->weights[i g] = gauss2->weights[ig]*(1-r1);348 gauss2->weights[ii] = gauss2->weights[ii]*(1-r1); 360 349 } 361 350 … … 367 356 this->weights=xNew<IssmDouble>(this->numgauss); 368 357 369 for(i g=0;ig<gauss1->numgauss;ig++){ // Add the first triangle gauss points370 this->coords1[i g]=gauss1->coords1[ig];371 this->coords2[i g]=gauss1->coords2[ig];372 this->coords3[i g]=gauss1->coords3[ig];373 this->coords4[i g]=gauss1->coords4[ig];374 this->weights[i g]=gauss1->weights[ig];375 } 376 for(i g=0;ig<gauss2->numgauss;ig++){ // Add the second triangle gauss points377 this->coords1[gauss1->numgauss+i g]=gauss2->coords1[ig];378 this->coords2[gauss1->numgauss+i g]=gauss2->coords2[ig];379 this->coords3[gauss1->numgauss+i g]=gauss2->coords3[ig];380 this->coords4[gauss1->numgauss+i g]=gauss2->coords4[ig];381 this->weights[gauss1->numgauss+i g]=gauss2->weights[ig];358 for(int ii=0;ii<gauss1->numgauss;ii++){ // Add the first triangle gauss points 359 this->coords1[ii]=gauss1->coords1[ii]; 360 this->coords2[ii]=gauss1->coords2[ii]; 361 this->coords3[ii]=gauss1->coords3[ii]; 362 this->coords4[ii]=gauss1->coords4[ii]; 363 this->weights[ii]=gauss1->weights[ii]; 364 } 365 for(int ii=0;ii<gauss2->numgauss;ii++){ // Add the second triangle gauss points 366 this->coords1[gauss1->numgauss+ii]=gauss2->coords1[ii]; 367 this->coords2[gauss1->numgauss+ii]=gauss2->coords2[ii]; 368 this->coords3[gauss1->numgauss+ii]=gauss2->coords3[ii]; 369 this->coords4[gauss1->numgauss+ii]=gauss2->coords4[ii]; 370 this->weights[gauss1->numgauss+ii]=gauss2->weights[ii]; 382 371 } 383 372 … … 393 382 coord3=UNDEF; 394 383 coord4=UNDEF; 384 ig = -1; 395 385 } 396 386 /*}}}*/ … … 408 398 409 399 /*Allocate GaussPenta fields*/ 400 ig = -1; 410 401 numgauss=order_horiz*order_vert; 411 402 coords1=xNew<IssmDouble>(numgauss); … … 443 434 444 435 /*Allocate GaussPenta fields*/ 436 ig = -1; 445 437 numgauss=order_horiz; 446 438 coords1=xNew<IssmDouble>(numgauss); … … 581 573 } 582 574 /*}}}*/ 575 bool GaussPenta::next(void){/*{{{*/ 576 577 /*Increment Gauss point*/ 578 this->ig++; 579 580 /*Have we reached the end?*/ 581 if(this->ig==this->numgauss) return false; 582 583 /*If not let's go to the next point*/ 584 _assert_(this->ig>=0 && this->ig< numgauss); 585 weight=weights[ig]; 586 coord1=coords1[ig]; 587 coord2=coords2[ig]; 588 coord3=coords3[ig]; 589 coord4=coords4[ig]; 590 591 return true; 592 }/*}}}*/ 583 593 void GaussPenta::GaussNode(int finiteelement,int iv){/*{{{*/ 584 594 -
issm/trunk-jpl/src/c/classes/gauss/GaussPenta.h
r24119 r25436 14 14 15 15 private: 16 int numgauss; 16 int numgauss; /*Total number of gauss points*/ 17 int ig; /*Current gauss point index*/ 17 18 IssmDouble* weights; 18 19 IssmDouble* coords1; … … 41 42 42 43 /*Methods*/ 44 bool next(void); 43 45 int begin(void); 44 46 void Echo(void); -
issm/trunk-jpl/src/c/classes/gauss/GaussSeg.cpp
r23066 r25436 14 14 GaussSeg::GaussSeg(){/*{{{*/ 15 15 16 ig=-1; 16 17 numgauss=-1; 17 18 … … 29 30 30 31 /*Get gauss points*/ 32 this->ig = -1; 31 33 this->numgauss = order; 32 34 GaussLegendreLinear(&pcoords1,&pweights,order); … … 54 56 /*Get gauss points*/ 55 57 this->numgauss = 1; 58 this->ig = -1; 56 59 this->coords1=xNew<IssmDouble>(numgauss); 57 60 this->weights=xNew<IssmDouble>(numgauss); … … 117 120 } 118 121 /*}}}*/ 122 bool GaussSeg::next(void){/*{{{*/ 123 124 /*Increment Gauss point*/ 125 this->ig++; 126 127 /*Have we reached the end?*/ 128 if(this->ig==this->numgauss) return false; 129 130 /*If not let's go to the next point*/ 131 _assert_(this->ig>=0 && this->ig< numgauss); 132 weight=weights[ig]; 133 coord1=coords1[ig]; 134 135 return true; 136 }/*}}}*/ 119 137 int GaussSeg::Enum(void){/*{{{*/ 120 138 return GaussSegEnum; -
issm/trunk-jpl/src/c/classes/gauss/GaussSeg.h
r20827 r25436 13 13 14 14 private: 15 int numgauss; 16 IssmDouble* weights; 15 int numgauss; /*Total number of gauss points*/ 16 int ig; /*Current gauss point index*/ 17 IssmDouble* weights; /*List of weights*/ 17 18 IssmDouble* coords1; 18 19 … … 29 30 30 31 /*Methods*/ 32 bool next(void); 31 33 int begin(void); 32 34 void Echo(void); -
issm/trunk-jpl/src/c/classes/gauss/GaussTetra.cpp
r20827 r25436 15 15 GaussTetra::GaussTetra(){/*{{{*/ 16 16 17 ig = -1; 17 18 numgauss=-1; 18 19 … … 54 55 coord2=UNDEF; 55 56 coord3=UNDEF; 57 ig = -1; 56 58 } 57 59 /*}}}*/ … … 82 84 _error_(index1 <<" "<<index2 <<" "<<index3 <<" Not supported yet"); 83 85 } 86 this->ig = -1; 84 87 } 85 88 /*}}}*/ … … 184 187 } 185 188 /*}}}*/ 189 bool GaussTetra::next(void){/*{{{*/ 190 191 /*Increment Gauss point*/ 192 this->ig++; 193 194 /*Have we reached the end?*/ 195 if(this->ig==this->numgauss) return false; 196 197 /*If not let's go to the next point*/ 198 _assert_(this->ig>=0 && this->ig< numgauss); 199 weight=weights[ig]; 200 coord1=coords1[ig]; 201 coord2=coords2[ig]; 202 coord3=coords3[ig]; 203 coord4=coords4[ig]; 204 205 return true; 206 }/*}}}*/ 186 207 void GaussTetra::GaussNode(int finiteelement,int iv){/*{{{*/ 187 208 -
issm/trunk-jpl/src/c/classes/gauss/GaussTetra.h
r20827 r25436 13 13 14 14 private: 15 int numgauss; 15 int numgauss; /*Total number of gauss points*/ 16 int ig; /*Current gauss point index*/ 16 17 IssmDouble* weights; 17 18 IssmDouble* coords1; … … 35 36 36 37 /*Methods*/ 38 bool next(void); 37 39 int begin(void); 38 40 void Echo(void); -
issm/trunk-jpl/src/c/classes/gauss/GaussTria.cpp
r24089 r25436 9 9 GaussTria::GaussTria(){/*{{{*/ 10 10 11 ig = -1; 11 12 numgauss=-1; 12 13 … … 32 33 coord2=UNDEF; 33 34 coord3=UNDEF; 35 ig = -1; 34 36 35 37 } … … 87 89 88 90 /*Initialize static fields as undefined*/ 91 ig = -1; 89 92 weight=UNDEF; 90 93 coord1=UNDEF; … … 122 125 123 126 /*Initialize static fields as undefined*/ 127 ig = -1; 124 128 weight=UNDEF; 125 129 coord1=UNDEF; … … 149 153 * 150 154 */ 151 int i g;155 int ii; 152 156 IssmDouble x,y; 153 157 IssmDouble xy_list[3][2]; … … 161 165 xy_list[2][0]=0; xy_list[2][1]=r2; 162 166 163 for(i g=0;ig<this->numgauss;ig++){164 x = this->coords1[i g]*xy_list[0][0] + this->coords2[ig]*xy_list[1][0] + this->coords3[ig]*xy_list[2][0];165 y = this->coords1[i g]*xy_list[0][1] + this->coords2[ig]*xy_list[1][1] + this->coords3[ig]*xy_list[2][1];167 for(ii=0;ii<this->numgauss;ii++){ 168 x = this->coords1[ii]*xy_list[0][0] + this->coords2[ii]*xy_list[1][0] + this->coords3[ii]*xy_list[2][0]; 169 y = this->coords1[ii]*xy_list[0][1] + this->coords2[ii]*xy_list[1][1] + this->coords3[ii]*xy_list[2][1]; 166 170 167 171 switch(index){ 168 172 case 0: 169 this->coords1[i g] = 1.-x-y;170 this->coords2[i g] = x;171 this->coords3[i g] = y;173 this->coords1[ii] = 1.-x-y; 174 this->coords2[ii] = x; 175 this->coords3[ii] = y; 172 176 break; 173 177 case 1: 174 this->coords1[i g] = y;175 this->coords2[i g] = 1.-x-y;176 this->coords3[i g] = x;178 this->coords1[ii] = y; 179 this->coords2[ii] = 1.-x-y; 180 this->coords3[ii] = x; 177 181 break; 178 182 case 2: 179 this->coords1[i g] = x;180 this->coords2[i g] = y;181 this->coords3[i g] = 1.-x-y;183 this->coords1[ii] = x; 184 this->coords2[ii] = y; 185 this->coords3[ii] = 1.-x-y; 182 186 break; 183 187 default: 184 188 _error_("index "<<index<<" not supported yet"); 185 189 } 186 this->weights[i g] = this->weights[ig]*r1*r2;190 this->weights[ii] = this->weights[ii]*r1*r2; 187 191 } 188 192 } … … 199 203 200 204 //gauss1->Echo(); 201 for(i g=0;ig<gauss1->numgauss;ig++){202 x = gauss1->coords1[i g]*xy_list[0][0] + gauss1->coords2[ig]*xy_list[1][0] + gauss1->coords3[ig]*xy_list[2][0];203 y = gauss1->coords1[i g]*xy_list[0][1] + gauss1->coords2[ig]*xy_list[1][1] + gauss1->coords3[ig]*xy_list[2][1];205 for(ii=0;ii<gauss1->numgauss;ii++){ 206 x = gauss1->coords1[ii]*xy_list[0][0] + gauss1->coords2[ii]*xy_list[1][0] + gauss1->coords3[ii]*xy_list[2][0]; 207 y = gauss1->coords1[ii]*xy_list[0][1] + gauss1->coords2[ii]*xy_list[1][1] + gauss1->coords3[ii]*xy_list[2][1]; 204 208 205 209 switch(index){ 206 210 case 0: 207 gauss1->coords1[i g] = 1.-x-y;208 gauss1->coords2[i g] = x;209 gauss1->coords3[i g] = y;211 gauss1->coords1[ii] = 1.-x-y; 212 gauss1->coords2[ii] = x; 213 gauss1->coords3[ii] = y; 210 214 break; 211 215 case 1: 212 gauss1->coords1[i g] = y;213 gauss1->coords2[i g] = 1.-x-y;214 gauss1->coords3[i g] = x;216 gauss1->coords1[ii] = y; 217 gauss1->coords2[ii] = 1.-x-y; 218 gauss1->coords3[ii] = x; 215 219 break; 216 220 case 2: 217 gauss1->coords1[i g] = x;218 gauss1->coords2[i g] = y;219 gauss1->coords3[i g] = 1.-x-y;221 gauss1->coords1[ii] = x; 222 gauss1->coords2[ii] = y; 223 gauss1->coords3[ii] = 1.-x-y; 220 224 break; 221 225 default: 222 226 _error_("index "<<index<<" not supported yet"); 223 227 } 224 gauss1->weights[i g] = gauss1->weights[ig]*r1*(1-r2);228 gauss1->weights[ii] = gauss1->weights[ii]*r1*(1-r2); 225 229 } 226 230 //gauss1->Echo(); … … 230 234 231 235 //gauss2->Echo(); 232 for(i g=0;ig<gauss2->numgauss;ig++){233 x = gauss2->coords1[i g]*xy_list[0][0] + gauss2->coords2[ig]*xy_list[1][0] + gauss2->coords3[ig]*xy_list[2][0];234 y = gauss2->coords1[i g]*xy_list[0][1] + gauss2->coords2[ig]*xy_list[1][1] + gauss2->coords3[ig]*xy_list[2][1];236 for(ii=0;ii<gauss2->numgauss;ii++){ 237 x = gauss2->coords1[ii]*xy_list[0][0] + gauss2->coords2[ii]*xy_list[1][0] + gauss2->coords3[ii]*xy_list[2][0]; 238 y = gauss2->coords1[ii]*xy_list[0][1] + gauss2->coords2[ii]*xy_list[1][1] + gauss2->coords3[ii]*xy_list[2][1]; 235 239 236 240 switch(index){ 237 241 case 0: 238 gauss2->coords1[i g] = 1.-x-y;239 gauss2->coords2[i g] = x;240 gauss2->coords3[i g] = y;242 gauss2->coords1[ii] = 1.-x-y; 243 gauss2->coords2[ii] = x; 244 gauss2->coords3[ii] = y; 241 245 break; 242 246 case 1: 243 gauss2->coords1[i g] = y;244 gauss2->coords2[i g] = 1.-x-y;245 gauss2->coords3[i g] = x;247 gauss2->coords1[ii] = y; 248 gauss2->coords2[ii] = 1.-x-y; 249 gauss2->coords3[ii] = x; 246 250 break; 247 251 case 2: 248 gauss2->coords1[i g] = x;249 gauss2->coords2[i g] = y;250 gauss2->coords3[i g] = 1.-x-y;252 gauss2->coords1[ii] = x; 253 gauss2->coords2[ii] = y; 254 gauss2->coords3[ii] = 1.-x-y; 251 255 break; 252 256 default: 253 257 _error_("index "<<index<<" not supported yet"); 254 258 } 255 gauss2->weights[i g] = gauss2->weights[ig]*(1-r1);259 gauss2->weights[ii] = gauss2->weights[ii]*(1-r1); 256 260 } 257 261 … … 262 266 this->weights=xNew<IssmDouble>(this->numgauss); 263 267 264 for(i g=0;ig<gauss1->numgauss;ig++){ // Add the first triangle gauss points265 this->coords1[i g]=gauss1->coords1[ig];266 this->coords2[i g]=gauss1->coords2[ig];267 this->coords3[i g]=gauss1->coords3[ig];268 this->weights[i g]=gauss1->weights[ig];268 for(ii=0;ii<gauss1->numgauss;ii++){ // Add the first triangle gauss points 269 this->coords1[ii]=gauss1->coords1[ii]; 270 this->coords2[ii]=gauss1->coords2[ii]; 271 this->coords3[ii]=gauss1->coords3[ii]; 272 this->weights[ii]=gauss1->weights[ii]; 269 273 } 270 for(i g=0;ig<gauss2->numgauss;ig++){ // Add the second triangle gauss points271 this->coords1[gauss1->numgauss+i g]=gauss2->coords1[ig];272 this->coords2[gauss1->numgauss+i g]=gauss2->coords2[ig];273 this->coords3[gauss1->numgauss+i g]=gauss2->coords3[ig];274 this->weights[gauss1->numgauss+i g]=gauss2->weights[ig];274 for(ii=0;ii<gauss2->numgauss;ii++){ // Add the second triangle gauss points 275 this->coords1[gauss1->numgauss+ii]=gauss2->coords1[ii]; 276 this->coords2[gauss1->numgauss+ii]=gauss2->coords2[ii]; 277 this->coords3[gauss1->numgauss+ii]=gauss2->coords3[ii]; 278 this->weights[gauss1->numgauss+ii]=gauss2->weights[ii]; 275 279 } 276 280 … … 281 285 282 286 /*Initialize static fields as undefined*/ 287 ig = -1; 283 288 weight=UNDEF; 284 289 coord1=UNDEF; … … 490 495 } 491 496 /*}}}*/ 497 bool GaussTria::next(void){/*{{{*/ 498 499 /*Increment Gauss point*/ 500 this->ig++; 501 502 /*Have we reached the end?*/ 503 if(this->ig==this->numgauss) return false; 504 505 /*If not let's go to the next point*/ 506 _assert_(this->ig>=0 && this->ig< numgauss); 507 weight=weights[ig]; 508 coord1=coords1[ig]; 509 coord2=coords2[ig]; 510 coord3=coords3[ig]; 511 512 return true; 513 }/*}}}*/ 492 514 void GaussTria::GaussNode(int finiteelement,int iv){/*{{{*/ 493 515 -
issm/trunk-jpl/src/c/classes/gauss/GaussTria.h
r21892 r25436 13 13 14 14 private: 15 int numgauss; 15 int numgauss; /*Total number of gauss points*/ 16 int ig; /*Current gauss point index*/ 16 17 IssmDouble* weights; 17 18 IssmDouble* coords1; … … 36 37 37 38 /*Methods*/ 39 bool next(void); 38 40 int begin(void); 39 41 void Echo(void);
Note:
See TracChangeset
for help on using the changeset viewer.