mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects: Further simplification and rationalization using the fvMeshFunctionObject base-class
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
||||
@ -59,7 +59,7 @@ Usage
|
||||
|
||||
See also
|
||||
Foam::functionObject
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::fvMeshFunctionObject
|
||||
Foam::functionObjects::writeFile
|
||||
|
||||
SourceFiles
|
||||
@ -70,7 +70,7 @@ SourceFiles
|
||||
#ifndef functionObjects_histogram_H
|
||||
#define functionObjects_histogram_H
|
||||
|
||||
#include "regionFunctionObject.H"
|
||||
#include "fvMeshFunctionObject.H"
|
||||
#include "writeFile.H"
|
||||
#include "writer.H"
|
||||
|
||||
@ -87,7 +87,7 @@ namespace functionObjects
|
||||
|
||||
class histogram
|
||||
:
|
||||
public regionFunctionObject
|
||||
public fvMeshFunctionObject
|
||||
{
|
||||
// Private data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user