source:
issm/oecreview/Archive/24307-24683/ISSM-24377-24378.diff@
24684
Last change on this file since 24684 was 24684, checked in by , 5 years ago | |
---|---|
File size: 12.4 KB |
-
../trunk-jpl/src/c/classes/FemModel.cpp
1763 1763 maxabsvx=-INFINITY; 1764 1764 for(i=0;i<this->elements->Size();i++){ 1765 1765 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i)); 1766 element_maxabsvx=element->inputs->MaxAbs(VxEnum); 1766 Input2* input = element->GetInput2(VxEnum); 1767 element_maxabsvx=input->GetInputMaxAbs(); 1767 1768 if(element_maxabsvx>maxabsvx) maxabsvx=element_maxabsvx; 1768 1769 } 1769 1770 … … 1787 1788 maxabsvy=-INFINITY; 1788 1789 for(i=0;i<this->elements->Size();i++){ 1789 1790 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i)); 1790 element_maxabsvy=element->inputs->MaxAbs(VyEnum); 1791 Input2* input = element->GetInput2(VyEnum); 1792 element_maxabsvy=input->GetInputMaxAbs(); 1791 1793 if(element_maxabsvy>maxabsvy) maxabsvy=element_maxabsvy; 1792 1794 } 1793 1795 … … 1811 1813 maxabsvz=-INFINITY; 1812 1814 for(i=0;i<this->elements->Size();i++){ 1813 1815 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i)); 1814 element_maxabsvz=element->inputs->MaxAbs(VzEnum); 1816 Input2* input = element->GetInput2(VzEnum); 1817 element_maxabsvz=input->GetInputMaxAbs(); 1815 1818 if(element_maxabsvz>maxabsvz) maxabsvz=element_maxabsvz; 1816 1819 } 1817 1820 … … 1954 1957 minvel=INFINITY; 1955 1958 for(i=0;i<this->elements->Size();i++){ 1956 1959 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i)); 1957 element_minvel = element->inputs->Min(VelEnum); 1960 Input2* input = element->GetInput2(VelEnum); 1961 element_minvel =input->GetInputMin(); 1958 1962 if(element_minvel<minvel) minvel=element_minvel; 1959 1963 } 1960 1964 … … 1978 1982 minvx=INFINITY; 1979 1983 for(i=0;i<this->elements->Size();i++){ 1980 1984 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i)); 1981 element_minvx = element->inputs->Min(VxEnum); 1985 Input2* input = element->GetInput2(VxEnum); 1986 element_minvx =input->GetInputMin(); 1982 1987 if(element_minvx<minvx) minvx=element_minvx; 1983 1988 } 1984 1989 … … 2002 2007 minvy=INFINITY; 2003 2008 for(i=0;i<this->elements->Size();i++){ 2004 2009 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i)); 2005 element_minvy = element->inputs->Min(VyEnum); 2010 Input2* input = element->GetInput2(VyEnum); 2011 element_minvy =input->GetInputMin(); 2006 2012 if(element_minvy<minvy) minvy=element_minvy; 2007 2013 } 2008 2014 … … 2026 2032 minvz=INFINITY; 2027 2033 for(i=0;i<this->elements->Size();i++){ 2028 2034 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i)); 2029 element_minvz = element->inputs->Min(VzEnum); 2035 Input2* input = element->GetInput2(VzEnum); 2036 element_minvz =input->GetInputMin(); 2030 2037 if(element_minvz<minvz) minvz=element_minvz; 2031 2038 } 2032 2039 … … 3636 3643 newtria->isonsurface = true; 3637 3644 newtria->isonbase = true; 3638 3645 newtria->parameters=NULL; 3639 newtria->inputs =new Inputs();3646 newtria->inputs2=NULL; 3640 3647 newtria->nodes=NULL; 3641 3648 newtria->vertices=NULL; 3642 3649 newtria->material=NULL; -
../trunk-jpl/src/c/classes/Elements/Element.h
43 43 int id; 44 44 int sid; 45 45 int lid; 46 Inputs *inputs;47 46 Inputs2 *inputs2; 48 47 Node **nodes; 49 48 Vertex **vertices; … … 68 67 void ComputeStrainRate(); 69 68 void CoordinateSystemTransform(IssmDouble** ptransform,Node** nodes,int numnodes,int* cs_array); 70 69 void DeepEcho(); 71 void DeleteInput(int input_enum);72 70 void DeleteMaterials(void); 73 71 void Delta18oParameterization(void); 74 72 void Delta18opdParameterization(void); -
../trunk-jpl/src/c/classes/Elements/Tria.cpp
42 42 /*this->parameters: we still can't point to it, it may not even exist. Configure will handle this.*/ 43 43 this->parameters = NULL; 44 44 45 /*intialize inputs: */46 this->inputs = new Inputs();47 48 45 /*initialize pointers:*/ 49 46 this->nodes = NULL; 50 47 this->vertices = NULL; … … 125 122 tria->id = this->id; 126 123 tria->sid = this->sid; 127 124 tria->lid = this->lid; 128 if(this->inputs) tria->inputs = (Inputs*)(this->inputs->Copy());129 else tria->inputs=new Inputs();130 125 tria->isonbase = this->isonbase; 131 126 tria->isonsurface = this->isonsurface; 132 127 … … 1097 1092 /*point parameters to real dataset: */ 1098 1093 this->parameters=parametersin; 1099 1094 this->inputs2=inputs2in; 1100 1101 /*get inputs configured too: */1102 this->inputs->Configure(this->parameters);1103 1104 1095 }/*}}}*/ 1105 1096 void Tria::ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index,int offset,int N, int M){/*{{{*/ 1106 1097 … … 3114 3105 3115 3106 /*Add new input to current element*/ 3116 3107 _error_("not implemented"); 3117 this->inputs->AddInput((Input*)newinput);3118 3108 } 3119 3109 /*}}}*/ 3120 3110 void Tria::InputUpdateFromIoModel(int index, IoModel* iomodel){ //i is the element index/*{{{*/ … … 4115 4105 seg->id=this->id; 4116 4106 seg->sid=this->sid; 4117 4107 seg->lid=this->lid; 4118 seg->inputs=NULL;//(Inputs*)this->inputs->SpawnSegInputs(index1,index2);4119 4108 seg->inputs2=this->inputs2; 4120 4109 seg->parameters=this->parameters; 4121 4110 seg->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED) -
../trunk-jpl/src/c/classes/Elements/Penta.cpp
55 55 //this->parameters: we still can't point to it, it may not even exist. Configure will handle this. 56 56 this->parameters=NULL; 57 57 58 /*intialize inputs: */59 this->inputs=new Inputs();60 61 58 /*initialize pointers:*/ 62 59 this->nodes = NULL; 63 60 this->vertices = NULL; … … 121 118 penta->id = this->id; 122 119 penta->sid = this->sid; 123 120 penta->lid = this->lid; 124 if(this->inputs) penta->inputs = (Inputs*)(this->inputs->Copy());125 else penta->inputs=new Inputs();126 121 penta->isonbase = this->isonbase; 127 122 penta->isonsurface = this->isonsurface; 128 123 … … 900 895 /*point parameters to real dataset: */ 901 896 this->parameters=parametersin; 902 897 this->inputs2=inputs2in; 903 904 /*get inputs configured too: */905 this->inputs->Configure(parameters);906 898 } 907 899 /*}}}*/ 908 900 void Penta::ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index,int offset,int N,int M){/*{{{*/ … … 2727 2719 mass_flux=tria->MassFlux(segment); 2728 2720 delete tria->material; delete tria; 2729 2721 2730 /*Delete Vx and Vy averaged*/2731 this->inputs->DeleteInput(VxAverageEnum);2732 this->inputs->DeleteInput(VyAverageEnum);2733 2734 2722 /*clean up and return*/ 2735 2723 return mass_flux; 2736 2724 } … … 2750 2738 mass_flux=tria->MassFlux(x1,y1,x2,y2,segment_id); 2751 2739 delete tria->material; delete tria; 2752 2740 2753 /*Delete Vx and Vy averaged*/2754 this->inputs->DeleteInput(VxAverageEnum);2755 this->inputs->DeleteInput(VyAverageEnum);2756 2757 2741 /*clean up and return*/ 2758 2742 return mass_flux; 2759 2743 } … … 3403 3387 if(this->GetInput2(CalvingrateyEnum)) this->InputDepthAverageAtBase(CalvingrateyEnum,CalvingrateyAverageEnum); 3404 3388 3405 3389 Tria* tria=(Tria*)SpawnTria(0,1,2); 3406 switch(this->material->ObjectEnum()){3407 case MaticeEnum:3408 this->inputs->DeleteInput(MaterialsRheologyBbarEnum);3409 this->inputs->DeleteInput(DamageDbarEnum);3410 break;3411 case MatestarEnum:3412 break;3413 default:3414 _error_("not supported yet");3415 }3416 this->inputs->DeleteInput(VxAverageEnum);3417 this->inputs->DeleteInput(VyAverageEnum);3418 this->inputs->DeleteInput(CalvingratexAverageEnum);3419 this->inputs->DeleteInput(CalvingrateyAverageEnum);3420 3390 3421 3391 return tria; 3422 3392 } … … 3442 3412 tria->id=this->id; 3443 3413 tria->sid=this->sid; 3444 3414 tria->lid=this->lid; 3445 tria->inputs=NULL;//(Inputs*)this->inputs->SpawnTriaInputs(index1,index2,index3);3446 3415 tria->parameters=this->parameters; 3447 3416 tria->inputs2=this->inputs2; 3448 3417 tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED) -
../trunk-jpl/src/c/classes/Elements/Seg.cpp
39 39 //this->parameters: we still can't point to it, it may not even exist. Configure will handle this. 40 40 this->parameters = NULL; 41 41 42 /*intialize inputs: */43 this->inputs = new Inputs();44 45 42 /*initialize pointers:*/ 46 43 this->nodes = NULL; 47 44 this->vertices = NULL; … … 101 98 seg->id = this->id; 102 99 seg->sid = this->sid; 103 100 seg->lid = this->lid; 104 if(this->inputs) seg->inputs = (Inputs*)(this->inputs->Copy());105 else seg->inputs=new Inputs();106 101 seg->isonbase = this->isonbase; 107 102 seg->isonsurface = this->isonsurface; 108 103 -
../trunk-jpl/src/c/classes/Elements/Tetra.cpp
35 35 //this->parameters: we still can't point to it, it may not even exist. Configure will handle this. 36 36 this->parameters = NULL; 37 37 38 /*intialize inputs: */39 this->inputs = new Inputs();40 41 38 /*initialize pointers:*/ 42 39 this->nodes = NULL; 43 40 this->vertices = NULL; … … 103 100 tetra->id = this->id; 104 101 tetra->sid = this->sid; 105 102 tetra->lid = this->lid; 106 if(this->inputs) tetra->inputs = (Inputs*)(this->inputs->Copy());107 else tetra->inputs=new Inputs();108 103 tetra->isonbase = this->isonbase; 109 104 tetra->isonsurface = this->isonsurface; 110 105 … … 164 159 /*point parameters to real dataset: */ 165 160 this->parameters=parametersin; 166 161 this->inputs2=inputs2in; 167 168 /*get inputs configured too: */169 this->inputs->Configure(parameters);170 162 } 171 163 /*}}}*/ 172 164 void Tetra::ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){/*{{{*/ … … 657 649 IssmDouble xz_plane[6]; 658 650 659 651 /*For FS only: we want the CS to be tangential to the bedrock*/ 660 inputs->GetInputValue(&approximation,ApproximationEnum);652 this->GetInput2Value(&approximation,ApproximationEnum); 661 653 if(!HasNodeOnBase() || approximation!=FSApproximationEnum) return; 662 654 663 655 //printf("element number %i \n",this->id); … … 762 754 /*Create Tria*/ 763 755 Tria* tria=new Tria(); 764 756 tria->id=this->id; 765 tria->inputs=(Inputs*)this->inputs->SpawnTriaInputs(index1,index2,index3);766 757 tria->parameters=this->parameters; 767 758 tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED) 768 759 this->SpawnTriaHook(xDynamicCast<ElementHook*>(tria),index1,index2,index3); -
../trunk-jpl/src/c/classes/Elements/Element.cpp
33 33 this->id = -1; 34 34 this->sid = -1; 35 35 this->lid = -1; 36 this->inputs = NULL;37 36 this->inputs2 = NULL; 38 37 this->nodes = NULL; 39 38 this->vertices = NULL; … … 43 42 }/*}}}*/ 44 43 Element::~Element(){/*{{{*/ 45 44 xDelete<int>(element_type_list); 46 delete inputs;47 45 } 48 46 /*}}}*/ 49 47 … … 410 408 else _printf_("parameters = NULL\n"); 411 409 412 410 _printf_(" inputs\n"); 413 if (inputs) inputs->DeepEcho();414 else _printf_("inputs =NULL\n");411 if(inputs2) inputs2->DeepEcho(); 412 else _printf_("inputs2=NULL\n"); 415 413 416 414 return; 417 415 } 418 416 /*}}}*/ 419 void Element::DeleteInput(int input_enum){/*{{{*/420 421 inputs->DeleteInput(input_enum);422 423 }424 /*}}}*/425 417 void Element::DeleteMaterials(void){/*{{{*/ 426 418 delete this->material; 427 419 }/*}}}*/ … … 933 925 else _printf_("parameters = NULL\n"); 934 926 935 927 _printf_(" inputs\n"); 936 if (inputs ) inputs->Echo();937 else _printf_("inputs =NULL\n");928 if (inputs2) inputs2->Echo(); 929 else _printf_("inputs2=NULL\n"); 938 930 } 939 931 /*}}}*/ 940 932 void Element::FindParam(bool* pvalue,int paramenum){/*{{{*/ … … 2306 2298 2307 2299 _assert_(this); 2308 2300 if(marshall_direction==MARSHALLING_BACKWARD){ 2309 inputs=new Inputs();2310 2301 nodes = NULL; 2311 2302 } 2312 2303 … … 2317 2308 MARSHALLING(lid); 2318 2309 MARSHALLING(element_type); 2319 2310 MARSHALLING_DYNAMIC(element_type_list,int,numanalyses); 2320 inputs->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);2321 2322 2311 } 2323 2312 /*}}}*/ 2324 2313 void Element::MigrateGroundingLine(IssmDouble* phi_ungrounding){/*{{{*/
Note:
See TracBrowser
for help on using the repository browser.