functionObjects: Further simplification and rationalization using the fvMeshFunctionObject base-class

This commit is contained in:
Henry Weller
2016-08-10 12:29:19 +01:00
parent 8339b57255
commit 2da5570c92
35 changed files with 256 additions and 447 deletions

View File

@ -75,15 +75,9 @@ Foam::functionObjects::histogram::histogram
const dictionary& dict
)
:
regionFunctionObject(name, runTime, dict),
fvMeshFunctionObject(name, runTime, dict),
file_(obr_, name)
{
if (!isA<fvMesh>(obr_))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict);
}
@ -120,8 +114,6 @@ bool Foam::functionObjects::histogram::write()
{
Log << type() << " " << name() << " write:" << nl;
const fvMesh& mesh = refCast<const fvMesh>(obr_);
autoPtr<volScalarField> fieldPtr;
if (obr_.foundObject<volScalarField>(fieldName_))
{
@ -137,12 +129,12 @@ bool Foam::functionObjects::histogram::write()
IOobject
(
fieldName_,
mesh.time().timeName(),
mesh,
mesh_.time().timeName(),
mesh_,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
mesh_
)
);
}
@ -166,7 +158,7 @@ bool Foam::functionObjects::histogram::write()
}
scalarField volFrac(nBins_, 0);
const scalarField& V = mesh.V();
const scalarField& V = mesh_.V();
forAll(field, celli)
{