mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -36,7 +36,8 @@ Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
|||||||
Foam::fvc::cellReduce
|
Foam::fvc::cellReduce
|
||||||
(
|
(
|
||||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& ssf,
|
const GeometricField<Type, fvsPatchField, surfaceMesh>& ssf,
|
||||||
const CombineOp& cop
|
const CombineOp& cop,
|
||||||
|
const Type& nullValue
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
|
typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
|
||||||
@ -56,7 +57,7 @@ Foam::fvc::cellReduce
|
|||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensioned<Type>("0", ssf.dimensions(), Zero),
|
dimensioned<Type>("initialValue", ssf.dimensions(), nullValue),
|
||||||
extrapolatedCalculatedFvPatchField<Type>::typeName
|
extrapolatedCalculatedFvPatchField<Type>::typeName
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -88,10 +89,19 @@ Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
|
|||||||
Foam::fvc::cellReduce
|
Foam::fvc::cellReduce
|
||||||
(
|
(
|
||||||
const tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>& tssf,
|
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();
|
tssf.clear();
|
||||||
|
|
||||||
|
|||||||
@ -53,14 +53,16 @@ namespace fvc
|
|||||||
tmp<GeometricField<Type, fvPatchField, volMesh>> cellReduce
|
tmp<GeometricField<Type, fvPatchField, volMesh>> cellReduce
|
||||||
(
|
(
|
||||||
const GeometricField<Type, fvsPatchField, surfaceMesh>&,
|
const GeometricField<Type, fvsPatchField, surfaceMesh>&,
|
||||||
const CombineOp& cop
|
const CombineOp& cop,
|
||||||
|
const Type& nullValue = pTraits<Type>::zero
|
||||||
);
|
);
|
||||||
|
|
||||||
template<class Type, class CombineOp>
|
template<class Type, class CombineOp>
|
||||||
tmp<GeometricField<Type, fvPatchField, volMesh>> cellReduce
|
tmp<GeometricField<Type, fvPatchField, volMesh>> cellReduce
|
||||||
(
|
(
|
||||||
const tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>&,
|
const tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>&,
|
||||||
const CombineOp& cop
|
const CombineOp& cop,
|
||||||
|
const Type& nullValue = pTraits<Type>::zero
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user