|
8 | 8 |
|
9 | 9 | namespace ModuleIO |
10 | 10 | { |
11 | | -bool read_cube( |
| 11 | +extern bool read_cube( |
12 | 12 | #ifdef __MPI |
13 | | - Parallel_Grid* Pgrid, |
| 13 | + const Parallel_Grid*const Pgrid, |
14 | 14 | #endif |
15 | | - int my_rank, |
16 | | - std::string esolver_type, |
17 | | - int rank_in_stogroup, |
18 | | - const int& is, |
| 15 | + const int my_rank, |
| 16 | + const std::string esolver_type, |
| 17 | + const int rank_in_stogroup, |
| 18 | + const int is, |
19 | 19 | std::ofstream& ofs_running, |
20 | | - const int& nspin, |
| 20 | + const int nspin, |
21 | 21 | const std::string& fn, |
22 | | - double* data, |
23 | | - const int& nx, |
24 | | - const int& ny, |
25 | | - const int& nz, |
| 22 | + double*const data, |
| 23 | + const int nx, |
| 24 | + const int ny, |
| 25 | + const int nz, |
26 | 26 | double& ef, |
27 | | - const UnitCell* ucell, |
| 27 | + const UnitCell*const ucell, |
28 | 28 | int& prenspin, |
29 | | - const bool& warning_flag = true); |
| 29 | + const bool warning_flag = true); |
30 | 30 |
|
31 | | -void write_cube( |
| 31 | +extern void write_cube( |
32 | 32 | #ifdef __MPI |
33 | | - const int& bz, |
34 | | - const int& nbz, |
35 | | - const int& nplane, |
36 | | - const int& startz_current, |
| 33 | + const int bz, |
| 34 | + const int nbz, |
| 35 | + const int nplane, |
| 36 | + const int startz_current, |
37 | 37 | #endif |
38 | | - const double* data, |
39 | | - const int& is, |
40 | | - const int& nspin, |
41 | | - const int& iter, |
| 38 | + const double*const data, |
| 39 | + const int is, |
| 40 | + const int nspin, |
| 41 | + const int iter, |
42 | 42 | const std::string& fn, |
43 | | - const int& nx, |
44 | | - const int& ny, |
45 | | - const int& nz, |
46 | | - const double& ef, |
47 | | - const UnitCell* ucell, |
48 | | - const int& precision = 11, |
49 | | - const int& out_fermi = 1); // mohan add 2007-10-17 |
| 43 | + const int nx, |
| 44 | + const int ny, |
| 45 | + const int nz, |
| 46 | + const double ef, |
| 47 | + const UnitCell*const ucell, |
| 48 | + const int precision = 11, |
| 49 | + const int out_fermi = 1); // mohan add 2007-10-17 |
| 50 | + |
| 51 | + |
| 52 | +extern void read_cube_core_match( |
| 53 | + std::ifstream &ifs, |
| 54 | +#ifdef __MPI |
| 55 | + const Parallel_Grid*const Pgrid, |
| 56 | + const bool flag_read_rank, |
| 57 | +#endif |
| 58 | + double*const data, |
| 59 | + const int nxy, |
| 60 | + const int nz); |
| 61 | + |
| 62 | +extern void read_cube_core_mismatch( |
| 63 | + std::ifstream &ifs, |
| 64 | +#ifdef __MPI |
| 65 | + const Parallel_Grid*const Pgrid, |
| 66 | + const bool flag_read_rank, |
| 67 | +#endif |
| 68 | + double*const data, |
| 69 | + const int nx, |
| 70 | + const int ny, |
| 71 | + const int nz, |
| 72 | + const int nx_read, |
| 73 | + const int ny_read, |
| 74 | + const int nz_read); |
| 75 | + |
| 76 | +extern void write_cube_core( |
| 77 | + std::ofstream &ofs_cube, |
| 78 | +#ifdef __MPI |
| 79 | + const int bz, |
| 80 | + const int nbz, |
| 81 | + const int nplane, |
| 82 | + const int startz_current, |
| 83 | +#endif |
| 84 | + const double*const data, |
| 85 | + const int nxy, |
| 86 | + const int nz, |
| 87 | + const int n_data_newline); |
50 | 88 |
|
51 | 89 | /** |
52 | 90 | * @brief The trilinear interpolation method |
@@ -78,15 +116,15 @@ void write_cube( |
78 | 116 | * @param nz the dimension of grids along z |
79 | 117 | * @param data the interpolated results |
80 | 118 | */ |
81 | | - void trilinear_interpolate(std::ifstream& ifs, |
| 119 | + extern void trilinear_interpolate(std::ifstream& ifs, |
82 | 120 | const int& nx_read, |
83 | 121 | const int& ny_read, |
84 | 122 | const int& nz_read, |
85 | 123 | const int& nx, |
86 | 124 | const int& ny, |
87 | 125 | const int& nz, |
88 | 126 | #ifdef __MPI |
89 | | - double** data |
| 127 | + std::vector<std::vector<double>> &data |
90 | 128 | #else |
91 | 129 | double* data |
92 | 130 | #endif |
|
0 commit comments