CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
Properties.hh
Go to the documentation of this file.
1 #ifndef PROPERTIES_HH
2 #define PROPERTIES_HH
3 
6 
7 namespace CASM {
8 
9  class DeltaProperties;
10 
11  //***************************************************************
12  /* PROPERTIES CLASS
13 
14  The Properties class works with the DeltaProperties class using
15  'operator+' and 'operator-' as follows:
16 
17  Properties calc;
18  Properties ref;
19  DeltaProperties delta;
20 
21  delta = calc - ref;
22  calc = ref + delta;
23 
24 
25  The Properties class inherits from jsonParser. You can
26  read/write/put/get from it just as you would from jsonParser.
27 
28  DATA MEMBERS:
29 
30  Currently, Properties does not strictly enforce which data
31  members it contains. Please use the following because it is
32  expected elsewhere.
33 
34  double "energy":
35  The energy in eV/(structure) from DFT calculations without
36  allowing the atom coordinates to relax
37 
38  double "relaxed_energy":
39  The energy in eV/(structure) after allowing DFT to relax
40  the atom coordinates
41 
42  // The following are not implemented yet:
43 
44  Array< Vector3<double> > "forces":
45  The forces on the atoms in structure, ordered in the same way
46  that structure and config_index_to_bijk are arranged. The
47  forces are in eV/Angstrom.
48 
49  BasicStructure<Coordinate> "structure":
50  Contains the structure, ordered in the exact same way that
51  config_index_to_bijk is ordered. The Coordinates are in
52  Angstroms.
53 
54  \ingroup Configuration
55  */
56  //***************************************************************
57 
58  class Properties : public jsonParser {
59 
60  public:
61 
63 
64  Properties(const jsonParser &json) : jsonParser(json) {};
65 
66  Properties(std::istream &stream) : jsonParser(stream) {};
67 
68  Properties(const std::string &file_name) : jsonParser(file_name) {};
69 
70  Properties(const fs::path &mypath) : jsonParser(mypath) {};
71 
72  Properties &operator+=(const DeltaProperties &delta);
73 
74  Properties operator+(const DeltaProperties &delta) const;
75 
77 
80  return *this;
81  }
82  };
83 
84 
85  //***************************************************************
86  /* DeltaProperties Class
87 
88  The DeltaProperties class works with the Properties class using
89  'operator+' and 'operator-' as follows:
90 
91  Properties calc;
92  Properties ref;
93  DeltaProperties delta;
94 
95  delta = calc - ref;
96  calc = ref + delta;
97 
98 
99  The DeltaProperties class inherits from jsonParser. You can
100  read/write/put/get from it just as you would from jsonParser.
101 
102  DATA MEMBERS:
103 
104  Currently, DeltaProperties does not strictly enforce which data
105  members it contains. Please use the following because it is
106  expected elsewhere.
107 
108  double "energy":
109  The energy difference in eV/(structure)
110 
111  double "relaxed_energy":
112  The relaxed energy difference in eV/(structure)
113 
114  // The following are not implemented yet:
115 
116  Array< Vector3<double> > "forces":
117  The difference in forces on the atoms in structure, ordered
118  in the same way that structure and config_index_to_bijk are
119  arranged. The forces are in eV/Angstrom.
120 
121  Array< Vector3< double > > "displacement":
122  The displacements of the atoms in fractional coordinates
123  arranged in the same order as relaxed_structure,
124  config_index_to_bijk and forces. The displacements are
125  calculated such that they are applied after first applying the
126  latticeStrain to the reference structure. The fractional
127  coordinates are thus in the lattice of the strained structure.
128 
129  LatticeStrain "strain":
130  The homogenous strain that needs to be applied to the
131  reference structure.
132  */
133  //***************************************************************
134 
135  class DeltaProperties : public jsonParser {
136 
137  public:
138 
140 
141  DeltaProperties(const jsonParser &json) : jsonParser(json) {};
142 
143  DeltaProperties(std::istream &stream) : jsonParser(stream) {};
144 
145  DeltaProperties(const std::string &file_name) : jsonParser(file_name) {};
146 
147  DeltaProperties(const fs::path &mypath) : jsonParser(mypath) {};
148 
149  DeltaProperties(const Properties &calc, const Properties &ref);
150 
152  jsonParser::operator=(json);
153  return *this;
154  }
155  };
156 
157 }
158 
159 #endif
Properties(const fs::path &mypath)
Definition: Properties.hh:70
DeltaProperties(const std::string &file_name)
Definition: Properties.hh:145
Main CASM namespace.
Definition: complete.cpp:8
jsonParser & operator=(const T &value)
Puts data of any type T for which 'jsonParser& to_json( const T &value, jsonParser &json)' is defined...
Definition: jsonParser.hh:802
pair_type ref
Definition: settings.cc:110
Properties(const jsonParser &json)
Definition: Properties.hh:64
DeltaProperties(std::istream &stream)
Definition: Properties.hh:143
DeltaProperties(const jsonParser &json)
Definition: Properties.hh:141
DeltaProperties(const fs::path &mypath)
Definition: Properties.hh:147
Properties(const std::string &file_name)
Definition: Properties.hh:68
Properties & operator=(const jsonParser &json)
Definition: Properties.hh:78
DeltaProperties operator-(const Properties &ref) const
Definition: Properties.cc:49
DeltaProperties & operator=(const jsonParser &json)
Definition: Properties.hh:151
Properties & operator+=(const DeltaProperties &delta)
Definition: Properties.cc:6
Properties(std::istream &stream)
Definition: Properties.hh:66
Properties operator+(const DeltaProperties &delta) const
Definition: Properties.cc:43