17 #ifdef gsSpectra_ENABLED
44 m_options = defaultOptions();
55 options.
addSwitch(
"verbose",
"Verbose output",
false);
56 options.
addInt(
"solver",
"Spectra solver to be used (see Spectra documentation):"
57 "0: Cholesky (default)"
63 options.
addInt(
"selectionRule",
"Selection rule to be used (see Spectra documentation):"
74 options.
addInt(
"sortRule",
"Sort rule to be used (see Spectra documentation):"
85 options.
addInt(
"ncvFac",
"Factor for Spectra's ncv number. Ncv = ncvFac * numEigenvalues",3);
86 options.
addReal(
"tolerance",
"Tolerance for spectra and the power method",1e-10);
87 options.
addReal(
"shift",
"Shift for the eigenvalue solver",0.0);
103 virtual const gsMatrix<T> & values()
const {
return m_values; };
104 virtual T value(
int k)
const {
return m_values.
at(k); };
106 virtual const gsMatrix<T> & vectors()
const {
return m_vectors; };
107 virtual gsMatrix<T> vector(
int k)
const {
return m_vectors.col(k); };
109 virtual std::vector<std::pair<T,gsMatrix<T>> > mode(
int k)
const {
return makeMode(k); }
113 virtual std::vector<std::pair<T,gsMatrix<T>> > makeMode(
int k)
const;
116 #ifdef gsSpectra_ENABLED
117 template<Spectra::GEigsMode _GEigsMode>
118 typename std::enable_if<_GEigsMode==Spectra::GEigsMode::Cholesky ||
119 _GEigsMode==Spectra::GEigsMode::RegularInverse
124 #ifdef gsSpectra_ENABLED
125 template<Spectra::GEigsMode _GEigsMode>
126 typename std::enable_if<_GEigsMode==Spectra::GEigsMode::ShiftInvert ||
127 _GEigsMode==Spectra::GEigsMode::Buckling ||
128 _GEigsMode==Spectra::GEigsMode::Cayley
135 gsSparseMatrix<T> m_A;
136 gsSparseMatrix<T> m_B;
138 gsOptionList m_options;
140 gsEigen::GeneralizedSelfAdjointEigenSolver< typename gsMatrix<T>::Base > m_eigSolver;
142 gsMatrix<T> m_values,m_vectors;
153 #ifndef GISMO_BUILD_LIB
154 #include GISMO_HPP_HEADER(gsEigenProblemBase.hpp)
virtual void setOptions(gsOptionList &options)
Set the options from options.
Definition: gsEigenProblemBase.h:95
Base class for buckling and modal analyses.
Definition: gsEigenProblemBase.h:37
#define index_t
Definition: gsConfig.h:32
gsStatus
Definition: gsStructuralAnalysisTypes.h:20
void addInt(const std::string &label, const std::string &desc, const index_t &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:201
T at(index_t i) const
Returns the i-th element of the vectorization of the matrix.
Definition: gsMatrix.h:211
Provides a list of labeled parameters/options that can be set and accessed easily.
void update(const gsOptionList &other, updateType type=ignoreIfUnknown)
Updates the object using the data from other.
Definition: gsOptionList.cpp:253
Provides a status object and typedefs.
Header file for using Spectra extension.
void addReal(const std::string &label, const std::string &desc, const Real &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:211
This is the main header file that collects wrappers of Eigen for linear algebra.
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
void addSwitch(const std::string &label, const std::string &desc, const bool &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:235
gsOptionList & options()
Get options.
Definition: gsEigenProblemBase.h:92