19 #ifndef IP_SSATAUCFORWARDPROBLEM_HH_4AEVR4Z
20 #define IP_SSATAUCFORWARDPROBLEM_HH_4AEVR4Z
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"
141 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.
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 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::Scalar * m_fixed_tauc_locations
Locations where should not be adjusted.
IPDesignVariableParameterization & m_tauc_param
The function taking to .
virtual std::shared_ptr< array::Vector > solution()
Returns the last solution of the SSA as computed by linearize_at.
bool m_rebuild_J_state
Flag indicating that the state jacobian matrix needs rebuilding.
virtual void set_tauc_fixed_locations(array::Scalar &locations)
Selects nodes where (more specifically ) should not be adjusted.
fem::Q1Element2 m_element
array::Scalar * m_zeta
Current value of zeta, provided from caller.
petsc::KSP m_ksp
KSP used in apply_linearization and apply_linearization_transpose.
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...
petsc::DM & get_da() const
Exposes the DMDA of the underlying grid for the benefit of TAO.
virtual IPDesignVariableParameterization & tauc_param()
Exposes the parameterization being used.
petsc::Mat m_J_state
Mat used in apply_linearization and apply_linearization_transpose.
virtual void assemble_residual(array::Vector &u, array::Vector &R)
Computes the residual function as defined in the class-level documentation.
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::Scalar1 DesignVecGhosted
std::shared_ptr< array::Vector > m_velocity_shared
Copy of the velocity field managed using a shared pointer.
array::Scalar DesignVec
The function space for the design variable, i.e. .
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
array::Vector1 m_du_local
Temporary storage when state vectors need to be used with ghosts.
fem::ElementIterator m_element_index
array::Vector m_du_global
Temporary storage when state vectors need to be used without ghosts.
IP_SSATaucForwardProblem(std::shared_ptr< const Grid > g, IPDesignVariableParameterization &tp)
array::Vector StateVec
The function space for the state variable, .
virtual void set_design(array::Scalar &zeta)
Sets the current value of of the design paramter .
array::Scalar1 m_dzeta_local
Storage for d_zeta with ghosts, if needed when an argument d_zeta is ghost-less.
virtual void assemble_jacobian_state(array::Vector &u, Mat J)
Assembles the state Jacobian matrix.
array::Scalar2 m_tauc_copy
Storage for tauc (avoids modifying fields obtained via pism::Vars)
virtual ~IP_SSATaucForwardProblem()=default
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