DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
linearSolverProblemDevice.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (c) 2017-2025 The Regents of the University of Michigan and DFT-FE
4// authors.
5//
6// This file is part of the DFT-FE code.
7//
8// The DFT-FE code is free software; you can use it, redistribute
9// it, and/or modify it under the terms of the GNU Lesser General
10// Public License as published by the Free Software Foundation; either
11// version 2.1 of the License, or (at your option) any later version.
12// The full text of the license can be found in the file LICENSE at
13// the top level of the DFT-FE distribution.
14//
15// ---------------------------------------------------------------------
16//
17
18#if defined(DFTFE_WITH_DEVICE)
19# ifndef linearSolverProblemDevice_H_
20# define linearSolverProblemDevice_H_
21
22# include <headers.h>
23
24namespace dftfe
25{
26 /**
27 * @brief Abstract class for linear solver problems to be used with the linearSolverCGDevice interface.
28 *
29 * @author Phani Motamarri, Sambit Das, Gourab Panigrahi
30 */
31 class linearSolverProblemDevice
32 {
33 public:
34 /**
35 * @brief Constructor.
36 */
37 linearSolverProblemDevice();
38
39 /**
40 * @brief get the reference to x field
41 *
42 * @return reference to x field. Assumes x field data structure is already initialized
43 */
44 virtual distributedDeviceVec<double> &
45 getX() = 0;
46
47 /**
48 * @brief get the reference to Preconditioner
49 *
50 * @return reference to Preconditioner
51 */
52 virtual distributedDeviceVec<double> &
53 getPreconditioner() = 0;
54
55 /**
56 * @brief Compute A matrix multipled by x.
57 *
58 */
59 virtual void
60 computeAX(distributedDeviceVec<double> &dst,
61 distributedDeviceVec<double> &src) = 0;
62
63 /**
64 * @brief Compute right hand side vector for the problem Ax = rhs.
65 *
66 * @param rhs vector for the right hand side values
67 */
68 virtual void
69 computeRhs(distributedCPUVec<double> &rhs) = 0;
70
71 /**
72 * @brief distribute x to the constrained nodes.
73 *
74 */
75 virtual void
76 setX() = 0;
77
78 virtual void
79 distributeX() = 0;
80
81 /**
82 * @brief copies x from device to host
83 *
84 */
85 virtual void
86 copyXfromDeviceToHost() = 0;
87
88 // protected:
89
90 /// typedef declaration needed by dealii
91 typedef dealii::types::global_dof_index size_type;
92 };
93
94} // namespace dftfe
95# endif // linearSolverProblemDevice_H_
96#endif
Definition pseudoPotentialToDftfeConverter.cc:34
unsigned int size_type
Definition TypeConfig.h:6