OOF2: The Manual
New Material Properties are the most complicated kind of
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 consists of a class definition and a PropertyRegistration
object. The registration contains metadata about the Property
and allows it to be found in the user interface. The class
must be a subclass of one of these intermediate base classes:
-
A FluxProperty contributes to a
Flux. For example, Mechanical:Elasticity:Isotropic contributes to Stress. -
An EqnProperty contributes directly to an
Equation. For example, Mechanical:MassDensity:ConstantMassDensity provides the mass times acceleration term in the Force_Balance equation. -
An ??? is neither of the above, but can be used indirectly by other
Properties. For example, Orientation is used by all anisotropicProperties. Color is used to displayMaterials.
See the documentation for each intermediate class for the details.
Property classes perform the following types of tasks (the
links below each task lead to detailed documentation, see the
pages for the classes for the full list of methods):
-
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. -
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”.There are also a few functions that
Propertiesmay define that influence the way they're used or the way a computation is done: -
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.7 to learn how to add new outputs.



