hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
hpfem::solvers::DeviceArnoldi Class Reference

#include <device_arnoldi.hpp>

Public Member Functions

 DeviceArnoldi (LinearSolver &shifted, const SparseMatrix &b, const SparseMatrix *gradient, LinearSolver *gauge, Index ncv)
 
 ~DeviceArnoldi ()
 
 DeviceArnoldi (const DeviceArnoldi &)=delete
 
DeviceArnoldi & operator= (const DeviceArnoldi &)=delete
 
void set_start (const Vector &start)
 \( v_0 = P s / \|P s\| \).
 
Real iterate (Index j, Vector &h_column)
 
void restart (Index m, const Vector &coefficients)
 \( v_0 = V_m c / \|V_m c\| \) for the explicit restart (c has m entries).
 
Matrix combine (Index m, const Matrix &coefficients) const
 \( V_m C \) (coefficients is m × count): the Ritz vectors.
 
Index size () const noexcept
 
Index krylov_dimension () const noexcept
 

Static Public Member Functions

static bool available (const LinearSolver &shifted) noexcept
 
static std::size_t basis_bytes (Index n, Index ncv) noexcept
 

Constructor & Destructor Documentation

◆ DeviceArnoldi() [1/2]

hpfem::solvers::DeviceArnoldi::DeviceArnoldi ( LinearSolver &  shifted,
const SparseMatrix &  b,
const SparseMatrix *  gradient,
LinearSolver *  gauge,
Index  ncv 
)
Parameters
shiftedthe factorised \( A - \sigma B \) (cuDSS backend)
b\( B \) (uploaded to the device)
gradient\( G \) (n × m) or null for no gauge projection
gaugethe factorised \( G^H B G \) (cuDSS backend), required with a gradient
ncvnumber of Krylov vectors; the basis holds ncv + 1 columns
Exceptions
Errorif available(shifted) is false, the gauge is not on the device, the estimated memory exceeds the free device memory (the estimate is logged) or an allocation fails; InvalidArgument for mismatched sizes. Callers fall back to a host basis on Error.

◆ ~DeviceArnoldi()

hpfem::solvers::DeviceArnoldi::~DeviceArnoldi ( )

◆ DeviceArnoldi() [2/2]

hpfem::solvers::DeviceArnoldi::DeviceArnoldi ( const DeviceArnoldi &  )
delete

Member Function Documentation

◆ available()

static bool hpfem::solvers::DeviceArnoldi::available ( const LinearSolver &  shifted)
staticnoexcept

True if shifted is (or, for kAuto, chose) the cuDSS backend of a library with API version 4 or later and HPFEM_GPU_ARNOLDI is not 0.

◆ basis_bytes()

static std::size_t hpfem::solvers::DeviceArnoldi::basis_bytes ( Index  n,
Index  ncv 
)
staticnoexcept

Device memory for the basis and the work vectors of n unknowns and ncv Krylov vectors (without the matrices and the factors): \( 16\,(n (k + 4)) \) bytes.

◆ combine()

Matrix hpfem::solvers::DeviceArnoldi::combine ( Index  m,
const Matrix &  coefficients 
) const

\( V_m C \) (coefficients is m × count): the Ritz vectors.

◆ iterate()

Real hpfem::solvers::DeviceArnoldi::iterate ( Index  j,
Vector &  h_column 
)

One Arnoldi step for column j (0-based, j < ncv): returns \( h_{j+1,j} = \|w\| \) and the j + 1 entries \( h_{0..j,j} \) (both Gram–Schmidt passes summed) in h_column; stores \( v_{j+1} \) when the norm is positive.

◆ krylov_dimension()

Index hpfem::solvers::DeviceArnoldi::krylov_dimension ( ) const
inlinenoexcept

◆ operator=()

DeviceArnoldi & hpfem::solvers::DeviceArnoldi::operator= ( const DeviceArnoldi &  )
delete

◆ restart()

void hpfem::solvers::DeviceArnoldi::restart ( Index  m,
const Vector &  coefficients 
)

\( v_0 = V_m c / \|V_m c\| \) for the explicit restart (c has m entries).

◆ set_start()

void hpfem::solvers::DeviceArnoldi::set_start ( const Vector &  start)

\( v_0 = P s / \|P s\| \).

◆ size()

Index hpfem::solvers::DeviceArnoldi::size ( ) const
inlinenoexcept

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