1 #include "../include/restart_nonlinear_problem_diff.h"
12 const unsigned int step_number)
25 for (std::map <unsigned int, unsigned int>::iterator pos =
indices_map.begin(); pos !=
indices_map.end(); ++pos)
38 cout<<
"Restart problem residual "<<endl;
39 unsigned int count = 0;
54 dst(count) = src_yy(count) - src_yy(count+2)*t(0)/t(2);
57 dst(count) = src_yy(count) - src_yy(count+1)*t(1)/t(2);
86 cout<<
"Restart problem nonlin residual: "<<dst.
l2_norm()<<endl;
104 cout<<
"Restart problem jacobian"<<endl;
107 unsigned int count = 0;
200 prec_direct.
vmult(dst,src);
virtual int setup_jacobian_prec(const Vector< double > &src_yy)
Setup Jacobian preconditioner for Newton.
std::set< unsigned int > rigid_modes_indices
void vmult(OutVector &dst, const InVector &src) const
real_type l2_norm() const
SparseMatrix< double > jacobian_matrix
DoFHandler< dim-1, dim > vector_dh
void set(const size_type i, const size_type j, const number value)
virtual int jacobian_prec(Vector< double > &dst, const Vector< double > &src_yy, const Vector< double > &src)
Jacobian inverse preconditioner vector product for newton solver.
virtual int jacobian_prec_prod(Vector< double > &dst, const Vector< double > &src_yy, const Vector< double > &src)
Jacobian preconditioner vector product for newton solver.
std::set< unsigned int > bow_stern_indices
virtual int residual(Vector< double > &dst, const Vector< double > &src_yy)
For newton solver, we need a residual function.
std::set< unsigned int > water_indices
std::set< unsigned int > water_line_indices
virtual unsigned int n_dofs() const
Returns the number of degrees of freedom.
const NumericalTowingTank & comp_dom
Vector< double > & free_surf_y
Vector< double > free_surf_res
types::global_dof_index n_dofs() const
std::map< unsigned int, unsigned int > indices_map
const SparseMatrix< double > & free_surf_jacobian_dot
FreeSurface< 3 > & free_surface
const SparsityPattern & get_sparsity_pattern() const
void initialize(const SparsityPattern &sparsity_pattern)
int residual_and_jacobian(const double t, Vector< double > &dst, const Vector< double > &src_yy, const Vector< double > &src_yp, const Vector< double > &src, const double alpha, const bool is_jacobian)
This function computes either DAE residual or corrensponding Jacobian matrix vector product with vect...
virtual int jacobian(Vector< double > &dst, const Vector< double > &src_yy, const Vector< double > &src)
Jacobian vector product for newton solver.
std::set< unsigned int > phi_indices
virtual void output_step(Vector< double > &solution, const unsigned int step_number)
This function is called at the end of each iteration step for the newton solver.
Vector< double > free_surf_jac_x_delta
Vector< double > & free_surf_y_dot
std::vector< Point< 3 > > iges_normals
Vector< double > edges_tangents
DoFHandler< dim-1, dim > dh
void vmult(Vector< double > &dst, const Vector< double > &src) const