source: issm/oecreview/Archive/15392-16133/ISSM-15791-15792.diff@ 16134

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

Added Archive/15392-16133

File size: 4.0 KB
RevLine 
[16134]1Index: ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp
2===================================================================
3--- ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp (revision 15791)
4+++ ../trunk-jpl/src/c/classes/Elements/PentaRef.cpp (revision 15792)
5@@ -2059,3 +2059,61 @@
6 return -1;
7 }
8 /*}}}*/
9+/*FUNCTION PentaRef::BasalNodeIndices{{{*/
10+void PentaRef::BasalNodeIndices(int* pnumindices,int** pindices,int finiteelement){
11+
12+ /*Output*/
13+ int numindices;
14+ int* indices = NULL;
15+
16+ switch(finiteelement){
17+ case P1Enum: case P1DGEnum:
18+ numindices = 3;
19+ indices = xNew<int>(numindices);
20+ indices[0] = 0;
21+ indices[1] = 1;
22+ indices[2] = 2;
23+ break;
24+ case P1bubbleEnum: case P1bubblecondensedEnum:
25+ numindices = 3;
26+ indices = xNew<int>(numindices);
27+ indices[0] = 0;
28+ indices[1] = 1;
29+ indices[2] = 2;
30+ break;
31+ case P2xP1Enum:
32+ numindices = 6;
33+ indices = xNew<int>(numindices);
34+ indices[0] = 0;
35+ indices[1] = 1;
36+ indices[2] = 2;
37+ indices[3] = 6;
38+ indices[4] = 7;
39+ indices[5] = 8;
40+ break;
41+ case P1xP2Enum:
42+ numindices = 3;
43+ indices = xNew<int>(numindices);
44+ indices[0] = 0;
45+ indices[1] = 1;
46+ indices[2] = 2;
47+ return;
48+ case P2Enum:
49+ numindices = 6;
50+ indices = xNew<int>(numindices);
51+ indices[0] = 0;
52+ indices[1] = 1;
53+ indices[2] = 2;
54+ indices[3] = 9;
55+ indices[4] = 10;
56+ indices[5] = 11;
57+ break;
58+ default:
59+ _error_("Element type "<<EnumToStringx(this->element_type)<<" not supported yet");
60+ }
61+
62+ /*Assign output pointer*/
63+ *pnumindices = numindices;
64+ *pindices = indices;
65+}
66+/*}}}*/
67Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
68===================================================================
69--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 15791)
70+++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 15792)
71@@ -2973,6 +2973,8 @@
72 void Penta::ResetCoordinateSystem(void){
73
74 int approximation;
75+ int numindices;
76+ int *indices = NULL;
77 IssmDouble slopex,slopey;
78 IssmDouble xz_plane[6];
79
80@@ -2981,7 +2983,7 @@
81 if(IsFloating() || !IsOnBed() || (approximation!=FSApproximationEnum && approximation!=SSAFSApproximationEnum && approximation!=HOFSApproximationEnum)) return;
82
83 /*Get number of nodes for velocity only and base*/
84- int vnumnodes = this->NumberofNodesVelocity();
85+ BasalNodeIndices(&numindices,&indices,this->VelocityInterpolation());
86
87 /*Get inputs*/
88 Input* slopex_input=inputs->GetInput(BedSlopeXEnum); _assert_(slopex_input);
89@@ -2989,8 +2991,8 @@
90
91 /*Loop over basal nodes and update their CS*/
92 GaussPenta* gauss = new GaussPenta();
93- for(int i=0;i<3;i++){//FIXME
94- gauss->GaussNode(this->VelocityInterpolation(),i);
95+ for(int i=0;i<numindices;i++){//FIXME
96+ gauss->GaussNode(this->VelocityInterpolation(),indices[i]);
97
98 slopex_input->GetInputValue(&slopex,gauss);
99 slopey_input->GetInputValue(&slopey,gauss);
100@@ -3000,10 +3002,11 @@
101 xz_plane[1]=0.; xz_plane[4]=-slopey;
102 xz_plane[2]=slopex; xz_plane[5]=1.;
103
104- XZvectorsToCoordinateSystem(&this->nodes[i]->coord_system[0][0],&xz_plane[0]);
105+ XZvectorsToCoordinateSystem(&this->nodes[indices[i]]->coord_system[0][0],&xz_plane[0]);
106 }
107
108 /*cleanup*/
109+ xDelete<int>(indices);
110 delete gauss;
111 }
112 /*}}}*/
113Index: ../trunk-jpl/src/c/classes/Elements/PentaRef.h
114===================================================================
115--- ../trunk-jpl/src/c/classes/Elements/PentaRef.h (revision 15791)
116+++ ../trunk-jpl/src/c/classes/Elements/PentaRef.h (revision 15792)
117@@ -68,6 +68,7 @@
118 void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussPenta* gauss);
119 void GetInputDerivativeValue(IssmDouble* pvalues, IssmDouble* plist,IssmDouble* xyz_list, GaussTria* gauss){_error_("only PentaGauss are supported");};
120
121+ int BasalNodeIndices(int* pnumindices,int** pindices,int finiteelement);
122 int NumberofNodes(void);
123 int NumberofNodesVelocity(void);
124 int NumberofNodesPressure(void);
Note: See TracBrowser for help on using the repository browser.