DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
dealiiLinearSolver.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
19#include <linearSolver.h>
20
21#ifndef dealiiLinearSolver_H_
22# define dealiiLinearSolver_H_
23
24namespace dftfe
25{
26 /**
27 * @brief dealii linear solver class wrapper
28 *
29 * @author Sambit Das
30 */
32 {
33 public:
35 {
36 CG = 0,
38 };
39
40 /**
41 * @brief Constructor
42 *
43 * @param mpi_comm_parent parent mpi communicato
44 * @param mpi_comm_domain domain mpi communicator
45 * @param type enum specifying the choice of the dealii linear solver
46 */
47 dealiiLinearSolver(const MPI_Comm & mpi_comm_parent,
48 const MPI_Comm & mpi_comm_domain,
49 const solverType type);
50
51 /**
52 * @brief Solve linear system, A*x=Rhs
53 *
54 * @param problem linearSolverProblem object (functor) to compute Rhs and A*x, and preconditioning
55 * @param relTolerance Tolerance (relative) required for convergence.
56 * @param maxNumberIterations Maximum number of iterations.
57 * @param debugLevel Debug output level:
58 * 0 - no debug output
59 * 1 - limited debug output
60 * 2 - all debug output.
61 */
62 void
64 const double absTolerance,
65 const unsigned int maxNumberIterations,
66 const int debugLevel = 0,
67 bool distributeFlag = true);
68
69 private:
70 /// enum denoting the choice of the dealii solver
72
73 /// define some temporary vectors
75
76 const MPI_Comm d_mpiCommParent;
77 const MPI_Comm mpi_communicator;
78 const unsigned int n_mpi_processes;
79 const unsigned int this_mpi_process;
80 dealii::ConditionalOStream pcout;
81 };
82
83} // namespace dftfe
84
85#endif
dealii::ConditionalOStream pcout
Definition dealiiLinearSolver.h:80
distributedCPUVec< double > gvec
define some temporary vectors
Definition dealiiLinearSolver.h:74
solverType
Definition dealiiLinearSolver.h:35
@ GMRES
Definition dealiiLinearSolver.h:37
@ CG
Definition dealiiLinearSolver.h:36
const unsigned int n_mpi_processes
Definition dealiiLinearSolver.h:78
const MPI_Comm d_mpiCommParent
Definition dealiiLinearSolver.h:76
const MPI_Comm mpi_communicator
Definition dealiiLinearSolver.h:77
const solverType d_type
enum denoting the choice of the dealii solver
Definition dealiiLinearSolver.h:71
dealiiLinearSolver(const MPI_Comm &mpi_comm_parent, const MPI_Comm &mpi_comm_domain, const solverType type)
Constructor.
const unsigned int this_mpi_process
Definition dealiiLinearSolver.h:79
distributedCPUVec< double > hvec
Definition dealiiLinearSolver.h:74
distributedCPUVec< double > dvec
Definition dealiiLinearSolver.h:74
void solve(dealiiLinearSolverProblem &problem, const double absTolerance, const unsigned int maxNumberIterations, const int debugLevel=0, bool distributeFlag=true)
Solve linear system, A*x=Rhs.
Abstract class for linear solve problems to be used with the dealiiLinearSolver interface.
Definition dealiiLinearSolverProblem.h:31
linearSolver()
Constructor.
Definition pseudoPotentialToDftfeConverter.cc:34
dealii::LinearAlgebra::distributed::Vector< elem_type, dealii::MemorySpace::Host > distributedCPUVec
Definition headers.h:92