Field: Added zero() constructor

This commit is contained in:
Henry Weller
2016-03-19 21:20:33 +00:00
parent 248d6065eb
commit 712b07d478
2 changed files with 10 additions and 0 deletions

View File

@ -57,6 +57,13 @@ Foam::Field<Type>::Field(const label size, const Type& t)
{}
template<class Type>
Foam::Field<Type>::Field(const label size, const zero)
:
List<Type>(size, pTraits<Type>::zero)
{}
template<class Type>
Foam::Field<Type>::Field
(

View File

@ -117,6 +117,9 @@ public:
//- Construct given size and initial value
Field(const label, const Type&);
//- Construct given size and initialed to zero
Field(const label, const zero);
//- Construct as copy of a UList\<Type\>
explicit Field(const UList<Type>&);