Loading...
Searching...
No Matches
zeroField Class Reference

A class representing the concept of a field of 0 used to avoid unnecessary manipulations for objects which are known to be zero at compile-time. More...

#include <zeroField.H>

Inheritance diagram for zeroField:
Collaboration diagram for zeroField:

Public Member Functions

 zeroField () noexcept=default
 Default construct.
zeroField field () const noexcept
 Method name compatibility with DimensionedField.
scalar operator[] (const label) const noexcept
zeroField operator() () const noexcept
zeroField operator- () const noexcept
Public Member Functions inherited from zero
constexpr zero () noexcept
 Default construct.
constexpr zero (Istream &) noexcept
 Construct from Istream consumes no content.
constexpr operator bool () const noexcept
 Return false (0) for bool.
constexpr operator label () const noexcept
 Return 0 for label.
constexpr operator float () const noexcept
 Return 0 for float.
constexpr operator double () const noexcept
 Return 0 for double.
zero operator[] (const label) const noexcept
 Component-wise or element-wise access returns zero.
template<class T>
constexpr zero operator() (const T &) const noexcept
 Unary functor returns zero.

Additional Inherited Members

Public Types inherited from zero
typedef zero value_type
 The value type.
Static Public Attributes inherited from zero
static zero dummy
 A static instance, when modifiable reference is required by an API.

Detailed Description

A class representing the concept of a field of 0 used to avoid unnecessary manipulations for objects which are known to be zero at compile-time.

Used for example as the argument to a function in which certain terms are optional, see source terms in the MULES solvers.

Definition at line 47 of file zeroField.H.

Constructor & Destructor Documentation

◆ zeroField()

zeroField ( )
defaultnoexcept

Default construct.

References Foam::noexcept.

Referenced by field(), operator()(), and operator-().

Here is the caller graph for this function:

Member Function Documentation

◆ field()

zeroField field ( ) const
inlinenoexcept

Method name compatibility with DimensionedField.

Definition at line 66 of file zeroField.H.

References field(), Foam::noexcept, and zeroField().

Referenced by field().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]()

scalar operator[] ( const label ) const
inlinenoexcept

Definition at line 74 of file zeroField.H.

◆ operator()()

zeroField operator() ( ) const
inlinenoexcept

Definition at line 79 of file zeroField.H.

References Foam::noexcept, and zeroField().

Here is the call graph for this function:

◆ operator-()

zeroField operator- ( ) const
inlinenoexcept

Definition at line 84 of file zeroField.H.

References Foam::noexcept, and zeroField().

Here is the call graph for this function:

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