Class: Aims::AimsOutput

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeAimsOutput

Returns a new instance of AimsOutput.



231
232
233
234
235
236
# File 'lib/aims/output.rb', line 231

def initialize
  self.geometry_steps = Array.new
  self.geometry_converged = false
  self.timings = {}
  self.computational_steps = Array.new
end

Instance Attribute Details

#computational_stepsObject

?



226
227
228
# File 'lib/aims/output.rb', line 226

def computational_steps
  @computational_steps
end

#geometry_convergedObject

Boolean, true if the geometry is converged



219
220
221
# File 'lib/aims/output.rb', line 219

def geometry_converged
  @geometry_converged
end

#geometry_stepsObject

Each Aims::GeometryStep geometry relaxation step



210
211
212
# File 'lib/aims/output.rb', line 210

def geometry_steps
  @geometry_steps
end

#k_gridObject

The k-point grid for periodic calculations



213
214
215
# File 'lib/aims/output.rb', line 213

def k_grid
  @k_grid
end

#n_atomsObject

The number of atoms in the computation



229
230
231
# File 'lib/aims/output.rb', line 229

def n_atoms
  @n_atoms
end

#original_fileObject

The name of the calculation output file



216
217
218
# File 'lib/aims/output.rb', line 216

def original_file
  @original_file
end

#timingsObject

The detailed time accounting data as a Aims::Timings will be nil if the calculation did not complete



223
224
225
# File 'lib/aims/output.rb', line 223

def timings
  @timings
end

Instance Method Details

#final_geometryObject



248
249
250
# File 'lib/aims/output.rb', line 248

def final_geometry
  self.geometry_steps.last.geometry
end

#final_stepObject



252
253
254
# File 'lib/aims/output.rb', line 252

def final_step
  self.geometry_steps.last
end

#geometry_stepObject



256
257
258
# File 'lib/aims/output.rb', line 256

def geometry_step
  self.geometry_steps.last
end

#n_relaxation_stepsObject



260
261
262
# File 'lib/aims/output.rb', line 260

def n_relaxation_steps
  self.geometry_steps.size - 1
end

#n_sc_iterationsObject



264
265
266
267
268
# File 'lib/aims/output.rb', line 264

def n_sc_iterations
  self.geometry_steps.inject(0){|total, step|
    total = total + step.sc_iterations.size
  }
end

#sc_iterationObject



280
281
282
# File 'lib/aims/output.rb', line 280

def sc_iteration
  self.geometry_step.sc_iteration
end

#total_cpu_timeObject



270
271
272
273
274
275
276
277
278
# File 'lib/aims/output.rb', line 270

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_energyObject

Returns the best available value of the total energy



239
240
241
242
243
244
245
246
# File 'lib/aims/output.rb', line 239

def total_energy
  etot = self.geometry_steps.collect{|gs| gs.total_energy }.compact.last
  if etot.nil? 
    Float::NAN
  else
    etot
  end
end