DFT-EFE
 
Loading...
Searching...
No Matches
PreconditionerJacobi.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 Bikash Kanungo
24 */
25
26#ifndef dftefePreconditionerJacobi_h
27#define dftefePreconditionerJacobi_h
28
35namespace dftefe
36{
37 namespace linearAlgebra
38 {
49 template <typename ValueTypeOperator,
50 typename ValueTypeOperand,
51 utils::MemorySpace memorySpace>
53 : public Preconditioner<ValueTypeOperator, ValueTypeOperand, memorySpace>
54 {
55 //
56 // typedefs
57 //
58 public:
59 //
60 // alias to define the union of ValueTypeOperator and ValueTypeOperand
61 // (e.g., the union of double and complex<double> is complex<double>)
62 //
65
66 public:
75
81
82 /*
83 * @brief Function to apply the Jacobi preconditioner on an input Vector \p x
84 * and store the output in \p y. That is, it stores \f$y_i=1/x_i$\f
85 *
86 * @param[in] x Input Vector
87 * @param[out] y Output Vector
88 *
89 * @note The input Vector \p x can be modified inside the function for
90 * performance reasons. If the user needs \p x to be constant
91 * (un-modified), we suggest the user to make a copy of \p x
92 * prior to calling this function
93 *
94 */
95 // void
96 // apply(Vector<ValueTypeOperand, memorySpace> &x,
97 // Vector<ValueTypeUnion, memorySpace> & y) const override;
98
99 /*
100 * @brief Function to apply the Jacobi preconditioner on an input Vector \p X
101 * and store the output in \p Y. That is, it stores \f$Y_i=1/X_i$\f
102 *
103 * @param[in] X Input Vector
104 * @param[out] Y Output Vector
105 *
106 * @note The input Vector \p X can be modified inside the function for
107 * performance reasons. If the user needs \p X to be constant
108 * (un-modified), we suggest the user to make a copy of \p X
109 * prior to calling this function
110 *
111 */
112 void
115
117 getPreconditionerType() const override;
118
119 private:
122 };
123
124
125 } // end of namespace linearAlgebra
126} // end of namespace dftefe
128#endif // dftefePreconditionerJacobi_h
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition: MultiVector.h:134
Class to encapsulate the Jacobi preconditioner.
Definition: PreconditionerJacobi.h:54
PreconditionerType getPreconditionerType() const override
Definition: PreconditionerJacobi.t.cpp:83
PreconditionerType d_pcType
Definition: PreconditionerJacobi.h:121
void apply(MultiVector< ValueTypeOperand, memorySpace > &X, MultiVector< ValueTypeUnion, memorySpace > &Y) const override
Definition: PreconditionerJacobi.t.cpp:56
blasLapack::scalar_type< ValueTypeOperator, ValueTypeOperand > ValueTypeUnion
Definition: PreconditionerJacobi.h:64
Vector< ValueTypeOperator, memorySpace > d_diagonalInv
Definition: PreconditionerJacobi.h:120
~PreconditionerJacobi()=default
Default Destructor.
Abstract class to encapsulate a preconditioner.
Definition: Preconditioner.h:54
A class that encapsulates a vector. This is a vector in the mathematical sense and not in the sense o...
Definition: Vector.h:122
blas::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:70
PreconditionerType
Definition: LinearAlgebraTypes.h:41
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31