Chi-Tech
|
#include <diffusion.h>
Data Structures | |
struct | Options |
Public Member Functions | |
DiffusionSolver (std::string text_name, const chi_math::SpatialDiscretization &sdm, const chi_math::UnknownManager &uk_man, std::map< uint64_t, BoundaryCondition > bcs, MatID2XSMap map_mat_id_2_xs, const std::vector< UnitCellMatrices > &unit_cell_matrices, bool verbose, bool requires_ghosts) | |
std::string | TextName () const |
const Vec & | RHS () const |
const std::map< uint64_t, BoundaryCondition > & | BCS () const |
const chi_math::UnknownManager & | UnknownStructure () const |
const chi_math::SpatialDiscretization & | SpatialDiscretization () const |
std::pair< size_t, size_t > | GetNumPhiIterativeUnknowns () |
virtual | ~DiffusionSolver () |
void | Initialize () |
virtual void | AssembleAand_b (const std::vector< double > &q_vector)=0 |
virtual void | Assemble_b (const std::vector< double > &q_vector)=0 |
virtual void | Assemble_b (Vec petsc_q_vector)=0 |
void | AddToRHS (const std::vector< double > &values) |
void | Solve (std::vector< double > &solution, bool use_initial_guess=false) |
void | Solve (Vec petsc_solution, bool use_initial_guess=false) |
Data Fields | |
struct lbs::acceleration::DiffusionSolver::Options | options |
Protected Types | |
typedef std::map< int, Multigroup_D_and_sigR > | MatID2XSMap |
Protected Attributes | |
const std::string | text_name_ |
const chi_mesh::MeshContinuum & | grid_ |
const chi_math::SpatialDiscretization & | sdm_ |
const chi_math::UnknownManager | uk_man_ |
const std::map< uint64_t, BoundaryCondition > | bcs_ |
const MatID2XSMap | mat_id_2_xs_map_ |
const std::vector< UnitCellMatrices > & | unit_cell_matrices_ |
const int64_t | num_local_dofs_ |
const int64_t | num_global_dofs_ |
Mat | A_ = nullptr |
Vec | rhs_ = nullptr |
KSP | ksp_ = nullptr |
const bool | requires_ghosts_ |
Generic diffusion solver for acceleration.
Definition at line 32 of file diffusion.h.
|
protected |
Definition at line 35 of file diffusion.h.
lbs::acceleration::DiffusionSolver::DiffusionSolver | ( | std::string | text_name, |
const chi_math::SpatialDiscretization & | sdm, | ||
const chi_math::UnknownManager & | uk_man, | ||
std::map< uint64_t, BoundaryCondition > | bcs, | ||
MatID2XSMap | map_mat_id_2_xs, | ||
const std::vector< UnitCellMatrices > & | unit_cell_matrices, | ||
bool | verbose, | ||
bool | requires_ghosts | ||
) |
Default constructor.
Definition at line 14 of file diffusion.cc.
|
virtual |
Default destructor.
Definition at line 42 of file diffusion.cc.
void lbs::acceleration::DiffusionSolver::AddToRHS | ( | const std::vector< double > & | values | ) |
Adds to the right-hand side without applying spatial discretization.
Definition at line 80 of file diffusion.cc.
|
pure virtual |
Implemented in lbs::acceleration::DiffusionMIPSolver, and lbs::acceleration::DiffusionPWLCSolver.
|
pure virtual |
Implemented in lbs::acceleration::DiffusionMIPSolver, and lbs::acceleration::DiffusionPWLCSolver.
|
pure virtual |
Implemented in lbs::acceleration::DiffusionMIPSolver, and lbs::acceleration::DiffusionPWLCSolver.
|
inline |
Definition at line 83 of file diffusion.h.
std::pair< size_t, size_t > lbs::acceleration::DiffusionSolver::GetNumPhiIterativeUnknowns | ( | ) |
Definition at line 73 of file diffusion.cc.
void lbs::acceleration::DiffusionSolver::Initialize | ( | ) |
Initializes the diffusion solver. This involves creating the sparse matrix with the appropriate sparsity pattern. Creating the RHS vector. Creating the KSP solver. Setting the very specialized parameters for Hypre's BooomerAMG. Note: PCSetFromOptions
and KSPSetFromOptions
are called at the end. Therefore, any number of additional PETSc options can be passed via the commandline.
Definition at line 18 of file diffusion_01_initialize.cc.
const Vec & lbs::acceleration::DiffusionSolver::RHS | ( | ) | const |
Returns the right-hand side petsc vector.
Definition at line 55 of file diffusion.cc.
void lbs::acceleration::DiffusionSolver::Solve | ( | std::vector< double > & | solution, |
bool | use_initial_guess = false |
||
) |
Solves the system and stores the local solution in the vector provide.
solution | Vector in to which the solution will be parsed. |
use_initial_guess | bool [Default:False] Flag, when set, will use the values of the output solution as initial guess. |
Definition at line 17 of file diffusion_03_solve.cc.
void lbs::acceleration::DiffusionSolver::Solve | ( | Vec | petsc_solution, |
bool | use_initial_guess = false |
||
) |
Solves the system and stores the local solution in the vector provide.
petsc_solution | Vector in to which the solution will be parsed. |
use_initial_guess | bool [Default:False] Flag, when set, will use the values of the output solution as initial guess. |
Definition at line 104 of file diffusion_03_solve.cc.
const chi_math::SpatialDiscretization & lbs::acceleration::DiffusionSolver::SpatialDiscretization | ( | ) | const |
Returns the associated spatial discretization.
Definition at line 67 of file diffusion.cc.
std::string lbs::acceleration::DiffusionSolver::TextName | ( | ) | const |
Returns the assigned text name.
Definition at line 51 of file diffusion.cc.
const chi_math::UnknownManager & lbs::acceleration::DiffusionSolver::UnknownStructure | ( | ) | const |
Returns the assigned unknown structure.
Definition at line 59 of file diffusion.cc.
|
protected |
Definition at line 51 of file diffusion.h.
|
protected |
Definition at line 42 of file diffusion.h.
|
protected |
Definition at line 38 of file diffusion.h.
|
protected |
Definition at line 53 of file diffusion.h.
|
protected |
Definition at line 44 of file diffusion.h.
|
protected |
Definition at line 49 of file diffusion.h.
|
protected |
Definition at line 48 of file diffusion.h.
struct lbs::acceleration::DiffusionSolver::Options lbs::acceleration::DiffusionSolver::options |
|
protected |
Definition at line 55 of file diffusion.h.
|
protected |
Definition at line 52 of file diffusion.h.
|
protected |
Definition at line 39 of file diffusion.h.
|
protected |
Definition at line 37 of file diffusion.h.
|
protected |
Definition at line 40 of file diffusion.h.
|
protected |
Definition at line 46 of file diffusion.h.