BISICLES AMR ice sheet model
0.9
|
#include <PetscIceSolver.H>
Public Member Functions | |
PetscIceSolver () | |
virtual | ~PetscIceSolver () |
virtual void | define (const ProblemDomain &a_coarseDomain, ConstitutiveRelation *a_constRel, BasalFrictionRelation *a_basalFrictionRel, const Vector< DisjointBoxLayout > &a_vectGrids, const Vector< int > &a_vectRefRatio, 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 | setSolverType (int a_solver_type) |
void | setTolerance (Real a_tolerance) |
if relevant, set solver tolerance More... | |
void | setAbsoluteTolerance (Real a_tolerance) |
void | setMaxIterations (int a_max_iter) |
if relevant, set max number of solver iterations More... | |
void | setVerbosity (int a_verbosity) |
void | computeAMRResidual (Vector< RefCountedPtr< LevelData< FArrayBox > > > &a_resid, const Vector< LevelData< FArrayBox > * > &a_horizontalVel, const Vector< LevelData< FArrayBox > * > &a_rhs, int a_lbase, int a_maxLevel) |
void | computeAMRResidualLevel (Vector< RefCountedPtr< LevelData< FArrayBox > > > &a_resid, const Vector< LevelData< FArrayBox > * > &a_horizontalVel, const Vector< LevelData< FArrayBox > * > &a_rhs, int a_lbase, int a_maxLevel, int a_ilev) |
virtual 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) |
solve for isothermal ice More... | |
void | picardSolve_private (int a_ilev, LevelData< FArrayBox > &a_horizontalVel, const LevelData< FArrayBox > &a_rhs, Real a_norm0, Real &a_norm, int a_numIts, int &a_it) |
void | jfnkSolve_private (int a_ilev, LevelData< FArrayBox > &a_horizontalVel, const LevelData< FArrayBox > &a_rhs, Real a_norm0, int a_numIts, int &a_it) |
void | computeMu (LevelData< FArrayBox > &a_horizontalVel, const LevelData< FluxBox > &a_A, const LevelData< FluxBox > &a_muCoef, const RefCountedPtr< LevelSigmaCS > &a_coordSys, LevelData< FArrayBox > *crseVelPtr, LevelData< FArrayBox > *fineVelPtr, int a_ilev, Real a_time) |
virtual void | updateCoefs (LevelData< FArrayBox > &a_horizontalVel, int) |
void | AMRProlong (LevelData< FArrayBox > &a_fineU, const LevelData< FArrayBox > &a_CrsU, LevelData< FArrayBox > &a_CrsCover, Copier a_copier, int a_refRatio) |
![]() | |
IceVelocitySolver () | |
virtual | ~IceVelocitySolver () |
virtual bool | isDefined () |
Public Attributes | |
Vector< ProblemDomain > | m_domains |
RefCountedPtr< ViscousTensorOpFactory > | m_opFactoryPtr |
Vector< RefCountedPtr< ViscousTensorOp > > | m_op |
RefCountedPtr< LevelData< FArrayBox > > | m_twork1 |
RefCountedPtr< LevelData< FArrayBox > > | m_twork2 |
RefCountedPtr< LevelData< FluxBox > > | m_tfaceA |
LevelData< FArrayBox > * | m_tcrseVel |
LevelData< FArrayBox > * | m_tphi0 |
RefCountedPtr< LevelData< FluxBox > > | m_tmuCoef |
RefCountedPtr< LevelSigmaCS > | m_tcoordSys |
Real | m_ttime |
Vector< RefCountedPtr< LevelData< FArrayBox > > > | m_fineCover |
Vector< Copier > | m_restCopier |
Vector< Copier > | m_projCopier |
Protected Member Functions | |
void | defineOpFactory (RealVect, const ProblemDomain &, int) |
define operator factory. In 2D, this is a ViscousTensorOp. More... | |
void | getOperatorScaleFactors (Real &a_alpha, Real &a_beta) const |
get ViscousTensorOp scaling factors (alpha and beta) More... | |
Protected Attributes | |
ConstitutiveRelation * | m_constRelPtr |
BasalFrictionRelation * | m_basalFrictionRelPtr |
Vector< DisjointBoxLayout > | m_grids |
Real | m_vtopSafety |
int | m_verbosity |
bool | m_isOpDefined |
bool | m_isSolverDefined |
IceThicknessIBC * | m_bc |
int | m_max_its |
Real | m_rtol |
Real | m_atol |
int | m_minPicardIterations |
int | m_amr_max_level |
bool | m_plotResidual |
Vector< int > | m_refRatios |
Vector< RefCountedPtr< LevelData< FluxBox > > > | m_Mu |
Vector< RefCountedPtr< LevelData< FluxBox > > > | m_Lambda |
Vector< const LevelData< FArrayBox > * > | m_Beta |
Vector< const LevelData< FArrayBox > * > | m_Beta0 |
Vector< RefCountedPtr< LevelData< FArrayBox > > > | m_C |
Real | m_constThetaVal |
![]() | |
bool | m_isDefined |
int | m_verbosity |
virtual class to manage the nonlinear solve for the ice-sheet momentum This is a virtual base class to facilitate the implementation of different solution algorithms.
PetscIceSolver::PetscIceSolver | ( | ) |
default is "lazy gsrb"
References m_amr_max_level, m_atol, m_basalFrictionRelPtr, m_bc, m_constRelPtr, m_constThetaVal, m_isOpDefined, m_max_its, m_minPicardIterations, m_plotResidual, m_rtol, and m_vtopSafety.
|
virtual |
References m_bc.
void PetscIceSolver::AMRProlong | ( | LevelData< FArrayBox > & | a_fineU, |
const LevelData< FArrayBox > & | a_CrsU, | ||
LevelData< FArrayBox > & | a_CrsCover, | ||
Copier | a_copier, | ||
int | a_refRatio | ||
) |
void PetscIceSolver::computeAMRResidual | ( | Vector< RefCountedPtr< LevelData< FArrayBox > > > & | a_resid, |
const Vector< LevelData< FArrayBox > * > & | a_horizontalVel, | ||
const Vector< LevelData< FArrayBox > * > & | a_rhs, | ||
int | a_lbase, | ||
int | a_maxLevel | ||
) |
References computeAMRResidualLevel().
Referenced by setVerbosity().
void PetscIceSolver::computeAMRResidualLevel | ( | Vector< RefCountedPtr< LevelData< FArrayBox > > > & | a_resid, |
const Vector< LevelData< FArrayBox > * > & | a_horizontalVel, | ||
const Vector< LevelData< FArrayBox > * > & | a_rhs, | ||
int | a_lbase, | ||
int | a_maxLevel, | ||
int | a_ilev | ||
) |
References m_op.
Referenced by computeAMRResidual(), and setVerbosity().
void PetscIceSolver::computeMu | ( | LevelData< FArrayBox > & | a_horizontalVel, |
const LevelData< FluxBox > & | a_A, | ||
const LevelData< FluxBox > & | a_muCoef, | ||
const RefCountedPtr< LevelSigmaCS > & | a_coordSys, | ||
LevelData< FArrayBox > * | crseVelPtr, | ||
LevelData< FArrayBox > * | fineVelPtr, | ||
int | a_ilev, | ||
Real | a_time | ||
) |
References BasalFrictionRelation::computeAlpha(), ConstitutiveRelation::computeFaceMu(), LevelSigmaCS::getFaceH(), m_basalFrictionRelPtr, m_bc, m_Beta, m_Beta0, m_C, m_constRelPtr, m_domains, m_grids, m_Lambda, m_Mu, m_refRatios, and IceThicknessIBC::velocityGhostBC().
Referenced by solve(), and updateCoefs().
|
virtual |
(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 defineOpFactory(), getOperatorScaleFactors(), m_basalFrictionRelPtr, m_bc, m_Beta, m_Beta0, m_C, m_constRelPtr, m_domains, m_fineCover, m_grids, m_Lambda, m_Mu, m_op, m_opFactoryPtr, m_projCopier, m_refRatios, m_restCopier, nc, and IceThicknessIBC::new_thicknessIBC().
|
protected |
define operator factory. In 2D, this is a ViscousTensorOp.
References getOperatorScaleFactors(), m_bc, m_C, m_grids, m_isOpDefined, m_Lambda, m_Mu, m_opFactoryPtr, m_refRatios, m_vtopSafety, and IceThicknessIBC::velocitySolveBC().
Referenced by define().
|
protected |
get ViscousTensorOp scaling factors (alpha and beta)
put this in a function because we need them in two separate places
Referenced by define(), defineOpFactory(), jfnkSolve_private(), picardSolve_private(), and solve().
void PetscIceSolver::jfnkSolve_private | ( | int | a_ilev, |
LevelData< FArrayBox > & | a_horizontalVel, | ||
const LevelData< FArrayBox > & | a_rhs, | ||
Real | a_norm0, | ||
int | a_numIts, | ||
int & | a_it | ||
) |
References FormFunction(), FormJacobian(), getOperatorScaleFactors(), m_atol, m_C, m_Lambda, m_Mu, m_op, and m_rtol.
Referenced by setVerbosity(), and solve().
void PetscIceSolver::picardSolve_private | ( | int | a_ilev, |
LevelData< FArrayBox > & | a_horizontalVel, | ||
const LevelData< FArrayBox > & | a_rhs, | ||
Real | a_norm0, | ||
Real & | a_norm, | ||
int | a_numIts, | ||
int & | a_it | ||
) |
References getOperatorScaleFactors(), m_C, m_Lambda, m_max_its, m_Mu, m_op, m_rtol, m_verbosity, and updateCoefs().
Referenced by setVerbosity(), and solve().
|
inline |
If norm(residual) drops below the absolute tolerance (regardless of the initial residual), we declare ourselves "done" – this is a simple way to avoid solver hangs.
References m_atol.
|
inlinevirtual |
if relevant, set max number of solver iterations
default implementation does nothing – it's assumed that derived classes will implement this in a meaningful way
Reimplemented from IceVelocitySolver.
References m_max_its.
|
inline |
|
inlinevirtual |
if relevant, set solver tolerance
default implementation does nothing – it's assumed that derived classes will implement this in a meaningful way
Reimplemented from IceVelocitySolver.
References m_rtol.
|
inlinevirtual |
Reimplemented from IceVelocitySolver.
References computeAMRResidual(), computeAMRResidualLevel(), jfnkSolve_private(), m_verbosity, picardSolve_private(), and solve().
|
virtual |
solve for isothermal ice
beta scales sliding coefficient C – acoef in terms of the ViscousTensorOp
Implements IceVelocitySolver.
References computeMu(), MultilevelIceVelOp::define(), IceVelocitySolver::define(), getOperatorScaleFactors(), jfnkSolve_private(), m_amr_max_level, m_basalFrictionRelPtr, m_bc, m_Beta, m_Beta0, m_C, m_constRelPtr, m_domains, m_fineCover, m_grids, m_isOpDefined, m_Lambda, m_max_its, m_minPicardIterations, m_Mu, m_op, m_opFactoryPtr, m_plotResidual, m_refRatios, m_restCopier, m_rtol, m_tcoordSys, m_tcrseVel, m_tfaceA, m_tmuCoef, m_tphi0, m_ttime, m_twork1, m_twork2, m_verbosity, nc, picardSolve_private(), JFNKSolver::solve(), and updateCoefs().
Referenced by setVerbosity().
|
virtual |
References computeMu(), m_tcoordSys, m_tcrseVel, m_tfaceA, m_tmuCoef, and m_ttime.
Referenced by FormFunction(), picardSolve_private(), and solve().
|
protected |
Referenced by PetscIceSolver(), and solve().
|
protected |
Referenced by jfnkSolve_private(), PetscIceSolver(), and setAbsoluteTolerance().
|
protected |
Referenced by computeMu(), define(), PetscIceSolver(), and solve().
|
protected |
Referenced by computeMu(), define(), defineOpFactory(), PetscIceSolver(), solve(), and ~PetscIceSolver().
|
protected |
Referenced by computeMu(), define(), and solve().
|
protected |
Referenced by computeMu(), define(), and solve().
|
protected |
Referenced by computeMu(), define(), defineOpFactory(), jfnkSolve_private(), picardSolve_private(), and solve().
|
protected |
Referenced by computeMu(), define(), PetscIceSolver(), and solve().
|
protected |
Referenced by PetscIceSolver().
Vector<ProblemDomain> PetscIceSolver::m_domains |
Referenced by computeMu(), define(), and solve().
Vector<RefCountedPtr<LevelData<FArrayBox> > > PetscIceSolver::m_fineCover |
|
protected |
Referenced by computeMu(), define(), defineOpFactory(), and solve().
|
protected |
Referenced by defineOpFactory(), PetscIceSolver(), and solve().
|
protected |
|
protected |
Referenced by computeMu(), define(), defineOpFactory(), jfnkSolve_private(), picardSolve_private(), and solve().
|
protected |
Referenced by PetscIceSolver(), picardSolve_private(), setMaxIterations(), and solve().
|
protected |
Referenced by PetscIceSolver(), and solve().
|
protected |
Referenced by computeMu(), define(), defineOpFactory(), jfnkSolve_private(), picardSolve_private(), and solve().
Vector<RefCountedPtr<ViscousTensorOp> > PetscIceSolver::m_op |
Referenced by computeAMRResidualLevel(), define(), FormFunction(), jfnkSolve_private(), picardSolve_private(), and solve().
RefCountedPtr<ViscousTensorOpFactory> PetscIceSolver::m_opFactoryPtr |
Referenced by define(), defineOpFactory(), and solve().
|
protected |
Referenced by PetscIceSolver(), and solve().
Vector<Copier> PetscIceSolver::m_projCopier |
Referenced by define().
|
protected |
Referenced by computeMu(), define(), defineOpFactory(), and solve().
|
protected |
Referenced by jfnkSolve_private(), PetscIceSolver(), picardSolve_private(), setTolerance(), and solve().
RefCountedPtr<LevelSigmaCS> PetscIceSolver::m_tcoordSys |
Referenced by solve(), and updateCoefs().
LevelData<FArrayBox>* PetscIceSolver::m_tcrseVel |
Referenced by solve(), and updateCoefs().
RefCountedPtr<LevelData<FluxBox> > PetscIceSolver::m_tfaceA |
Referenced by solve(), and updateCoefs().
RefCountedPtr<LevelData<FluxBox> > PetscIceSolver::m_tmuCoef |
Referenced by solve(), and updateCoefs().
LevelData<FArrayBox>* PetscIceSolver::m_tphi0 |
Referenced by FormFunction(), and solve().
Real PetscIceSolver::m_ttime |
Referenced by solve(), and updateCoefs().
RefCountedPtr<LevelData<FArrayBox> > PetscIceSolver::m_twork1 |
Referenced by FormFunction(), and solve().
RefCountedPtr<LevelData<FArrayBox> > PetscIceSolver::m_twork2 |
Referenced by FormFunction(), and solve().
|
protected |
Referenced by picardSolve_private(), setVerbosity(), and solve().
|
protected |
Referenced by defineOpFactory(), and PetscIceSolver().