Skip to content

FiniteVolumeField Interface

Adam O'Brien edited this page Feb 22, 2017 · 5 revisions

#About

The FiniteVolumeField template class provides an interface for the handling of arbitrary data types, including the handling of boundary conditions, as well as optional face and node centred data. Specializations exist for common FiniteVolumeFields typed with Scalar, Vector2D or Tensor2D types.

This class allows for access to either cell-centred or face centred data by passing a Cell or Face reference. This allows seamless integration between the FiniteVolumeField and FiniteVolumeGrid2D classes. Several useful operators exist that allow for addition, subtraction and multiplication of fields together for easy equation construction, which is made possible through C++ 11 move semantics.

#Defining a FiniteVolumeField Object

A FiniteVolumeField object must, at minimum, be constructed with a FiniteVolumeField2D grid reference and a std::string to identify it. Optionally, an Input object (see examples) may be passed to define boundary information (hence the need for a field name). For example, using an existing Input and FiniteVolumeGrid2D object, one can define a scalar and vector field as

 FiniteVolumeField<Scalar> scalarField(input, grid, "scalar");
 FiniteVolumeField<Vector2D> vectorField(input, grid, "vector");

Additional fields may be constructed through addition, subtracton, multiplication and division of compatible field types. Note that the code makes heavy use of C++ 11 move semantics to ensure these operations are as efficient as possible.

Clone this wiki locally