Loading...
Searching...
No Matches
slepc.h
// Copyright (C) 2005-2018 Garth N. Wells
//
// This file is part of DOLFINx (https://www.fenicsproject.org)
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#pragma once
#ifdef HAS_SLEPC
#include "dolfinx/common/MPI.h"
#include <memory>
#include <petscmat.h>
#include <petscvec.h>
#include <slepceps.h>
#include <string>
namespace dolfinx::la
{
class SLEPcEigenSolver
{
public:
explicit SLEPcEigenSolver(MPI_Comm comm);
SLEPcEigenSolver(EPS eps, bool inc_ref_count);
// Delete copy constructor
SLEPcEigenSolver(const SLEPcEigenSolver&) = delete;
SLEPcEigenSolver(SLEPcEigenSolver&& solver) noexcept;
~SLEPcEigenSolver();
// Assignment operator (disabled)
SLEPcEigenSolver& operator=(const SLEPcEigenSolver&) = delete;
SLEPcEigenSolver& operator=(SLEPcEigenSolver&& solver) noexcept;
void set_operators(const Mat A, const Mat B);
void solve();
void solve(std::int64_t n);
std::complex<PetscReal> get_eigenvalue(int i) const;
void get_eigenpair(PetscScalar& lr, PetscScalar& lc, Vec r, Vec c,
int i) const;
int get_iteration_number() const;
std::int64_t get_number_converged() const;
void set_options_prefix(const std::string& options_prefix);
std::string get_options_prefix() const;
void set_from_options() const;
EPS eps() const;
MPI_Comm comm() const;
private:
// SLEPc solver pointer
EPS _eps;
};
} // namespace dolfinx::la
#endif
dolfinx::la
Linear algebra interface.
Definition sparsitybuild.h:15