FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Generic templated field type. More...

#include <OpenFOAM/Field.H>


Detailed Description

template<class Type>
class Foam::Field< Type >

Generic templated field type.

Source files

Definition at line 78 of file Field.H.

Inheritance diagram for Field< Type >:
Collaboration diagram for Field< Type >:

List of all members.

Public Types

typedef pTraits< Type >::cmptType  cmptType
 Component type.
typedef SubField< Type >  subField
 Declare type of subField.

Public Member Functions

 Field ()
 Construct null.
 Field (const label)
 Construct given size.
 Field (const label, const Type &)
 Construct given size and initial value.
 Field (const UList< Type > &)
 Construct as copy of a UList<Type>
 Field (const Xfer< List< Type > > &)
 Construct by transferring the List contents.
 Field (const UList< Type > &mapF, const unallocLabelList &mapAddressing)
 Construct by 1 to 1 mapping from the given field.
 Field (const tmp< Field< Type > > &tmapF, const unallocLabelList &mapAddressing)
 Construct by 1 to 1 mapping from the given tmp field.
 Field (const UList< Type > &mapF, const labelListList &mapAddressing, const scalarListList &weights)
 Construct by interpolative mapping from the given field.
 Field (const tmp< Field< Type > > &tmapF, const labelListList &mapAddressing, const scalarListList &weights)
 Construct by interpolative mapping from the given tmp field.
 Field (const UList< Type > &mapF, const FieldMapper &map)
 Construct by mapping from the given field.
 Field (const tmp< Field< Type > > &tmapF, const FieldMapper &map)
 Construct by mapping from the given tmp field.
 Field (const Field< Type > &)
 Construct as copy.
 Field (Field< Type > &, bool reUse)
 Construct as copy or re-use as specified.
 Field (const Xfer< Field< Type > > &)
 Construct by transferring the Field contents.
 Field (const typename Field< Type >::subField &)
 Construct as copy of subField.
 Field (Istream &)
 Construct as copy of tmp<Field>
 Field (const word &keyword, const dictionary &dict, const label size)
 Construct from a dictionary entry.
tmp< Field< Type > >  clone () const
 Clone.
void  map (const UList< Type > &mapF, const unallocLabelList &mapAddressing)
 1 to 1 map from the given field
void  map (const tmp< Field< Type > > &tmapF, const unallocLabelList &mapAddressing)
 1 to 1 map from the given tmp field
void  map (const UList< Type > &mapF, const labelListList &mapAddressing, const scalarListList &weights)
 Interpolative map from the given field.
void  map (const tmp< Field< Type > > &tmapF, const labelListList &mapAddressing, const scalarListList &weights)
 Interpolative map from the given tmp field.
void  map (const UList< Type > &mapF, const FieldMapper &map)
 Map from the given field.
void  map (const tmp< Field< Type > > &tmapF, const FieldMapper &map)
 Map from the given tmp field.
void  autoMap (const FieldMapper &map)
 Map from self.
void  rmap (const UList< Type > &mapF, const unallocLabelList &mapAddressing)
 1 to 1 reverse-map from the given field
void  rmap (const tmp< Field< Type > > &tmapF, const unallocLabelList &mapAddressing)
 1 to 1 reverse-map from the given tmp field
void  rmap (const UList< Type > &mapF, const unallocLabelList &mapAddressing, const scalarList &weights)
 Interpolative reverse map from the given field.
void  rmap (const tmp< Field< Type > > &tmapF, const unallocLabelList &mapAddressing, const scalarList &weights)
 Interpolative reverse map from the given tmp field.
void  negate ()
 Negate this field.
tmp< Field< cmptType > >  component (const direction) const
 Return a component field of the field.
void  replace (const direction, const UList< cmptType > &)
 Replace a component field of the field.
void  replace (const direction, const tmp< Field< cmptType > > &)
 Replace a component field of the field.
void  replace (const direction, const cmptType &)
 Replace a component field of the field.
tmp< Field< Type > >  T () const
 Return the field transpose (only defined for second rank tensors)
void  writeEntry (const word &keyword, Ostream &os) const
 Write the field as a dictionary entry.
