OOF2: The Manual

Name

PropertyOutputRegistration — Define a new Property-dependent output quantity

Python Synopsis


from oof2.SWIG.engine.IO import propertyoutput

class ScalarPropertyOutputRegistration(PropertyOutputRegistration):
  def __init__(self, nameinitializer=Noneparameters=[]tip=Nonediscussion=None)

class SymmMatrix3PropertyOutputRegistration(PropertyOutputRegistration):
  def __init__(self, nameinitializer=Noneparameters=[]tip=Nonediscussion=None)

class ThreeVectorPropertyOutputRegistration(PropertyOutputRegistration):
  def __init__(self, nameinitializer=Noneparameters=[]tip=Nonediscussion=None)

      

Source Files

  • SRC/engine/IO/propertyoutput.C: C++ source code
  • SRC/engine/IO/propertyoutput.h: C++ header file
  • SRC/engine/IO/propertyoutput.swg: SWIG source code
  • SRC/engine/IO/propertyoutput.spy: Python code included in the SWIG output. PropertyOutputRegistration subclasses.

Description

PropertyOutputRegistration objects contain the data that's required for OOF2 to compute a Property-dependent output quantity. Because the actual computation is done in Property::output, the registration object doesn't have to do much. It is basically a container for the name of the output and its Parameters, if any. It also defines appropriate Output objects and calls definePositionOutput, etc on them.

The PropertyOutputRegistration base class is a swigged C++ class, but it should never be used directly. Instead, new property outputs should create an instance of one of the subclasses listed above. (Adding new subclasses is not difficult, but it won't be discussed here. If new subclasses are required, the classes in SRC/engine/IO/propertyoutput.spy can be used as examples.)

The three subclasses, ScalarPropertyOutputRegistration, SymmMatrix3PropertyOutputRegistration, and ThreeVectorPropertyOutputRegistration, are for registering Outputs that compute different types of data (scalars, symmetric 3×3 matrices, and 3-vectors, respectively). The constructors for all of the subclasses take the same arguments (all but the first are optional):

name

The name of the Output. This is the name that is retrieved by PropertyOutput::name in a Property::output function.

initializer

initializer, if provided, must be an instance of an appropriate subclass of PropertyOutputInit. The initializer is called to make a Property-independent contribution to the output data before calling Property::output.

parameters

parameters is a list of Parameter objects that further define the output. For example, the 'Energy' output has an EnumParameter called 'etype' that can be set to 'Elastic', 'Total', etc. The values of the parameters can be retrieved by Property::output by calling PropertyOutput::getFloatParam, etc.

tip

tip is a short string describing the output. It will appear in tooltips in the GUI.

discussion

discussion is a more verbose description of the Output, meant for inclusion in the OOF2 users manual. It can either be a string or a reference to a file via the xmlmenudump.loadFile function. The string or the contents of the file must be docbook xml code suitable for the contents of a refsection.