Sha256: 013d66bbca5fb618a82e90bb1ba74d36a6ba8dc477f2b896bd16de43c1f2b3d5

Contents?: true

Size: 781 Bytes

Versions: 4

Compression:

Stored size: 781 Bytes

Contents

#! /usr/bin/env ruby
# coding: utf-8

require "thor"
require "vasputils"

class PotcarCommand < Thor

  desc 'generate [options] elem1 [elem2, ...]', 'generate POTCAR of elements'
  option :poscar, desc: 'Alternatively use of elements in POSCAR',
    lazy_default: "POSCAR"
  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
end

PotcarCommand.start(ARGV)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vasputils-0.1.6 bin/potcar
vasputils-0.1.5 bin/potcar
vasputils-0.1.4 bin/potcar
vasputils-0.1.3 bin/potcar