OOF2: The Manual

8.4. Adding New Material Properties

[Warning] Warning

This section has not yet been updated for OOF2 version 2.1. A partial discussion of the differences between the 2.0 and 2.1 extension APIs may be found at http://www.ctcms.nist.gov/oof/oof2/property_api_21.html.

Adding new Material Properties is the most complicated part of creating an OOF2 extension. Just to make it simpler, there are two ways of doing it. Properties can be written in C++ or they can be written in Python. Python Properties are a bit easier to write and install, but will run significantly more slowly. It may be convenient to develop new Properties in Python and translate them to C++ after the bugs have been worked out.

Whether a Property is written in C++ or Python, the same code elements must be present. Not all of them are necessary for every Property. It is safe simply to omit the unnecessary ones.

A Property definition contains a class definition, which is either a C++ subclass of Property or a Python subclass of oof2.SWIG.engine.pypropertywrapper, and a PropertyRegistration object, which contains metadata about the Property.

Property classes perform the following types of tasks (the links below each task lead to detailed documentation):