Class: PotcarCommand

Inherits:
Thor
  • Object
show all
Defined in:
bin/potcar

Instance Method Summary collapse

Instance Method Details

#generate(*elements) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'bin/potcar', line 12

def generate(*elements)
  if options[:poscar] && (! elements.empty?)
    puts "Error. Duplicated indication of elements with argument and --poscar option."
    exit
  end

  if options[:poscar]
    elements = VaspUtils::Poscar.load_file(options[:poscar]).elements
  end

  setting = VaspUtils::Setting.new

  vpc = VaspUtils::Potcar::Concatenater.new(
    setting['potcar_dir'],
    setting['default_potcar']
  )
  vpc.dump(elements, STDOUT)
end