OOF2: The Manual

Name

ThreeVectorField — A three dimensional vector-valued Field object.

Synopses

C++ Synopsis

#include "engine/field.h" 
class ThreeVectorField: , public Field {
  virtual FieldIndex* getIndex(const std::string& name) const;
  DoubleVec values(const FEMeshmesh,
                   const Elementelement,
                   const MasterPositionposition);

  DoubleVec gradients(const FEMeshmesh,
                      const Elementelement,
                      const MasterPositionposition,
                      SpaceIndex direction);

}

Python Synopsis

from ooflib.SWIG.engine.field import ThreeVectorField 
class ThreeVectorField(Field):
  def getIndex(self, name)

Source Files

  • SRC/engine/field.h: C++ header
  • SRC/engine/field.C: C++ code
  • SRC/engine/field.swg: SWIG source code
  • SRC/engine/field.spy: python code included in field.swg.

Description

ThreeVectorField is a subclass of Field that represents a three dimensional vector. It is not a subclass of CompoundField. It is used as the out-of-plane and out-of-plane derivative Fields for TwoVectorField.

The FieldIndex type for a ThreeVectorField is VectorFieldIndex. The Components type is VectorFieldComponents, and the ComponentIterator is VectorFieldIterator.

Methods

FieldIndex *getIndex(const std::string &name) const

ThreeVectorField::getIndex() returns a pointer to a VectorFieldIndex. The name argument can be "x", "y", or "z".

DoubleVec values(...) const

DoubleVec values(const FEMesh* mesh, const Element* element, const MasterPosition& point) const;

values() is a non-virtual method that returns all components of a ThreeVectorField in a vector at the given point within the given element.

To retrieve Field values from a generic Field* pointer, either cast the pointer to the derived type and call values():

DoubleVec vals = dynamic_cast<const ThreeVectorField*>(field)->values(mesh, element, point); 

or access the components individually via the Field base class methods:

DoubleVec vals(field->ndof());
for(IndexP i : *field->components())
  vals[i.integer()] = field->value(mesh, element, point, i);

DoubleVec gradients(...) const

DoubleVec gradients(const FEMesh* mesh, const Element* element, const MasterPosition& point, SpaceIndex direction) const; 

gradients() is just like values(), but it returns the components of the gradients in the given direction. That is, gradients(mesh, element, x, j) returns a vector whose ith component is the j -derivative of the ith component of the ThreeVectorField.