OOF2: The Manual


PropertyOutput — Compute Property-dependent data on a Mesh

C++ Synopsis

#include "engine/IO/propertyoutput.h"
class PropertyOutput {
  const std::string& name() const;
  double getFloatParam(char* name) const;
  int getIntParam(char* name) const;
  std::string getStringParam(char* name) const;
  std::string getEnumParam(char* name) const;
  std::string getRegisteredParamName(char* name) const;

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


PropertyOutput objects are created by the OOF2 Output machinery when computing Property-dependent output quantities. The objects are passed as arguments to Property::output(). They should never be explicitly created by the authors of OOF2 extensions, so the constructor syntax isn't discussed here.

The role of the PropertyOutput class is simply to inform the Property of which output quantity it's supposed to compute.


const std::string& name() const

This returns the name of the PropertyOutput, as specified in its PropertyOutputRegistration. In many cases, this is all that the Property needs to know in order to compute the desired quantities.

double getFloatParam(char *name) const

If the PropertyOutputRegistration for this PropertyOutput included a floating point parameter (FloatParameter), then the value of that parameter can be retrieved by calling getFloatParam. The argument is the name of the parameter. If the parameter can't be found, getFloatParam will throw an exception which will be caught when control returns to the Python interpreter.

The argument to getFloatParam is a char* instead of a std::string because that's what the Python API functions expect to see.

int getIntParam(char *name) const

getIntParam is just like getFloatParam, but it fetches the value of a IntParameter.

std::string getStringParam(char *name) const

getStringParam is just like getFloatParam, but it fetches the value of a StringParameter.

std::string getEnumParam(char *name) const

getEnumParam is just like getFloatParam, but it fetches the value of a EnumParameter. Actually, it technically returns the name of the value, since the value is a Python object.

std::string getRegisteredParamName(char *name) const

getRegisteredParamName is just like getEnumParam, but for RegisteredParameter parameters. The parameter's value is a RegisteredClass object. getRegisteredParamName calls the object's name() function and returns the result.