void  operator= (const Field< Type > &)
void  operator= (const UList< Type > &)
 Assignment from UList operator. Takes linear time.
void  operator= (const SubField< Type > &)
void  operator= (const tmp< Field< Type > > &)
void  operator= (const Type &)
 Assignment of all entries to the given value.
template<class Form , class Cmpt , int nCmpt>
void  operator= (const VectorSpace< Form, Cmpt, nCmpt > &)
void  operator+= (const UList< Type > &)
void  operator+= (const tmp< Field< Type > > &)
void  operator-= (const UList< Type > &)
void  operator-= (const tmp< Field< Type > > &)
void  operator*= (const UList< scalar > &)
void  operator*= (const tmp< Field< scalar > > &)
void  operator/= (const UList< scalar > &)
void  operator/= (const tmp< Field< scalar > > &)
void  operator+= (const Type &)
void  operator-= (const Type &)
void  operator*= (const scalar &)
void  operator/= (const scalar &)
template<class Type>
void  operator= (const tmp< Field > &rhs)

Static Public Member Functions

static const Field< Type > &  null ()
 Return a null field.
template<class Type2 >
static tmp< Field< Type > >  NewCalculatedType (const Field< Type2 > &f)
 Return a pointer to a new calculatedFvPatchFieldField created on.

Static Public Attributes

static const char *const  typeName

Friends

Ostream &  operator (Ostream &, const Field< Type > &)
Ostream &  operator (Ostream &, const tmp< Field< Type > > &)

Member Typedef Documentation

typedef SubField<Type> subField

Declare type of subField.

Definition at line 90 of file Field.H.


Constructor & Destructor Documentation

Field (  )

Construct null.

Used for temporary fields which are initialised after construction

Definition at line 45 of file Field.C.

Field ( const label   size  ) [explicit]

Construct given size.

Used for temporary fields which are initialised after construction

Definition at line 52 of file Field.C.

Field ( const label   size,
const Type &   t  
)

Construct given size and initial value.

Definition at line 59 of file Field.C.

Field ( const UList< Type > &   list  ) [explicit]

Construct as copy of a UList<Type>

Definition at line 179 of file Field.C.

Field ( const Xfer< List< Type > > &   f  ) [explicit]

Construct by transferring the List contents.

Definition at line 158 of file Field.C.

Field ( const UList< Type > &   mapF,
const unallocLabelList &   mapAddressing  
)

Construct by 1 to 1 mapping from the given field.

Definition at line 67 of file Field.C.

Field ( const tmp< Field< Type > > &   tmapF,
const unallocLabelList &   mapAddressing  
)

Construct by 1 to 1 mapping from the given tmp field.

Definition at line 79 of file Field.C.

Field ( const UList< Type > &   mapF,
const labelListList &   mapAddressing,
const scalarListList &   weights  
)

Construct by interpolative mapping from the given field.

Definition at line 92 of file Field.C.

Field ( const tmp< Field< Type > > &   tmapF,
const labelListList &   mapAddressing,
const scalarListList &   weights  
)

Construct by interpolative mapping from the given tmp field.

Definition at line 105 of file Field.C.

Field ( const UList< Type > &   mapF,
const FieldMapper &   map  
)

Construct by mapping from the given field.

Definition at line 119 of file Field.C.

Field ( const tmp< Field< Type > > &   tmapF,
const FieldMapper &   map  
)

Construct by mapping from the given tmp field.

Definition at line 131 of file Field.C.

Field ( const Field< Type > &   f  )

Construct as copy.

Definition at line 143 of file Field.C.

Field ( Field< Type > &   f,
bool   reUse  
)

Construct as copy or re-use as specified.

Definition at line 151 of file Field.C.

Field ( const Xfer< Field< Type > > &   f  )

Construct by transferring the Field contents.

Definition at line 165 of file Field.C.

Field ( const typename Field< Type >::subField< Type > &   sf  )

Construct as copy of subField.

Definition at line 172 of file Field.C.

Field ( Istream &   is  )

Construct as copy of tmp<Field>

Construct from Istream

