source: issm/oecreview/Archive/24307-24683/ISSM-24377-24378.diff@ 24684

Last change on this file since 24684 was 24684, checked in by Mathieu Morlighem, 5 years ago

CHG: added new review

File size: 12.4 KB
RevLine 
[24684]1Index: ../trunk-jpl/src/c/classes/FemModel.cpp
2===================================================================
3--- ../trunk-jpl/src/c/classes/FemModel.cpp (revision 24377)
4+++ ../trunk-jpl/src/c/classes/FemModel.cpp (revision 24378)
5@@ -1763,7 +1763,8 @@
6 maxabsvx=-INFINITY;
7 for(i=0;i<this->elements->Size();i++){
8 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
9- element_maxabsvx=element->inputs->MaxAbs(VxEnum);
10+ Input2* input = element->GetInput2(VxEnum);
11+ element_maxabsvx=input->GetInputMaxAbs();
12 if(element_maxabsvx>maxabsvx) maxabsvx=element_maxabsvx;
13 }
14
15@@ -1787,7 +1788,8 @@
16 maxabsvy=-INFINITY;
17 for(i=0;i<this->elements->Size();i++){
18 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
19- element_maxabsvy=element->inputs->MaxAbs(VyEnum);
20+ Input2* input = element->GetInput2(VyEnum);
21+ element_maxabsvy=input->GetInputMaxAbs();
22 if(element_maxabsvy>maxabsvy) maxabsvy=element_maxabsvy;
23 }
24
25@@ -1811,7 +1813,8 @@
26 maxabsvz=-INFINITY;
27 for(i=0;i<this->elements->Size();i++){
28 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
29- element_maxabsvz=element->inputs->MaxAbs(VzEnum);
30+ Input2* input = element->GetInput2(VzEnum);
31+ element_maxabsvz=input->GetInputMaxAbs();
32 if(element_maxabsvz>maxabsvz) maxabsvz=element_maxabsvz;
33 }
34
35@@ -1954,7 +1957,8 @@
36 minvel=INFINITY;
37 for(i=0;i<this->elements->Size();i++){
38 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
39- element_minvel = element->inputs->Min(VelEnum);
40+ Input2* input = element->GetInput2(VelEnum);
41+ element_minvel =input->GetInputMin();
42 if(element_minvel<minvel) minvel=element_minvel;
43 }
44
45@@ -1978,7 +1982,8 @@
46 minvx=INFINITY;
47 for(i=0;i<this->elements->Size();i++){
48 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
49- element_minvx = element->inputs->Min(VxEnum);
50+ Input2* input = element->GetInput2(VxEnum);
51+ element_minvx =input->GetInputMin();
52 if(element_minvx<minvx) minvx=element_minvx;
53 }
54
55@@ -2002,7 +2007,8 @@
56 minvy=INFINITY;
57 for(i=0;i<this->elements->Size();i++){
58 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
59- element_minvy = element->inputs->Min(VyEnum);
60+ Input2* input = element->GetInput2(VyEnum);
61+ element_minvy =input->GetInputMin();
62 if(element_minvy<minvy) minvy=element_minvy;
63 }
64
65@@ -2026,7 +2032,8 @@
66 minvz=INFINITY;
67 for(i=0;i<this->elements->Size();i++){
68 Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
69- element_minvz = element->inputs->Min(VzEnum);
70+ Input2* input = element->GetInput2(VzEnum);
71+ element_minvz =input->GetInputMin();
72 if(element_minvz<minvz) minvz=element_minvz;
73 }
74
75@@ -3636,7 +3643,7 @@
76 newtria->isonsurface = true;
77 newtria->isonbase = true;
78 newtria->parameters=NULL;
79- newtria->inputs=new Inputs();
80+ newtria->inputs2=NULL;
81 newtria->nodes=NULL;
82 newtria->vertices=NULL;
83 newtria->material=NULL;
84Index: ../trunk-jpl/src/c/classes/Elements/Element.h
85===================================================================
86--- ../trunk-jpl/src/c/classes/Elements/Element.h (revision 24377)
87+++ ../trunk-jpl/src/c/classes/Elements/Element.h (revision 24378)
88@@ -43,7 +43,6 @@
89 int id;
90 int sid;
91 int lid;
92- Inputs *inputs;
93 Inputs2 *inputs2;
94 Node **nodes;
95 Vertex **vertices;
96@@ -68,7 +67,6 @@
97 void ComputeStrainRate();
98 void CoordinateSystemTransform(IssmDouble** ptransform,Node** nodes,int numnodes,int* cs_array);
99 void DeepEcho();
100- void DeleteInput(int input_enum);
101 void DeleteMaterials(void);
102 void Delta18oParameterization(void);
103 void Delta18opdParameterization(void);
104Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
105===================================================================
106--- ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 24377)
107+++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 24378)
108@@ -42,9 +42,6 @@
109 /*this->parameters: we still can't point to it, it may not even exist. Configure will handle this.*/
110 this->parameters = NULL;
111
112- /*intialize inputs: */
113- this->inputs = new Inputs();
114-
115 /*initialize pointers:*/
116 this->nodes = NULL;
117 this->vertices = NULL;
118@@ -125,8 +122,6 @@
119 tria->id = this->id;
120 tria->sid = this->sid;
121 tria->lid = this->lid;
122- if(this->inputs) tria->inputs = (Inputs*)(this->inputs->Copy());
123- else tria->inputs=new Inputs();
124 tria->isonbase = this->isonbase;
125 tria->isonsurface = this->isonsurface;
126
127@@ -1097,10 +1092,6 @@
128 /*point parameters to real dataset: */
129 this->parameters=parametersin;
130 this->inputs2=inputs2in;
131-
132- /*get inputs configured too: */
133- this->inputs->Configure(this->parameters);
134-
135 }/*}}}*/
136 void Tria::ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index,int offset,int N, int M){/*{{{*/
137
138@@ -3114,7 +3105,6 @@
139
140 /*Add new input to current element*/
141 _error_("not implemented");
142- this->inputs->AddInput((Input*)newinput);
143 }
144 /*}}}*/
145 void Tria::InputUpdateFromIoModel(int index, IoModel* iomodel){ //i is the element index/*{{{*/
146@@ -4115,7 +4105,6 @@
147 seg->id=this->id;
148 seg->sid=this->sid;
149 seg->lid=this->lid;
150- seg->inputs=NULL;//(Inputs*)this->inputs->SpawnSegInputs(index1,index2);
151 seg->inputs2=this->inputs2;
152 seg->parameters=this->parameters;
153 seg->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED)
154Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
155===================================================================
156--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 24377)
157+++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 24378)
158@@ -55,9 +55,6 @@
159 //this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
160 this->parameters=NULL;
161
162- /*intialize inputs: */
163- this->inputs=new Inputs();
164-
165 /*initialize pointers:*/
166 this->nodes = NULL;
167 this->vertices = NULL;
168@@ -121,8 +118,6 @@
169 penta->id = this->id;
170 penta->sid = this->sid;
171 penta->lid = this->lid;
172- if(this->inputs) penta->inputs = (Inputs*)(this->inputs->Copy());
173- else penta->inputs=new Inputs();
174 penta->isonbase = this->isonbase;
175 penta->isonsurface = this->isonsurface;
176
177@@ -900,9 +895,6 @@
178 /*point parameters to real dataset: */
179 this->parameters=parametersin;
180 this->inputs2=inputs2in;
181-
182- /*get inputs configured too: */
183- this->inputs->Configure(parameters);
184 }
185 /*}}}*/
186 void Penta::ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index,int offset,int N,int M){/*{{{*/
187@@ -2727,10 +2719,6 @@
188 mass_flux=tria->MassFlux(segment);
189 delete tria->material; delete tria;
190
191- /*Delete Vx and Vy averaged*/
192- this->inputs->DeleteInput(VxAverageEnum);
193- this->inputs->DeleteInput(VyAverageEnum);
194-
195 /*clean up and return*/
196 return mass_flux;
197 }
198@@ -2750,10 +2738,6 @@
199 mass_flux=tria->MassFlux(x1,y1,x2,y2,segment_id);
200 delete tria->material; delete tria;
201
202- /*Delete Vx and Vy averaged*/
203- this->inputs->DeleteInput(VxAverageEnum);
204- this->inputs->DeleteInput(VyAverageEnum);
205-
206 /*clean up and return*/
207 return mass_flux;
208 }
209@@ -3403,20 +3387,6 @@
210 if(this->GetInput2(CalvingrateyEnum)) this->InputDepthAverageAtBase(CalvingrateyEnum,CalvingrateyAverageEnum);
211
212 Tria* tria=(Tria*)SpawnTria(0,1,2);
213- switch(this->material->ObjectEnum()){
214- case MaticeEnum:
215- this->inputs->DeleteInput(MaterialsRheologyBbarEnum);
216- this->inputs->DeleteInput(DamageDbarEnum);
217- break;
218- case MatestarEnum:
219- break;
220- default:
221- _error_("not supported yet");
222- }
223- this->inputs->DeleteInput(VxAverageEnum);
224- this->inputs->DeleteInput(VyAverageEnum);
225- this->inputs->DeleteInput(CalvingratexAverageEnum);
226- this->inputs->DeleteInput(CalvingrateyAverageEnum);
227
228 return tria;
229 }
230@@ -3442,7 +3412,6 @@
231 tria->id=this->id;
232 tria->sid=this->sid;
233 tria->lid=this->lid;
234- tria->inputs=NULL;//(Inputs*)this->inputs->SpawnTriaInputs(index1,index2,index3);
235 tria->parameters=this->parameters;
236 tria->inputs2=this->inputs2;
237 tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED)
238Index: ../trunk-jpl/src/c/classes/Elements/Seg.cpp
239===================================================================
240--- ../trunk-jpl/src/c/classes/Elements/Seg.cpp (revision 24377)
241+++ ../trunk-jpl/src/c/classes/Elements/Seg.cpp (revision 24378)
242@@ -39,9 +39,6 @@
243 //this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
244 this->parameters = NULL;
245
246- /*intialize inputs: */
247- this->inputs = new Inputs();
248-
249 /*initialize pointers:*/
250 this->nodes = NULL;
251 this->vertices = NULL;
252@@ -101,8 +98,6 @@
253 seg->id = this->id;
254 seg->sid = this->sid;
255 seg->lid = this->lid;
256- if(this->inputs) seg->inputs = (Inputs*)(this->inputs->Copy());
257- else seg->inputs=new Inputs();
258 seg->isonbase = this->isonbase;
259 seg->isonsurface = this->isonsurface;
260
261Index: ../trunk-jpl/src/c/classes/Elements/Tetra.cpp
262===================================================================
263--- ../trunk-jpl/src/c/classes/Elements/Tetra.cpp (revision 24377)
264+++ ../trunk-jpl/src/c/classes/Elements/Tetra.cpp (revision 24378)
265@@ -35,9 +35,6 @@
266 //this->parameters: we still can't point to it, it may not even exist. Configure will handle this.
267 this->parameters = NULL;
268
269- /*intialize inputs: */
270- this->inputs = new Inputs();
271-
272 /*initialize pointers:*/
273 this->nodes = NULL;
274 this->vertices = NULL;
275@@ -103,8 +100,6 @@
276 tetra->id = this->id;
277 tetra->sid = this->sid;
278 tetra->lid = this->lid;
279- if(this->inputs) tetra->inputs = (Inputs*)(this->inputs->Copy());
280- else tetra->inputs=new Inputs();
281 tetra->isonbase = this->isonbase;
282 tetra->isonsurface = this->isonsurface;
283
284@@ -164,9 +159,6 @@
285 /*point parameters to real dataset: */
286 this->parameters=parametersin;
287 this->inputs2=inputs2in;
288-
289- /*get inputs configured too: */
290- this->inputs->Configure(parameters);
291 }
292 /*}}}*/
293 void Tetra::ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){/*{{{*/
294@@ -657,7 +649,7 @@
295 IssmDouble xz_plane[6];
296
297 /*For FS only: we want the CS to be tangential to the bedrock*/
298- inputs->GetInputValue(&approximation,ApproximationEnum);
299+ this->GetInput2Value(&approximation,ApproximationEnum);
300 if(!HasNodeOnBase() || approximation!=FSApproximationEnum) return;
301
302 //printf("element number %i \n",this->id);
303@@ -762,7 +754,6 @@
304 /*Create Tria*/
305 Tria* tria=new Tria();
306 tria->id=this->id;
307- tria->inputs=(Inputs*)this->inputs->SpawnTriaInputs(index1,index2,index3);
308 tria->parameters=this->parameters;
309 tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED)
310 this->SpawnTriaHook(xDynamicCast<ElementHook*>(tria),index1,index2,index3);
311Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
312===================================================================
313--- ../trunk-jpl/src/c/classes/Elements/Element.cpp (revision 24377)
314+++ ../trunk-jpl/src/c/classes/Elements/Element.cpp (revision 24378)
315@@ -33,7 +33,6 @@
316 this->id = -1;
317 this->sid = -1;
318 this->lid = -1;
319- this->inputs = NULL;
320 this->inputs2 = NULL;
321 this->nodes = NULL;
322 this->vertices = NULL;
323@@ -43,7 +42,6 @@
324 }/*}}}*/
325 Element::~Element(){/*{{{*/
326 xDelete<int>(element_type_list);
327- delete inputs;
328 }
329 /*}}}*/
330
331@@ -410,18 +408,12 @@
332 else _printf_("parameters = NULL\n");
333
334 _printf_(" inputs\n");
335- if (inputs) inputs->DeepEcho();
336- else _printf_("inputs=NULL\n");
337+ if(inputs2) inputs2->DeepEcho();
338+ else _printf_("inputs2=NULL\n");
339
340 return;
341 }
342 /*}}}*/
343-void Element::DeleteInput(int input_enum){/*{{{*/
344-
345- inputs->DeleteInput(input_enum);
346-
347-}
348-/*}}}*/
349 void Element::DeleteMaterials(void){/*{{{*/
350 delete this->material;
351 }/*}}}*/
352@@ -933,8 +925,8 @@
353 else _printf_("parameters = NULL\n");
354
355 _printf_(" inputs\n");
356- if (inputs) inputs->Echo();
357- else _printf_("inputs=NULL\n");
358+ if (inputs2) inputs2->Echo();
359+ else _printf_("inputs2=NULL\n");
360 }
361 /*}}}*/
362 void Element::FindParam(bool* pvalue,int paramenum){/*{{{*/
363@@ -2306,7 +2298,6 @@
364
365 _assert_(this);
366 if(marshall_direction==MARSHALLING_BACKWARD){
367- inputs=new Inputs();
368 nodes = NULL;
369 }
370
371@@ -2317,8 +2308,6 @@
372 MARSHALLING(lid);
373 MARSHALLING(element_type);
374 MARSHALLING_DYNAMIC(element_type_list,int,numanalyses);
375- inputs->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
376-
377 }
378 /*}}}*/
379 void Element::MigrateGroundingLine(IssmDouble* phi_ungrounding){/*{{{*/
Note: See TracBrowser for help on using the repository browser.