Changeset 4047 for issm/trunk/src/c/objects/Elements/Penta.cpp
- Timestamp:
- 06/15/10 11:13:28 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r4046 r4047 4555 4555 /*}}}*/ 4556 4556 /*FUNCTION Penta::Gradj {{{1*/ 4557 void Penta::Gradj( Vec grad_g,int control_type){4557 void Penta::Gradj(int control_type){ 4558 4558 4559 4559 /*inputs: */ … … 4567 4567 4568 4568 if (control_type==DragCoefficientEnum){ 4569 GradjDrag( grad_g);4569 GradjDrag(); 4570 4570 } 4571 4571 else if (control_type=RheologyBEnum){ 4572 GradjB( grad_g);4572 GradjB(); 4573 4573 } 4574 4574 else ISSMERROR("%s%i","control type not supported yet: ",control_type); … … 4576 4576 /*}}}*/ 4577 4577 /*FUNCTION Penta::GradjDrag {{{1*/ 4578 void Penta::GradjDrag( Vec grad_g){4578 void Penta::GradjDrag(void){ 4579 4579 4580 4580 Tria* tria=NULL; 4581 TriaVertexInput* triavertexinput=NULL; 4582 double gradient[6]={0,0,0,0,0,0}; 4581 4583 4582 4584 /*inputs: */ … … 4586 4588 int analysis_type,sub_analysis_type; 4587 4589 4588 /*retri ve parameters: */4590 /*retrieve parameters: */ 4589 4591 parameters->FindParam(&analysis_type,AnalysisTypeEnum); 4590 4592 parameters->FindParam(&sub_analysis_type,AnalysisTypeEnum); … … 4608 4610 /*MacAyeal or Pattyn*/ 4609 4611 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria. 4610 tria->GradjDrag( grad_g); 4611 delete tria; 4612 return; 4612 tria->GradjDrag(); 4613 4613 } 4614 4614 else if (sub_analysis_type==StokesAnalysisEnum){ … … 4616 4616 /*Stokes*/ 4617 4617 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria. 4618 tria->GradjDragStokes( grad_g); 4619 delete tria; 4620 return; 4618 tria->GradjDragStokes(); 4621 4619 } 4622 4620 else ISSMERROR("%s%i%s\n","sub_analysis: ",sub_analysis_type," not supported yet"); 4621 4622 /*Now, the tria has a GradientEnum input. Take it, and make a PentaVertexInput out of it, then delete the tria: */ 4623 triavertexinput=tria->inputs->GetInput(GradientEnum); 4624 for(i=0;i<3;i++)gradient[i]=triavertexinput->values[i]; 4625 this->inputs->AddInput(new PentaVertexInput(GradientEnum,&gradient[0])); 4626 4627 delete tria; 4628 4623 4629 } 4624 4630 /*}}}*/ 4625 4631 /*FUNCTION Penta::GradjB {{{1*/ 4626 void Penta::GradjB( Vec grad_g){4632 void Penta::GradjB(void){ 4627 4633 4628 4634 Tria* tria=NULL; 4635 TriaVertexInput* triavertexinput=NULL; 4636 double gradient[6]={0,0,0,0,0,0}; 4629 4637 4630 4638 /*inputs: */ … … 4648 4656 * and compute gardj*/ 4649 4657 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face). 4650 tria->GradjB(grad_g); 4651 delete tria; 4652 return; 4658 tria->GradjB(); 4653 4659 } 4654 4660 else{ 4655 4661 /*B is a 2d field, use MacAyeal(2d) gradient even if it is Stokes or Pattyn*/ 4656 4662 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face). 4657 tria->GradjB(grad_g); 4658 delete tria; 4659 return; 4660 } 4663 tria->GradjB(); 4664 } 4665 4666 /*Now, the tria has a GradientEnum input. Take it, and make a PentaVertexInput out of it, then delete the tria: */ 4667 triavertexinput=tria->inputs->GetInput(GradientEnum); 4668 for(i=0;i<3;i++)gradient[i]=triavertexinput->values[i]; 4669 this->inputs->AddInput(new PentaVertexInput(GradientEnum,&gradient[0])); 4670 4671 delete tria; 4672 4661 4673 } 4662 4674 /*}}}*/ … … 5328 5340 } 5329 5341 /*}}}*/ 5342 /*FUNCTION Penta::ScaleInput(int enum_type,double scale_factor){{{1*/ 5343 void Penta::ScaleInput(int enum_type,double scale_factor){ 5344 5345 Input* input=NULL; 5346 5347 /*Make a copy of the original input: */ 5348 input=(Input*)this->inputs->GetInput(enum_type); 5349 5350 /*Scale: */ 5351 input->Scale(scale_factor); 5352 } 5353 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.