Definition at line 198 of file Field.C.

Field ( const word &   keyword,
const dictionary &   dict,
const label   size  
)

Member Function Documentation

static const Field<Type>& null (  ) [inline, static]

Return a null field.

Reimplemented from List< Type >.

Reimplemented in DimensionedField< Type, GeoMesh >, DynamicField< T, SizeInc, SizeMult, SizeDiv >, GeometricField< Type, PatchField, GeoMesh >, DimensionedField< tensor, volMesh >, DimensionedField< scalar, volMesh >, DimensionedField< vector, pointMesh >, DimensionedField< scalar, pointMesh >, DimensionedField< Type, volMesh >, DimensionedField< symmTensor, volMesh >, DimensionedField< scalar, surfaceMesh >, DimensionedField< vector, volMesh >, DimensionedField< Type, surfaceMesh >, DimensionedField< Type, pointMesh >, GeometricField< symmTensor, fvPatchField, volMesh >, GeometricField< tensor, fvPatchField, volMesh >, GeometricField< scalar, fvPatchField, volMesh >, GeometricField< scalar, fvsPatchField, surfaceMesh >, GeometricField< Type, fvsPatchField, surfaceMesh >, GeometricField< Type, pointPatchField, pointMesh >, GeometricField< scalar, pointPatchField, pointMesh >, GeometricField< vector, fvPatchField, volMesh >, GeometricField< vector, pointPatchField, pointMesh >, and GeometricField< Type, fvPatchField, volMesh >.

Definition at line 101 of file Field.H.

Referenced by parabolicCylindricalCS::globalToLocal(), slicedFvPatchField< Type >::gradientBoundaryCoeffs(), slicedFvPatchField< Type >::gradientInternalCoeffs(), globalPointPatch::localPoints(), pointPatchField< Type >::NewCalculatedType(), fvsPatchField< Type >::NewCalculatedType(), slicedFvPatchField< Type >::patchInternalField(), slicedFvPatchField< Type >::patchNeighbourField(), globalPointPatch::pointNormals(), slicedFvPatchField< Type >::snGrad(), slicedFvPatchField< Type >::valueBoundaryCoeffs(), and slicedFvPatchField< Type >::valueInternalCoeffs().

tmp< Field< Type > > clone (  ) const

Clone.

Reimplemented from List< Type >.

