source: issm/oecreview/Archive/23390-24306/ISSM-24096-24097.diff@ 24307

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

NEW: adding Archive/23390-24306

File size: 14.5 KB
RevLine 
[24307]1Index: ../trunk-jpl/src/c/cores/masstransport_core.cpp
2===================================================================
3--- ../trunk-jpl/src/c/cores/masstransport_core.cpp (revision 24096)
4+++ ../trunk-jpl/src/c/cores/masstransport_core.cpp (revision 24097)
5@@ -60,6 +60,7 @@
6 depthaverage_core(femmodel);
7 }
8 femmodel->SetCurrentConfiguration(MasstransportAnalysisEnum);
9+ InputDuplicatex(femmodel,ThicknessEnum,ThicknessOldEnum);
10 if(stabilization==4){
11 solutionsequence_fct(femmodel);
12 }
13Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp
14===================================================================
15--- ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 24096)
16+++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 24097)
17@@ -1807,7 +1807,7 @@
18
19 /*Fetch dof list and allocate solution vector*/
20 GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
21- IssmDouble* values = xNew<IssmDouble>(numnodes);
22+ IssmDouble* values = xNew<IssmDouble>(numnodes);
23
24 /*Use the dof list to index into the solution vector: */
25 for(int i=0;i<numnodes;i++){
26Index: ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
27===================================================================
28--- ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp (revision 24096)
29+++ ../trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp (revision 24097)
30@@ -807,26 +807,15 @@
31 /*Only update if on base*/
32 if(!element->IsOnBase()) return;
33
34- /*Get basal element*/
35- int domaintype; element->FindParam(&domaintype,DomainTypeEnum);
36- Element* basalelement=element;
37- if(domaintype!=Domain2DhorizontalEnum) basalelement = element->SpawnBasalElement();
38-
39- /*Fetch number of nodes and dof for this finite element*/
40- int numnodes = basalelement->GetNumberOfNodes();
41- int numvertices = basalelement->GetNumberOfVertices();
42-
43- /*Keep old thickness for later*/
44- IssmDouble* oldthickness = xNew<IssmDouble>(numvertices);
45- basalelement->GetInputListOnNodes(&oldthickness[0],ThicknessEnum);
46-
47 /*Fetch dof list and allocate solution vector*/
48 int *doflist = NULL;
49 element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum);
50+
51+ int numnodes = element->GetNumberOfNodes();
52 IssmDouble* newthickness = xNew<IssmDouble>(numnodes);
53
54 /*Use the dof list to index into the solution vector: */
55- IssmDouble minthickness = basalelement->FindParam(MasstransportMinThicknessEnum);
56+ IssmDouble minthickness = element->FindParam(MasstransportMinThicknessEnum);
57 for(int i=0;i<numnodes;i++){
58 newthickness[i]=solution[doflist[i]];
59 /*Check solution*/
60@@ -834,15 +823,23 @@
61 if(xIsInf<IssmDouble>(newthickness[i])) _error_("Inf found in solution vector");
62 if(newthickness[i]<minthickness) newthickness[i]=minthickness;
63 }
64-
65 element->AddBasalInput(ThicknessEnum,newthickness,element->GetElementType());
66-
67- /*Free ressources:*/
68+ xDelete<int>(doflist);
69 xDelete<IssmDouble>(newthickness);
70- xDelete<int>(doflist);
71
72+ /*Update bed and surface accordingly*/
73+
74+ /*Get basal element*/
75+ int domaintype; element->FindParam(&domaintype,DomainTypeEnum);
76+ Element* basalelement=element;
77+ if(domaintype!=Domain2DhorizontalEnum) basalelement = element->SpawnBasalElement();
78+
79+ /*Fetch number of nodes and dof for this finite element*/
80+ int numvertices = basalelement->GetNumberOfVertices();
81+
82 /*Now, we need to do some "processing"*/
83 newthickness = xNew<IssmDouble>(numvertices);
84+ IssmDouble* oldthickness = xNew<IssmDouble>(numvertices);
85 IssmDouble* cumdeltathickness = xNew<IssmDouble>(numvertices);
86 IssmDouble* deltathickness = xNew<IssmDouble>(numvertices);
87 IssmDouble* newbase = xNew<IssmDouble>(numvertices);
88@@ -855,6 +852,7 @@
89
90 /*Get previous base, thickness, surfac and current sealevel and bed:*/
91 basalelement->GetInputListOnVertices(&newthickness[0],ThicknessEnum);
92+ basalelement->GetInputListOnVertices(&oldthickness[0],ThicknessOldEnum);
93 basalelement->GetInputListOnVertices(&oldbase[0],BaseEnum);
94 basalelement->GetInputListOnVertices(&oldsurface[0],SurfaceEnum);
95 basalelement->GetInputListOnVertices(&phi[0],MaskGroundediceLevelsetEnum);
96@@ -868,8 +866,8 @@
97
98 /*What is the delta thickness forcing the sea-level rise core: cumulated over time, hence the +=:*/
99 for(int i=0;i<numvertices;i++){
100- cumdeltathickness[i]+=newthickness[i]-oldthickness[i];
101- deltathickness[i]=newthickness[i]-oldthickness[i];
102+ cumdeltathickness[i] += newthickness[i]-oldthickness[i];
103+ deltathickness[i] = newthickness[i]-oldthickness[i];
104 }
105
106 /*Find MasstransportHydrostaticAdjustment to figure out how to update the geometry:*/
107@@ -879,8 +877,7 @@
108 IssmDouble rho_water = basalelement->FindParam(MaterialsRhoSeawaterEnum);
109
110 for(int i=0;i<numvertices;i++) {
111- if (phi[i]>0.){ //this is an ice sheet: just add thickness to base.
112- /*Update! actually, the bed has moved too!:*/
113+ if (phi[i]>0.){ //this is grounded ice: just add thickness to base.
114 if(isgroundingline){
115 newsurface[i] = bed[i]+newthickness[i]; //surface = bed + newthickness
116 newbase[i] = bed[i]; //new base at new bed
117@@ -887,7 +884,7 @@
118 }
119 else{
120 newsurface[i] = oldbase[i]+newthickness[i]; //surface = oldbase + newthickness
121- newbase[i] = oldbase[i]; //same base: do nothing
122+ newbase[i] = oldbase[i]; //same base: do nothing
123 }
124 }
125 else{ //this is an ice shelf: hydrostatic equilibrium*/
126Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
127===================================================================
128--- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h (revision 24096)
129+++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h (revision 24097)
130@@ -776,6 +776,7 @@
131 ThicknessAcrossGradientEnum,
132 ThicknessAlongGradientEnum,
133 ThicknessEnum,
134+ ThicknessOldEnum,
135 ThicknessPositiveEnum,
136 VelEnum,
137 VxAverageEnum,
138Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
139===================================================================
140--- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp (revision 24096)
141+++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp (revision 24097)
142@@ -782,6 +782,7 @@
143 case ThicknessAcrossGradientEnum : return "ThicknessAcrossGradient";
144 case ThicknessAlongGradientEnum : return "ThicknessAlongGradient";
145 case ThicknessEnum : return "Thickness";
146+ case ThicknessOldEnum : return "ThicknessOld";
147 case ThicknessPositiveEnum : return "ThicknessPositive";
148 case VelEnum : return "Vel";
149 case VxAverageEnum : return "VxAverage";
150Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
151===================================================================
152--- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp (revision 24096)
153+++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp (revision 24097)
154@@ -800,6 +800,7 @@
155 else if (strcmp(name,"ThicknessAcrossGradient")==0) return ThicknessAcrossGradientEnum;
156 else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum;
157 else if (strcmp(name,"Thickness")==0) return ThicknessEnum;
158+ else if (strcmp(name,"ThicknessOld")==0) return ThicknessOldEnum;
159 else if (strcmp(name,"ThicknessPositive")==0) return ThicknessPositiveEnum;
160 else if (strcmp(name,"Vel")==0) return VelEnum;
161 else if (strcmp(name,"VxAverage")==0) return VxAverageEnum;
162@@ -873,11 +874,11 @@
163 else if (strcmp(name,"Outputdefinition54")==0) return Outputdefinition54Enum;
164 else if (strcmp(name,"Outputdefinition55")==0) return Outputdefinition55Enum;
165 else if (strcmp(name,"Outputdefinition56")==0) return Outputdefinition56Enum;
166- else if (strcmp(name,"Outputdefinition57")==0) return Outputdefinition57Enum;
167 else stage=8;
168 }
169 if(stage==8){
170- if (strcmp(name,"Outputdefinition58")==0) return Outputdefinition58Enum;
171+ if (strcmp(name,"Outputdefinition57")==0) return Outputdefinition57Enum;
172+ else if (strcmp(name,"Outputdefinition58")==0) return Outputdefinition58Enum;
173 else if (strcmp(name,"Outputdefinition59")==0) return Outputdefinition59Enum;
174 else if (strcmp(name,"Outputdefinition5")==0) return Outputdefinition5Enum;
175 else if (strcmp(name,"Outputdefinition60")==0) return Outputdefinition60Enum;
176@@ -996,11 +997,11 @@
177 else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
178 else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
179 else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum;
180- else if (strcmp(name,"DoubleMatExternalResult")==0) return DoubleMatExternalResultEnum;
181 else stage=9;
182 }
183 if(stage==9){
184- if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum;
185+ if (strcmp(name,"DoubleMatExternalResult")==0) return DoubleMatExternalResultEnum;
186+ else if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum;
187 else if (strcmp(name,"DoubleParam")==0) return DoubleParamEnum;
188 else if (strcmp(name,"DoubleVecParam")==0) return DoubleVecParamEnum;
189 else if (strcmp(name,"Element")==0) return ElementEnum;
190@@ -1119,11 +1120,11 @@
191 else if (strcmp(name,"Materials")==0) return MaterialsEnum;
192 else if (strcmp(name,"Matestar")==0) return MatestarEnum;
193 else if (strcmp(name,"Matice")==0) return MaticeEnum;
194- else if (strcmp(name,"Matlitho")==0) return MatlithoEnum;
195 else stage=10;
196 }
197 if(stage==10){
198- if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum;
199+ if (strcmp(name,"Matlitho")==0) return MatlithoEnum;
200+ else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum;
201 else if (strcmp(name,"MaxAbsVx")==0) return MaxAbsVxEnum;
202 else if (strcmp(name,"MaxAbsVy")==0) return MaxAbsVyEnum;
203 else if (strcmp(name,"MaxAbsVz")==0) return MaxAbsVzEnum;
204@@ -1242,11 +1243,11 @@
205 else if (strcmp(name,"StringArrayParam")==0) return StringArrayParamEnum;
206 else if (strcmp(name,"StringExternalResult")==0) return StringExternalResultEnum;
207 else if (strcmp(name,"StringParam")==0) return StringParamEnum;
208- else if (strcmp(name,"SubelementFriction1")==0) return SubelementFriction1Enum;
209 else stage=11;
210 }
211 if(stage==11){
212- if (strcmp(name,"SubelementFriction2")==0) return SubelementFriction2Enum;
213+ if (strcmp(name,"SubelementFriction1")==0) return SubelementFriction1Enum;
214+ else if (strcmp(name,"SubelementFriction2")==0) return SubelementFriction2Enum;
215 else if (strcmp(name,"SubelementMelt1")==0) return SubelementMelt1Enum;
216 else if (strcmp(name,"SubelementMelt2")==0) return SubelementMelt2Enum;
217 else if (strcmp(name,"SubelementMigration")==0) return SubelementMigrationEnum;
218Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
219===================================================================
220--- ../trunk-jpl/src/c/shared/Enum/Enum.vim (revision 24096)
221+++ ../trunk-jpl/src/c/shared/Enum/Enum.vim (revision 24097)
222@@ -780,6 +780,7 @@
223 syn keyword cConstant ThicknessAcrossGradientEnum
224 syn keyword cConstant ThicknessAlongGradientEnum
225 syn keyword cConstant ThicknessEnum
226+syn keyword cConstant ThicknessOldEnum
227 syn keyword cConstant ThicknessPositiveEnum
228 syn keyword cConstant VelEnum
229 syn keyword cConstant VxAverageEnum
230@@ -1280,6 +1281,7 @@
231 syn keyword cType Cfsurfacelogvel
232 syn keyword cType Cfsurfacesquare
233 syn keyword cType Channel
234+syn keyword cType classes
235 syn keyword cType Constraint
236 syn keyword cType Constraints
237 syn keyword cType Contour
238@@ -1286,8 +1288,8 @@
239 syn keyword cType Contours
240 syn keyword cType ControlInput
241 syn keyword cType Covertree
242+syn keyword cType DatasetInput
243 syn keyword cType DataSetParam
244-syn keyword cType DatasetInput
245 syn keyword cType Definition
246 syn keyword cType DependentObject
247 syn keyword cType DoubleArrayInput
248@@ -1300,8 +1302,8 @@
249 syn keyword cType Element
250 syn keyword cType ElementHook
251 syn keyword cType ElementMatrix
252+syn keyword cType Elements
253 syn keyword cType ElementVector
254-syn keyword cType Elements
255 syn keyword cType ExponentialVariogram
256 syn keyword cType ExternalResult
257 syn keyword cType FemModel
258@@ -1308,11 +1310,12 @@
259 syn keyword cType FileParam
260 syn keyword cType Friction
261 syn keyword cType Gauss
262+syn keyword cType GaussianVariogram
263+syn keyword cType gaussobjects
264 syn keyword cType GaussPenta
265 syn keyword cType GaussSeg
266 syn keyword cType GaussTetra
267 syn keyword cType GaussTria
268-syn keyword cType GaussianVariogram
269 syn keyword cType GenericExternalResult
270 syn keyword cType GenericOption
271 syn keyword cType GenericParam
272@@ -1320,6 +1323,7 @@
273 syn keyword cType Hook
274 syn keyword cType Input
275 syn keyword cType Inputs
276+syn keyword cType IntArrayInput
277 syn keyword cType IntInput
278 syn keyword cType IntMatParam
279 syn keyword cType IntParam
280@@ -1327,6 +1331,7 @@
281 syn keyword cType IoModel
282 syn keyword cType IssmDirectApplicInterface
283 syn keyword cType IssmParallelDirectApplicInterface
284+syn keyword cType krigingobjects
285 syn keyword cType Load
286 syn keyword cType Loads
287 syn keyword cType Masscon
288@@ -1337,6 +1342,7 @@
289 syn keyword cType Matestar
290 syn keyword cType Matice
291 syn keyword cType Matlitho
292+syn keyword cType matrixobjects
293 syn keyword cType MatrixParam
294 syn keyword cType Misfit
295 syn keyword cType Moulin
296@@ -1349,8 +1355,8 @@
297 syn keyword cType Observation
298 syn keyword cType Observations
299 syn keyword cType Option
300+syn keyword cType Options
301 syn keyword cType OptionUtilities
302-syn keyword cType Options
303 syn keyword cType Param
304 syn keyword cType Parameters
305 syn keyword cType Pengrid
306@@ -1363,12 +1369,12 @@
307 syn keyword cType Quadtree
308 syn keyword cType Regionaloutput
309 syn keyword cType Results
310+syn keyword cType Riftfront
311 syn keyword cType RiftStruct
312-syn keyword cType Riftfront
313 syn keyword cType Seg
314 syn keyword cType SegInput
315+syn keyword cType Segment
316 syn keyword cType SegRef
317-syn keyword cType Segment
318 syn keyword cType SpcDynamic
319 syn keyword cType SpcStatic
320 syn keyword cType SpcTransient
321@@ -1388,10 +1394,6 @@
322 syn keyword cType VectorParam
323 syn keyword cType Vertex
324 syn keyword cType Vertices
325-syn keyword cType classes
326-syn keyword cType gaussobjects
327-syn keyword cType krigingobjects
328-syn keyword cType matrixobjects
329 syn keyword cType AdjointBalancethickness2Analysis
330 syn keyword cType AdjointBalancethicknessAnalysis
331 syn keyword cType AdjointHorizAnalysis
332@@ -1410,8 +1412,8 @@
333 syn keyword cType ExtrudeFromTopAnalysis
334 syn keyword cType FreeSurfaceBaseAnalysis
335 syn keyword cType FreeSurfaceTopAnalysis
336+syn keyword cType GiaIvinsAnalysis
337 syn keyword cType GLheightadvectionAnalysis
338-syn keyword cType GiaIvinsAnalysis
339 syn keyword cType HydrologyDCEfficientAnalysis
340 syn keyword cType HydrologyDCInefficientAnalysis
341 syn keyword cType HydrologyGlaDSAnalysis
Note: See TracBrowser for help on using the repository browser.