diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C index 5cc6f2213e1030949b53052dc7cbf45e12336371..9a1b6c70ef9b31b864430493eec7fadb4306c23d 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.C @@ -47,27 +47,13 @@ namespace functionObjects Foam::functionObjects::writeVTK::writeVTK ( const word& name, - const Time& t, + const Time& runTime, const dictionary& dict ) : - functionObject(name), - time_(t), - obr_ - ( - time_.lookupObject<objectRegistry> - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ), + fvMeshFunctionObject(name, runTime, dict), objectNames_() { - if (!isA<fvMesh>(obr_)) - { - FatalErrorInFunction - << "objectRegistry is not an fvMesh" << exit(FatalError); - } - read(dict); } @@ -98,20 +84,16 @@ bool Foam::functionObjects::writeVTK::write(const bool postProcess) { Info<< type() << " " << name() << " output:" << nl; - fvMesh& mesh = const_cast<fvMesh&>(refCast<const fvMesh>(obr_)); - - const Time& runTime = mesh.time(); - - Info<< "Time: " << runTime.timeName() << endl; + Info<< "Time: " << time_.timeName() << endl; - word timeDesc = runTime.timeName(); + word timeDesc = time_.timeName(); // VTK/ directory in the case - fileName fvPath(runTime.path()/"VTK"); + fileName fvPath(time_.path()/"VTK"); mkDir(fvPath); - string vtkName = runTime.caseName(); + string vtkName = time_.caseName(); if (Pstream::parRun()) { @@ -135,7 +117,7 @@ bool Foam::functionObjects::writeVTK::write(const bool postProcess) Info<< " Internal : " << vtkFileName << endl; - vtkMesh vMesh(mesh); + vtkMesh vMesh(const_cast<fvMesh&>(mesh_)); // Write mesh internalWriter writer(vMesh, false, vtkFileName); diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.H b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.H index 2df7cb328d8a11d83fd7969aaaebec778c452318..b8c1968f81545f7ee613b8fa26f5f6e2d9504c7e 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.H +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeVTK/writeVTK.H @@ -54,7 +54,7 @@ Description \endtable SeeAlso - Foam::functionObject + Foam::functionObjects::fvMeshFunctionObject Foam::functionObjects::timeControl SourceFiles @@ -66,18 +66,13 @@ SourceFiles #ifndef functionObjects_writeVTK_H #define functionObjects_writeVTK_H -#include "functionObject.H" +#include "fvMeshFunctionObject.H" #include "wordReList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// Forward declaration of classes -class Time; -class objectRegistry; - namespace functionObjects { @@ -87,16 +82,10 @@ namespace functionObjects class writeVTK : - public functionObject + public fvMeshFunctionObject { // Private data - //- Reference to the Time - const Time& time_; - - //- Refererence to objectRegistry - const objectRegistry& obr_; - //- Names of objects wordReList objectNames_; diff --git a/src/postProcessing/functionObjects/field/div/div.C b/src/postProcessing/functionObjects/field/div/div.C index a91ffffcdff326352bfb2ab5279a82eec2f07e0c..a3e6bf114d62145d6f30248716b53ff8c61aae74 100644 --- a/src/postProcessing/functionObjects/field/div/div.C +++ b/src/postProcessing/functionObjects/field/div/div.C @@ -131,10 +131,10 @@ bool Foam::functionObjects::div::execute(const bool postProcess) bool Foam::functionObjects::div::write(const bool postProcess) { - if (obr_.foundObject<regIOobject>(resultName_)) + if (mesh_.foundObject<regIOobject>(resultName_)) { const regIOobject& field = - obr_.lookupObject<regIOobject>(resultName_); + mesh_.lookupObject<regIOobject>(resultName_); Info<< type() << " " << name() << " output:" << nl << " writing field " << field.name() << nl << endl; diff --git a/src/postProcessing/functionObjects/field/div/div.H b/src/postProcessing/functionObjects/field/div/div.H index 17e53c26d65abd0fa8a49ffb065bc55135bcebc2..54e514a42aa978e137fab99e61997744273603b3 100644 --- a/src/postProcessing/functionObjects/field/div/div.H +++ b/src/postProcessing/functionObjects/field/div/div.H @@ -32,6 +32,9 @@ Description limited to surfaceScalarFields and volVectorFields, and the output is a volScalarField. +SeeAlso + Foam::functionObjects::fvMeshFunctionObject + SourceFiles div.C @@ -62,7 +65,7 @@ class div : public fvMeshFunctionObject { - // Private data + // Private member data //- Name of field to process word fieldName_; diff --git a/src/postProcessing/functionObjects/field/grad/grad.H b/src/postProcessing/functionObjects/field/grad/grad.H index 43e6cef3d507a23e5d82ba46509fd2ad6917e245..a58d781935ba92c96b1df47cb7f45ed65098e0ee 100644 --- a/src/postProcessing/functionObjects/field/grad/grad.H +++ b/src/postProcessing/functionObjects/field/grad/grad.H @@ -32,6 +32,9 @@ Description limited to scalar and vector volume or surface fields, and the output is a volume vector or tensor field. +SeeAlso + Foam::functionObjects::fvMeshFunctionObject + SourceFiles grad.C diff --git a/src/postProcessing/functionObjects/field/mag/mag.H b/src/postProcessing/functionObjects/field/mag/mag.H index be1c6fe86fede96130ad24a8467d283da74768f7..e3f09e7ed82ce682b0447ec667c3da3d393d8044 100644 --- a/src/postProcessing/functionObjects/field/mag/mag.H +++ b/src/postProcessing/functionObjects/field/mag/mag.H @@ -32,6 +32,9 @@ Description can be applied to any volume or surface fieldsm and the output is a volume or surface scalar field. +SeeAlso + Foam::functionObjects::fvMeshFunctionObject + SourceFiles mag.C diff --git a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C index 2bf8fb2537e0e4d41ab2f8da479302a447532e09..29f1e3577e8ca118cdbd4274710d01503c070f41 100644 --- a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C +++ b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C @@ -46,14 +46,12 @@ namespace functionObjects void Foam::functionObjects::nearWallFields::calcAddressing() { - const fvMesh& mesh = refCast<const fvMesh>(obr_); - // Count number of faces label nPatchFaces = 0; forAllConstIter(labelHashSet, patchSet_, iter) { label patchi = iter.key(); - nPatchFaces += mesh.boundary()[patchi].size(); + nPatchFaces += mesh_.boundary()[patchi].size(); } // Global indexing @@ -65,7 +63,7 @@ void Foam::functionObjects::nearWallFields::calcAddressing() } // Construct cloud - Cloud<findCellParticle> cloud(mesh, IDLList<findCellParticle>()); + Cloud<findCellParticle> cloud(mesh_, IDLList<findCellParticle>()); // Add particles to track to sample locations nPatchFaces = 0; @@ -73,7 +71,7 @@ void Foam::functionObjects::nearWallFields::calcAddressing() forAllConstIter(labelHashSet, patchSet_, iter) { label patchi = iter.key(); - const fvPatch& patch = mesh.boundary()[patchi]; + const fvPatch& patch = mesh_.boundary()[patchi]; vectorField nf(patch.nf()); vectorField faceCellCentres(patch.patch().faceCellCentres()); @@ -88,7 +86,7 @@ void Foam::functionObjects::nearWallFields::calcAddressing() ( mappedPatchBase::facePoint ( - mesh, + mesh_, meshFacei, polyMesh::FACE_DIAG_TRIS ) @@ -112,14 +110,14 @@ void Foam::functionObjects::nearWallFields::calcAddressing() label celli = -1; label tetFacei = -1; label tetPtI = -1; - mesh.findCellFacePt(start, celli, tetFacei, tetPtI); + mesh_.findCellFacePt(start, celli, tetFacei, tetPtI); // Add to cloud. Add originating face as passive data cloud.addParticle ( new findCellParticle ( - mesh, + mesh_, start, celli, tetFacei, @@ -140,8 +138,8 @@ void Foam::functionObjects::nearWallFields::calcAddressing() // Dump particles OBJstream str ( - mesh.time().path() - /"wantedTracks_" + mesh.time().timeName() + ".obj" + mesh_.time().path() + /"wantedTracks_" + mesh_.time().timeName() + ".obj" ); InfoInFunction << "Dumping tracks to " << str.name() << endl; @@ -155,14 +153,14 @@ void Foam::functionObjects::nearWallFields::calcAddressing() // Per cell: empty or global wall index and end location - cellToWalls_.setSize(mesh.nCells()); - cellToSamples_.setSize(mesh.nCells()); + cellToWalls_.setSize(mesh_.nCells()); + cellToSamples_.setSize(mesh_.nCells()); // Database to pass into findCellParticle::move findCellParticle::trackingData td(cloud, cellToWalls_, cellToSamples_); // Track all particles to their end position. - scalar maxTrackLen = 2.0*mesh.bounds().mag(); + scalar maxTrackLen = 2.0*mesh_.bounds().mag(); //Debug: collect start points @@ -202,8 +200,8 @@ void Foam::functionObjects::nearWallFields::calcAddressing() { OBJstream str ( - mesh.time().path() - /"obtainedTracks_" + mesh.time().timeName() + ".obj" + mesh_.time().path() + /"obtainedTracks_" + mesh_.time().timeName() + ".obj" ); InfoInFunction << "Dumping obtained to " << str.name() << endl; @@ -230,22 +228,9 @@ Foam::functionObjects::nearWallFields::nearWallFields const dictionary& dict ) : - functionObject(name), - obr_ - ( - runTime.lookupObject<objectRegistry> - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ), + fvMeshFunctionObject(name, runTime, dict), fieldSet_() { - if (!isA<fvMesh>(obr_)) - { - FatalErrorInFunction - << "objectRegistry is not an fvMesh" << exit(FatalError); - } - read(dict); } @@ -270,11 +255,9 @@ bool Foam::functionObjects::nearWallFields::read(const dictionary& dict) InfoInFunction << endl; } - const fvMesh& mesh = refCast<const fvMesh>(obr_); - dict.lookup("fields") >> fieldSet_; patchSet_ = - mesh.boundaryMesh().patchSet(wordReList(dict.lookup("patches"))); + mesh_.boundaryMesh().patchSet(wordReList(dict.lookup("patches"))); distance_ = readScalar(dict.lookup("distance")); @@ -343,7 +326,7 @@ bool Foam::functionObjects::nearWallFields::execute(const bool postProcess) Info<< type() << " " << name() << " output:" << nl; - Info<< " Sampling fields to " << obr_.time().timeName() + Info<< " Sampling fields to " << time_.timeName() << endl; sampleFields(vsf_); @@ -363,7 +346,7 @@ bool Foam::functionObjects::nearWallFields::write(const bool postProcess) InfoInFunction << endl; } - Info<< " Writing sampled fields to " << obr_.time().timeName() + Info<< " Writing sampled fields to " << time_.timeName() << endl; forAll(vsf_, i) diff --git a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H index 4ea6f13fd56d4bf00071d86f5558b5d1ea16b475..f0bdda2cc83a281ce3d0879aef836a070844d903 100644 --- a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H +++ b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H @@ -61,7 +61,7 @@ Description \endtable SeeAlso - Foam::functionObject + Foam::functionObjects::fvMeshFunctionObject SourceFiles nearWallFields.C @@ -71,7 +71,7 @@ SourceFiles #ifndef functionObjects_nearWallFields_H #define functionObjects_nearWallFields_H -#include "functionObject.H" +#include "fvMeshFunctionObject.H" #include "volFields.H" #include "Tuple2.H" #include "interpolationCellPoint.H" @@ -80,10 +80,6 @@ SourceFiles namespace Foam { - -// Forward declaration of classes -class objectRegistry; - namespace functionObjects { @@ -93,14 +89,11 @@ namespace functionObjects class nearWallFields : - public functionObject + public fvMeshFunctionObject { protected: - // Protected data - - //- Reference to the objectRegistry - const objectRegistry& obr_; + // Protected member data // Read from dictionary diff --git a/src/postProcessing/functionObjects/field/processorField/processorField.C b/src/postProcessing/functionObjects/field/processorField/processorField.C index 3a0f57ed27cd79061054bf6181b91f1d98b1525d..1ffc9c10d58c6c51a9957abf38199de2be931ee0 100644 --- a/src/postProcessing/functionObjects/field/processorField/processorField.C +++ b/src/postProcessing/functionObjects/field/processorField/processorField.C @@ -48,25 +48,10 @@ Foam::functionObjects::processorField::processorField const dictionary& dict ) : - functionObject(name), - obr_ - ( - runTime.lookupObject<objectRegistry> - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ) + fvMeshFunctionObject(name, runTime, dict) { - if (!isA<fvMesh>(obr_)) - { - FatalErrorInFunction - << "objectRegistry is not an fvMesh" << exit(FatalError); - } - read(dict); - const fvMesh& mesh = refCast<const fvMesh>(obr_); - volScalarField* procFieldPtr ( new volScalarField @@ -74,17 +59,17 @@ Foam::functionObjects::processorField::processorField IOobject ( "processorID", - mesh.time().timeName(), - mesh, + mesh_.time().timeName(), + mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + mesh_, dimensionedScalar("0", dimless, 0.0) ) ); - mesh.objectRegistry::store(procFieldPtr); + mesh_.objectRegistry::store(procFieldPtr); } @@ -105,7 +90,7 @@ bool Foam::functionObjects::processorField::read(const dictionary& dict) bool Foam::functionObjects::processorField::execute(const bool postProcess) { const volScalarField& procField = - obr_.lookupObject<volScalarField>("processorID"); + mesh_.lookupObject<volScalarField>("processorID"); const_cast<volScalarField&>(procField) == dimensionedScalar("proci", dimless, Pstream::myProcNo()); @@ -117,7 +102,7 @@ bool Foam::functionObjects::processorField::execute(const bool postProcess) bool Foam::functionObjects::processorField::write(const bool postProcess) { const volScalarField& procField = - obr_.lookupObject<volScalarField>("processorID"); + mesh_.lookupObject<volScalarField>("processorID"); procField.write(); diff --git a/src/postProcessing/functionObjects/field/processorField/processorField.H b/src/postProcessing/functionObjects/field/processorField/processorField.H index 5e9138f45a77496653ddce246493e830f15f11ba..c3334bedd9e86abcebf22646be650ee999f7fc4b 100644 --- a/src/postProcessing/functionObjects/field/processorField/processorField.H +++ b/src/postProcessing/functionObjects/field/processorField/processorField.H @@ -48,7 +48,7 @@ Description \endtable SeeAlso - Foam::functionObject + Foam::functionObjects::fvMeshFunctionObject SourceFiles processorField.C @@ -58,16 +58,12 @@ SourceFiles #ifndef functionObjects_processorField_H #define functionObjects_processorField_H -#include "functionObject.H" +#include "fvMeshFunctionObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// Forward declaration of classes -class objectRegistry; - namespace functionObjects { @@ -77,18 +73,8 @@ namespace functionObjects class processorField : - public functionObject + public fvMeshFunctionObject { -protected: - - // Protected data - - //- Reference to the objectRegistry - const objectRegistry& obr_; - - -private: - // Private member functions //- Disallow default bitwise copy construct diff --git a/src/postProcessing/functionObjects/field/readFields/readFields.C b/src/postProcessing/functionObjects/field/readFields/readFields.C index 6014a7d31ccfc35b79b6056f2b0ce5e665b684f3..d51f5c6527992dacd58266d4259fe5765cb8fe82 100644 --- a/src/postProcessing/functionObjects/field/readFields/readFields.C +++ b/src/postProcessing/functionObjects/field/readFields/readFields.C @@ -49,22 +49,9 @@ Foam::functionObjects::readFields::readFields const dictionary& dict ) : - functionObject(name), - obr_ - ( - runTime.lookupObject<objectRegistry> - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ), + fvMeshFunctionObject(name, runTime, dict), fieldSet_() { - if (!isA<fvMesh>(obr_)) - { - FatalErrorInFunction - << "objectRegistry is not an fvMesh" << exit(FatalError); - } - read(dict); } diff --git a/src/postProcessing/functionObjects/field/readFields/readFields.H b/src/postProcessing/functionObjects/field/readFields/readFields.H index d82ecdf44bfa48c226fba6a53fd2303dc4dd1402..0f314eb0b3c6c31b01e92e9423e94b400e0124c2 100644 --- a/src/postProcessing/functionObjects/field/readFields/readFields.H +++ b/src/postProcessing/functionObjects/field/readFields/readFields.H @@ -54,7 +54,7 @@ Description \endtable SeeAlso - Foam::functionObject + Foam::functionObjects::fvMeshFunctionObject SourceFiles readFields.C @@ -64,7 +64,7 @@ SourceFiles #ifndef functionObjects_readFields_H #define functionObjects_readFields_H -#include "functionObject.H" +#include "fvMeshFunctionObject.H" #include "volFieldsFwd.H" #include "surfaceFieldsFwd.H" @@ -72,10 +72,6 @@ SourceFiles namespace Foam { - -// Forward declaration of classes -class objectRegistry; - namespace functionObjects { @@ -85,15 +81,12 @@ namespace functionObjects class readFields : - public functionObject + public fvMeshFunctionObject { protected: // Protected data - //- Reference to the objectRegistry - const objectRegistry& obr_; - //- Fields to load wordList fieldSet_; diff --git a/src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C b/src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C index 37631001c9b012faec0d99d0493723c92d634bfa..9e9feb90eb7c4e3bd2ddaa2a1b2b638ea4802050 100644 --- a/src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C +++ b/src/postProcessing/functionObjects/field/readFields/readFieldsTemplates.C @@ -59,13 +59,11 @@ void Foam::functionObjects::readFields::loadField } else { - const fvMesh& mesh = refCast<const fvMesh>(obr_); - IOobject fieldHeader ( fieldName, - mesh.time().timeName(), - mesh, + mesh_.time().timeName(), + mesh_, IOobject::MUST_READ, IOobject::NO_WRITE ); @@ -80,7 +78,7 @@ void Foam::functionObjects::readFields::loadField Info<< " Reading " << fieldName << endl; label sz = vflds.size(); vflds.setSize(sz+1); - vflds.set(sz, new vfType(fieldHeader, mesh)); + vflds.set(sz, new vfType(fieldHeader, mesh_)); } else if ( @@ -92,7 +90,7 @@ void Foam::functionObjects::readFields::loadField Info<< " Reading " << fieldName << endl; label sz = sflds.size(); sflds.setSize(sz+1); - sflds.set(sz, new sfType(fieldHeader, mesh)); + sflds.set(sz, new sfType(fieldHeader, mesh_)); } } } diff --git a/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.C b/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.C index 97ab1ddd63f56600ef19fef81983d6e02f40115b..631c5541e942eb6f4be28aa71a561954576987e7 100644 --- a/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.C +++ b/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.C @@ -129,8 +129,6 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressureTools::pDyn const volScalarField& p ) const { - const fvMesh& mesh = refCast<const fvMesh>(obr_); - tmp<volScalarField> tpDyn ( new volScalarField @@ -138,12 +136,12 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressureTools::pDyn IOobject ( "pDyn", - mesh.time().timeName(), - mesh, + mesh_.time().timeName(), + mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + mesh_, dimensionedScalar("zero", dimPressure, 0.0) ) ); @@ -191,14 +189,7 @@ Foam::functionObjects::pressureTools::pressureTools const dictionary& dict ) : - functionObject(name), - obr_ - ( - runTime.lookupObject<objectRegistry> - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ), + fvMeshFunctionObject(name, runTime, dict), pName_("p"), UName_("U"), rhoName_("rho"), @@ -209,12 +200,6 @@ Foam::functionObjects::pressureTools::pressureTools UInf_(Zero), rhoInf_(0.0) { - if (!isA<fvMesh>(obr_)) - { - FatalErrorInFunction - << "objectRegistry is not an fvMesh" << exit(FatalError); - } - read(dict); dimensionSet pDims(dimPressure); @@ -224,8 +209,6 @@ Foam::functionObjects::pressureTools::pressureTools pDims /= dimPressure; } - const fvMesh& mesh = refCast<const fvMesh>(obr_); - volScalarField* pPtr ( new volScalarField @@ -233,17 +216,17 @@ Foam::functionObjects::pressureTools::pressureTools IOobject ( pName(), - mesh.time().timeName(), - mesh, + mesh_.time().timeName(), + mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + mesh_, dimensionedScalar("0", pDims, 0.0) ) ); - mesh.objectRegistry::store(pPtr); + mesh_.objectRegistry::store(pPtr); } diff --git a/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.H b/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.H index ff3fd37adb951de55e30a0ced32c884ffa163a59..f957966c87ae466064dd0b8a4d9f91038a8211c9 100644 --- a/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.H +++ b/src/postProcessing/functionObjects/forces/pressureTools/pressureTools.H @@ -100,6 +100,9 @@ Description rhoInf | Freestream density for coefficient calculation | no | \endtable +SeeAlso + Foam::functionObjects::fvMeshFunctionObject + SourceFiles pressureTools.C @@ -108,7 +111,7 @@ SourceFiles #ifndef functionObjects_pressureTools_H #define functionObjects_pressureTools_H -#include "functionObject.H" +#include "fvMeshFunctionObject.H" #include "volFieldsFwd.H" #include "dimensionedScalar.H" @@ -116,10 +119,6 @@ SourceFiles namespace Foam { - -// Forward declaration of classes -class objectRegistry; - namespace functionObjects { @@ -129,13 +128,10 @@ namespace functionObjects class pressureTools : - public functionObject + public fvMeshFunctionObject { // Private data - //- Reference to the objectRegistry - const objectRegistry& obr_; - //- Name of pressure field, default is "p" word pName_; diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C index 298963e58d68a61d69f7035b9690141902266b5f..ff99c21b4b08290c4ee43ef9d7ae1fb29669d003 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C @@ -75,27 +75,10 @@ Foam::functionObjects::CourantNo::CourantNo const dictionary& dict ) : - functionObject(name), - obr_ - ( - runTime.lookupObject<objectRegistry> - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ), - phiName_("phi"), - rhoName_("rho") + fvMeshFunctionObject(name, runTime, dict) { - if (!isA<fvMesh>(obr_)) - { - FatalErrorInFunction - << "objectRegistry is not an fvMesh" << exit(FatalError); - } - read(dict); - const fvMesh& mesh = refCast<const fvMesh>(obr_); - volScalarField* CourantNoPtr ( new volScalarField @@ -103,18 +86,18 @@ Foam::functionObjects::CourantNo::CourantNo IOobject ( type(), - mesh.time().timeName(), - mesh, + mesh_.time().timeName(), + mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + mesh_, dimensionedScalar("0", dimless, 0.0), zeroGradientFvPatchScalarField::typeName ) ); - mesh.objectRegistry::store(CourantNoPtr); + mesh_.objectRegistry::store(CourantNoPtr); } @@ -137,21 +120,19 @@ bool Foam::functionObjects::CourantNo::read(const dictionary& dict) bool Foam::functionObjects::CourantNo::execute(const bool postProcess) { - const fvMesh& mesh = refCast<const fvMesh>(obr_); - const surfaceScalarField& phi = - mesh.lookupObject<surfaceScalarField>(phiName_); + mesh_.lookupObject<surfaceScalarField>(phiName_); volScalarField& Co = const_cast<volScalarField&> ( - mesh.lookupObject<volScalarField>(type()) + mesh_.lookupObject<volScalarField>(type()) ); Co.ref() = byRho ( - (0.5*mesh.time().deltaT()) + (0.5*mesh_.time().deltaT()) *fvc::surfaceSum(mag(phi))()() - /mesh.V() + /mesh_.V() ); Co.correctBoundaryConditions(); diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H index 6db5e796e5b57ebe04d82c98123c4ecabc0b6a69..feaa6b0aea62c53673b11ed9164cc7d661b94c80 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H @@ -32,6 +32,9 @@ Description volScalarField. The field is stored on the mesh database so that it can be retrieved and used for other applications. +SeeAlso + Foam::functionObjects::fvMeshFunctionObject + SourceFiles CourantNo.C @@ -40,7 +43,7 @@ SourceFiles #ifndef functionObjects_CourantNo_H #define functionObjects_CourantNo_H -#include "functionObject.H" +#include "fvMeshFunctionObject.H" #include "volFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,13 +59,10 @@ namespace functionObjects class CourantNo : - public functionObject + public fvMeshFunctionObject { // Private data - //- Reference to the database - const objectRegistry& obr_; - //- Name of flux field, default is "phi" word phiName_; diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C index defbe1841aaebf46ce9c058dd315b841a687474a..9f47b1fac1120d901b7a2621d4471687033859c3 100644 --- a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C @@ -56,26 +56,10 @@ Foam::functionObjects::Lambda2::Lambda2 const dictionary& dict ) : - functionObject(name), - obr_ - ( - runTime.lookupObject<objectRegistry> - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ), - UName_("U") + fvMeshFunctionObject(name, runTime, dict) { - if (!isA<fvMesh>(obr_)) - { - FatalErrorInFunction - << "objectRegistry is not an fvMesh" << exit(FatalError); - } - read(dict); - const fvMesh& mesh = refCast<const fvMesh>(obr_); - volScalarField* Lambda2Ptr ( new volScalarField @@ -83,17 +67,17 @@ Foam::functionObjects::Lambda2::Lambda2 IOobject ( type(), - mesh.time().timeName(), - mesh, + mesh_.time().timeName(), + mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + mesh_, dimensionedScalar("0", dimless/sqr(dimTime), 0.0) ) ); - mesh.objectRegistry::store(Lambda2Ptr); + mesh_.objectRegistry::store(Lambda2Ptr); } @@ -115,10 +99,8 @@ bool Foam::functionObjects::Lambda2::read(const dictionary& dict) bool Foam::functionObjects::Lambda2::execute(const bool postProcess) { - const fvMesh& mesh = refCast<const fvMesh>(obr_); - const volVectorField& U = - mesh.lookupObject<volVectorField>(UName_); + mesh_.lookupObject<volVectorField>(UName_); const volTensorField gradU(fvc::grad(U)); @@ -131,7 +113,7 @@ bool Foam::functionObjects::Lambda2::execute(const bool postProcess) volScalarField& Lambda2 = const_cast<volScalarField&> ( - mesh.lookupObject<volScalarField>(type()) + mesh_.lookupObject<volScalarField>(type()) ); Lambda2 = -eigenValues(SSplusWW)().component(vector::Y); diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H index 76d3b6d73f24a58c768daf356b30b2b5c4e8604e..0957556aa35b3625bb96cce5c29efaeb74f83917 100644 --- a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H @@ -32,6 +32,9 @@ Description of the sum of the square of the symmetrical and anti-symmetrical parts of the velocity gradient tensor. +SeeAlso + Foam::functionObjects::fvMeshFunctionObject + SourceFiles Lambda2.C @@ -40,17 +43,13 @@ SourceFiles #ifndef functionObjects_Lambda2_H #define functionObjects_Lambda2_H -#include "functionObject.H" +#include "fvMeshFunctionObject.H" #include "volFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// Forward declaration of classes -class objectRegistry; - namespace functionObjects { @@ -60,13 +59,10 @@ namespace functionObjects class Lambda2 : - public functionObject + public fvMeshFunctionObject { // Private data - //- Reference to the database - const objectRegistry& obr_; - //- Name of velocity field, default is "U" word UName_; diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C index b4560d54ee32fcf693574cab597a369b31a8208b..a21596e5dc145237203d0950b4db9cf2e95fdd99 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C @@ -59,27 +59,10 @@ Foam::functionObjects::Peclet::Peclet const dictionary& dict ) : - functionObject(name), - obr_ - ( - runTime.lookupObject<objectRegistry> - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ), - phiName_("phi"), - rhoName_("rho") + fvMeshFunctionObject(name, runTime, dict) { - if (!isA<fvMesh>(obr_)) - { - FatalErrorInFunction - << "objectRegistry is not an fvMesh" << exit(FatalError); - } - read(dict); - const fvMesh& mesh = refCast<const fvMesh>(obr_); - surfaceScalarField* PecletPtr ( new surfaceScalarField @@ -87,17 +70,17 @@ Foam::functionObjects::Peclet::Peclet IOobject ( type(), - mesh.time().timeName(), - mesh, + mesh_.time().timeName(), + mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + mesh_, dimensionedScalar("0", dimless, 0.0) ) ); - mesh.objectRegistry::store(PecletPtr); + mesh_.objectRegistry::store(PecletPtr); } @@ -123,39 +106,37 @@ bool Foam::functionObjects::Peclet::execute(const bool postProcess) typedef compressible::turbulenceModel cmpTurbModel; typedef incompressible::turbulenceModel icoTurbModel; - const fvMesh& mesh = refCast<const fvMesh>(obr_); - tmp<volScalarField> nuEff; - if (mesh.foundObject<cmpTurbModel>(turbulenceModel::propertiesName)) + if (mesh_.foundObject<cmpTurbModel>(turbulenceModel::propertiesName)) { const cmpTurbModel& model = - mesh.lookupObject<cmpTurbModel> + mesh_.lookupObject<cmpTurbModel> ( turbulenceModel::propertiesName ); const volScalarField& rho = - mesh.lookupObject<volScalarField>(rhoName_); + mesh_.lookupObject<volScalarField>(rhoName_); nuEff = model.muEff()/rho; } else if ( - mesh.foundObject<icoTurbModel>(turbulenceModel::propertiesName) + mesh_.foundObject<icoTurbModel>(turbulenceModel::propertiesName) ) { const icoTurbModel& model = - mesh.lookupObject<icoTurbModel> + mesh_.lookupObject<icoTurbModel> ( turbulenceModel::propertiesName ); nuEff = model.nuEff(); } - else if (mesh.foundObject<dictionary>("transportProperties")) + else if (mesh_.foundObject<dictionary>("transportProperties")) { const dictionary& model = - mesh.lookupObject<dictionary>("transportProperties"); + mesh_.lookupObject<dictionary>("transportProperties"); nuEff = tmp<volScalarField> @@ -165,12 +146,12 @@ bool Foam::functionObjects::Peclet::execute(const bool postProcess) IOobject ( "nuEff", - mesh.time().timeName(), - mesh, + mesh_.time().timeName(), + mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + mesh_, dimensionedScalar(model.lookup("nu")) ) ); @@ -183,19 +164,19 @@ bool Foam::functionObjects::Peclet::execute(const bool postProcess) } const surfaceScalarField& phi = - mesh.lookupObject<surfaceScalarField>(phiName_); + mesh_.lookupObject<surfaceScalarField>(phiName_); surfaceScalarField& Peclet = const_cast<surfaceScalarField&> ( - mesh.lookupObject<surfaceScalarField>(type()) + mesh_.lookupObject<surfaceScalarField>(type()) ); Peclet = mag(phi) /( - mesh.magSf() - *mesh.surfaceInterpolation::deltaCoeffs() + mesh_.magSf() + *mesh_.surfaceInterpolation::deltaCoeffs() *fvc::interpolate(nuEff) ); @@ -206,7 +187,7 @@ bool Foam::functionObjects::Peclet::execute(const bool postProcess) bool Foam::functionObjects::Peclet::write(const bool postProcess) { const surfaceScalarField& Peclet = - obr_.lookupObject<surfaceScalarField>(type()); + mesh_.lookupObject<surfaceScalarField>(type()); Info<< type() << " " << name() << " output:" << nl << " writing field " << Peclet.name() << nl diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H index ed829c196f238697eeefba259678971ff8f0a101..d2e872b86890770e1de693b25951b9b3616c1515 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H @@ -31,6 +31,9 @@ Description This function object calculates and outputs the Peclet number as a surfaceScalarField. +SeeAlso + Foam::functionObjects::fvMeshFunctionObject + SourceFiles Peclet.C @@ -39,17 +42,13 @@ SourceFiles #ifndef functionObjects_Peclet_H #define functionObjects_Peclet_H -#include "functionObject.H" +#include "fvMeshFunctionObject.H" #include "volFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// Forward declaration of classes -class objectRegistry; - namespace functionObjects { @@ -59,13 +58,10 @@ namespace functionObjects class Peclet : - public functionObject + public fvMeshFunctionObject { // Private data - //- Reference to the database - const objectRegistry& obr_; - //- Name of flux field, default is "phi" word phiName_; diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.C b/src/postProcessing/functionObjects/utilities/Q/Q.C index 407ce0ba6a08626c260f91822f09e6002f57a271..a07925d2b2ae16f5d1a41fa398fc1e05e7b3d454 100644 --- a/src/postProcessing/functionObjects/utilities/Q/Q.C +++ b/src/postProcessing/functionObjects/utilities/Q/Q.C @@ -55,26 +55,10 @@ Foam::functionObjects::Q::Q const dictionary& dict ) : - functionObject(name), - obr_ - ( - runTime.lookupObject<objectRegistry> - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ), - UName_("U") + fvMeshFunctionObject(name, runTime, dict) { - if (!isA<fvMesh>(obr_)) - { - FatalErrorInFunction - << "objectRegistry is not an fvMesh" << exit(FatalError); - } - read(dict); - const fvMesh& mesh = refCast<const fvMesh>(obr_); - volScalarField* QPtr ( new volScalarField @@ -82,17 +66,17 @@ Foam::functionObjects::Q::Q IOobject ( type(), - mesh.time().timeName(), - mesh, + mesh_.time().timeName(), + mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + mesh_, dimensionedScalar("0", dimless/sqr(dimTime), 0.0) ) ); - mesh.objectRegistry::store(QPtr); + mesh_.objectRegistry::store(QPtr); } @@ -114,17 +98,15 @@ bool Foam::functionObjects::Q::read(const dictionary& dict) bool Foam::functionObjects::Q::execute(const bool postProcess) { - const fvMesh& mesh = refCast<const fvMesh>(obr_); - const volVectorField& U = - mesh.lookupObject<volVectorField>(UName_); + mesh_.lookupObject<volVectorField>(UName_); const volTensorField gradU(fvc::grad(U)); volScalarField& Q = const_cast<volScalarField&> ( - mesh.lookupObject<volScalarField>(type()) + mesh_.lookupObject<volScalarField>(type()) ); Q = 0.5*(sqr(tr(gradU)) - tr(((gradU) & (gradU)))); @@ -136,7 +118,7 @@ bool Foam::functionObjects::Q::execute(const bool postProcess) bool Foam::functionObjects::Q::write(const bool postProcess) { const volScalarField& Q = - obr_.lookupObject<volScalarField>(type()); + mesh_.lookupObject<volScalarField>(type()); Info<< type() << " " << name() << " output:" << nl << " writing field " << Q.name() << nl diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.H b/src/postProcessing/functionObjects/utilities/Q/Q.H index 52ec9aaadefadafa5068fd3bd63fa87d956e906c..1b64e08d0d45eb77fe877d3c093b0c40b87da52c 100644 --- a/src/postProcessing/functionObjects/utilities/Q/Q.H +++ b/src/postProcessing/functionObjects/utilities/Q/Q.H @@ -35,6 +35,9 @@ Description Q = 0.5(sqr(tr(\nabla U)) - tr(((\nabla U) \cdot (\nabla U)))) \f] +SeeAlso + Foam::functionObjects::fvMeshFunctionObject + SourceFiles Q.C @@ -43,17 +46,13 @@ SourceFiles #ifndef functionObjects_Q_H #define functionObjects_Q_H -#include "functionObject.H" +#include "fvMeshFunctionObject.H" #include "volFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// Forward declaration of classes -class objectRegistry; - namespace functionObjects { @@ -63,13 +62,10 @@ namespace functionObjects class Q : - public functionObject + public fvMeshFunctionObject { // Private data - //- Reference to the database - const objectRegistry& obr_; - //- Name of velocity field, default is "U" word UName_; diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H index 33e1fd1c85bf67c586bb98b624b1727db138ebb2..f0d7dc61b86cd5835a232192a9622499d825dfe8 100644 --- a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H @@ -33,8 +33,7 @@ Description value is calculated via the maximum blending factor for any cell face. SeeAlso - Foam::fvMeshFunctionObject - Foam::functionObject + Foam::functionObjects::fvMeshFunctionObject SourceFiles blendingFactor.C diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorTemplates.C b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorTemplates.C index d2df84d3cbed5e14142e120dcbdc4511429e2a3d..d9262f7ffaa097043099fcfd1be4a79d251be0fc 100644 --- a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorTemplates.C +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorTemplates.C @@ -38,22 +38,20 @@ Foam::volScalarField& Foam::functionObjects::blendingFactor::factor { const word fieldName = "blendingFactor:" + field.name(); - if (!obr_.foundObject<volScalarField>(fieldName)) + if (!mesh_.foundObject<volScalarField>(fieldName)) { - const fvMesh& mesh = refCast<const fvMesh>(obr_); - volScalarField* factorPtr = new volScalarField ( IOobject ( fieldName, - mesh.time().timeName(), - mesh, + mesh_.time().timeName(), + mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + mesh_, dimensionedScalar("0", dimless, 0.0), zeroGradientFvPatchScalarField::typeName ); @@ -64,7 +62,7 @@ Foam::volScalarField& Foam::functionObjects::blendingFactor::factor return const_cast<volScalarField&> ( - obr_.lookupObject<volScalarField>(fieldName) + mesh_.lookupObject<volScalarField>(fieldName) ); } @@ -74,23 +72,21 @@ void Foam::functionObjects::blendingFactor::calc() { typedef GeometricField<Type, fvPatchField, volMesh> fieldType; - if (!obr_.foundObject<fieldType>(fieldName_)) + if (!mesh_.foundObject<fieldType>(fieldName_)) { return; } - const fvMesh& mesh = refCast<const fvMesh>(obr_); - - const fieldType& field = mesh.lookupObject<fieldType>(fieldName_); + const fieldType& field = mesh_.lookupObject<fieldType>(fieldName_); const word divScheme("div(" + phiName_ + ',' + fieldName_ + ')'); - ITstream& its = mesh.divScheme(divScheme); + ITstream& its = mesh_.divScheme(divScheme); const surfaceScalarField& phi = - mesh.lookupObject<surfaceScalarField>(phiName_); + mesh_.lookupObject<surfaceScalarField>(phiName_); tmp<fv::convectionScheme<Type>> cs = - fv::convectionScheme<Type>::New(mesh, phi, its); + fv::convectionScheme<Type>::New(mesh_, phi, its); const fv::gaussConvectionScheme<Type>& gcs = refCast<const fv::gaussConvectionScheme<Type>>(cs()); diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C index c494a5b2ba2256480fbb5663e92469877424a2ab..2a0fe99e705b66af053da4296113096b43be02a1 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C @@ -157,25 +157,9 @@ Foam::functionObjects::scalarTransport::scalarTransport const dictionary& dict ) : - functionObject(name), - mesh_ - ( - refCast<const fvMesh> - ( - runTime.lookupObject<objectRegistry> - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ) - ), - phiName_(dict.lookupOrDefault<word>("phiName", "phi")), - UName_(dict.lookupOrDefault<word>("UName", "U")), - rhoName_(dict.lookupOrDefault<word>("rhoName", "rho")), + fvMeshFunctionObject(name, runTime, dict), DT_(0.0), - userDT_(false), - resetOnStartUp_(false), nCorr_(0), - autoSchemes_(false), fvOptions_(mesh_), T_ ( diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H index 2508ce72116a423123ee578f27560af20d20d698..9f3ea589b955e07d5bb1e8e672cd192f6c6c6f6e 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H @@ -39,6 +39,9 @@ Description - the diffusivity can be set manually using the DT entry, or retrieved from the turbulence model (if applicable) +SeeAlso + Foam::functionObjects::fvMeshFunctionObject + SourceFiles scalarTransport.C @@ -47,7 +50,7 @@ SourceFiles #ifndef functionObjects_scalarTransport_H #define functionObjects_scalarTransport_H -#include "functionObject.H" +#include "fvMeshFunctionObject.H" #include "volFields.H" #include "surfaceFieldsFwd.H" #include "fvOptionList.H" @@ -56,10 +59,6 @@ SourceFiles namespace Foam { - -// Forward declaration of classes -class objectRegistry; - namespace functionObjects { @@ -69,13 +68,10 @@ namespace functionObjects class scalarTransport : - public functionObject + public fvMeshFunctionObject { // Private data - //- Reference to the mesh database - const fvMesh& mesh_; - //- Name of flux field (optional) word phiName_; diff --git a/src/postProcessing/functionObjects/utilities/vorticity/vorticity.C b/src/postProcessing/functionObjects/utilities/vorticity/vorticity.C index ac9828f8e1532a2b2360c9cfa711845f89149d57..a9f8f1faa79bbe59943cf7f7ef545c3739d27ddc 100644 --- a/src/postProcessing/functionObjects/utilities/vorticity/vorticity.C +++ b/src/postProcessing/functionObjects/utilities/vorticity/vorticity.C @@ -55,27 +55,11 @@ Foam::functionObjects::vorticity::vorticity const dictionary& dict ) : - functionObject(name), - obr_ - ( - runTime.lookupObject<objectRegistry> - ( - dict.lookupOrDefault("region", polyMesh::defaultRegion) - ) - ), - UName_("U"), + fvMeshFunctionObject(name, runTime, dict), outputName_(typeName) { - if (!isA<fvMesh>(obr_)) - { - FatalErrorInFunction - << "objectRegistry is not an fvMesh" << exit(FatalError); - } - read(dict); - const fvMesh& mesh = refCast<const fvMesh>(obr_); - volVectorField* vorticityPtr ( new volVectorField @@ -83,17 +67,17 @@ Foam::functionObjects::vorticity::vorticity IOobject ( outputName_, - mesh.time().timeName(), - mesh, + mesh_.time().timeName(), + mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + mesh_, dimensionedVector("0", dimless/dimTime, Zero) ) ); - mesh.objectRegistry::store(vorticityPtr); + mesh_.objectRegistry::store(vorticityPtr); } @@ -119,11 +103,11 @@ bool Foam::functionObjects::vorticity::read(const dictionary& dict) bool Foam::functionObjects::vorticity::execute(const bool postProcess) { - const volVectorField& U = obr_.lookupObject<volVectorField>(UName_); + const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_); volVectorField& vorticity = const_cast<volVectorField&> ( - obr_.lookupObject<volVectorField>(outputName_) + mesh_.lookupObject<volVectorField>(outputName_) ); vorticity = fvc::curl(U); @@ -135,7 +119,7 @@ bool Foam::functionObjects::vorticity::execute(const bool postProcess) bool Foam::functionObjects::vorticity::write(const bool postProcess) { const volVectorField& vorticity = - obr_.lookupObject<volVectorField>(outputName_); + mesh_.lookupObject<volVectorField>(outputName_); Info<< type() << " " << name() << " output:" << nl << " writing field " << vorticity.name() << nl diff --git a/src/postProcessing/functionObjects/utilities/vorticity/vorticity.H b/src/postProcessing/functionObjects/utilities/vorticity/vorticity.H index 942926a9483f8eb158b1b032ca0c0c163b7a9eb6..6d719e3ed90671a694fae144ef15abe083acbc3d 100644 --- a/src/postProcessing/functionObjects/utilities/vorticity/vorticity.H +++ b/src/postProcessing/functionObjects/utilities/vorticity/vorticity.H @@ -30,6 +30,9 @@ Group Description This function object calculates the vorticity, the curl of the velocity. +SeeAlso + Foam::functionObjects::fvMeshFunctionObject + SourceFiles vorticity.C @@ -38,17 +41,13 @@ SourceFiles #ifndef functionObjects_vorticity_H #define functionObjects_vorticity_H -#include "functionObject.H" +#include "fvMeshFunctionObject.H" #include "volFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// Forward declaration of classes -class objectRegistry; - namespace functionObjects { @@ -58,13 +57,10 @@ namespace functionObjects class vorticity : - public functionObject + public fvMeshFunctionObject { // Private data - //- Reference to the database - const objectRegistry& obr_; - //- Name of velocity field, default is "U" word UName_; diff --git a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C index 83b88380f766284b68205a3e78c30d15baf2f9de..40a8f5f7be8debd964542aac725a279a047988fd 100644 --- a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C +++ b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C @@ -51,12 +51,11 @@ template<class ThermoType> Foam::moleFractions<ThermoType>::moleFractions ( const word& name, - const Time& t, + const Time& runTime, const dictionary& dict ) : - writeFiles(name, t, dict, typeName), - mesh_(refCast<const fvMesh>(obr_)) + fvMeshFunctionObject(name, runTime, dict) { if (mesh_.foundObject<ThermoType>(basicThermo::dictName)) { diff --git a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.H b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.H index c35771832f7f7b5cdbdf4151b815e34c920df291..0ad3845a26b26c4061121b65d43dca0b1cd13d04 100644 --- a/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.H +++ b/src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.H @@ -49,7 +49,7 @@ Description depending on the thermodynamics package used in the solver. SeeAlso - Foam::functionObject + Foam::functionObjects::fvMeshFunctionObject SourceFiles moleFractions.C @@ -59,8 +59,8 @@ SourceFiles #ifndef moleFractions_H #define moleFractions_H -#include "writeFiles.H" -#include "volFields.H" +#include "fvMeshFunctionObject.H" +#include "volFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -74,13 +74,10 @@ namespace Foam template<class ThermoType> class moleFractions : - public functionObjects::writeFiles + public functionObjects::fvMeshFunctionObject { // Private data - //- Reference to the mesh - const fvMesh& mesh_; - //- Species mole fractions PtrList<volScalarField> X_;