FreePOOMA
2.4.1
|
Centering indicates the positions of values within a field's cell. More...
#include <FieldCentering.h>
Public Types | |
typedef Loc< Dim > | Orientation |
An orientation. | |
typedef Vector< Dim > | Position |
A position. | |
typedef std::vector< Orientation > | Orientations |
A list of value orientations. | |
typedef std::vector< Position > | Positions |
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 Orientations & | orientations () const |
const Positions & | positions () const |
const Orientation & | orientation (int i) const |
const Position & | position (int i) const |
int | size () const |
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:
VertexType, false / * continuous * /, {((0, 0, 0), (0.0, 0.0, 0.0))}
VertexType, true / * discontinuous * /, {((0, 0, 0), (0.0, 0.0, 0.0)), ((0, 0, 0), (1.0, 0.0, 0.0)), ((0, 0, 0), (0.0, 1.0, 0.0)), ((0, 0, 0), (0.0, 0.0, 1.0)), ((0, 0, 0), (1.0, 1.0, 0.0)), ((0, 0, 0), (1.0, 0.0, 1.0)), ((0, 0, 0), (0.0, 1.0, 1.0)), ((0, 0, 0), (1.0, 1.0, 1.0))}
FaceType, false / * continuous * /, {((0, 1, 1), (0.0, 0.5, 0.5)), ((1, 0, 1), (0.5, 0.0, 0.5)), ((1, 1, 0), (0.5, 0.5, 0.0))}
typedef Loc<Dim> Centering< Dim >::Orientation |
An orientation.
typedef std::vector<Orientation> Centering< Dim >::Orientations |
A list of value orientations.
A list of value positions.
Centering< Dim >::Centering | ( | CenteringType | cent = CellType , |
ContinuityType | cont = Continuous |
||
) | [inline] |
Create a centering without any values.
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.
Sub-centering constructor.
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().
CenteringType Centering< Dim >::centeringType | ( | ) | const [inline] |
Referenced by UniformRectilinearMesh< Dim, T >::initializeCellVolumes(), RectilinearMesh< Dim, T >::initializeCellVolumes(), UniformRectilinearMesh< Dim, T >::initializeEdgeLengths(), RectilinearMesh< Dim, T >::initializeEdgeLengths(), UniformRectilinearMesh< Dim, T >::initializeFaceAreas(), RectilinearMesh< Dim, T >::initializeFaceAreas(), UniformRectilinearMesh< Dim, T >::initializeNormals(), RectilinearMesh< Dim, T >::initializeNormals(), operator<<(), and operator==().
ContinuityType Centering< Dim >::continuityType | ( | ) | const [inline] |
bool Centering< Dim >::discontinuous | ( | ) | const [inline] |
References Discontinuous.
Referenced by cellDomainToCenteringDomain(), centeringDomainToCellDomain(), and operator==().
bool Centering< Dim >::continuous | ( | ) | const [inline] |
References Continuous.
Referenced by operator<<().
const Orientations& Centering< Dim >::orientations | ( | ) | const [inline] |
Referenced by operator==().
Referenced by NearestNeighborClass< Dim, IntraCellOnly >::operator()(), and operator==().
const Orientation& Centering< Dim >::orientation | ( | int | i | ) | const [inline] |
References PInsist.
Referenced by FieldEngine< Mesh, T, EngineTag >::FieldEngine(), FieldOffsetReduction< T, Dim, Accumulate >::FieldOffsetReduction(), UniformRectilinearMesh< Dim, T >::initializeCellVolumes(), RectilinearMesh< Dim, T >::initializeCellVolumes(), UniformRectilinearMesh< Dim, T >::initializeEdgeLengths(), RectilinearMesh< Dim, T >::initializeEdgeLengths(), UniformRectilinearMesh< Dim, T >::initializeFaceAreas(), RectilinearMesh< Dim, T >::initializeFaceAreas(), UniformRectilinearMesh< Dim, T >::initializeNormals(), RectilinearMesh< Dim, T >::initializeNormals(), FieldStencilSimple< Functor, Expression >::make(), FieldShiftSimple< Expression >::make(), NearestNeighborClass< Dim, IntraCellOnly >::operator()(), operator<<(), Centering< Dim >::operator[](), and replicate().
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.