SubField< Type > Class Template Reference

SubField is a Field obtained as a section of another Field, without its own allocation. SubField is derived from a SubList rather than a List. More...

Inheritance diagram for SubField< Type >:
[legend]

Public Types

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

Public Member Functions

 SubField () noexcept=default
 Default construct, zero-sized and nullptr. More...
 
 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 nullObject reference SubField. More...
 

Detailed Description

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

SubField is a Field obtained as a section of another Field, without its own allocation. 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 66 of file SubField.H.

Constructor & Destructor Documentation

◆ SubField() [1/8]

SubField ( )
defaultnoexcept

Default construct, zero-sized and nullptr.

◆ SubField() [2/8]

SubField ( const SubField< Type > &  sfield)
inline

Copy construct (shallow copy)

Definition at line 42 of file SubFieldI.H.

◆ SubField() [3/8]

SubField ( const SubList< Type > &  list)
inline

Copy construct from SubList.

Definition at line 52 of file SubFieldI.H.

◆ SubField() [4/8]

SubField ( const UList< Type > &  list)
inlineexplicit

Construct from UList, the entire size.

Definition at line 62 of file SubFieldI.H.

◆ SubField() [5/8]

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

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

Definition at line 72 of file SubFieldI.H.

◆ SubField() [6/8]

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 83 of file SubFieldI.H.

◆ SubField() [7/8]

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 95 of file SubFieldI.H.

◆ SubField() [8/8]

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 106 of file SubFieldI.H.

Member Function Documentation

◆ null()

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

Return nullObject reference SubField.

Definition at line 32 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 120 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 129 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 138 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 145 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 152 of file SubFieldI.H.

◆ operator=() [3/5]

void operator= ( const Type &  val)
inline

Assign all entries to the given value.

Definition at line 159 of file SubFieldI.H.

◆ operator=() [4/5]

void operator= ( const Foam::zero  )
inline

Assign all entries to zero.

Definition at line 166 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 175 of file SubFieldI.H.

References forAll.

◆ operator+=()

void operator+= ( const Type &  val)
inline

Add value to each entry.

Definition at line 187 of file SubFieldI.H.

◆ operator-=()

void operator-= ( const Type &  val)
inline

Subtract value from each entry.

Definition at line 197 of file SubFieldI.H.

◆ operator*=()

void operator*= ( const scalar &  s)
inline

Multiply each entry by value.

Definition at line 207 of file SubFieldI.H.

References s.

◆ operator/=()

void operator/= ( const scalar &  s)
inline

Divide each entry by value.

Definition at line 217 of file SubFieldI.H.

References s.


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