-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathMVPSolver.h
More file actions
72 lines (57 loc) · 1.88 KB
/
Copy pathMVPSolver.h
File metadata and controls
72 lines (57 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright (c) 2017, Lawrence Livermore National Security, LLC and
// UT-Battelle, LLC.
// Produced at the Lawrence Livermore National Laboratory and the Oak Ridge
// National Laboratory.
// LLNL-CODE-743438
// All rights reserved.
// This file is part of MGmol. For details, see https://github.com/llnl/mgmol.
// Please also read this link https://github.com/llnl/mgmol/LICENSE
#ifndef MGMOL_MVPSOLVER_H
#define MGMOL_MVPSOLVER_H
#include "Energy.h"
#include "MGmol.h"
#include "Rho.h"
#include "Timer.h"
class Ions;
class Electrostatic;
template <class OrbitalsType>
class ProjectedMatrices;
template <class OrbitalsType, class MatrixType>
class MVPSolver
{
private:
const MPI_Comm comm_;
std::ostream& os_;
const short n_inner_steps_;
const bool use_old_dm_;
Ions& ions_;
int numst_;
double mixing_;
/*!
* tolerance on energy slope in inner iterations
*/
double tol_de0_;
Rho<OrbitalsType>* rho_;
Energy<OrbitalsType>* energy_;
Electrostatic* electrostat_;
MGmol<OrbitalsType>* mgmol_strategy_;
MatrixType* work_;
ProjectedMatrices<MatrixType>* proj_mat_work_;
static Timer solve_tm_;
static Timer target_tm_;
double evaluateDerivative(
MatrixType& dm2Ninit, MatrixType& delta_dm, const double ts0);
void buildTarget_MVP(MatrixType& h11, MatrixType& s11, MatrixType& target);
public:
MVPSolver(MPI_Comm comm, std::ostream& os, Ions& ions,
Rho<OrbitalsType>* rho, Energy<OrbitalsType>* energy,
Electrostatic* electrostat, MGmol<OrbitalsType>* mgmol_strategy,
const int numst, const double kbT,
const std::vector<std::vector<int>>& global_indexes,
const short n_inner_steps, const double mixing, const double tol_de0,
const bool use_old_dm);
~MVPSolver();
int solve(OrbitalsType& orbitals);
static void printTimers(std::ostream& os);
};
#endif