Implements the callback for computing the residual.
Compute the residual
\[r_{ij}= G(x, \psi_{ij}) \]
where \(G\) is the weak form of the SSA, \(x\) is the current approximate solution, and the \(\psi_{ij}\) are test functions.
The weak form of the SSA system is
Definition at line 726 of file SSAFEM.cc.
References pism::fem::Element2::add_contribution(), pism::ParallelSection::check(), pism::fem::Element::chi(), pism::fem::DirichletData::constrain(), pism::stressbalance::SSA::driving_stress(), pism::fem::Germ::dx, pism::fem::Germ::dy, pism::fem::ELEMENT_EXTERIOR, pism::fem::ELEMENT_Q, pism::fem::element_type(), pism::fem::DirichletData_Vector::enforce(), pism::fem::Element2::evaluate(), explicit_driving_stress(), pism::ParallelSection::failed(), pism::fem::DirichletData_Vector::fix_residual(), pism::fem::DirichletData_Vector::fix_residual_homogeneous(), pism::k, m_bc_mask, m_bc_values, m_boundary_integral, m_coefficients, pism::Component::m_config, m_dirichletScale, m_driving_stress_x, m_driving_stress_y, m_element_index, pism::Component::m_grid, m_node_type, m_q1_element, pism::fem::MAX_QUADRATURE_SIZE, monitor_function(), pism::fem::Element::n_chi(), pism::fem::q1::n_chi, pism::fem::Element::n_pts(), pism::fem::Element2::nodal_values(), PointwiseNuHAndBeta(), quad_point_values(), pism::fem::Element2::reset(), pism::Vector2d::u, pism::Vector2d::v, pism::fem::Germ::val, pism::fem::Element::weight(), pism::fem::ElementIterator::xm, pism::fem::ElementIterator::xs, pism::fem::ElementIterator::ym, and pism::fem::ElementIterator::ys.
Referenced by pism::inverse::IP_SSAHardavForwardProblem::assemble_residual(), pism::inverse::IP_SSATaucForwardProblem::assemble_residual(), and function_callback().