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;
237 HDF5HeaderData m_headerData;
240 void writeMetaDataHDF5(HDF5Handle& a_handle)
const;
245 void setHeader(
const std::string& a_key,
const std::string& a_val)
247 m_headerData.m_string[a_key] = a_val;
249 void getHeader(
const std::string& a_key, std::string& a_val)
251 a_val = m_headerData.m_string[a_key];
253 void setHeader(
const std::string& a_key,
const int& a_val)
255 m_headerData.m_int[a_key] = a_val;
259 a_val = m_headerData.m_int[a_key];
261 void setHeader(
const std::string& a_key,
const Real& a_val)
263 m_headerData.m_real[a_key] = a_val;
268 a_val = m_headerData.m_real[a_key];
272 const Vector<DisjointBoxLayout>& a_grids,
273 const Vector<LevelData<FArrayBox>* > & a_data,
274 const Vector<string>& a_name,
279 const Vector<int>& a_ratio,
280 const int& a_numLevels)
const;
283 const Vector<DisjointBoxLayout>& a_grids,
284 const Vector<LevelData<FArrayBox>* > & a_data,
285 const Vector<string>& a_name,
290 const Vector<int>& a_ratio,
291 const int& a_numLevels)
const;
316 void restart(
const string& a_restart_file);
325 LevelData<FArrayBox> m_uniform_cf_data;
330 Vector<std::string> m_uniform_cf_data_name;
332 Vector<std::string> m_uniform_cf_standard_name;
334 Vector<std::string> m_uniform_cf_long_name;
336 Vector<std::string> m_uniform_cf_units;
338 Vector<std::function<const LevelData<FArrayBox>*(int, LevelData<FArrayBox>&) > >m_cf_field_function;
341 LevelData<FArrayBox> m_cf_tmp_data;
342 Vector<Interval> m_cf_field_interval;
344 Real m_cf_start_time;
345 bool m_plot_style_cf, m_plot_style_amr;
346 enum OutputFileNumbering { time_step = 0, time_seconds = 1, time_years = 2, time_yyyymmdd_360 = 3, NUM_PLOT_NUMBERING};
347 OutputFileNumbering m_output_file_numbering;
350 long outputNumbering();
359 void setOutputOptions(ParmParse& a_pp);
380 void accumulateCFData(Real a_dt,
bool a_reset =
false);
403 int a_maskVal,
int a_level)
const;
454 const RealVect
dx(
int a_level)
const 459 const RefCountedPtr<LevelSigmaCS>
geometry(
int a_level)
const 463 const DisjointBoxLayout&
grids(
int a_level)
const 467 const Vector<DisjointBoxLayout>&
grids()
const 483 const LevelData<FArrayBox>*
velocity(
int a_level)
const 498 MayDay::Error(
"no surface heat boundary data");
526 MayDay::Error(
"no surface heat boundary data");
534 const LevelData<FArrayBox>*
iceFrac(
int a_level)
const 540 const LevelData<FArrayBox>&
muCoef(
int a_level)
const 567 const LevelData<FArrayBox>*
viscousTensor(
int a_level)
const;
595 void tagCells(Vector<IntVectSet>& a_tags);
610 void levelSetup(
int a_level,
const DisjointBoxLayout& a_grids);
613 void initData(Vector<RefCountedPtr<LevelSigmaCS > >& a_vectCoordSys,
614 Vector<LevelData<FArrayBox>* >& a_initialVelocity);
623 virtual void solveVelocityField(
bool a_forceSolve =
false, Real a_convergenceMetric = -1.0);
626 virtual void defineVelRHS(Vector<LevelData<FArrayBox>* >& a_vectRhs);
629 virtual void setBasalFriction(Vector<LevelData<FArrayBox>* >& a_C, Vector<LevelData<FArrayBox>* >& a_C0);
632 virtual void setMuCoefficient(Vector<LevelData<FArrayBox>* >& a_cellMuCoef);
636 Vector<LevelData<FluxBox>* >& a_faceVelTotal,
637 Vector<LevelData<FluxBox>* >& a_diffusivity,
638 Vector<LevelData<FluxBox>* >& a_layerXYFaceXYVel,
639 Vector<LevelData<FArrayBox>* >& a_layerSFaceXYVel);
650 const Vector<LevelData<FArrayBox>* >& a_dphi,
660 void setIceFrac(
const LevelData<FArrayBox>& a_thickness,
int a_level);
669 void updateIceFrac(LevelData<FArrayBox>& a_thickness,
int a_level);
671 void setIceFracBC(LevelData<FArrayBox>& a_iceFrac,
const ProblemDomain& a_domain);
674 void advectIceFrac(Vector<LevelData<FArrayBox>* >& a_iceFrac,
675 const Vector<LevelData<FluxBox>* >& a_faceVelAdvection,
717 void setToZero(Vector<LevelData<FArrayBox>*>& a_data);
721 const Vector<LevelData<FArrayBox>* >& a_sts,
722 const Vector<LevelData<FArrayBox>* >& a_bts,
723 const Vector<LevelData<FArrayBox>* >& a_vts
733 const Vector<LevelData<FArrayBox>* >& a_rhs,
734 Real a_alpha, Real a_beta)
const;
739 Real a_alpha, Real a_beta)
const;
742 #if BISICLES_Z == BISICLES_LAYERED 746 void computeA(Vector<LevelData<FArrayBox>* >& a_A,
747 Vector<LevelData<FArrayBox>* >& a_sA,
748 Vector<LevelData<FArrayBox>* >& a_bA,
749 const Vector<LevelData<FArrayBox>* >& a_internalEnergy,
750 const Vector<LevelData<FArrayBox>* >& a_sInternalEnergy,
751 const Vector<LevelData<FArrayBox>* >& a_bInternalEnergy,
752 const Vector<RefCountedPtr<LevelSigmaCS> >& a_coordSys)
const;
757 Vector<LevelData<FluxBox>* >& a_layerH_half,
758 const Vector<LevelData<FluxBox>* >& a_layerXYFaceXYVel,
759 const Real a_dt,
const Real a_time);
765 Vector<LevelData<FluxBox>* >& a_layerH_half,
766 const Vector<LevelData<FluxBox>* >& a_layerXYFaceXYVel,
767 const Vector<LevelData<FArrayBox>* >& a_layerSFaceXYVel,
768 const Real a_dt,
const Real a_time,
769 Vector<RefCountedPtr<LevelSigmaCS> >& a_coordSysNew,
770 Vector<RefCountedPtr<LevelSigmaCS> >& a_coordSysOld,
771 const Vector<LevelData<FArrayBox>*>& a_surfaceThicknessSource,
772 const Vector<LevelData<FArrayBox>*>& a_basalThicknessSource,
773 const Vector<LevelData<FArrayBox>*>& a_volumeThicknessSource);
780 const LevelData<FArrayBox>& a_coarseH,
781 const LevelData<FArrayBox>& a_coarseBed,
782 const DisjointBoxLayout a_newDBL,
783 const ProblemDomain& a_domain,
896 return (0 <= m_finest_timestep_level)?
1151 #if BISICLES_Z == BISICLES_LAYERED 1173 Vector<LevelData<FArrayBox>* >
m_A;
1176 #if BISICLES_Z == BISICLES_LAYERED 1183 Vector<LevelData<FArrayBox>* >
m_sA;
1184 Vector<LevelData<FArrayBox>* >
m_bA;
1185 #elif BISICLES_Z == BISICLES_FULL 1199 const FArrayBox& a_divuh,
const BaseFab<int>& a_mask,
1200 const Box& a_box)
const;
1377 #if BISICLES_Z == BISICLES_LAYERED 1385 void setLayers(
const Vector<Real>& a_sigma);
1403 void levelAllocate(LevelData<T>** a_ptrPtr,
const DisjointBoxLayout& a_grids,
1404 int a_nComp,
const IntVect& a_ghost)
1406 CH_assert(a_ptrPtr != NULL);
1407 if (*a_ptrPtr != NULL)
1409 *a_ptrPtr =
new LevelData<T>(a_grids, a_nComp, a_ghost);
1425 void setObservee(
AmrIce* a_amrIce)
1427 m_observee = a_amrIce;
1431 void clearObservee()
1442 if (m_observee != NULL)
1459 virtual void addPlotVars(Vector<std::string>& a_vars){;}
1472 virtual void readCheckData(HDF5Handle& a_handle, HDF5HeaderData& a_header,
int a_level,
const DisjointBoxLayout& a_grids){;}
1479 if (std::find(m_observers.begin(), m_observers.end(), a_observer) == m_observers.end())
1481 m_observers.push_back(a_observer);
1482 a_observer->setObservee(
this);
1489 std::vector<Observer*>::iterator it = std::find(m_observers.begin(), m_observers.end(), a_observer);
1490 if ( it != m_observers.end())
1492 a_observer->clearObservee();
1493 m_observers.erase(it);
1500 std::vector<Observer*> m_observers;
1505 for (
int i = 0; i < m_observers.size(); i++)
1506 m_observers[i]->
notify(a_n, *
this);
1511 #include "NamespaceFooter.H" bool m_tagOnGradVel
tag on grad(velocity)?
Definition: AmrIce.H:969
const Vector< DisjointBoxLayout > & grids() const
Definition: AmrIce.H:467
void setThicknessBC(IceThicknessIBC *a_thicknessIBC)
set BC for thickness advection
Definition: AmrIce.cpp:1517
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:1438
Real m_additionalDiffusivity
Definition: AmrIce.H:1146
virtual void notify(const Notification, AmrIce &)=0
General purpose notify method.
Vector< DisjointBoxLayout > m_amrGrids
current grids
Definition: AmrIce.H:1071
Vector< int > m_num_cells
book-keeping; keeps track of number of cells per level
Definition: AmrIce.H:1077
virtual void addPlotVars(Vector< std::string > &a_vars)
Fat interface members.
Definition: AmrIce.H:1460
Real m_eliminate_remote_ice_tol
Definition: AmrIce.H:1041
Vector< LevelData< FArrayBox > *> m_dragCoef
Definition: AmrIce.H:1211
void restart(const string &a_restart_file)
set up for restart
Definition: AmrIceIO.cpp:2187
bool m_tagOnEpsSqr
tag on strain rate invariant?
Definition: AmrIce.H:985
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:4769
string m_plot_prefix
Definition: AmrIce.H:1278
void eliminateRemoteIce()
Definition: AmrIce.cpp:4746
void addObserver(Observer *a_observer)
Definition: AmrIce.H:1476
Vector< LevelData< FArrayBox > *> m_volumeThicknessSource
Definition: AmrIce.H:1195
void setLayers(const Vector< Real > &a_sigma)
Definition: AmrIce.cpp:5125
MuCoefficient * m_muCoefficientPtr
sets mu coefficient (phi)
Definition: AmrIce.H:881
bool m_doInitialVelGuess
if true, use nonzero initial guess for velocity field (default is false)
Definition: AmrIce.H:941
bool m_tagAllIceOnLevel0
tag any cell with ice in it on level 0
Definition: AmrIce.H:1032
void getHeader(const std::string &a_key, int &a_val)
Definition: AmrIce.H:257
int m_block_factor
blocking factor
Definition: AmrIce.H:905
Vector< LevelData< FArrayBox > *> m_addedIceThickness
Definition: AmrIce.H:1206
Definition: MuCoefficient.H:25
bool m_check_exit
Definition: AmrIce.H:1284
virtual BasalFriction * new_basalFriction() const =0
factory method
ConstitutiveRelation * m_constitutiveRelation
constitutive relation
Definition: AmrIce.H:831
int finestTimestepLevel() const
Definition: AmrIce.H:894
bool m_write_baseVel
Definition: AmrIce.H:1311
part of Observer-Observee implementation
Definition: AmrIce.H:1418
void setHeader(const std::string &a_key, const std::string &a_val)
Definition: AmrIce.H:245
int m_tags_grow
amount to buffer tags used in regridding
Definition: AmrIce.H:1054
bool m_write_map_file
if true, write out .map.hdf5 file
Definition: AmrIce.H:1326
Vector< LevelData< FArrayBox > *> m_bTemperature
Definition: AmrIce.H:1180
Vector< LevelData< FArrayBox > *> m_divThicknessFlux
Definition: AmrIce.H:1202
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:1242
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:4712
void updateViscousTensor() const
Definition: AmrIce.cpp:4496
Vector< LevelData< FArrayBox > *> m_viscousTensorCell
Definition: AmrIce.H:1215
Real m_laplacian_tagging_val
tagging threshold value for undivided lap(vel)
Definition: AmrIce.H:981
RealVect m_initialGuessConstVel
Definition: AmrIce.H:952
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:871
bool m_write_dHDt
if true, include dH/dt in plotfiles
Definition: AmrIce.H:1302
bool m_interpolate_zb
if true, interpolate things like base topography at regrid time
Definition: AmrIce.H:957
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:1472
Abstract class around the englacial constitutive relations for ice.
Definition: ConstitutiveRelation.H:34
bool m_timeStepTicks
Definition: AmrIce.H:1366
bool m_write_fluxVel
Definition: AmrIce.H:1305
Vector< LevelData< FArrayBox > *> m_sTemperature
Definition: AmrIce.H:1179
Real m_waterDepth
Definition: AmrIce.H:1107
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:2143
bool m_reportGroundedIce
Definition: AmrIce.H:1372
Real m_tagging_val
tagging value (undivided gradient(vel) threshold for regridding)
Definition: AmrIce.H:972
DiffusionTreatment
Definition: AmrIce.H:1362
void writeAMRPlotFile()
write hdf5 plotfile to the standard location
Definition: AmrIceIO.cpp:202
int m_regrid_thickness_interpolation_method
thickness interpolation method to use on regrid, see LevelSigmaCS::ThicknessInterpolationMethod ...
Definition: AmrIce.H:959
int m_finest_level
current finest level
Definition: AmrIce.H:887
IceVelocitySolver * m_velSolver
nonlinear elliptic solver for velocity field
Definition: AmrIce.H:827
rate factor A(T) in (e.g) Glen's law
Definition: ConstitutiveRelation.H:156
Vector< LevelData< FArrayBox > *> m_velBasalC
Definition: AmrIce.H:1138
const Vector< Real > & getFaceSigma() const
Definition: AmrIce.H:1380
const Vector< LevelData< FArrayBox > *> & surfaceHeatFlux() const
access function for surface heat flux
Definition: AmrIce.H:586
bool m_floating_ice_basal_flux_is_min_dhdt
Definition: AmrIce.H:1353
Real m_epsSqr_tagVal
tagging value for strain rate invariant
Definition: AmrIce.H:990
int m_initialGuessType
Definition: AmrIce.H:947
Real computeInitialDt()
compute timestep at initial time
Definition: AmrIce.cpp:4182
int m_regrid_interval
regrid interval
Definition: AmrIce.H:929
bool m_isothermal
Definition: AmrIce.H:1104
int m_groundingLineProximityCalcType
Definition: AmrIce.H:1231
Definition: AmrIce.H:1438
Vector< ProblemDomain > m_amrDomains
problem domains at each level
Definition: AmrIce.H:1065
bool m_additionalVelocity
Definition: AmrIce.H:1398
void updateGroundingLineProximity() const
Definition: AmrIce.cpp:4208
const Vector< LevelData< FArrayBox > *> & removedIceThickness() const
Definition: AmrIce.H:579
class to manage non-subcycled AMR ice-sheet model
Definition: AmrIce.H:40
bool m_evolve_velocity
Definition: AmrIce.H:1343
Vector< LevelData< FArrayBox > * > m_velocity
horizontal velocity field (found by an IceVelocitySolver)
Definition: AmrIce.H:1132
Vector< LevelData< FArrayBox > *> & amrIceFrac()
return reference to full AMR ice fraction
Definition: AmrIce.H:546
Vector< IntVectSet > m_vectTags
stores tags from previous regrids
Definition: AmrIce.H:966
LevelData< FArrayBox > * iceFrac(int a_level)
return pointer to real-valued ice fraction on level a_level
Definition: AmrIce.H:511
RealVect m_domainSize
Definition: AmrIce.H:1068
virtual RateFactor * getNewRateFactor() const =0
Vector< LevelData< FArrayBox > *> m_calvedIceThickness
Definition: AmrIce.H:1204
Vector< LevelData< FluxBox > *> m_faceVelAdvection
Definition: AmrIce.H:1149
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:1262
IceInternalEnergyIBC * m_internalEnergyIBCPtr
IBC for internalEnergy advection.
Definition: AmrIce.H:855
unsigned int m_nLayers
Definition: AmrIce.H:1391
bool m_tagOnLapVel
tag on laplacian(velocity)
Definition: AmrIce.H:975
void incrementIceThickness(Vector< LevelData< FArrayBox > *> a_thk)
nearly direct access to the ice thickness
Definition: AmrIce.cpp:5139
void writeCheckpointFile()
write checkpoint file out for later restarting
Definition: AmrIceIO.cpp:1071
Real m_velocity_exit
maximum acceptable velocity: if max(u) > m_vel_exit , then dump a plot file and exit ...
Definition: AmrIce.H:1098
int m_initialGuessSolverType
Definition: AmrIce.H:951
Vector< LevelData< FluxBox > *> m_viscousTensorFace
Definition: AmrIce.H:1217
Vector< LevelData< FArrayBox > *> m_cellMuCoef
Definition: AmrIce.H:1141
bool m_floating_ice_basal_flux_is_dhdt
Definition: AmrIce.H:1352
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:983
Vector< LevelData< FArrayBox > *> m_internalEnergy
Definition: AmrIce.H:1169
bool m_sigmaSet
Definition: AmrIce.H:1388
Vector< LevelData< FArrayBox > *> m_groundingLineProximity
Definition: AmrIce.H:1226
Vector< IntVectSet > m_vectTagSubset
Definition: AmrIce.H:910
bool m_write_mask
if true, include mask in plotfiles
Definition: AmrIce.H:1299
void setIceFrac(const LevelData< FArrayBox > &a_thickness, int a_level)
initialize real-valued ice fraction
Definition: AmrIce.cpp:3581
bool m_write_ismip6
Definition: AmrIce.H:1323
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:5098
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:2364
Real m_groundingLineProximityScale
Definition: AmrIce.H:1230
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:575
PyObject * m_tagPythonModule
Definition: AmrIce.H:1049
virtual CalvingModel * new_CalvingModel()=0
factory method
velSolverTypes
compute area of ice with grounded/floating status given by a_maskval
Definition: AmrIce.H:424
void setBasalRateFactor(RateFactor *a_rateFactorPtr)
set rate factor at base
Definition: AmrIce.H:89
bool m_frac_sources
Definition: AmrIce.H:1359
const RefCountedPtr< LevelSigmaCS > geometry(int a_level) const
Definition: AmrIce.H:459
Vector< LevelData< FArrayBox > *> m_bInternalEnergy
Definition: AmrIce.H:1180
virtual ConstitutiveRelation * getNewConstitutiveRelation() const =0
creates a new copy of this ConstitutiveRelation object.
const Vector< LevelData< FArrayBox > *> & amrVelocity()
Definition: AmrIce.H:488
bool m_grounded_ice_stable
Definition: AmrIce.H:1349
bool m_evolve_ice_frac
Definition: AmrIce.H:1340
bool m_tag_thin_cavity
Definition: AmrIce.H:1019
Vector< LevelData< FArrayBox > *> m_removedIceThickness
Definition: AmrIce.H:1205
const LevelData< FArrayBox > * groundingLineProximity(int a_level) const
Definition: AmrIce.cpp:4685
Vector< LevelData< FArrayBox > * > m_old_thickness
current old-time data
Definition: AmrIce.H:1127
bool m_tagAllIce
tag any cell with ice in it
Definition: AmrIce.H:1027
DiffusionTreatment m_diffusionTreatment
Definition: AmrIce.H:1363
bool m_surfaceBoundaryHeatDataDirichlett
should a Dirichlett internal energy condition be imposed at the upper surface?
Definition: AmrIce.H:1110
SurfaceFlux & surfaceHeatBoundaryData() const
Definition: AmrIce.H:493
Vector< LevelData< FluxBox > *> m_diffusivity
Definition: AmrIce.H:1145
Real m_tag_thin_cavity_thickness
Definition: AmrIce.H:1020
void incrementWithDivFlux(Vector< LevelData< FArrayBox > * > &a_phi, const Vector< LevelData< FArrayBox > * > &a_dphi, Real a_dt)
Definition: AmrIce.cpp:3537
void run(Real a_max_time, int a_max_step)
advance solution until either max_time or max_step are reached
Definition: AmrIce.cpp:1742
bool m_tagOndivHgradVel
tag on div(H grad (vel))
Definition: AmrIce.H:999
void initGrids(int a_finest_level)
initialize grids at initial time
Definition: AmrIceMesh.cpp:1088
bool m_write_thickness_sources
Definition: AmrIce.H:1320
Vector< LevelData< FArrayBox > *> m_tillWaterDepth
Definition: AmrIce.H:1171
void computeThicknessFluxes(Vector< LevelData< FluxBox > * > &a_vectFluxes, const Vector< LevelData< FluxBox > * > &a_H_half, const Vector< LevelData< FluxBox > * > &a_faceVelAdvection)
Definition: AmrIce.cpp:2249
Vector< LevelData< FArrayBox > *> m_iceFrac
Definition: AmrIce.H:1166
BasalFrictionRelation * m_basalFrictionRelation
basal Friction relation
Definition: AmrIce.H:835
Vector< Real > m_amrDx
cell spacing at each level
Definition: AmrIce.H:1062
int m_tag_cap
maximum level at which refinement tags are computed
Definition: AmrIce.H:902
Vector< LevelData< FArrayBox > *> m_A
Definition: AmrIce.H:1173
Definition: AmrIce.H:1438
Real computeDt()
compute timestep
Definition: AmrIce.cpp:4071
IntVect m_tags_grow_dir
Definition: AmrIce.H:1056
int m_max_level
max number ofSflux levels
Definition: AmrIce.H:884
AmrIce()
Default constructor.
Definition: AmrIce.cpp:171
IceThicknessIBC * m_thicknessIBCPtr
IBC for thickness advection.
Definition: AmrIce.H:852
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:1463
Real groundingLineProximityScale() const
Definition: AmrIce.H:559
void regrid()
do regridding
Definition: AmrIceMesh.cpp:119
virtual ~Observer()
Definition: AmrIce.H:1440
Vector< LevelData< FArrayBox > *> m_velRHS
velocity solve RHS (in case we want to save it)
Definition: AmrIce.H:1135
const LevelData< FArrayBox > * viscosityCoefficient(int a_level) const
Definition: AmrIce.cpp:4398
Definition: AmrIce.H:1362
Vector< LevelData< FArrayBox > *> m_basalThicknessSource
Definition: AmrIce.H:1194
bool m_surfaceBoundaryHeatDataTemperature
is the Dirichlett data a temperature (rather than an internal energy)?
Definition: AmrIce.H:1112
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:978
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:2291
void writePlotFile()
write hdf5 plotfile to the standard location
Definition: AmrIceIO.cpp:194
BasalFriction * m_basalFrictionPtr
sets basal friction coefficient (beta^2)
Definition: AmrIce.H:878
int m_n_regrids
Definition: AmrIce.H:930
Real m_basalLengthScale
Definition: AmrIce.H:963
Vector< LevelData< FArrayBox > *> m_calvedThicknessSource
Definition: AmrIce.H:1207
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:1024
void setTime(Real a_time)
Definition: AmrIce.H:433
const Vector< LevelData< FArrayBox > *> & addedIceThickness() const
Definition: AmrIce.H:580
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:843
bool m_tagOnVelRHS
tag on velocity solve RHS
Definition: AmrIce.H:993
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:3871
void setHeader(const std::string &a_key, const int &a_val)
Definition: AmrIce.H:253
void setHeader(const std::string &a_key, const Real &a_val)
Definition: AmrIce.H:261
void setupFixedGrids(const std::string &a_gridFile)
set up grids from grids file
Definition: AmrIceMesh.cpp:1251
Definition: AmrIce.H:1438
const LevelData< FArrayBox > * velocity(int a_level) const
Definition: AmrIce.H:483
Common virtual base class for internal energy transport IBC.
Definition: IceInternalEnergyIBC.H:29
Real dt() const
Definition: AmrIce.H:444
GodunovPhysics * m_thicknessPhysPtr
pointer to a GodunovPhysics for thickness advection
Definition: AmrIce.H:846
bool m_tagEntireDomain
tag all cells for refinement (refine entire domain)
Definition: AmrIce.H:1035
Real time() const
read only access members implementing AMRIceBase
Definition: AmrIce.H:439
const Vector< LevelData< FArrayBox > *> & calvedIceThickness() const
access function for calved ice data
Definition: AmrIce.H:578
Real m_max_dt_grow
maximum amount cfl number may grow in one timestep
Definition: AmrIce.H:1095
Vector< LevelData< FArrayBox > *> m_surfaceThicknessSource
Definition: AmrIce.H:1193
int m_solverType
what type of nonlinear solver to use for velocity field
Definition: AmrIce.H:812
Vector< LevelData< FArrayBox > *> m_sInternalEnergy
Definition: AmrIce.H:1179
Vector< LevelData< FArrayBox > *> m_temperature
Definition: AmrIce.H:1169
int m_plot_interval
Definition: AmrIce.H:1288
bool surfaceHeatBoundaryTemperature() const
Definition: AmrIce.H:516
int m_velDx_tagVal_finestLevelGrounded
Definition: AmrIce.H:1014
Real m_stable_dt
most recent stable timestep (> m_dt if we took a step just to hit a plot interval) ...
Definition: AmrIce.H:1086
Real m_seconds_per_unit_time
Definition: AmrIce.H:1124
void setToZero(Vector< LevelData< FArrayBox > *> &a_data)
Definition: AmrIce.cpp:1728
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:583
abstract class defining the surface flux interface
Definition: SurfaceFlux.H:39
bool m_write_internal_energy
Definition: AmrIce.H:1317
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:1248
Definition: DomainDiagnosticData.H:88
CalvingModel * m_calvingModelPtr
Calving model.
Definition: AmrIce.H:858
const Vector< RefCountedPtr< LevelSigmaCS > > & amrGeometry() const
Definition: AmrIce.H:471
const LevelData< FArrayBox > * basalThicknessSource(int a_level) const
Definition: AmrIce.cpp:4445
bool m_tagPython
tag cells according to a python function
Definition: AmrIce.H:1048
Real m_fill_ratio
grid efficiency
Definition: AmrIce.H:913
Vector< LevelData< FArrayBox > *> m_sHeatFlux
Definition: AmrIce.H:1181
Vector< RefCountedPtr< LevelSigmaCS > > m_vect_coordSys
Definition: AmrIce.H:1160
const LevelData< FArrayBox > * dragCoefficient(int a_level) const
Definition: AmrIce.cpp:4469
bool m_write_layer_velocities
Definition: AmrIce.H:1397
bool m_evolve_topography_fix_surface
Definition: AmrIce.H:1346
void timeStep(Real a_dt)
compute one timestep
Definition: AmrIce.cpp:1869
void setBasalFlux(SurfaceFlux *a_basalFluxPtr)
set basal flux for ice sheet
Definition: AmrIce.H:118
initialGuessTypes
Definition: AmrIce.H:943
Real m_velocity_solver_tolerance
solver tolerance for velSolver.
Definition: AmrIce.H:818
void initData(Vector< RefCountedPtr< LevelSigmaCS > > &a_vectCoordSys, Vector< LevelData< FArrayBox > * > &a_initialVelocity)
initialize data on hierarchy
Definition: AmrIce.cpp:2795
SurfaceFlux * m_surfaceFluxPtr
sets surface flux for ice sheet
Definition: AmrIce.H:861
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:908
Real m_seaWaterDensity
Definition: AmrIce.H:1118
bool m_grounded_ice_basal_flux_is_dhdt
Definition: AmrIce.H:1354
Vector< int > m_refinement_ratios
refinement ratios
Definition: AmrIce.H:1059
Vector< LevelData< FArrayBox > *> m_bHeatFlux
Definition: AmrIce.H:1182
bool m_write_solver_rhs
if true, include velocity solver RHS in plotfiles
Definition: AmrIce.H:1314
Definition: AmrIce.H:1438
const RealVect dx(int a_level) const
Definition: AmrIce.H:454
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:1394
Real m_initial_cfl
cfl number for initial timestep (useful if initial data needs small cfl)
Definition: AmrIce.H:1092
Real m_initialGuessConstMu
Definition: AmrIce.H:950
Real computeTotalIce() const
diagnostic function – integrates thickness over domain
Definition: AmrIce.cpp:5078
virtual MuCoefficient * new_muCoefficient() const =0
factory method
Real m_dt
most recent timestep
Definition: AmrIce.H:1083
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:5010
Real m_offsetTime
Definition: AmrIce.H:1080
virtual void defineVelRHS(Vector< LevelData< FArrayBox > * > &a_vectRhs)
compute RHS for velocity field solve
Definition: AmrIce.cpp:3261
const LevelData< FArrayBox > * iceFrac(int a_level) const
return pointer to real-valued ice fraction on level a_level
Definition: AmrIce.H:534
virtual BasalFrictionRelation * getNewBasalFrictionRelation() const =0
creates a new copy of subclass objects.
bool m_is_defined
is this object initialized?
Definition: AmrIce.H:1269
bool m_tagGroundingLine
tag the grounding line
Definition: AmrIce.H:1005
SurfaceFlux & basalHeatBoundaryData() const
Definition: AmrIce.H:521
int m_finest_timestep_level
Definition: AmrIce.H:893
bool m_reduced_plot
if true, reduce the number of fields written to plot files
Definition: AmrIce.H:1293
bool m_report_discharge
if true, report discharge of solid ice from the ice edge
Definition: AmrIce.H:1235
bool m_floating_ice_stable
Definition: AmrIce.H:1350
Vector< LevelData< FArrayBox > *> m_layerSFaceXYVel
Definition: AmrIce.H:1152
virtual SurfaceFlux * new_surfaceFlux()=0
factory method: return a pointer to a new SurfaceFlux object
bool m_evolve_thickness
Definition: AmrIce.H:1337
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:2890
Virtual base class for basal friction relations.
Definition: BasalFrictionRelation.H:27
Real m_betaVal
background value for beta
Definition: AmrIce.H:1245
Notification
Definition: AmrIce.H:1438
void getHeader(const std::string &a_key, Real &a_val)
Definition: AmrIce.H:266
Vector< LevelData< FArrayBox > *> m_bA
Definition: AmrIce.H:1184
bool m_A_valid
Definition: AmrIce.H:1175
const Vector< Real > & amrDx() const
Definition: AmrIce.H:481
Vector< LevelData< FArrayBox > *> m_sA
Definition: AmrIce.H:1183
int m_check_interval
Definition: AmrIce.H:1334
Vector< LevelData< FArrayBox > * > m_deltaTopography
Definition: AmrIce.H:875
Definition: AmrIce.H:1362
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:249
virtual void writeCheckData(HDF5Handle &a_handle, int a_level)
copy level a_level checkpoint data to LevelData<FArrayBox>& a_data
Definition: AmrIce.H:1469
void setInternalEnergyBC(IceInternalEnergyIBC *a_internalEnergyIBC)
set BC for internalEnergy advection
Definition: AmrIce.cpp:1524
Stage
Definition: CalvingModel.H:28
int m_restart_step
if starting from a restart, timestep of restart
Definition: AmrIce.H:1275
Real m_fixed_dt
Definition: AmrIce.H:1369
Real m_next_report_time
Definition: AmrIce.H:1239
Real m_velocitySolveFinalResidualNorm
Definition: AmrIce.H:825
bool m_write_muCoeff
if true, include viscosity multiplier (muCoefficient) in plotfiles
Definition: AmrIce.H:1296
bool m_doInitialVelSolve
Definition: AmrIce.H:934
Real m_time
current time
Definition: AmrIce.H:1080
Definition: AmrIce.H:1438
Real m_velocitySolveInitialResidualNorm
Residual norms at the start and end of the last velocity solve.
Definition: AmrIce.H:824
bool surfaceHeatBoundaryDirichlett() const
Definition: AmrIce.H:503
void removeObserver(Observer *a_observer)
Definition: AmrIce.H:1486
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:3361
const Vector< LevelData< FluxBox > *> & faceVelocities()
access function for face-centered velocities
Definition: AmrIce.H:572
const LevelData< FArrayBox > * surfaceThicknessSource(int a_level) const
Definition: AmrIce.cpp:4423
bool m_write_presolve_plotfiles
if true, write out plotfile before doing velocity solves
Definition: AmrIce.H:1331
bool m_tagVelDx
tag where |vel| * dx > m_maxVelDxVal
Definition: AmrIce.H:1012
int m_cur_step
Definition: AmrIce.H:1101
Definition: AmrIce.H:1362
int m_num_thickness_ghost
number of ghost cells we need for m_old_thickness
Definition: AmrIce.H:809
int m_max_base_grid_size
max box size for level 0 (defaults to max_box_size)
Definition: AmrIce.H:926
const DisjointBoxLayout & grids(int a_level) const
Definition: AmrIce.H:463
bool m_do_restart
Definition: AmrIce.H:1272
Vector< LevelData< FArrayBox > *> m_viscosityCoefCell
Definition: AmrIce.H:1212
int m_velDx_tagVal_finestLevelFloating
Definition: AmrIce.H:1015
bool m_tagMargin
tag at the ice margin
Definition: AmrIce.H:1023
Vector< PatchGodunov * > m_thicknessPatchGodVect
PatchGodunov used for thickness advection – one for each level.
Definition: AmrIce.H:849
static int s_verbosity
how verbose should we be?
Definition: AmrIce.H:1266
int m_eliminate_remote_ice_max_iter
Definition: AmrIce.H:1040
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:2136
int m_temporalAccuracy
temporal accuracy
Definition: AmrIce.H:802
Real m_velRHS_tagVal
tagging value for velocity RHS
Definition: AmrIce.H:996
void updateInvalidIceFrac(Vector< LevelData< FArrayBox > *> a_iceFrac)
update covered cells, ghost cells etc, of a_iceFrac
Definition: AmrIce.cpp:3627
RateFactor * m_basalRateFactor
rate factor at base
Definition: AmrIce.H:837
Vector< int > m_covered_level
keeps track of which levels are completely covered
Definition: AmrIce.H:1074
int m_nesting_radius
proper nesting radius
Definition: AmrIce.H:916
void helmholtzSolve(Vector< LevelData< FArrayBox > * > &a_phi, const Vector< LevelData< FArrayBox > * > &a_rhs, Real a_alpha, Real a_beta) const
Definition: AmrIce.cpp:4906
Vector< LevelData< FluxBox > *> m_faceVelTotal
Definition: AmrIce.H:1150
RateFactor * m_rateFactor
rate factor
Definition: AmrIce.H:833
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:540
abstract base class for amr ice sheet models (AmrIce, AMRIceControl)
Definition: AmrIceBase.H:21
Vector< LevelData< FArrayBox > *> m_layerSFaceSVel
Definition: AmrIce.H:1153
bool m_viscousTensor_valid
Definition: AmrIce.H:1219
bool m_eliminate_remote_ice
Definition: AmrIce.H:1039
Real m_groundingLineTaggingMaxBasalFrictionCoef
threshold Basal friction coefficient at the grounding line : tag if C < value
Definition: AmrIce.H:1009
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:1290
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:815
Real m_velDx_tagVal
Definition: AmrIce.H:1013
SurfaceFlux * m_basalHeatBoundaryDataPtr
sets basal heat flux or temperature for ice sheet
Definition: AmrIce.H:868
Real m_cfl
timestep scaling
Definition: AmrIce.H:1089
const Vector< int > & refRatios() const
Definition: AmrIce.H:479
void updateCoordSysWithNewThickness(const Vector< LevelData< FArrayBox > * > &a_thickness)
Definition: AmrIce.cpp:3557
virtual void defineSolver()
initialize diagnostics
Definition: AmrIce.cpp:1530
Real m_report_time_interval
report diagnostic every m_report_time_interval years (rather than every time step) ...
Definition: AmrIce.H:1238
Vector< LevelData< FluxBox > *> m_layerXYFaceXYVel
Definition: AmrIce.H:1154
void levelSetup(int a_level, const DisjointBoxLayout &a_grids)
set up storage, etc on an AMR level
Definition: AmrIce.cpp:2693
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:1466
Real m_gravity
Definition: AmrIce.H:1121
Real m_iceDensity
Definition: AmrIce.H:1115
bool m_eliminate_remote_ice_after_regrid
Definition: AmrIce.H:1044
bool m_groundingLineProximity_valid
Definition: AmrIce.H:1228
Real m_divHGradVel_tagVal
tagging threshold value for undivided div(H grad(vel))
Definition: AmrIce.H:1002
Real m_groundingLineTaggingMinVel
threshold velocity at the grounding line : tag if |u| > value
Definition: AmrIce.H:1007
PyObject * m_tagPythonFunction
Definition: AmrIce.H:1050
void computeDischarge(const Vector< LevelData< FluxBox > * > &a_vectFluxes)
int m_velocity_solve_interval
solve the velocity problem every m_velocitySolveInterval timesteps
Definition: AmrIce.H:821
int finestLevel() const
Definition: AmrIce.H:449
bool m_check_overwrite
Definition: AmrIce.H:1283
int m_max_box_size
max box size
Definition: AmrIce.H:919
void updateIceFrac(LevelData< FArrayBox > &a_thickness, int a_level)
update real-valued ice fraction after thickness update
Definition: AmrIce.cpp:3600
SurfaceFlux * m_basalFluxPtr
sets basal flux for ice sheet
Definition: AmrIce.H:863
SurfaceFlux * m_surfaceHeatBoundaryDataPtr
sets surface heat flux or internalEnergy for ice sheet
Definition: AmrIce.H:866
const LevelData< FArrayBox > * viscousTensor(int a_level) const
Definition: AmrIce.cpp:4371
bool m_write_viscousTensor
Definition: AmrIce.H:1308
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:552
void readCheckpointFile(HDF5Handle &a_handle)
read checkpoint file for restart
Definition: AmrIceIO.cpp:1415
string m_check_prefix
Definition: AmrIce.H:1281