Class: Aims::AimsOutput
- Inherits:
-
Object
- Object
- Aims::AimsOutput
- Defined in:
- lib/aims/output.rb
Overview
An object encapsulating the data that is output from AIMS. This object is generated from Aims::OutputParser.parse(filename)
Instance Attribute Summary collapse
-
#computational_steps ⇒ Object
?.
-
#geometry_converged ⇒ Object
Boolean, true if the geometry is converged.
-
#geometry_steps ⇒ Object
(also: #relaxation_steps)
Each Aims::GeometryStep geometry relaxation step.
-
#k_grid ⇒ Object
The k-point grid for periodic calculations.
-
#n_atoms ⇒ Object
The number of atoms in the computation.
-
#original_file ⇒ Object
The name of the calculation output file.
-
#timings ⇒ Object
The detailed time accounting data as a Aims::Timings will be nil if the calculation did not complete.
Instance Method Summary collapse
- #final_geometry ⇒ Object
- #final_step ⇒ Object
- #geometry_step ⇒ Object
-
#initialize ⇒ AimsOutput
constructor
A new instance of AimsOutput.
- #n_relaxation_steps ⇒ Object
- #n_sc_iterations ⇒ Object
- #sc_iteration ⇒ Object
- #total_cpu_time ⇒ Object
-
#total_energy ⇒ Object
Returns the best available value of the total energy.
Constructor Details
#initialize ⇒ AimsOutput
Returns a new instance of AimsOutput.
232 233 234 235 236 237 |
# File 'lib/aims/output.rb', line 232 def initialize self.geometry_steps = Array.new self.geometry_converged = false self.timings = {} self.computational_steps = Array.new end |
Instance Attribute Details
#computational_steps ⇒ Object
?
227 228 229 |
# File 'lib/aims/output.rb', line 227 def computational_steps @computational_steps end |
#geometry_converged ⇒ Object
Boolean, true if the geometry is converged
220 221 222 |
# File 'lib/aims/output.rb', line 220 def geometry_converged @geometry_converged end |
#geometry_steps ⇒ Object Also known as: relaxation_steps
Each Aims::GeometryStep geometry relaxation step
210 211 212 |
# File 'lib/aims/output.rb', line 210 def geometry_steps @geometry_steps end |
#k_grid ⇒ Object
The k-point grid for periodic calculations
214 215 216 |
# File 'lib/aims/output.rb', line 214 def k_grid @k_grid end |
#n_atoms ⇒ Object
The number of atoms in the computation
230 231 232 |
# File 'lib/aims/output.rb', line 230 def n_atoms @n_atoms end |
#original_file ⇒ Object
The name of the calculation output file
217 218 219 |
# File 'lib/aims/output.rb', line 217 def original_file @original_file end |
#timings ⇒ Object
The detailed time accounting data as a Aims::Timings will be nil if the calculation did not complete
224 225 226 |
# File 'lib/aims/output.rb', line 224 def timings @timings end |
Instance Method Details
#final_geometry ⇒ Object
249 250 251 |
# File 'lib/aims/output.rb', line 249 def final_geometry self.geometry_steps.last.geometry end |
#final_step ⇒ Object
253 254 255 |
# File 'lib/aims/output.rb', line 253 def final_step self.geometry_steps.last end |
#geometry_step ⇒ Object
257 258 259 |
# File 'lib/aims/output.rb', line 257 def geometry_step self.geometry_steps.last end |
#n_relaxation_steps ⇒ Object
261 262 263 |
# File 'lib/aims/output.rb', line 261 def n_relaxation_steps self.geometry_steps.size - 1 end |
#n_sc_iterations ⇒ Object
265 266 267 268 269 |
# File 'lib/aims/output.rb', line 265 def n_sc_iterations self.geometry_steps.inject(0){|total, step| total = total + step.sc_iterations.size } end |
#sc_iteration ⇒ Object
281 282 283 |
# File 'lib/aims/output.rb', line 281 def sc_iteration self.geometry_step.sc_iteration end |
#total_cpu_time ⇒ Object
271 272 273 274 275 276 277 278 279 |
# File 'lib/aims/output.rb', line 271 def total_cpu_time begin self.timings.find{|t| t[:description] =~ /Total time$/}[:cpu_time] rescue self.geometry_steps.inject(0) {|total, step| total = total + step.total_cpu_time } end end |
#total_energy ⇒ Object
Returns the best available value of the total energy
240 241 242 243 244 245 246 247 |
# File 'lib/aims/output.rb', line 240 def total_energy etot = self.geometry_steps.collect{|gs| gs.total_energy }.compact.last if etot.nil? Float::NAN else etot end end |