ERKALE
ERKALE - DFT from Hel
 All Classes Functions Variables Friends Pages
xyzutils.h
1 /*
2  * This source code is part of
3  *
4  * E R K A L E
5  * -
6  * DFT from Hel
7  *
8  * Written by Susi Lehtola, 2010-2011
9  * Copyright (c) 2010-2011, Susi Lehtola
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  */
16 
17 
18 
19 #ifndef ERKALE_XYZ
20 #define ERKALE_XYZ
21 
22 #include <string>
23 #include <vector>
24 
26 typedef struct {
28  std::string el;
30  size_t num;
32  double x;
34  double y;
36  double z;
38  int Q;
39 } atom_t;
40 
42 std::vector<atom_t> load_xyz(std::string filename);
43 
45 void save_xyz(const std::vector<atom_t> & at, const std::string & comment, const std::string & fname, bool append=false);
46 
48 void print_xyz(const std::vector<atom_t> & at);
49 
50 #endif
A structure for reading in atoms.
Definition: xyzutils.h:26
std::string el
Type of atom.
Definition: xyzutils.h:28
int Q
Charge.
Definition: xyzutils.h:38
double z
z coordinate
Definition: xyzutils.h:36
size_t num
Atom number.
Definition: xyzutils.h:30
double x
x coordinate;
Definition: xyzutils.h:32
double y
y coordinate
Definition: xyzutils.h:34