OOF2: The Manual

Name

Material — Collection of Properties

Synopses

C++ Synopsis

#include "engine/material.h"
class Material {
  Property* fetchProperty(const std::string& name) const;
}

Python Synopsis

from oof2.SWIG.engine import material
class Material:
  def fetchProperty(self)

Description

The Material class contains a list of all of the Properties that define a physical material. It coordinates the construction of the finite element stiffness matrix and handles various other bookkeeping tasks. Most of the details of the class are irrelevant to the authors of OOF2 extensions.

Methods

This section only discusses the Material methods that are important when writing OOF2 extensions. In particular, it does not discuss constructors or destructors, or how to add Properties to Materials. Those tasks are performed by the GUI and the OOF2 menu system.

Property* fetchProperty(const std::string& name) const

OOF2 Properties are sorted into categories called propertyTypes. Each Material can have at most one Property of each type. fetchProperty looks through the Material's Properties and returns the one whose type is specified by the given name. If there is no such Property, an exception is thrown.

fetchProperty is meant to be called by a Property's cross_reference function, in order to resolve dependencies on other Properties within the Material. For example, an Elasticity Property needs to use the Orientation Property in order to compute the laboratory frame elasticity tensor.

In C++, fetchProperty returns a pointer to a base class Property object. This pointer must be dynamically cast to the appropriate Property subclass. The correct subclass is always known from the context. In Python, fetchProperty automatically returns a reference to a Property of the appropriate derived type.