OOF2: The Manual


Flux — Base class for Fluxes


(Only those methods useful when extending OOF2 are listed here.)

C++ Synopsis

#include "engine/flux.h"
class Flux {
  const std::string& name() const;
  int ndof() const;
  int divergence_dim() const;
  IteratorP iterator(Planarity planarity) const;
  IteratorP divergence_iterator() const;
  OutputValue output(const FEMesh* mesh,
                     const Element* element,
                     const MasterPosition& pos) const;


Python Synopsis

from oof2.SWIG.engine import Flux
class Flux:
  def name(self)
  def ndof(self)
  def divergence_dim(self)
  def iterator(self, planarity)

Source Files

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


Flux is the base class for all Flux objects. Like Fields and Equations, Fluxes are global objects. There is only one stress flux object, even though stress may be computed on many different meshes. Flux objects store information about the physical flux, but do not store its values.

Fluxes should only be created in Python. See Section 8.1.


std::string &name() const

This returns the name that was assigned to this Flux when it was created. See Section 8.1.

int ndof() const

ndof returns the number of floating point numbers required to represent a value of the Flux.

int divergence_dim() const

divergence_dim returns the number of in-plane components in the Flux's divergence. This is equal to the number of Equations required to solve the Flux's divergence equation.

const IteratorP iterator(Planarity planarity) const

iterator returns an IteratorP object that can be used to loop over and refer to the components of the Flux. The given Planarity determines whether the iteration should include the in-plane, out-of-plane, or both components.

IteratorP divergence_iterator() const

divergence_iterator returns an IteratorP that can be used to loop over the in-plane components of the divergence of the Flux.

OutputValue output(...) const

output is analogous to Field::output — it returns the value of the Flux at a given point. The return value is an OutputValue, which wraps the appropriate OutputVal derived class.

The arguments are:

const FEMesh* mesh

The finite element mesh on which the Flux is to be computed.

const Element* element

The element containing the point at which the Flux is to be computed.

const MasterPosition& pos

The position of the output point, specified as a point in the element's master coordinate space. Master space coordinates can be converted to physical coordinates by Element::from_master.