14 #include "LevelData.H" 15 #include "FArrayBox.H" 19 #include "PatchGodunov.H" 20 #include "AdvectPhysics.H" 30 #include "ParmParse.H" 35 #include "NamespaceHeader.H" 140 if (a_surfaceHeatBoundaryDataPtr != NULL)
156 if (a_basalHeatBoundaryDataPtr != NULL)
191 void run(Real a_max_time,
int a_max_step);
197 void computeH_half(Vector<LevelData<FluxBox>* >& a_H_half, Real a_dt);
201 const Vector<LevelData<FluxBox>* >& a_H_half,
202 const Vector<LevelData<FluxBox>* >& a_faceVelAdvection);
205 void updateGeometry(Vector<RefCountedPtr<LevelSigmaCS> >& a_vect_coordSys_new,
206 Vector<RefCountedPtr<LevelSigmaCS> >& a_vectCoords_old,
207 const Vector<LevelData<FluxBox>* >& a_vectFluxes,
221 Real* a_dew, Real* a_dns)
const;
236 HDF5HeaderData m_headerData;
239 void writeMetaDataHDF5(HDF5Handle& a_handle)
const;
242 void setHeader(
const std::string& a_key,
const std::string& a_val)
244 m_headerData.m_string[a_key] = a_val;
246 void getHeader(
const std::string& a_key, std::string& a_val)
248 a_val = m_headerData.m_string[a_key];
250 void setHeader(
const std::string& a_key,
const int& a_val)
252 m_headerData.m_int[a_key] = a_val;
256 a_val = m_headerData.m_int[a_key];
258 void setHeader(
const std::string& a_key,
const Real& a_val)
260 m_headerData.m_real[a_key] = a_val;
265 a_val = m_headerData.m_real[a_key];
269 const Vector<DisjointBoxLayout>& a_grids,
270 const Vector<LevelData<FArrayBox>* > & a_data,
271 const Vector<string>& a_name,
276 const Vector<int>& a_ratio,
277 const int& a_numLevels)
const;
280 const Vector<DisjointBoxLayout>& a_grids,
281 const Vector<LevelData<FArrayBox>* > & a_data,
282 const Vector<string>& a_name,
287 const Vector<int>& a_ratio,
288 const int& a_numLevels)
const;
313 void restart(
const string& a_restart_file);
322 LevelData<FArrayBox> m_uniform_cf_data;
326 Vector<std::string> m_uniform_cf_data_name;
328 Vector<std::string> m_uniform_cf_standard_name;
330 Vector<std::string> m_uniform_cf_long_name;
332 Vector<std::string> m_uniform_cf_units;
334 Vector<std::function<const LevelData<FArrayBox>*(int, LevelData<FArrayBox>&) > >m_cf_field_function;
337 LevelData<FArrayBox> m_cf_tmp_data;
338 Vector<Interval> m_cf_field_interval;
340 Real m_cf_start_time;
341 bool m_plot_style_cf, m_plot_style_amr;
342 enum OutputFileNumbering { time_step = 0, time_seconds = 1, time_years = 2, time_yyyymmdd_360 = 3, NUM_PLOT_NUMBERING};
343 OutputFileNumbering m_output_file_numbering;
346 long outputNumbering();
353 void setOutputOptions(ParmParse& a_pp);
374 void accumulateCFData(Real a_dt,
bool a_reset =
false);
395 int a_maskVal,
int a_level)
const;
446 const RealVect
dx(
int a_level)
const 451 const RefCountedPtr<LevelSigmaCS>
geometry(
int a_level)
const 455 const DisjointBoxLayout&
grids(
int a_level)
const 459 const Vector<DisjointBoxLayout>&
grids()
const 475 const LevelData<FArrayBox>*
velocity(
int a_level)
const 490 MayDay::Error(
"no surface heat boundary data");
518 MayDay::Error(
"no surface heat boundary data");
526 const LevelData<FArrayBox>*
iceFrac(
int a_level)
const 532 const LevelData<FArrayBox>&
muCoef(
int a_level)
const 559 const LevelData<FArrayBox>*
viscousTensor(
int a_level)
const;
587 void tagCells(Vector<IntVectSet>& a_tags);
602 void levelSetup(
int a_level,
const DisjointBoxLayout& a_grids);
605 void initData(Vector<RefCountedPtr<LevelSigmaCS > >& a_vectCoordSys,
606 Vector<LevelData<FArrayBox>* >& a_initialVelocity);
615 virtual void solveVelocityField(
bool a_forceSolve =
false, Real a_convergenceMetric = -1.0);
618 virtual void defineVelRHS(Vector<LevelData<FArrayBox>* >& a_vectRhs);
621 virtual void setBasalFriction(Vector<LevelData<FArrayBox>* >& a_C, Vector<LevelData<FArrayBox>* >& a_C0);
624 virtual void setMuCoefficient(Vector<LevelData<FArrayBox>* >& a_cellMuCoef);
628 Vector<LevelData<FluxBox>* >& a_faceVelTotal,
629 Vector<LevelData<FluxBox>* >& a_diffusivity,
630 Vector<LevelData<FluxBox>* >& a_layerXYFaceXYVel,
631 Vector<LevelData<FArrayBox>* >& a_layerSFaceXYVel);
642 const Vector<LevelData<FArrayBox>* >& a_dphi,
652 void setIceFrac(
const LevelData<FArrayBox>& a_thickness,
int a_level);
661 void updateIceFrac(LevelData<FArrayBox>& a_thickness,
int a_level);
663 void setIceFracBC(LevelData<FArrayBox>& a_iceFrac,
const ProblemDomain& a_domain);
666 void advectIceFrac(Vector<LevelData<FArrayBox>* >& a_iceFrac,
667 const Vector<LevelData<FluxBox>* >& a_faceVelAdvection,
709 void setToZero(Vector<LevelData<FArrayBox>*>& a_data);
713 const Vector<LevelData<FArrayBox>* >& a_sts,
714 const Vector<LevelData<FArrayBox>* >& a_bts,
715 const Vector<LevelData<FArrayBox>* >& a_vts
725 const Vector<LevelData<FArrayBox>* >& a_rhs,
726 Real a_alpha, Real a_beta)
const;
731 Real a_alpha, Real a_beta)
const;
734 #if BISICLES_Z == BISICLES_LAYERED 738 void computeA(Vector<LevelData<FArrayBox>* >& a_A,
739 Vector<LevelData<FArrayBox>* >& a_sA,
740 Vector<LevelData<FArrayBox>* >& a_bA,
741 const Vector<LevelData<FArrayBox>* >& a_internalEnergy,
742 const Vector<LevelData<FArrayBox>* >& a_sInternalEnergy,
743 const Vector<LevelData<FArrayBox>* >& a_bInternalEnergy,
744 const Vector<RefCountedPtr<LevelSigmaCS> >& a_coordSys)
const;
749 Vector<LevelData<FluxBox>* >& a_layerH_half,
750 const Vector<LevelData<FluxBox>* >& a_layerXYFaceXYVel,
751 const Real a_dt,
const Real a_time);
757 Vector<LevelData<FluxBox>* >& a_layerH_half,
758 const Vector<LevelData<FluxBox>* >& a_layerXYFaceXYVel,
759 const Vector<LevelData<FArrayBox>* >& a_layerSFaceXYVel,
760 const Real a_dt,
const Real a_time,
761 Vector<RefCountedPtr<LevelSigmaCS> >& a_coordSysNew,
762 Vector<RefCountedPtr<LevelSigmaCS> >& a_coordSysOld,
763 const Vector<LevelData<FArrayBox>*>& a_surfaceThicknessSource,
764 const Vector<LevelData<FArrayBox>*>& a_basalThicknessSource,
765 const Vector<LevelData<FArrayBox>*>& a_volumeThicknessSource);
772 const LevelData<FArrayBox>& a_coarseH,
773 const LevelData<FArrayBox>& a_coarseBed,
774 const DisjointBoxLayout a_newDBL,
775 const ProblemDomain& a_domain,
888 return (0 <= m_finest_timestep_level)?
1143 #if BISICLES_Z == BISICLES_LAYERED 1165 Vector<LevelData<FArrayBox>* >
m_A;
1168 #if BISICLES_Z == BISICLES_LAYERED 1175 Vector<LevelData<FArrayBox>* >
m_sA;
1176 Vector<LevelData<FArrayBox>* >
m_bA;
1177 #elif BISICLES_Z == BISICLES_FULL 1191 const FArrayBox& a_divuh,
const BaseFab<int>& a_mask,
1192 const Box& a_box)
const;
1366 #if BISICLES_Z == BISICLES_LAYERED 1374 void setLayers(
const Vector<Real>& a_sigma);
1392 void levelAllocate(LevelData<T>** a_ptrPtr,
const DisjointBoxLayout& a_grids,
1393 int a_nComp,
const IntVect& a_ghost)
1395 CH_assert(a_ptrPtr != NULL);
1396 if (*a_ptrPtr != NULL)
1398 *a_ptrPtr =
new LevelData<T>(a_grids, a_nComp, a_ghost);
1414 void setObservee(
AmrIce* a_amrIce)
1416 m_observee = a_amrIce;
1420 void clearObservee()
1431 if (m_observee != NULL)
1448 virtual void addPlotVars(Vector<std::string>& a_vars){;}
1461 virtual void readCheckData(HDF5Handle& a_handle, HDF5HeaderData& a_header,
int a_level,
const DisjointBoxLayout& a_grids){;}
1468 if (std::find(m_observers.begin(), m_observers.end(), a_observer) == m_observers.end())
1470 m_observers.push_back(a_observer);
1471 a_observer->setObservee(
this);
1478 std::vector<Observer*>::iterator it = std::find(m_observers.begin(), m_observers.end(), a_observer);
1479 if ( it != m_observers.end())
1481 a_observer->clearObservee();
1482 m_observers.erase(it);
1489 std::vector<Observer*> m_observers;
1494 for (
int i = 0; i < m_observers.size(); i++)
1495 m_observers[i]->
notify(a_n, *
this);
1500 #include "NamespaceFooter.H" bool m_tagOnGradVel
tag on grad(velocity)?
Definition: AmrIce.H:961
const Vector< DisjointBoxLayout > & grids() const
Definition: AmrIce.H:459
void setThicknessBC(IceThicknessIBC *a_thicknessIBC)
set BC for thickness advection
Definition: AmrIce.cpp:1516
static void postInterpolationReFloat(LevelData< FArrayBox > &a_H, const LevelData< FArrayBox > &a_coarseH, const LevelData< FArrayBox > &a_coarseBed, const DisjointBoxLayout a_newDBL, const ProblemDomain &a_domain, int a_refRatio, Real a_seaLevel, Real a_waterDensity, Real a_iceDensity)
Definition: AmrIce.H:1427
Real m_additionalDiffusivity
Definition: AmrIce.H:1138
virtual void notify(const Notification, AmrIce &)=0
General purpose notify method.
Vector< DisjointBoxLayout > m_amrGrids
current grids
Definition: AmrIce.H:1063
Vector< int > m_num_cells
book-keeping; keeps track of number of cells per level
Definition: AmrIce.H:1069
virtual void addPlotVars(Vector< std::string > &a_vars)
Fat interface members.
Definition: AmrIce.H:1449
Real m_eliminate_remote_ice_tol
Definition: AmrIce.H:1033
Vector< LevelData< FArrayBox > *> m_dragCoef
Definition: AmrIce.H:1203
void restart(const string &a_restart_file)
set up for restart
Definition: AmrIceIO.cpp:2164
bool m_tagOnEpsSqr
tag on strain rate invariant?
Definition: AmrIce.H:977
void implicitThicknessCorrection(Real a_dt, const Vector< LevelData< FArrayBox > * > &a_sts, const Vector< LevelData< FArrayBox > * > &a_bts, const Vector< LevelData< FArrayBox > * > &a_vts)
implicit solve for diffusive fluxes
Definition: AmrIce.cpp:4764
string m_plot_prefix
Definition: AmrIce.H:1270
void eliminateRemoteIce()
Definition: AmrIce.cpp:4741
void addObserver(Observer *a_observer)
Definition: AmrIce.H:1465
Vector< LevelData< FArrayBox > *> m_volumeThicknessSource
Definition: AmrIce.H:1187
void setLayers(const Vector< Real > &a_sigma)
Definition: AmrIce.cpp:5120
MuCoefficient * m_muCoefficientPtr
sets mu coefficient (phi)
Definition: AmrIce.H:873
bool m_doInitialVelGuess
if true, use nonzero initial guess for velocity field (default is false)
Definition: AmrIce.H:933
bool m_tagAllIceOnLevel0
tag any cell with ice in it on level 0
Definition: AmrIce.H:1024
void getHeader(const std::string &a_key, int &a_val)
Definition: AmrIce.H:254
int m_block_factor
blocking factor
Definition: AmrIce.H:897
Vector< LevelData< FArrayBox > *> m_addedIceThickness
Definition: AmrIce.H:1198
Definition: MuCoefficient.H:25
bool m_check_exit
Definition: AmrIce.H:1276
virtual BasalFriction * new_basalFriction() const =0
factory method
ConstitutiveRelation * m_constitutiveRelation
constitutive relation
Definition: AmrIce.H:823
int finestTimestepLevel() const
Definition: AmrIce.H:886
bool m_write_baseVel
Definition: AmrIce.H:1300
part of Observer-Observee implementation
Definition: AmrIce.H:1407
void setHeader(const std::string &a_key, const std::string &a_val)
Definition: AmrIce.H:242
int m_tags_grow
amount to buffer tags used in regridding
Definition: AmrIce.H:1046
bool m_write_map_file
if true, write out .map.hdf5 file
Definition: AmrIce.H:1315
Vector< LevelData< FArrayBox > *> m_bTemperature
Definition: AmrIce.H:1172
Vector< LevelData< FArrayBox > *> m_divThicknessFlux
Definition: AmrIce.H:1194
bool isDefined() const
is this object defined and initialized?
Definition: AmrIce.cpp:165
int m_beta_type
type of basal friction distribution
Definition: AmrIce.H:1234
void setDomainSize(const RealVect &a_domainSize)
set domain size (in meters)
Definition: AmrIce.H:66
void setTopographyFlux(SurfaceFlux *a_topographyFluxPtr)
set bedrock flux for ice sheet
Definition: AmrIce.H:166
void applyCalvingCriterion(CalvingModel::Stage a_stage)
Definition: AmrIce.cpp:4707
void updateViscousTensor() const
Definition: AmrIce.cpp:4491
Vector< LevelData< FArrayBox > *> m_viscousTensorCell
Definition: AmrIce.H:1207
Real m_laplacian_tagging_val
tagging threshold value for undivided lap(vel)
Definition: AmrIce.H:973
RealVect m_initialGuessConstVel
Definition: AmrIce.H:944
Abstract class to manage the nonlinear solve for the ice-sheet momentum.
Definition: IceVelocitySolver.H:32
SurfaceFlux * m_topographyFluxPtr
sets topography flux (which raises/lowers bedrock)
Definition: AmrIce.H:863
bool m_write_dHDt
if true, include dH/dt in plotfiles
Definition: AmrIce.H:1291
bool m_interpolate_zb
if true, interpolate things like base topography at regrid time
Definition: AmrIce.H:949
virtual void readCheckData(HDF5Handle &a_handle, HDF5HeaderData &a_header, int a_level, const DisjointBoxLayout &a_grids)
read level a_level checkpoint data from LevelData<FArrayBox>& a_data
Definition: AmrIce.H:1461
Abstract class around the englacial constitutive relations for ice.
Definition: ConstitutiveRelation.H:34
bool m_timeStepTicks
Definition: AmrIce.H:1355
bool m_write_fluxVel
Definition: AmrIce.H:1294
Vector< LevelData< FArrayBox > *> m_sTemperature
Definition: AmrIce.H:1171
Real m_waterDepth
Definition: AmrIce.H:1099
void updateTemperature()
update the temperature (a derived field)
Definition: AmrIceThermodynamics.cpp:464
void tagCells(Vector< IntVectSet > &a_tags)
compute tags for regridding
Definition: AmrIceMesh.cpp:607
void writeAMRHierarchyHDF5(HDF5Handle &a_handle, const Vector< DisjointBoxLayout > &a_grids, const Vector< LevelData< FArrayBox > * > &a_data, const Vector< string > &a_name, const Box &a_domain, const Real &a_dx, const Real &a_dt, const Real &a_time, const Vector< int > &a_ratio, const int &a_numLevels) const
Definition: AmrIceIO.cpp:2120
bool m_reportGroundedIce
Definition: AmrIce.H:1361
Real m_tagging_val
tagging value (undivided gradient(vel) threshold for regridding)
Definition: AmrIce.H:964
DiffusionTreatment
Definition: AmrIce.H:1351
void writeAMRPlotFile()
write hdf5 plotfile to the standard location
Definition: AmrIceIO.cpp:199
int m_regrid_thickness_interpolation_method
thickness interpolation method to use on regrid, see LevelSigmaCS::ThicknessInterpolationMethod ...
Definition: AmrIce.H:951
int m_finest_level
current finest level
Definition: AmrIce.H:879
IceVelocitySolver * m_velSolver
nonlinear elliptic solver for velocity field
Definition: AmrIce.H:819
rate factor A(T) in (e.g) Glen's law
Definition: ConstitutiveRelation.H:156
Vector< LevelData< FArrayBox > *> m_velBasalC
Definition: AmrIce.H:1130
const Vector< Real > & getFaceSigma() const
Definition: AmrIce.H:1369
const Vector< LevelData< FArrayBox > *> & surfaceHeatFlux() const
access function for surface heat flux
Definition: AmrIce.H:578
bool m_floating_ice_basal_flux_is_min_dhdt
Definition: AmrIce.H:1342
Real m_epsSqr_tagVal
tagging value for strain rate invariant
Definition: AmrIce.H:982
int m_initialGuessType
Definition: AmrIce.H:939
Real computeInitialDt()
compute timestep at initial time
Definition: AmrIce.cpp:4177
int m_regrid_interval
regrid interval
Definition: AmrIce.H:921
bool m_isothermal
Definition: AmrIce.H:1096
int m_groundingLineProximityCalcType
Definition: AmrIce.H:1223
Definition: AmrIce.H:1427
Vector< ProblemDomain > m_amrDomains
problem domains at each level
Definition: AmrIce.H:1057
bool m_additionalVelocity
Definition: AmrIce.H:1387
void updateGroundingLineProximity() const
Definition: AmrIce.cpp:4203
const Vector< LevelData< FArrayBox > *> & removedIceThickness() const
Definition: AmrIce.H:571
class to manage non-subcycled AMR ice-sheet model
Definition: AmrIce.H:40
bool m_evolve_velocity
Definition: AmrIce.H:1332
Vector< LevelData< FArrayBox > * > m_velocity
horizontal velocity field (found by an IceVelocitySolver)
Definition: AmrIce.H:1124
Vector< LevelData< FArrayBox > *> & amrIceFrac()
return reference to full AMR ice fraction
Definition: AmrIce.H:538
Vector< IntVectSet > m_vectTags
stores tags from previous regrids
Definition: AmrIce.H:958
LevelData< FArrayBox > * iceFrac(int a_level)
return pointer to real-valued ice fraction on level a_level
Definition: AmrIce.H:503
RealVect m_domainSize
Definition: AmrIce.H:1060
virtual RateFactor * getNewRateFactor() const =0
Vector< LevelData< FArrayBox > *> m_calvedIceThickness
Definition: AmrIce.H:1196
Vector< LevelData< FluxBox > *> m_faceVelAdvection
Definition: AmrIce.H:1141
Physical/domain initial and boundary conditions for ice-sheet problems.
Definition: IceThicknessIBC.H:84
RealVect m_basalSlope
background slope of bottom topography
Definition: AmrIce.H:1254
IceInternalEnergyIBC * m_internalEnergyIBCPtr
IBC for internalEnergy advection.
Definition: AmrIce.H:847
unsigned int m_nLayers
Definition: AmrIce.H:1380
bool m_tagOnLapVel
tag on laplacian(velocity)
Definition: AmrIce.H:967
void incrementIceThickness(Vector< LevelData< FArrayBox > *> a_thk)
nearly direct access to the ice thickness
Definition: AmrIce.cpp:5134
void writeCheckpointFile()
write checkpoint file out for later restarting
Definition: AmrIceIO.cpp:1051
Real m_velocity_exit
maximum acceptable velocity: if max(u) > m_vel_exit , then dump a plot file and exit ...
Definition: AmrIce.H:1090
int m_initialGuessSolverType
Definition: AmrIce.H:943
Vector< LevelData< FluxBox > *> m_viscousTensorFace
Definition: AmrIce.H:1209
Vector< LevelData< FArrayBox > *> m_cellMuCoef
Definition: AmrIce.H:1133
bool m_floating_ice_basal_flux_is_dhdt
Definition: AmrIce.H:1341
Real m_laplacian_tagging_max_basal_friction_coef
when tagging on undivided lap(vel), ignore cells where the basal friction coeffcient exceeds ...
Definition: AmrIce.H:975
Vector< LevelData< FArrayBox > *> m_internalEnergy
Definition: AmrIce.H:1161
bool m_sigmaSet
Definition: AmrIce.H:1377
Vector< LevelData< FArrayBox > *> m_groundingLineProximity
Definition: AmrIce.H:1218
Vector< IntVectSet > m_vectTagSubset
Definition: AmrIce.H:902
bool m_write_mask
if true, include mask in plotfiles
Definition: AmrIce.H:1288
void setIceFrac(const LevelData< FArrayBox > &a_thickness, int a_level)
initialize real-valued ice fraction
Definition: AmrIce.cpp:3578
bool m_write_ismip6
Definition: AmrIce.H:1312
void computeAreaFraction(LevelData< FArrayBox > &a_area, int a_maskVal, int a_level) const
compute total ice and total grounded ice (volume, at this point)
Definition: AmrIce.cpp:5093
void setRateFactor(RateFactor *a_rateFactorPtr)
set rate factor
Definition: AmrIce.H:82
void updateGeometry(Vector< RefCountedPtr< LevelSigmaCS > > &a_vect_coordSys_new, Vector< RefCountedPtr< LevelSigmaCS > > &a_vectCoords_old, const Vector< LevelData< FluxBox > * > &a_vectFluxes, Real a_dt)
Definition: AmrIce.cpp:2361
Real m_groundingLineProximityScale
Definition: AmrIce.H:1222
void setBasalFriction(const BasalFriction *a_basalFrictionPtr)
set basal friction
Definition: AmrIce.H:177
void setBasalHeatBoundaryData(SurfaceFlux *a_basalHeatBoundaryDataPtr)
set basal Heat flux for ice sheet. Does not include the heat flux due to sliding friction ...
Definition: AmrIce.H:149
const Vector< LevelData< FluxBox > *> & faceVelocitiesLayered() const
access function for layered face-centered velocities
Definition: AmrIce.H:567
PyObject * m_tagPythonModule
Definition: AmrIce.H:1041
virtual CalvingModel * new_CalvingModel()=0
factory method
velSolverTypes
compute area of ice with grounded/floating status given by a_maskval
Definition: AmrIce.H:416
void setBasalRateFactor(RateFactor *a_rateFactorPtr)
set rate factor at base
Definition: AmrIce.H:89
bool m_frac_sources
Definition: AmrIce.H:1348
const RefCountedPtr< LevelSigmaCS > geometry(int a_level) const
Definition: AmrIce.H:451
Vector< LevelData< FArrayBox > *> m_bInternalEnergy
Definition: AmrIce.H:1172
virtual ConstitutiveRelation * getNewConstitutiveRelation() const =0
creates a new copy of this ConstitutiveRelation object.
const Vector< LevelData< FArrayBox > *> & amrVelocity()
Definition: AmrIce.H:480
bool m_grounded_ice_stable
Definition: AmrIce.H:1338
bool m_evolve_ice_frac
Definition: AmrIce.H:1329
bool m_tag_thin_cavity
Definition: AmrIce.H:1011
Vector< LevelData< FArrayBox > *> m_removedIceThickness
Definition: AmrIce.H:1197
const LevelData< FArrayBox > * groundingLineProximity(int a_level) const
Definition: AmrIce.cpp:4680
Vector< LevelData< FArrayBox > * > m_old_thickness
current old-time data
Definition: AmrIce.H:1119
bool m_tagAllIce
tag any cell with ice in it
Definition: AmrIce.H:1019
DiffusionTreatment m_diffusionTreatment
Definition: AmrIce.H:1352
bool m_surfaceBoundaryHeatDataDirichlett
should a Dirichlett internal energy condition be imposed at the upper surface?
Definition: AmrIce.H:1102
SurfaceFlux & surfaceHeatBoundaryData() const
Definition: AmrIce.H:485
Vector< LevelData< FluxBox > *> m_diffusivity
Definition: AmrIce.H:1137
Real m_tag_thin_cavity_thickness
Definition: AmrIce.H:1012
void incrementWithDivFlux(Vector< LevelData< FArrayBox > * > &a_phi, const Vector< LevelData< FArrayBox > * > &a_dphi, Real a_dt)
Definition: AmrIce.cpp:3534
void run(Real a_max_time, int a_max_step)
advance solution until either max_time or max_step are reached
Definition: AmrIce.cpp:1741
bool m_tagOndivHgradVel
tag on div(H grad (vel))
Definition: AmrIce.H:991
void initGrids(int a_finest_level)
initialize grids at initial time
Definition: AmrIceMesh.cpp:1088
bool m_write_thickness_sources
Definition: AmrIce.H:1309
Vector< LevelData< FArrayBox > *> m_tillWaterDepth
Definition: AmrIce.H:1163
void computeThicknessFluxes(Vector< LevelData< FluxBox > * > &a_vectFluxes, const Vector< LevelData< FluxBox > * > &a_H_half, const Vector< LevelData< FluxBox > * > &a_faceVelAdvection)
Definition: AmrIce.cpp:2246
Vector< LevelData< FArrayBox > *> m_iceFrac
Definition: AmrIce.H:1158
BasalFrictionRelation * m_basalFrictionRelation
basal Friction relation
Definition: AmrIce.H:827
Vector< Real > m_amrDx
cell spacing at each level
Definition: AmrIce.H:1054
int m_tag_cap
maximum level at which refinement tags are computed
Definition: AmrIce.H:894
Vector< LevelData< FArrayBox > *> m_A
Definition: AmrIce.H:1165
Definition: AmrIce.H:1427
Real computeDt()
compute timestep
Definition: AmrIce.cpp:4068
IntVect m_tags_grow_dir
Definition: AmrIce.H:1048
int m_max_level
max number ofSflux levels
Definition: AmrIce.H:876
AmrIce()
Default constructor.
Definition: AmrIce.cpp:171
IceThicknessIBC * m_thicknessIBCPtr
IBC for thickness advection.
Definition: AmrIce.H:844
void computeInternalEnergyHalf(Vector< LevelData< FluxBox > * > &a_layerEH_half, Vector< LevelData< FluxBox > * > &a_layerH_half, const Vector< LevelData< FluxBox > * > &a_layerXYFaceXYVel, const Real a_dt, const Real a_time)
Definition: AmrIceThermodynamics.cpp:535
virtual void writePlotData(LevelData< FArrayBox > &a_data, int a_level)
copy level a_level plot data to LevelData<FArrayBox>& a_data
Definition: AmrIce.H:1452
Real groundingLineProximityScale() const
Definition: AmrIce.H:551
void regrid()
do regridding
Definition: AmrIceMesh.cpp:119
virtual ~Observer()
Definition: AmrIce.H:1429
Vector< LevelData< FArrayBox > *> m_velRHS
velocity solve RHS (in case we want to save it)
Definition: AmrIce.H:1127
const LevelData< FArrayBox > * viscosityCoefficient(int a_level) const
Definition: AmrIce.cpp:4393
Definition: AmrIce.H:1351
Vector< LevelData< FArrayBox > *> m_basalThicknessSource
Definition: AmrIce.H:1186
bool m_surfaceBoundaryHeatDataTemperature
is the Dirichlett data a temperature (rather than an internal energy)?
Definition: AmrIce.H:1104
void setSurfaceFlux(SurfaceFlux *a_surfaceFluxPtr)
set surfact flux for ice sheet
Definition: AmrIce.H:107
bool m_tagOnGroundedLapVel
tag on laplacian(velocity) in grounded regions only
Definition: AmrIce.H:970
void setStableSources(FArrayBox &a_sts, FArrayBox &a_bts, FArrayBox &a_vts, const FArrayBox &a_divuh, const BaseFab< int > &a_mask, const Box &a_box) const
modify the source terms (surface,basal,volume) to keep all or part of the ice sheet/shelf steady ...
Definition: AmrIce.cpp:2288
void writePlotFile()
write hdf5 plotfile to the standard location
Definition: AmrIceIO.cpp:191
BasalFriction * m_basalFrictionPtr
sets basal friction coefficient (beta^2)
Definition: AmrIce.H:870
int m_n_regrids
Definition: AmrIce.H:922
Real m_basalLengthScale
Definition: AmrIce.H:955
Vector< LevelData< FArrayBox > *> m_calvedThicknessSource
Definition: AmrIce.H:1199
void tagCellsLevel(IntVectSet &a_tags, int a_level)
compute tags for the level a_level
Definition: AmrIceMesh.cpp:650
int m_margin_tagVal_finestLevel
Definition: AmrIce.H:1016
void setTime(Real a_time)
Definition: AmrIce.H:425
const Vector< LevelData< FArrayBox > *> & addedIceThickness() const
Definition: AmrIce.H:572
bool m_reset_floating_friction_to_zero
if false, don't reset basal friction for floating ice to zero (default is true)
Definition: AmrIce.H:835
bool m_tagOnVelRHS
tag on velocity solve RHS
Definition: AmrIce.H:985
void advectIceFrac(Vector< LevelData< FArrayBox > * > &a_iceFrac, const Vector< LevelData< FluxBox > * > &a_faceVelAdvection, Real a_dt)
update real-valued ice fraction through advection from neighboring cells
Definition: AmrIce.cpp:3868
void setHeader(const std::string &a_key, const int &a_val)
Definition: AmrIce.H:250
void setHeader(const std::string &a_key, const Real &a_val)
Definition: AmrIce.H:258
void setupFixedGrids(const std::string &a_gridFile)
set up grids from grids file
Definition: AmrIceMesh.cpp:1251
Definition: AmrIce.H:1427
const LevelData< FArrayBox > * velocity(int a_level) const
Definition: AmrIce.H:475
Common virtual base class for internal energy transport IBC.
Definition: IceInternalEnergyIBC.H:29
Real dt() const
Definition: AmrIce.H:436
GodunovPhysics * m_thicknessPhysPtr
pointer to a GodunovPhysics for thickness advection
Definition: AmrIce.H:838
bool m_tagEntireDomain
tag all cells for refinement (refine entire domain)
Definition: AmrIce.H:1027
Real time() const
read only access members implementing AMRIceBase
Definition: AmrIce.H:431
const Vector< LevelData< FArrayBox > *> & calvedIceThickness() const
access function for calved ice data
Definition: AmrIce.H:570
Real m_max_dt_grow
maximum amount cfl number may grow in one timestep
Definition: AmrIce.H:1087
Vector< LevelData< FArrayBox > *> m_surfaceThicknessSource
Definition: AmrIce.H:1185
int m_solverType
what type of nonlinear solver to use for velocity field
Definition: AmrIce.H:804
Vector< LevelData< FArrayBox > *> m_sInternalEnergy
Definition: AmrIce.H:1171
Vector< LevelData< FArrayBox > *> m_temperature
Definition: AmrIce.H:1161
int m_plot_interval
Definition: AmrIce.H:1280
bool surfaceHeatBoundaryTemperature() const
Definition: AmrIce.H:508
int m_velDx_tagVal_finestLevelGrounded
Definition: AmrIce.H:1006
Real m_stable_dt
most recent stable timestep (> m_dt if we took a step just to hit a plot interval) ...
Definition: AmrIce.H:1078
Real m_seconds_per_unit_time
Definition: AmrIce.H:1116
void setToZero(Vector< LevelData< FArrayBox > *> &a_data)
Definition: AmrIce.cpp:1727
void setSurfaceHeatBoundaryData(SurfaceFlux *a_surfaceHeatBoundaryDataPtr, bool a_dirichlett, bool a_temperature)
set surface Heat flux for ice sheet
Definition: AmrIce.H:129
const Vector< LevelData< FArrayBox > *> & surfaceInternalEnergy() const
access function for surface temperature
Definition: AmrIce.H:575
abstract class defining the surface flux interface
Definition: SurfaceFlux.H:39
bool m_write_internal_energy
Definition: AmrIce.H:1306
void initialize()
initializes object based on inputs data passed in through parmParse
Definition: AmrIce.cpp:780
Real m_betaEps
small parameter for use in computing beta, if needed
Definition: AmrIce.H:1240
Definition: DomainDiagnosticData.H:88
CalvingModel * m_calvingModelPtr
Calving model.
Definition: AmrIce.H:850
const Vector< RefCountedPtr< LevelSigmaCS > > & amrGeometry() const
Definition: AmrIce.H:463
const LevelData< FArrayBox > * basalThicknessSource(int a_level) const
Definition: AmrIce.cpp:4440
bool m_tagPython
tag cells according to a python function
Definition: AmrIce.H:1040
Real m_fill_ratio
grid efficiency
Definition: AmrIce.H:905
Vector< LevelData< FArrayBox > *> m_sHeatFlux
Definition: AmrIce.H:1173
Vector< RefCountedPtr< LevelSigmaCS > > m_vect_coordSys
Definition: AmrIce.H:1152
const LevelData< FArrayBox > * dragCoefficient(int a_level) const
Definition: AmrIce.cpp:4464
bool m_write_layer_velocities
Definition: AmrIce.H:1386
bool m_evolve_topography_fix_surface
Definition: AmrIce.H:1335
void timeStep(Real a_dt)
compute one timestep
Definition: AmrIce.cpp:1866
void setBasalFlux(SurfaceFlux *a_basalFluxPtr)
set basal flux for ice sheet
Definition: AmrIce.H:118
initialGuessTypes
Definition: AmrIce.H:935
Real m_velocity_solver_tolerance
solver tolerance for velSolver.
Definition: AmrIce.H:810
void initData(Vector< RefCountedPtr< LevelSigmaCS > > &a_vectCoordSys, Vector< LevelData< FArrayBox > * > &a_initialVelocity)
initialize data on hierarchy
Definition: AmrIce.cpp:2792
SurfaceFlux * m_surfaceFluxPtr
sets surface flux for ice sheet
Definition: AmrIce.H:853
void setIceFracBC(LevelData< FArrayBox > &a_iceFrac, const ProblemDomain &a_domain)
void setDefaults()
set default values before initialization
Definition: AmrIce.cpp:191
void setCalvingModel(CalvingModel *a_calvingModelPtr)
Definition: AmrIce.H:183
void setMuCoefficient(const MuCoefficient *a_muCoefficientPtr)
Definition: AmrIce.H:180
IntVectSet m_tag_subset
only allow tagging within a subset of the coarse domain
Definition: AmrIce.H:900
Real m_seaWaterDensity
Definition: AmrIce.H:1110
bool m_grounded_ice_basal_flux_is_dhdt
Definition: AmrIce.H:1343
Vector< int > m_refinement_ratios
refinement ratios
Definition: AmrIce.H:1051
Vector< LevelData< FArrayBox > *> m_bHeatFlux
Definition: AmrIce.H:1174
bool m_write_solver_rhs
if true, include velocity solver RHS in plotfiles
Definition: AmrIce.H:1303
Definition: AmrIce.H:1427
const RealVect dx(int a_level) const
Definition: AmrIce.H:446
void updateInternalEnergy(Vector< LevelData< FluxBox > * > &a_layerTH_half, Vector< LevelData< FluxBox > * > &a_layerH_half, const Vector< LevelData< FluxBox > * > &a_layerXYFaceXYVel, const Vector< LevelData< FArrayBox > * > &a_layerSFaceXYVel, const Real a_dt, const Real a_time, Vector< RefCountedPtr< LevelSigmaCS > > &a_coordSysNew, Vector< RefCountedPtr< LevelSigmaCS > > &a_coordSysOld, const Vector< LevelData< FArrayBox > *> &a_surfaceThicknessSource, const Vector< LevelData< FArrayBox > *> &a_basalThicknessSource, const Vector< LevelData< FArrayBox > *> &a_volumeThicknessSource)
Update the internalEnergy and tillWaterDepth fields.
Definition: AmrIceThermodynamics.cpp:77
Vector< Real > m_faceSigma
Definition: AmrIce.H:1383
Real m_initial_cfl
cfl number for initial timestep (useful if initial data needs small cfl)
Definition: AmrIce.H:1084
Real m_initialGuessConstMu
Definition: AmrIce.H:942
Real computeTotalIce() const
diagnostic function – integrates thickness over domain
Definition: AmrIce.cpp:5073
virtual MuCoefficient * new_muCoefficient() const =0
factory method
Real m_dt
most recent timestep
Definition: AmrIce.H:1075
void computeA(Vector< LevelData< FArrayBox > * > &a_A, Vector< LevelData< FArrayBox > * > &a_sA, Vector< LevelData< FArrayBox > * > &a_bA, const Vector< LevelData< FArrayBox > * > &a_internalEnergy, const Vector< LevelData< FArrayBox > * > &a_sInternalEnergy, const Vector< LevelData< FArrayBox > * > &a_bInternalEnergy, const Vector< RefCountedPtr< LevelSigmaCS > > &a_coordSys) const
compute the flow rate coefficient A given bulk internal energy & geometry
Definition: AmrIce.cpp:5005
Real m_offsetTime
Definition: AmrIce.H:1072
virtual void defineVelRHS(Vector< LevelData< FArrayBox > * > &a_vectRhs)
compute RHS for velocity field solve
Definition: AmrIce.cpp:3258
const LevelData< FArrayBox > * iceFrac(int a_level) const
return pointer to real-valued ice fraction on level a_level
Definition: AmrIce.H:526
virtual BasalFrictionRelation * getNewBasalFrictionRelation() const =0
creates a new copy of subclass objects.
bool m_is_defined
is this object initialized?
Definition: AmrIce.H:1261
bool m_tagGroundingLine
tag the grounding line
Definition: AmrIce.H:997
SurfaceFlux & basalHeatBoundaryData() const
Definition: AmrIce.H:513
int m_finest_timestep_level
Definition: AmrIce.H:885
bool m_reduced_plot
if true, reduce the number of fields written to plot files
Definition: AmrIce.H:1285
bool m_report_discharge
if true, report discharge of solid ice from the ice edge
Definition: AmrIce.H:1227
bool m_floating_ice_stable
Definition: AmrIce.H:1339
Vector< LevelData< FArrayBox > *> m_layerSFaceXYVel
Definition: AmrIce.H:1144
virtual SurfaceFlux * new_surfaceFlux()=0
factory method: return a pointer to a new SurfaceFlux object
bool m_evolve_thickness
Definition: AmrIce.H:1326
virtual void solveVelocityField(bool a_forceSolve=false, Real a_convergenceMetric=-1.0)
solve for velocity field (or just set up some auxilliary quantities)
Definition: AmrIce.cpp:2887
Virtual base class for basal friction relations.
Definition: BasalFrictionRelation.H:27
Real m_betaVal
background value for beta
Definition: AmrIce.H:1237
Notification
Definition: AmrIce.H:1427
void getHeader(const std::string &a_key, Real &a_val)
Definition: AmrIce.H:263
Vector< LevelData< FArrayBox > *> m_bA
Definition: AmrIce.H:1176
bool m_A_valid
Definition: AmrIce.H:1167
const Vector< Real > & amrDx() const
Definition: AmrIce.H:473
Vector< LevelData< FArrayBox > *> m_sA
Definition: AmrIce.H:1175
int m_check_interval
Definition: AmrIce.H:1323
Vector< LevelData< FArrayBox > * > m_deltaTopography
Definition: AmrIce.H:867
Definition: AmrIce.H:1351
void getIceThickness(Real *a_data_ptr, int *a_dim_info, Real *a_dew, Real *a_dns) const
fill flattened Fortran array of data with ice thickness
Definition: AmrIce.cpp:82
void getHeader(const std::string &a_key, std::string &a_val)
Definition: AmrIce.H:246
virtual void writeCheckData(HDF5Handle &a_handle, int a_level)
copy level a_level checkpoint data to LevelData<FArrayBox>& a_data
Definition: AmrIce.H:1458
void setInternalEnergyBC(IceInternalEnergyIBC *a_internalEnergyIBC)
set BC for internalEnergy advection
Definition: AmrIce.cpp:1523
Stage
Definition: CalvingModel.H:28
int m_restart_step
if starting from a restart, timestep of restart
Definition: AmrIce.H:1267
Real m_fixed_dt
Definition: AmrIce.H:1358
Real m_next_report_time
Definition: AmrIce.H:1231
Real m_velocitySolveFinalResidualNorm
Definition: AmrIce.H:817
bool m_doInitialVelSolve
Definition: AmrIce.H:926
Real m_time
current time
Definition: AmrIce.H:1072
Definition: AmrIce.H:1427
Real m_velocitySolveInitialResidualNorm
Residual norms at the start and end of the last velocity solve.
Definition: AmrIce.H:816
bool surfaceHeatBoundaryDirichlett() const
Definition: AmrIce.H:495
void removeObserver(Observer *a_observer)
Definition: AmrIce.H:1475
void computeFaceVelocity(Vector< LevelData< FluxBox > * > &a_faceVelAdvection, Vector< LevelData< FluxBox > * > &a_faceVelTotal, Vector< LevelData< FluxBox > * > &a_diffusivity, Vector< LevelData< FluxBox > * > &a_layerXYFaceXYVel, Vector< LevelData< FArrayBox > * > &a_layerSFaceXYVel)
given the current cell centred velocity field, compute a face centred velocity field ...
Definition: AmrIce.cpp:3358
const Vector< LevelData< FluxBox > *> & faceVelocities()
access function for face-centered velocities
Definition: AmrIce.H:564
const LevelData< FArrayBox > * surfaceThicknessSource(int a_level) const
Definition: AmrIce.cpp:4418
bool m_write_presolve_plotfiles
if true, write out plotfile before doing velocity solves
Definition: AmrIce.H:1320
bool m_tagVelDx
tag where |vel| * dx > m_maxVelDxVal
Definition: AmrIce.H:1004
int m_cur_step
Definition: AmrIce.H:1093
Definition: AmrIce.H:1351
int m_num_thickness_ghost
number of ghost cells we need for m_old_thickness
Definition: AmrIce.H:801
int m_max_base_grid_size
max box size for level 0 (defaults to max_box_size)
Definition: AmrIce.H:918
const DisjointBoxLayout & grids(int a_level) const
Definition: AmrIce.H:455
bool m_do_restart
Definition: AmrIce.H:1264
Vector< LevelData< FArrayBox > *> m_viscosityCoefCell
Definition: AmrIce.H:1204
int m_velDx_tagVal_finestLevelFloating
Definition: AmrIce.H:1007
bool m_tagMargin
tag at the ice margin
Definition: AmrIce.H:1015
Vector< PatchGodunov * > m_thicknessPatchGodVect
PatchGodunov used for thickness advection – one for each level.
Definition: AmrIce.H:841
static int s_verbosity
how verbose should we be?
Definition: AmrIce.H:1258
int m_eliminate_remote_ice_max_iter
Definition: AmrIce.H:1032
void setBasalFrictionRelation(BasalFrictionRelation *a_basalFrictionRelPtr)
set basal Friction relation
Definition: AmrIce.H:96
Definition: BasalFriction.H:28
void computeH_half(Vector< LevelData< FluxBox > * > &a_H_half, Real a_dt)
Definition: AmrIce.cpp:2133
int m_temporalAccuracy
temporal accuracy
Definition: AmrIce.H:794
Real m_velRHS_tagVal
tagging value for velocity RHS
Definition: AmrIce.H:988
void updateInvalidIceFrac(Vector< LevelData< FArrayBox > *> a_iceFrac)
update covered cells, ghost cells etc, of a_iceFrac
Definition: AmrIce.cpp:3624
RateFactor * m_basalRateFactor
rate factor at base
Definition: AmrIce.H:829
Vector< int > m_covered_level
keeps track of which levels are completely covered
Definition: AmrIce.H:1066
int m_nesting_radius
proper nesting radius
Definition: AmrIce.H:908
void helmholtzSolve(Vector< LevelData< FArrayBox > * > &a_phi, const Vector< LevelData< FArrayBox > * > &a_rhs, Real a_alpha, Real a_beta) const
Definition: AmrIce.cpp:4901
Vector< LevelData< FluxBox > *> m_faceVelTotal
Definition: AmrIce.H:1142
RateFactor * m_rateFactor
rate factor
Definition: AmrIce.H:825
virtual base for calving models
Definition: CalvingModel.H:23
const LevelData< FArrayBox > & muCoef(int a_level) const
return const ref to real-valued 'mu coefficient' on level a_level
Definition: AmrIce.H:532
abstract base class for amr ice sheet models (AmrIce, AMRIceControl)
Definition: AmrIceBase.H:21
Vector< LevelData< FArrayBox > *> m_layerSFaceSVel
Definition: AmrIce.H:1145
bool m_viscousTensor_valid
Definition: AmrIce.H:1211
bool m_eliminate_remote_ice
Definition: AmrIce.H:1031
Real m_groundingLineTaggingMaxBasalFrictionCoef
threshold Basal friction coefficient at the grounding line : tag if C < value
Definition: AmrIce.H:1001
virtual ~AmrIce()
destructor
Definition: AmrIce.cpp:330
Real m_plot_time_interval
write a plot file every m_plot_time_interval years (rather than steps)
Definition: AmrIce.H:1282
void setConstitutiveRelation(ConstitutiveRelation *a_constRelPtr)
set constitutive relation
Definition: AmrIce.H:73
int m_maxSolverIterations
max number of iterations for velocity solver
Definition: AmrIce.H:807
Real m_velDx_tagVal
Definition: AmrIce.H:1005
SurfaceFlux * m_basalHeatBoundaryDataPtr
sets basal heat flux or temperature for ice sheet
Definition: AmrIce.H:860
Real m_cfl
timestep scaling
Definition: AmrIce.H:1081
const Vector< int > & refRatios() const
Definition: AmrIce.H:471
void updateCoordSysWithNewThickness(const Vector< LevelData< FArrayBox > * > &a_thickness)
Definition: AmrIce.cpp:3554
virtual void defineSolver()
initialize diagnostics
Definition: AmrIce.cpp:1529
Real m_report_time_interval
report diagnostic every m_report_time_interval years (rather than every time step) ...
Definition: AmrIce.H:1230
Vector< LevelData< FluxBox > *> m_layerXYFaceXYVel
Definition: AmrIce.H:1146
void levelSetup(int a_level, const DisjointBoxLayout &a_grids)
set up storage, etc on an AMR level
Definition: AmrIce.cpp:2690
virtual void addCheckVars(Vector< std::string > &a_vars)
fill a_var with the names of variables to add to the checkpoint file
Definition: AmrIce.H:1455
Real m_gravity
Definition: AmrIce.H:1113
Real m_iceDensity
Definition: AmrIce.H:1107
bool m_eliminate_remote_ice_after_regrid
Definition: AmrIce.H:1036
bool m_groundingLineProximity_valid
Definition: AmrIce.H:1220
Real m_divHGradVel_tagVal
tagging threshold value for undivided div(H grad(vel))
Definition: AmrIce.H:994
Real m_groundingLineTaggingMinVel
threshold velocity at the grounding line : tag if |u| > value
Definition: AmrIce.H:999
PyObject * m_tagPythonFunction
Definition: AmrIce.H:1042
void computeDischarge(const Vector< LevelData< FluxBox > * > &a_vectFluxes)
int m_velocity_solve_interval
solve the velocity problem every m_velocitySolveInterval timesteps
Definition: AmrIce.H:813
int finestLevel() const
Definition: AmrIce.H:441
bool m_check_overwrite
Definition: AmrIce.H:1275
int m_max_box_size
max box size
Definition: AmrIce.H:911
void updateIceFrac(LevelData< FArrayBox > &a_thickness, int a_level)
update real-valued ice fraction after thickness update
Definition: AmrIce.cpp:3597
SurfaceFlux * m_basalFluxPtr
sets basal flux for ice sheet
Definition: AmrIce.H:855
SurfaceFlux * m_surfaceHeatBoundaryDataPtr
sets surface heat flux or internalEnergy for ice sheet
Definition: AmrIce.H:858
const LevelData< FArrayBox > * viscousTensor(int a_level) const
Definition: AmrIce.cpp:4366
bool m_write_viscousTensor
Definition: AmrIce.H:1297
void tagCellsInit(Vector< IntVectSet > &a_tags)
compute tags at initial time
Definition: AmrIceMesh.cpp:1072
const Vector< LevelData< FArrayBox > *> & amrIceFrac() const
return const reference to full AMR ice fraction
Definition: AmrIce.H:544
void readCheckpointFile(HDF5Handle &a_handle)
read checkpoint file for restart
Definition: AmrIceIO.cpp:1393
string m_check_prefix
Definition: AmrIce.H:1273