Reimplemented in basicSymmetryFvPatchField< Type >, calculatedFvPatchField< Type >, coupledFvPatchField< Type >, directionMixedFvPatchField< Type >, fixedGradientFvPatchField< Type >, fixedValueFvPatchField< Type >, mixedFvPatchField< Type >, slicedFvPatchField< Type >, transformFvPatchField< Type >, zeroGradientFvPatchField< Type >, cyclicFvPatchField< Type >, emptyFvPatchField< Type >, processorFvPatchField< Type >, symmetryFvPatchField< Type >, wedgeFvPatchField< Type >, advectiveFvPatchField< Type >, directMappedFixedValueFvPatchField< Type >, fanFvPatchField< Type >, fixedInternalValueFvPatchField< Type >, fixedNormalSlipFvPatchField< Type >, freestreamFvPatchField< Type >, inletOutletFvPatchField< Type >, oscillatingFixedValueFvPatchField< Type >, outletInletFvPatchField< Type >, outletMappedUniformInletFvPatchField< Type >, partialSlipFvPatchField< Type >, slipFvPatchField< Type >, timeVaryingMappedFixedValueFvPatchField< Type >, timeVaryingUniformFixedValueFvPatchField< Type >, timeVaryingUniformInletOutletFvPatchField< Type >, turbulentInletFvPatchField< Type >, uniformFixedValueFvPatchField< Type >, waveTransmissiveFvPatchField< Type >, fvPatchField< Type >, calculatedFvsPatchField< Type >, coupledFvsPatchField< Type >, fixedValueFvsPatchField< Type >, slicedFvsPatchField< Type >, cyclicFvsPatchField< Type >, emptyFvsPatchField< Type >, processorFvsPatchField< Type >, symmetryFvsPatchField< Type >, wedgeFvsPatchField< Type >, fvsPatchField< Type >, cellMotionFvPatchField< Type >, surfaceSlipDisplacementFvPatchField< Type >, angularOscillatingDisplacementPointPatchVectorField, angularOscillatingVelocityPointPatchVectorField, oscillatingDisplacementPointPatchVectorField, oscillatingVelocityPointPatchVectorField, genericFvPatchField< Type >, DimensionedField< Type, GeoMesh >, DynamicField< T, SizeInc, SizeMult, SizeDiv >, fixedValuePointPatchField< Type >, mixedPointPatchField< Type >, valuePointPatchField< Type >, timeVaryingUniformFixedValuePointPatchField< Type >, uniformFixedValuePointPatchField< Type >, curve, sixDoFRigidBodyDisplacementPointPatchVectorField, uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField, sampledSet, epsilonWallFunctionFvPatchScalarField, kqRWallFunctionFvPatchField< Type >, omegaWallFunctionFvPatchScalarField, epsilonWallFunctionFvPatchScalarField, kqRWallFunctionFvPatchField< Type >, omegaWallFunctionFvPatchScalarField, mixedFixedValueSlipFvPatchField< Type >, phase, zeroGradientFvPatchField< scalar >, fixedInternalValueFvPatchField< scalar >, fvPatchField< scalar >, DimensionedField< tensor, volMesh >, DimensionedField< scalar, volMesh >, DimensionedField< vector, pointMesh >, DimensionedField< scalar, pointMesh >, DimensionedField< Type, volMesh >, DimensionedField< symmTensor, volMesh >, DimensionedField< scalar, surfaceMesh >, DimensionedField< vector, volMesh >, DimensionedField< Type, surfaceMesh >, DimensionedField< Type, pointMesh >, fixedValuePointPatchField< vector >, and valuePointPatchField< vector >.

Definition at line 288 of file Field.C.

static tmp<Field<Type> > NewCalculatedType ( const Field< Type2 > &   f  ) [inline, static]

Return a pointer to a new calculatedFvPatchFieldField created on.

freestore without setting patchField values

Definition at line 199 of file Field.H.

void map ( const UList< Type > &   mapF,
const unallocLabelList &   mapAddressing  
)

1 to 1 map from the given field

Definition at line 298 of file Field.C.

References f(), forAll, List< Type >::setSize(), UList< T >::size(), and List< Type >::size().

Referenced by polyMesh::updateMesh().

void map ( const tmp< Field< Type > > &   tmapF,
const unallocLabelList &   mapAddressing  
)

1 to 1 map from the given tmp field

Definition at line 327 of file Field.C.

void map ( const UList< Type > &   mapF,
const labelListList &   mapAddressing,
const scalarListList &   weights  
)

Interpolative map from the given field.

Definition at line 339 of file Field.C.

References Foam::abort(), f(), Foam::FatalError, FatalErrorIn, forAll, List< Type >::setSize(), List< T >::size(), and List< Type >::size().

void map ( const tmp< Field< Type > > &   tmapF,
const labelListList &   mapAddressing,
const scalarListList &   weights  
)

Interpolative map from the given tmp field.

Definition at line 383 of file Field.C.

void map ( const UList< Type > &   mapF,
const FieldMapper &   map  
)
void map ( const tmp< Field< Type > > &   tmapF,
const FieldMapper &   map  
)

Map from the given tmp field.

Definition at line 418 of file Field.C.

void rmap ( const UList< Type > &   mapF,
const unallocLabelList &   mapAddressing  
)

1 to 1 reverse-map from the given field

Definition at line 456 of file Field.C.

References f(), and forAll.

Referenced by valuePointPatchField< Type >::rmap(), mixedPointPatchField< Type >::rmap(), and fvsPatchField< Type >::rmap().

void rmap ( const tmp< Field< Type > > &   tmapF,
const unallocLabelList &   mapAddressing  
)

1 to 1 reverse-map from the given tmp field

Definition at line 476 of file Field.C.

void rmap ( const UList< Type > &   mapF,
const unallocLabelList &   mapAddressing,
const scalarList &   weights  
)

