This directory contains skeletons for object-oriented (OO) Fortran wrappers for C++ classes. The OO wrappers invoke C++ methods via procedural bindings contained in a file with a name of the form for*.F90.  The scripts that generate the corresponding CTrilinos C header files also produce the bindings in for*.F90.  The skeletons can be edited to provide the basic elements common to all classes: user-defined constructors, destructors, and type converters.  The destructors are invoked by a component of the Universal parent class that all classes at the base of the ForTrilinos application programming interface (API) must extend.  Extending Universal automates critical functionality for managing memory CTrilinos allocates in response to ForTrilinos requests for new objects.

The object construction process differs between ForTrilinos base classes and extended classes Extended classes extend base classes.  BaseClass.F90 contains a skeleton base class.  ExtendedClass.F90 contains a skeleton extended class.  To create a ForTrilinos class hierarchy that mimics and wraps a Trilinos C++ hierarchy, follow the steps below for each class:

1. Create the directory $TRILINOS_HOME/packages/ForTrilinos/src/package_name if it does not exist. 
2. For a given C++ class in the package to be wrapped, copy BaseClass.F90 or ExtendedClass.F90 to the new package directory. 
3. Rename the copied file using the format PackageName_ClassName.F90.
4. Inside each created file, substitute the actual package name for all $Package and $Package_ occurrences. 
5. Inside each created file, substitute the actual class name for all $Class occurrences.

For example, on Mac OS 10.6.5, a base class named Bar in a package named Foo could be created using the Unix sed stream editor as follows:

cd $TRILINOS_HOME/packages/ForTrilinos/src
cp -R skeleton foo
cd foo
sed 's/$Package_/Foo/g' BaseClass.F90 > Foo_Bar
sed -i.backup 's/$Package/Foo/g' FooBar.F90
sed -i.backup 's/$Class/ Bar/g' FooBar.F90
