hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
device_arnoldi.hpp
Go to the documentation of this file.
1#pragma once
16
17#include <cstddef>
18#include <memory>
19
20#include "hpfem/core/types.hpp"
22
23namespace hpfem::solvers {
24
26 public:
29 [[nodiscard]] static bool available(const LinearSolver& shifted) noexcept;
30
33 [[nodiscard]] static std::size_t basis_bytes(Index n, Index ncv) noexcept;
34
44 DeviceArnoldi(LinearSolver& shifted, const SparseMatrix& b, const SparseMatrix* gradient,
45 LinearSolver* gauge, Index ncv);
47 DeviceArnoldi(const DeviceArnoldi&) = delete;
49
51 void set_start(const Vector& start);
55 Real iterate(Index j, Vector& h_column);
57 void restart(Index m, const Vector& coefficients);
59 [[nodiscard]] Matrix combine(Index m, const Matrix& coefficients) const;
60
61 [[nodiscard]] Index size() const noexcept { return size_; }
62 [[nodiscard]] Index krylov_dimension() const noexcept { return ncv_; }
63
64 private:
65 struct Impl;
66 std::unique_ptr<Impl> impl_;
67 Index size_ = 0;
68 Index ncv_ = 0;
69};
70
71} // namespace hpfem::solvers
Definition device_arnoldi.hpp:25
Index krylov_dimension() const noexcept
Definition device_arnoldi.hpp:62
Index size() const noexcept
Definition device_arnoldi.hpp:61
DeviceArnoldi(LinearSolver &shifted, const SparseMatrix &b, const SparseMatrix *gradient, LinearSolver *gauge, Index ncv)
Matrix combine(Index m, const Matrix &coefficients) const
(coefficients is m × count): the Ritz vectors.
static std::size_t basis_bytes(Index n, Index ncv) noexcept
void restart(Index m, const Vector &coefficients)
for the explicit restart (c has m entries).
DeviceArnoldi & operator=(const DeviceArnoldi &)=delete
DeviceArnoldi(const DeviceArnoldi &)=delete
static bool available(const LinearSolver &shifted) noexcept
Real iterate(Index j, Vector &h_column)
void set_start(const Vector &start)
.
Factorise once, solve for many right-hand sides.
Definition linear_solver.hpp:17
Definition device_arnoldi.hpp:23
double Real
Definition types.hpp:15
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition types.hpp:22
Eigen::SparseMatrix< Complex, Eigen::RowMajor, Index > SparseMatrix
Definition types.hpp:24
std::int64_t Index
global indices (DoFs, entities)
Definition types.hpp:17
Eigen::Matrix< Complex, Eigen::Dynamic, 1 > Vector
Definition types.hpp:20