DFT-EFE
 
Loading...
Searching...
No Matches
ChebyshevFilteredEigenSolver.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2021. *
3 * The Regents of the University of Michigan and DFT-EFE developers. *
4 * *
5 * This file is part of the DFT-EFE code. *
6 * *
7 * DFT-EFE is free software: you can redistribute it and/or modify *
8 * it under the terms of the Lesser GNU General Public License as *
9 * published by the Free Software Foundation, either version 3 of *
10 * the License, or (at your option) any later version. *
11 * *
12 * DFT-EFE is distributed in the hope that it will be useful, but *
13 * WITHOUT ANY WARRANTY; without even the implied warranty *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
15 * See the Lesser GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License at the top level of DFT-EFE distribution. If not, see *
19 * <https://www.gnu.org/licenses/>. *
20 ******************************************************************************/
21
22/*
23 * @author Avirup Sircar
24 */
25
26#ifndef dftefeChebyshevFilteredEigenSolver_h
27#define dftefeChebyshevFilteredEigenSolver_h
28
38#include <memory>
39#include <utils/Profiler.h>
40
41namespace dftefe
42{
43 namespace linearAlgebra
44 {
56 template <typename ValueTypeOperator,
57 typename ValueTypeOperand,
58 utils::MemorySpace memorySpace>
60 : public HermitianIterativeEigenSolver<ValueTypeOperator,
61 ValueTypeOperand,
62 memorySpace>
63 {
64 public:
71 using ValueType =
74 using OpContext =
75 typename HermitianIterativeEigenSolver<ValueTypeOperator,
76 ValueTypeOperand,
77 memorySpace>::OpContext;
78
79 public:
84 const double wantedSpectrumLowerBound,
85 const double wantedSpectrumUpperBound,
86 const double unWantedSpectrumUpperBound,
87 const double polynomialDegree,
88 const double illConditionTolerance,
90 bool isResidualChebyshevFilter = true,
91 const size_type eigenVectorBlockSize = 0);
92
98
99 void
100 reinit(const double wantedSpectrumLowerBound,
101 const double wantedSpectrumUpperBound,
102 const double unWantedSpectrumUpperBound,
103 const double polynomialDegree,
104 const double illConditionTolerance,
106 const size_type eigenVectorBlockSize);
107
109 solve(const OpContext & A,
110 std::vector<RealType> & eigenValues,
112 bool computeEigenVectors = false,
113 const OpContext &B = IdentityOperatorContext<ValueTypeOperator,
114 ValueTypeOperand,
115 memorySpace>(),
116 const OpContext &BInv =
117 IdentityOperatorContext<ValueTypeOperator,
118 ValueTypeOperand,
119 memorySpace>()) override;
120
123
126
127 private:
135
136 std::shared_ptr<MultiVector<ValueType, memorySpace>>
138 std::shared_ptr<MultiVector<ValueType, memorySpace>> d_filteredSubspace;
139
140 std::shared_ptr<
145
146 }; // end of class ChebyshevFilteredEigenSolver
147 } // end of namespace linearAlgebra
148} // end of namespace dftefe
150#endif // dftefeChebyshevFilteredEigenSolver_h
A derived class of OperatorContext to encapsulate the action of a discrete operator on vectors,...
Definition: ChebyshevFilteredEigenSolver.h:63
std::shared_ptr< RayleighRitzEigenSolver< ValueTypeOperator, ValueType, memorySpace > > d_rr
Definition: ChebyshevFilteredEigenSolver.h:142
const bool d_isResidualChebyFilter
Definition: ChebyshevFilteredEigenSolver.h:144
MultiVector< ValueTypeOperand, memorySpace > * d_eigenSubspaceGuess
Definition: ChebyshevFilteredEigenSolver.h:133
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_filteredSubspace
Definition: ChebyshevFilteredEigenSolver.h:138
double d_polynomialDegree
Definition: ChebyshevFilteredEigenSolver.h:131
utils::Profiler d_p
Definition: ChebyshevFilteredEigenSolver.h:143
std::shared_ptr< MultiVector< ValueType, memorySpace > > d_filteredSubspaceOrtho
Definition: ChebyshevFilteredEigenSolver.h:137
double d_wantedSpectrumUpperBound
Definition: ChebyshevFilteredEigenSolver.h:129
MultiVector< ValueType, memorySpace > & getFilteredSubspace()
Definition: ChebyshevFilteredEigenSolver.t.cpp:266
MultiVector< ValueType, memorySpace > & getOrthogonalizedFilteredSubspace()
Definition: ChebyshevFilteredEigenSolver.t.cpp:279
size_type d_eigenVectorBlockSize
Definition: ChebyshevFilteredEigenSolver.h:134
void reinit(const double wantedSpectrumLowerBound, const double wantedSpectrumUpperBound, const double unWantedSpectrumUpperBound, const double polynomialDegree, const double illConditionTolerance, MultiVector< ValueTypeOperand, memorySpace > &eigenSubspaceGuess, const size_type eigenVectorBlockSize)
Definition: ChebyshevFilteredEigenSolver.t.cpp:77
double d_unWantedSpectrumUpperBound
Definition: ChebyshevFilteredEigenSolver.h:130
blasLapack::real_type< ValueType > RealType
Definition: ChebyshevFilteredEigenSolver.h:73
double d_wantedSpectrumLowerBound
Definition: ChebyshevFilteredEigenSolver.h:128
typename HermitianIterativeEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace >::OpContext OpContext
Definition: ChebyshevFilteredEigenSolver.h:77
EigenSolverError solve(const OpContext &A, std::vector< RealType > &eigenValues, MultiVector< ValueType, memorySpace > &eigenVectors, bool computeEigenVectors=false, const OpContext &B=IdentityOperatorContext< ValueTypeOperator, ValueTypeOperand, memorySpace >(), const OpContext &BInv=IdentityOperatorContext< ValueTypeOperator, ValueTypeOperand, memorySpace >()) override
Definition: ChebyshevFilteredEigenSolver.t.cpp:114
double d_illConditionTolerance
Definition: ChebyshevFilteredEigenSolver.h:132
blasLapack::scalar_type< ValueTypeOperator, ValueTypeOperand > ValueType
define ValueType as the superior (bigger set) of the ValueTypeOperator and ValueTypeOperand (e....
Definition: ChebyshevFilteredEigenSolver.h:72
Abstract class to encapsulate the action of a discrete operator on vectors, matrices,...
Definition: IdentityOperatorContext.h:53
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition: MultiVector.h:134
A derived class of OperatorContext to encapsulate the action of a discrete operator on vectors,...
Definition: RayleighRitzEigenSolver.h:57
Definition: Profiler.h:44
blas::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:70
blas::real_type< ValueType > real_type
Definition: BlasLapackTypedef.h:64
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8
Definition: LinearAlgebraTypes.h:127