Input data for Feff


 

Starting from a conventional feff.inp file

FEFF is, let's face it, a bit long in the tooth. It requires that its instructions be contained is a rather rigidly structured textual input file. The keywords of the file are called “cards” in the FEFF documentation -- a word whose etymology probably escapes FEFF's younger users.

DEMETER goes through some serious gymnastics in an attempt to hide FEFF's clunky interface. The need for an input file is unavoidable and DEMETER does, in fact, read in and write out feff.inp files repeatedly. It does so, however, in a stealthy way that should require the attention of the programmer using DEMETER only at the very beginning of the process.

Creating a Feff object and populating it with the contents of a feff.inp file is done in a way that should be quite familiar at this point:

  1. #!/usr/bin/perl
  2. use Demeter;
  3. my $feff = Demeter::Feff -> new(file => "feff/feff.inp");
  4. $feff->set(workspace=>"feff/", screen=>0);

Because FEFF is heavily dependent on disk-based IO to do its work, you must specify a workspace. This is a directory on disk where the various files that FEFF needs to do its business can be written. In the example that will be running through this section, that workspace is a subdirectory called feff/.

The screen attribute is a boolean which will suppress the messages the FEFF would normally write to standard output when set to 0.

When the file attribute is set, that input file will be parsed and its contents stored as attributes of the Feff object. At this point, the new Feff object is fully instrumented and ready to start being used for interesting work.


 

Starting from an Atoms object

If you are running FEFF on a crystalline material for which you have an atoms.inp or CIF file, then DEMETER also allows you to skip the step fo explicitly writing the feff.inp file. Insetad of setting the file attribute of the Feff object, you can set the atoms attribute to an Atoms object. The feff.inp still gets generated, but it is done behind the scenes using a temporary file that is quickly discarded.

  1. #!/usr/bin/perl
  2. use Demeter;
  3. my $atoms = Demeter::Atoms -> new(file => 'atoms.inp');
  4. my $feff = Demeter::Feff -> new(atoms => $atoms);
  5. $feff->set(workspace=>"feff/", screen=>0);

When the atoms attribute is set, the feff.inp file is created, parsed, then deleted. Its contents are stored as attributes of the Feff object. At this point, the new Feff object is fully instrumented and ready to start being used for interesting work.

This approach is convenient in any situation for which you do not need to modify FEFF input data in any way from the form that the ATOMS calculation generates. In that situation, this approach to FEFF is identical in every way to starting from a feff.inp file.


 

Starting from a molecular structure file

To do! Integration with OpenBabel so that other cluster file formats can be used directly as input to FEFF.