Class: Aims::GeometryStep

Inherits:
Object
  • Object
show all
Defined in:
lib/aims/output.rb

Overview

A geometry relaxation step in the calculation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGeometryStep

Initialize a new geometry step



28
29
30
31
32
33
34
35
# File 'lib/aims/output.rb', line 28

def initialize
  @sc_iterations = Array.new
  @forces = Array.new
  @step_num = -1
  @total_energy = Float::NAN
  @total_corrected_energy = Float::NAN
  @chemical_potential = Float::NAN
end

Instance Attribute Details

#chemical_potentialObject

The chemical potential for this geometry



22
23
24
# File 'lib/aims/output.rb', line 22

def chemical_potential
  @chemical_potential
end

#forcesObject

The forces for this geometry



25
26
27
# File 'lib/aims/output.rb', line 25

def forces
  @forces
end

#geometryObject

The Aims::Geometry



13
14
15
# File 'lib/aims/output.rb', line 13

def geometry
  @geometry
end

#sc_iterationsObject (readonly)

An Array of Aims::SCIteration



10
11
12
# File 'lib/aims/output.rb', line 10

def sc_iterations
  @sc_iterations
end

#step_numObject

The relaxation step number



7
8
9
# File 'lib/aims/output.rb', line 7

def step_num
  @step_num
end

#total_corrected_energyObject

The total corrected energy for this geometry as a Float



19
20
21
# File 'lib/aims/output.rb', line 19

def total_corrected_energy
  @total_corrected_energy
end

#total_energyObject

The total energy for this geometry as a Float



16
17
18
# File 'lib/aims/output.rb', line 16

def total_energy
  @total_energy
end

Instance Method Details

#sc_iterationObject

Return the last self-consistency iteration for this relaxation step



38
39
40
# File 'lib/aims/output.rb', line 38

def sc_iteration
  self.sc_iterations.last
end

#timingsObject

A hash with keys :description, :cpu_time, and :wall_time with detailed time accounting for this geometry step.



54
55
56
57
58
59
60
# File 'lib/aims/output.rb', line 54

def timings
  timings = Timings.new
  self.sc_iterations.each{|sc_iter|
    timings.add!(sc_iter.timings)
  }
  timings
end

#total_corrected_energy_per_atomObject

Return the total corrected energy per atom for this relaxation step



48
49
50
# File 'lib/aims/output.rb', line 48

def total_corrected_energy_per_atom
  self.total_corrected_energy/geometry.size rescue "N/A"
end

#total_cpu_timeObject

The total CPU time deterimed by summing the time for each self-consistency iteration



64
65
66
67
68
# File 'lib/aims/output.rb', line 64

def total_cpu_time
  self.sc_iterations.inject(0){|tot, sc_iter|
    tot += sc_iter.total_cpu_time
  }
end

#total_energy_per_atomObject

Return the total energy per atom for this relaxation step



43
44
45
# File 'lib/aims/output.rb', line 43

def total_energy_per_atom
  self.total_energy/geometry.size rescue "N/A"
end

#total_wall_timeObject

The total wall clock time deterimed by summing the time for each self-consistency iteration



73
74
75
76
77
# File 'lib/aims/output.rb', line 73

def total_wall_time
  self.sc_iterations.inject(0){|tot, sc_iter|
    tot += sc_iter.total_wall_time
  }
end