DFT-EFE
Loading...
Searching...
No Matches
Preconditioner.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 dftefePreconditioner_h
27
#define dftefePreconditioner_h
28
29
#include <
utils/MemorySpaceType.h
>
30
#include <
linearAlgebra/OperatorContext.h
>
31
#include <
linearAlgebra/Vector.h
>
32
#include <
linearAlgebra/MultiVector.h
>
33
#include <
linearAlgebra/LinearAlgebraTypes.h
>
34
#include <
linearAlgebra/BlasLapackTypedef.h
>
35
namespace
dftefe
36
{
37
namespace
linearAlgebra
38
{
49
template
<
typename
ValueTypeOperator,
50
typename
ValueTypeOperand,
51
utils::MemorySpace
memorySpace>
52
class
Preconditioner
53
:
public
OperatorContext
<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
//
63
using
ValueTypeUnion
=
64
blasLapack::scalar_type<ValueTypeOperator, ValueTypeOperand>
;
65
66
public
:
71
~Preconditioner
() =
default
;
72
73
/*
74
* @brief Function to apply the pre-conditoner on an input Vector \p x
75
* and store the output in \p y. A typical use case is that the
76
* pre-conditioner is a matrix (\f$A$\f) and we want to evaluate
77
* \f$y=Ax$\f
78
*
79
* @param[in] x Input Vector
80
* @param[out] y Output Vector that stores the action of the operator
81
* on \p x
82
*
83
* @note The input Vector \p x can be modified inside the function for
84
* performance reasons. If the user needs \p x to be constant
85
* (un-modified), we suggest the user to make a copy of \p x
86
* prior to calling this function
87
*
88
*/
89
// virtual void
90
// apply(Vector<ValueTypeOperand, memorySpace> &x,
91
// Vector<ValueTypeUnion, memorySpace> & y) const = 0;
92
93
/*
94
* @brief Function to apply the pre-conditoner on an input Vector \p X
95
* and store the output in \p Y. A typical use case is that the
96
* pre-conditioner is a matrix (\f$A$\f) and we want to evaluate
97
* \f$Y=AX$\f
98
*
99
* @param[in] X Input Vector
100
* @param[out] Y Output Vector that stores the action of the operator
101
* on \p X
102
*
103
* @note The input Vector \p X can be modified inside the function for
104
* performance reasons. If the user needs \p X to be constant
105
* (un-modified), we suggest the user to make a copy of \p X
106
* prior to calling this function
107
*
108
*/
109
virtual
void
110
apply
(
MultiVector<ValueTypeOperand, memorySpace>
&X,
111
MultiVector<ValueTypeUnion, memorySpace>
& Y)
const
= 0;
112
113
virtual
PreconditionerType
114
getPreconditionerType
()
const
= 0;
115
};
116
}
// end of namespace linearAlgebra
117
}
// end of namespace dftefe
118
#endif
// dftefePreconditioner_h
BlasLapackTypedef.h
LinearAlgebraTypes.h
MemorySpaceType.h
MultiVector.h
OperatorContext.h
Vector.h
dftefe::linearAlgebra::MultiVector
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition:
MultiVector.h:134
dftefe::linearAlgebra::OperatorContext
Abstract class to encapsulate the action of a discrete operator on vectors, matrices,...
Definition:
OperatorContext.h:51
dftefe::linearAlgebra::Preconditioner
Abstract class to encapsulate a preconditioner.
Definition:
Preconditioner.h:54
dftefe::linearAlgebra::Preconditioner::apply
virtual void apply(MultiVector< ValueTypeOperand, memorySpace > &X, MultiVector< ValueTypeUnion, memorySpace > &Y) const =0
dftefe::linearAlgebra::Preconditioner::ValueTypeUnion
blasLapack::scalar_type< ValueTypeOperator, ValueTypeOperand > ValueTypeUnion
Definition:
Preconditioner.h:64
dftefe::linearAlgebra::Preconditioner::getPreconditionerType
virtual PreconditionerType getPreconditionerType() const =0
dftefe::linearAlgebra::Preconditioner::~Preconditioner
~Preconditioner()=default
Default Destructor.
dftefe::linearAlgebra::blasLapack::scalar_type
blas::scalar_type< ValueType1, ValueType2 > scalar_type
Definition:
BlasLapackTypedef.h:70
dftefe::linearAlgebra::PreconditionerType
PreconditionerType
Definition:
LinearAlgebraTypes.h:41
dftefe::utils::MemorySpace
MemorySpace
Definition:
MemorySpaceType.h:37
dftefe
dealii includes
Definition:
AtomFieldDataSpherical.cpp:31
src
linearAlgebra
Preconditioner.h
Generated by
1.9.5