DFT-EFE
 
Loading...
Searching...
No Matches
PoissonLinearSolverFunctionFE.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 dftefePoissonLinearSolverFunctionFE_h
27#define dftefePoissonLinearSolverFunctionFE_h
28
29#include <utils/TypeConfig.h>
41#include <vector>
42#include <memory>
43#include <utils/Profiler.h>
44
45namespace dftefe
46{
47 namespace electrostatics
48 {
70 template <typename ValueTypeOperator,
71 typename ValueTypeOperand,
72 utils::MemorySpace memorySpace,
73 size_type dim>
75 : public linearAlgebra::
76 LinearSolverFunction<ValueTypeOperator, ValueTypeOperand, memorySpace>
77 {
78 public:
85 using ValueType =
87 ValueTypeOperand>;
88
89 public:
94 std::shared_ptr<const basis::FEBasisManager<ValueTypeOperand,
95 ValueTypeOperator,
96 memorySpace,
97 dim>> feBasisManagerField,
98 std::shared_ptr<
100 feBasisDataStorageStiffnessMatrix,
101 const std::map<
102 std::string,
103 std::shared_ptr<
105 &feBasisDataStorageRhs,
106 const std::map<
107 std::string,
109 & inpRhs,
112 linAlgOpContext,
113 const size_type maxCellBlock,
114 const size_type maxFieldBlock);
115
120 std::shared_ptr<const basis::FEBasisManager<ValueTypeOperand,
121 ValueTypeOperator,
122 memorySpace,
123 dim>> feBasisManagerField,
124 std::shared_ptr<
126 feBasisDataStorageStiffnessMatrix,
127 std::shared_ptr<
129 feBasisDataStorageRhs,
131 & inpRhs,
134 linAlgOpContext,
135 const size_type maxCellBlock,
136 const size_type maxFieldBlock);
137
138 void
139 reinit(
140 std::shared_ptr<const basis::FEBasisManager<ValueTypeOperand,
141 ValueTypeOperator,
142 memorySpace,
143 dim>> feBasisManagerField,
144 const std::map<
145 std::string,
147 &inpRhs);
148
149 void
151 std::shared_ptr<const basis::FEBasisManager<ValueTypeOperand,
152 ValueTypeOperator,
153 memorySpace,
154 dim>> feBasisManagerField,
156 &inpRhs);
157
159
160 const linearAlgebra::
161 OperatorContext<ValueTypeOperator, ValueTypeOperand, memorySpace> &
162 getAxContext() const override;
163
164 const linearAlgebra::
165 OperatorContext<ValueTypeOperator, ValueTypeOperand, memorySpace> &
166 getPCContext() const override;
167
168 void
171
172 void
175
177 getRhs() const override;
178
180 getInitialGuess() const override;
181
182 const utils::mpi::MPIComm &
183 getMPIComm() const override;
184
185 private:
187 std::shared_ptr<
188 const basis::
189 FEBasisManager<ValueTypeOperand, ValueTypeOperator, memorySpace, dim>>
191 std::shared_ptr<
192 const basis::
193 FEBasisManager<ValueTypeOperand, ValueTypeOperator, memorySpace, dim>>
195 std::shared_ptr<LaplaceOperatorContextFE<ValueTypeOperator,
196 ValueTypeOperand,
197 memorySpace,
198 dim>>
200 std::shared_ptr<LaplaceOperatorContextFE<ValueTypeOperator,
201 ValueTypeOperand,
202 memorySpace,
203 dim>>
205 std::shared_ptr<const linearAlgebra::OperatorContext<ValueTypeOperator,
206 ValueTypeOperand,
207 memorySpace>>
215 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
219 std::shared_ptr<
224 std::map<std::string,
227 std::map<std::string,
230 std::map<
231 std::string,
232 std::shared_ptr<
235
236 }; // end of class PoissonLinearSolverFunctionFE
237 } // namespace electrostatics
238} // end of namespace dftefe
240#endif // dftefePoissonLinearSolverFunctionFE_h
An abstract class to store and access data for a given basis, such as the basis function values on a ...
Definition: FEBasisDataStorage.h:54
An abstract class to encapsulate the partitioning of a finite element basis across multiple processor...
Definition: FEBasisManager.h:44
A derived class of linearAlgebra::OperatorContext to encapsulate the action of a discrete operator on...
Definition: LaplaceOperatorContextFE.h:63
A derived class of linearAlgebra::LinearSolverFunction to encapsulate the Poisson partial differentia...
Definition: PoissonLinearSolverFunctionFE.h:77
size_type d_numComponents
Definition: PoissonLinearSolverFunctionFE.h:186
const utils::mpi::MPIComm & getMPIComm() const override
Definition: PoissonLinearSolverFunctionFE.t.cpp:652
void getSolution(linearAlgebra::MultiVector< ValueType, memorySpace > &solution) override
Definition: PoissonLinearSolverFunctionFE.t.cpp:587
linearAlgebra::MultiVector< ValueTypeOperand, memorySpace > d_fieldInHomoDBCVec
Definition: PoissonLinearSolverFunctionFE.h:214
void setSolution(const linearAlgebra::MultiVector< ValueType, memorySpace > &x) override
Definition: PoissonLinearSolverFunctionFE.t.cpp:570
linearAlgebra::MultiVector< ValueType, memorySpace > d_b
Definition: PoissonLinearSolverFunctionFE.h:211
std::shared_ptr< LaplaceOperatorContextFE< ValueTypeOperator, ValueTypeOperand, memorySpace, dim > > d_AxContextNHDB
Definition: PoissonLinearSolverFunctionFE.h:204
std::shared_ptr< const linearAlgebra::OperatorContext< ValueTypeOperator, ValueTypeOperand, memorySpace > > d_PCContext
Definition: PoissonLinearSolverFunctionFE.h:208
utils::Profiler d_p
Definition: PoissonLinearSolverFunctionFE.h:222
void reinit(std::shared_ptr< const basis::FEBasisManager< ValueTypeOperand, ValueTypeOperator, memorySpace, dim > > feBasisManagerField, const quadrature::QuadratureValuesContainer< ValueType, memorySpace > &inpRhs)
utils::ConditionalOStream d_rootCout
Definition: PoissonLinearSolverFunctionFE.h:223
std::shared_ptr< LaplaceOperatorContextFE< ValueTypeOperator, ValueTypeOperand, memorySpace, dim > > d_AxContext
Definition: PoissonLinearSolverFunctionFE.h:199
PoissonLinearSolverFunctionFE(std::shared_ptr< const basis::FEBasisManager< ValueTypeOperand, ValueTypeOperator, memorySpace, dim > > feBasisManagerField, std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeOperator, memorySpace > > feBasisDataStorageStiffnessMatrix, std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeOperator, memorySpace > > feBasisDataStorageRhs, const quadrature::QuadratureValuesContainer< ValueType, memorySpace > &inpRhs, const linearAlgebra::PreconditionerType pcType, std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > linAlgOpContext, const size_type maxCellBlock, const size_type maxFieldBlock)
This constructor creates an instance of a base LinearSolverFunction called PoissonLinearSolverFE.
std::map< std::string, linearAlgebra::MultiVector< ValueTypeOperand, memorySpace > > d_rhsMultiVecComponent
Definition: PoissonLinearSolverFunctionFE.h:226
linearAlgebra::PreconditionerType d_pcType
Definition: PoissonLinearSolverFunctionFE.h:209
const linearAlgebra::MultiVector< ValueType, memorySpace > & getInitialGuess() const override
Definition: PoissonLinearSolverFunctionFE.t.cpp:639
std::map< std::string, quadrature::QuadratureValuesContainer< ValueType, memorySpace > > d_rhsQuadValComponent
Definition: PoissonLinearSolverFunctionFE.h:229
std::map< std::string, std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeOperator, memorySpace > > > d_feBasisDataStorageRhs
Definition: PoissonLinearSolverFunctionFE.h:234
void reinit(std::shared_ptr< const basis::FEBasisManager< ValueTypeOperand, ValueTypeOperator, memorySpace, dim > > feBasisManagerField, const std::map< std::string, const quadrature::QuadratureValuesContainer< ValueType, memorySpace > & > &inpRhs)
Definition: PoissonLinearSolverFunctionFE.t.cpp:326
linearAlgebra::MultiVector< ValueType, memorySpace > d_initial
Definition: PoissonLinearSolverFunctionFE.h:212
linearAlgebra::MultiVector< ValueType, memorySpace > d_x
Definition: PoissonLinearSolverFunctionFE.h:210
const linearAlgebra::MultiVector< ValueTypeOperand, memorySpace > & getRhs() const override
Definition: PoissonLinearSolverFunctionFE.t.cpp:623
const size_type d_maxCellBlock
Definition: PoissonLinearSolverFunctionFE.h:217
linearAlgebra::blasLapack::scalar_type< ValueTypeOperator, ValueTypeOperand > ValueType
define ValueType as the superior (bigger set) of the ValueTypeOperator and ValueTypeOperand (e....
Definition: PoissonLinearSolverFunctionFE.h:87
std::shared_ptr< const basis::FEBasisManager< ValueTypeOperand, ValueTypeOperator, memorySpace, dim > > d_feBasisManagerHomo
Definition: PoissonLinearSolverFunctionFE.h:194
std::shared_ptr< const basis::FEBasisManager< ValueTypeOperand, ValueTypeOperator, memorySpace, dim > > d_feBasisManagerField
Definition: PoissonLinearSolverFunctionFE.h:190
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: PoissonLinearSolverFunctionFE.h:216
const linearAlgebra::OperatorContext< ValueTypeOperator, ValueTypeOperand, memorySpace > & getPCContext() const override
Definition: PoissonLinearSolverFunctionFE.t.cpp:556
const size_type d_maxFieldBlock
Definition: PoissonLinearSolverFunctionFE.h:218
const linearAlgebra::OperatorContext< ValueTypeOperator, ValueTypeOperand, memorySpace > & getAxContext() const override
Definition: PoissonLinearSolverFunctionFE.t.cpp:542
std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeOperator, memorySpace > > d_feBasisDataStorageStiffnessMatrix
Definition: PoissonLinearSolverFunctionFE.h:221
Definition: LinAlgOpContext.h:38
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
Definition: QuadratureValuesContainer.h:39
Provides an interface to print based on whether a certain condition is met or not....
Definition: ConditionalOStream.h:47
Definition: Profiler.h:44
blas::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:70
PreconditionerType
Definition: LinearAlgebraTypes.h:41
int MPIComm
Definition: MPITypes.h:83
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8