fvcCellReduce: Add support for optional initial value
Patch contributed by Mattijs Janssens Resolves bug-report http://bugs.openfoam.org/view.php?id=2143
This commit is contained in:
parent
6230ca2689
commit
f7b851b35f
2 changed files with 18 additions and 6 deletions
|
|
@ -36,7 +36,8 @@ Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
|||
Foam::fvc::cellReduce
|
||||
(
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& ssf,
|
||||
const CombineOp& cop
|
||||
const CombineOp& cop,
|
||||
const Type& nullValue
|
||||
)
|
||||
{
|
||||
typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
|
||||
|
|
@ -56,7 +57,7 @@ Foam::fvc::cellReduce
|
|||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensioned<Type>("0", ssf.dimensions(), Zero),
|
||||
dimensioned<Type>("initialValue", ssf.dimensions(), nullValue),
|
||||
extrapolatedCalculatedFvPatchField<Type>::typeName
|
||||
)
|
||||
);
|
||||
|
|
@ -88,10 +89,19 @@ Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
|||
Foam::fvc::cellReduce
|
||||
(
|
||||
const tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>& tssf,
|
||||
const CombineOp& cop
|
||||
const CombineOp& cop,
|
||||
const Type& nullValue
|
||||
)
|
||||
{
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> tvf(cellReduce(tssf, cop));
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> tvf
|
||||
(
|
||||
cellReduce
|
||||
(
|
||||
tssf,
|
||||
cop,
|
||||
nullValue
|
||||
)
|
||||
);
|
||||
|
||||
tssf.clear();
|
||||
|
||||
|
|
|
|||
|
|
@ -53,14 +53,16 @@ namespace fvc
|
|||
tmp<GeometricField<Type, fvPatchField, volMesh>> cellReduce
|
||||
(
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>&,
|
||||
const CombineOp& cop
|
||||
const CombineOp& cop,
|
||||
const Type& nullValue = pTraits<Type>::zero
|
||||
);
|
||||
|
||||
template<class Type, class CombineOp>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh>> cellReduce
|
||||
(
|
||||
const tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>&,
|
||||
const CombineOp& cop
|
||||
const CombineOp& cop,
|
||||
const Type& nullValue = pTraits<Type>::zero
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue