-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathinput.h
More file actions
29 lines (25 loc) · 748 Bytes
/
input.h
File metadata and controls
29 lines (25 loc) · 748 Bytes
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
#ifndef INPUT_H
#define INPUT_H
#include <istream>
#include <string>
#include <string_view>
void input(int rank);
void read_parameterfile(int rank);
void update_parameterfile(int nts);
void setup_cellcache();
void setup_timesteps();
void write_timestep_file();
auto get_noncommentline(std::istream& input, std::string& line) -> bool;
// return true for whitespace-only lines, and lines that are exclusively whitespace up to a '#' character
[[nodiscard]] constexpr auto lineiscommentonly(const std::string_view line) -> bool {
for (char const i : line) {
if (i == '#') { // anything to the right of a # character doesn't count
return true;
}
if (i != ' ') {
return false;
}
}
return true;
}
#endif // INPUT_H