Cabana 0.8.0-dev
 
Loading...
Searching...
No Matches
Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace > Class Template Referenceabstract

Reference preconditioned structured solver interface. More...

#include <Cabana_Grid_ReferenceStructuredSolver.hpp>

Inheritance diagram for Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >:

Public Types

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

virtual void setMatrixStencil (const std::vector< std::array< int, num_space_dim > > &stencil, const bool is_symmetric)=0
 Set the matrix stencil.
 
virtual const Array_tgetMatrixValues ()=0
 Get the matrix values.
 
virtual void setPreconditionerStencil (const std::vector< std::array< int, num_space_dim > > &stencil, const bool is_symmetric)=0
 Set the preconditioner stencil.
 
virtual const Array_tgetPreconditionerValues ()=0
 Get the preconditioner values.
 
virtual void setTolerance (const double tol)=0
 Set convergence tolerance implementation.
 
virtual void setMaxIter (const int max_iter)=0
 Set maximum iteration implementation.
 
virtual void setPrintLevel (const int print_level)=0
 Set the output level.
 
virtual void setup ()=0
 Setup the problem.
 
virtual void solve (const Array_t &b, Array_t &x)=0
 Solve the problem Ax = b for x.
 
virtual int getNumIter ()=0
 Get the number of iterations taken on the last solve.
 
virtual double getFinalRelativeResidualNorm ()=0
 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.
 

Detailed Description

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
class Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >

Reference preconditioned structured solver interface.

Member Function Documentation

◆ getFinalRelativeResidualNorm()

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
virtual double Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >::getFinalRelativeResidualNorm ( )
pure virtual

Get the relative residual norm achieved on the last solve.

Implemented in Cabana::Grid::ReferenceConjugateGradient< Scalar, EntityType, MeshType, MemorySpace >.

◆ getMatrixValues()

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
virtual const Array_t & Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >::getMatrixValues ( )
pure virtual

Get the matrix values.

Returns
The matrix entry values which the user can fill with their entries. For each entity over which the vector space is defined an entry for each stencil element is required. The order of the stencil elements is that same as that in the stencil definition. Note that values corresponding to stencil entries outside of the domain should be set to zero.

Implemented in Cabana::Grid::ReferenceConjugateGradient< Scalar, EntityType, MeshType, MemorySpace >.

◆ getNumIter()

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
virtual int Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >::getNumIter ( )
pure virtual

Get the number of iterations taken on the last solve.

Implemented in Cabana::Grid::ReferenceConjugateGradient< Scalar, EntityType, MeshType, MemorySpace >.

◆ getPreconditionerValues()

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
virtual const Array_t & Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >::getPreconditionerValues ( )
pure virtual

Get the preconditioner values.

Returns
The preconditioner entry values which the user can fill with their entries. For each entity over which the vector space is defined an entry for each stencil element is required. The order of the stencil elements is that same as that in the stencil definition. Note that values corresponding to stencil entries outside of the domain should be set to zero.

Implemented in Cabana::Grid::ReferenceConjugateGradient< Scalar, EntityType, MeshType, MemorySpace >.

◆ setMatrixStencil()

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
virtual void Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >::setMatrixStencil ( const std::vector< std::array< int, num_space_dim > > & stencil,
const bool is_symmetric )
pure virtual

Set the matrix stencil.

Parameters
stencilThe (i,j,k) offsets describing the structured matrix entries at each grid point. Offsets are defined relative to an index.
is_symmetricIf true the matrix is designated as symmetric. The stencil entries should only contain one entry from each symmetric component if this is true.

Implemented in Cabana::Grid::ReferenceConjugateGradient< Scalar, EntityType, MeshType, MemorySpace >.

◆ setMaxIter()

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
virtual void Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >::setMaxIter ( const int max_iter)
pure virtual

◆ setPreconditionerStencil()

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
virtual void Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >::setPreconditionerStencil ( const std::vector< std::array< int, num_space_dim > > & stencil,
const bool is_symmetric )
pure virtual

Set the preconditioner stencil.

Parameters
stencilThe (i,j,k) offsets describing the structured preconditioner entries at each grid point. Offsets are defined relative to an index.
is_symmetricIf true the preconditioner is designated as symmetric. The stencil entries should only contain one entry from each symmetric component if this is true.

Implemented in Cabana::Grid::ReferenceConjugateGradient< Scalar, EntityType, MeshType, MemorySpace >.

◆ setPrintLevel()

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
virtual void Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >::setPrintLevel ( const int print_level)
pure virtual

◆ setTolerance()

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
virtual void Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >::setTolerance ( const double tol)
pure virtual

Set convergence tolerance implementation.

Implemented in Cabana::Grid::ReferenceConjugateGradient< Scalar, EntityType, MeshType, MemorySpace >.

◆ setup()

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
virtual void Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >::setup ( )
pure virtual

◆ solve()

template<class Scalar, class EntityType, class MeshType, class MemorySpace>
virtual void Cabana::Grid::ReferenceStructuredSolver< Scalar, EntityType, MeshType, MemorySpace >::solve ( const Array_t & b,
Array_t & x )
pure virtual

Solve the problem Ax = b for x.

Parameters
bThe forcing term.
xThe solution.

Implemented in Cabana::Grid::ReferenceConjugateGradient< Scalar, EntityType, MeshType, MemorySpace >.


The documentation for this class was generated from the following file: