Merge remote-tracking branch 'remotes/origin/feature/postfixedSubRegistry' into HrvojeJasak

This commit is contained in:
Hrvoje Jasak 2012-01-29 12:27:23 +00:00
commit fa6c5b8888
227 changed files with 2049 additions and 631 deletions

View file

@ -163,13 +163,13 @@ void smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
}
const fvPatchScalarField& pmu =
patch().lookupPatchField<volScalarField, scalar>("mu");
lookupPatchField<volScalarField, scalar>("mu");
const fvPatchScalarField& prho =
patch().lookupPatchField<volScalarField, scalar>("rho");
lookupPatchField<volScalarField, scalar>("rho");
const fvPatchField<scalar>& ppsi =
patch().lookupPatchField<volScalarField, scalar>("psi");
lookupPatchField<volScalarField, scalar>("psi");
const fvPatchVectorField& pU =
patch().lookupPatchField<volVectorField, vector>("U");
lookupPatchField<volVectorField, vector>("U");
// Prandtl number reading consistent with rhoCentralFoam
const dictionary& thermophysicalProperties =

View file

@ -141,11 +141,11 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
}
const fvPatchScalarField& pmu =
patch().lookupPatchField<volScalarField, scalar>("mu");
lookupPatchField<volScalarField, scalar>("mu");
const fvPatchScalarField& prho =
patch().lookupPatchField<volScalarField, scalar>("rho");
lookupPatchField<volScalarField, scalar>("rho");
const fvPatchField<scalar>& ppsi =
patch().lookupPatchField<volScalarField, scalar>("psi");
lookupPatchField<volScalarField, scalar>("psi");
Field<scalar> C1 = sqrt(ppsi*mathematicalConstant::pi/2.0)
*(2.0 - accommodationCoeff_)/accommodationCoeff_;
@ -170,7 +170,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
if(curvature_)
{
const fvPatchTensorField& ptauMC =
patch().lookupPatchField<volTensorField, tensor>("tauMC");
lookupPatchField<volTensorField, tensor>("tauMC");
vectorField n = patch().nf();
refValue() -= C1/prho*transform(I - n*n, (n & ptauMC));

View file

@ -100,10 +100,10 @@ void fixedRhoFvPatchScalarField::updateCoeffs()
}
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>("psi");
lookupPatchField<volScalarField, scalar>("psi");
const fvPatchField<scalar>& pp =
patch().lookupPatchField<volScalarField, scalar>("p");
lookupPatchField<volScalarField, scalar>("p");
operator==(psip*pp);

View file

@ -129,13 +129,13 @@ void inviscidWallPFvPatchScalarField::updateCoeffs()
}
const fvPatchField<vector>& rhoUp =
patch().lookupPatchField<volVectorField, vector>("rhoU");
lookupPatchField<volVectorField, vector>("rhoU");
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>("phi");
lookupPatchField<surfaceScalarField, scalar>("phi");
const fvsPatchField<scalar>& rAp =
patch().lookupPatchField<surfaceScalarField, scalar>("rrhoUAf");
lookupPatchField<surfaceScalarField, scalar>("rrhoUAf");
gradient() = (fluxFraction_*phip - (patch().Sf() & rhoUp))/
(rAp*patch().magSf());

View file

@ -98,10 +98,10 @@ void fixedRhoFvPatchScalarField::updateCoeffs()
}
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>("psi");
lookupPatchField<volScalarField, scalar>("psi");
const fvPatchField<scalar>& pp =
patch().lookupPatchField<volScalarField, scalar>("p");
lookupPatchField<volScalarField, scalar>("p");
operator==(psip*pp);

View file

@ -111,10 +111,10 @@ void gradientRhoFvPatchScalarField::updateCoeffs()
}
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>("psi");
lookupPatchField<volScalarField, scalar>("psi");
const fvPatchField<scalar>& pp =
patch().lookupPatchField<volScalarField, scalar>("p");
lookupPatchField<volScalarField, scalar>("p");
gradient() = psip*pp.snGrad() + psip.snGrad()*pp;

View file

@ -105,13 +105,13 @@ void fixedRhoEFvPatchScalarField::updateCoeffs()
dimensionedScalar Cv(thermodynamicProperties.lookup("Cv"));
const fvPatchScalarField& rhop =
patch().lookupPatchField<volScalarField, scalar>("rho");
lookupPatchField<volScalarField, scalar>("rho");
const fvPatchVectorField& rhoUp =
patch().lookupPatchField<volVectorField, vector>("rhoU");
lookupPatchField<volVectorField, vector>("rhoU");
const fvPatchScalarField& Tp =
patch().lookupPatchField<volScalarField, scalar>("T");
lookupPatchField<volScalarField, scalar>("T");
operator==(rhop*(Cv.value()*Tp + 0.5*magSqr(rhoUp/rhop)));

View file

@ -137,11 +137,11 @@ void mixedRhoEFvPatchScalarField::updateCoeffs()
}
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>("rho");
lookupPatchField<volScalarField, scalar>("rho");
const fvPatchField<vector>& rhoUp =
patch().lookupPatchField<volVectorField, vector>("rhoU");
lookupPatchField<volVectorField, vector>("rhoU");
// fvPatchField<scalar>& Tp =
// patch().lookupPatchField<volScalarField, scalar>("T");
// lookupPatchField<volScalarField, scalar>("T");
const volScalarField& T = db().lookupObject<volScalarField>("T");
const label patchi = patch().index();

View file

@ -98,10 +98,10 @@ void fixedRhoUFvPatchVectorField::updateCoeffs()
}
const fvPatchScalarField& rhop =
patch().lookupPatchField<volScalarField, scalar>("rho");
lookupPatchField<volScalarField, scalar>("rho");
const fvPatchVectorField& Up =
patch().lookupPatchField<volVectorField, vector>("U");
lookupPatchField<volVectorField, vector>("U");
operator==(rhop*Up);

View file

@ -46,6 +46,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createFluidMesh.H"
# include "attachPatches.H"
# include "createSolidMesh.H"
# include "createFields.H"
# include "createSolidFields.H"

View file

@ -64,13 +64,10 @@
# include "createPhi.H"
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
# include "attachPatches.H"
Info<< "Reading field DT\n" << endl;
volScalarField DT
(

View file

@ -1,6 +1,8 @@
Info<< "Create mesh for time = "
<< runTime.timeName() << nl << endl;
Info << "f1" << endl;
fvMesh mesh
(
IOobject
@ -11,3 +13,6 @@
IOobject::MUST_READ
)
);
Info << "f2" << endl;

View file

@ -1,3 +1,5 @@
Info << "s1" << endl;
fvMesh solidMesh
(
IOobject
@ -8,3 +10,6 @@
IOobject::MUST_READ
)
);
Info << "s2" << endl;

View file

