Changeset 5637
- Timestamp:
- 08/31/10 14:01:55 (15 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Tria.cpp
r5636 r5637 3247 3247 3248 3248 /* gaussian points: */ 3249 int num_gauss,ig; 3250 double *first_gauss_area_coord = NULL; 3251 double *second_gauss_area_coord = NULL; 3252 double *third_gauss_area_coord = NULL; 3253 double *gauss_weights = NULL; 3254 double gauss_weight; 3255 double gauss_l1l2l3[3]; 3249 int ig; 3250 GaussTria *gauss=NULL; 3256 3251 3257 3252 /* matrices: */ … … 3274 3269 double alpha2; 3275 3270 double alpha2_list[numvertices]; //TO BE DELETED 3276 double gauss [numvertices][numvertices] = {{1,0,0},{0,1,0},{0,0,1}}; //TO BE DELETED3271 double gaussgrids[numvertices][numvertices] = {{1,0,0},{0,1,0},{0,0,1}}; //TO BE DELETED 3277 3272 3278 3273 double MAXSLOPE=.06; // 6 % … … 3314 3309 /*COMPUT alpha2_list (TO BE DELETED)*/ 3315 3310 for(i=0;i<numvertices;i++){ 3316 friction->GetAlpha2(&alpha2_list[i],&gauss[i][0],VxEnum,VyEnum,VzEnum); 3317 } 3318 3319 /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */ 3320 GaussLegendreTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 2); 3311 friction->GetAlpha2(&alpha2_list[i],&gaussgrids[i][0],VxEnum,VyEnum,VzEnum); 3312 } 3321 3313 3322 3314 /* Start looping on the number of gaussian points: */ 3323 for (ig=0; ig<num_gauss; ig++){ 3324 /*Pick up the gaussian point: */ 3325 gauss_weight=*(gauss_weights+ig); 3326 gauss_l1l2l3[0]=*(first_gauss_area_coord+ig); 3327 gauss_l1l2l3[1]=*(second_gauss_area_coord+ig); 3328 gauss_l1l2l3[2]=*(third_gauss_area_coord+ig); 3315 gauss=new GaussTria(2); 3316 for (ig=gauss->begin();ig<gauss->end();ig++){ 3317 3318 gauss->GaussPoint(ig); 3329 3319 3330 3320 /*Friction: */ 3331 // friction->GetAlpha2(&alpha2, gauss _l1l2l3,VxEnum,VyEnum,VzEnum); // TO UNCOMMENT3332 TriaRef::GetParameterValue(&alpha2,&alpha2_list[0],gauss _l1l2l3); // TO BE DELETED3321 // friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum); // TO UNCOMMENT 3322 TriaRef::GetParameterValue(&alpha2,&alpha2_list[0],gauss); // TO BE DELETED 3333 3323 3334 3324 // If we have a slope > 6% for this element, it means we are on a mountain. In this particular case, 3335 3325 //velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */ 3336 surface_input->GetParameterDerivativeValue(&slope[0],&xyz_list[0][0], &gauss_l1l2l3[0]);3326 surface_input->GetParameterDerivativeValue(&slope[0],&xyz_list[0][0],gauss); 3337 3327 slope_magnitude=sqrt(pow(slope[0],2)+pow(slope[1],2)); 3338 3328 … … 3342 3332 3343 3333 /* Get Jacobian determinant: */ 3344 GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss _l1l2l3);3334 GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss); 3345 3335 3346 3336 /*Get L matrix: */ 3347 GetL(&L[0][0], &xyz_list[0][0], gauss _l1l2l3,numberofdofspernode);3337 GetL(&L[0][0], &xyz_list[0][0], gauss,numberofdofspernode); 3348 3338 3349 3339 3350 DL_scalar=alpha2*gauss _weight*Jdet;3340 DL_scalar=alpha2*gauss->weight*Jdet; 3351 3341 for (i=0;i<2;i++){ 3352 3342 DL[i][i]=DL_scalar; … … 3367 3357 MatSetValues(Kgg,numdof,doflistp,numdof,doflistm,(const double*)Ke_gg,ADD_VALUES); 3368 3358 3369 xfree((void**)&first_gauss_area_coord); 3370 xfree((void**)&second_gauss_area_coord); 3371 xfree((void**)&third_gauss_area_coord); 3372 xfree((void**)&gauss_weights); 3359 /*Clean up and return*/ 3360 delete gauss; 3361 delete friction; 3373 3362 xfree((void**)&doflistm); 3374 3363 xfree((void**)&doflistp); 3375 delete friction;3376 3364 } 3377 3365 /*}}}*/ … … 3391 3379 3392 3380 /* gaussian points: */ 3393 int num_gauss,ig; 3394 double *first_gauss_area_coord = NULL; 3395 double *second_gauss_area_coord = NULL; 3396 double *third_gauss_area_coord = NULL; 3397 double *gauss_weights = NULL; 3398 double gauss_weight; 3399 double gauss_l1l2l3[3]; 3381 int ig; 3382 GaussTria *gauss=NULL; 3400 3383 3401 3384 /* matrices: */ … … 3418 3401 double alpha2; 3419 3402 double alpha2_list[numvertices]; //TO BE DELETED 3420 double gauss [numvertices][numvertices] = {{1,0,0},{0,1,0},{0,0,1}}; //TO BE DELETED3403 double gaussgrids[numvertices][numvertices] = {{1,0,0},{0,1,0},{0,0,1}}; //TO BE DELETED 3421 3404 3422 3405 double MAXSLOPE=.06; // 6 % … … 3457 3440 /*COMPUT alpha2_list (TO BE DELETED)*/ 3458 3441 for(i=0;i<numvertices;i++){ 3459 friction->GetAlpha2(&alpha2_list[i],&gauss[i][0],VxEnum,VyEnum,VzEnum); 3460 } 3461 3462 /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */ 3463 GaussLegendreTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 2); 3442 friction->GetAlpha2(&alpha2_list[i],&gaussgrids[i][0],VxEnum,VyEnum,VzEnum); 3443 } 3464 3444 3465 3445 /* Start looping on the number of gaussian points: */ 3466 for (ig=0; ig<num_gauss; ig++){ 3467 /*Pick up the gaussian point: */ 3468 gauss_weight=*(gauss_weights+ig); 3469 gauss_l1l2l3[0]=*(first_gauss_area_coord+ig); 3470 gauss_l1l2l3[1]=*(second_gauss_area_coord+ig); 3471 gauss_l1l2l3[2]=*(third_gauss_area_coord+ig); 3446 gauss=new GaussTria(2); 3447 for (ig=gauss->begin();ig<gauss->end();ig++){ 3448 3449 gauss->GaussPoint(ig); 3472 3450 3473 3451 /*Friction: */ 3474 // friction->GetAlpha2(&alpha2, gauss _l1l2l3,VxEnum,VyEnum,VzEnum); // TO UNCOMMENT3475 TriaRef::GetParameterValue(&alpha2,&alpha2_list[0],gauss _l1l2l3); // TO BE DELETED3452 // friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum); // TO UNCOMMENT 3453 TriaRef::GetParameterValue(&alpha2,&alpha2_list[0],gauss); // TO BE DELETED 3476 3454 3477 3455 // If we have a slope > 6% for this element, it means we are on a mountain. In this particular case, 3478 3456 //velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */ 3479 surface_input->GetParameterDerivativeValue(&slope[0],&xyz_list[0][0], &gauss_l1l2l3[0]);3457 surface_input->GetParameterDerivativeValue(&slope[0],&xyz_list[0][0],gauss); 3480 3458 slope_magnitude=sqrt(pow(slope[0],2)+pow(slope[1],2)); 3481 3459 … … 3485 3463 3486 3464 /* Get Jacobian determinant: */ 3487 GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss _l1l2l3);3465 GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss); 3488 3466 3489 3467 /*Get L matrix: */ 3490 GetL(&L[0][0], &xyz_list[0][0], gauss _l1l2l3,numberofdofspernode);3468 GetL(&L[0][0], &xyz_list[0][0], gauss,numberofdofspernode); 3491 3469 3492 3470 3493 DL_scalar=alpha2*gauss _weight*Jdet;3471 DL_scalar=alpha2*gauss->weight*Jdet; 3494 3472 for (i=0;i<2;i++){ 3495 3473 DL[i][i]=DL_scalar; … … 3509 3487 MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES); 3510 3488 3511 xfree((void**)&first_gauss_area_coord); 3512 xfree((void**)&second_gauss_area_coord); 3513 xfree((void**)&third_gauss_area_coord); 3514 xfree((void**)&gauss_weights); 3489 /*Clean up and return*/ 3490 delete gauss; 3491 delete friction; 3515 3492 xfree((void**)&doflist); 3516 delete friction;3517 3493 } 3518 3494 /*}}}*/ … … 3532 3508 3533 3509 /* gaussian points: */ 3534 int num_gauss,ig; 3535 double *first_gauss_area_coord = NULL; 3536 double *second_gauss_area_coord = NULL; 3537 double *third_gauss_area_coord = NULL; 3538 double *gauss_weights = NULL; 3539 double gauss_weight; 3540 double gauss_l1l2l3[3]; 3510 int ig; 3511 GaussTria *gauss=NULL; 3541 3512 3542 3513 /* matrices: */ … … 3559 3530 double alpha2; 3560 3531 double alpha2_list[numvertices]; //TO BE DELETED 3561 double gauss [numvertices][numvertices] = {{1,0,0},{0,1,0},{0,0,1}}; //TO BE DELETED3532 double gaussgrids[numvertices][numvertices] = {{1,0,0},{0,1,0},{0,0,1}}; //TO BE DELETED 3562 3533 3563 3534 double MAXSLOPE=.06; // 6 % … … 3598 3569 /*COMPUT alpha2_list (TO BE DELETED)*/ 3599 3570 for(i=0;i<numvertices;i++){ 3600 friction->GetAlpha2(&alpha2_list[i],&gauss[i][0],VxEnum,VyEnum,VzEnum); 3601 } 3602 3603 /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */ 3604 GaussLegendreTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 2); 3571 friction->GetAlpha2(&alpha2_list[i],&gaussgrids[i][0],VxEnum,VyEnum,VzEnum); 3572 } 3605 3573 3606 3574 /* Start looping on the number of gaussian points: */ 3607 for (ig=0; ig<num_gauss; ig++){ 3608 /*Pick up the gaussian point: */ 3609 gauss_weight=*(gauss_weights+ig); 3610 gauss_l1l2l3[0]=*(first_gauss_area_coord+ig); 3611 gauss_l1l2l3[1]=*(second_gauss_area_coord+ig); 3612 gauss_l1l2l3[2]=*(third_gauss_area_coord+ig); 3575 gauss=new GaussTria(2); 3576 for (ig=gauss->begin();ig<gauss->end();ig++){ 3577 3578 gauss->GaussPoint(ig); 3613 3579 3614 3580 /*Friction: */ 3615 // friction->GetAlpha2(&alpha2, gauss _l1l2l3,VxEnum,VyEnum,VzEnum); // TO UNCOMMENT3616 TriaRef::GetParameterValue(&alpha2,&alpha2_list[0],gauss _l1l2l3); // TO BE DELETED3581 // friction->GetAlpha2(&alpha2, gauss,VxEnum,VyEnum,VzEnum); // TO UNCOMMENT 3582 TriaRef::GetParameterValue(&alpha2,&alpha2_list[0],gauss); // TO BE DELETED 3617 3583 3618 3584 // If we have a slope > 6% for this element, it means we are on a mountain. In this particular case, 3619 3585 //velocity should be = 0. To achieve this result, we set alpha2_list to a very high value: */ 3620 surface_input->GetParameterDerivativeValue(&slope[0],&xyz_list[0][0], &gauss_l1l2l3[0]);3586 surface_input->GetParameterDerivativeValue(&slope[0],&xyz_list[0][0],gauss); 3621 3587 slope_magnitude=sqrt(pow(slope[0],2)+pow(slope[1],2)); 3622 3588 … … 3626 3592 3627 3593 /* Get Jacobian determinant: */ 3628 GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss _l1l2l3);3594 GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss); 3629 3595 3630 3596 /*Get L matrix: */ 3631 GetL(&L[0][0], &xyz_list[0][0], gauss _l1l2l3,numberofdofspernode);3597 GetL(&L[0][0], &xyz_list[0][0], gauss,numberofdofspernode); 3632 3598 3633 3599 3634 DL_scalar=alpha2*gauss _weight*Jdet;3600 DL_scalar=alpha2*gauss->weight*Jdet; 3635 3601 for (i=0;i<2;i++){ 3636 3602 DL[i][i]=DL_scalar; … … 3650 3616 MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES); 3651 3617 3652 xfree((void**)&first_gauss_area_coord); 3653 xfree((void**)&second_gauss_area_coord); 3654 xfree((void**)&third_gauss_area_coord); 3655 xfree((void**)&gauss_weights); 3618 /*Clean up and return*/ 3619 delete gauss; 3620 delete friction; 3656 3621 xfree((void**)&doflist); 3657 delete friction;3658 3622 } 3659 3623 /*}}}*/ -
issm/trunk/src/c/objects/Gauss/GaussTria.cpp
r5630 r5637 102 102 } 103 103 /*}}}*/ 104 /*FUNCTION GaussTria::GaussCenter{{{1*/ 105 void GaussTria::GaussCenter(void){ 106 107 /*update static arrays*/ 108 coord1=ONETHIRD; 109 coord2=ONETHIRD; 110 coord3=ONETHIRD; 111 112 } 113 /*}}}*/ 104 114 /*FUNCTION GaussTria::GaussPoint{{{1*/ 105 115 void GaussTria::GaussPoint(int ig){ -
issm/trunk/src/c/objects/Gauss/GaussTria.h
r5630 r5637 40 40 void GaussPoint(int ig); 41 41 void GaussVertex(int iv); 42 void GaussCenter(void); 42 43 }; 43 44 #endif /* _GAUSSTRIA_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.