Changeset 4995 for issm/trunk/src/c/objects/Elements/Penta.cpp
- Timestamp:
- 08/05/10 08:19:48 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r4990 r4995 712 712 else{ 713 713 714 /*Depth Average B*/ 715 this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum); 714 /*Depth Average B and put it in inputs*/ 715 Penta* penta=GetBasalElement(); 716 penta->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum); 717 Input* B_input=penta->matice->inputs->GetInput(RheologyB2dEnum); 718 Input* B_copy=(Input*)B_input->copy(); 719 this->matice->inputs->AddInput((Input*)B_copy); 716 720 717 721 tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face). … … 721 725 /*delete B average*/ 722 726 this->matice->inputs->DeleteInput(RheologyB2dEnum); 727 penta->matice->inputs->DeleteInput(RheologyB2dEnum); 723 728 724 729 return J; … … 4661 4666 } 4662 4667 /*}}}*/ 4668 /*FUNCTION Penta::GetBasalElement{{{1*/ 4669 Penta* Penta::GetBasalElement(void){ 4670 4671 /*Output*/ 4672 Penta* penta=NULL; 4673 4674 /*Go through all elements till the bed is reached*/ 4675 penta=this; 4676 for(;;){ 4677 4678 /*Stop if we have reached the surface, else, take lower penta*/ 4679 if (penta->IsOnBed()) break; 4680 4681 /* get lower Penta*/ 4682 penta=penta->GetLowerElement(); 4683 ISSMASSERT(penta->Id()!=this->id); 4684 } 4685 4686 /*return output*/ 4687 return penta; 4688 } 4689 /*}}}*/ 4690 /*FUNCTION Penta::GetLowerElement{{{1*/ 4691 Penta* Penta::GetLowerElement(void){ 4692 4693 Penta* upper_penta=NULL; 4694 upper_penta=(Penta*)neighbors[0]; //first one (0) under, second one (1) above 4695 return upper_penta; 4696 4697 } 4698 /*}}}*/ 4663 4699 /*FUNCTION Penta::GetUpperElement{{{1*/ 4664 4700 Penta* Penta::GetUpperElement(void){ … … 4708 4744 } 4709 4745 else{ 4746 /*Gradient is computed on bed only (B2d)*/ 4747 if (!onbed) return; 4748 4710 4749 /*Depth Average B*/ 4711 4750 this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum); … … 5471 5510 } 5472 5511 /*}}}*/ 5512 /*FUNCTION Penta::IsOnBed{{{1*/ 5513 bool Penta::IsOnBed(void){ 5514 5515 bool onbed; 5516 inputs->GetParameterValue(&onbed,ElementOnBedEnum); 5517 return onbed; 5518 5519 } 5520 /*}}}*/ 5473 5521 /*FUNCTION Penta::ReduceMatrixStokes {{{1*/ 5474 5522 void Penta::ReduceMatrixStokes(double* Ke_reduced, double* Ke_temp){
Note:
See TracChangeset
for help on using the changeset viewer.