Changeset 26075
- Timestamp:
- 03/11/21 10:27:18 (4 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/HydrologyTwsAnalysis.cpp
r26047 r26075 38 38 39 39 /*Initialize sea level cumulated sea level loads :*/ 40 InputUpdateFromConstantx(inputs,elements,0.,AccumulatedDeltaTwsEnum);41 InputUpdateFromConstantx(inputs,elements,0.,OldAccumulatedDeltaTwsEnum);40 iomodel->ConstantToInput(inputs,elements,0.,AccumulatedDeltaTwsEnum,P1Enum); 41 iomodel->ConstantToInput(inputs,elements,0.,OldAccumulatedDeltaTwsEnum,P1Enum); 42 42 iomodel->FetchDataToInput(inputs,elements,"md.initialization.watercolumn",WatercolumnEnum); 43 43 … … 79 79 if(!element->IsOnBase()) return; 80 80 81 /*deal with logic of accumulating thickness if we are coupled to a82 * sea level core:*/83 int frequency,count,isgrd;84 element->FindParam(&isgrd,SolidearthSettingsGRDEnum);85 if(isgrd){86 element->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);87 element->FindParam(&count,SealevelchangeRunCountEnum);88 }89 81 /*Fetch dof list and allocate solution vector*/ 90 82 int *doflist = NULL; … … 106 98 xDelete<IssmDouble>(watercolumn); 107 99 108 /*Get basal element*/109 int domaintype; element->FindParam(&domaintype,DomainTypeEnum);110 Element* basalelement=element;111 if(domaintype!=Domain2DhorizontalEnum) basalelement = element->SpawnBasalElement();112 113 /*Fetch number of nodes and dof for this finite element*/114 int numvertices = basalelement->GetNumberOfVertices();115 116 /*Now, we need to do some "processing"*/117 watercolumn = xNew<IssmDouble>(numvertices);118 IssmDouble* oldwatercolumn = xNew<IssmDouble>(numvertices);119 IssmDouble* cumdeltawatercolumn = xNew<IssmDouble>(numvertices);120 IssmDouble* oldcumdeltawatercolumn = xNew<IssmDouble>(numvertices);121 IssmDouble* deltawatercolumn = xNew<IssmDouble>(numvertices);122 123 /*Get previous base, tws, surfac and current sealevel and bed:*/124 basalelement->GetInputListOnVertices(&watercolumn[0],WatercolumnEnum);125 basalelement->GetInputListOnVertices(&oldwatercolumn[0],WaterColumnOldEnum);126 basalelement->GetInputListOnVertices(&cumdeltawatercolumn[0],AccumulatedDeltaTwsEnum);127 128 /*What is the delta tws forcing the sea-level change core: cumulated over time, hence the +=:*/129 if(isgrd){130 for(int i=0;i<numvertices;i++){131 cumdeltawatercolumn[i] += watercolumn[i]-oldwatercolumn[i];132 }133 }134 135 /*Add input to the element: */136 if(isgrd){137 element->AddBasalInput(AccumulatedDeltaTwsEnum,cumdeltawatercolumn,P1Enum);138 if(count==frequency){139 basalelement->GetInputListOnVertices(&oldcumdeltawatercolumn[0],OldAccumulatedDeltaTwsEnum);140 element->AddBasalInput(OldAccumulatedDeltaTwsEnum,cumdeltawatercolumn,P1Enum);141 for(int i=0;i<numvertices;i++)deltawatercolumn[i]=cumdeltawatercolumn[i]-oldcumdeltawatercolumn[i];142 element->AddBasalInput(DeltaTwsEnum,deltawatercolumn,P1Enum);143 }144 }145 146 /*Free ressources:*/147 xDelete<IssmDouble>(watercolumn);148 xDelete<IssmDouble>(deltawatercolumn);149 xDelete<IssmDouble>(cumdeltawatercolumn);150 xDelete<IssmDouble>(oldcumdeltawatercolumn);151 xDelete<IssmDouble>(oldwatercolumn);152 xDelete<int>(doflist);153 if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};154 100 }/*}}}*/ 155 101 void HydrologyTwsAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/ -
issm/trunk-jpl/src/c/cores/hydrology_core.cpp
r26047 r26075 9 9 #include "../modules/modules.h" 10 10 #include "../solutionsequences/solutionsequences.h" 11 12 void hydrology_core(FemModel* femmodel){ 11 void SolidEarthWaterUpdates(FemModel* femmodel); 12 13 void hydrology_core(FemModel* femmodel){ /*{{{*/ 13 14 14 15 /*Start profiler*/ … … 43 44 /*transfer water column thickness to old water column thickness: */ 44 45 InputDuplicatex(femmodel,WatercolumnEnum,WaterColumnOldEnum); 46 /*solid earth considerations:*/ 47 SolidEarthWaterUpdates(femmodel); 48 45 49 46 50 } … … 59 63 GetVectorFromInputsx(&ug,femmodel,HydrologyTwsSpcEnum,VertexPIdEnum); 60 64 InputUpdateFromSolutionx(femmodel,ug); 65 66 /*solid earth considerations:*/ 67 SolidEarthWaterUpdates(femmodel); 68 61 69 delete ug; 62 70 … … 219 227 /*End profiler*/ 220 228 femmodel->profiler->Stop(HYDROLOGYCORE); 221 } 229 } /*}}}*/ 230 void SolidEarthWaterUpdates(FemModel* femmodel){ /*{{{*/ 231 232 int isgrd; 233 int grdmodel; 234 IssmDouble time; 235 int frequency,count; 236 237 /*retrieve parameters:*/ 238 femmodel->parameters->FindParam(&isgrd,SolidearthSettingsGRDEnum); 239 femmodel->parameters->FindParam(&grdmodel,GrdModelEnum); 240 femmodel->parameters->FindParam(&time,TimeEnum); 241 femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum); 242 femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum); 243 244 /*early return?:*/ 245 if(!isgrd)return; 246 247 /*From old and new thickness, create delta thickness and accumulate:*/ 248 femmodel->inputs->AXPY(-1, WaterColumnOldEnum,WatercolumnEnum,DeltaTwsEnum); 249 femmodel->inputs->AXPY(+1, DeltaTwsEnum,AccumulatedDeltaTwsEnum,DummyEnum); 250 femmodel->inputs->DuplicateInput(DummyEnum,AccumulatedDeltaTwsEnum); 251 252 /*compute total water column change between two sea-level solver time steps, ie. every frequency*dt:*/ 253 if(count==frequency){ 254 femmodel->inputs->AXPY(-1, OldAccumulatedDeltaTwsEnum,AccumulatedDeltaTwsEnum,DeltaTwsEnum); 255 femmodel->inputs->DuplicateInput(AccumulatedDeltaTwsEnum,OldAccumulatedDeltaTwsEnum); 256 } 257 return; 258 }/*}}}*/ -
issm/trunk-jpl/src/c/cores/masstransport_core.cpp
r26073 r26075 10 10 #include "../solutionsequences/solutionsequences.h" 11 11 #include "../classes/Inputs/TransientInput.h" 12 void SolidEarthUpdates(FemModel* femmodel); 13 12 void SolidEarthIceUpdates(FemModel* femmodel); 14 13 void masstransport_core(FemModel* femmodel){ /*{{{*/ 15 14 … … 77 76 //} 78 77 } 79 SolidEarth Updates(femmodel);78 SolidEarthIceUpdates(femmodel); 80 79 81 80 femmodel->parameters->SetParam(ThicknessEnum,InputToExtrudeEnum); … … 100 99 femmodel->profiler->Stop(MASSTRANSPORTCORE); 101 100 } /*}}}*/ 102 void SolidEarth Updates(FemModel* femmodel){ /*{{{*/101 void SolidEarthIceUpdates(FemModel* femmodel){ /*{{{*/ 103 102 104 103 int isgrd; -
issm/trunk-jpl/test/NightlyRun/test2001.m
r26073 r26075 50 50 51 51 %Fields and tolerances to track changes 52 field_names ={'UGia','UGiaRate'}; 53 field_tolerances={1e-13,1e-13}; 54 field_values={... 55 (md.results.TransientSolution(2).SealevelUGrd), 56 (md.results.TransientSolution(2).SealevelUGrd) 57 }; 52 field_names ={'UGrd'}; 53 field_tolerances={1e-13}; 54 field_values={md.results.TransientSolution(2).SealevelUGrd};
Note:
See TracChangeset
for help on using the changeset viewer.