Changeset 4978
- Timestamp:
- 08/04/10 12:09:21 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/EnumDefinitions/EnumAsString.cpp
r4971 r4978 268 268 case EpsRelEnum : return "EpsRel"; 269 269 case EpsResEnum : return "EpsRes"; 270 case ExtrudeParamEnum : return "ExtrudeParam";271 270 case HeatCapacityEnum : return "HeatCapacity"; 272 271 case IsHutterEnum : return "IsHutter"; -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r4971 r4978 305 305 EpsRelEnum, 306 306 EpsResEnum, 307 ExtrudeParamEnum,308 307 HeatCapacityEnum, 309 308 IsHutterEnum, -
issm/trunk/src/c/EnumDefinitions/StringAsEnum.cpp
r4971 r4978 266 266 else if (strcmp(name,"EpsRel")==0) return EpsRelEnum; 267 267 else if (strcmp(name,"EpsRes")==0) return EpsResEnum; 268 else if (strcmp(name,"ExtrudeParam")==0) return ExtrudeParamEnum;269 268 else if (strcmp(name,"HeatCapacity")==0) return HeatCapacityEnum; 270 269 else if (strcmp(name,"IsHutter")==0) return IsHutterEnum; -
issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
r4934 r4978 26 26 27 27 if (strcmp(iomodel->control_type,"drag_coefficient")==0){ 28 parameters->AddObject(new BoolParam(ExtrudeParamEnum,false));29 28 parameters->AddObject(new IntParam(ControlTypeEnum,DragCoefficientEnum)); 30 29 } 31 30 else if (strcmp(iomodel->control_type,"rheology_B")==0){ 32 parameters->AddObject(new BoolParam(ExtrudeParamEnum,true));33 31 parameters->AddObject(new IntParam(ControlTypeEnum,RheologyB2dEnum)); 34 32 } -
issm/trunk/src/c/objects/Elements/Penta.cpp
r4974 r4978 697 697 /*This element should be collapsed into a tria element at its base. Create this tria element, 698 698 * and compute CostFunction*/ 699 700 /*Depth Average B*/ 701 this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum); 702 699 703 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face). 700 704 J=tria->CostFunction(process_units); 701 705 delete tria; 706 707 /*delete B average*/ 708 this->matice->inputs->DeleteInput(RheologyB2dEnum); 709 702 710 return J; 703 711 } 704 712 else{ 713 714 /*Depth Average B*/ 715 this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum); 705 716 706 717 tria=(Tria*)SpawnTria(3,4,5); //grids 3, 4 and 5 make the new tria (upper face). 707 718 J=tria->CostFunction(process_units); 708 719 delete tria; 720 721 /*delete B average*/ 722 this->matice->inputs->DeleteInput(RheologyB2dEnum); 723 709 724 return J; 710 725 } … … 994 1009 double cm_min,cm_max; 995 1010 int control_type; 1011 bool onbed; 996 1012 997 1013 /*retrieve some parameters: */ … … 1000 1016 this->parameters->FindParam(&control_type,ControlTypeEnum); 1001 1017 1002 1003 1018 /*Rheology*/ 1004 1019 if(control_type==RheologyB2dEnum){ 1020 1021 /*The update is done by the element on bed only*/ 1022 inputs->GetParameterValue(&onbed,ElementOnBedEnum); 1023 if (!onbed) return; 1005 1024 1006 1025 /*First, get revert to previous parameter value (kept in ControlParameter input)*/ … … 1018 1037 input->Constrain(cm_min,cm_max); 1019 1038 1039 /*OK, now we can propagate the new parameter up*/ 1040 this->InputExtrude(RheologyBEnum,MaterialsEnum); 1041 1020 1042 /*Finally: save input if requested*/ 1021 if (save_parameter) matice->inputs->DuplicateInput(RheologyBEnum,ControlParameterEnum); 1043 if (save_parameter){ 1044 matice->inputs->DuplicateInput(RheologyBEnum,ControlParameterEnum); 1045 this->InputExtrude(ControlParameterEnum,MaterialsEnum); 1046 } 1022 1047 1023 1048 } … … 1174 1199 /*Go through all the input objects, and find the one corresponding to enum_type, if it exists: */ 1175 1200 if (enum_type==RheologyB2dEnum){ 1176 input=this->matice->inputs->GetInput( enum_type);1201 input=this->matice->inputs->GetInput(RheologyBEnum); 1177 1202 } 1178 1203 else{ … … 4671 4696 /*This element should be collapsed into a tria element at its base. Create this tria element, 4672 4697 * and compute gardj*/ 4698 4699 /*Depth Average B*/ 4700 this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum); 4701 4673 4702 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face). 4674 4703 tria->GradjB(gradient); 4675 4704 delete tria; 4705 4706 /*delete B average*/ 4707 this->matice->inputs->DeleteInput(RheologyB2dEnum); 4676 4708 } 4677 4709 else{ 4710 /*Depth Average B*/ 4711 this->InputDepthAverageAtBase(RheologyBEnum,RheologyB2dEnum,MaterialsEnum); 4712 4678 4713 /*B is a 2d field, use MacAyeal(2d) gradient even if it is Stokes or Pattyn*/ 4679 4714 tria=(Tria*)SpawnTria(0,1,2); //grids 0, 1 and 2 make the new tria (lower face). 4680 4715 tria->GradjB(gradient); 4681 4716 delete tria; 4682 } 4683 4717 4718 /*delete B average*/ 4719 this->matice->inputs->DeleteInput(RheologyB2dEnum); 4720 } 4684 4721 4685 4722 } … … 4736 4773 /*}}}*/ 4737 4774 /*FUNCTION Penta::InputExtrude {{{1*/ 4738 void Penta::InputExtrude(int enum_type, bool only_if_collapsed){4739 4740 bool onbed ,collapse=false;4775 void Penta::InputExtrude(int enum_type,int object_type){ 4776 4777 bool onbed; 4741 4778 Penta *penta = NULL; 4742 4779 Input *original_input = NULL; 4743 4780 4744 4781 /*recover parameters: */ 4745 if (only_if_collapsed) inputs->GetParameterValue(&collapse,CollapseEnum);4746 4782 inputs->GetParameterValue(&onbed,ElementOnBedEnum); 4747 4748 /*First: if only_if_collapsed, check wether this penta is collapsed*/4749 if (only_if_collapsed && !collapse) return;4750 4783 4751 4784 /*Are we on the base, not on the surface?:*/ … … 4758 4791 4759 4792 /*Step1: Extrude the original input: */ 4760 original_input=(Input*)this->inputs->GetInput(enum_type); 4793 if (object_type==ElementsEnum) 4794 original_input=(Input*)this->inputs->GetInput(enum_type); 4795 else if (object_type==MaterialsEnum) 4796 original_input=(Input*)matice->inputs->GetInput(enum_type); 4797 else 4798 ISSMERROR("object of type %s not supported yet",EnumAsString(object_type)); 4761 4799 if(!original_input) ISSMERROR("%s%s"," could not find input with enum:",EnumAsString(enum_type)); 4762 4800 original_input->Extrude(); … … 4776 4814 Input* copy=NULL; 4777 4815 copy=(Input*)original_input->copy(); 4778 penta->inputs->AddInput((Input*)copy); 4816 if (object_type==ElementsEnum) 4817 penta->inputs->AddInput((Input*)copy); 4818 else if (object_type==MaterialsEnum) 4819 penta->matice->inputs->AddInput((Input*)copy); 4820 else 4821 ISSMERROR("object of type %s not supported yet",EnumAsString(object_type)); 4779 4822 4780 4823 /*Stop if we have reached the surface*/ -
issm/trunk/src/c/objects/Elements/Penta.h
r4974 r4978 156 156 void GetStrainRate3d(double* epsilon,double* xyz_list, double* gauss, Input* vx_input, Input* vy_input, Input* vz_input); 157 157 Penta* GetUpperElement(void); 158 void InputExtrude(int enum_type, bool only_if_collapsed);158 void InputExtrude(int enum_type,int object_type); 159 159 void InputUpdateFromSolutionAdjointHoriz( double* solutiong); 160 160 void InputUpdateFromSolutionAdjointStokes( double* solutiong); -
issm/trunk/src/c/objects/Materials/Matice.cpp
r4967 r4978 547 547 548 548 /*Call inputs method*/ 549 printf("%s\n",EnumAsString(original_enum));550 549 if (IsInput(original_enum)) inputs->DuplicateInput(original_enum,new_enum); 551 550
Note:
See TracChangeset
for help on using the changeset viewer.