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.
Properties
have names by which they are identified in the user interface. They also have a propertyType. ApropertyType
is a string that identifies theProperty
's physical role. EachMaterial
instance can have at most oneProperty
of eachpropertyType
. For example, allProperties
that provide an elastic modulus have the type'Elasticity'
, and all thermal expansionProperties
have the type'ThermalExpansion'
. Authors of new types ofProperty
should invent newpropertyType
strings. Authors of new versions of a preexistingProperty
should examine the existingPropertyRegistrations
and reuse the samepropertyType
.There are also a few functions that
Properties
may define that influence the way they're used or the way a computation is done: -
Cross Referencing. Sometimes a
Property
needs to use data from otherProperties
in the sameMaterial
. For example, any anisotropicProperty
will need to find out itsMaterial
'sOrientation
. Cross referencing allows aProperty
to usepropertyType
information to locate otherProperties
. This is done after aMaterial
is constructed but before it is used for numerical computations. -
Precomputation. When constructing the finite element stiffness matrix, the OOF2 program loops over all
Elements
and asks theirMaterials
to ask theirProperties
to make their contributions to the matrix. For efficiency,Properties
may 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.
Properties
can 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
Field
invariants, are defined without reference toProperties
, but there are also many outputs, such as energy densities, that depend upon aProperty
in one way or another, and rely upon theProperty
's code. See Section 8.5 to learn how to add new outputs.