[11991] | 1 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/thermal_core.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/thermal_core.cpp (revision 11809)
|
---|
| 4 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/thermal_core.cpp (revision 11810)
|
---|
| 5 | @@ -19,14 +19,15 @@
|
---|
| 6 | /*intermediary*/
|
---|
| 7 | double time;
|
---|
| 8 | int nsteps;
|
---|
| 9 | - double final_time;
|
---|
| 10 | + double starttime,final_time;
|
---|
| 11 | double dt;
|
---|
| 12 | double melting_offset;
|
---|
| 13 | - bool control_analysis;
|
---|
| 14 | - int solution_type;
|
---|
| 15 | - bool dakota_analysis = false;
|
---|
| 16 | + bool control_analysis;
|
---|
| 17 | + int solution_type;
|
---|
| 18 | + bool dakota_analysis = false;
|
---|
| 19 |
|
---|
| 20 | //first recover parameters common to all solutions
|
---|
| 21 | + femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
|
---|
| 22 | femmodel->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
|
---|
| 23 | femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 24 | femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
|
---|
| 25 | @@ -38,18 +39,20 @@
|
---|
| 26 | dt=0;
|
---|
| 27 | nsteps=1;
|
---|
| 28 | }
|
---|
| 29 | - else nsteps=(int)(final_time/dt);
|
---|
| 30 | + else nsteps=(int)((final_time-starttime)/dt);
|
---|
| 31 | + time=starttime;
|
---|
| 32 |
|
---|
| 33 | if(dakota_analysis){
|
---|
| 34 | femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);
|
---|
| 35 | ResetConstraintsx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
|
---|
| 36 | }
|
---|
| 37 | + printf("start = %g final = %g n=%i\n",starttime,final_time,nsteps);
|
---|
| 38 |
|
---|
| 39 | /*Loop through time: */
|
---|
| 40 | for(i=0;i<nsteps;i++){
|
---|
| 41 |
|
---|
| 42 | if(nsteps)_printf_(VerboseSolution(),"time step: %i/%i\n",i+1,nsteps);
|
---|
| 43 | - time=(i+1)*dt;
|
---|
| 44 | + time+=dt;
|
---|
| 45 | femmodel->parameters->SetParam(time,TimeEnum);
|
---|
| 46 |
|
---|
| 47 | /*call thermal_core_step: */
|
---|
| 48 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/transient_core.cpp
|
---|
| 49 | ===================================================================
|
---|
| 50 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/transient_core.cpp (revision 11809)
|
---|
| 51 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/transient_core.cpp (revision 11810)
|
---|
| 52 | @@ -22,7 +22,7 @@
|
---|
| 53 | void transient_core(FemModel* femmodel){
|
---|
| 54 |
|
---|
| 55 | /*parameters: */
|
---|
| 56 | - double finaltime,dt,yts;
|
---|
| 57 | + double starttime,finaltime,dt,yts;
|
---|
| 58 | bool control_analysis,isdiagnostic,isprognostic,isthermal,isgroundingline,isenthalpy;
|
---|
| 59 | bool dakota_analysis=false;
|
---|
| 60 | bool time_adapt=false;
|
---|
| 61 | @@ -38,6 +38,7 @@
|
---|
| 62 |
|
---|
| 63 | //first recover parameters common to all solutions
|
---|
| 64 | femmodel->parameters->FindParam(&dim,MeshDimensionEnum);
|
---|
| 65 | + femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
|
---|
| 66 | femmodel->parameters->FindParam(&finaltime,TimesteppingFinalTimeEnum);
|
---|
| 67 | femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 68 | femmodel->parameters->FindParam(&yts,ConstantsYtsEnum);
|
---|
| 69 | @@ -57,7 +58,7 @@
|
---|
| 70 |
|
---|
| 71 | /*initialize: */
|
---|
| 72 | step=0;
|
---|
| 73 | - time=0;
|
---|
| 74 | + time=starttime;
|
---|
| 75 |
|
---|
| 76 | /*for qmu analysis, reinitialize velocity so that fake sensitivities do not show up as a result of a different restart of the convergence at each trial.*/
|
---|
| 77 | if(dakota_analysis){
|
---|
| 78 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/hydrology_core.cpp
|
---|
| 79 | ===================================================================
|
---|
| 80 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/hydrology_core.cpp (revision 11809)
|
---|
| 81 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/hydrology_core.cpp (revision 11810)
|
---|
| 82 | @@ -18,13 +18,14 @@
|
---|
| 83 | /*intermediary*/
|
---|
| 84 | double time;
|
---|
| 85 | int nsteps;
|
---|
| 86 | - double final_time;
|
---|
| 87 | + double starttime,final_time;
|
---|
| 88 | double dt;
|
---|
| 89 | - bool control_analysis;
|
---|
| 90 | - int solution_type;
|
---|
| 91 | - int output_frequency;
|
---|
| 92 | + bool control_analysis;
|
---|
| 93 | + int solution_type;
|
---|
| 94 | + int output_frequency;
|
---|
| 95 |
|
---|
| 96 | //first recover parameters common to all solutions
|
---|
| 97 | + femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
|
---|
| 98 | femmodel->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
|
---|
| 99 | femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 100 | femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
|
---|
| 101 | @@ -39,13 +40,14 @@
|
---|
| 102 | dt=0;
|
---|
| 103 | nsteps=1;
|
---|
| 104 | }
|
---|
| 105 | - else nsteps=(int)(final_time/dt);
|
---|
| 106 | + else nsteps=(int)((final_time-starttime)/dt);
|
---|
| 107 | + time=starttime;
|
---|
| 108 |
|
---|
| 109 | /*Loop through time: */
|
---|
| 110 | for(i=0;i<nsteps;i++){
|
---|
| 111 |
|
---|
| 112 | if(nsteps)_printf_(VerboseSolution(),"time step:%i/%i\n",i+1,nsteps);
|
---|
| 113 | - time=(i+1)*dt;
|
---|
| 114 | + time+=dt;
|
---|
| 115 | femmodel->parameters->SetParam(time,TimeEnum);
|
---|
| 116 |
|
---|
| 117 | /*call hydrology_core step: */
|
---|
| 118 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/enthalpy_core.cpp
|
---|
| 119 | ===================================================================
|
---|
| 120 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/enthalpy_core.cpp (revision 11809)
|
---|
| 121 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/solutions/enthalpy_core.cpp (revision 11810)
|
---|
| 122 | @@ -19,13 +19,14 @@
|
---|
| 123 | /*intermediary*/
|
---|
| 124 | double time;
|
---|
| 125 | int nsteps;
|
---|
| 126 | - double final_time;
|
---|
| 127 | + double starttime,final_time;
|
---|
| 128 | double dt;
|
---|
| 129 | double melting_offset;
|
---|
| 130 | - bool control_analysis;
|
---|
| 131 | - int solution_type;
|
---|
| 132 | + bool control_analysis;
|
---|
| 133 | + int solution_type;
|
---|
| 134 |
|
---|
| 135 | //first recover parameters common to all solutions
|
---|
| 136 | + femmodel->parameters->FindParam(&starttime,TimesteppingStartTimeEnum);
|
---|
| 137 | femmodel->parameters->FindParam(&final_time,TimesteppingFinalTimeEnum);
|
---|
| 138 | femmodel->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
|
---|
| 139 | femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
|
---|
| 140 | @@ -36,13 +37,14 @@
|
---|
| 141 | dt=0;
|
---|
| 142 | nsteps=1;
|
---|
| 143 | }
|
---|
| 144 | - else nsteps=(int)(final_time/dt);
|
---|
| 145 | + else nsteps=(int)((final_time-starttime)/dt);
|
---|
| 146 | + time=starttime;
|
---|
| 147 |
|
---|
| 148 | /*Loop through time: */
|
---|
| 149 | for(i=0;i<nsteps;i++){
|
---|
| 150 |
|
---|
| 151 | if(nsteps)_printf_(VerboseSolution(),"time step: %i/%i\n",i+1,nsteps);
|
---|
| 152 | - time=(i+1)*dt;
|
---|
| 153 | + time+=dt;
|
---|
| 154 |
|
---|
| 155 | /*call enthalpy_core_step: */
|
---|
| 156 | enthalpy_core_step(femmodel,i,time);
|
---|
| 157 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h
|
---|
| 158 | ===================================================================
|
---|
| 159 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h (revision 11809)
|
---|
| 160 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/EnumDefinitions/EnumDefinitions.h (revision 11810)
|
---|
| 161 | @@ -162,8 +162,9 @@
|
---|
| 162 | ThermalStabilizationEnum,
|
---|
| 163 | ThermalIsenthalpyEnum,
|
---|
| 164 | ThicknessEnum,
|
---|
| 165 | + TimesteppingStartTimeEnum,
|
---|
| 166 | + TimesteppingFinalTimeEnum,
|
---|
| 167 | TimesteppingCflCoefficientEnum,
|
---|
| 168 | - TimesteppingFinalTimeEnum,
|
---|
| 169 | TimesteppingTimeAdaptEnum,
|
---|
| 170 | TimesteppingTimeStepEnum,
|
---|
| 171 | TransientIsdiagnosticEnum,
|
---|
| 172 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp
|
---|
| 173 | ===================================================================
|
---|
| 174 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp (revision 11809)
|
---|
| 175 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/shared/Numerics/UnitConversion.cpp (revision 11810)
|
---|
| 176 | @@ -46,30 +46,28 @@
|
---|
| 177 |
|
---|
| 178 | double scale;
|
---|
| 179 | switch(type_enum){
|
---|
| 180 | - case TimesteppingTimeStepEnum: scale=1.0/yts;break; //yr
|
---|
| 181 | - case TimesteppingFinalTimeEnum: scale=1.0/yts;break; //yr
|
---|
| 182 | - case TimeEnum: scale=1.0/yts;break; //yr
|
---|
| 183 | - case HydrologyWaterVxEnum: scale=yts;break; //m/yr
|
---|
| 184 | - case HydrologyWaterVyEnum: scale=yts;break; //m/yr
|
---|
| 185 | - case VxEnum: scale=yts;break; //m/yr
|
---|
| 186 | - case InversionVxObsEnum: scale=yts;break; //m/yr
|
---|
| 187 | - case VyEnum: scale=yts;break; //m/yr
|
---|
| 188 | - case InversionVyObsEnum: scale=yts;break; //m/yr
|
---|
| 189 | - case VzEnum: scale=yts;break; //m/yr
|
---|
| 190 | - case InversionVzObsEnum: scale=yts;break; //m/yr
|
---|
| 191 | - case VelEnum: scale=yts;break; //m/yr
|
---|
| 192 | - case InversionVelObsEnum: scale=yts;break; //m/yr
|
---|
| 193 | - case BalancethicknessThickeningRateEnum: scale=yts;break; //m/yr
|
---|
| 194 | - case BasalforcingsMeltingRateEnum: scale=yts;break; //m/yr
|
---|
| 195 | + case TimesteppingStartTimeEnum: scale=1.0/yts;break; //yr
|
---|
| 196 | + case TimesteppingFinalTimeEnum: scale=1.0/yts;break; //yr
|
---|
| 197 | + case TimesteppingTimeStepEnum: scale=1.0/yts;break; //yr
|
---|
| 198 | + case TimeEnum: scale=1.0/yts;break; //yr
|
---|
| 199 | + case HydrologyWaterVxEnum: scale=yts;break; //m/yr
|
---|
| 200 | + case HydrologyWaterVyEnum: scale=yts;break; //m/yr
|
---|
| 201 | + case VxEnum: scale=yts;break; //m/yr
|
---|
| 202 | + case InversionVxObsEnum: scale=yts;break; //m/yr
|
---|
| 203 | + case VyEnum: scale=yts;break; //m/yr
|
---|
| 204 | + case InversionVyObsEnum: scale=yts;break; //m/yr
|
---|
| 205 | + case VzEnum: scale=yts;break; //m/yr
|
---|
| 206 | + case InversionVzObsEnum: scale=yts;break; //m/yr
|
---|
| 207 | + case VelEnum: scale=yts;break; //m/yr
|
---|
| 208 | + case InversionVelObsEnum: scale=yts;break; //m/yr
|
---|
| 209 | + case BalancethicknessThickeningRateEnum: scale=yts;break; //m/yr
|
---|
| 210 | + case BasalforcingsMeltingRateEnum: scale=yts;break; //m/yr
|
---|
| 211 | case BasalforcingsMeltingRateCorrectionEnum: scale=yts;break; //m/yr
|
---|
| 212 | - case SurfaceforcingsPrecipitationEnum: scale=yts;break; //m/yr
|
---|
| 213 | - case SurfaceforcingsMassBalanceEnum: scale=yts;break; //m/yr
|
---|
| 214 | - case MisfitEnum: scale=pow(yts,2);break; //(m/yr)^2
|
---|
| 215 | - case MassFluxEnum: scale=pow((double)10,-12)*yts;break; // (GigaTon/year)
|
---|
| 216 | + case SurfaceforcingsPrecipitationEnum: scale=yts;break; //m/yr
|
---|
| 217 | + case SurfaceforcingsMassBalanceEnum: scale=yts;break; //m/yr
|
---|
| 218 | + case MisfitEnum: scale=pow(yts,2);break; //(m/yr)^2
|
---|
| 219 | + case MassFluxEnum: scale=pow((double)10,-12)*yts;break; // (GigaTon/year)
|
---|
| 220 | default: scale=1.0; break;
|
---|
| 221 | }
|
---|
| 222 | return scale;
|
---|
| 223 | }
|
---|
| 224 | -
|
---|
| 225 | -
|
---|
| 226 | -
|
---|
| 227 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp
|
---|
| 228 | ===================================================================
|
---|
| 229 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp (revision 11809)
|
---|
| 230 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/StringToEnumx/StringToEnumx.cpp (revision 11810)
|
---|
| 231 | @@ -170,8 +170,9 @@
|
---|
| 232 | else if (strcmp(name,"ThermalStabilization")==0) return ThermalStabilizationEnum;
|
---|
| 233 | else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
|
---|
| 234 | else if (strcmp(name,"Thickness")==0) return ThicknessEnum;
|
---|
| 235 | + else if (strcmp(name,"TimesteppingStartTime")==0) return TimesteppingStartTimeEnum;
|
---|
| 236 | + else if (strcmp(name,"TimesteppingFinalTime")==0) return TimesteppingFinalTimeEnum;
|
---|
| 237 | else if (strcmp(name,"TimesteppingCflCoefficient")==0) return TimesteppingCflCoefficientEnum;
|
---|
| 238 | - else if (strcmp(name,"TimesteppingFinalTime")==0) return TimesteppingFinalTimeEnum;
|
---|
| 239 | else if (strcmp(name,"TimesteppingTimeAdapt")==0) return TimesteppingTimeAdaptEnum;
|
---|
| 240 | else if (strcmp(name,"TimesteppingTimeStep")==0) return TimesteppingTimeStepEnum;
|
---|
| 241 | else if (strcmp(name,"TransientIsdiagnostic")==0) return TransientIsdiagnosticEnum;
|
---|
| 242 | @@ -258,11 +259,11 @@
|
---|
| 243 | else if (strcmp(name,"Node")==0) return NodeEnum;
|
---|
| 244 | else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum;
|
---|
| 245 | else if (strcmp(name,"Param")==0) return ParamEnum;
|
---|
| 246 | - else if (strcmp(name,"PattynIceFront")==0) return PattynIceFrontEnum;
|
---|
| 247 | else stage=3;
|
---|
| 248 | }
|
---|
| 249 | if(stage==3){
|
---|
| 250 | - if (strcmp(name,"Pengrid")==0) return PengridEnum;
|
---|
| 251 | + if (strcmp(name,"PattynIceFront")==0) return PattynIceFrontEnum;
|
---|
| 252 | + else if (strcmp(name,"Pengrid")==0) return PengridEnum;
|
---|
| 253 | else if (strcmp(name,"Penpair")==0) return PenpairEnum;
|
---|
| 254 | else if (strcmp(name,"Penta")==0) return PentaEnum;
|
---|
| 255 | else if (strcmp(name,"PentaP1Input")==0) return PentaP1InputEnum;
|
---|
| 256 | @@ -381,11 +382,11 @@
|
---|
| 257 | else if (strcmp(name,"DoubleElementResult")==0) return DoubleElementResultEnum;
|
---|
| 258 | else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
|
---|
| 259 | else if (strcmp(name,"DoubleMatExternalResult")==0) return DoubleMatExternalResultEnum;
|
---|
| 260 | - else if (strcmp(name,"DoubleVecExternalResult")==0) return DoubleVecExternalResultEnum;
|
---|
| 261 | else stage=4;
|
---|
| 262 | }
|
---|
| 263 | if(stage==4){
|
---|
| 264 | - if (strcmp(name,"IntExternalResult")==0) return IntExternalResultEnum;
|
---|
| 265 | + if (strcmp(name,"DoubleVecExternalResult")==0) return DoubleVecExternalResultEnum;
|
---|
| 266 | + else if (strcmp(name,"IntExternalResult")==0) return IntExternalResultEnum;
|
---|
| 267 | else if (strcmp(name,"J")==0) return JEnum;
|
---|
| 268 | else if (strcmp(name,"Patch")==0) return PatchEnum;
|
---|
| 269 | else if (strcmp(name,"PatchNodes")==0) return PatchNodesEnum;
|
---|
| 270 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp
|
---|
| 271 | ===================================================================
|
---|
| 272 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp (revision 11809)
|
---|
| 273 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/EnumToStringx/EnumToStringx.cpp (revision 11810)
|
---|
| 274 | @@ -166,8 +166,9 @@
|
---|
| 275 | case ThermalStabilizationEnum : return "ThermalStabilization";
|
---|
| 276 | case ThermalIsenthalpyEnum : return "ThermalIsenthalpy";
|
---|
| 277 | case ThicknessEnum : return "Thickness";
|
---|
| 278 | + case TimesteppingStartTimeEnum : return "TimesteppingStartTime";
|
---|
| 279 | + case TimesteppingFinalTimeEnum : return "TimesteppingFinalTime";
|
---|
| 280 | case TimesteppingCflCoefficientEnum : return "TimesteppingCflCoefficient";
|
---|
| 281 | - case TimesteppingFinalTimeEnum : return "TimesteppingFinalTime";
|
---|
| 282 | case TimesteppingTimeAdaptEnum : return "TimesteppingTimeAdapt";
|
---|
| 283 | case TimesteppingTimeStepEnum : return "TimesteppingTimeStep";
|
---|
| 284 | case TransientIsdiagnosticEnum : return "TransientIsdiagnostic";
|
---|
| 285 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
|
---|
| 286 | ===================================================================
|
---|
| 287 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp (revision 11809)
|
---|
| 288 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp (revision 11810)
|
---|
| 289 | @@ -44,9 +44,10 @@
|
---|
| 290 | parameters->AddObject(iomodel->CopyConstantObject(SteadystateReltolEnum));
|
---|
| 291 | parameters->AddObject(iomodel->CopyConstantObject(SteadystateMaxiterEnum));
|
---|
| 292 | parameters->AddObject(iomodel->CopyConstantObject(ConstantsYtsEnum));
|
---|
| 293 | - parameters->AddObject(iomodel->CopyConstantObject(TimesteppingTimeStepEnum));
|
---|
| 294 | + parameters->AddObject(iomodel->CopyConstantObject(TimesteppingStartTimeEnum));
|
---|
| 295 | parameters->AddObject(iomodel->CopyConstantObject(TimesteppingFinalTimeEnum));
|
---|
| 296 | parameters->AddObject(iomodel->CopyConstantObject(TimesteppingTimeAdaptEnum));
|
---|
| 297 | + parameters->AddObject(iomodel->CopyConstantObject(TimesteppingTimeStepEnum));
|
---|
| 298 | parameters->AddObject(iomodel->CopyConstantObject(TimesteppingCflCoefficientEnum));
|
---|
| 299 | parameters->AddObject(iomodel->CopyConstantObject(PrognosticHydrostaticAdjustmentEnum));
|
---|
| 300 | parameters->AddObject(iomodel->CopyConstantObject(PrognosticStabilizationEnum));
|
---|
| 301 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/solutions/transient_core.m
|
---|
| 302 | ===================================================================
|
---|
| 303 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/solutions/transient_core.m (revision 11809)
|
---|
| 304 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/solutions/transient_core.m (revision 11810)
|
---|
| 305 | @@ -6,7 +6,8 @@
|
---|
| 306 |
|
---|
| 307 | %recover parameters common to all solutions
|
---|
| 308 | dim=femmodel.parameters.MeshDimension;
|
---|
| 309 | - ndt=femmodel.parameters.TimesteppingFinalTime;
|
---|
| 310 | + starttime=femmodel.parameters.TimesteppingStartTime;
|
---|
| 311 | + finaltime=femmodel.parameters.TimesteppingFinalTime;
|
---|
| 312 | dt=femmodel.parameters.TimesteppingTimeStep;
|
---|
| 313 | yts=femmodel.parameters.ConstantsYts;
|
---|
| 314 | control_analysis=femmodel.parameters.InversionIscontrol;
|
---|
| 315 | @@ -22,7 +23,7 @@
|
---|
| 316 | groundinglinemigration=femmodel.parameters.GroundinglineMigration;
|
---|
| 317 |
|
---|
| 318 | %Initialize
|
---|
| 319 | - time=0;
|
---|
| 320 | + time=starttime;
|
---|
| 321 | step=0;
|
---|
| 322 |
|
---|
| 323 | %for qmu analysis, be sure the velocity input we are starting from is the one in the parameters:
|
---|
| 324 | @@ -41,19 +42,19 @@
|
---|
| 325 | end
|
---|
| 326 |
|
---|
| 327 | %Loop through time
|
---|
| 328 | - while (time < ndt - (yts*eps)),
|
---|
| 329 | + while (time < finaltime+eps),
|
---|
| 330 |
|
---|
| 331 | %Increment
|
---|
| 332 | if(time_adapt),
|
---|
| 333 | dt=TimeAdapt(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters);
|
---|
| 334 | - if(time+dt>ndt), dt=ndt-time; end
|
---|
| 335 | + if(time+dt>finaltime), dt=finaltime-time; end
|
---|
| 336 | femmodel.parameters.TimesteppingTimeStep=dt;
|
---|
| 337 | end
|
---|
| 338 | step=step+1;
|
---|
| 339 | time=time+dt;
|
---|
| 340 | femmodel.parameters.Time=time;
|
---|
| 341 |
|
---|
| 342 | - issmprintf(VerboseSolution,'\n%s%g%s%i%s%g\n','time [yr] ',time/yts,' iteration number: ',step,'/',floor(ndt/dt));
|
---|
| 343 | + issmprintf(VerboseSolution,'\n%s%g%s%i%s%g\n','time [yr] ',time/yts,' iteration number: ',step,'/',floor((finaltime-starttime)/dt));
|
---|
| 344 |
|
---|
| 345 | if (isthermal & dim==3)
|
---|
| 346 | issmprintf(VerboseSolution,'\n%s',[' computing temperature']);
|
---|
| 347 | @@ -83,7 +84,7 @@
|
---|
| 348 | GroundinglineMigration(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters);
|
---|
| 349 | end
|
---|
| 350 |
|
---|
| 351 | - if (solution_type==TransientSolutionEnum & ~control_analysis & (mod(step,output_frequency)==0 | time==ndt)),
|
---|
| 352 | + if (solution_type==TransientSolutionEnum & ~control_analysis & (mod(step,output_frequency)==0 | time==finaltime)),
|
---|
| 353 | issmprintf(VerboseSolution,'\n%s',[' saving results']);
|
---|
| 354 | femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,VxEnum,step,time);
|
---|
| 355 | femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,VyEnum,step,time);
|
---|
| 356 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/enum/TimesteppingStartTimeEnum.m
|
---|
| 357 | ===================================================================
|
---|
| 358 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/enum/TimesteppingStartTimeEnum.m (revision 0)
|
---|
| 359 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/enum/TimesteppingStartTimeEnum.m (revision 11810)
|
---|
| 360 | @@ -0,0 +1,11 @@
|
---|
| 361 | +function macro=TimesteppingStartTimeEnum()
|
---|
| 362 | +%TIMESTEPPINGSTARTTIMEENUM - Enum of TimesteppingStartTime
|
---|
| 363 | +%
|
---|
| 364 | +% WARNING: DO NOT MODIFY THIS FILE
|
---|
| 365 | +% this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
|
---|
| 366 | +% Please read src/c/EnumDefinitions/README for more information
|
---|
| 367 | +%
|
---|
| 368 | +% Usage:
|
---|
| 369 | +% macro=TimesteppingStartTimeEnum()
|
---|
| 370 | +
|
---|
| 371 | +macro=StringToEnum('TimesteppingStartTime');
|
---|
| 372 | Index: /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/classes/timestepping.m
|
---|
| 373 | ===================================================================
|
---|
| 374 | --- /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/classes/timestepping.m (revision 11809)
|
---|
| 375 | +++ /proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/classes/timestepping.m (revision 11810)
|
---|
| 376 | @@ -5,8 +5,9 @@
|
---|
| 377 |
|
---|
| 378 | classdef timestepping
|
---|
| 379 | properties (SetAccess=public)
|
---|
| 380 | + start_time = 0;
|
---|
| 381 | + final_time = 0;
|
---|
| 382 | time_step = 0;
|
---|
| 383 | - final_time = 0;
|
---|
| 384 | time_adapt = 0;
|
---|
| 385 | cfl_coefficient = 0;
|
---|
| 386 | end
|
---|
| 387 | @@ -40,21 +41,29 @@
|
---|
| 388 | end % }}}
|
---|
| 389 | function checkconsistency(obj,md,solution,analyses) % {{{
|
---|
| 390 |
|
---|
| 391 | + checkfield(md,'timestepping.start_time','numel',1,'NaN',1);
|
---|
| 392 | + checkfield(md,'timestepping.final_time','numel',1,'NaN',1);
|
---|
| 393 | + checkfield(md,'timestepping.time_step','numel',1,'>=',0,'NaN',1);
|
---|
| 394 | checkfield(md,'timestepping.time_adapt','numel',1,'values',[0 1]);
|
---|
| 395 | checkfield(md,'timestepping.cfl_coefficient','numel',1,'>',0,'<=',1);
|
---|
| 396 | + if obj.final_time-obj.start_time<0,
|
---|
| 397 | + checkmessage('timestepping.final_time should be larger than timestepping.start_time');
|
---|
| 398 | + end
|
---|
| 399 | end % }}}
|
---|
| 400 | function disp(obj) % {{{
|
---|
| 401 | disp(sprintf(' timestepping parameters:'));
|
---|
| 402 |
|
---|
| 403 | + fielddisplay(obj,'start_time','simulation starting time [yrs]');
|
---|
| 404 | + fielddisplay(obj,'final_time','final time to stop the simulation [yrs]');
|
---|
| 405 | fielddisplay(obj,'time_step','length of time steps [yrs]');
|
---|
| 406 | - fielddisplay(obj,'final_time','final time to stop the simulation [yrs]');
|
---|
| 407 | fielddisplay(obj,'time_adapt','use cfl condition to define time step ? (0 or 1) ');
|
---|
| 408 | fielddisplay(obj,'cfl_coefficient','coefficient applied to cfl condition');
|
---|
| 409 |
|
---|
| 410 | end % }}}
|
---|
| 411 | function marshall(obj,fid) % {{{
|
---|
| 412 | + WriteData(fid,'object',obj,'fieldname','start_time','format','Double');
|
---|
| 413 | + WriteData(fid,'object',obj,'fieldname','final_time','format','Double');
|
---|
| 414 | WriteData(fid,'object',obj,'fieldname','time_step','format','Double');
|
---|
| 415 | - WriteData(fid,'object',obj,'fieldname','final_time','format','Double');
|
---|
| 416 | WriteData(fid,'object',obj,'fieldname','time_adapt','format','Boolean');
|
---|
| 417 | WriteData(fid,'object',obj,'fieldname','cfl_coefficient','format','Double');
|
---|
| 418 | end % }}}
|
---|