FreePOOMA  2.4.1
Public Types | Public Member Functions
Centering< Dim > Class Template Reference

Centering indicates the positions of values within a field's cell. More...

#include <FieldCentering.h>

List of all members.

Public Types

typedef Loc< Dim > Orientation
 An orientation.
typedef Vector< Dim > Position
 A position.
typedef std::vector< OrientationOrientations
 A list of value orientations.
typedef std::vector< PositionPositions
 A list of value positions.

Public Member Functions

Centering< Dim > operator[] (int iSubField) const
 Sub-centering creation function.
 ~Centering ()
 Empty destructor is fine for us.
void addValue (const Orientation &orientation, const Position &position)
 Add a value to a centering.
 Centering (CenteringType cent=CellType, ContinuityType cont=Continuous)
 Create a centering without any values.
 Centering (CenteringType cent, ContinuityType cont, const Orientations &orientations, const Positions &positions)
 Create a centering with values specified in two vectors.
 Centering (const Centering< Dim > &model, int c)
 Sub-centering constructor.
CenteringType centeringType () const
ContinuityType continuityType () const
bool discontinuous () const
bool continuous () const
const Orientationsorientations () const
const Positionspositions () const
const Orientationorientation (int i) const
const Positionposition (int i) const
int size () const

Detailed Description

template<int Dim>
class Centering< Dim >

Centering indicates the positions of values within a field's cell.

It is specified using the following fields:

In practice, we use two lists of values, one for orientations and one for positions, with elements at the same position related to each other.

For a dim-D cell, a face is a (dim-1)-D object. An edge centering is always a 1-D object. For two dimensions, edge and face centerings are the same although it is sometimes useful to distinguish them when writing programs that work for various dimensions.

Adjacent cells can share values. For example, a vertex-centered value in a 3-D field is shared by eight cells. A program might require that each cell maintain its own value at the point. To do so, specify discontinuous values. To be a valid discontinuous centering, values on cell boundaries must be arranged so that every adjacent cell also has a value at that same position in space. For example, any discontinuous edge value in three-dimensional space must have related values in the three adjacent cells. (Why do we have this restriction?)

Each value in the list should be specified exactly once. For example, the canonical continuous vertex-centered value is at position (0.0, ..., 0.0). This cell specifies a value at its origin. Neighboring cells specify values at their origins. Collectively, all the field's vertex values are specified. For continuous values, positions should be in the range [0.0,1.0)^{dim}. For discontinuous values, positions should be in the range [0.0,1.0]^{dim}. To implement the field, each specified position corresponds to a subfield.

Orientations are used when creating storage for field values. When creating storage, the number of values does not necessarily match the number of cells. For example, to create a field with n^2 cells requires (n+1)^2 vertices. Although orientations might appear to be redundant since nonzero values indicate an orientation, an x-face centered value may have position (0,0,0.5), which does not indicate whether it is an x- or y-face.

For three-dimensions, example orientations include

Example centerings include:


Member Typedef Documentation

template<int Dim>
typedef Loc<Dim> Centering< Dim >::Orientation

An orientation.

template<int Dim>
typedef Vector<Dim> Centering< Dim >::Position

A position.

template<int Dim>
typedef std::vector<Orientation> Centering< Dim >::Orientations

A list of value orientations.

template<int Dim>
typedef std::vector<Position> Centering< Dim >::Positions

A list of value positions.


Constructor & Destructor Documentation

template<int Dim>
Centering< Dim >::Centering ( CenteringType  cent = CellType,
ContinuityType  cont = Continuous 
) [inline]

Create a centering without any values.

template<int Dim>
Centering< Dim >::Centering ( CenteringType  cent,
ContinuityType  cont,
const Orientations orientations,
const Positions positions 
) [inline]

Create a centering with values specified in two vectors.

The two vectors should have the same length and corresponding entries specifying values.

References PInsist.

template<int Dim>
Centering< Dim >::Centering ( const Centering< Dim > &  model,
int  c 
) [inline]

Sub-centering constructor.

template<int Dim>
Centering< Dim >::~Centering ( ) [inline]

Empty destructor is fine for us.


Member Function Documentation

template<int Dim>
Centering<Dim> Centering< Dim >::operator[] ( int  iSubField) const [inline]

Sub-centering creation function.

This is not really meant to be called by users. Return a centering with one specified value.

References PInsist, and Centering< Dim >::size().

template<int Dim>
CenteringType Centering< Dim >::centeringType ( ) const [inline]
template<int Dim>
ContinuityType Centering< Dim >::continuityType ( ) const [inline]
template<int Dim>
bool Centering< Dim >::discontinuous ( ) const [inline]
template<int Dim>
bool Centering< Dim >::continuous ( ) const [inline]

References Continuous.

Referenced by operator<<().

template<int Dim>
const Orientations& Centering< Dim >::orientations ( ) const [inline]

Referenced by operator==().

template<int Dim>
const Positions& Centering< Dim >::positions ( ) const [inline]
template<int Dim>
const Orientation& Centering< Dim >::orientation ( int  i) const [inline]
template<int Dim>
const Position& Centering< Dim >::position ( int  i) const [inline]
template<int Dim>
int Centering< Dim >::size ( ) const [inline]
template<int Dim>
void Centering< Dim >::addValue ( const Orientation orientation,
const Position position 
) [inline]

Add a value to a centering.

There is no check that the value is not already present.


The documentation for this class was generated from the following file: