Changeset 24097
- Timestamp:
- 07/17/19 01:18:19 (6 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
r24091 r24097 808 808 if(!element->IsOnBase()) return; 809 809 810 /*Get basal element*/811 int domaintype; element->FindParam(&domaintype,DomainTypeEnum);812 Element* basalelement=element;813 if(domaintype!=Domain2DhorizontalEnum) basalelement = element->SpawnBasalElement();814 815 /*Fetch number of nodes and dof for this finite element*/816 int numnodes = basalelement->GetNumberOfNodes();817 int numvertices = basalelement->GetNumberOfVertices();818 819 /*Keep old thickness for later*/820 IssmDouble* oldthickness = xNew<IssmDouble>(numvertices);821 basalelement->GetInputListOnNodes(&oldthickness[0],ThicknessEnum);822 823 810 /*Fetch dof list and allocate solution vector*/ 824 811 int *doflist = NULL; 825 812 element->GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum); 813 814 int numnodes = element->GetNumberOfNodes(); 826 815 IssmDouble* newthickness = xNew<IssmDouble>(numnodes); 827 816 828 817 /*Use the dof list to index into the solution vector: */ 829 IssmDouble minthickness = basalelement->FindParam(MasstransportMinThicknessEnum);818 IssmDouble minthickness = element->FindParam(MasstransportMinThicknessEnum); 830 819 for(int i=0;i<numnodes;i++){ 831 820 newthickness[i]=solution[doflist[i]]; … … 835 824 if(newthickness[i]<minthickness) newthickness[i]=minthickness; 836 825 } 837 838 826 element->AddBasalInput(ThicknessEnum,newthickness,element->GetElementType()); 839 840 /*Free ressources:*/ 827 xDelete<int>(doflist); 841 828 xDelete<IssmDouble>(newthickness); 842 xDelete<int>(doflist); 829 830 /*Update bed and surface accordingly*/ 831 832 /*Get basal element*/ 833 int domaintype; element->FindParam(&domaintype,DomainTypeEnum); 834 Element* basalelement=element; 835 if(domaintype!=Domain2DhorizontalEnum) basalelement = element->SpawnBasalElement(); 836 837 /*Fetch number of nodes and dof for this finite element*/ 838 int numvertices = basalelement->GetNumberOfVertices(); 843 839 844 840 /*Now, we need to do some "processing"*/ 845 841 newthickness = xNew<IssmDouble>(numvertices); 842 IssmDouble* oldthickness = xNew<IssmDouble>(numvertices); 846 843 IssmDouble* cumdeltathickness = xNew<IssmDouble>(numvertices); 847 844 IssmDouble* deltathickness = xNew<IssmDouble>(numvertices); … … 856 853 /*Get previous base, thickness, surfac and current sealevel and bed:*/ 857 854 basalelement->GetInputListOnVertices(&newthickness[0],ThicknessEnum); 855 basalelement->GetInputListOnVertices(&oldthickness[0],ThicknessOldEnum); 858 856 basalelement->GetInputListOnVertices(&oldbase[0],BaseEnum); 859 857 basalelement->GetInputListOnVertices(&oldsurface[0],SurfaceEnum); … … 869 867 /*What is the delta thickness forcing the sea-level rise core: cumulated over time, hence the +=:*/ 870 868 for(int i=0;i<numvertices;i++){ 871 cumdeltathickness[i] +=newthickness[i]-oldthickness[i];872 deltathickness[i] =newthickness[i]-oldthickness[i];869 cumdeltathickness[i] += newthickness[i]-oldthickness[i]; 870 deltathickness[i] = newthickness[i]-oldthickness[i]; 873 871 } 874 872 … … 880 878 881 879 for(int i=0;i<numvertices;i++) { 882 if (phi[i]>0.){ //this is an ice sheet: just add thickness to base. 883 /*Update! actually, the bed has moved too!:*/ 880 if (phi[i]>0.){ //this is grounded ice: just add thickness to base. 884 881 if(isgroundingline){ 885 882 newsurface[i] = bed[i]+newthickness[i]; //surface = bed + newthickness … … 888 885 else{ 889 886 newsurface[i] = oldbase[i]+newthickness[i]; //surface = oldbase + newthickness 890 newbase[i] 887 newbase[i] = oldbase[i]; //same base: do nothing 891 888 } 892 889 } -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r24089 r24097 1808 1808 /*Fetch dof list and allocate solution vector*/ 1809 1809 GetDofListLocal(&doflist,NoneApproximationEnum,GsetEnum); 1810 IssmDouble* values 1810 IssmDouble* values = xNew<IssmDouble>(numnodes); 1811 1811 1812 1812 /*Use the dof list to index into the solution vector: */ -
issm/trunk-jpl/src/c/cores/masstransport_core.cpp
r23221 r24097 61 61 } 62 62 femmodel->SetCurrentConfiguration(MasstransportAnalysisEnum); 63 InputDuplicatex(femmodel,ThicknessEnum,ThicknessOldEnum); 63 64 if(stabilization==4){ 64 65 solutionsequence_fct(femmodel); -
issm/trunk-jpl/src/c/shared/Enum/Enum.vim
r24088 r24097 781 781 syn keyword cConstant ThicknessAlongGradientEnum 782 782 syn keyword cConstant ThicknessEnum 783 syn keyword cConstant ThicknessOldEnum 783 784 syn keyword cConstant ThicknessPositiveEnum 784 785 syn keyword cConstant VelEnum … … 1281 1282 syn keyword cType Cfsurfacesquare 1282 1283 syn keyword cType Channel 1284 syn keyword cType classes 1283 1285 syn keyword cType Constraint 1284 1286 syn keyword cType Constraints … … 1287 1289 syn keyword cType ControlInput 1288 1290 syn keyword cType Covertree 1291 syn keyword cType DatasetInput 1289 1292 syn keyword cType DataSetParam 1290 syn keyword cType DatasetInput1291 1293 syn keyword cType Definition 1292 1294 syn keyword cType DependentObject … … 1301 1303 syn keyword cType ElementHook 1302 1304 syn keyword cType ElementMatrix 1305 syn keyword cType Elements 1303 1306 syn keyword cType ElementVector 1304 syn keyword cType Elements1305 1307 syn keyword cType ExponentialVariogram 1306 1308 syn keyword cType ExternalResult … … 1309 1311 syn keyword cType Friction 1310 1312 syn keyword cType Gauss 1313 syn keyword cType GaussianVariogram 1314 syn keyword cType gaussobjects 1311 1315 syn keyword cType GaussPenta 1312 1316 syn keyword cType GaussSeg 1313 1317 syn keyword cType GaussTetra 1314 1318 syn keyword cType GaussTria 1315 syn keyword cType GaussianVariogram1316 1319 syn keyword cType GenericExternalResult 1317 1320 syn keyword cType GenericOption … … 1321 1324 syn keyword cType Input 1322 1325 syn keyword cType Inputs 1326 syn keyword cType IntArrayInput 1323 1327 syn keyword cType IntInput 1324 1328 syn keyword cType IntMatParam … … 1328 1332 syn keyword cType IssmDirectApplicInterface 1329 1333 syn keyword cType IssmParallelDirectApplicInterface 1334 syn keyword cType krigingobjects 1330 1335 syn keyword cType Load 1331 1336 syn keyword cType Loads … … 1338 1343 syn keyword cType Matice 1339 1344 syn keyword cType Matlitho 1345 syn keyword cType matrixobjects 1340 1346 syn keyword cType MatrixParam 1341 1347 syn keyword cType Misfit … … 1350 1356 syn keyword cType Observations 1351 1357 syn keyword cType Option 1358 syn keyword cType Options 1352 1359 syn keyword cType OptionUtilities 1353 syn keyword cType Options1354 1360 syn keyword cType Param 1355 1361 syn keyword cType Parameters … … 1364 1370 syn keyword cType Regionaloutput 1365 1371 syn keyword cType Results 1372 syn keyword cType Riftfront 1366 1373 syn keyword cType RiftStruct 1367 syn keyword cType Riftfront1368 1374 syn keyword cType Seg 1369 1375 syn keyword cType SegInput 1376 syn keyword cType Segment 1370 1377 syn keyword cType SegRef 1371 syn keyword cType Segment1372 1378 syn keyword cType SpcDynamic 1373 1379 syn keyword cType SpcStatic … … 1389 1395 syn keyword cType Vertex 1390 1396 syn keyword cType Vertices 1391 syn keyword cType classes1392 syn keyword cType gaussobjects1393 syn keyword cType krigingobjects1394 syn keyword cType matrixobjects1395 1397 syn keyword cType AdjointBalancethickness2Analysis 1396 1398 syn keyword cType AdjointBalancethicknessAnalysis … … 1411 1413 syn keyword cType FreeSurfaceBaseAnalysis 1412 1414 syn keyword cType FreeSurfaceTopAnalysis 1415 syn keyword cType GiaIvinsAnalysis 1413 1416 syn keyword cType GLheightadvectionAnalysis 1414 syn keyword cType GiaIvinsAnalysis1415 1417 syn keyword cType HydrologyDCEfficientAnalysis 1416 1418 syn keyword cType HydrologyDCInefficientAnalysis -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r24088 r24097 777 777 ThicknessAlongGradientEnum, 778 778 ThicknessEnum, 779 ThicknessOldEnum, 779 780 ThicknessPositiveEnum, 780 781 VelEnum, -
issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
r24088 r24097 783 783 case ThicknessAlongGradientEnum : return "ThicknessAlongGradient"; 784 784 case ThicknessEnum : return "Thickness"; 785 case ThicknessOldEnum : return "ThicknessOld"; 785 786 case ThicknessPositiveEnum : return "ThicknessPositive"; 786 787 case VelEnum : return "Vel"; -
issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
r24088 r24097 801 801 else if (strcmp(name,"ThicknessAlongGradient")==0) return ThicknessAlongGradientEnum; 802 802 else if (strcmp(name,"Thickness")==0) return ThicknessEnum; 803 else if (strcmp(name,"ThicknessOld")==0) return ThicknessOldEnum; 803 804 else if (strcmp(name,"ThicknessPositive")==0) return ThicknessPositiveEnum; 804 805 else if (strcmp(name,"Vel")==0) return VelEnum; … … 874 875 else if (strcmp(name,"Outputdefinition55")==0) return Outputdefinition55Enum; 875 876 else if (strcmp(name,"Outputdefinition56")==0) return Outputdefinition56Enum; 876 else if (strcmp(name,"Outputdefinition57")==0) return Outputdefinition57Enum;877 877 else stage=8; 878 878 } 879 879 if(stage==8){ 880 if (strcmp(name,"Outputdefinition58")==0) return Outputdefinition58Enum; 880 if (strcmp(name,"Outputdefinition57")==0) return Outputdefinition57Enum; 881 else if (strcmp(name,"Outputdefinition58")==0) return Outputdefinition58Enum; 881 882 else if (strcmp(name,"Outputdefinition59")==0) return Outputdefinition59Enum; 882 883 else if (strcmp(name,"Outputdefinition5")==0) return Outputdefinition5Enum; … … 997 998 else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum; 998 999 else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum; 999 else if (strcmp(name,"DoubleMatExternalResult")==0) return DoubleMatExternalResultEnum;1000 1000 else stage=9; 1001 1001 } 1002 1002 if(stage==9){ 1003 if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum; 1003 if (strcmp(name,"DoubleMatExternalResult")==0) return DoubleMatExternalResultEnum; 1004 else if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum; 1004 1005 else if (strcmp(name,"DoubleParam")==0) return DoubleParamEnum; 1005 1006 else if (strcmp(name,"DoubleVecParam")==0) return DoubleVecParamEnum; … … 1120 1121 else if (strcmp(name,"Matestar")==0) return MatestarEnum; 1121 1122 else if (strcmp(name,"Matice")==0) return MaticeEnum; 1122 else if (strcmp(name,"Matlitho")==0) return MatlithoEnum;1123 1123 else stage=10; 1124 1124 } 1125 1125 if(stage==10){ 1126 if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum; 1126 if (strcmp(name,"Matlitho")==0) return MatlithoEnum; 1127 else if (strcmp(name,"MatrixParam")==0) return MatrixParamEnum; 1127 1128 else if (strcmp(name,"MaxAbsVx")==0) return MaxAbsVxEnum; 1128 1129 else if (strcmp(name,"MaxAbsVy")==0) return MaxAbsVyEnum; … … 1243 1244 else if (strcmp(name,"StringExternalResult")==0) return StringExternalResultEnum; 1244 1245 else if (strcmp(name,"StringParam")==0) return StringParamEnum; 1245 else if (strcmp(name,"SubelementFriction1")==0) return SubelementFriction1Enum;1246 1246 else stage=11; 1247 1247 } 1248 1248 if(stage==11){ 1249 if (strcmp(name,"SubelementFriction2")==0) return SubelementFriction2Enum; 1249 if (strcmp(name,"SubelementFriction1")==0) return SubelementFriction1Enum; 1250 else if (strcmp(name,"SubelementFriction2")==0) return SubelementFriction2Enum; 1250 1251 else if (strcmp(name,"SubelementMelt1")==0) return SubelementMelt1Enum; 1251 1252 else if (strcmp(name,"SubelementMelt2")==0) return SubelementMelt2Enum;
Note:
See TracChangeset
for help on using the changeset viewer.