SubField< Type > Class Template Reference

SubField is a Field obtained as a section of another Field. More...

Inheritance diagram for SubField< Type >:
[legend]

Public Types

typedef pTraits< Type >::cmptType cmptType
 Component type. More...
 

Public Member Functions

 SubField (const SubField< Type > &sfield)
 Copy construct (shallow copy) More...
 
 SubField (const SubList< Type > &list)
 Copy construct from SubList. More...
 
 SubField (const UList< Type > &list)
 Construct from UList, the entire size. More...
 
 SubField (const UList< Type > &list, const label subSize)
 Construct from UList with a given sub-list size, start at 0. More...
 
 SubField (const UList< Type > &list, const label subSize, const label startIndex)
 Construct from UList with a given size and start index. More...
 
 SubField (const UList< Type > &list, const labelRange &range)
 Construct from UList and a (start,size) range. More...
 
 SubField (const labelRange &range, const UList< Type > &list)
 
tmp< Field< cmptType > > component (const direction) const
 Return a component field of the field. More...
 
tmp< Field< Type > > T () const
 Return the field transpose (only defined for second rank tensors) More...
 
 operator const Foam::Field< Type > & () const
 Allow cast to a const Field<Type>&. More...
 
void operator= (const SubField< Type > &)
 Copy assign via UList operator. Takes linear time. More...
 
void operator= (const Field< Type > &)
 Copy assign via UList operator. Takes linear time. More...
 
void operator= (const Type &val)
 Assign all entries to the given value. More...
 
void operator= (const Foam::zero)
 Assign all entries to zero. More...
 
template<class Form , direction Ncmpts>
void operator= (const VectorSpace< Form, Type, Ncmpts > &rhs)
 Copy assign via UList operator. Takes linear time. More...
 
void operator+= (const Type &val)
 Add value to each entry. More...
 
void operator-= (const Type &val)
 Subtract value from each entry. More...
 
void operator*= (const scalar &s)
 Multiply each entry by value. More...
 
void operator/= (const scalar &s)
 Divide each entry by value. More...
 

Static Public Member Functions

static const SubField< Type > & null ()
 Return a null SubField. More...
 

Detailed Description

template<class Type>
class Foam::SubField< Type >

SubField is a Field obtained as a section of another Field.

Thus it is itself unallocated so that no storage is allocated or deallocated during its use. To achieve this behaviour, SubField is derived from a SubList rather than a List.

Source files

Definition at line 64 of file Field.H.

Member Typedef Documentation

◆ cmptType

typedef pTraits<Type>::cmptType cmptType

Component type.

Definition at line 71 of file SubField.H.

Constructor & Destructor Documentation

◆ SubField() [1/7]

SubField ( const SubField< Type > &  sfield)
inline

Copy construct (shallow copy)

Definition at line 33 of file SubFieldI.H.

◆ SubField() [2/7]

SubField ( const SubList< Type > &  list)
inline

Copy construct from SubList.

Definition at line 43 of file SubFieldI.H.

◆ SubField() [3/7]

SubField ( const UList< Type > &  list)
inlineexplicit

Construct from UList, the entire size.

Definition at line 53 of file SubFieldI.H.

◆ SubField() [4/7]

SubField ( const UList< Type > &  list,
const label  subSize 
)
inline

Construct from UList with a given sub-list size, start at 0.

Definition at line 63 of file SubFieldI.H.

◆ SubField() [5/7]

SubField ( const UList< Type > &  list,
const label  subSize,
const label  startIndex 
)
inline

Construct from UList with a given size and start index.

Definition at line 74 of file SubFieldI.H.

◆ SubField() [6/7]

SubField ( const UList< Type > &  list,
const labelRange range 
)
inline

Construct from UList and a (start,size) range.

The range is subsetted with the list size itself to ensure that the result always addresses a valid section of the list.

Definition at line 86 of file SubFieldI.H.

◆ SubField() [7/7]

SubField ( const labelRange range,
const UList< Type > &  list 
)
inline

Construct from UList and a (start,size) range, but bypassing run-time range checking.

Definition at line 97 of file SubFieldI.H.

Member Function Documentation

◆ null()

const Foam::SubField< Type > & null ( )
inlinestatic

Return a null SubField.

Definition at line 109 of file SubFieldI.H.

◆ component()

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

Return a component field of the field.

Definition at line 118 of file SubFieldI.H.

◆ T()

Foam::tmp< Foam::Field< Type > > T ( ) const
inline

Return the field transpose (only defined for second rank tensors)

Definition at line 127 of file SubFieldI.H.

◆ operator const Foam::Field< Type > &()

operator const Foam::Field< Type > & ( ) const
inline

Allow cast to a const Field<Type>&.

Definition at line 136 of file SubFieldI.H.

◆ operator=() [1/5]

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

Copy assign via UList operator. Takes linear time.

Definition at line 143 of file SubFieldI.H.

Referenced by SubDimensionedField< Type, GeoMesh >::operator=().

Here is the caller graph for this function:

◆ operator=() [2/5]

void operator= ( const Field< Type > &  rhs)
inline

Copy assign via UList operator. Takes linear time.

Definition at line 150 of file SubFieldI.H.

◆ operator=() [3/5]

void operator= ( const Type &  val)
inline

Assign all entries to the given value.

Definition at line 157 of file SubFieldI.H.

◆ operator=() [4/5]

void operator= ( const Foam::zero  )
inline

Assign all entries to zero.

Definition at line 164 of file SubFieldI.H.

References Foam::Zero.

◆ operator=() [5/5]

void operator= ( const VectorSpace< Form, Type, Ncmpts > &  rhs)
inline

Copy assign via UList operator. Takes linear time.

Definition at line 173 of file SubFieldI.H.

References forAll.

◆ operator+=()

void operator+= ( const Type &  val)
inline

Add value to each entry.

Definition at line 185 of file SubFieldI.H.

◆ operator-=()

void operator-= ( const Type &  val)
inline

Subtract value from each entry.

Definition at line 195 of file SubFieldI.H.

◆ operator*=()

void operator*= ( const scalar &  s)
inline

Multiply each entry by value.

Definition at line 205 of file SubFieldI.H.

References s.

◆ operator/=()

void operator/= ( const scalar &  s)
inline

Divide each entry by value.

Definition at line 215 of file SubFieldI.H.

References s.


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