15 Chi::log.
Log() <<
"\nExecuting CFEM Multigroup Diffusion solver";
54 unsigned int thermal_iteration = 0;
56 int64_t max_thermal_iters =
basic_options_(
"max_thermal_iters").IntegerValue();
58 double thermal_tol =
basic_options_(
"thermal_flux_tolerance").FloatValue();
60 double thermal_error_all;
61 double thermal_error_g;
65 thermal_error_all = 0.0;
78 thermal_error_all = std::max(thermal_error_all,thermal_error_g);
89 Chi::log.
Log() <<
" --thermal iteration = " << std::setw(5) << std::right << thermal_iteration
90 <<
", Error=" << std::setw(11) << std::right << std::scientific << std::setprecision(7)
91 << thermal_error_all << std::endl;
95 while ( (thermal_error_all > thermal_tol) &&
96 (thermal_iteration < max_thermal_iters) );
100 if (thermal_error_all < thermal_tol)
101 std::cout <<
"\nThermal iterations converged for fixed-source problem" << std::endl;
103 std::cout <<
"\nThermal iterations NOT converged for fixed-source problem" << std::endl;
107 Chi::log.
Log() <<
"Done solving multi-group diffusion";
LogStream Log(LOG_LVL level=LOG_0)
std::string TextName() const
BasicOptions basic_options_
void Update_Flux_With_TwoGrid(int64_t iverbose)
void Assemble_RHS_TwoGrid(int64_t iverbose)
KSPAppContext my_app_context_
std::vector< Vec > x_old_
void UpdateFieldFunctions()
void Assemble_RHS(unsigned int g, int64_t iverbose)
chi_math::PETScUtils::PETScSolverSetup petsc_solver_
void SolveOneGroupProblem(unsigned int g, int64_t iverbose)
PETScSolverSetup CreateCommonKrylovSolverSetup(Mat ref_matrix, const std::string &in_solver_name="KSPSolver", const std::string &in_solver_type=KSPGMRES, const std::string &in_preconditioner_type=PCNONE, double in_relative_residual_tolerance=1.0e-6, int64_t in_maximum_iterations=100)
PetscErrorCode MGKSPMonitor(KSP ksp, PetscInt n, PetscReal rnorm, void *)