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

@ -53,16 +53,10 @@ Foam::functionObjects::residuals::residuals
const dictionary& dict
)
:
regionFunctionObject(name, runTime, dict),
fvMeshFunctionObject(name, runTime, dict),
logFiles(obr_, name),
fieldSet_()
{
if (!isA<fvMesh>(obr_))
{
FatalErrorInFunction
<< "objectRegistry is not an fvMesh" << exit(FatalError);
}
read(dict);
resetName(typeName);
}
@ -78,7 +72,7 @@ Foam::functionObjects::residuals::~residuals()
bool Foam::functionObjects::residuals::read(const dictionary& dict)
{
regionFunctionObject::read(dict);
fvMeshFunctionObject::read(dict);
dict.lookup("fields") >> fieldSet_;

View File

@ -51,7 +51,7 @@ Description
See also
Foam::functionObject
Foam::functionObjects::regionFunctionObject
Foam::functionObjects::fvMeshFunctionObject
Foam::functionObjects::logFiles
Foam::functionObjects::timeControl
@ -63,7 +63,7 @@ SourceFiles
#ifndef functionObjects_residuals_H
#define functionObjects_residuals_H
#include "regionFunctionObject.H"
#include "fvMeshFunctionObject.H"
#include "logFiles.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -79,7 +79,7 @@ namespace functionObjects
class residuals
:
public regionFunctionObject,
public fvMeshFunctionObject,
public logFiles
{
protected:

View File

@ -36,12 +36,9 @@ void Foam::functionObjects::residuals::writeFileHeader(const word& fieldName)
if (obr_.foundObject<fieldType>(fieldName))
{
const fieldType& field = obr_.lookupObject<fieldType>(fieldName);
const fvMesh& mesh = field.mesh();
typename pTraits<Type>::labelType validComponents
(
mesh.validComponents<Type>()
mesh_.validComponents<Type>()
);
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
@ -66,9 +63,7 @@ void Foam::functionObjects::residuals::writeResidual(const word& fieldName)
if (obr_.foundObject<fieldType>(fieldName))
{
const fieldType& field = obr_.lookupObject<fieldType>(fieldName);
const fvMesh& mesh = field.mesh();
const Foam::dictionary& solverDict = mesh.solverPerformanceDict();
const Foam::dictionary& solverDict = mesh_.solverPerformanceDict();
if (solverDict.found(fieldName))
{
@ -81,7 +76,7 @@ void Foam::functionObjects::residuals::writeResidual(const word& fieldName)
typename pTraits<Type>::labelType validComponents
(
mesh.validComponents<Type>()
mesh_.validComponents<Type>()
);
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)