Interpolative reverse map from the given field.

Definition at line 488 of file Field.C.

References f(), and forAll.

void rmap ( const tmp< Field< Type > > &   tmapF,
const unallocLabelList &   mapAddressing,
const scalarList &   weights  
)

Interpolative reverse map from the given tmp field.

Definition at line 506 of file Field.C.

tmp< Field< typename Field< Type >::cmptType > > component ( const direction   d  ) const

Return a component field of the field.

Reimplemented in DimensionedField< Type, GeoMesh >, GeometricField< Type, PatchField, GeoMesh >, DimensionedField< tensor, volMesh >, DimensionedField< scalar, volMesh >, DimensionedField< vector, pointMesh >, DimensionedField< scalar, pointMesh >, DimensionedField< Type, volMesh >, DimensionedField< symmTensor, volMesh >, DimensionedField< scalar, surfaceMesh >, DimensionedField< vector, volMesh >, DimensionedField< Type, surfaceMesh >, DimensionedField< Type, pointMesh >, GeometricField< symmTensor, fvPatchField, volMesh >, GeometricField< tensor, fvPatchField, volMesh >, GeometricField< scalar, fvPatchField, volMesh >, GeometricField< scalar, fvsPatchField, surfaceMesh >, GeometricField< Type, fvsPatchField, surfaceMesh >, GeometricField< Type, pointPatchField, pointMesh >, GeometricField< scalar, pointPatchField, pointMesh >, GeometricField< vector, fvPatchField, volMesh >, GeometricField< vector, pointPatchField, pointMesh >, GeometricField< Type, fvPatchField, volMesh >, GeometricField< Type, PatchField, GeoMesh >, and GeometricField< Type, PatchField, GeoMesh >.

Definition at line 526 of file Field.C.

References component(), and d.

Referenced by simpleGeomDecomp::decompose(), displacementInterpolationFvMotionSolver::displacementInterpolationFvMotionSolver(), sphericalCS::globalToLocal(), cylindricalCS::globalToLocal(), fvMatrix< Type >::H(), sphericalCS::localToGlobal(), parabolicCylindricalCS::localToGlobal(), cylindricalCS::localToGlobal(), fvMatrix< Type >::residual(), partialSlipFvPatchField< Type >::snGradTransformDiag(), fixedNormalSlipFvPatchField< Type >::snGradTransformDiag(), basicSymmetryFvPatchField< Type >::snGradTransformDiag(), fvMatrix< Type >::solve(), displacementComponentLaplacianFvMotionSolver::updateMesh(), and ensightPart::writeField().

void replace ( const direction   d,
const tmp< Field< cmptType > > &   tsf  
)

Replace a component field of the field.

Definition at line 550 of file Field.C.

void replace ( const direction   d,
const cmptType &   c  
)

Replace a component field of the field.

Definition at line 562 of file Field.C.

References TFOR_ALL_F_OP_FUNC_S_S.

void operator= ( const SubField< Type > &   rhs  )

Definition at line 634 of file Field.C.

References List< T >::operator=().

void operator= ( const tmp< Field< Type > > &    )
void operator= ( const VectorSpace< Form, Cmpt, nCmpt > &   vs  )

Definition at line 673 of file Field.C.

References TFOR_ALL_F_OP_S.

void operator+= ( const UList< Type > &    )
void operator+= ( const tmp< Field< Type > > &    )
void operator-= ( const UList< Type > &    )
void operator-= ( const tmp< Field< Type > > &    )
void operator*= ( const UList< scalar > &    )
void operator*= ( const tmp< Field< scalar > > &    )
void operator/= ( const UList< scalar > &    )
void operator/= ( const tmp< Field< scalar > > &    )
void operator*= ( const scalar &    )
void operator/= ( const scalar &    )
sutherlandTransport< thermo > & operator= ( const tmp< Field< Type > > &   rhs  ) [inline]

Friends And Related Function Documentation

Ostream& operator ( Ostream &   ,
const tmp< Field< Type > > &    
) [friend]

Member Data Documentation

const char *const typeName [static]

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