Top Level Namespace

Defined Under Namespace

Modules: VaspUtils Classes: IncarCommand, KpointsCommand, PoscarCommand, PotcarCommand, VaspGeomOptCommand, VaspdirCommand, VasprunXmlCommand

Constant Summary collapse

INSPECT_DEFAULT_ITEMS =
[ :klass_name, :state, :toten, :dir, ]
INSPECT_ALL_ITEMS =
[ :kpoints, :encut, :i_step, :e_step, :time, ] + INSPECT_DEFAULT_ITEMS
INSPECT_WIDTH =

for printf option. minus value indicate left shifted printing.

{
  :dir         => "-20",
  :e_step      => "3",
  :i_step      => "3",
  :klass_name  => "11",
  :kpoints     => "8",
  :encut       => "6",
  :state       => "10",
  :time        => "15",
  :toten       => "17",
}

Instance Method Summary collapse

Instance Method Details

#form_time(second) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'bin/vaspdir', line 36

def form_time(second)
  second = second.to_i
  result = ""
  result = sprintf("%02d", second % 60)

  minute = second / 60
  if 0 < minute
    result = sprintf("%02d:#{result}", minute % 60)
  end

  hour = minute / 60
  if 0 < hour
    result = sprintf("%02d:#{result}", hour % 24)
  end

  day = hour / 24
  if 0 < day
    result = sprintf("%dd #{result}", day)
  end

  return result
end

#show_items(hash, tgt_properties) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'bin/vaspdir', line 26

def show_items(hash, tgt_properties)
  items = tgt_properties.map do |item|
    val = sprintf("%#{INSPECT_WIDTH[item]}s", hash[item])
    val
  end
  separator = " "

  puts items.join(separator)
end