BISICLES AMR ice sheet model  0.9
IceUtility.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3 * _______ __
4 * / ___/ / ___ __ _ / / ___
5 * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6 * \___/_//_/\___/_/_/_/_.__/\___/
7 * Please refer to Copyright.txt, in Chombo's root directory.
8 */
9 #endif
10 #ifndef _ICEUTILITY_H_
11 #define _ICEUTILITY_H_
12 #include "Vector.H"
13 #include "LevelSigmaCS.H"
14 #include "ConstitutiveRelation.H"
15 #include "IceThicknessIBC.H"
16 #include "NamespaceHeader.H"
17 
19 namespace IceUtility
20 {
21 
23 
39  void computeC0(Vector<LevelData<FArrayBox>* >& a_vectC0,
40  const Vector<LevelData<FArrayBox>* >& a_vectC,
41  const Vector<DisjointBoxLayout>& a_grids,
42  const Vector<RefCountedPtr<LevelSigmaCS> >& a_coordSys,
43  const Vector<Real> a_dx, int a_finest_level);
44 
45 
46  void addWallDrag(FArrayBox& a_drag,
47  const BaseFab<int>& a_mask,
48  const FArrayBox& a_usrf,
49  const FArrayBox& a_thk,
50  const FArrayBox& a_topg,
51  const FArrayBox& a_beta,
52  const Real& a_extra,
53  const RealVect& a_dx,
54  const Box& a_box);
55 
56 
57  void addThinIceDrag(FArrayBox& a_drag,
58  const BaseFab<int>& a_mask,
59  const FArrayBox& a_thk,
60  const Real& a_extra,
61  const Real& a_thin,
62  const Box& a_box);
63 
64 
65  void defineRHS(Vector<LevelData<FArrayBox>* >& a_rhs,
66  const Vector<RefCountedPtr<LevelSigmaCS > >& a_CS,
67  const Vector<DisjointBoxLayout>& a_grids,
68  const Vector<RealVect>& a_dx);
69 
70 
72  void applyHelmOp
73  (LevelData<FArrayBox>& a_lapPhi,
74  const LevelData<FArrayBox>& a_phi,
75  const Real& a_a, const Real& a_b,
76  const DisjointBoxLayout& a_grids,
77  const RealVect& a_dx);
78 
81  void applyDiv
82  (LevelData<FArrayBox>& a_divU,
83  const LevelData<FluxBox>& a_u,
84  const DisjointBoxLayout& a_grids,
85  const RealVect& a_dx);
86 
89  void applyGradSq
90  (LevelData<FArrayBox>& a_gradPhiSq,
91  const LevelData<FArrayBox>& a_phi,
92  const DisjointBoxLayout& a_grids,
93  const RealVect& a_dx);
94 
100  (LevelData<FluxBox>& a_us,
101  const LevelData<FArrayBox>& a_u,
102  const LevelData<FArrayBox>& a_s,
103  const DisjointBoxLayout& a_grids);
104 
110  (LevelData<FluxBox>& a_us,
111  const LevelData<FluxBox>& a_u,
112  const LevelData<FArrayBox>& a_s,
113  const DisjointBoxLayout& a_grids);
114 
116  void computeA
117  (LevelData<FArrayBox>& a_A,
118  const Vector<Real>& a_sigma,
119  const LevelSigmaCS& a_coordSys,
120  const RateFactor* a_rateFactor,
121  const LevelData<FArrayBox>& a_internalEnergy);
122 
124  void extrapVelocityToMargin(LevelData<FluxBox>& a_faceVel,
125  const LevelData<FArrayBox>& a_cellVel,
126  const LevelSigmaCS& a_coordSys);
127 
130  (LevelData<FluxBox>& a_faceVelAdvection,
131  LevelData<FluxBox>& a_faceVelTotal,
132  LevelData<FluxBox>& a_faceDiffusivity,
133  LevelData<FArrayBox>& a_cellDiffusivity,
134 #if BISICLES_Z == BISICLES_LAYERED
135  LevelData<FluxBox>& a_layerXYFaceXYVel,
136  LevelData<FArrayBox>& a_layerSFaceXYVel,
137 #endif
138  const LevelData<FArrayBox>& a_velocity,
139  const LevelSigmaCS& a_coordSys,
140  const IceThicknessIBC* a_bc,
141  const LevelData<FArrayBox>& a_A,
142 #if BISICLES_Z == BISICLES_LAYERED
143  const LevelData<FArrayBox>& a_sA,
144  const LevelData<FArrayBox>& a_bA,
145 #endif
146  const LevelData<FArrayBox>* a_crseVelocity,
147  const LevelData<FArrayBox>* a_crseDiffusivity,
148  int a_nRefCrse,
149  const ConstitutiveRelation* a_constitutiveRelation,
150  bool a_additionalVelocity, bool a_implicitDiffusion);
151 
152 
154  (LevelData<FArrayBox>& a_uSigma,
155  const LevelData<FluxBox>& a_layerThicknessFlux,
156  const LevelData<FArrayBox>& a_layerSFaceXYVel,
157  const LevelData<FArrayBox>& a_dHdt,
158  const DisjointBoxLayout a_grid,
159  const LevelData<FArrayBox>& a_surfaceThicknessSource,
160  const LevelData<FArrayBox>& a_basalThicknessSource,
161  const Vector<Real>& a_dSigma,
162  const RealVect& a_dx,
163  const Real& a_dt );
164 
165 
167  int eliminateFastIce
168  (Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
169  Vector<LevelData<FArrayBox>* >& a_vel,
170  Vector<LevelData<FArrayBox>* >& a_calvedIce,
171  Vector<LevelData<FArrayBox>* >& a_addedIce,
172  Vector<LevelData<FArrayBox>* >& a_removedIce,
173  const Vector<DisjointBoxLayout>& a_grids,
174  const Vector<ProblemDomain>& a_domain,
175  const Vector<int>& a_refRatio, Real a_crseDx,
176  int a_finestLevel, int a_maxIter, Real a_thinIceTol, Real a_fastIceTol,
177  bool a_edgeOnly, int a_verbosity = 0);
178 
181  void eliminateRemoteIce
182  (Vector<RefCountedPtr<LevelSigmaCS > >& a_coordSys,
183  Vector<LevelData<FArrayBox>* >& a_vel,
184  Vector<LevelData<FArrayBox>* >& a_calvedIce,
185  Vector<LevelData<FArrayBox>* >& a_addedIce,
186  Vector<LevelData<FArrayBox>* >& a_removedIce,
187  const Vector<DisjointBoxLayout>& a_grids,
188  const Vector<ProblemDomain>& a_domain,
189  const Vector<int>& a_refRatio, Real a_crseDx,
190  int a_finestLevel, int a_maxIter, Real a_tol,
191  int a_verbosity = 0);
192 
195  (LevelData<FArrayBox>& a_u, const LevelSigmaCS& a_coords,
196  const DisjointBoxLayout& a_grids, int a_subdivision);
197 
200  (LevelData<FArrayBox>& a_C, const LevelSigmaCS& a_coords,
201  const DisjointBoxLayout& a_grids);
202 
203 }
204 
205 #include "NamespaceFooter.H"
206 #endif
void extrapVelocityToMargin(LevelData< FluxBox > &a_faceVel, const LevelData< FArrayBox > &a_cellVel, const LevelSigmaCS &a_coordSys)
extrapolate face centered velocity field (usually derived by cell-to-face average) to the margins ...
Definition: IceUtility.cpp:449
void multiplyByGroundedFraction(LevelData< FArrayBox > &a_u, const LevelSigmaCS &a_coords, const DisjointBoxLayout &a_grids, int a_subdivision)
subgrid grounding line interpolation : multiply a_u by the grounded portion of each cell ...
Definition: IceUtility.cpp:1068
Abstract class around the englacial constitutive relations for ice.
Definition: ConstitutiveRelation.H:34
IceUtility namespace : general purpose ice sheet functions common to the &#39;big&#39; classes (AmrIce...
Definition: IceUtility.H:19
rate factor A(T) in (e.g) Glen&#39;s law
Definition: ConstitutiveRelation.H:156
void computeFaceFluxUpwind(LevelData< FluxBox > &a_us, const LevelData< FluxBox > &a_u, const LevelData< FArrayBox > &a_s, const DisjointBoxLayout &a_grids)
Definition: IceUtility.cpp:230
Physical/domain initial and boundary conditions for ice-sheet problems.
Definition: IceThicknessIBC.H:84
void setFloatingBasalFriction(LevelData< FArrayBox > &a_C, const LevelSigmaCS &a_coords, const DisjointBoxLayout &a_grids)
set C = 0 in floating region, potentially using subgrid interpolation
Definition: IceUtility.cpp:1126
void computeFaceFluxCentered(LevelData< FluxBox > &a_us, const LevelData< FArrayBox > &a_u, const LevelData< FArrayBox > &a_s, const DisjointBoxLayout &a_grids)
Definition: IceUtility.cpp:207
void applyGradSq(LevelData< FArrayBox > &a_gradPhiSq, const LevelData< FArrayBox > &a_phi, const DisjointBoxLayout &a_grids, const RealVect &a_dx)
Definition: IceUtility.cpp:258
void computeA(LevelData< FArrayBox > &a_A, const Vector< Real > &a_sigma, const LevelSigmaCS &a_coordSys, const RateFactor *a_rateFactor, const LevelData< FArrayBox > &a_internalEnergy)
compute cell centered rate factor A from the temperature
Definition: IceUtility.cpp:287
Basic Sigma fourth-order coordinate system on an AMR level.
Definition: LevelSigmaCS.H:48
int eliminateFastIce(Vector< RefCountedPtr< LevelSigmaCS > > &a_coordSys, Vector< LevelData< FArrayBox > * > &a_vel, Vector< LevelData< FArrayBox > * > &a_calvedIce, Vector< LevelData< FArrayBox > * > &a_addedIce, Vector< LevelData< FArrayBox > * > &a_removedIce, const Vector< DisjointBoxLayout > &a_grids, const Vector< ProblemDomain > &a_domain, const Vector< int > &a_refRatio, Real a_crseDx, int a_finestLevel, int a_maxIter, Real a_thinIceTol, Real a_fastIceTol, bool a_edgeOnly, int a_verbosity=0)
Identify regions of fast ice and eliminate them. return the total number of cells eliminated...
Definition: IceUtility.cpp:776
void addThinIceDrag(FArrayBox &a_drag, const BaseFab< int > &a_mask, const FArrayBox &a_thk, const Real &a_extra, const Real &a_thin, const Box &a_box)
Definition: IceUtility.cpp:390
void defineRHS(Vector< LevelData< FArrayBox > * > &a_rhs, const Vector< RefCountedPtr< LevelSigmaCS > > &a_CS, const Vector< DisjointBoxLayout > &a_grids, const Vector< RealVect > &a_dx)
compute RHS for velocity field solve
Definition: IceUtility.cpp:31
void eliminateRemoteIce(Vector< RefCountedPtr< LevelSigmaCS > > &a_coordSys, Vector< LevelData< FArrayBox > * > &a_vel, Vector< LevelData< FArrayBox > * > &a_calvedIce, Vector< LevelData< FArrayBox > * > &a_addedIce, Vector< LevelData< FArrayBox > * > &a_removedIce, const Vector< DisjointBoxLayout > &a_grids, const Vector< ProblemDomain > &a_domain, const Vector< int > &a_refRatio, Real a_crseDx, int a_finestLevel, int a_maxIter, Real a_tol, int a_verbosity=0)
Definition: IceUtility.cpp:892
void computeC0(Vector< LevelData< FArrayBox > * > &a_vectC0, const Vector< LevelData< FArrayBox > * > &a_vectC, const Vector< DisjointBoxLayout > &a_grids, const Vector< RefCountedPtr< LevelSigmaCS > > &a_coordSys, const Vector< Real > a_dx, int a_finest_level)
Compute a C0 such that basal traction Tb = C0 u + f(C,u)
Definition: IceUtility.cpp:328
void computeFaceVelocity(LevelData< FluxBox > &a_faceVelAdvection, LevelData< FluxBox > &a_faceVelTotal, LevelData< FluxBox > &a_faceDiffusivity, LevelData< FArrayBox > &a_cellDiffusivity, #if BISICLES_Z==BISICLES_LAYERED LevelData< FluxBox > &a_layerXYFaceXYVel, LevelData< FArrayBox > &a_layerSFaceXYVel, #endif const LevelData< FArrayBox > &a_velocity, const LevelSigmaCS &a_coordSys, const IceThicknessIBC *a_bc, const LevelData< FArrayBox > &a_A, #if BISICLES_Z==BISICLES_LAYERED const LevelData< FArrayBox > &a_sA, const LevelData< FArrayBox > &a_bA, #endif const LevelData< FArrayBox > *a_crseVelocity, const LevelData< FArrayBox > *a_crseDiffusivity, int a_nRefCrse, const ConstitutiveRelation *a_constitutiveRelation, bool a_additionalVelocity, bool a_implicitDiffusion)
compute face-centered velocity and thickness diffusion coefficients from cell-centered velocity ...
Definition: IceUtility.cpp:527
void computeSigmaVelocity(LevelData< FArrayBox > &a_uSigma, const LevelData< FluxBox > &a_layerThicknessFlux, const LevelData< FArrayBox > &a_layerSFaceXYVel, const LevelData< FArrayBox > &a_dHdt, const DisjointBoxLayout a_grid, const LevelData< FArrayBox > &a_surfaceThicknessSource, const LevelData< FArrayBox > &a_basalThicknessSource, const Vector< Real > &a_dSigma, const RealVect &a_dx, const Real &a_dt)
compute the cross layer velocity u^sigma (the contravariant component)
Definition: IceUtility.cpp:695
void addWallDrag(FArrayBox &a_drag, const BaseFab< int > &a_mask, const FArrayBox &a_usrf, const FArrayBox &a_thk, const FArrayBox &a_topg, const FArrayBox &a_beta, const Real &a_extra, const RealVect &a_dx, const Box &a_box)
Definition: IceUtility.cpp:407
void applyDiv(LevelData< FArrayBox > &a_divU, const LevelData< FluxBox > &a_u, const DisjointBoxLayout &a_grids, const RealVect &a_dx)
Definition: IceUtility.cpp:178
void applyHelmOp(LevelData< FArrayBox > &a_lapPhi, const LevelData< FArrayBox > &a_phi, const Real &a_a, const Real &a_b, const DisjointBoxLayout &a_grids, const RealVect &a_dx)
compute the operator L phi = a * phi + b * grad^2 (phi)
Definition: IceUtility.cpp:155