31 std::vector<int64_t> nodal_nnz_in_diag;
32 std::vector<int64_t> nodal_nnz_off_diag;
40 A_, nodal_nnz_in_diag, nodal_nnz_off_diag);
61 KSPCreate(PETSC_COMM_WORLD, &
ksp_);
63 KSPSetType(
ksp_, KSPCG);
72 PCSetType(pc, PCHYPRE);
74 PCHYPRESetType(pc,
"boomeramg");
75 std::vector<std::string> pc_options = {
76 "pc_hypre_boomeramg_agg_nl 1",
77 "pc_hypre_boomeramg_P_max 4",
78 "pc_hypre_boomeramg_grid_sweeps_coarse 1",
79 "pc_hypre_boomeramg_max_levels 25",
80 "pc_hypre_boomeramg_relax_type_all symmetric-SOR/Jacobi",
81 "pc_hypre_boomeramg_coarsen_type HMIS",
82 "pc_hypre_boomeramg_interp_type ext+i"};
85 pc_options.emplace_back(
"pc_hypre_boomeramg_strong_threshold 0.6");
87 pc_options.emplace_back(
"pc_hypre_boomeramg_strong_threshold 0.8");
89 for (
const auto& option : pc_options)
90 PetscOptionsInsertString(
nullptr, (
"-" +
text_name_ + option).c_str());
95 KSPSetFromOptions(
ksp_);
static chi::MPI_Info & mpi
LogStream Log(LOG_LVL level=LOG_0)
virtual std::vector< int64_t > GetGhostDOFIndices(const UnknownManager &unknown_manager) const =0
virtual void BuildSparsityPattern(std::vector< int64_t > &nodal_nnz_in_diag, std::vector< int64_t > &nodal_nnz_off_diag, const UnknownManager &unknown_manager) const =0
virtual size_t GetNumGhostDOFs(const UnknownManager &unknown_manager) const =0
MeshAttributes Attributes() const
struct lbs::acceleration::DiffusionSolver::Options options
const bool requires_ghosts_
const chi_math::SpatialDiscretization & sdm_
const int64_t num_local_dofs_
const chi_math::UnknownManager uk_man_
const chi_mesh::MeshContinuum & grid_
const std::string text_name_
const int64_t num_global_dofs_
void InitMatrixSparsity(Mat &A, const std::vector< int64_t > &nodal_nnz_in_diag, const std::vector< int64_t > &nodal_nnz_off_diag)
Vec CreateVectorWithGhosts(int64_t local_size, int64_t global_size, int64_t nghosts, const std::vector< int64_t > &ghost_indices)
Mat CreateSquareMatrix(int64_t local_size, int64_t global_size)
Vec CreateVector(int64_t local_size, int64_t global_size)
int max_iters
Maximum iterations.
double residual_tolerance
Residual tol. relative to rhs.
bool verbose
Verbosity flag.
std::string additional_options_string