ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
cif_io.h
Go to the documentation of this file.
1#ifndef MODULE_IO_CIF_IO_H
2#define MODULE_IO_CIF_IO_H
4#include <string>
5#include <vector>
6#include <map>
7
8namespace ModuleIO
9{
88 {
89 public:
90 CifParser() = delete; // I cannot see any necessity to have a default constructor
91 CifParser(const std::string& fcif); // read the cif file and store the information
92 ~CifParser() {} // actually do not need to do anything explicitly
93
108 static void write(const std::string& fcif,
109 const double* abc_angles,
110 const int natom,
111 const std::string* atom_site_labels, // the one without numbers
112 const double* atom_site_fract_coords,
113 const std::string& title = "# generated by ABACUS",
114 const std::string& data_tag = "data_?",
115 const int rank = 0,
116 const double* atom_site_occups = nullptr, // may be this will be useful after impementation of VCA?
117 const std::string& cell_formula_units_z = "1");
131 static void write(const std::string& fcif,
132 const std::vector<double>& abc_angles,
133 const std::vector<std::string>& atom_site_labels, // the one without numbers
134 const std::vector<double>& atom_site_fract_coords,
135 const std::string& title = "# generated by ABACUS",
136 const std::string& data_tag = "data_?",
137 const int rank = 0,
138 const std::vector<double>& atom_site_occups = {}, // may be this will be useful after impementation of VCA?
139 const std::string& cell_formula_units_z = "1");
140 // the version with both spacegroup symmetry and point group symmetry ready
141 // not for now, because it is too complicated. However it is a walk-around
142 // way to fix issue #4998
143 // static void write();
144
154 static void write(const std::string& fcif,
155 const UnitCell& ucell,
156 const std::string& title = "# generated by ABACUS",
157 const std::string& data_tag = "data_?",
158 const int rank = 0);
166 static void read(const std::string& fcif,
167 std::map<std::string, std::vector<std::string>>& out,
168 const int rank = 0);
169
178 std::vector<std::string> get(const std::string& key);
179
180 private:
181 // interface to ABACUS UnitCell impl.
182 static void _unpack_ucell(const UnitCell& ucell, // because ucell is too heavy...
183 std::vector<double>& veca,
184 std::vector<double>& vecb,
185 std::vector<double>& vecc,
186 int& natom,
187 std::vector<std::string>& atom_site_labels,
188 std::vector<double>& atom_site_fract_coords);
189
190 // stores the information of the cif file
191 std::map<std::string, std::vector<std::string>> raw_;
192 };
193} // namespace ModuleIO
194#endif // MODULE_IO_CIF_IO_H
Definition cif_io.h:88
static void write(const std::string &fcif, const double *abc_angles, const int natom, const std::string *atom_site_labels, const double *atom_site_fract_coords, const std::string &title="# generated by ABACUS", const std::string &data_tag="data_?", const int rank=0, const double *atom_site_occups=nullptr, const std::string &cell_formula_units_z="1")
Print the CIF file from the given information.
Definition cif_io.cpp:319
static void read(const std::string &fcif, std::map< std::string, std::vector< std::string > > &out, const int rank=0)
Read the CIF file and store the information in the map.
Definition cif_io.cpp:464
~CifParser()
Definition cif_io.h:92
std::vector< std::string > get(const std::string &key)
get information by key from the stored information of cif file, if the key is not found,...
Definition cif_io.cpp:519
std::map< std::string, std::vector< std::string > > raw_
Definition cif_io.h:191
static void _unpack_ucell(const UnitCell &ucell, std::vector< double > &veca, std::vector< double > &vecb, std::vector< double > &vecc, int &natom, std::vector< std::string > &atom_site_labels, std::vector< double > &atom_site_fract_coords)
Definition cif_io.cpp:278
Definition unitcell.h:16
This class has two functions: restart psi from the previous calculation, and write psi to the disk.
Definition cal_dos.h:9