paratec::input - paratec input file
Implements the input file of paratec, allowing for both reading and writing.
Creates an object associated with an input file, which can be used to conveniently read and write the properties of the paratec input file.
paratec::input is actually very easy to use. Say you just want to set the volume of an input file to be equal to the volume of an OUT file. The following code does what you want:
use paratec::input;
use paratec::OUT;
$in = new paratec::input; $out = new paratec::OUT; $in->volume($out->volume);
The first two lines simply tell perl that you want to use these two
modules. The second two lines tell perl to create objects named $in and
$out associated with the input and OUT files. The third line tells it
to read the volume from the OUT file, and write that volume to the input
file. If you wanted, you could do arithmetic on the volume between these
two steps.
C<use paratec::input;>
Makes the methods and overloaded operators of this module available to your program.
C<$input = new paratec::input;>
input file constructor method.
C<$input = new paratec::input("filename.inp";>
The optional argument for input file constructor method can be used to specify a file name other than the default (input). This can be handy if you want to preprocess a whole slew of input files.
$property = $input->property;
Finds the value of the property ``property'' in the file refered to by
$input and returns it. This is a default function, which means you can
have ``property'' be any property of the paratec input file (such as
volume, energy_cutoff, or whatever).
$input->property($newvalue);
Sets the value of the property ``property'' in the file refered to by
$input to be $newvalue. This is another default function, which
means you can have ``property'' be any property of the paratec input file
(such as volume, energy_cutoff, or whatever). This is one of the most
useful methods in this class, as it allows you to easily modify an input
file.
$matrix = $input->latticevectors;
$input->latticevectors($matrix);
Works the same as the above, reading or writing the lattice vectors, except
that paratec::tensor is created, with the lattice vectors as row
vectors.
$matrix = $input->basisvectors;
$input->basisvectors($matrix);
Works the same as reading or writing the lattice vectors, but instead reads and writes the basis vectors. This code is a tad buggy in that it will not correctly read or write to input files with multiple 'newtype' statements. Such is life.
$input->add_atom("Al", $vector);
Add an atom to the list of atoms, with the given element and position. This makes it possible to generate just about any input file you want using only Perl. However, the atom is assumed to be unpolarized and have specified muffin tin radius.
paratec::OUT, paratec::PW_LOG, paratec::vector, paratec::tensor.
This man page documents paratec::input version 0.1.
David Roundy <droundy@physics.berkeley.edu>.
Thanks to Gilles Santi, for giving me the idea of writing this.
Copyright (c) 2000, David Roundy. All rights reserved.
This package is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.