MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / get_eigenvalue

Method get_eigenvalue

cpp/dolfinx/la/slepc.cpp:113–138  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

111}
112//-----------------------------------------------------------------------------
113std::complex<PetscReal> SLEPcEigenSolver::get_eigenvalue(int i) const
114{
115 assert(_eps);
116
117 // Get number of computed values
118 PetscInt num_computed_eigenvalues;
119 EPSGetConverged(_eps, &num_computed_eigenvalues);
120
121 if (i < num_computed_eigenvalues)
122 {
123#ifdef PETSC_USE_COMPLEX
124 PetscScalar l;
125 EPSGetEigenvalue(_eps, i, &l, nullptr);
126 return l;
127#else
128 PetscScalar lr, li;
129 EPSGetEigenvalue(_eps, i, &lr, &li);
130 return std::complex<PetscReal>(lr, li);
131#endif
132 }
133 else
134 {
135 throw std::runtime_error("Requested eigenvalue (" + std::to_string(i)
136 + ") has not been computed");
137 }
138}
139//-----------------------------------------------------------------------------
140void SLEPcEigenSolver::get_eigenpair(PetscScalar& lr, PetscScalar& lc, Vec r,
141 Vec c, int i) const

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected