GPRidge v1.0.0
GPR-accelerated saddle point searches on potential energy surfaces
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
FileManager.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
// Copyright (c) gpridge developers
3
// See LICENSE for details.
4
5
/*
6
* IOManager.h
7
*
8
* Created on: 17 Jun 2020
9
* Author: Maxim Masterov
10
* Company: SURFSara
11
*/
12
13
#ifndef MANAGERS_IO_FILEMANAGER_H_
14
#define MANAGERS_IO_FILEMANAGER_H_
15
16
#include <algorithm>
17
#include <cassert>
18
#include <fstream>
19
#include <iostream>
20
#include <map>
21
#include <regex>
22
#include <string>
23
#include <type_traits>
24
#include <vector>
25
26
#include "
../../data_types/Field.h
"
27
#include "
../../structures/Structures.h
"
28
29
namespace
gpr
{
30
namespace
io
{
34
class
FileManager
{
35
public
:
36
FileManager
();
37
virtual
~FileManager
();
38
47
void
readInputFile
(
const
std::string file_name,
48
gpr::InputParameters
¶meters);
49
59
template
<
typename
T>
60
void
readDataFile
(
const
std::string file_name,
61
std::map<std::string, T *> &data);
62
72
template
<
typename
T>
73
bool
readFromPlainFile
(
const
std::string file_name, T &
field
);
74
75
template
<
typename
T>
76
bool
writePlainFile
(
const
std::string file_name,
const
T &
field
,
77
std::ios::openmode mode);
78
79
bool
writeXYZFile
(
const
std::string file_name,
const
gpr::Coord
&
field
,
80
std::ios::openmode mode);
81
82
private
:
89
inline
std::vector<std::string> splitString(
const
std::string &str,
90
const
std::string _regex);
91
101
template
<
typename
T>
102
void
convertStringToValue(
103
std::map<std::string, std::vector<std::string> > &input_data,
104
gpr::KeyValuePair<T>
¶meters);
105
115
template
<
typename
T>
116
void
convertStringToString(
117
std::map<std::string, std::vector<std::string> > &input_data,
118
gpr::KeyValuePair<T>
¶meters);
119
130
template
<
typename
T>
131
void
convertStringToValueArray(
132
std::map<std::string, std::vector<std::string> > &input_data,
133
gpr::KeyValuePair<T>
¶meters);
134
145
template
<
typename
T>
146
void
convertStringToStringArray(
147
std::map<std::string, std::vector<std::string> > &input_data,
148
gpr::KeyValuePair<T>
¶meters);
149
};
150
151
}
/* namespace io */
152
}
/* namespace gpr */
153
154
#include "
FileManager.inl
"
155
156
#endif
/* MANAGERS_IO_FILEMANAGER_H_ */
Field.h
FileManager.inl
Structures.h
gpr::io::FileManager::~FileManager
virtual ~FileManager()
Definition
FileManager.cpp:25
gpr::io::FileManager::writePlainFile
bool writePlainFile(const std::string file_name, const T &field, std::ios::openmode mode)
Definition
FileManager.inl:230
gpr::io::FileManager::writeXYZFile
bool writeXYZFile(const std::string file_name, const gpr::Coord &field, std::ios::openmode mode)
Definition
FileManager.cpp:231
gpr::io::FileManager::FileManager
FileManager()
Definition
FileManager.cpp:23
gpr::io::FileManager::readFromPlainFile
bool readFromPlainFile(const std::string file_name, T &field)
Read plain ASCII data file. This function reads data line-by-line from a plain text file....
Definition
FileManager.inl:202
gpr::io::FileManager::readDataFile
void readDataFile(const std::string file_name, std::map< std::string, T * > &data)
Read data file. The method reads data file written in ASCII format. The values of data should point t...
Definition
FileManager.inl:98
gpr::io::FileManager::readInputFile
void readInputFile(const std::string file_name, gpr::InputParameters ¶meters)
Read data from the input file and populates structure of parameters. The input file may have empty li...
Definition
FileManager.cpp:27
gpr::field
Definition
EigenHelpers.h:14
gpr::io
Definition
SeededSearch.h:8
gpr
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition
Macros.h:16
gpr::Coord
FieldMatrixd Coord
Definition
Macros.h:35
gpr::InputParameters
Structure of the input parameters. All input parameters are pairs of string names and values.
Definition
Structures.h:370
gpr::KeyValuePair
Structure of a string key and template value.
Definition
Structures.h:35
managers
io
FileManager.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf