DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
dealiiLinearSolverProblem.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#include <headers.h>
19
20#ifndef dealiiLinearSolverProblem_H_
21# define dealiiLinearSolverProblem_H_
22
23namespace dftfe
24{
25 /**
26 * @brief Abstract class for linear solve problems to be used with the dealiiLinearSolver interface.
27 *
28 * @author Sambit Das
29 */
31 {
32 public:
33 /**
34 * @brief Constructor.
35 */
37
38 /**
39 * @brief get the reference to x field
40 *
41 * @return reference to x field. Assumes x field data structure is already initialized
42 */
44 getX() = 0;
45
46 /**
47 * @brief Compute A matrix multipled by x.
48 *
49 */
50 virtual void
52
53 /**
54 * @brief Compute right hand side vector for the problem Ax = rhs.
55 *
56 * @param rhs vector for the right hand side values
57 */
58 virtual void
60
61 /**
62 * @brief Jacobi preconditioning function.
63 *
64 */
65 virtual void
68 const double omega) const = 0;
69
70 /**
71 * @brief distribute x to the constrained nodes.
72 *
73 */
74 virtual void
76
77 /// function needed by dealii to mimic SparseMatrix for Jacobi
78 /// preconditioning
79 virtual void
80 subscribe(std::atomic<bool> *const validity,
81 const std::string & identifier = "") const = 0;
82
83 /// function needed by dealii to mimic SparseMatrix for Jacobi
84 /// preconditioning
85 virtual void
86 unsubscribe(std::atomic<bool> *const validity,
87 const std::string & identifier = "") const = 0;
88
89 /// function needed by dealii to mimic SparseMatrix
90 virtual bool
91 operator!=(double val) const = 0;
92
93 // protected:
94
95 /// typedef declaration needed by dealii
96 typedef dealii::types::global_dof_index size_type;
97 };
98
99} // namespace dftfe
100#endif // dealiiLinearSolverProblem_H_
virtual void vmult(distributedCPUVec< double > &Ax, distributedCPUVec< double > &x)=0
Compute A matrix multipled by x.
virtual void precondition_Jacobi(distributedCPUVec< double > &dst, const distributedCPUVec< double > &src, const double omega) const =0
Jacobi preconditioning function.
virtual void unsubscribe(std::atomic< bool > *const validity, const std::string &identifier="") const =0
virtual void computeRhs(distributedCPUVec< double > &rhs)=0
Compute right hand side vector for the problem Ax = rhs.
virtual void distributeX()=0
distribute x to the constrained nodes.
virtual distributedCPUVec< double > & getX()=0
get the reference to x field
dealii::types::global_dof_index size_type
typedef declaration needed by dealii
Definition dealiiLinearSolverProblem.h:96
virtual bool operator!=(double val) const =0
function needed by dealii to mimic SparseMatrix
virtual void subscribe(std::atomic< bool > *const validity, const std::string &identifier="") const =0
Definition pseudoPotentialToDftfeConverter.cc:34
dealii::LinearAlgebra::distributed::Vector< elem_type, dealii::MemorySpace::Host > distributedCPUVec
Definition headers.h:92