Example #1
0
    def main(self):
        (options, args) = self.par()
        input_name = options.input_name

        sysopts = {"verbose": self.verbose, "debug": self.debug}

        input_file = LX(input_name, "OUTCAR", sysopts)
        input_file.build()
        input_file.process()
Example #2
0
  def main( self ):
    (opts, args) = self.parse()

    sysopts = { "verbose" : self.verbose, "debug" : self.debug }
    try:
      inp = LX( opts.input, 'OUTCAR', sysopts )
      inp.build()
      inp.process()
    except:
      if self.debug:
        raise
      else:
        print "Input failed:", opts.input
        sys.exit(1)
Example #3
0
  def main( self ):
    (opts, args) = self.parse()

    opts_sys = { "verbose" : self.verbose, "debug" : self.debug }

    # read input
    # IO  filename  type  mode  options
    try:
      inp = IO( opts.input, 'POSCAR', 'r', opts_sys )
      inp.read()
    except:
      if self.debug:
        raise
      else:
        print "Input not found:", opts.input
        sys.exit(1)
    # end try

    # do transformation
    # LX  transfile type options
    try:
      trs = LX( opts.trans, 'TF', opts_sys )
      trs.geom( inp.geom() )
      # build & process
      geom = trs.read()
    except:
      if self.debug:
        raise
      else:
        print "Transformation error:", opts.trans
        sys.exit(1)
    # end try

    # write output
    # IO  filename  type  mode  options
    try:
      out = IO( opts.output, 'POSCAR', "w+", opts_sys )
      out.geom( geom )
      if opts.cart:
        out.write( { 'pt' : PT.Cart } )
      else:
        out.write( { 'pt' : PT.Direct } )
    except:
      if self.debug:
        raise
      else:
        print "Output failed:", opts.output
        sys.exit(1)
Example #4
0
  def main( self ):
    (options, args) = self.par()
    input_name  = options.input_name
    trans_name  = options.trans_name
    output_name = options.output_name

    sysopts = { "verbose" : self.verbose, "debug" : self.debug }

    # read input geometry
    input_file = IO( input_name, 'POSCAR', 'r', sysopts )
    input_file.read()

    # transform
    trans_file = LX( trans_name, 'TF', sysopts )
    trans_file.geom( input_file.geom() )
    geom = trans_file.read()

    # output
    opts = { 'pt' : PT.Cart }
    output_file = IO( output_name, 'POSCAR', "w+", sysopts )
    output_file.geom( geom )
    output_file.write( opts )