20 <<
"No materials added to simulation. Add materials.";
27 if (!suppress_assembly)
29 <<
TextName() <<
": Assembling A locally";
33 auto fem_method =
basic_options_(
"discretization_method").StringValue();
34 if (fem_method ==
"PWLC")
36 if (!suppress_assembly)
41 else if (fem_method ==
"PWLD_MIP")
43 if (!suppress_assembly)
53 <<
"Diffusion Solver: Finite Element Discretization "
54 "method not specified.";
58 if (!suppress_assembly)
60 <<
TextName() <<
": Done Assembling A locally";
68 <<
TextName() <<
": Communicating matrix assembly";
70 if (!suppress_assembly)
73 <<
TextName() <<
": Assembling A globally";
74 MatAssemblyBegin(
A_, MAT_FINAL_ASSEMBLY);
75 MatAssemblyEnd(
A_, MAT_FINAL_ASSEMBLY);
89 PetscBool missing_diagonal;
91 MatMissingDiagonal(
A_, &missing_diagonal, &row);
94 <<
TextName() <<
": Missing diagonal detected";
98 ierr_ = MatGetInfo(
A_, MAT_GLOBAL_SUM, &info);
100 Chi::log.
Log() <<
"Number of mallocs used = " << info.mallocs
101 <<
"\nNumber of non-zeros allocated = "
103 <<
"\nNumber of non-zeros used = "
105 <<
"\nNumber of unneeded non-zeros = "
111 <<
TextName() <<
": Assembling x and b";
112 VecAssemblyBegin(
x_);
114 VecAssemblyBegin(
b_);
125 <<
": Setting up solver and preconditioner\n";
135 <<
TextName() <<
": Solving system\n";
155 KSPConvergedReason reason;
156 KSPGetConvergedReason(
ksp_, &reason);
159 <<
"Convergence reason: "
166 ierr_ = KSPGetIterationNumber(
ksp_, &its);
170 <<
"]: Number of iterations =" << its;
185 Chi::log.
Log() <<
"Diffusion Solver execution completed!\n";
static std::vector< chi_physics::MaterialPtr > material_stack
static chi::Timer program_timer
static void Exit(int error_code)
static chi::MPI_Info & mpi
LogStream Log(LOG_LVL level=LOG_0)
@ LOG_0VERBOSE_1
Used only if verbosity level equals 1.
std::string GetTimeString() const
void CFEM_Assemble_A_and_b(chi_mesh::Cell &cell, int group=0)
void UpdateFieldFunctions()
void PWLD_Assemble_b(const chi_mesh::Cell &cell, int component=0)
int ExecuteS(bool suppress_assembly=false, bool suppress_solve=false)
chi_mesh::MeshContinuumPtr grid_ptr_
void PWLD_Assemble_A_and_b(const chi_mesh::Cell &cell, int component=0)
std::string TextName() const
BasicOptions basic_options_
std::string GetPETScConvergedReasonstring(KSPConvergedReason reason)