BISICLES AMR ice sheet model
0.9
|
Implementation of InverseIceVelocitySolver for the vertically integrated (SSA,SSA*,L1L2) stress models. More...
#include <InverseVerticallyIntegratedVelocitySolver.H>
Classes | |
class | Configuration |
Data read through ParmParse. More... | |
Public Member Functions | |
InverseVerticallyIntegratedVelocitySolver () | |
~InverseVerticallyIntegratedVelocitySolver () | |
void | setPreviousTime (Real a_time) |
void | define (const ProblemDomain &a_coarseDomain, ConstitutiveRelation *a_constRel, BasalFrictionRelation *a_FrictionRel, const Vector< DisjointBoxLayout > &a_grids, const Vector< int > &a_refRatio, const RealVect &a_dxCrse, IceThicknessIBC *a_bc, int a_numLevels) |
(Re-)define IceVelocitySolver object for a given mesh and set of physics rules More... | |
void | define (const AmrIceBase &a_amrIce, const ProblemDomain &a_coarseDomain, ConstitutiveRelation *a_constRel, BasalFrictionRelation *a_FrictionRel, const Vector< DisjointBoxLayout > &a_grids, const Vector< int > &a_refRatio, const RealVect &a_dxCrse, IceThicknessIBC *a_bc, int a_numLevels) |
int | solve (Vector< LevelData< FArrayBox > * > &a_horizontalVel, Vector< LevelData< FArrayBox > * > &a_calvedIce, Vector< LevelData< FArrayBox > * > &a_addedIce, Vector< LevelData< FArrayBox > * > &a_removedIce, Real &a_initialResidualNorm, Real &a_finalResidualNorm, const Real a_convergenceMetric, const Vector< LevelData< FArrayBox > * > &a_rhs, const Vector< LevelData< FArrayBox > * > &a_C, const Vector< LevelData< FArrayBox > * > &a_C0, const Vector< LevelData< FArrayBox > * > &a_A, const Vector< LevelData< FArrayBox > * > &a_muCoef, Vector< RefCountedPtr< LevelSigmaCS > > &a_coordSys, Real a_time, int a_lbase, int a_maxLevel) |
Compute the horizontal, cell centered ice velocity ( u(x,y), v(x,y) ) [VERTICALLY INTEGRATED MODELS!]. More... | |
void | computeObjectiveAndGradient (Real &a_fm, Real &a_fp, Vector< LevelData< FArrayBox > * > &a_g, const Vector< LevelData< FArrayBox > * > &a_x, bool a_inner) |
void | restart () |
carry out whatver operations are required prior to a restart More... | |
void | create (Vector< LevelData< FArrayBox > * > &a_a, const Vector< LevelData< FArrayBox > * > &a_b) |
void | preCond (Vector< LevelData< FArrayBox > * > &a_s, const Vector< LevelData< FArrayBox > * > &a_r) |
void | free (Vector< LevelData< FArrayBox > *> &a_data) |
need to make this explicit More... | |
void | plus (Vector< LevelData< FArrayBox > * > &a_a, Real a_r) |
void | scale (Vector< LevelData< FArrayBox > * > &a_x, const Real a_s) |
void | assign (Vector< LevelData< FArrayBox > * > &a_y, const Vector< LevelData< FArrayBox > * > &a_x) |
void | incr (Vector< LevelData< FArrayBox > * > &y, const Vector< LevelData< FArrayBox > * > &x, Real s) |
Real | dotProduct (Vector< LevelData< FArrayBox > * > &a_y, const Vector< LevelData< FArrayBox > * > &a_x) |
int | nDoF (const Vector< LevelData< FArrayBox > * > &x) |
BasalFriction * | basalFriction () |
Create a BasalFriction object containing the solution ![]() | |
MuCoefficient * | muCoefficient () |
is the basal friction an improvement on the initial guess? More... | |
![]() | |
IceVelocitySolver () | |
virtual | ~IceVelocitySolver () |
virtual void | setVerbosity (int a_verbosity) |
virtual void | setMaxIterations (int a_max_iter) |
if relevant, set max number of solver iterations More... | |
virtual void | setTolerance (Real a_tolerance) |
if relevant, set solver tolerance More... | |
virtual bool | isDefined () |
![]() | |
virtual | ~ObjectiveWithGradient () |
virtual destructor More... | |
virtual Real | dotProduct (Vector< LevelData< FArrayBox > * > &a, const Vector< LevelData< FArrayBox > * > &b)=0 |
virtual void | computeObjectiveAndGradient (Real &fm, Real &fp, Vector< LevelData< FArrayBox > * > &g, const Vector< LevelData< FArrayBox > * > &x, bool inner)=0 |
virtual void | assign (Vector< LevelData< FArrayBox > * > &y, const Vector< LevelData< FArrayBox > * > &x)=0 |
Copy x to y. More... | |
virtual void | incr (Vector< LevelData< FArrayBox > * > &y, const Vector< LevelData< FArrayBox > * > &x, Real s)=0 |
Set y = y + s * x. More... | |
virtual void | create (Vector< LevelData< FArrayBox > * > &a, const Vector< LevelData< FArrayBox > * > &b)=0 |
resize a / allocate storage to conform with b More... | |
virtual void | scale (Vector< LevelData< FArrayBox > * > &a, const Real s)=0 |
set a = a * s More... | |
virtual void | preCond (Vector< LevelData< FArrayBox > * > &a, const Vector< LevelData< FArrayBox > * > &b)=0 |
apply precoditioner K, so a = Kb More... | |
virtual int | nDoF (const Vector< LevelData< FArrayBox > * > &x)=0 |
number of degrees-of-freedom (maximum number of iterations before restart) More... | |
Additional Inherited Members | |
![]() | |
static BasalFriction * | basalFriction (const Vector< LevelData< FArrayBox > *> &a_C, const Vector< int > &a_ratio, const RealVect &a_dxCrse) |
static MuCoefficient * | muCoefficient (const Vector< LevelData< FArrayBox > *> &a_mu, const Vector< int > &a_ratio, const RealVect &a_dxCrse) |
![]() | |
bool | m_isDefined |
int | m_verbosity |
Implementation of InverseIceVelocitySolver for the vertically integrated (SSA,SSA*,L1L2) stress models.
Computes a velocity , a basal friction coefficient
and a stiffening coefficient
which mimimises an objective function
This is essentially the inverse problem described in e.g Cornford et al, 2015, The Cryopshere.
Because and
are positive, they are expressed as
and
.
The functions f,g are composed from a few parts to:
The first part of J is minimal when the model and observed velocities match, given the form of f.
The second part is minimal when the model and observed flux divergence match. As this is often a noisy field, there is an option to smooth it
The remaining parts of are used to regularize the solution. Any or all the
can be zero. Typically, in time-independent problems only
and
are non-zero - this is Tikhonov regularization.
New to the code, and experimental, is some support for time independent problems. For now this is limited to recomputing and
to minimise a
. The factors
can be made to depend on the time-step, so that
will tend to be closer to
as
.
J is reduced in a series of nonlinear conjugate gradient (CG) iterations. To that end, the class implements the interface implied by the function template CGOptimize. The major method is computeObjectiveAndGradient, which calculates J and its directional derivatives with respect to X_0 and X_1. This function also writes the current state of the problem to hdf5 files, either every 'outer' CG iteration, or even more frequently, on every call, which will correspond to CG's 'inner' (secant) iterations
Uses JFNKSolver to solve a number of internal problems.
InverseVerticallyIntegratedVelocitySolver::InverseVerticallyIntegratedVelocitySolver | ( | ) |
InverseVerticallyIntegratedVelocitySolver::~InverseVerticallyIntegratedVelocitySolver | ( | ) |
void InverseVerticallyIntegratedVelocitySolver::assign | ( | Vector< LevelData< FArrayBox > * > & | a_y, |
const Vector< LevelData< FArrayBox > * > & | a_x | ||
) |
References incr().
Referenced by computeObjectiveAndGradient(), dotProduct(), preCond(), scale(), and solve().
|
inlinevirtual |
Create a BasalFriction object containing the solution .
Implements InverseIceVelocitySolver.
References InverseIceVelocitySolver::basalFriction().
void InverseVerticallyIntegratedVelocitySolver::computeObjectiveAndGradient | ( | Real & | a_fm, |
Real & | a_fp, | ||
Vector< LevelData< FArrayBox > * > & | a_g, | ||
const Vector< LevelData< FArrayBox > * > & | a_x, | ||
bool | a_inner | ||
) |
References assign(), IceUtility::computeFaceVelocity(), IceNonlinearViscousTensor::computeViscousTensorFace(), SurfaceFlux::evaluate(), InverseVerticallyIntegratedVelocitySolver::Configuration::log_speed, InverseVerticallyIntegratedVelocitySolver::Configuration::m_boundMethod, InverseVerticallyIntegratedVelocitySolver::Configuration::m_divuhMisfitCoefficient, InverseVerticallyIntegratedVelocitySolver::Configuration::m_divuhMisfitSmooth, InverseVerticallyIntegratedVelocitySolver::Configuration::m_dtTypical, InverseVerticallyIntegratedVelocitySolver::Configuration::m_gradCsqRegularization, InverseVerticallyIntegratedVelocitySolver::Configuration::m_gradientFactor, InverseVerticallyIntegratedVelocitySolver::Configuration::m_gradMuCoefShelfOnly, InverseVerticallyIntegratedVelocitySolver::Configuration::m_gradMuCoefsqRegularization, InverseVerticallyIntegratedVelocitySolver::Configuration::m_gradX0sqRegularization, InverseVerticallyIntegratedVelocitySolver::Configuration::m_gradX1sqRegularization, InverseVerticallyIntegratedVelocitySolver::Configuration::m_innerStepFileNameBase, InverseVerticallyIntegratedVelocitySolver::Configuration::m_lowerX0, InverseVerticallyIntegratedVelocitySolver::Configuration::m_lowerX1, InverseVerticallyIntegratedVelocitySolver::Configuration::m_optimizeX0, InverseVerticallyIntegratedVelocitySolver::Configuration::m_optimizeX1, InverseVerticallyIntegratedVelocitySolver::Configuration::m_outerStepFileNameBase, InverseVerticallyIntegratedVelocitySolver::Configuration::m_thicknessThreshold, InverseVerticallyIntegratedVelocitySolver::Configuration::m_upperX0, InverseVerticallyIntegratedVelocitySolver::Configuration::m_upperX1, InverseVerticallyIntegratedVelocitySolver::Configuration::m_velMisfitCoefficient, InverseVerticallyIntegratedVelocitySolver::Configuration::m_velMisfitType, InverseVerticallyIntegratedVelocitySolver::Configuration::m_writeInnerSteps, InverseVerticallyIntegratedVelocitySolver::Configuration::MAX_VELOCITY_MISFIT_TYPE, plus(), InverseVerticallyIntegratedVelocitySolver::Configuration::projection, scale(), IceNonlinearViscousTensor::setState(), InverseVerticallyIntegratedVelocitySolver::Configuration::speed, InverseVerticallyIntegratedVelocitySolver::Configuration::velocity, and AmrIceBase::writeAMRHierarchyHDF5().
Referenced by nDoF().
void InverseVerticallyIntegratedVelocitySolver::create | ( | Vector< LevelData< FArrayBox > * > & | a_a, |
const Vector< LevelData< FArrayBox > * > & | a_b | ||
) |
References preCond().
|
inlinevirtual |
(Re-)define IceVelocitySolver object for a given mesh and set of physics rules
a_coarseDomain | domain boundaries on the coarsest level |
a_constRel | physics rule (e.g Glen's flow law) relating englacial stress and strian-rate |
a_FrictionRel | physics rule (e.g Weertman law) relating basal stress and strain-rate |
a_vectGrids | mesh layout for each level |
a_vectGrids | refinement ratio for each level |
a_dxCrse | mesh spacing on coarsest level |
a_bc | ice thickness and velocity boundary conditions |
a_numLevels | number of mesh levels. |
Implements IceVelocitySolver.
References IceVelocitySolver::define(), and IceVelocitySolver::solve().
Referenced by AmrIce::defineSolver(), and InverseVerticallyIntegratedVelocitySolver::Configuration::parse().
void InverseVerticallyIntegratedVelocitySolver::define | ( | const AmrIceBase & | a_amrIce, |
const ProblemDomain & | a_coarseDomain, | ||
ConstitutiveRelation * | a_constRel, | ||
BasalFrictionRelation * | a_FrictionRel, | ||
const Vector< DisjointBoxLayout > & | a_grids, | ||
const Vector< int > & | a_refRatio, | ||
const RealVect & | a_dxCrse, | ||
IceThicknessIBC * | a_bc, | ||
int | a_numLevels | ||
) |
References InverseVerticallyIntegratedVelocitySolver::Configuration::parse(), and solve().
Real InverseVerticallyIntegratedVelocitySolver::dotProduct | ( | Vector< LevelData< FArrayBox > * > & | a_y, |
const Vector< LevelData< FArrayBox > * > & | a_x | ||
) |
|
inlinevirtual |
need to make this explicit
Implements ObjectiveWithGradient< Vector< LevelData< FArrayBox > *> >.
void InverseVerticallyIntegratedVelocitySolver::incr | ( | Vector< LevelData< FArrayBox > * > & | y, |
const Vector< LevelData< FArrayBox > * > & | x, | ||
Real | s | ||
) |
References dotProduct().
Referenced by assign().
|
inlinevirtual |
is the basal friction an improvement on the initial guess?
Create a MuCoefficient object containing the solution
Implements InverseIceVelocitySolver.
References InverseIceVelocitySolver::muCoefficient().
int InverseVerticallyIntegratedVelocitySolver::nDoF | ( | const Vector< LevelData< FArrayBox > * > & | x | ) |
References IceUtility::addWallDrag(), IceUtility::applyGradSq(), IceUtility::applyHelmOp(), computeObjectiveAndGradient(), IceVelocitySolver::define(), JFNKSolver::get_evil_configuration(), LevelSigmaCS::getFloatingMask(), LevelSigmaCS::getH(), LevelSigmaCS::getSurfaceHeight(), LevelSigmaCS::getTopography(), InverseVerticallyIntegratedVelocitySolver::Configuration::m_CGrestartInterval, InverseVerticallyIntegratedVelocitySolver::Configuration::m_gradCsqRegularization, InverseVerticallyIntegratedVelocitySolver::Configuration::m_gradMuCoefsqRegularization, InverseVerticallyIntegratedVelocitySolver::Configuration::m_gradX0sqRegularization, InverseVerticallyIntegratedVelocitySolver::Configuration::m_gradX1sqRegularization, InverseVerticallyIntegratedVelocitySolver::Configuration::m_lowerX0, InverseVerticallyIntegratedVelocitySolver::Configuration::m_lowerX1, JFNKSolver::Configuration::m_maxRelaxIter, JFNKSolver::Configuration::m_RelaxHang, InverseVerticallyIntegratedVelocitySolver::Configuration::m_upperX0, InverseVerticallyIntegratedVelocitySolver::Configuration::m_upperX1, ReflectGhostCells(), IceUtility::setFloatingBasalFriction(), and JFNKSolver::solve().
void InverseVerticallyIntegratedVelocitySolver::plus | ( | Vector< LevelData< FArrayBox > * > & | a_a, |
Real | a_r | ||
) |
References scale().
Referenced by computeObjectiveAndGradient(), preCond(), and solve().
void InverseVerticallyIntegratedVelocitySolver::preCond | ( | Vector< LevelData< FArrayBox > * > & | a_s, |
const Vector< LevelData< FArrayBox > * > & | a_r | ||
) |
|
inlinevirtual |
carry out whatver operations are required prior to a restart
Implements ObjectiveWithGradient< Vector< LevelData< FArrayBox > *> >.
void InverseVerticallyIntegratedVelocitySolver::scale | ( | Vector< LevelData< FArrayBox > * > & | a_x, |
const Real | a_s | ||
) |
References assign().
Referenced by computeObjectiveAndGradient(), dotProduct(), and plus().
|
inlinevirtual |
Implements InverseIceVelocitySolver.
|
virtual |
Compute the horizontal, cell centered ice velocity ( u(x,y), v(x,y) ) [VERTICALLY INTEGRATED MODELS!].
a_horizontalVel | on input an initial guess ( u_0(x,y), v_0(x,y) ), on output ( u(x,y), v(x,y) ) |
a_initialResidualNorm | residual norm given the initial guess |
a_finalResidualNorm | residual norm at the end of the calculation |
a_convergenceMetric | desired a_finalResidualNorm/a_initialResidualNorm |
a_rhs | right hand side of the stress balance equation: the driving stress (x,y) components |
a_C | main basal friction coefficient : ![]() |
a_C0 | auxilliary basal friction coefficient : ![]() |
a_A | flow rate factor: one component per layer |
a_muCoef | stiffness factor: one component |
a_coordSys | ice sheet geoemtry |
a_time | current time |
a_lbase | lowest mesh level (probably doesn't work!) |
a_maxLevel | highest mesh level |
Implements IceVelocitySolver.
References assign(), CGOptimize(), SurfaceFlux::evaluate(), InverseVerticallyIntegratedVelocitySolver::Configuration::m_CGhang, InverseVerticallyIntegratedVelocitySolver::Configuration::m_CGmaxIter, InverseVerticallyIntegratedVelocitySolver::Configuration::m_CGsecantMaxIter, InverseVerticallyIntegratedVelocitySolver::Configuration::m_CGsecantParameter, InverseVerticallyIntegratedVelocitySolver::Configuration::m_CGsecantStepMaxGrow, InverseVerticallyIntegratedVelocitySolver::Configuration::m_CGsecantTol, InverseVerticallyIntegratedVelocitySolver::Configuration::m_CGtol, InverseVerticallyIntegratedVelocitySolver::Configuration::m_divuhObs_a, InverseVerticallyIntegratedVelocitySolver::Configuration::m_divuhObs_c, InverseVerticallyIntegratedVelocitySolver::Configuration::m_initialLowerC, InverseVerticallyIntegratedVelocitySolver::Configuration::m_initialLowerMuCoef, InverseVerticallyIntegratedVelocitySolver::Configuration::m_initialUpperC, InverseVerticallyIntegratedVelocitySolver::Configuration::m_initialUpperMuCoef, InverseVerticallyIntegratedVelocitySolver::Configuration::m_minLevelForOptimization, InverseVerticallyIntegratedVelocitySolver::Configuration::m_minTimeBetweenOptimizations, InverseVerticallyIntegratedVelocitySolver::Configuration::m_velObs_c, InverseVerticallyIntegratedVelocitySolver::Configuration::m_velObs_x, InverseVerticallyIntegratedVelocitySolver::Configuration::m_velObs_y, and plus().
Referenced by define().