diff --git a/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.C b/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.C index de0119fe46..4c60b68844 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.C @@ -36,7 +36,8 @@ Foam::tmp> Foam::fvc::cellReduce ( const GeometricField& ssf, - const CombineOp& cop + const CombineOp& cop, + const Type& nullValue ) { typedef GeometricField volFieldType; @@ -56,7 +57,7 @@ Foam::fvc::cellReduce IOobject::NO_WRITE ), mesh, - dimensioned("0", ssf.dimensions(), Zero), + dimensioned("initialValue", ssf.dimensions(), nullValue), extrapolatedCalculatedFvPatchField::typeName ) ); @@ -88,10 +89,19 @@ Foam::tmp> Foam::fvc::cellReduce ( const tmp>& tssf, - const CombineOp& cop + const CombineOp& cop, + const Type& nullValue ) { - tmp> tvf(cellReduce(tssf, cop)); + tmp> tvf + ( + cellReduce + ( + tssf, + cop, + nullValue + ) + ); tssf.clear(); diff --git a/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.H b/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.H index 5c03792629..58f31d20a0 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.H +++ b/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.H @@ -53,14 +53,16 @@ namespace fvc tmp> cellReduce ( const GeometricField&, - const CombineOp& cop + const CombineOp& cop, + const Type& nullValue = pTraits::zero ); template tmp> cellReduce ( const tmp>&, - const CombineOp& cop + const CombineOp& cop, + const Type& nullValue = pTraits::zero ); }