Repository navigation
Expand file tree
/
Copy pathparameter.h
More file actions
60 lines (52 loc) · 1.78 KB
/
Copy pathparameter.h
File metadata and controls
60 lines (52 loc) · 1.78 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
#ifndef PARAMETER_H
#define PARAMETER_H
#include "input_parameter.h"
#include "system_parameter.h"
namespace ModuleIO
{
class ReadInput;
}
class CalAtomInfo;
class Parameter
{
public:
// Construct a new Parameter object
Parameter(){};
// Destruct the Parameter object
~Parameter(){};
public:
// ---------------------------------------------------------------
// -------------- Getters ----------------
// ---------------------------------------------------------------
// We can only read the value of input, but cannot modify it.
const Input_para& inp = input;
// We can only read the value of mdp, but cannot modify it.
const MD_para& mdp = input.mdp;
// We can only read the value of globalv parameters, but cannot modify it.
const System_para& globalv = sys;
// Set the rank & nproc & nthreads_per_proc
// changed from set_rank_nproc in 2024-1018
void set_pal_param(const int& myrank, const int& nproc, const int& nthread_per_proc);
// Set the start time
void set_start_time(const std::time_t& start_time);
private:
// Only ReadInput and CalAtomInfo can modify the value of Parameter.
// Do not add extra friend class here!!!
friend class ModuleIO::ReadInput; // ReadInput read INPUT file and give the value to Parameter
friend class CalAtomsInfo; // CalAtomInfo calculate the atom information from pseudopotential and give the value to
// Parameter
// INPUT parameters
Input_para input;
// System parameters
System_para sys;
};
extern Parameter PARAM;
// temperarily put here
namespace GlobalV
{
extern int NPROC;
extern int MY_RANK;
extern std::ofstream ofs_running;
extern std::ofstream ofs_warning;
} // namespace GlobalV
#endif