Sha256: 249d3bba7e552f011b3eae18737aeb266bdbf6ee6b3fb3bc23d1798b8c0df97c

Contents?: true

Size: 1009 Bytes

Versions: 1

Compression:

Stored size: 1009 Bytes

Contents

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

require "rubygems"
gem "comana"
require "comana/computationmanager.rb"

#gem "vasputils"
require "vasputils.rb"

require "optparse"

## option analysis
opts = {}
op = OptionParser.new
op.on("-g"    , "--geom-opt",  "Geometry optimization"){opts[:geom] = true}
op.on("-c"    , "--cond-find", "Condition finding"    ){opts[:cond] = true}
op.parse!(ARGV)

dir = ARGV[0] || "."

if opts[:geom] && opts[:cond]
  puts "-g and -c must not be duplicated."
  exit
end

if opts[:geom]
  begin
    calc_dir = VaspUtils::VaspGeomOpt.new(dir)
  rescue VaspUtils::VaspGeometryOptimizer::NoVaspDirError
    puts "Not suitable for VaspGeomOpt: #{dir}"
    exit
  end
elsif opts[:cond]
  TODO
else
  begin
    calc_dir = VaspUtils::VaspDir.new(dir)
  rescue VaspUtils::VaspDir::InitializeError
    puts "Not VaspDir: #{dir}"
    exit
  end
end

#pp calc_dir.class.ancestors

begin
  calc_dir.start
rescue ComputationManager::AlreadyStartedError
  puts "Already started. Exit."
  exit
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vasputils-0.0.10 bin/runvasp