-
Notifications
You must be signed in to change notification settings - Fork 0
/
reader.h
65 lines (46 loc) · 1.52 KB
/
reader.h
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
//
// Created by Jon on 21/08/2015.
//
#ifndef XYZ_CIFREADER_H
#define XYZ_CIFREADER_H
// for file input
#include <string>
#include <fstream>
#include <streambuf>
#include <regex>
#include <sstream>
#include <vector>
#include <Eigen/Dense>
#include "utilities.h"
#include "atomsite.h"
#include "symmetryoperation.h"
#include "unitcell.h"
#include "cellgeometry.h"
namespace CIF {
class Reader {
public:
Reader() = default;
// constructor that takes filename
explicit Reader(std::string filePath, bool attempt_fixes = false);
// method to return a class instance that will contain the unit cell information
UnitCell getUnitCell() { return UnitCell(cell, atomsites); }
std::string getFilePath(){return file_path;}
private:
// class instance to hold unit cell information
std::vector<Symmetry> symmetrylist;
std::vector<AtomSite> atomsites;
CellGeometry cell;
std::string file_path;
bool fix;
// methods to read
// 1. atom positions
// 2. symmetry
// 3. basis geometry
void readAtoms(const std::string &input);
void readSymmetryOperations(const std::string &input);
void readCellGeometry(const std::string &input);
void readAtomPositions(const std::vector<std::string> &headers, const std::vector<std::string> &entries);
void readThermalParameters(const std::vector<std::string> &headers, const std::vector<std::string> &entries);
};
}
#endif //XYZ_CIFREADER_H