OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
ippl::PoissonCG< FieldLHS, FieldRHS > Class Template Reference

#include <PoissonCG.h>

Inheritance diagram for ippl::PoissonCG< FieldLHS, FieldRHS >:
Inheritance graph
Collaboration diagram for ippl::PoissonCG< FieldLHS, FieldRHS >:
Collaboration graph

Public Types

using Base = Poisson< FieldLHS, FieldRHS >
 
using OperatorRet = UnaryMinus< detail::meta_laplace< lhs_type > >
 
using LowerRet = UnaryMinus< detail::meta_lower_laplace< lhs_type > >
 
using UpperRet = UnaryMinus< detail::meta_upper_laplace< lhs_type > >
 
using UpperAndLowerRet = UnaryMinus< detail::meta_upper_and_lower_laplace< lhs_type > >
 
using InverseDiagonalRet = double
 
using DiagRet = double
 
using lhs_type = FieldLHS
 
using rhs_type = FieldRHS
 
enum  OutputType
 
using Trhs = typename FieldRHS::value_type
 
using grad_type = Field< Vector< Tlhs, Dim >, Dim, Mesh, Centering >
 

Public Member Functions

 PoissonCG ()
 
 PoissonCG (lhs_type &lhs, rhs_type &rhs)
 
void setSolver (lhs_type lhs)
 
void solve () override
 
int getIterationCount ()
 
Tlhs getResidue () const
 
void updateParameter (const std::string &key, const T &value)
 
void updateParameters (const ParameterList &params)
 
void mergeParameters (const ParameterList &params)
 
void setLhs (lhs_type &lhs)
 
virtual void setRhs (rhs_type &rhs)
 
virtual MField_tgetHessian ()
 
void setGradient (grad_type &grad)
 

Static Public Attributes

static constexpr unsigned Dim = FieldLHS::dim
 

Protected Member Functions

void setDefaultParameters () override
 

Protected Attributes

std::unique_ptr< CG< OperatorRet, LowerRet, UpperRet, UpperAndLowerRet, InverseDiagonalRet, DiagRet, FieldLHS, FieldRHS > > algo_m
 
ParameterList params_m
 
rhs_typerhs_mp
 
lhs_typelhs_mp
 
grad_typegrad_mp
 

Private Types

using Tlhs = typename FieldLHS::value_type
 
typedef FieldLHS::Mesh_t Mesh
 
typedef FieldLHS::Centering_t Centering
 
typedef Mesh::matrix_type Matrix_t
 
typedef Field< Matrix_t, Dim, Mesh, CenteringMField_t
 

Detailed Description

template<typename FieldLHS, typename FieldRHS = FieldLHS>
class ippl::PoissonCG< FieldLHS, FieldRHS >

Definition at line 23 of file PoissonCG.h.

Member Typedef Documentation

◆ Base

template<typename FieldLHS , typename FieldRHS = FieldLHS>
using ippl::PoissonCG< FieldLHS, FieldRHS >::Base = Poisson<FieldLHS, FieldRHS>

Definition at line 27 of file PoissonCG.h.

◆ Centering

typedef FieldLHS::Centering_t ippl::Poisson< FieldLHS, FieldLHS >::Centering
privateinherited

Definition at line 19 of file Poisson.h.

◆ DiagRet

template<typename FieldLHS , typename FieldRHS = FieldLHS>
using ippl::PoissonCG< FieldLHS, FieldRHS >::DiagRet = double

Definition at line 35 of file PoissonCG.h.

◆ grad_type

using ippl::Poisson< FieldLHS, FieldLHS >::grad_type = Field<Vector<Tlhs, Dim>, Dim, Mesh, Centering>
inherited

Definition at line 29 of file Poisson.h.

◆ InverseDiagonalRet

template<typename FieldLHS , typename FieldRHS = FieldLHS>
using ippl::PoissonCG< FieldLHS, FieldRHS >::InverseDiagonalRet = double

Definition at line 34 of file PoissonCG.h.

◆ lhs_type

template<typename FieldLHS , typename FieldRHS = FieldLHS>
using ippl::Poisson< FieldLHS, FieldRHS >::lhs_type = FieldLHS

Definition at line 24 of file Poisson.h.

◆ LowerRet

template<typename FieldLHS , typename FieldRHS = FieldLHS>
using ippl::PoissonCG< FieldLHS, FieldRHS >::LowerRet = UnaryMinus<detail::meta_lower_laplace<lhs_type> >