@ -132,12 +132,12 @@ Foam::solidWallHeatFluxTemperatureFvPatchScalarField::K() const
if (mesh.objectRegistry::foundObject<volScalarField>(KName_))
{
return patch().lookupPatchField<volScalarField, scalar>(KName_);
return lookupPatchField<volScalarField, scalar>(KName_);
}
else if (mesh.objectRegistry::foundObject<volSymmTensorField>(KName_))
{
const symmTensorField& KWall =
patch().lookupPatchField<volSymmTensorField, scalar>(KName_);
lookupPatchField<volSymmTensorField, scalar>(KName_);
vectorField n = patch().nf();

View file

@ -133,7 +133,7 @@ solidWallMixedTemperatureCoupledFvPatchScalarField
const Foam::fvPatchScalarField&
Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::K() const
{
return this->patch().lookupPatchField<volScalarField, scalar>(KName_);
return this->lookupPatchField<volScalarField, scalar>(KName_);
}

View file

@ -132,7 +132,7 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
return;
}
const scalarField& Kw = patch().lookupPatchField<volScalarField, scalar>
const scalarField& Kw = lookupPatchField<volScalarField, scalar>
(
KName_
);

View file

@ -180,15 +180,15 @@ void cohesiveLawFvPatchVectorField::updateCoeffs()
// Looking up rheology
const fvPatchField<scalar>& mu =
patch().lookupPatchField<volScalarField, scalar>("mu");
lookupPatchField<volScalarField, scalar>("mu");
const fvPatchField<scalar>& lambda =
patch().lookupPatchField<volScalarField, scalar>("lambda");
lookupPatchField<volScalarField, scalar>("lambda");
vectorField n = patch().nf();
const fvPatchField<tensor>& gradU =
patch().lookupPatchField<volTensorField, tensor>("grad(U)");
lookupPatchField<volTensorField, tensor>("grad(U)");
// Patch displacement
const vectorField& U = *this;

View file

@ -213,7 +213,7 @@ void cohesiveZoneFvPatchVectorField::updateCoeffs()
rheology.lambda()().boundaryField()[patch().index()];
const fvPatchField<tensor>& gradU =
patch().lookupPatchField<volTensorField, tensor>
lookupPatchField<volTensorField, tensor>
(
"grad(" +UName_ + ")"
);

View file

@ -195,7 +195,7 @@ void nusseltFvPatchScalarField::updateCoeffs()
// Lookup temperature diffusivity of the patch
const fvPatchField<scalar>& DT =
this->patch().lookupPatchField<volScalarField, scalar>(DTName_);
this->lookupPatchField<volScalarField, scalar>(DTName_);
// Calculate flux
scalarField tempFlux = alpha_*(Tinternal - Tinf_);

View file

