OOF2: The Manual
![]() |
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):
-
Identification.
Propertieshave names by which they are identified in the user interface. They also have a propertyType. ApropertyTypeis a string that identifies theProperty's physical role. EachMaterialinstance can have at most onePropertyof eachpropertyType. For example, allPropertiesthat provide an elastic modulus have the type'Elasticity', and all thermal expansionPropertieshave the type'ThermalExpansion'. Authors of new types ofPropertyshould invent newpropertyTypestrings. Authors of new versions of a preexistingPropertyshould examine the existingPropertyRegistrationsand reuse the samepropertyType.There are also a few functions that
Propertiesmay define that influence the way they're used or the way a computation is done: -
Cross Referencing. Sometimes a
Propertyneeds to use data from otherPropertiesin the sameMaterial. For example, any anisotropicPropertywill need to find out itsMaterial'sOrientation. Cross referencing allows aPropertyto usepropertyTypeinformation to locate otherProperties. This is done after aMaterialis constructed but before it is used for numerical computations. -
Precomputation. When constructing the finite element stiffness matrix, the OOF2 program loops over all
Elementsand asks theirMaterialsto ask theirPropertiesto make their contributions to the matrix. For efficiency,Propertiesmay want to precompute some quantities before this process begins. There are two possible precomputation points:Element- andNode-independent computations that are done before looping overElements, andElement-dependent ones that are done before looping overNodes. -
Computation.
Propertiescan make contributions to the finite element stiffness matrix and to the right-hand side vector of external “forces”. -
Postcomputation. This is just like precomputation, but later. It can be done either after the computation on each
Element, or after a full solution has been obtained. -
Outputs. Many output quantities, such as
Fieldinvariants, are defined without reference toProperties, but there are also many outputs, such as energy densities, that depend upon aPropertyin one way or another, and rely upon theProperty's code. See Section 8.5 to learn how to add new outputs.


![[Warning]](IMAGES/warning.png)

