Added zero CoeffField

This commit is contained in:
Hrvoje Jasak 2017-04-05 11:08:42 +01:00
parent 9fca371a48
commit 0e04d88628
2 changed files with 22 additions and 6 deletions

View file

@ -31,6 +31,10 @@ License
template<class Type> template<class Type>
const char* const Foam::CoeffField<Type>::typeName("CoeffField"); const char* const Foam::CoeffField<Type>::typeName("CoeffField");
template<class Type>
const Foam::CoeffField<Type> Foam::CoeffField<Type>::zero(0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View file

@ -122,6 +122,19 @@ public:
static const char* const typeName; static const char* const typeName;
//- Empty field
static const CoeffField<Type> zero;
// Static Member Functions
//- Return a null field
inline static const CoeffField<Type>& null()
{
return zero;
}
// Constructors // Constructors
@ -138,13 +151,9 @@ public:
tmp<CoeffField<Type> > clone() const; tmp<CoeffField<Type> > clone() const;
// Destructor //- Destructor
~CoeffField(); ~CoeffField();
//- Clear data
void clear();
// Member functions // Member functions
@ -163,6 +172,9 @@ public:
//- Return the field transpose //- Return the field transpose
tmp<CoeffField<Type> > transpose() const; tmp<CoeffField<Type> > transpose() const;
//- Clear data
void clear();
// Return as typed. Fails when asked for the incorrect type // Return as typed. Fails when asked for the incorrect type