OOF2: The Manual

Name

SymTensorIterator, SymTensorInPlaneIterator, SymTensorOutOfPlaneIterator — Iterate over the components of a symmetric 3×3 tensor

C++ Synopsis

#include "engine/fieldindex.h"
class SymTensorIterator: , public ComponentIterator {
  SymTensorIterator();
  SymTensorIterator(int voigt);
  SymTensorIterator(SpaceIndex i,
                    SpaceIndex j);

  bool diagonal() const;
}
class SymTensorInPlaneIterator: , public SymTensorIterator {
}
class SymTensorOutOfPlaneIterator: , public SymTensorIterator {
}

Source Files

  • SRC/engine/fieldindex.h: C++ header
  • SRC/engine/fieldindex.C: C++ source code

Description

SymTensorIterator, SymTensorInPlaneIterator and SymTensorOutOfPlaneIterator are the ComponentIterator subclasses used to iterate over the components of a 3×3 symmetric tensor, such as a SymmetricTensorFlux or a SymmMatrix3. The iteration is done in Voigt order.

The three classes differ in which components of the tensor are included. SymTensorIterator includes all components. SymTensorInPlaneIterator includes only the in-plane components (xx, yy, and xy, or Voigt indices 0, 1, and 5). SymTensorOutOfPlaneIterator includes only the out-of-plane components (zz, yz, and xz, or Voigt indices 2, 3, and 4).

[Note] Note

The iterators only iterate over the unique elements of the tensor. Because the yx element is identical to the xy element, the iterator includes xy but not yx. Depending on the circumstances, it may be necessary to include factors of 2 to compensate for this.

Like all of the ComponentIterator subclasses, new objects are created by the begin() and end() methods of the corresponding Components classes: SymTensorComponents, SymTensorInPlaneComponents, and SymTensorOutOfPlaneComponents. The different constructors differ in how the initial index is set.

Methods

diagonal()

diagonal() returns true if the iterator is currently pointing to a component on the diagonal of the tensor: xx, yy, or zz.