19 #ifndef IP_SSAHARDAVFORWARDPROBLEM_HH_HAD68BK7
20 #define IP_SSAHARDAVFORWARDPROBLEM_HH_HAD68BK7
22 #include "pism/stressbalance/ssa/SSAFEM.hh"
23 #include "pism/inverse/IPDesignVariableParameterization.hh"
24 #include "pism/util/petscwrappers/KSP.hh"
25 #include "pism/util/petscwrappers/Mat.hh"
138 virtual std::shared_ptr<array::Vector>
solution() {
This class represents a 2D vector field (such as ice velocity) at a certain grid point.
Manages iterating over element indices.
Q1 element with sides parallel to X and Y axes.
petsc::Mat m_J_state
Mat used in apply_linearization and apply_linearization_transpose.
virtual std::shared_ptr< array::Vector > solution()
Returns the last solution of the SSA as computed by linearize_at.
virtual IPDesignVariableParameterization & design_param()
Exposes the design variable parameterization being used.
virtual ~IP_SSAHardavForwardProblem()=default
virtual void assemble_residual(array::Vector &u, array::Vector &R)
Computes the residual function as defined in the class-level documentation.
virtual void apply_jacobian_design_transpose(array::Vector &u, array::Vector &du, array::Scalar &dzeta)
Applies the transpose of the design Jacobian matrix to a perturbation of the state variable.
array::Vector m_du_global
Temporary storage when state vectors need to be used without ghosts.
array::Scalar1 DesignVecGhosted
virtual void apply_linearization(array::Scalar &dzeta, array::Vector &du)
Applies the linearization of the forward map (i.e. the reduced gradient described in the class-level...
virtual void assemble_jacobian_state(array::Vector &u, Mat J)
Assembles the state Jacobian matrix.
IPDesignVariableParameterization & m_design_param
The function taking to .
array::Scalar DesignVec
The function space for the design variable, i.e. .
array::Scalar1 m_hardav
Vertically-averaged ice hardness.
array::Scalar * m_fixed_design_locations
Locations where should not be adjusted.
petsc::DM & get_da() const
Exposes the DMDA of the underlying grid for the benefit of TAO.
array::Scalar1 m_dzeta_local
Storage for d_zeta with ghosts, if needed when an argument d_zeta is ghost-less.
virtual void set_design_fixed_locations(array::Scalar &locations)
Selects nodes where (more specifically ) should not be adjusted.
const int m_stencil_width
IP_SSAHardavForwardProblem(std::shared_ptr< const Grid > g, IPDesignVariableParameterization &tp)
Constructs from the same objects as SSAFEM, plus a specification of how is parameterized.
fem::ElementIterator m_element_index
std::shared_ptr< array::Vector > m_velocity_shared
array::Vector StateVec
The function space for the state variable, .
virtual void apply_jacobian_design(array::Vector &u, array::Scalar &dzeta, array::Vector &du)
Applies the design Jacobian matrix to a perturbation of the design variable.
virtual std::shared_ptr< TerminationReason > linearize_at(array::Scalar &zeta)
Sets the current value of the design variable and solves the SSA to find the associated .
array::Scalar * m_zeta
Current value of zeta, provided from caller.
bool m_rebuild_J_state
Flag indicating that the state jacobian matrix needs rebuilding.
virtual void apply_linearization_transpose(array::Vector &du, array::Scalar &dzeta)
Applies the transpose of the linearization of the forward map (i.e. the transpose of the reduced grad...
SNESConvergedReason m_reason
virtual void set_design(array::Scalar &zeta)
Sets the current value of of the design paramter .
fem::Q1Element2 m_element
array::Vector1 m_du_local
Temporary storage when state vectors need to be used with ghosts.
petsc::KSP m_ksp
KSP used in apply_linearization and apply_linearization_transpose.
Implements the forward problem of the map taking to the corresponding solution of the SSA.
PISM's SSA solver: the finite element method implementation written by Jed and David.
std::shared_ptr< petsc::DM > m_da
array::Vector2 m_velocity