Reference structured preconditioned block conjugate gradient implementation. More...
#include <Cabana_Grid_ReferenceStructuredSolver.hpp>
Classes | |
struct | LayoutContainer |
Array-like container to hold layout and data information. More... | |
Public Types | |
using | base_type |
Base type. | |
using | memory_space = typename base_type::memory_space |
Memory space. | |
using | execution_space = typename base_type::execution_space |
Default execution space. | |
using | entity_type = typename base_type::entity_type |
Entity type. | |
using | value_type = typename base_type::value_type |
Scalar value type. | |
using | Array_t = typename base_type::Array_t |
Array type. | |
using | subarray_type = typename base_type::subarray_type |
SubArray type. | |
![]() | |
using | entity_type = EntityType |
Entity type. | |
using | value_type = Scalar |
Scalar value type. | |
using | memory_space = typename MemorySpace::memory_space |
Memory space. | |
using | execution_space = typename memory_space::execution_space |
Default execution space. | |
using | Array_t = Array<Scalar, EntityType, MeshType, MemorySpace> |
Array type. | |
using | subarray_type = typename Array_t::subarray_type |
SubArray type. | |
Public Member Functions | |
ReferenceConjugateGradient (const ArrayLayout< EntityType, MeshType > &layout) | |
Constructor. | |
void | setMatrixStencil (const std::vector< std::array< int, num_space_dim > > &stencil, const bool is_symmetric=false) override |
Set the matrix stencil. | |
const Array_t & | getMatrixValues () override |
Get the matrix values. | |
void | setPreconditionerStencil (const std::vector< std::array< int, num_space_dim > > &stencil, const bool is_symmetric=false) override |
Set the preconditioner stencil. | |
const Array_t & | getPreconditionerValues () override |
Get the preconditioner values. | |
void | setTolerance (const double tol) override |
Set convergence tolerance implementation. | |
void | setMaxIter (const int max_iter) override |
Set maximum iteration implementation. | |
void | setPrintLevel (const int print_level) override |
Set the output level. | |
void | setup () override |
Setup the problem. | |
void | solve (const Array_t &b, Array_t &x) override |
Solve the problem Ax = b for x. | |
int | getNumIter () override |
Get the number of iterations taken on the last solve. | |
double | getFinalRelativeResidualNorm () override |
Get the relative residual norm achieved on the last solve. | |
Static Public Attributes | |
static constexpr std::size_t | num_space_dim = MeshType::num_space_dim |
Spatial dimension. | |
![]() | |
static constexpr std::size_t | num_space_dim = MeshType::num_space_dim |
Spatial dimension. | |
Reference structured preconditioned block conjugate gradient implementation.
using Cabana::Grid::ReferenceConjugateGradient< Scalar, EntityType, MeshType, MemorySpace >::base_type |
Base type.
|
inlineoverridevirtual |
Get the relative residual norm achieved on the last solve.
Implements Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >.
|
inlineoverridevirtual |
Get the matrix values.
Implements Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >.
|
inlineoverridevirtual |
Get the number of iterations taken on the last solve.
Implements Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >.
|
inlineoverridevirtual |
Get the preconditioner values.
Implements Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >.
|
inlineoverridevirtual |
Set the matrix stencil.
stencil | The (i,j,k) offsets describing the structured matrix entries at each grid point. Offsets are defined relative to an index. |
is_symmetric | If true the matrix is designated as symmetric. The stencil entries should only contain one entry from each symmetric component if this is true. |
Implements Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >.
|
inlineoverridevirtual |
Set maximum iteration implementation.
Implements Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >.
|
inlineoverridevirtual |
Set the preconditioner stencil.
stencil | The (i,j,k) offsets describing the structured preconditioner entries at each grid point. Offsets are defined relative to an index. |
is_symmetric | If true the preconditioner is designated as symmetric. The stencil entries should only contain one entry from each symmetric component if this is true. |
Implements Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >.
|
inlineoverridevirtual |
Set the output level.
Implements Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >.
|
inlineoverridevirtual |
Set convergence tolerance implementation.
Implements Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >.
|
inlineoverridevirtual |
Setup the problem.
Implements Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >.
|
inlineoverridevirtual |
Solve the problem Ax = b for x.
b | The forcing term. |
x | The solution. |
Implements Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >.