DFT-EFE
 
Loading...
Searching...
No Matches
OperatorContext.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 dftefeOperatorContext_h
27#define dftefeOperatorContext_h
28
33namespace dftefe
34{
35 namespace linearAlgebra
36 {
47 template <typename ValueTypeOperator,
48 typename ValueTypeOperand,
49 utils::MemorySpace memorySpace>
51 {
52 //
53 // typedefs
54 //
55 public:
56 //
57 // alias to define the union of ValueTypeOperator and ValueTypeOperand
58 // (e.g., the union of double and complex<double> is complex<double>)
59 //
62
63 public:
68 ~OperatorContext() = default;
69
70 /*
71 * @brief Function to apply the operator on an input Vector \p x and store
72 * the output in \p y. A typical use case is that the operator is a matrix
73 * (\f$A$\f) and we want to evaluate \f$y=Ax$\f
74 *
75 * @param[in] x Input Vector
76 * @param[out] y Output Vector that stores the action of the operator
77 * on \p x
78 *
79 * @note The input Vector \p x can be modified inside the function for
80 * performance reasons. If the user needs \p x to be constant
81 * (un-modified), we suggest the user to make a copy of \p x
82 * prior to calling this function
83 *
84 */
85 // virtual void
86 // apply(Vector<ValueTypeOperand, memorySpace> &x,
87 // Vector<ValueTypeUnion, memorySpace> & y) const = 0;
88
89 /*
90 * @brief Function to apply the operator on an input Vector \p X and store
91 * the output in \p Y. A typical use case is that the operator is a matrix
92 * (\f$A$\f) and we want to evaluate \f$Y=AX$\f
93 *
94 * @param[in] X Input Vector
95 * @param[out] Y Output Vector that stores the action of the operator
96 * on \p X
97 *
98 * @note The input Vector \p X can be modified inside the function for
99 * performance reasons. If the user needs \p X to be constant
100 * (un-modified), we suggest the user to make a copy of \p X
101 * prior to calling this function
102 *
103 */
104 virtual void
107 };
108 } // end of namespace linearAlgebra
109} // end of namespace dftefe
110#endif // dftefeOperatorContext_h
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition: MultiVector.h:134
Abstract class to encapsulate the action of a discrete operator on vectors, matrices,...
Definition: OperatorContext.h:51
virtual void apply(MultiVector< ValueTypeOperand, memorySpace > &X, MultiVector< ValueTypeUnion, memorySpace > &Y) const =0
~OperatorContext()=default
Default Destructor.
blasLapack::scalar_type< ValueTypeOperator, ValueTypeOperand > ValueTypeUnion
Definition: OperatorContext.h:61
blas::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:70
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31