31 #include "libmesh/petsc_macro.h" 32 #include "libmesh/libmesh_config.h" 36 #ifdef LIBMESH_HAVE_PETSC // 11111111111111111111111111111111 44 #include "libmesh/equation_systems.h" 45 #include "libmesh/parallel_object.h" 46 #include "libmesh/reference_counted_object.h" 50 EXTERN_C_FOR_PETSC_BEGIN
51 # include <petscksp.h> 52 EXTERN_C_FOR_PETSC_END
55 using libMesh::EquationSystems;
56 using libMesh::ReferenceCountedObject;
57 using libMesh::ParallelObject;
78 class StokesSolver :
public ReferenceCountedObject<StokesSolver>,
84 StokesSolver(EquationSystems& es_stokes);
88 StokesSolver(EquationSystems& es_stokes,
89 const StokesSolverType solver_type);
100 void init_ksp_solver();
106 const bool is_ksp_initialized()
const {
return _is_init; }
112 void set_solver_type(
const StokesSolverType solver_type);
126 void build_is(IS *is_v,
134 void setup_schur_pc(KSP ksp,
148 void setup_approx_schur_matrix(IS is_v,
157 const unsigned int n_linear_iterations()
const;
163 const Real final_linear_residual()
const;
169 void petsc_view_is(IS is_p)
const;
170 void petsc_view_vector(Vec vector)
const;
171 void petsc_view_matrix(Mat matix)
const;
177 EquationSystems& _equation_systems;
180 StokesSolverType _solver_type;
205 #endif // #ifdef LIBMESH_HAVE_PETSC // 11111111111111111111111111111111