Definition at line 31 of file PoissonCG.h.

◆ Matrix_t

typedef Mesh::matrix_type ippl::Poisson< FieldLHS, FieldLHS >::Matrix_t
privateinherited

Definition at line 20 of file Poisson.h.

◆ Mesh

typedef FieldLHS::Mesh_t ippl::Poisson< FieldLHS, FieldLHS >::Mesh
privateinherited

Definition at line 18 of file Poisson.h.

◆ MField_t

typedef Field<Matrix_t, Dim, Mesh, Centering> ippl::Poisson< FieldLHS, FieldLHS >::MField_t
privateinherited

Definition at line 21 of file Poisson.h.

◆ OperatorRet

template<typename FieldLHS , typename FieldRHS = FieldLHS>
using ippl::PoissonCG< FieldLHS, FieldRHS >::OperatorRet = UnaryMinus<detail::meta_laplace<lhs_type> >

Definition at line 30 of file PoissonCG.h.

◆ rhs_type

template<typename FieldLHS , typename FieldRHS = FieldLHS>
using ippl::Poisson< FieldLHS, FieldRHS >::rhs_type = FieldRHS

Definition at line 25 of file Poisson.h.

◆ Tlhs

template<typename FieldLHS , typename FieldRHS = FieldLHS>
using ippl::PoissonCG< FieldLHS, FieldRHS >::Tlhs = typename FieldLHS::value_type
private

Definition at line 24 of file PoissonCG.h.

◆ Trhs

using ippl::Poisson< FieldLHS, FieldLHS >::Trhs = typename FieldRHS::value_type
inherited

Definition at line 27 of file Poisson.h.

◆ UpperAndLowerRet

template<typename FieldLHS , typename FieldRHS = FieldLHS>
using ippl::PoissonCG< FieldLHS, FieldRHS >::UpperAndLowerRet = UnaryMinus<detail::meta_upper_and_lower_laplace<lhs_type> >

Definition at line 33 of file PoissonCG.h.

◆ UpperRet

template<typename FieldLHS , typename FieldRHS = FieldLHS>
using ippl::PoissonCG< FieldLHS, FieldRHS >::UpperRet = UnaryMinus<detail::meta_upper_laplace<lhs_type> >

Definition at line 32 of file PoissonCG.h.

Member Enumeration Documentation

◆ OutputType

enum ippl::Poisson::OutputType
inherited

Represents the types of fields that should be output by the solver

Definition at line 35 of file Poisson.h.

Constructor & Destructor Documentation

◆ PoissonCG() [1/2]

template<typename FieldLHS , typename FieldRHS = FieldLHS>
ippl::PoissonCG< FieldLHS, FieldRHS >::PoissonCG ( )
inline

Definition at line 37 of file PoissonCG.h.

References ippl::PoissonCG< FieldLHS, FieldRHS >::setDefaultParameters().

Here is the call graph for this function:

◆ PoissonCG() [2/2]

template<typename FieldLHS , typename FieldRHS = FieldLHS>
ippl::PoissonCG< FieldLHS, FieldRHS >::PoissonCG ( lhs_type lhs,
rhs_type rhs 
)
inline

Definition at line 44 of file PoissonCG.h.

References ippl::PoissonCG< FieldLHS, FieldRHS >::setDefaultParameters().

Here is the call graph for this function:

Member Function Documentation

◆ getHessian()

virtual MField_t * ippl::Poisson< FieldLHS, FieldLHS >::getHessian ( )
inlinevirtualinherited

Get the Hessian matrix of the solution

Returns
Matrix field containing the Hessian of the lhs

Definition at line 102 of file Poisson.h.

◆ getIterationCount()

template<typename FieldLHS , typename FieldRHS = FieldLHS>
int ippl::PoissonCG< FieldLHS, FieldRHS >::getIterationCount ( )
inline

Query how many iterations were required to obtain the solution the last time this solver was used

Returns
Iteration count of last solve

Definition at line 139 of file PoissonCG.h.

References ippl::PoissonCG< FieldLHS, FieldRHS >::algo_m.

Referenced by FieldSolver< T, Dim >::runSolver().

◆ getResidue()

template<typename FieldLHS , typename FieldRHS = FieldLHS>
Tlhs ippl::PoissonCG< FieldLHS, FieldRHS >::getResidue ( ) const
inline

