diff --git a/src/foam/fields/CoeffField/CoeffField.C b/src/foam/fields/CoeffField/CoeffField.C index 6fb7a6201..ea3233901 100644 --- a/src/foam/fields/CoeffField/CoeffField.C +++ b/src/foam/fields/CoeffField/CoeffField.C @@ -31,6 +31,10 @@ License template const char* const Foam::CoeffField::typeName("CoeffField"); +template +const Foam::CoeffField Foam::CoeffField::zero(0); + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/foam/fields/CoeffField/CoeffField.H b/src/foam/fields/CoeffField/CoeffField.H index 159e73c38..a46ee682d 100644 --- a/src/foam/fields/CoeffField/CoeffField.H +++ b/src/foam/fields/CoeffField/CoeffField.H @@ -122,6 +122,19 @@ public: static const char* const typeName; + //- Empty field + static const CoeffField zero; + + + // Static Member Functions + + //- Return a null field + inline static const CoeffField& null() + { + return zero; + } + + // Constructors @@ -138,12 +151,8 @@ public: tmp > clone() const; - // Destructor - - ~CoeffField(); - - //- Clear data - void clear(); + //- Destructor + ~CoeffField(); // Member functions @@ -163,6 +172,9 @@ public: //- Return the field transpose tmp > transpose() const; + //- Clear data + void clear(); + // Return as typed. Fails when asked for the incorrect type