CASM  1.1.0
A Clusters Approach to Statistical Mechanics
VaspIO.hh
Go to the documentation of this file.
1 #ifndef CASM_crystallography_io_VaspIO
2 #define CASM_crystallography_io_VaspIO
3 
6 #include "casm/global/enum.hh"
7 
8 namespace CASM {
9 
10 class Log;
11 
13 namespace VaspIO {
14 
39 
40 class PrintPOSCAR {
41  public:
42  using AtomName = std::string;
43 
45 
57  PrintPOSCAR(xtal::SimpleStructure _struc, std::string _title = "",
58  SpeciesMode _mode = SpeciesMode::ATOM);
59 
61  void set_title(std::string title) { m_title = title; }
62 
64  void set_scale(double s) { m_scale = s; }
65 
68 
70  void set_frac() { m_coord_mode = FRAC; }
71 
73  void set_cart() { m_coord_mode = CART; }
74 
76  void set_coord_mode(COORD_TYPE mode) { m_coord_mode = mode; }
77 
80 
83 
85  void set_atom_names_off() { m_atom_names = false; }
86 
88  void set_atom_names_on() { m_atom_names = true; }
89 
92 
95 
98  std::set<std::string> &ignore() { return m_ignore; }
99 
102  const std::set<std::string> &ignore() const { return m_ignore; }
103 
105  void sort();
106 
108  void print(std::ostream &sout) const;
109 
111  void print(Log &sout) const;
112 
113  private:
114  std::string m_title;
116 
118  std::vector<Index> m_permute;
119 
120  double m_scale;
125 
128  std::set<std::string> m_ignore;
129 };
130 
131 } // namespace VaspIO
132 } // namespace CASM
133 
134 #endif
std::set< std::string > & s
Definition: Log.hh:48
Print POSCAR with formating options.
Definition: VaspIO.hh:40
SpeciesMode m_species_mode
Definition: VaspIO.hh:115
void set_cart()
Set coordinate mode to Cartesian.
Definition: VaspIO.hh:73
void set_direct()
Set coordinate mode to Direct (fractional)
Definition: VaspIO.hh:67
xtal::SimpleStructure m_struc
Definition: VaspIO.hh:117
void set_append_atom_names_on()
Append atom name to end of each coordinate line.
Definition: VaspIO.hh:94
void set_title(std::string title)
Set title.
Definition: VaspIO.hh:61
void set_coord_mode(COORD_TYPE mode)
Set coordinate mode.
Definition: VaspIO.hh:76
void set_atom_names_off()
Do not print atom names line.
Definition: VaspIO.hh:85
void set_atom_names_on()
Print atom names line.
Definition: VaspIO.hh:88
void set_append_atom_names_off()
Do not append atom name to end of each coordinate line.
Definition: VaspIO.hh:91
std::set< std::string > & ignore()
Access set of atom names which should not be printed, such as for vacancies.
Definition: VaspIO.hh:98
void sort()
Default sort is by atom name.
Definition: VaspIO.cc:50
const std::set< std::string > & ignore() const
const Access set of atom names which should not be printed, such as for vacancies
Definition: VaspIO.hh:102
void set_selective_dynamics_on()
Set selective dynamics on.
Definition: VaspIO.hh:82
std::string AtomName
Definition: VaspIO.hh:42
void set_frac()
Set coordinate mode to fractional (Direct)
Definition: VaspIO.hh:70
COORD_TYPE m_coord_mode
Definition: VaspIO.hh:121
std::set< std::string > m_ignore
List of atom names which should not be printed (primarily for vacancies)
Definition: VaspIO.hh:128
PrintPOSCAR(xtal::SimpleStructure _struc, std::string _title="", SpeciesMode _mode=SpeciesMode::ATOM)
Construct PrintPOSCAR object.
Definition: VaspIO.cc:32
void set_scale(double s)
Set scaling factor.
Definition: VaspIO.hh:64
void set_selective_dynamics_off()
Set selective dynamics off.
Definition: VaspIO.hh:79
void print(std::ostream &sout) const
Print POSCAR to stream.
Definition: VaspIO.cc:56
std::vector< Index > m_permute
Definition: VaspIO.hh:118
Representation of a crystal of molecular and/or atomic occupants, and any additional properties....
SimpleStructureTools::SpeciesMode SpeciesMode
SpeciesMode
enum to refer to a particular representation of the occupants (atomic or molecular)
Main CASM namespace.
Definition: APICommand.hh:8
COORD_TYPE
Definition: enum.hh:6
const COORD_TYPE FRAC
Definition: enum.hh:8
const COORD_TYPE CART
Definition: enum.hh:9