Query the residue

Returns
Residue norm from last solve

Definition at line 145 of file PoissonCG.h.

References ippl::PoissonCG< FieldLHS, FieldRHS >::algo_m.

Referenced by FieldSolver< T, Dim >::runSolver().

◆ mergeParameters()

void ippl::Poisson< FieldLHS, FieldLHS >::mergeParameters ( const ParameterList params)
inlineinherited

Merges another parameter set into the solver's parameters, overwriting existing parameters in case of conflict

Parameters
paramsParameter list with desired values

Definition at line 84 of file Poisson.h.

◆ setDefaultParameters()

template<typename FieldLHS , typename FieldRHS = FieldLHS>
void ippl::PoissonCG< FieldLHS, FieldRHS >::setDefaultParameters ( )
inlineoverrideprotectedvirtual

Utility function for initializing a solver's default parameters (to be overridden for each base class)

Reimplemented from ippl::Poisson< FieldLHS, FieldLHS >.

Definition at line 152 of file PoissonCG.h.

References ippl::ParameterList::add(), Physics::e, and ippl::Poisson< FieldLHS, FieldLHS >::params_m.

Referenced by ippl::PoissonCG< FieldLHS, FieldRHS >::PoissonCG().

Here is the call graph for this function:

◆ setGradient()

void ippl::Poisson< FieldLHS, FieldLHS >::setGradient ( grad_type grad)
inlineinherited

Set the field in which the gradient of the computed potential should be stored

Parameters
gradReference to field in which to store the gradient

Definition at line 109 of file Poisson.h.

◆ setLhs()

void ippl::Poisson< FieldLHS, FieldLHS >::setLhs ( lhs_type lhs)
inlineinherited

Set the problem LHS

Parameters
lhsReference to problem LHS field

Definition at line 90 of file Poisson.h.

◆ setRhs()

virtual void ippl::Poisson< FieldLHS, FieldLHS >::setRhs ( rhs_type rhs)
inlinevirtualinherited

Set the problem RHS

Parameters
rhsReference to problem RHS field

Definition at line 96 of file Poisson.h.

◆ setSolver()

◆ solve()

◆ updateParameter()

void ippl::Poisson< FieldLHS, FieldLHS >::updateParameter ( const std::string &  key,
const T value 
)
inlineinherited

Update one of the solver's parameters

Parameters
keyThe parameter key
valueThe new value
Exceptions
IpplExceptionFails if there is no existing parameter with the given key

Definition at line 67 of file Poisson.h.

◆ updateParameters()

void ippl::Poisson< FieldLHS, FieldLHS >::updateParameters ( const ParameterList params)
inlineinherited

Updates all solver parameters based on values in another parameter set

Parameters
paramsParameter list with updated values
Exceptions
IpplExceptionFails if the provided parameter list includes keys not already present

Definition at line 77 of file Poisson.h.

Member Data Documentation

◆ algo_m

template<typename FieldLHS , typename FieldRHS = FieldLHS>
std::unique_ptr<CG<OperatorRet, LowerRet, UpperRet, UpperAndLowerRet, InverseDiagonalRet, DiagRet, FieldLHS, FieldRHS> > ippl::PoissonCG< FieldLHS, FieldRHS >::algo_m
protected

◆ Dim

template<typename FieldLHS , typename FieldRHS = FieldLHS>
constexpr unsigned ippl::PoissonCG< FieldLHS, FieldRHS >::Dim = FieldLHS::dim
staticconstexpr

Definition at line 28 of file PoissonCG.h.

Referenced by ippl::PoissonCG< FieldLHS, FieldRHS >::setSolver().

◆ grad_mp

grad_type* ippl::Poisson< FieldLHS, FieldLHS >::grad_mp
protectedinherited

Definition at line 125 of file Poisson.h.

◆ lhs_mp

lhs_type* ippl::Poisson< FieldLHS, FieldLHS >::lhs_mp
protectedinherited

Definition at line 123 of file Poisson.h.

◆ params_m

ParameterList ippl::Poisson< FieldLHS, FieldLHS >::params_m
protectedinherited

Definition at line 120 of file Poisson.h.

◆ rhs_mp

rhs_type* ippl::Poisson< FieldLHS, FieldLHS >::rhs_mp
protectedinherited

Definition at line 122 of file Poisson.h.


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