@ -169,7 +169,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
vectorField n = patch().nf();
const fvPatchField<tensor>& gradU =
patch().lookupPatchField<volTensorField, tensor>("grad(" +UName_ + ")");
lookupPatchField<volTensorField, tensor>("grad(" +UName_ + ")");
gradient() =
(

View file

@ -180,7 +180,7 @@ void tractionDisplacementThermoFvPatchVectorField::updateCoeffs()
vectorField n = patch().nf();
const fvPatchField<tensor>& gradU =
patch().lookupPatchField<volTensorField, tensor>("grad(" +UName_ + ")");
lookupPatchField<volTensorField, tensor>("grad(" +UName_ + ")");
// Thermal component
@ -189,7 +189,7 @@ void tractionDisplacementThermoFvPatchVectorField::updateCoeffs()
this->db().objectRegistry::lookupObject<thermalModel>(thermoName_);
const fvPatchField<scalar>& T =
patch().lookupPatchField<volScalarField, scalar>(TName_);
lookupPatchField<volScalarField, scalar>(TName_);
const scalarField rhoThreeKalpha =
rheology.rho()().boundaryField()[patch().index()]*

View file

@ -169,7 +169,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
vectorField n = patch().nf();
const fvPatchField<tensor>& gradU =
patch().lookupPatchField<volTensorField, tensor>("grad(U)");
lookupPatchField<volTensorField, tensor>("grad(U)");
gradient() =
(

View file

@ -172,7 +172,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
vectorField n = patch().nf();
const fvPatchField<symmTensor>& sigmaD =
patch().lookupPatchField<volSymmTensorField, symmTensor>("sigmaD");
lookupPatchField<volSymmTensorField, symmTensor>("sigmaD");
gradient() =
(
@ -188,7 +188,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
dimensionedScalar threeKalpha = threeK*alpha;
const fvPatchField<scalar>& T =
patch().lookupPatchField<volScalarField, scalar>("T");
lookupPatchField<volScalarField, scalar>("T");
gradient() += n*threeKalpha.value()*T/twoMuLambda;
}

View file

@ -169,10 +169,10 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs()
vectorField n = patch().nf();
const fvPatchField<symmTensor>& sigmaD =
patch().lookupPatchField<volSymmTensorField, symmTensor>("sigmaD");
lookupPatchField<volSymmTensorField, symmTensor>("sigmaD");
const fvPatchField<tensor>& sigmaExp =
patch().lookupPatchField<volTensorField, tensor>("sigmaExp");
lookupPatchField<volTensorField, tensor>("sigmaExp");
gradient() =
(

View file

@ -172,7 +172,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
vectorField n = patch().nf();
const fvPatchField<tensor>& gradU =
patch().lookupPatchField<volTensorField, tensor>("grad(U)");
lookupPatchField<volTensorField, tensor>("grad(U)");
gradient() =
(
@ -190,7 +190,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
dimensionedScalar threeKalpha = threeK*alpha;
const fvPatchField<scalar>& T =
patch().lookupPatchField<volScalarField, scalar>("T");
lookupPatchField<volScalarField, scalar>("T");
gradient() += n*threeKalpha.value()*T/(2.0*mu + lambda).value();
}

View file

@ -629,6 +629,7 @@ DebugSwitches
nutWallFunction 0;
obj 0;
objectRegistry 0;
postfixedSubRegistry 0;
octree 0;
octreeDataEdges 0;
octreeDataFace 0;

View file

@ -126,8 +126,8 @@ if ( ! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64
if ( ! $?WM_PRECISION_OPTION ) setenv WM_PRECISION_OPTION DP
# WM_COMPILE_OPTION = Opt | Debug | Prof
#if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt
setenv WM_COMPILE_OPTION Opt
if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt
#setenv WM_COMPILE_OPTION Opt
#setenv WM_COMPILE_OPTION Debug
# WM_MPLIB = | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI

View file

@ -169,6 +169,7 @@ $(regIOobject)/regIOobjectWrite.C
db/IOobjectList/IOobjectList.C
db/objectRegistry/objectRegistry.C
db/postfixedSubRegistry/postfixedSubRegistry.C
db/CallbackRegistry/CallbackRegistryName.C
db/dlLibraryTable/dlLibraryTable.C
@ -176,7 +177,6 @@ db/functionObjects/functionObject/functionObject.C
db/functionObjects/functionObjectList/functionObjectList.C
db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C
Time = db/Time
$(Time)/TimePaths.C
$(Time)/TimeState.C

View file

@ -113,6 +113,34 @@ bool Foam::IOobject::IOobject::fileNameComponents
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::IOobject::IOobject
(
const word& name,
const Time& time,
readOption ro,
writeOption wo
)
:
name_(name),
headerClassName_(typeName),
note_(),
instance_(""),
local_(),
db_(time),
rOpt_(ro),
wOpt_(wo),
registerObject_(false),
objState_(GOOD)
{
if (objectRegistry::debug)
{
Info<< "Constructing IOobject called " << name_
<< " of type " << headerClassName_
<< endl;
}
}
Foam::IOobject::IOobject
(
const word& name,
@ -123,7 +151,7 @@ Foam::IOobject::IOobject
bool registerObject
)
:
name_(name),
name_(registry.mangleFileName(name)),
headerClassName_(typeName),
note_(),
instance_(instance),
@ -154,7 +182,7 @@ Foam::IOobject::IOobject
bool registerObject
)
:
name_(name),
name_(registry.mangleFileName(name)),
headerClassName_(typeName),
note_(),
instance_(instance),

View file

@ -179,6 +179,15 @@ public:
// Constructors
//- Construct from name, instance, registry, io options
IOobject
(
const word& name,
const Time& registry,
readOption r = NO_READ,
writeOption w = NO_WRITE
);
//- Construct from name, instance, registry, io options
IOobject
(

View file

@ -45,11 +45,9 @@ Foam::objectRegistry::objectRegistry
IOobject
(
string::validate<word>(t.caseName()),
"",
t,
IOobject::NO_READ,
IOobject::AUTO_WRITE,
false
IOobject::AUTO_WRITE
),
true // to flag that this is the top-level regIOobject
),
@ -78,6 +76,24 @@ Foam::objectRegistry::objectRegistry
}
Foam::objectRegistry::objectRegistry
(
const IOobject& io,
const fileName& dbDir,
const label nIoObjects
)
:
regIOobject(io),
HashTable<regIOobject*>(nIoObjects),
time_(io.time()),
parent_(io.db()),
dbDir_(dbDir),
event_(1)
{
writeOpt() = IOobject::AUTO_WRITE;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::objectRegistry::~objectRegistry()
@ -135,6 +151,12 @@ Foam::wordList Foam::objectRegistry::names(const word& ClassName) const
}
Foam::fileName Foam::objectRegistry::mangleFileName(const fileName& fName) const
{
return fName;
}
const Foam::objectRegistry& Foam::objectRegistry::subRegistry
(
const word& name

View file

@ -105,6 +105,14 @@ public:
const label nIoObjects = 128
);
//- Construct a sub-registry given an IObject to describe the registry
// and an initial estimate for the number of entries
explicit objectRegistry
(
const IOobject& io,
const fileName& dbDir,
const label nIoObjects = 128
);
// Destructor
@ -133,6 +141,14 @@ public:
return dbDir_;
}
fileName& dbDir()
{
return dbDir_;
}
//- Return mangled fileName
virtual fileName mangleFileName (const fileName&) const;
//- Return the list of names of the IOobjects
wordList names() const;
@ -168,10 +184,10 @@ public:
virtual void rename(const word& newName);
//- Add an regIOobject to registry
bool checkIn(regIOobject&) const;
virtual bool checkIn(regIOobject&) const;
//- Remove an regIOobject from registry
bool checkOut(regIOobject&) const;
virtual bool checkOut(regIOobject&) const;
// Reading

View file

@ -0,0 +1,144 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "postfixedSubRegistry.H"
#include "Pstream.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(postfixedSubRegistry, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::postfixedSubRegistry::postfixedSubRegistry
(
const IOobject& io,
const label nIoObjects
)
:
objectRegistry(io, io.db().dbDir(), nIoObjects)
{
writeOpt() = IOobject::NO_WRITE;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::postfixedSubRegistry::~postfixedSubRegistry()
{
objectRegistry::clear();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::fileName Foam::postfixedSubRegistry::mangleFileName(const fileName& fName) const
{
return fileName(fName+name());
}
bool Foam::postfixedSubRegistry::checkIn(regIOobject& io) const
{
if (postfixedSubRegistry::debug)
{
Pout<< "postfixedSubRegistry::checkIn(regIOobject&) : "
<< name() << " : checking in " << io.name()
<< endl;
}
word demangledName = io.name();
demangledName = demangledName(io.name().size() - name().size());
// Check into Mesh-Registry under full name
const_cast<objectRegistry&>(parent()).insert(io.name(), &io);
// Check into Mesh-Registry under short name
return const_cast<postfixedSubRegistry&>(*this).insert(demangledName, &io);;
}
bool Foam::postfixedSubRegistry::checkOut(regIOobject& io) const
{
word demangledName = io.name();
demangledName = demangledName(io.name().size() - name().size());
iterator iter = const_cast<postfixedSubRegistry&>(*this).find(demangledName);
iterator iterPar = const_cast<objectRegistry&>(parent()).find(io.name());
if (iter != end() && iterPar != end())
{
if (postfixedSubRegistry::debug)
{
Pout<< "postfixedSubRegistry::checkOut(regIOobject&) : "
<< name() << " : checking out " << io.name()
<< endl;
}
if (iter() != &io || iterPar() != &io)
{
if (postfixedSubRegistry::debug)
{
WarningIn("postfixedSubRegistry::checkOut(regIOobject&)")
<< name() << " : attempt to checkOut copy of " << io.name()
<< endl;
}
return false;
}
else
{
bool hasErased =
const_cast<postfixedSubRegistry&>(*this).erase(iter)
&& const_cast<objectRegistry&>(parent()).erase(iterPar);
if (io.ownedByRegistry())
{
delete iter();
}
return hasErased;
}
}
else
{
if (postfixedSubRegistry::debug)
{
Pout<< "postfixedSubRegistry::checkOut(regIOobject&) : "
<< name() << " : could not find " << io.name()
<< " in registry " << name()
<< endl;
}
return false;
}
}
// ************************************************************************* //

View file

@ -0,0 +1,136 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::postfixedSubRegistry
Description
Registry of regIOobjects
SourceFiles
postfixedSubRegistry.C
\*---------------------------------------------------------------------------*/
#ifndef postfixedSubRegistry_H
#define postfixedSubRegistry_H
#include "objectRegistry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class postfixedSubRegistry Declaration
\*---------------------------------------------------------------------------*/
class postfixedSubRegistry
:
public objectRegistry
{
// Private Member Functions
//- Disallow Copy constructor
postfixedSubRegistry(const postfixedSubRegistry&);
//- Disallow default bitwise copy construct and assignment
void operator=(const postfixedSubRegistry&);
public:
//- Declare type name for this IOobject
TypeName("postfixedSubRegistry");
// Constructors
//- Construct a sub-registry given an IObject to describe the registry
// and an initial estimate for the number of entries
explicit postfixedSubRegistry
(
const IOobject& io,
const label nIoObjects = 128
);
// Destructor
virtual ~postfixedSubRegistry();
// Member functions
// Access
//- Return mangled fileName
virtual fileName mangleFileName (const fileName&) const;
// Edit
//- Add an regIOobject to registry
virtual bool checkIn(regIOobject&) const;
//- Remove an regIOobject from registry
virtual bool checkOut(regIOobject&) const;
// Reading
//- Return true if any of the object's files have been modified
virtual bool modified() const
{
return false;
}
//- Read object if modified
virtual bool readIfModified()
{
return true;
}
// Writing
virtual bool writeObject
(
IOstream::streamFormat fmt,
IOstream::versionNumber ver,
IOstream::compressionType cmp
) const
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -107,7 +107,8 @@ template
const objectRegistry&
PointPatchField<PatchField, Mesh, PointPatch, MatrixType, Type>::db() const
{
return patch_.boundaryMesh().mesh()();
//HR 12.3.10: Lookup fields from the field DB rather than the mesh
return internalField_.db();
}

View file

@ -205,7 +205,7 @@ void Foam::engineMassFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
// mass flow-rate
operator==(n*avgU/rhop);

View file

@ -234,7 +234,7 @@ void engineTimeVaryingTotalPressureFvPatchScalarField::updateCoeffs(const vector
);
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
lookupPatchField<surfaceScalarField, scalar>(phiName_);
if (psiName_ == "none" && rhoName_ == "none")
{
@ -243,7 +243,7 @@ void engineTimeVaryingTotalPressureFvPatchScalarField::updateCoeffs(const vector
else if (rhoName_ == "none")
{
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>(psiName_);
lookupPatchField<volScalarField, scalar>(psiName_);
if (gamma_ > 1.0)
{
@ -267,7 +267,7 @@ void engineTimeVaryingTotalPressureFvPatchScalarField::updateCoeffs(const vector
else if (psiName_ == "none")
{
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(p0_ - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
}
@ -293,7 +293,7 @@ void engineTimeVaryingTotalPressureFvPatchScalarField::updateCoeffs(const vector
void engineTimeVaryingTotalPressureFvPatchScalarField::updateCoeffs()
{
updateCoeffs(patch().lookupPatchField<volVectorField, vector>(UName_));
updateCoeffs(lookupPatchField<volVectorField, vector>(UName_));
}

View file

@ -131,7 +131,7 @@ void inletOutletFaPatchField<Type>::updateCoeffs()
return;
}
const Field<scalar>& phip = this->patch().lookupPatchField
const Field<scalar>& phip = this->lookupPatchField
(
phiName_,
reinterpret_cast<const edgeScalarField*>(NULL),

View file

@ -140,7 +140,24 @@ faPatchField<Type>::faPatchField
template<class Type>
const objectRegistry& faPatchField<Type>::db() const
{
return patch_.boundaryMesh().mesh();
//HR 12.3.10: Lookup fields from the field DB rather than the mesh
return internalField_.db();
}
template<class Type>
template<class GeometricField, class Type2>
const typename GeometricField::PatchFieldType& Foam::faPatchField<Type>::lookupPatchField
(
const word& name,
const GeometricField*,
const Type2*
) const
{
return patch_.patchField<GeometricField, Type2>
(
internalField_.db().objectRegistry::lookupObject<GeometricField>(name)
);
}

View file

@ -255,6 +255,19 @@ public:
//- Return local objectRegistry
const objectRegistry& db() const;
//- Lookup and return the patchField of the named field from the
// field's objectRegistry.
// N.B. The dummy pointer arguments are used if this function is
// instantiated within a templated function to avoid a bug in gcc.
// See inletOutletFvPatchField.C and outletInletFvPatchField.C
template<class GeometricField, class Type2>
const typename GeometricField::PatchFieldType& lookupPatchField
(
const word& name,
const GeometricField* = NULL,
const Type2* = NULL
) const;
//- Return patch
const faPatch& patch() const
{

View file

@ -134,7 +134,24 @@ faePatchField<Type>::faePatchField
template<class Type>
const objectRegistry& faePatchField<Type>::db() const
{
return patch_.boundaryMesh().mesh();
//HR 12.3.10: Lookup fields from the field DB rather than the mesh
return internalField_.db();
}
template<class Type>
template<class GeometricField, class Type2>
const typename GeometricField::PatchFieldType& Foam::faePatchField<Type>::lookupPatchField
(
const word& name,
const GeometricField*,
const Type2*
) const
{
return patch_.patchField<GeometricField, Type2>
(
internalField_.db().objectRegistry::lookupObject<GeometricField>(name)
);
}

View file

@ -255,6 +255,19 @@ public:
//- Return local objectRegistry
const objectRegistry& db() const;
//- Lookup and return the patchField of the named field from the
// field's objectRegistry.
// N.B. The dummy pointer arguments are used if this function is
// instantiated within a templated function to avoid a bug in gcc.
// See inletOutletFvPatchField.C and outletInletFvPatchField.C
template<class GeometricField, class Type2>
const typename GeometricField::PatchFieldType& lookupPatchField
(
const word& name,
const GeometricField* = NULL,
const Type2* = NULL
) const;
//- Return patch
const faPatch& patch() const
{

View file

@ -175,7 +175,7 @@ tmp<scalarField> advectiveFvPatchField<Type>::advectionSpeed() const
const surfaceScalarField& phi =
this->db().objectRegistry::lookupObject<surfaceScalarField>(phiName_);
fvsPatchField<scalar> phip = this->patch().lookupPatchField
fvsPatchField<scalar> phip = this->lookupPatchField
(
phiName_,
reinterpret_cast<const surfaceScalarField*>(0),
@ -184,7 +184,7 @@ tmp<scalarField> advectiveFvPatchField<Type>::advectionSpeed() const
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchScalarField& rhop = this->patch().lookupPatchField
const fvPatchScalarField& rhop = this->lookupPatchField
(
rhoName_,
reinterpret_cast<const volScalarField*>(0),
@ -357,7 +357,7 @@ void advectiveFvPatchField<Type>::updateCoeffs()
}
// Get access to flux field
fvsPatchField<scalar> phip = this->patch().lookupPatchField
fvsPatchField<scalar> phip = this->lookupPatchField
(
phiName_,
reinterpret_cast<const surfaceScalarField*>(NULL),

View file

@ -135,7 +135,7 @@ void buoyantPressureFvPatchScalarField::updateCoeffs()
db().lookupObject<uniformDimensionedVectorField>("g");
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
// If the variable name is "p_rgh" or "pd" assume it is p - rho*g.h
// and set the gradient appropriately.

View file

@ -69,7 +69,7 @@ void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs()
Un /=
scalarField::subField
(
patch().lookupPatchField<volScalarField, scalar>("rho"),
lookupPatchField<volScalarField, scalar>("rho"),
size()/2
);
}

View file

@ -126,7 +126,7 @@ void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs()
}
const fvPatchField<vector>& Up =
patch().lookupPatchField<volVectorField, vector>(UName_);
lookupPatchField<volVectorField, vector>(UName_);
const surfaceScalarField& phi =
db().lookupObject<surfaceScalarField>(phiName_);
@ -137,13 +137,13 @@ void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs()
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
phip /= rhop;
}
const fvPatchField<scalar>& rAp =
patch().lookupPatchField<volScalarField, scalar>("(1|A("+UName_+"))");
lookupPatchField<volScalarField, scalar>("(1|A("+UName_+"))");
if (adjoint_)
{

View file

@ -109,7 +109,7 @@ void fixedPressureCompressibleDensityFvPatchScalarField::updateCoeffs()
}
const fvPatchField<scalar>& pp =
patch().lookupPatchField<volScalarField, scalar>(pName_);
lookupPatchField<volScalarField, scalar>(pName_);
const dictionary& thermoProps =
db().lookupObject<IOdictionary>("thermodynamicProperties");

View file

@ -134,7 +134,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
// Mass flow-rate
operator==(n*avgU/rhop);

View file

@ -142,7 +142,7 @@ void fluxFvPatchField<Type>::updateCoeffs()
const Field<Type>& C = *this;
const fvPatchField<scalar>& gammap =
this->patch().lookupPatchField
this->lookupPatchField
(
gammaName_,
reinterpret_cast<const volScalarField*>(NULL),

View file

@ -121,7 +121,7 @@ void Foam::fluxCorrectedVelocityFvPatchVectorField::evaluate
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(*this - n*(n & *this) + n*phip/(rhop*magS));
}

View file

@ -102,7 +102,7 @@ void freestreamPressureFvPatchScalarField::updateCoeffs()
const freestreamFvPatchVectorField& Up =
refCast<const freestreamFvPatchVectorField>
(
patch().lookupPatchField<volVectorField, vector>("U")
lookupPatchField<volVectorField, vector>("U")
);
const surfaceScalarField& phi =
@ -121,7 +121,7 @@ void freestreamPressureFvPatchScalarField::updateCoeffs()
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>("rho");
lookupPatchField<volScalarField, scalar>("rho");
phip = rhop*(patch().Sf() & Up.freestreamValue());
}

View file

@ -127,7 +127,7 @@ void inletOutletFvPatchField<Type>::updateCoeffs()
return;
}
const Field<scalar>& phip = this->patch().lookupPatchField
const Field<scalar>& phip = this->lookupPatchField
(
phiName_,
reinterpret_cast<const surfaceScalarField*>(0),

View file

@ -171,13 +171,13 @@ void Foam::inletOutletTotalTemperatureFvPatchScalarField::updateCoeffs()
}
const fvPatchVectorField& Up =
patch().lookupPatchField<volVectorField, vector>(UName_);
lookupPatchField<volVectorField, vector>(UName_);
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
lookupPatchField<surfaceScalarField, scalar>(phiName_);
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>(psiName_);
lookupPatchField<volScalarField, scalar>(psiName_);
scalar gM1ByG = (gamma_ - 1.0)/gamma_;

View file

@ -121,7 +121,7 @@ void outletInletFvPatchField<Type>::updateCoeffs()
return;
}
const fvsPatchField<scalar>& phip = this->patch().lookupPatchField
const fvsPatchField<scalar>& phip = this->lookupPatchField
(
"phi",
reinterpret_cast<const surfaceScalarField*>(0),

View file

@ -169,7 +169,7 @@ void pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs()
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
refValue() = inletDir_*phip/(rhop*ndmagS);
}

View file

@ -161,7 +161,7 @@ void pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs()
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(inletDir_*phip/(rhop*ndmagS));
}

View file

@ -176,7 +176,7 @@ void pressureInletOutletVelocityFvPatchVectorField::updateCoeffs()
}
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
lookupPatchField<surfaceScalarField, scalar>(phiName_);
valueFraction() = neg(phip)*(I - sqr(patch().nf()));

View file

@ -126,7 +126,7 @@ void pressureInletVelocityFvPatchVectorField::updateCoeffs()
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(n*phip/(rhop*magS));
}

View file

@ -138,7 +138,7 @@ void pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs()
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
refValue() = n*phip/(rhop*magS);
}

View file

@ -107,7 +107,7 @@ void rotatingTotalPressureFvPatchScalarField::updateCoeffs()
vectorField rotationVelocity =
omega_ ^ (patch().Cf() - axisHat*(axisHat & patch().Cf()));
vectorField Up = patch().lookupPatchField<volVectorField, vector>(UName())
vectorField Up = lookupPatchField<volVectorField, vector>(UName())
+ rotationVelocity;
totalPressureFvPatchScalarField::updateCoeffs(Up);

View file

@ -153,13 +153,13 @@ void supersonicFreestreamFvPatchVectorField::updateCoeffs()
}
const fvPatchField<scalar>& pT =
patch().lookupPatchField<volScalarField, scalar>("T");
lookupPatchField<volScalarField, scalar>("T");
const fvPatchField<scalar>& pp =
patch().lookupPatchField<volScalarField, scalar>("p");
lookupPatchField<volScalarField, scalar>("p");
const fvPatchField<scalar>& ppsi =
patch().lookupPatchField<volScalarField, scalar>("psi");
lookupPatchField<volScalarField, scalar>("psi");
// Need R of the free-stream flow. Assume R is independent of location
// along patch so use face 0

View file

@ -157,7 +157,7 @@ updateCoeffs()
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(inletDir*phip/(rhop*ndmagS));
}

View file

@ -166,7 +166,7 @@ void Foam::timeVaryingMappedTotalPressureFvPatchScalarField::updateCoeffs
const scalarField p0 = *this;
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
lookupPatchField<surfaceScalarField, scalar>(phiName_);
if (dimensionedInternalField().dimensions() == dimPressure/dimDensity)
{
@ -199,14 +199,14 @@ void Foam::timeVaryingMappedTotalPressureFvPatchScalarField::updateCoeffs
if (rhoName_ != "none")
{
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(p0 - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
}
else if (psiName_ != "none")
{
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>(psiName_);
lookupPatchField<volScalarField, scalar>(psiName_);
if (gamma_ > 1.0)
{
@ -265,7 +265,7 @@ void Foam::timeVaryingMappedTotalPressureFvPatchScalarField::updateCoeffs
void Foam::timeVaryingMappedTotalPressureFvPatchScalarField::updateCoeffs()
{
updateCoeffs(patch().lookupPatchField<volVectorField, vector>(UName_));
updateCoeffs(lookupPatchField<volVectorField, vector>(UName_));
}

View file

@ -151,7 +151,7 @@ void Foam::timeVaryingUniformTotalPressureFvPatchScalarField::updateCoeffs
p0_ = timeSeries_(this->db().time().timeOutputValue());
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
lookupPatchField<surfaceScalarField, scalar>(phiName_);
if (psiName_ == "none" && rhoName_ == "none")
{
@ -160,7 +160,7 @@ void Foam::timeVaryingUniformTotalPressureFvPatchScalarField::updateCoeffs
else if (rhoName_ == "none")
{
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>(psiName_);
lookupPatchField<volScalarField, scalar>(psiName_);
if (gamma_ > 1.0)
{
@ -184,7 +184,7 @@ void Foam::timeVaryingUniformTotalPressureFvPatchScalarField::updateCoeffs
else if (psiName_ == "none")
{
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(p0_ - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
}
@ -210,7 +210,7 @@ void Foam::timeVaryingUniformTotalPressureFvPatchScalarField::updateCoeffs
void Foam::timeVaryingUniformTotalPressureFvPatchScalarField::updateCoeffs()
{
updateCoeffs(patch().lookupPatchField<volVectorField, vector>(UName_));
updateCoeffs(lookupPatchField<volVectorField, vector>(UName_));
}

View file

@ -161,7 +161,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up)
}
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
lookupPatchField<surfaceScalarField, scalar>(phiName_);
if (psiName_ == "none" && rhoName_ == "none")
{
@ -170,7 +170,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up)
else if (rhoName_ == "none")
{
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>(psiName_);
lookupPatchField<volScalarField, scalar>(psiName_);
if (gamma_ > 1.0)
{
@ -194,7 +194,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up)
else if (psiName_ == "none")
{
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
lookupPatchField<volScalarField, scalar>(rhoName_);
operator==(p0_ - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
}
@ -220,7 +220,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up)
void Foam::totalPressureFvPatchScalarField::updateCoeffs()
{
updateCoeffs(patch().lookupPatchField<volVectorField, vector>(UName_));
updateCoeffs(lookupPatchField<volVectorField, vector>(UName_));
}

View file

@ -158,13 +158,13 @@ void Foam::totalTemperatureFvPatchScalarField::updateCoeffs()
}
const fvPatchVectorField& Up =
patch().lookupPatchField<volVectorField, vector>(UName_);
lookupPatchField<volVectorField, vector>(UName_);
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
lookupPatchField<surfaceScalarField, scalar>(phiName_);
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>(psiName_);
lookupPatchField<volScalarField, scalar>(psiName_);
scalar gM1ByG = (gamma_ - 1.0)/gamma_;

View file

@ -128,7 +128,7 @@ updateCoeffs()
}
const fvPatchField<vector>& Up =
patch().lookupPatchField<volVectorField, vector>(UName_);
lookupPatchField<volVectorField, vector>(UName_);
operator==(1.5*sqr(intensity_)*magSqr(Up));

View file

@ -114,7 +114,7 @@ template<class Type>
tmp<scalarField> waveTransmissiveFvPatchField<Type>::advectionSpeed() const
{
// Lookup the velocity and compressibility of the patch
const fvPatchField<scalar>& psip = this->patch().lookupPatchField
const fvPatchField<scalar>& psip = this->lookupPatchField
(
psiName_,
reinterpret_cast<const volScalarField*>(0),
@ -125,7 +125,7 @@ tmp<scalarField> waveTransmissiveFvPatchField<Type>::advectionSpeed() const
this->db().objectRegistry::lookupObject<surfaceScalarField>
(this->phiName_);
fvsPatchField<scalar> phip = this->patch().lookupPatchField
fvsPatchField<scalar> phip = this->lookupPatchField
(
this->phiName_,
reinterpret_cast<const surfaceScalarField*>(0),
@ -134,7 +134,7 @@ tmp<scalarField> waveTransmissiveFvPatchField<Type>::advectionSpeed() const
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchScalarField& rhop = this->patch().lookupPatchField
const fvPatchScalarField& rhop = this->lookupPatchField
(
this->rhoName_,
reinterpret_cast<const volScalarField*>(0),
@ -155,7 +155,7 @@ template<class Type>
tmp<scalarField> waveTransmissiveFvPatchField<Type>::supercritical() const
{
// Lookup the velocity and compressibility of the patch
const fvPatchField<scalar>& psip = this->patch().lookupPatchField
const fvPatchField<scalar>& psip = this->lookupPatchField
(
psiName_,
reinterpret_cast<const volScalarField*>(NULL),
@ -163,7 +163,7 @@ tmp<scalarField> waveTransmissiveFvPatchField<Type>::supercritical() const
);
const fvPatchVectorField& U =
this->patch().lookupPatchField
this->lookupPatchField
(
UName_,
reinterpret_cast<const volVectorField*>(NULL),

View file

@ -157,7 +157,24 @@ Foam::fvPatchField<Type>::fvPatchField
template<class Type>
const Foam::objectRegistry& Foam::fvPatchField<Type>::db() const
{
return patch_.boundaryMesh().mesh();
//HR 12.3.10: Lookup fields from the field DB rather than the mesh
return internalField_.db();
}
template<class Type>
template<class GeometricField, class Type2>
const typename GeometricField::PatchFieldType& Foam::fvPatchField<Type>::lookupPatchField
(
const word& name,
const GeometricField*,
const Type2*
) const
{
return patch_.patchField<GeometricField, Type2>
(
internalField_.db().objectRegistry::lookupObject<GeometricField>(name)
);
}

View file

@ -269,6 +269,19 @@ public:
//- Return local objectRegistry
const objectRegistry& db() const;
//- Lookup and return the patchField of the named field from the
// field's objectRegistry.
// N.B. The dummy pointer arguments are used if this function is
// instantiated within a templated function to avoid a bug in gcc.
// See inletOutletFvPatchField.C and outletInletFvPatchField.C
template<class GeometricField, class Type2>
const typename GeometricField::PatchFieldType& lookupPatchField
(
const word& name,
const GeometricField* = NULL,
const Type2* = NULL
) const;
//- Return patch
const fvPatch& patch() const
{

View file

@ -150,7 +150,24 @@ fvsPatchField<Type>::fvsPatchField
template<class Type>
const objectRegistry& fvsPatchField<Type>::db() const
{
return patch_.boundaryMesh().mesh();
//HR 12.3.10: Lookup fields from the field DB rather than the mesh
return internalField_.db();
}
template<class Type>
template<class GeometricField, class Type2>
const typename GeometricField::PatchFieldType& Foam::fvsPatchField<Type>::lookupPatchField
(
const word& name,
const GeometricField*,
const Type2*
) const
{
return patch_.patchField<GeometricField, Type2>
(
internalField_.db().objectRegistry::lookupObject<GeometricField>(name)
);
}

View file

@ -260,6 +260,19 @@ public:
//- Return local objectRegistry
const objectRegistry& db() const;
//- Lookup and return the patchField of the named field from the
// field's objectRegistry.
// N.B. The dummy pointer arguments are used if this function is
// instantiated within a templated function to avoid a bug in gcc.
// See inletOutletFvPatchField.C and outletInletFvPatchField.C
template<class GeometricField, class Type2>
const typename GeometricField::PatchFieldType& lookupPatchField
(
const word& name,
const GeometricField* = NULL,
const Type2* = NULL
) const;
//- Return patch
const fvPatch& patch() const
{

View file

@ -145,7 +145,7 @@ void Foam::basicThermo::eBoundaryCorrection(volScalarField& e)
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicThermo::basicThermo(const fvMesh& mesh)
Foam::basicThermo::basicThermo(const fvMesh& mesh, const objectRegistry& obj)
:
IOdictionary
(
@ -153,7 +153,7 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
(
"thermophysicalProperties",
mesh.time().constant(),
mesh,
obj,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
@ -165,7 +165,7 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
(
"p",
mesh.time().timeName(),
mesh,
obj,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
@ -178,7 +178,7 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
(
"psi",
mesh.time().timeName(),
mesh,
obj,
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -192,7 +192,7 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
(
"T",
mesh.time().timeName(),
mesh,
obj,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
@ -205,7 +205,7 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
(
"mu",
mesh.time().timeName(),
mesh,
obj,
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -219,7 +219,7 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
(
"alpha",
mesh.time().timeName(),
mesh,
obj,
IOobject::NO_READ,
IOobject::NO_WRITE
),

View file

@ -112,8 +112,8 @@ public:
// Constructors
//- Construct from mesh
basicThermo(const fvMesh&);
//- Construct from mesh and object registry
basicThermo(const fvMesh&, const objectRegistry&);
//- Destructor

View file

@ -104,7 +104,7 @@ void Foam::fixedEnthalpyFvPatchScalarField::updateCoeffs()
const_cast<fvPatchScalarField&>(thermo.T().boundaryField()[patchi]);
Tw.evaluate();
if (dimensionedInternalField().name() == "h")
if (dimensionedInternalField().name() == db().mangleFileName("h"))
{
operator==(thermo.h(Tw, patchi));
}

View file

@ -105,7 +105,7 @@ void Foam::gradientEnthalpyFvPatchScalarField::updateCoeffs()
Tw.evaluate();
if (dimensionedInternalField().name() == "h")
if (dimensionedInternalField().name() == db().mangleFileName("h"))
{
gradient() = thermo.Cp(Tw, patchi)*Tw.snGrad()
+ patch().deltaCoeffs()*

View file

@ -113,7 +113,7 @@ void Foam::mixedEnthalpyFvPatchScalarField::updateCoeffs()
valueFraction() = Tw.valueFraction();
if (dimensionedInternalField().name() == "h")
if (dimensionedInternalField().name() == db().mangleFileName("h"))
{
refValue() = thermo.h(Tw.refValue(), patchi);
refGrad() = thermo.Cp(Tw, patchi)*Tw.refGrad()

View file

@ -43,7 +43,8 @@ defineTypeNameAndDebug(basicMixture, 0);
basicMixture::basicMixture
(
const dictionary&,
const fvMesh&
const fvMesh&,
const objectRegistry&
)
{}

View file

@ -44,6 +44,7 @@ namespace Foam
{
class fvMesh;
class objectRegistry;
class dictionary;
/*---------------------------------------------------------------------------*\
@ -61,8 +62,8 @@ public:
// Constructors
//- Construct from dictionary and mesh
basicMixture(const dictionary&, const fvMesh&);
//- Construct from dictionary, mesh and object registry
basicMixture(const dictionary&, const fvMesh&, const objectRegistry&);
// Destructor

View file

@ -40,10 +40,11 @@ template<class ThermoType>
pureMixture<ThermoType>::pureMixture
(
const dictionary& thermoDict,
const fvMesh& mesh
const fvMesh& mesh,
const objectRegistry& obj
)
:
basicMixture(thermoDict, mesh),
basicMixture(thermoDict, mesh, obj),
mixture_(thermoDict.lookup("mixture"))
{}

View file

@ -72,8 +72,8 @@ public:
// Constructors
//- Construct from dictionary and mesh
pureMixture(const dictionary&, const fvMesh&);
//- Construct from dictionary, mesh and object registry
pureMixture(const dictionary&, const fvMesh&, const objectRegistry&);
// Destructor

View file

@ -37,9 +37,9 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicPsiThermo::basicPsiThermo(const fvMesh& mesh)
Foam::basicPsiThermo::basicPsiThermo(const fvMesh& mesh, const objectRegistry& obj)
:
basicThermo(mesh)
basicThermo(mesh, obj)
{}

View file

@ -76,20 +76,25 @@ public:
autoPtr,
basicPsiThermo,
fvMesh,
(const fvMesh& mesh),
(mesh)
(const fvMesh& mesh, const objectRegistry& obj),
(mesh, obj)
);
#endif
// Constructors
//- Construct from mesh
basicPsiThermo(const fvMesh&);
//- Construct from mesh and object registry
basicPsiThermo(const fvMesh&, const objectRegistry&);
//- Selector
static autoPtr<basicPsiThermo> New(const fvMesh&);
static autoPtr<basicPsiThermo> New(const fvMesh&, const objectRegistry&);
static autoPtr<basicPsiThermo> New(const fvMesh& mesh)
{
return New(mesh, mesh);
}
//- Destructor
virtual ~basicPsiThermo();

View file

@ -30,7 +30,8 @@ License
Foam::autoPtr<Foam::basicPsiThermo> Foam::basicPsiThermo::New
(
const fvMesh& mesh
const fvMesh& mesh,
const objectRegistry& obj
)
{
word thermoTypeName;
@ -45,7 +46,7 @@ Foam::autoPtr<Foam::basicPsiThermo> Foam::basicPsiThermo::New
(
"thermophysicalProperties",
mesh.time().constant(),
mesh,
obj,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
@ -61,14 +62,14 @@ Foam::autoPtr<Foam::basicPsiThermo> Foam::basicPsiThermo::New
if (cstrIter == fvMeshConstructorTablePtr_->end())
{
FatalErrorIn("basicPsiThermo::New(const fvMesh&)")
FatalErrorIn("basicPsiThermo::New(const fvMesh&, const objectRegistry&)")
<< "Unknown basicPsiThermo type " << thermoTypeName << nl << nl
<< "Valid basicPsiThermo types are:" << nl
<< fvMeshConstructorTablePtr_->toc() << nl
<< exit(FatalError);
}
return autoPtr<basicPsiThermo>(cstrIter()(mesh));
return autoPtr<basicPsiThermo>(cstrIter()(mesh, obj));
}

View file

@ -99,10 +99,10 @@ void Foam::ePsiThermo<MixtureType>::calculate()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class MixtureType>
Foam::ePsiThermo<MixtureType>::ePsiThermo(const fvMesh& mesh)
Foam::ePsiThermo<MixtureType>::ePsiThermo(const fvMesh& mesh, const objectRegistry& obj)
:
basicPsiThermo(mesh),
MixtureType(*this, mesh),
basicPsiThermo(mesh, obj),
MixtureType(*this, mesh, obj),
e_
(
@ -110,7 +110,7 @@ Foam::ePsiThermo<MixtureType>::ePsiThermo(const fvMesh& mesh)
(
"e",
mesh.time().timeName(),
mesh,
obj,
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -241,7 +241,7 @@ Foam::tmp<Foam::volScalarField> Foam::ePsiThermo<MixtureType>::Cp() const
(
"Cp",
mesh.time().timeName(),
mesh,
T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -304,7 +304,7 @@ Foam::tmp<Foam::volScalarField> Foam::ePsiThermo<MixtureType>::Cv() const
(
"Cv",
mesh.time().timeName(),
mesh,
T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),

View file

@ -77,8 +77,8 @@ public:
// Constructors
//- Construct from mese
ePsiThermo(const fvMesh&);
//- Construct from mesh and object registry
ePsiThermo(const fvMesh&, const objectRegistry&);
//- Destructor

View file

@ -97,10 +97,10 @@ void Foam::hPsiThermo<MixtureType>::calculate()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class MixtureType>
Foam::hPsiThermo<MixtureType>::hPsiThermo(const fvMesh& mesh)
Foam::hPsiThermo<MixtureType>::hPsiThermo(const fvMesh& mesh, const objectRegistry& obj)
:
basicPsiThermo(mesh),
MixtureType(*this, mesh),
basicPsiThermo(mesh, obj),
MixtureType(*this, mesh, obj),
h_
(
@ -239,7 +239,7 @@ Foam::tmp<Foam::volScalarField> Foam::hPsiThermo<MixtureType>::Cp() const
(
"Cp",
mesh.time().timeName(),
mesh,
this->T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -302,7 +302,7 @@ Foam::tmp<Foam::volScalarField> Foam::hPsiThermo<MixtureType>::Cv() const
(
"Cv",
mesh.time().timeName(),
mesh,
this->T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),

View file

@ -78,7 +78,7 @@ public:
// Constructors
//- Construct from mesh
hPsiThermo(const fvMesh&);
hPsiThermo(const fvMesh&, const objectRegistry& obj);
//- Destructor

View file

@ -97,10 +97,14 @@ void Foam::hsPsiThermo<MixtureType>::calculate()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class MixtureType>
Foam::hsPsiThermo<MixtureType>::hsPsiThermo(const fvMesh& mesh)
Foam::hsPsiThermo<MixtureType>::hsPsiThermo
(
const fvMesh& mesh,
const objectRegistry& obj
)
:
basicPsiThermo(mesh),
MixtureType(*this, mesh),
basicPsiThermo(mesh, obj),
MixtureType(*this, mesh, obj),
hs_
(
@ -108,7 +112,7 @@ Foam::hsPsiThermo<MixtureType>::hsPsiThermo(const fvMesh& mesh)
(
"hs",
mesh.time().timeName(),
mesh,
obj,
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -239,7 +243,7 @@ Foam::tmp<Foam::volScalarField> Foam::hsPsiThermo<MixtureType>::Cp() const
(
"Cp",
mesh.time().timeName(),
mesh,
T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -302,7 +306,7 @@ Foam::tmp<Foam::volScalarField> Foam::hsPsiThermo<MixtureType>::Cv() const
(
"Cv",
mesh.time().timeName(),
mesh,
T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),

View file

@ -77,8 +77,8 @@ public:
// Constructors
//- Construct from mesh
hsPsiThermo(const fvMesh&);
//- Construct from mesh and object registry
hsPsiThermo(const fvMesh&, const objectRegistry&);
//- Destructor

View file

@ -37,16 +37,16 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicRhoThermo::basicRhoThermo(const fvMesh& mesh)
Foam::basicRhoThermo::basicRhoThermo(const fvMesh& mesh, const objectRegistry& obj)
:
basicThermo(mesh),
basicThermo(mesh, obj),
rho_
(
IOobject
(
"rhoThermo",
mesh.time().timeName(),
mesh,
obj,
IOobject::NO_READ,
IOobject::NO_WRITE
),

View file

@ -81,20 +81,24 @@ public:
autoPtr,
basicRhoThermo,
fvMesh,
(const fvMesh& mesh),
(mesh)
(const fvMesh& mesh, const objectRegistry& obj),
(mesh, obj)
);
// Constructors
//- Construct from mesh
basicRhoThermo(const fvMesh&);
//- Construct from mesh and object registry
basicRhoThermo(const fvMesh&, const objectRegistry&);
//- Selector
static autoPtr<basicRhoThermo> New(const fvMesh&);
static autoPtr<basicRhoThermo> New(const fvMesh&, const objectRegistry&);
static autoPtr<basicRhoThermo> New(const fvMesh& mesh)
{
return New(mesh, mesh);
}
//- Destructor
virtual ~basicRhoThermo();

View file

@ -33,7 +33,8 @@ Description
Foam::autoPtr<Foam::basicRhoThermo> Foam::basicRhoThermo::New
(
const fvMesh& mesh
const fvMesh& mesh,
const objectRegistry& obj
)
{
word thermoTypeName;
@ -48,7 +49,7 @@ Foam::autoPtr<Foam::basicRhoThermo> Foam::basicRhoThermo::New
(
"thermophysicalProperties",
mesh.time().constant(),
mesh,
obj,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
@ -64,14 +65,14 @@ Foam::autoPtr<Foam::basicRhoThermo> Foam::basicRhoThermo::New
if (cstrIter == fvMeshConstructorTablePtr_->end())
{
FatalErrorIn("basicRhoThermo::New(const fvMesh&)")
FatalErrorIn("basicRhoThermo::New(const fvMesh&, const objectRegistry&)")
<< "Unknown basicRhoThermo type " << thermoTypeName << nl << nl
<< "Valid basicRhoThermo types are:" << nl
<< fvMeshConstructorTablePtr_->toc() << nl
<< exit(FatalError);
}
return autoPtr<basicRhoThermo>(cstrIter()(mesh));
return autoPtr<basicRhoThermo>(cstrIter()(mesh, obj));
}

View file

@ -102,10 +102,10 @@ void Foam::hRhoThermo<MixtureType>::calculate()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class MixtureType>
Foam::hRhoThermo<MixtureType>::hRhoThermo(const fvMesh& mesh)
Foam::hRhoThermo<MixtureType>::hRhoThermo(const fvMesh& mesh, const objectRegistry& obj)
:
basicRhoThermo(mesh),
MixtureType(*this, mesh),
basicRhoThermo(mesh, obj),
MixtureType(*this, mesh, obj),
h_
(
@ -113,7 +113,7 @@ Foam::hRhoThermo<MixtureType>::hRhoThermo(const fvMesh& mesh)
(
"h",
mesh.time().timeName(),
mesh,
obj,
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -238,7 +238,7 @@ Foam::tmp<Foam::volScalarField> Foam::hRhoThermo<MixtureType>::Cp() const
(
"Cp",
mesh.time().timeName(),
mesh,
this->T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -301,7 +301,7 @@ Foam::tmp<Foam::volScalarField> Foam::hRhoThermo<MixtureType>::Cv() const
(
"Cv",
mesh.time().timeName(),
mesh,
this->T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),

View file

@ -78,7 +78,7 @@ public:
// Constructors
//- Construct from mesh
hRhoThermo(const fvMesh&);
hRhoThermo(const fvMesh&, const objectRegistry&);
//- Destructor

View file

@ -102,10 +102,10 @@ void Foam::hsRhoThermo<MixtureType>::calculate()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class MixtureType>
Foam::hsRhoThermo<MixtureType>::hsRhoThermo(const fvMesh& mesh)
Foam::hsRhoThermo<MixtureType>::hsRhoThermo(const fvMesh& mesh, const objectRegistry& obj)
:
basicRhoThermo(mesh),
MixtureType(*this, mesh),
basicRhoThermo(mesh, obj),
MixtureType(*this, mesh, obj),
hs_
(
@ -113,7 +113,7 @@ Foam::hsRhoThermo<MixtureType>::hsRhoThermo(const fvMesh& mesh)
(
"hs",
mesh.time().timeName(),
mesh,
obj,
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -238,7 +238,7 @@ Foam::tmp<Foam::volScalarField> Foam::hsRhoThermo<MixtureType>::Cp() const
(
"Cp",
mesh.time().timeName(),
mesh,
this->T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -301,7 +301,7 @@ Foam::tmp<Foam::volScalarField> Foam::hsRhoThermo<MixtureType>::Cv() const
(
"Cv",
mesh.time().timeName(),
mesh,
this->T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),

View file

@ -77,8 +77,8 @@ public:
// Constructors
//- Construct from mesh
hsRhoThermo(const fvMesh&);
//- Construct from mesh and object registry
hsRhoThermo(const fvMesh&, const objectRegistry&);
//- Destructor

View file

@ -34,11 +34,12 @@ template<class CompType, class ThermoType>
Foam::ODEChemistryModel<CompType, ThermoType>::ODEChemistryModel
(
const fvMesh& mesh,
const objectRegistry& obj,
const word& compTypeName,
const word& thermoTypeName
)
:
CompType(mesh, thermoTypeName),
CompType(mesh, obj, thermoTypeName),
ODE(),

View file

@ -50,6 +50,7 @@ namespace Foam
// Forward declaration of classes
class fvMesh;
class objectRegistry;
template<class CompType, class ThermoType>
class chemistrySolver;
@ -118,6 +119,7 @@ public:
ODEChemistryModel
(
const fvMesh& mesh,
const objectRegistry& obj,
const word& compTypeName,
const word& thermoTypeName
);

View file

@ -37,7 +37,11 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh)
Foam::basicChemistryModel::basicChemistryModel
(
const fvMesh& mesh,
const objectRegistry& obj
)
:
IOdictionary
(
@ -45,7 +49,7 @@ Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh)
(
"chemistryProperties",
mesh.time().constant(),
mesh,
obj,
IOobject::MUST_READ,
IOobject::NO_WRITE
)

Some files were not shown because too many files have changed in this diff Show more