DFT-EFE
 
Loading...
Searching...
No Matches
Field.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, Vishal Subramanian
24 */
25
26#ifndef dftefeField_h
27#define dftefeField_h
28
29#include <basis/BasisManager.h>
35#include <string>
36#include <memory>
37namespace dftefe
38{
39 namespace basis
40 {
45 template <typename ValueTypeBasisCoeff, utils::MemorySpace memorySpace>
46 class Field
47 {
48 public:
49 //
50 // typedefs
51 //
52 using value_type =
53 typename linearAlgebra::MultiVector<ValueTypeBasisCoeff,
54 memorySpace>::value_type;
55 using pointer = typename linearAlgebra::MultiVector<ValueTypeBasisCoeff,
56 memorySpace>::pointer;
57 using reference =
58 typename linearAlgebra::MultiVector<ValueTypeBasisCoeff,
59 memorySpace>::reference;
61 typename linearAlgebra::MultiVector<ValueTypeBasisCoeff,
62 memorySpace>::const_reference;
63 using iterator =
64 typename linearAlgebra::MultiVector<ValueTypeBasisCoeff,
65 memorySpace>::iterator;
67 typename linearAlgebra::MultiVector<ValueTypeBasisCoeff,
68 memorySpace>::const_iterator;
69
70 Field(
72 basisManager,
73 const size_type numVectors,
75 linAlgOpContext);
76
77 ~Field() = default;
78
79 void
80 reinit(
82 basisManager,
83 const size_type numVectors,
85 linAlgOpContext);
86
87 void
89
90 void
92
94 getVector();
95
97 getVector() const;
98
100 getBasisManager() const;
101
103 begin();
104
106 begin() const;
107
109 end();
110
112 end() const;
113
114 void
115 updateGhostValues(const size_type communicationChannel = 0);
116
117 void
118 accumulateAddLocallyOwned(const size_type communicationChannel = 0);
119
120 void
121 updateGhostValuesBegin(const size_type communicationChannel = 0);
122
123 void
125
126 void
127 accumulateAddLocallyOwnedBegin(const size_type communicationChannel = 0);
128
129 void
131
133 getLinAlgOpContext() const;
134
135 private:
136 std::shared_ptr<dftefe::linearAlgebra::LinAlgOpContext<memorySpace>>
138 std::shared_ptr<const BasisManager<ValueTypeBasisCoeff, memorySpace>>
140 std::shared_ptr<
143 }; // end of Field
144 } // end of namespace basis
145} // end of namespace dftefe
146#include <basis/Field.t.cpp>
147#endif // dftefeField_h
An abstract class to encapsulate the partitioning of a basis across multiple processors.
Definition: BasisManager.h:54
Definition: Field.h:47
typename linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace >::pointer pointer
Definition: Field.h:56
void applyConstraintsParentToChild()
Definition: Field.t.cpp:66
void accumulateAddLocallyOwnedEnd()
Definition: Field.t.cpp:175
typename linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace >::reference reference
Definition: Field.h:59
typename linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace >::iterator iterator
Definition: Field.h:65
void accumulateAddLocallyOwnedBegin(const size_type communicationChannel=0)
Definition: Field.t.cpp:167
void updateGhostValues(const size_type communicationChannel=0)
Definition: Field.t.cpp:136
typename linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace >::const_reference const_reference
Definition: Field.h:62
void applyConstraintsChildToParent()
Definition: Field.t.cpp:76
typename linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace >::value_type value_type
Definition: Field.h:54
typename linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace >::const_iterator const_iterator
Definition: Field.h:68
void reinit(std::shared_ptr< const BasisManager< ValueTypeBasisCoeff, memorySpace > > basisManager, const size_type numVectors, std::shared_ptr< dftefe::linearAlgebra::LinAlgOpContext< memorySpace > > linAlgOpContext)
Definition: Field.t.cpp:44
void updateGhostValuesBegin(const size_type communicationChannel=0)
Definition: Field.t.cpp:152
iterator end()
Definition: Field.t.cpp:122
std::shared_ptr< linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > > d_vector
Definition: Field.h:142
void accumulateAddLocallyOwned(const size_type communicationChannel=0)
Definition: Field.t.cpp:144
linearAlgebra::LinAlgOpContext< memorySpace > & getLinAlgOpContext() const
Definition: Field.t.cpp:182
iterator begin()
Definition: Field.t.cpp:108
linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > & getVector()
Definition: Field.t.cpp:86
void updateGhostValuesEnd()
Definition: Field.t.cpp:160
const BasisManager< ValueTypeBasisCoeff, memorySpace > & getBasisManager() const
Definition: Field.t.cpp:101
std::shared_ptr< const BasisManager< ValueTypeBasisCoeff, memorySpace > > d_basisManager
Definition: Field.h:139
std::shared_ptr< dftefe::linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: Field.h:137
Definition: LinAlgOpContext.h:38
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition: MultiVector.h:134
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8