source: issm/oecreview/Archive/14312-15392/ISSM-14760-14761.diff@ 15393

Last change on this file since 15393 was 15393, checked in by Mathieu Morlighem, 12 years ago

NEW: adding Archive/14312-15392 for oecreview

File size: 33.8 KB
RevLine 
[15393]1Index: ../trunk-jpl/src/c/Container/Elements.cpp
2===================================================================
3--- ../trunk-jpl/src/c/Container/Elements.cpp (revision 14760)
4+++ ../trunk-jpl/src/c/Container/Elements.cpp (revision 14761)
5@@ -46,7 +46,7 @@
6 for ( object=objects.begin() ; object < objects.end(); object++ ){
7
8 element=dynamic_cast<Element*>((*object));
9- element->Configure(elements,loads,nodes,materials,parameters);
10+ element->Configure(elements,loads,nodes,vertices,materials,parameters);
11
12 }
13
14Index: ../trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp
15===================================================================
16--- ../trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp (revision 14760)
17+++ ../trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp (revision 14761)
18@@ -13,13 +13,13 @@
19 int ConfigureObjectsx( Elements* elements, Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters){
20
21 /*Intermediary*/
22+ int i;
23 int noerr=1;
24- int i;
25- Element* element=NULL;
26- Load* load=NULL;
27- Node* node=NULL;
28- Material* material=NULL;
29 int configuration_type;
30+ Element *element = NULL;
31+ Load *load = NULL;
32+ Node *node = NULL;
33+ Material *material = NULL;
34
35 /*Get analysis type: */
36 parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
37@@ -27,7 +27,7 @@
38 if(VerboseMProcessor()) _pprintLine_(" Configuring elements...");
39 for (i=0;i<elements->Size();i++){
40 element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
41- element->Configure(elements,loads,nodes,materials,parameters);
42+ element->Configure(elements,loads,nodes,vertices,materials,parameters);
43 }
44 if(VerboseMProcessor()) _pprintLine_(" Configuring loads...");
45 for (i=0;i<loads->Size();i++){
46Index: ../trunk-jpl/src/c/classes/objects/Loads/Icefront.h
47===================================================================
48--- ../trunk-jpl/src/c/classes/objects/Loads/Icefront.h (revision 14760)
49+++ ../trunk-jpl/src/c/classes/objects/Loads/Icefront.h (revision 14761)
50@@ -25,18 +25,20 @@
51 int analysis_type;
52
53 /*hooks: */
54- Hook* hnodes;
55- Hook* helement;
56- Hook* hmatpar;
57+ Hook *hnodes;
58+ Hook *hvertices;
59+ Hook *helement;
60+ Hook *hmatpar;
61
62 /*Corresponding fields*/
63 Matpar *matpar;
64 Node **nodes;
65+ Vertex **vertices;
66 Element *element;
67
68 /*inputs and parameters: */
69- Inputs* inputs;
70- Parameters* parameters;
71+ Inputs *inputs;
72+ Parameters *parameters;
73
74 /*Icefront constructors, destructors: {{{*/
75 Icefront();
76Index: ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp
77===================================================================
78--- ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp (revision 14760)
79+++ ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp (revision 14761)
80@@ -25,12 +25,13 @@
81 /*Numericalflux constructors and destructor*/
82 /*FUNCTION Numericalflux::Numericalflux(){{{*/
83 Numericalflux::Numericalflux(){
84- this->inputs=NULL;
85- this->parameters=NULL;
86- this->helement=NULL;
87- this->element=NULL;
88- this->hnodes=NULL;
89- this->nodes=NULL;
90+ this->inputs = NULL;
91+ this->parameters = NULL;
92+ this->helement = NULL;
93+ this->element = NULL;
94+ this->hnodes = NULL;
95+ this->hvertices = NULL;
96+ this->nodes = NULL;
97 }
98 /*}}}*/
99 /*FUNCTION Numericalflux::Numericalflux(int id, int i, IoModel* iomodel, int analysis_type) {{{*/
100@@ -47,6 +48,7 @@
101 /*numericalflux constructor data: */
102 int numericalflux_elem_ids[2];
103 int numericalflux_mparid;
104+ int numericalflux_vertex_ids[2];
105 int numericalflux_node_ids[4];
106 int numericalflux_type;
107
108@@ -82,7 +84,10 @@
109 /*1: Get vertices ids*/
110 i1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+0]);
111 i2=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+1]);
112+ numericalflux_vertex_ids[0]=i1;
113+ numericalflux_vertex_ids[1]=i2;
114
115+ /*2: Get node ids*/
116 if (numericalflux_type==InternalEnum){
117
118 /*Now, we must get the nodes of the 4 nodes located on the edge*/
119@@ -125,8 +130,9 @@
120 this->analysis_type=in_analysis_type;
121
122 /*Hooks: */
123- this->hnodes =new Hook(numericalflux_node_ids,num_nodes);
124- this->helement=new Hook(numericalflux_elem_ids,1); // take only the first element for now
125+ this->hnodes =new Hook(numericalflux_node_ids,num_nodes);
126+ this->hvertices =new Hook(numericalflux_vertex_ids,2);
127+ this->helement =new Hook(numericalflux_elem_ids,1); // take only the first element for now
128
129 //intialize and add as many inputs per element as requested:
130 this->inputs=new Inputs();
131@@ -144,6 +150,7 @@
132 this->parameters=NULL;
133 delete helement;
134 delete hnodes;
135+ delete hvertices;
136 }
137 /*}}}*/
138
139@@ -154,6 +161,7 @@
140 _printLine_(" id: " << id);
141 _printLine_(" analysis_type: " << EnumToStringx(analysis_type));
142 hnodes->Echo();
143+ hvertices->Echo();
144 helement->Echo();
145 _printLine_(" parameters: " << parameters);
146 _printLine_(" inputs: " << inputs);
147@@ -166,6 +174,7 @@
148 _printLine_(" id: " << id);
149 _printLine_(" analysis_type: " << EnumToStringx(analysis_type));
150 hnodes->DeepEcho();
151+ hvertices->DeepEcho();
152 helement->DeepEcho();
153 _printLine_(" parameters");
154 if(parameters)
155@@ -209,12 +218,14 @@
156 numericalflux->parameters=this->parameters;
157
158 /*now deal with hooks and objects: */
159- numericalflux->hnodes=(Hook*)this->hnodes->copy();
160- numericalflux->helement=(Hook*)this->helement->copy();
161+ numericalflux->hnodes = (Hook*)this->hnodes->copy();
162+ numericalflux->hvertices = (Hook*)this->hvertices->copy();
163+ numericalflux->helement = (Hook*)this->helement->copy();
164
165 /*corresponding fields*/
166- numericalflux->nodes =(Node**)numericalflux->hnodes->deliverp();
167- numericalflux->element=(Element*)numericalflux->helement->delivers();
168+ numericalflux->nodes = (Node**)numericalflux->hnodes->deliverp();
169+ numericalflux->vertices = (Vertex**)numericalflux->hvertices->deliverp();
170+ numericalflux->element = (Element*)numericalflux->helement->delivers();
171
172 return numericalflux;
173 }
174@@ -227,15 +238,16 @@
175 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
176 * datasets, using internal ids and offsets hidden in hooks: */
177 hnodes->configure(nodesin);
178+ hvertices->configure(verticesin);
179 helement->configure(elementsin);
180
181 /*Initialize hooked fields*/
182- this->nodes =(Node**)hnodes->deliverp();
183- this->element=(Element*)helement->delivers();
184+ this->nodes = (Node**)hnodes->deliverp();
185+ this->vertices = (Vertex**)hvertices->deliverp();
186+ this->element = (Element*)helement->delivers();
187
188 /*point parameters to real dataset: */
189 this->parameters=parametersin;
190-
191 }
192 /*}}}*/
193 /*FUNCTION Numericalflux::SetCurrentConfiguration {{{*/
194Index: ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h
195===================================================================
196--- ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h (revision 14760)
197+++ ../trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h (revision 14761)
198@@ -25,9 +25,11 @@
199 /*Hooks*/
200 Hook *helement;
201 Hook *hnodes;
202+ Hook *hvertices;
203
204 /*Corresponding fields*/
205 Element *element;
206+ Vertex **vertices;
207 Node **nodes;
208 Parameters *parameters;
209 Inputs *inputs;
210@@ -38,43 +40,43 @@
211 ~Numericalflux();
212 /*}}}*/
213 /*Object virtual functions definitions:{{{ */
214- void Echo();
215- void DeepEcho();
216- int Id();
217- int ObjectEnum();
218- Object* copy();
219+ void Echo();
220+ void DeepEcho();
221+ int Id();
222+ int ObjectEnum();
223+ Object *copy();
224 /*}}}*/
225 /*Update virtual functions resolution: {{{*/
226- void InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/}
227- void InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");}
228- void InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");}
229- void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/}
230- void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/}
231- void InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");}
232- void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");}
233- void InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/};
234- void InputUpdateFromConstant(int constant, int name){/*Do nothing*/};
235- void InputUpdateFromConstant(bool constant, int name){_error_("Not implemented yet!");}
236- void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");}
237- void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
238+ void InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/}
239+ void InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");}
240+ void InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");}
241+ void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/}
242+ void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/}
243+ void InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");}
244+ void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");}
245+ void InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/};
246+ void InputUpdateFromConstant(int constant, int name){/*Do nothing*/};
247+ void InputUpdateFromConstant(bool constant, int name){_error_("Not implemented yet!");}
248+ void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");}
249+ void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
250 /*}}}*/
251 /*Load virtual functions definitions: {{{*/
252- void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
253- void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
254- void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
255- void CreatePVector(Vector<IssmDouble>* pf);
256- void GetNodesSidList(int* sidlist);
257- int GetNumberOfNodes(void);
258- void CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
259- bool IsPenalty(void);
260- void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
261- void PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
262- void PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
263- void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum);
264- bool InAnalysis(int analysis_type);
265+ void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
266+ void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
267+ void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
268+ void CreatePVector(Vector<IssmDouble>* pf);
269+ void GetNodesSidList(int* sidlist);
270+ int GetNumberOfNodes(void);
271+ void CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
272+ bool IsPenalty(void);
273+ void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
274+ void PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
275+ void PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
276+ void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum);
277+ bool InAnalysis(int analysis_type);
278 /*}}}*/
279 /*Numericalflux management:{{{*/
280- void GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]);
281+ void GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]);
282 ElementMatrix* CreateKMatrixPrognostic(void);
283 ElementMatrix* CreateKMatrixPrognosticInternal(void);
284 ElementMatrix* CreateKMatrixPrognosticBoundary(void);
285Index: ../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp
286===================================================================
287--- ../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp (revision 14760)
288+++ ../trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp (revision 14761)
289@@ -31,6 +31,8 @@
290
291 this->hnodes=NULL;
292 this->nodes= NULL;
293+ this->hvertices=NULL;
294+ this->vertices= NULL;
295 this->helement=NULL;
296 this->element= NULL;
297 this->hmatpar=NULL;
298@@ -50,6 +52,7 @@
299 int icefront_eid;
300 int icefront_mparid;
301 int icefront_node_ids[NUMVERTICESQUA]; //initialize with largest size
302+ int icefront_vertex_ids[NUMVERTICESQUA]; //initialize with largest size
303 int icefront_fill;
304
305 /*find parameters: */
306@@ -73,12 +76,18 @@
307 if (in_icefront_type==MacAyeal2dIceFrontEnum || in_icefront_type==MacAyeal3dIceFrontEnum){
308 icefront_node_ids[0]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0));
309 icefront_node_ids[1]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1));
310+ icefront_vertex_ids[0]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0));
311+ icefront_vertex_ids[1]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1));
312 }
313 else if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum){
314 icefront_node_ids[0]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0));
315 icefront_node_ids[1]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1));
316 icefront_node_ids[2]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+2));
317 icefront_node_ids[3]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3));
318+ icefront_vertex_ids[0]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0));
319+ icefront_vertex_ids[1]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1));
320+ icefront_vertex_ids[2]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+2));
321+ icefront_vertex_ids[3]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3));
322 }
323 else _error_("in_icefront_type " << EnumToStringx(in_icefront_type) << " not supported yet!");
324
325@@ -96,6 +105,7 @@
326
327 /*Hooks: */
328 this->hnodes=new Hook(icefront_node_ids,num_nodes);
329+ this->hvertices=new Hook(icefront_vertex_ids,num_nodes);
330 this->helement=new Hook(&icefront_eid,1);
331 this->hmatpar=new Hook(&icefront_mparid,1);
332
333@@ -105,10 +115,11 @@
334 this->inputs->AddInput(new IntInput(IceFrontTypeEnum,in_icefront_type));
335
336 //parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this.
337- this->parameters=NULL;
338- this->nodes= NULL;
339- this->element= NULL;
340- this->matpar= NULL;
341+ this->parameters = NULL;
342+ this->nodes = NULL;
343+ this->vertices = NULL;
344+ this->element = NULL;
345+ this->matpar = NULL;
346 }
347
348 /*}}}*/
349@@ -117,6 +128,7 @@
350 delete inputs;
351 this->parameters=NULL;
352 delete hnodes;
353+ delete hvertices;
354 delete helement;
355 delete hmatpar;
356 }
357@@ -129,6 +141,7 @@
358 _printLine_(" id: " << id);
359 _printLine_(" analysis_type: " << EnumToStringx(analysis_type));
360 hnodes->Echo();
361+ hvertices->Echo();
362 helement->Echo();
363 hmatpar->Echo();
364 _printLine_(" parameters: " << parameters);
365@@ -144,6 +157,7 @@
366 _printLine_(" id: " << id);
367 _printLine_(" analysis_type: " << EnumToStringx(analysis_type));
368 hnodes->DeepEcho();
369+ hvertices->DeepEcho();
370 helement->DeepEcho();
371 hmatpar->DeepEcho();
372 _printLine_(" parameters: " << parameters);
373@@ -182,14 +196,16 @@
374 icefront->parameters=this->parameters;
375
376 /*now deal with hooks and objects: */
377- icefront->hnodes=(Hook*)this->hnodes->copy();
378- icefront->helement=(Hook*)this->helement->copy();
379- icefront->hmatpar=(Hook*)this->hmatpar->copy();
380+ icefront->hnodes = (Hook*)this->hnodes->copy();
381+ icefront->hvertices = (Hook*)this->hvertices->copy();
382+ icefront->helement = (Hook*)this->helement->copy();
383+ icefront->hmatpar = (Hook*)this->hmatpar->copy();
384
385 /*corresponding fields*/
386- icefront->nodes =(Node**)icefront->hnodes->deliverp();
387- icefront->element=(Element*)icefront->helement->delivers();
388- icefront->matpar =(Matpar*)icefront->hmatpar->delivers();
389+ icefront->nodes = (Node**)icefront->hnodes->deliverp();
390+ icefront->vertices = (Vertex**)icefront->hvertices->deliverp();
391+ icefront->element = (Element*)icefront->helement->delivers();
392+ icefront->matpar = (Matpar*)icefront->hmatpar->delivers();
393
394 return icefront;
395
396@@ -203,13 +219,15 @@
397 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
398 * datasets, using internal ids and offsets hidden in hooks: */
399 hnodes->configure(nodesin);
400+ hvertices->configure(verticesin);
401 helement->configure(elementsin);
402 hmatpar->configure(materialsin);
403
404 /*Initialize hooked fields*/
405- this->nodes =(Node**)hnodes->deliverp();
406- this->element=(Element*)helement->delivers();
407- this->matpar =(Matpar*)hmatpar->delivers();
408+ this->nodes = (Node**)hnodes->deliverp();
409+ this->vertices = (Vertex**)hvertices->deliverp();
410+ this->element = (Element*)helement->delivers();
411+ this->matpar = (Matpar*)hmatpar->delivers();
412
413 /*point parameters to real dataset: */
414 this->parameters=parametersin;
415Index: ../trunk-jpl/src/c/classes/objects/Elements/Element.h
416===================================================================
417--- ../trunk-jpl/src/c/classes/objects/Elements/Element.h (revision 14760)
418+++ ../trunk-jpl/src/c/classes/objects/Elements/Element.h (revision 14761)
419@@ -26,7 +26,7 @@
420
421 virtual ~Element(){};
422
423- virtual void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
424+ virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
425 virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
426 virtual void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum)=0;
427 virtual void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs)=0;
428Index: ../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp
429===================================================================
430--- ../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp (revision 14760)
431+++ ../trunk-jpl/src/c/classes/objects/Elements/Tria.cpp (revision 14761)
432@@ -30,13 +30,14 @@
433
434 int i;
435
436- this->nodes=NULL;
437- this->material=NULL;
438- this->matpar=NULL;
439+ this->nodes = NULL;
440+ this->vertices = NULL;
441+ this->material = NULL;
442+ this->matpar = NULL;
443 for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF;
444- this->inputs=NULL;
445- this->parameters=NULL;
446- this->results=NULL;
447+ this->inputs = NULL;
448+ this->parameters = NULL;
449+ this->results = NULL;
450
451 }
452 /*}}}*/
453@@ -61,9 +62,10 @@
454 this->results=new Results();
455
456 /*initialize pointers:*/
457- this->nodes=NULL;
458- this->material=NULL;
459- this->matpar=NULL;
460+ this->nodes = NULL;
461+ this->vertices = NULL;
462+ this->material = NULL;
463+ this->matpar = NULL;
464
465 }
466 /*}}}*/
467@@ -90,6 +92,7 @@
468 tria->numanalyses=this->numanalyses;
469 tria->hnodes=new Hook*[tria->numanalyses];
470 for(i=0;i<tria->numanalyses;i++)tria->hnodes[i]=(Hook*)this->hnodes[i]->copy();
471+ tria->hvertices=(Hook*)this->hvertices->copy();
472 tria->hmaterial=(Hook*)this->hmaterial->copy();
473 tria->hmatpar=(Hook*)this->hmatpar->copy();
474
475@@ -114,6 +117,7 @@
476 /*recover objects: */
477 tria->nodes=xNew<Node*>(3); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
478 for(i=0;i<3;i++)tria->nodes[i]=this->nodes[i];
479+ tria->vertices=(Vertex**)tria->hvertices->deliverp();
480 tria->material=(Material*)tria->hmaterial->delivers();
481 tria->matpar=(Matpar*)tria->hmatpar->delivers();
482
483@@ -886,7 +890,7 @@
484 }
485 /*}}}*/
486 /*FUNCTION Tria::Configure {{{*/
487-void Tria::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
488+void Tria::Configure(Elements* elementsin, Loads* loadsin,Nodes* nodesin,Vertices *verticesin,Materials* materialsin, Parameters* parametersin){
489
490 /*go into parameters and get the analysis_counter: */
491 int analysis_counter;
492@@ -898,14 +902,16 @@
493 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
494 * datasets, using internal ids and offsets hidden in hooks: */
495 if(this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin);
496+ this->hvertices->configure(verticesin);
497 this->hmaterial->configure(materialsin);
498 this->hmatpar->configure(materialsin);
499
500 /*Now, go pick up the objects inside the hooks: */
501 if(this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
502 else this->nodes=NULL;
503- this->material=(Material*)this->hmaterial->delivers();
504- this->matpar=(Matpar*)this->hmatpar->delivers();
505+ this->vertices = (Vertex**)this->hvertices->deliverp();
506+ this->material = (Material*)this->hmaterial->delivers();
507+ this->matpar = (Matpar*)this->hmatpar->delivers();
508
509 /*point parameters to real dataset: */
510 this->parameters=parametersin;
511Index: ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp
512===================================================================
513--- ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp (revision 14760)
514+++ ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp (revision 14761)
515@@ -23,9 +23,10 @@
516 /*FUNCTION TriaHook::TriaHook(){{{*/
517 TriaHook::TriaHook(){
518 numanalyses=UNDEF;
519- this->hnodes=NULL;
520- this->hmaterial=NULL;
521- this->hmatpar=NULL;
522+ this->hnodes = NULL;
523+ this->hvertices = NULL;
524+ this->hmaterial = NULL;
525+ this->hmatpar = NULL;
526 }
527 /*}}}*/
528 /*FUNCTION TriaHook::~TriaHook(){{{*/
529@@ -35,26 +36,38 @@
530 for(i=0;i<this->numanalyses;i++){
531 if (this->hnodes[i]) delete this->hnodes[i];
532 }
533- delete [] this->hnodes;
534+ delete [] hnodes;
535+ delete hvertices;
536 delete hmaterial;
537 delete hmatpar;
538
539 }
540 /*}}}*/
541-/*FUNCTION TriaHook::TriaHook(int in_numanalyses,int material_id, int matpar_id){{{*/
542-TriaHook::TriaHook(int in_numanalyses,int material_id, IoModel* iomodel){
543+/*FUNCTION TriaHook::TriaHook(int in_numanalyses,int element_id, int matpar_id){{{*/
544+TriaHook::TriaHook(int in_numanalyses,int element_id, IoModel* iomodel){
545
546 /*intermediary: */
547 int matpar_id;
548+ int material_id;
549+ int tria_vertex_ids[3];
550
551- /*retrieve parameters: */
552+ /*retrieve material_id: */
553 iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
554
555- this->numanalyses=in_numanalyses;
556- this->hnodes= new Hook*[in_numanalyses];
557- this->hmaterial=new Hook(&material_id,1);
558- this->hmatpar=new Hook(&matpar_id,1);
559+ /*retrive material_id*/
560+ material_id = element_id;
561
562+ /*retrieve vertices ids*/
563+ for(int i=0;i<3;i++){
564+ tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*(element_id-1)+i]);
565+ }
566+
567+ this->numanalyses = in_numanalyses;
568+ this->hnodes = new Hook*[in_numanalyses];
569+ this->hvertices = new Hook(&tria_vertex_ids[0],3);
570+ this->hmaterial = new Hook(&material_id,1);
571+ this->hmatpar = new Hook(&matpar_id,1);
572+
573 //Initialize hnodes as NULL
574 for(int i=0;i<this->numanalyses;i++){
575 this->hnodes[i]=NULL;
576Index: ../trunk-jpl/src/c/classes/objects/Elements/Tria.h
577===================================================================
578--- ../trunk-jpl/src/c/classes/objects/Elements/Tria.h (revision 14760)
579+++ ../trunk-jpl/src/c/classes/objects/Elements/Tria.h (revision 14761)
580@@ -31,7 +31,8 @@
581 int id;
582 int sid;
583
584- Node **nodes; // 3 nodes
585+ Node **nodes; // nodes
586+ Vertex **vertices; // 3 vertices
587 Material *material; // 1 material ice
588 Matpar *matpar; // 1 material parameter
589 int horizontalneighborsids[3];
590@@ -73,7 +74,7 @@
591 void ComputeBasalStress(Vector<IssmDouble>* sigma_b);
592 void ComputeStrainRate(Vector<IssmDouble>* eps);
593 void ComputeStressTensor();
594- void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
595+ void Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters);
596 void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
597 void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum);
598 void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
599Index: ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h
600===================================================================
601--- ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h (revision 14760)
602+++ ../trunk-jpl/src/c/classes/objects/Elements/TriaHook.h (revision 14761)
603@@ -11,10 +11,11 @@
604 class TriaHook{
605
606 public:
607- int numanalyses; //number of analysis types
608- Hook** hnodes; // 3 nodes for each analysis type
609- Hook* hmaterial; // 1 ice material
610- Hook* hmatpar; // 1 material parameter
611+ int numanalyses; //number of analysis types
612+ Hook **hnodes; // nodes for each analysis type
613+ Hook *hvertices; // 3 vertices
614+ Hook *hmaterial; // 1 ice material
615+ Hook *hmatpar; // 1 material parameter
616
617 /*FUNCTION constructors, destructors {{{*/
618 TriaHook();
619Index: ../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp
620===================================================================
621--- ../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp (revision 14760)
622+++ ../trunk-jpl/src/c/classes/objects/Elements/Penta.cpp (revision 14761)
623@@ -26,16 +26,15 @@
624 /*FUNCTION Penta::Penta(){{{*/
625 Penta::Penta(){
626
627- int i;
628-
629- this->nodes=NULL;
630- this->material=NULL;
631- this->matpar=NULL;
632- this->verticalneighbors=NULL;
633- this->inputs=NULL;
634- this->parameters=NULL;
635- this->results=NULL;
636- for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF;
637+ this->nodes = NULL;
638+ this->vertices = NULL;
639+ this->material = NULL;
640+ this->matpar = NULL;
641+ this->verticalneighbors = NULL;
642+ this->inputs = NULL;
643+ this->parameters = NULL;
644+ this->results = NULL;
645+ for(int i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF;
646 }
647 /*}}}*/
648 /*FUNCTION Penta::~Penta(){{{*/
649@@ -83,10 +82,11 @@
650 this->results=new Results();
651
652 /*initialize pointers:*/
653- this->nodes=NULL;
654- this->material=NULL;
655- this->matpar=NULL;
656- this->verticalneighbors=NULL;
657+ this->nodes = NULL;
658+ this->vertices = NULL;
659+ this->material = NULL;
660+ this->matpar = NULL;
661+ this->verticalneighbors = NULL;
662 }
663 /*}}}*/
664 /*FUNCTION Penta::copy {{{*/
665@@ -106,6 +106,7 @@
666 penta->numanalyses=this->numanalyses;
667 penta->hnodes=new Hook*[penta->numanalyses];
668 for(i=0;i<penta->numanalyses;i++)penta->hnodes[i]=(Hook*)this->hnodes[i]->copy();
669+ penta->hvertices=(Hook*)this->hvertices->copy();
670 penta->hmaterial=(Hook*)this->hmaterial->copy();
671 penta->hmatpar=(Hook*)this->hmatpar->copy();
672 penta->hneighbors=(Hook*)this->hneighbors->copy();
673@@ -131,6 +132,7 @@
674 /*recover objects: */
675 penta->nodes=xNew<Node*>(6); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
676 for(i=0;i<6;i++)penta->nodes[i]=this->nodes[i];
677+ penta->vertices=(Vertex**)penta->hvertices->deliverp();
678 penta->material=(Material*)penta->hmaterial->delivers();
679 penta->matpar=(Matpar*)penta->hmatpar->delivers();
680 penta->verticalneighbors=(Penta**)penta->hneighbors->deliverp();
681@@ -372,7 +374,7 @@
682 }
683 /*}}}*/
684 /*FUNCTION Penta::Configure {{{*/
685-void Penta::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
686+void Penta::Configure(Elements* elementsin, Loads* loadsin, Nodes* nodesin,Vertices* verticesin, Materials* materialsin, Parameters* parametersin){
687
688 int analysis_counter;
689
690@@ -385,6 +387,7 @@
691 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
692 * datasets, using internal ids and offsets hidden in hooks: */
693 if (this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin);
694+ this->hvertices->configure(verticesin);
695 this->hmaterial->configure(materialsin);
696 this->hmatpar->configure(materialsin);
697 this->hneighbors->configure(elementsin);
698@@ -392,9 +395,10 @@
699 /*Now, go pick up the objects inside the hooks: */
700 if (this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
701 else this->nodes=NULL;
702- this->material=(Material*)this->hmaterial->delivers();
703- this->matpar=(Matpar*)this->hmatpar->delivers();
704- this->verticalneighbors=(Penta**)this->hneighbors->deliverp();
705+ this->vertices = (Vertex**)this->hvertices->deliverp();
706+ this->material = (Material*)this->hmaterial->delivers();
707+ this->matpar = (Matpar*)this->hmatpar->delivers();
708+ this->verticalneighbors = (Penta**)this->hneighbors->deliverp();
709
710 /*point parameters to real dataset: */
711 this->parameters=parametersin;
712@@ -2848,6 +2852,7 @@
713
714 /*recover nodes, material and matpar: */
715 tria->nodes=(Node**)tria->hnodes[analysis_counter]->deliverp();
716+ tria->vertices=(Vertex**)tria->hvertices->deliverp();
717 tria->matpar=(Matpar*)tria->hmatpar->delivers();
718
719 return tria;
720Index: ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp
721===================================================================
722--- ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp (revision 14760)
723+++ ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp (revision 14761)
724@@ -23,10 +23,11 @@
725 /*FUNCTION PentaHook::PentaHook(){{{*/
726 PentaHook::PentaHook(){
727 numanalyses=UNDEF;
728- this->hnodes=NULL;
729- this->hmaterial=NULL;
730- this->hmatpar=NULL;
731- this->hneighbors=NULL;
732+ this->hnodes = NULL;
733+ this->hvertices = NULL;
734+ this->hmaterial = NULL;
735+ this->hmatpar = NULL;
736+ this->hneighbors = NULL;
737 }
738 /*}}}*/
739 /*FUNCTION PentaHook::~PentaHook(){{{*/
740@@ -38,26 +39,39 @@
741 if (this->hnodes[i]) delete this->hnodes[i];
742 }
743 delete [] this->hnodes;
744+ delete hvertices;
745 delete hmaterial;
746 delete hmatpar;
747 delete hneighbors;
748 }
749 /*}}}*/
750-/*FUNCTION PentaHook::PentaHook(int in_numanalyses,int material_id, int matpar_id){{{*/
751-PentaHook::PentaHook(int in_numanalyses,int material_id, IoModel* iomodel){
752+/*FUNCTION PentaHook::PentaHook(int in_numanalyses,int element_id, int matpar_id){{{*/
753+PentaHook::PentaHook(int in_numanalyses,int element_id, IoModel* iomodel){
754
755 /*intermediary: */
756 int matpar_id;
757+ int material_id;
758+ int penta_vertex_ids[3];
759
760- /*retrieve parameters: */
761+ /*retrieve material_id: */
762 iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
763
764- this->numanalyses=in_numanalyses;
765- this->hnodes=new Hook*[in_numanalyses];
766- this->hmaterial=new Hook(&material_id,1);
767- this->hmatpar=new Hook(&matpar_id,1);
768- this->hneighbors=NULL;
769+ /*retrive material_id*/
770+ material_id = element_id;
771
772+ /*retrieve vertices ids*/
773+ for(int i=0;i<6;i++){
774+ penta_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[6*(element_id-1)+i]);
775+ }
776+
777+
778+ this->numanalyses = in_numanalyses;
779+ this->hnodes = new Hook*[in_numanalyses];
780+ this->hvertices = new Hook(&penta_vertex_ids[0],6);
781+ this->hmaterial = new Hook(&material_id,1);
782+ this->hmatpar = new Hook(&matpar_id,1);
783+ this->hneighbors = NULL;
784+
785 //Initialize hnodes as NULL
786 for(int i=0;i<this->numanalyses;i++){
787 this->hnodes[i]=NULL;
788@@ -98,6 +112,7 @@
789 }
790 // do not spawn hmaterial. material will be taken care of by Penta
791 triahook->hmaterial=NULL;
792+ triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,3);
793 triahook->hmatpar=(Hook*)this->hmatpar->copy();
794 }
795 /*}}}*/
796Index: ../trunk-jpl/src/c/classes/objects/Elements/Penta.h
797===================================================================
798--- ../trunk-jpl/src/c/classes/objects/Elements/Penta.h (revision 14760)
799+++ ../trunk-jpl/src/c/classes/objects/Elements/Penta.h (revision 14761)
800@@ -33,7 +33,8 @@
801 int id;
802 int sid;
803
804- Node **nodes; // 6 nodes
805+ Node **nodes; // set of nodes
806+ Vertex **vertices; // 6 vertices
807 Material *material; // 1 material ice
808 Matpar *matpar; // 1 material parameter
809 Penta **verticalneighbors; // 2 neighbors: first one under, second one above
810@@ -77,7 +78,7 @@
811 void ComputeBasalStress(Vector<IssmDouble>* sigma_b);
812 void ComputeStrainRate(Vector<IssmDouble>* eps);
813 void ComputeStressTensor();
814- void Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
815+ void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
816 void SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
817 void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum);
818 void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
819Index: ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h
820===================================================================
821--- ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h (revision 14760)
822+++ ../trunk-jpl/src/c/classes/objects/Elements/PentaHook.h (revision 14761)
823@@ -13,7 +13,8 @@
824
825 public:
826 int numanalyses; //number of analysis types
827- Hook **hnodes; // 6 nodes for each analysis type
828+ Hook **hnodes; // set of nodes for each analysis type
829+ Hook *hvertices; // 6 vertices for each analysis type
830 Hook *hmaterial; // 1 ice material
831 Hook *hmatpar; // 1 material parameter
832 Hook *hneighbors; // 2 elements, first down, second up
Note: See TracBrowser for help on using the repository browser.