Boundary conditions: Added extrapolatedCalculatedFvPatchField

To be used instead of zeroGradientFvPatchField for temporary fields for
which zero-gradient extrapolation is use to evaluate the boundary field
but avoiding fields derived from temporary field using field algebra
inheriting the zeroGradient boundary condition by the reuse of the
temporary field storage.

zeroGradientFvPatchField should not be used as the default patch field
for any temporary fields and should be avoided for non-temporary fields
except where it is clearly appropriate;
extrapolatedCalculatedFvPatchField and calculatedFvPatchField are
generally more suitable defaults depending on the manner in which the
boundary values are specified or evaluated.

The entire OpenFOAM-dev code-base has been updated following the above
recommendations.

Henry G. Weller
CFD Direct
This commit is contained in:
Henry Weller
2016-02-20 22:44:37 +00:00
parent 979e1ee191
commit 99a10ecea6
110 changed files with 1004 additions and 552 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "basicXiSubXiEq.H" #include "basicXiSubXiEq.H"
#include "zeroGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -93,59 +92,43 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
const scalarField Cw = pow(mesh.V(), 2.0/3.0); const scalarField Cw = pow(mesh.V(), 2.0/3.0);
tmp<volScalarField> tN volScalarField N
( (
new volScalarField IOobject
( (
IOobject "N",
( mesh.time().constant(),
"tN",
mesh.time().constant(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh, mesh,
dimensionedScalar("zero", Nv.dimensions(), 0.0), IOobject::NO_READ,
zeroGradientFvPatchVectorField::typeName IOobject::NO_WRITE
) ),
mesh,
dimensionedScalar("zero", Nv.dimensions(), 0.0)
); );
volScalarField& N = tN();
N.internalField() = Nv.internalField()*Cw; N.internalField() = Nv.internalField()*Cw;
tmp<volSymmTensorField> tns volSymmTensorField ns
( (
new volSymmTensorField IOobject
( (
IOobject "ns",
( U.mesh().time().timeName(),
"tns",
U.mesh().time().timeName(),
U.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
U.mesh(), U.mesh(),
dimensionedSymmTensor IOobject::NO_READ,
( IOobject::NO_WRITE
"zero", ),
nsv.dimensions(), U.mesh(),
pTraits<symmTensor>::zero dimensionedSymmTensor
), (
zeroGradientFvPatchSymmTensorField::typeName "zero",
nsv.dimensions(),
pTraits<symmTensor>::zero
) )
); );
volSymmTensorField& ns = tns();
ns.internalField() = nsv.internalField()*Cw; ns.internalField() = nsv.internalField()*Cw;
volScalarField n(max(N - (Uhat & ns & Uhat), scalar(1e-4))); volScalarField n(max(N - (Uhat & ns & Uhat), scalar(1e-4)));
volScalarField b((Uhat & B_ & Uhat)/sqrt(n)); volScalarField b((Uhat & B_ & Uhat)/sqrt(n));
volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
volScalarField XiSubEq volScalarField XiSubEq

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "basicXiSubG.H" #include "basicXiSubG.H"
#include "zeroGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -74,29 +73,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::G() const
volScalarField& Gtot = tGtot(); volScalarField& Gtot = tGtot();
const scalarField Cw = pow(Su_.mesh().V(), 2.0/3.0); const scalarField Cw = pow(Su_.mesh().V(), 2.0/3.0);
scalarField N(Nv.internalField()*Cw);
tmp<volScalarField> tN
(
new volScalarField
(
IOobject
(
"tN",
Su_.mesh().time().timeName(),
Su_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
Su_.mesh(),
dimensionedScalar("zero", Nv.dimensions(), 0.0),
zeroGradientFvPatchVectorField::typeName
)
);
volScalarField& N = tN();
N.internalField() = Nv.internalField()*Cw;
forAll(N, celli) forAll(N, celli)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "basic.H" #include "basic.H"
#include "zeroGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -110,8 +109,7 @@ Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
"zero", "zero",
dimMass/dimTime/pow(dimLength, 3), dimMass/dimTime/pow(dimLength, 3),
pTraits<symmTensor>::zero pTraits<symmTensor>::zero
), )
zeroGradientFvPatchSymmTensorField::typeName
) )
); );
@ -145,8 +143,7 @@ Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
U_.mesh(), U_.mesh(),
dimensionedScalar("zero", dimMass/dimLength/pow(dimTime, 3), 0.0), dimensionedScalar("zero", dimMass/dimLength/pow(dimTime, 3), 0.0)
zeroGradientFvPatchVectorField::typeName
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "XiEqModel.H" #include "XiEqModel.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -111,39 +110,30 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
false false
), ),
mesh, mesh,
dimensionedScalar("zero", Nv.dimensions(), 0.0), dimensionedScalar("zero", Nv.dimensions(), 0.0)
zeroGradientFvPatchVectorField::typeName
) )
); );
volScalarField& N = tN(); volScalarField& N = tN();
N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0); N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
tmp<volSymmTensorField> tns volSymmTensorField ns
( (
new volSymmTensorField IOobject
( (
IOobject "tns",
( mesh.time().timeName(),
"tns",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh, mesh,
dimensionedSymmTensor IOobject::NO_READ,
( IOobject::NO_WRITE
"zero", ),
nsv.dimensions(), mesh,
pTraits<symmTensor>::zero dimensionedSymmTensor
) (
"zero",
nsv.dimensions(),
pTraits<symmTensor>::zero
) )
); );
volSymmTensorField& ns = tns();
ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0); ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
const volVectorField Uhat const volVectorField Uhat

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -34,7 +34,6 @@ Description
#include "dynamicFvMesh.H" #include "dynamicFvMesh.H"
#include "psiThermo.H" #include "psiThermo.H"
#include "turbulentFluidThermoModel.H" #include "turbulentFluidThermoModel.H"
#include "zeroGradientFvPatchFields.H"
#include "fixedRhoFvPatchScalarField.H" #include "fixedRhoFvPatchScalarField.H"
#include "directionInterpolate.H" #include "directionInterpolate.H"
#include "motionSolver.H" #include "motionSolver.H"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,7 +33,6 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "psiThermo.H" #include "psiThermo.H"
#include "turbulentFluidThermoModel.H" #include "turbulentFluidThermoModel.H"
#include "zeroGradientFvPatchFields.H"
#include "fixedRhoFvPatchScalarField.H" #include "fixedRhoFvPatchScalarField.H"
#include "directionInterpolate.H" #include "directionInterpolate.H"
#include "localEulerDdtScheme.H" #include "localEulerDdtScheme.H"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -59,8 +59,6 @@ void Foam::multiphaseMixtureThermo::calcAlphas()
alphas_ += level*phase(); alphas_ += level*phase();
level += 1.0; level += 1.0;
} }
alphas_.correctBoundaryConditions();
} }
@ -104,8 +102,7 @@ Foam::multiphaseMixtureThermo::multiphaseMixtureThermo
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh_, mesh_,
dimensionedScalar("alphas", dimless, 0.0), dimensionedScalar("alphas", dimless, 0.0)
zeroGradientFvPatchScalarField::typeName
), ),
sigmas_(lookup("sigmas")), sigmas_(lookup("sigmas")),

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -54,8 +54,6 @@ void Foam::multiphaseSystem::calcAlphas()
alphas_ += level*iter(); alphas_ += level*iter();
level += 1.0; level += 1.0;
} }
alphas_.correctBoundaryConditions();
} }
@ -417,8 +415,7 @@ Foam::multiphaseSystem::multiphaseSystem
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh_, mesh_,
dimensionedScalar("alphas", dimless, 0.0), dimensionedScalar("alphas", dimless, 0.0)
zeroGradientFvPatchScalarField::typeName
), ),
sigmas_(lookup("sigmas")), sigmas_(lookup("sigmas")),

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,8 +52,6 @@ void Foam::multiphaseMixture::calcAlphas()
alphas_ += level*iter(); alphas_ += level*iter();
level += 1.0; level += 1.0;
} }
alphas_.correctBoundaryConditions();
} }
@ -108,8 +106,7 @@ Foam::multiphaseMixture::multiphaseMixture
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh_, mesh_,
dimensionedScalar("alphas", dimless, 0.0), dimensionedScalar("alphas", dimless, 0.0)
zeroGradientFvPatchScalarField::typeName
), ),
nu_ nu_

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -27,6 +27,7 @@ License
#include "phasePair.H" #include "phasePair.H"
#include "fvcGrad.H" #include "fvcGrad.H"
#include "surfaceInterpolate.H" #include "surfaceInterpolate.H"
#include "zeroGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -34,6 +34,7 @@ License
#include "fvcDiv.H" #include "fvcDiv.H"
#include "fvmSup.H" #include "fvmSup.H"
#include "fvMatrix.H" #include "fvMatrix.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -78,8 +78,7 @@ Foam::InertPhaseModel<BasePhaseModel>::Sh() const
this->mesh() this->mesh()
), ),
this->mesh(), this->mesh(),
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0), dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0)
zeroGradientFvPatchScalarField::typeName
) )
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -64,8 +64,6 @@ void Foam::multiphaseSystem::calcAlphas()
alphas_ += level*phases()[i]; alphas_ += level*phases()[i];
level += 1.0; level += 1.0;
} }
alphas_.correctBoundaryConditions();
} }
@ -506,8 +504,7 @@ Foam::multiphaseSystem::multiphaseSystem
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("alphas", dimless, 0.0), dimensionedScalar("alphas", dimless, 0.0)
zeroGradientFvPatchScalarField::typeName
), ),
cAlphas_(lookup("interfaceCompression")), cAlphas_(lookup("interfaceCompression")),

View File

@ -1,4 +1,4 @@
EXE_INC = \ EXE_INC = -ggdb3 \
-ItwoPhaseSystem/lnInclude \ -ItwoPhaseSystem/lnInclude \
-I../phaseSystems/lnInclude \ -I../phaseSystems/lnInclude \
-I../interfacialModels/lnInclude \ -I../interfacialModels/lnInclude \

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -27,6 +27,7 @@ License
#include "phasePair.H" #include "phasePair.H"
#include "fvcGrad.H" #include "fvcGrad.H"
#include "surfaceInterpolate.H" #include "surfaceInterpolate.H"
#include "zeroGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -41,8 +41,7 @@
"rho", "rho",
dimMass/dimVolume, dimMass/dimVolume,
rhoValue rhoValue
), )
zeroGradientFvPatchField<scalar>::typeName
) )
); );
} }
@ -97,8 +96,7 @@
"Erho", "Erho",
dimMass/dimLength/sqr(dimTime), dimMass/dimLength/sqr(dimTime),
rhoEValue rhoEValue
), )
zeroGradientFvPatchField<scalar>::typeName
) )
); );
} }
@ -152,8 +150,7 @@
"nu", "nu",
dimless, dimless,
nuValue nuValue
), )
zeroGradientFvPatchField<scalar>::typeName
) )
); );
} }

View File

@ -75,8 +75,7 @@ if (thermalStress)
"C", "C",
dimensionSet(0, 2, -2 , -1, 0), dimensionSet(0, 2, -2 , -1, 0),
CValue CValue
), )
zeroGradientFvPatchField<scalar>::typeName
) )
); );
@ -131,8 +130,7 @@ if (thermalStress)
"rhoK", "rhoK",
dimensionSet(1, 1, -3 , -1, 0), dimensionSet(1, 1, -3 , -1, 0),
rhoKValue rhoKValue
), )
zeroGradientFvPatchField<scalar>::typeName
) )
); );
@ -188,8 +186,7 @@ if (thermalStress)
"alpha", "alpha",
inv(dimTemperature), inv(dimTemperature),
alphaValue alphaValue
), )
zeroGradientFvPatchField<scalar>::typeName
) )
); );
} }

View File

@ -398,8 +398,7 @@ int main(int argc, char *argv[])
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
mesh, mesh,
dimensionedScalar("cellDist", dimless, 0), dimensionedScalar("cellDist", dimless, 0)
zeroGradientFvPatchScalarField::typeName
); );
forAll(procIds, celli) forAll(procIds, celli)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -236,20 +236,18 @@ void writeDecomposition
false // do not register false // do not register
), ),
mesh, mesh,
dimensionedScalar(name, dimless, -1), dimensionedScalar(name, dimless, -1)
zeroGradientFvPatchScalarField::typeName
); );
forAll(procCells, cI) forAll(procCells, cI)
{ {
procCells[cI] = decomp[cI]; procCells[cI] = decomp[cI];
} }
procCells.write(); procCells.write();
} }
// Read vol or surface fields
//template<class T, class Mesh>
template<class GeoField> template<class GeoField>
void readFields void readFields
( (
@ -260,12 +258,12 @@ void readFields
PtrList<GeoField>& fields PtrList<GeoField>& fields
) )
{ {
//typedef GeometricField<T, fvPatchField, Mesh> fldType;
// Get my objects of type // Get my objects of type
IOobjectList objects(allObjects.lookupClass(GeoField::typeName)); IOobjectList objects(allObjects.lookupClass(GeoField::typeName));
// Check that we all have all objects // Check that we all have all objects
wordList objectNames = objects.toc(); wordList objectNames = objects.toc();
// Get master names // Get master names
wordList masterNames(objectNames); wordList masterNames(objectNames);
Pstream::scatter(masterNames); Pstream::scatter(masterNames);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,6 +35,7 @@ Description
#include "calc.H" #include "calc.H"
#include "fvc.H" #include "fvc.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -113,12 +113,12 @@ template<class T, class Container>
Foam::CompactListList<T, Container>::CompactListList Foam::CompactListList<T, Container>::CompactListList
( (
CompactListList<T, Container>& lst, CompactListList<T, Container>& lst,
bool reUse bool reuse
) )
: :
size_(lst.size()), size_(lst.size()),
offsets_(lst.offsets_, reUse), offsets_(lst.offsets_, reuse),
m_(lst.m_, reUse) m_(lst.m_, reuse)
{} {}

View File

@ -123,7 +123,7 @@ public:
explicit CompactListList(const Xfer<CompactListList<T, Container>>&); explicit CompactListList(const Xfer<CompactListList<T, Container>>&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
CompactListList(CompactListList<T, Container>&, bool reUse); CompactListList(CompactListList<T, Container>&, bool reuse);
//- Construct from Istream. //- Construct from Istream.
CompactListList(Istream&); CompactListList(Istream&);

View File

@ -34,11 +34,8 @@ License
#include "BiIndirectList.H" #include "BiIndirectList.H"
#include "contiguous.H" #include "contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
// Construct with length specified
template<class T> template<class T>
Foam::List<T>::List(const label s) Foam::List<T>::List(const label s)
: :
@ -58,7 +55,6 @@ Foam::List<T>::List(const label s)
} }
// Construct with length and single value specified
template<class T> template<class T>
Foam::List<T>::List(const label s, const T& a) Foam::List<T>::List(const label s, const T& a)
: :
@ -83,7 +79,6 @@ Foam::List<T>::List(const label s, const T& a)
} }
// Construct as copy
template<class T> template<class T>
Foam::List<T>::List(const List<T>& a) Foam::List<T>::List(const List<T>& a)
: :
@ -93,13 +88,13 @@ Foam::List<T>::List(const List<T>& a)
{ {
this->v_ = new T[this->size_]; this->v_ = new T[this->size_];
# ifdef USEMEMCPY #ifdef USEMEMCPY
if (contiguous<T>()) if (contiguous<T>())
{ {
memcpy(this->v_, a.v_, this->byteSize()); memcpy(this->v_, a.v_, this->byteSize());
} }
else else
# endif #endif
{ {
List_ACCESS(T, (*this), vp); List_ACCESS(T, (*this), vp);
List_CONST_ACCESS(T, a, ap); List_CONST_ACCESS(T, a, ap);
@ -111,7 +106,6 @@ Foam::List<T>::List(const List<T>& a)
} }
// Construct by transferring the parameter contents
template<class T> template<class T>
Foam::List<T>::List(const Xfer<List<T>>& lst) Foam::List<T>::List(const Xfer<List<T>>& lst)
{ {
@ -119,13 +113,12 @@ Foam::List<T>::List(const Xfer<List<T>>& lst)
} }
// Construct as copy or re-use as specified.
template<class T> template<class T>
Foam::List<T>::List(List<T>& a, bool reUse) Foam::List<T>::List(List<T>& a, bool reuse)
: :
UList<T>(NULL, a.size_) UList<T>(NULL, a.size_)
{ {
if (reUse) if (reuse)
{ {
this->v_ = a.v_; this->v_ = a.v_;
a.v_ = 0; a.v_ = 0;
@ -135,13 +128,13 @@ Foam::List<T>::List(List<T>& a, bool reUse)
{ {
this->v_ = new T[this->size_]; this->v_ = new T[this->size_];
# ifdef USEMEMCPY #ifdef USEMEMCPY
if (contiguous<T>()) if (contiguous<T>())
{ {
memcpy(this->v_, a.v_, this->byteSize()); memcpy(this->v_, a.v_, this->byteSize());
} }
else else
# endif #endif
{ {
List_ACCESS(T, (*this), vp); List_ACCESS(T, (*this), vp);
List_CONST_ACCESS(T, a, ap); List_CONST_ACCESS(T, a, ap);
@ -153,7 +146,6 @@ Foam::List<T>::List(List<T>& a, bool reUse)
} }
// Construct as subset
template<class T> template<class T>
Foam::List<T>::List(const UList<T>& a, const labelUList& map) Foam::List<T>::List(const UList<T>& a, const labelUList& map)
: :
@ -173,7 +165,6 @@ Foam::List<T>::List(const UList<T>& a, const labelUList& map)
} }
// Construct given start and end iterators.
template<class T> template<class T>
template<class InputIterator> template<class InputIterator>
Foam::List<T>::List(InputIterator first, InputIterator last) Foam::List<T>::List(InputIterator first, InputIterator last)
@ -205,7 +196,6 @@ Foam::List<T>::List(InputIterator first, InputIterator last)
} }
// Construct as copy of FixedList<T, Size>
template<class T> template<class T>
template<unsigned Size> template<unsigned Size>
Foam::List<T>::List(const FixedList<T, Size>& lst) Foam::List<T>::List(const FixedList<T, Size>& lst)
@ -224,7 +214,6 @@ Foam::List<T>::List(const FixedList<T, Size>& lst)
} }
// Construct as copy of PtrList<T>
template<class T> template<class T>
Foam::List<T>::List(const PtrList<T>& lst) Foam::List<T>::List(const PtrList<T>& lst)
: :
@ -242,7 +231,6 @@ Foam::List<T>::List(const PtrList<T>& lst)
} }
// Construct as copy of SLList<T>
template<class T> template<class T>
Foam::List<T>::List(const SLList<T>& lst) Foam::List<T>::List(const SLList<T>& lst)
: :
@ -266,7 +254,6 @@ Foam::List<T>::List(const SLList<T>& lst)
} }
// Construct as copy of UIndirectList<T>
template<class T> template<class T>
Foam::List<T>::List(const UIndirectList<T>& lst) Foam::List<T>::List(const UIndirectList<T>& lst)
: :
@ -284,7 +271,6 @@ Foam::List<T>::List(const UIndirectList<T>& lst)
} }
// Construct as copy of BiIndirectList<T>
template<class T> template<class T>
Foam::List<T>::List(const BiIndirectList<T>& lst) Foam::List<T>::List(const BiIndirectList<T>& lst)
: :
@ -304,7 +290,6 @@ Foam::List<T>::List(const BiIndirectList<T>& lst)
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
// Destroy list elements
template<class T> template<class T>
Foam::List<T>::~List() Foam::List<T>::~List()
{ {
@ -334,13 +319,13 @@ void Foam::List<T>::setSize(const label newSize)
{ {
label i = min(this->size_, newSize); label i = min(this->size_, newSize);
# ifdef USEMEMCPY #ifdef USEMEMCPY
if (contiguous<T>()) if (contiguous<T>())
{ {
memcpy(nv, this->v_, i*sizeof(T)); memcpy(nv, this->v_, i*sizeof(T));
} }
else else
# endif #endif
{ {
T* vv = &this->v_[i]; T* vv = &this->v_[i];
T* av = &nv[i]; T* av = &nv[i];
@ -384,8 +369,6 @@ void Foam::List<T>::clear()
} }
// Transfer the contents of the argument List into this List
// and annul the argument list
template<class T> template<class T>
void Foam::List<T>::transfer(List<T>& a) void Foam::List<T>::transfer(List<T>& a)
{ {
@ -398,25 +381,21 @@ void Foam::List<T>::transfer(List<T>& a)
} }
// Transfer the contents of the argument DynamicList into this List
// and annul the argument list
template<class T> template<class T>
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv> template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
void Foam::List<T>::transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>& a) void Foam::List<T>::transfer(DynamicList<T, SizeInc, SizeMult, SizeDiv>& a)
{ {
// shrink the allocated space to the number of elements used // Shrink the allocated space to the number of elements used
a.shrink(); a.shrink();
transfer(static_cast<List<T>&>(a)); transfer(static_cast<List<T>&>(a));
a.clearStorage(); a.clearStorage();
} }
// Transfer the contents of the argument SortableList into this List
// and annul the argument list
template<class T> template<class T>
void Foam::List<T>::transfer(SortableList<T>& a) void Foam::List<T>::transfer(SortableList<T>& a)
{ {
// shrink away the sort indices // Shrink away the sort indices
a.shrink(); a.shrink();
transfer(static_cast<List<T>&>(a)); transfer(static_cast<List<T>&>(a));
} }
@ -424,7 +403,6 @@ void Foam::List<T>::transfer(SortableList<T>& a)
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// Assignment to UList operator. Takes linear time.
template<class T> template<class T>
void Foam::List<T>::operator=(const UList<T>& a) void Foam::List<T>::operator=(const UList<T>& a)
{ {
@ -438,13 +416,13 @@ void Foam::List<T>::operator=(const UList<T>& a)
if (this->size_) if (this->size_)
{ {
# ifdef USEMEMCPY #ifdef USEMEMCPY
if (contiguous<T>()) if (contiguous<T>())
{ {
memcpy(this->v_, a.v_, this->byteSize()); memcpy(this->v_, a.v_, this->byteSize());
} }
else else
# endif #endif
{ {
List_ACCESS(T, (*this), vp); List_ACCESS(T, (*this), vp);
List_CONST_ACCESS(T, a, ap); List_CONST_ACCESS(T, a, ap);
@ -456,7 +434,6 @@ void Foam::List<T>::operator=(const UList<T>& a)
} }
// Assignment operator. Takes linear time.
template<class T> template<class T>
void Foam::List<T>::operator=(const List<T>& a) void Foam::List<T>::operator=(const List<T>& a)
{ {
@ -471,7 +448,6 @@ void Foam::List<T>::operator=(const List<T>& a)
} }
// Assignment operator. Takes linear time.
template<class T> template<class T>
void Foam::List<T>::operator=(const SLList<T>& lst) void Foam::List<T>::operator=(const SLList<T>& lst)
{ {
@ -499,7 +475,6 @@ void Foam::List<T>::operator=(const SLList<T>& lst)
} }
// Assignment operator. Takes linear time.
template<class T> template<class T>
void Foam::List<T>::operator=(const UIndirectList<T>& lst) void Foam::List<T>::operator=(const UIndirectList<T>& lst)
{ {
@ -518,7 +493,6 @@ void Foam::List<T>::operator=(const UIndirectList<T>& lst)
} }
// Assignment operator. Takes linear time.
template<class T> template<class T>
void Foam::List<T>::operator=(const BiIndirectList<T>& lst) void Foam::List<T>::operator=(const BiIndirectList<T>& lst)
{ {

View File

@ -112,7 +112,7 @@ public:
List(const Xfer<List<T>>&); List(const Xfer<List<T>>&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
List(List<T>&, bool reUse); List(List<T>&, bool reuse);
//- Construct as subset. //- Construct as subset.
List(const UList<T>&, const labelUList& mapAddressing); List(const UList<T>&, const labelUList& mapAddressing);

View File

@ -31,7 +31,6 @@ License
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
// Construct from Istream
template<class T> template<class T>
Foam::List<T>::List(Istream& is) Foam::List<T>::List(Istream& is)
: :
@ -173,12 +172,12 @@ Foam::List<T> Foam::readList(Istream& is)
<< exit(FatalIOError); << exit(FatalIOError);
} }
// read via a singly-linked list // Read via a singly-linked list
L = SLList<T>(is); L = SLList<T>(is);
} }
else else
{ {
// create list with a single item // Create list with a single item
L.setSize(1); L.setSize(1);
is >> L[0]; is >> L[0];

View File

@ -77,20 +77,11 @@ Foam::PtrList<T>::PtrList(const Xfer<PtrList<T>>& lst)
template<class T> template<class T>
Foam::PtrList<T>::PtrList(PtrList<T>& a, bool reUse) Foam::PtrList<T>::PtrList(PtrList<T>& a, bool reuse)
: :
ptrs_(a.size()) ptrs_(a.ptrs_, reuse)
{ {
if (reUse) if (!reuse)
{
forAll(*this, i)
{
ptrs_[i] = a.ptrs_[i];
a.ptrs_[i] = NULL;
}
a.setSize(0);
}
else
{ {
forAll(*this, i) forAll(*this, i)
{ {

View File

@ -161,7 +161,7 @@ public:
PtrList(const Xfer<PtrList<T>>&); PtrList(const Xfer<PtrList<T>>&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
PtrList(PtrList<T>&, bool reUse); PtrList(PtrList<T>&, bool reuse);
//- Construct as copy of SLPtrList<T> //- Construct as copy of SLPtrList<T>
explicit PtrList(const SLPtrList<T>&); explicit PtrList(const SLPtrList<T>&);

View File

@ -51,9 +51,9 @@ Foam::UPtrList<T>::UPtrList(const Xfer<UPtrList<T>>& lst)
template<class T> template<class T>
Foam::UPtrList<T>::UPtrList(UPtrList<T>& a, bool reUse) Foam::UPtrList<T>::UPtrList(UPtrList<T>& a, bool reuse)
: :
ptrs_(a.ptrs_, reUse) ptrs_(a.ptrs_, reuse)
{} {}

View File

@ -113,7 +113,7 @@ public:
UPtrList(const Xfer<UPtrList<T>>&); UPtrList(const Xfer<UPtrList<T>>&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
UPtrList(UPtrList<T>&, bool reUse); UPtrList(UPtrList<T>&, bool reuse);
// Member functions // Member functions

View File

@ -131,11 +131,11 @@ template<class Type, class GeoMesh>
DimensionedField<Type, GeoMesh>::DimensionedField DimensionedField<Type, GeoMesh>::DimensionedField
( (
DimensionedField<Type, GeoMesh>& df, DimensionedField<Type, GeoMesh>& df,
bool reUse bool reuse
) )
: :
regIOobject(df, reUse), regIOobject(df, reuse),
Field<Type>(df, reUse), Field<Type>(df, reuse),
mesh_(df.mesh_), mesh_(df.mesh_),
dimensions_(df.dimensions_) dimensions_(df.dimensions_)
{} {}
@ -194,11 +194,11 @@ DimensionedField<Type, GeoMesh>::DimensionedField
( (
const IOobject& io, const IOobject& io,
DimensionedField<Type, GeoMesh>& df, DimensionedField<Type, GeoMesh>& df,
bool reUse bool reuse
) )
: :
regIOobject(io, df), regIOobject(io, df),
Field<Type>(df, reUse), Field<Type>(df, reuse),
mesh_(df.mesh_), mesh_(df.mesh_),
dimensions_(df.dimensions_) dimensions_(df.dimensions_)
{} {}
@ -223,11 +223,11 @@ DimensionedField<Type, GeoMesh>::DimensionedField
( (
const word& newName, const word& newName,
DimensionedField<Type, GeoMesh>& df, DimensionedField<Type, GeoMesh>& df,
bool reUse bool reuse
) )
: :
regIOobject(newName, df, true), regIOobject(newName, df, true),
Field<Type>(df, reUse), Field<Type>(df, reuse),
mesh_(df.mesh_), mesh_(df.mesh_),
dimensions_(df.dimensions_) dimensions_(df.dimensions_)
{} {}

View File

@ -159,7 +159,7 @@ public:
DimensionedField DimensionedField
( (
DimensionedField<Type, GeoMesh>&, DimensionedField<Type, GeoMesh>&,
bool reUse bool reuse
); );
//- Construct by transferring the DimensionedField //- Construct by transferring the DimensionedField
@ -188,7 +188,7 @@ public:
( (
const IOobject&, const IOobject&,
DimensionedField<Type, GeoMesh>&, DimensionedField<Type, GeoMesh>&,
bool reUse bool reuse
); );
//- Construct as copy resetting name //- Construct as copy resetting name
@ -203,7 +203,7 @@ public:
( (
const word& newName, const word& newName,
DimensionedField<Type, GeoMesh>&, DimensionedField<Type, GeoMesh>&,
bool reUse bool reuse
); );
//- Construct by transferring the DimensionedField with a new name //- Construct by transferring the DimensionedField with a new name

View File

@ -143,10 +143,10 @@ FieldField<Field, Type>::FieldField(const FieldField<Field, Type>& f)
template<template<class> class Field, class Type> template<template<class> class Field, class Type>
FieldField<Field, Type>::FieldField(FieldField<Field, Type>& f, bool reUse) FieldField<Field, Type>::FieldField(FieldField<Field, Type>& f, bool reuse)
: :
refCount(), refCount(),
PtrList<Field<Type>>(f, reUse) PtrList<Field<Type>>(f, reuse)
{} {}
@ -157,7 +157,6 @@ FieldField<Field, Type>::FieldField(const PtrList<Field<Type>>& tl)
{} {}
// Construct as copy of tmp<FieldField>
#ifndef NoConstructFromTmp #ifndef NoConstructFromTmp
template<template<class> class Field, class Type> template<template<class> class Field, class Type>
FieldField<Field, Type>::FieldField(const tmp<FieldField<Field, Type>>& tf) FieldField<Field, Type>::FieldField(const tmp<FieldField<Field, Type>>& tf)
@ -168,7 +167,7 @@ FieldField<Field, Type>::FieldField(const tmp<FieldField<Field, Type>>& tf)
tf.isTmp() tf.isTmp()
) )
{ {
const_cast<FieldField<Field, Type>&>(tf()).resetRefCount(); tf.clear();
} }
#endif #endif

View File

@ -102,7 +102,7 @@ public:
FieldField(const FieldField<Field, Type>&); FieldField(const FieldField<Field, Type>&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
FieldField(FieldField<Field, Type>&, bool reUse); FieldField(FieldField<Field, Type>&, bool reuse);
//- Construct as copy of a PtrList<Field, Type> //- Construct as copy of a PtrList<Field, Type>
FieldField(const PtrList<Field<Type>>&); FieldField(const PtrList<Field<Type>>&);

View File

@ -63,7 +63,8 @@ public:
static tmp<FieldField<Field, TypeR>> New static tmp<FieldField<Field, TypeR>> New
( (
const tmp<FieldField<Field, TypeR>>& tf1 const tmp<FieldField<Field, TypeR>>& tf1,
const bool initRet = false
) )
{ {
if (tf1.isTmp()) if (tf1.isTmp())
@ -72,10 +73,17 @@ public:
} }
else else
{ {
return tmp<FieldField<Field, TypeR>> tmp<FieldField<Field, TypeR>> rtf
( (
FieldField<Field, TypeR>::NewCalculatedType(tf1()) FieldField<Field, TypeR>::NewCalculatedType(tf1())
); );
if (initRet)
{
rtf() = tf1();
}
return rtf;
} }
} }

View File

@ -202,9 +202,9 @@ Foam::Field<Type>::Field(const Field<Type>& f)
template<class Type> template<class Type>
Foam::Field<Type>::Field(Field<Type>& f, bool reUse) Foam::Field<Type>::Field(Field<Type>& f, bool reuse)
: :
List<Type>(f, reUse) List<Type>(f, reuse)
{} {}
@ -236,7 +236,7 @@ Foam::Field<Type>::Field(const tmp<Field<Type>>& tf)
: :
List<Type>(const_cast<Field<Type>&>(tf()), tf.isTmp()) List<Type>(const_cast<Field<Type>&>(tf()), tf.isTmp())
{ {
const_cast<Field<Type>&>(tf()).resetRefCount(); tf.clear();
} }
#endif #endif

View File

@ -205,7 +205,7 @@ public:
Field(const Field<Type>&); Field(const Field<Type>&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
Field(Field<Type>&, bool reUse); Field(Field<Type>&, bool reuse);
//- Construct by transferring the Field contents //- Construct by transferring the Field contents
Field(const Xfer<Field<Type>>&); Field(const Xfer<Field<Type>>&);

View File

@ -55,7 +55,11 @@ class reuseTmp<TypeR, TypeR>
{ {
public: public:
static tmp<Field<TypeR>> New(const tmp<Field<TypeR>>& tf1) static tmp<Field<TypeR>> New
(
const tmp<Field<TypeR>>& tf1,
const bool initRet = false
)
{ {
if (tf1.isTmp()) if (tf1.isTmp())
{ {
@ -63,7 +67,14 @@ public:
} }
else else
{ {
return tmp<Field<TypeR>>(new Field<TypeR>(tf1().size())); tmp<Field<TypeR>> rtf(new Field<TypeR>(tf1().size()));
if (initRet)
{
rtf() = tf1();
}
return rtf;
} }
} }

View File

@ -33,6 +33,48 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template
<
class Type,
template<class> class PatchField,
class GeoMesh
>
bool reusable(const tmp<GeometricField<Type, PatchField, GeoMesh>>& tgf)
{
if (tgf.isTmp())
{
if (GeometricField<Type, PatchField, GeoMesh>::debug)
{
const GeometricField<Type, PatchField, GeoMesh>& gf = tgf();
const typename GeometricField<Type, PatchField, GeoMesh>::
GeometricBoundaryField& gbf = gf.boundaryField();
forAll(gbf, patchi)
{
if
(
!polyPatch::constraintType(gbf[patchi].patch().type())
&& !isA<typename PatchField<Type>::Calculated>(gbf[patchi])
)
{
WarningInFunction
<< "Attempt to reuse temporary with non-reusable BC "
<< gbf[patchi].type() << endl;
return false;
}
}
}
return true;
}
else
{
return false;
}
}
template template
< <
class TypeR, class TypeR,
@ -46,12 +88,12 @@ public:
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
( (
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1,
const word& name, const word& name,
const dimensionSet& dimensions const dimensionSet& dimensions
) )
{ {
const GeometricField<Type1, PatchField, GeoMesh>& df1 = tdf1(); const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1();
return tmp<GeometricField<TypeR, PatchField, GeoMesh>> return tmp<GeometricField<TypeR, PatchField, GeoMesh>>
( (
@ -60,10 +102,10 @@ public:
IOobject IOobject
( (
name, name,
df1.instance(), gf1.instance(),
df1.db() gf1.db()
), ),
df1.mesh(), gf1.mesh(),
dimensions dimensions
) )
); );
@ -71,10 +113,10 @@ public:
static void clear static void clear
( (
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1 const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1
) )
{ {
tdf1.clear(); tgf1.clear();
} }
}; };
@ -86,47 +128,55 @@ public:
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
( (
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tdf1, const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf1,
const word& name, const word& name,
const dimensionSet& dimensions const dimensionSet& dimensions,
const bool initRet = false
) )
{ {
GeometricField<TypeR, PatchField, GeoMesh>& df1 = GeometricField<TypeR, PatchField, GeoMesh>& gf1 =
const_cast<GeometricField<TypeR, PatchField, GeoMesh>& >(tdf1()); const_cast<GeometricField<TypeR, PatchField, GeoMesh>& >(tgf1());
if (tdf1.isTmp()) if (reusable(tgf1))
{ {
df1.rename(name); gf1.rename(name);
df1.dimensions().reset(dimensions); gf1.dimensions().reset(dimensions);
return tdf1; return tgf1;
} }
else else
{ {
return tmp<GeometricField<TypeR, PatchField, GeoMesh>> tmp<GeometricField<TypeR, PatchField, GeoMesh>> rtgf
( (
new GeometricField<TypeR, PatchField, GeoMesh> new GeometricField<TypeR, PatchField, GeoMesh>
( (
IOobject IOobject
( (
name, name,
df1.instance(), gf1.instance(),
df1.db() gf1.db()
), ),
df1.mesh(), gf1.mesh(),
dimensions dimensions
) )
); );
if (initRet)
{
rtgf() == tgf1();
}
return rtgf;
} }
} }
static void clear static void clear
( (
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tdf1 const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf1
) )
{ {
if (tdf1.isTmp()) if (reusable(tgf1))
{ {
tdf1.ptr(); tgf1.ptr();
} }
} }
}; };
@ -147,13 +197,13 @@ public:
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
( (
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1,
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2, const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2,
const word& name, const word& name,
const dimensionSet& dimensions const dimensionSet& dimensions
) )
{ {
const GeometricField<Type1, PatchField, GeoMesh>& df1 = tdf1(); const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1();
return tmp<GeometricField<TypeR, PatchField, GeoMesh>> return tmp<GeometricField<TypeR, PatchField, GeoMesh>>
( (
@ -162,10 +212,10 @@ public:
IOobject IOobject
( (
name, name,
df1.instance(), gf1.instance(),
df1.db() gf1.db()
), ),
df1.mesh(), gf1.mesh(),
dimensions dimensions
) )
); );
@ -173,12 +223,12 @@ public:
static void clear static void clear
( (
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1,
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2
) )
{ {
tdf1.clear(); tgf1.clear();
tdf2.clear(); tgf2.clear();
} }
}; };
@ -198,21 +248,21 @@ public:
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
( (
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1,
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tdf2, const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf2,
const word& name, const word& name,
const dimensionSet& dimensions const dimensionSet& dimensions
) )
{ {
const GeometricField<Type1, PatchField, GeoMesh>& df1 = tdf1(); const GeometricField<Type1, PatchField, GeoMesh>& gf1 = tgf1();
GeometricField<TypeR, PatchField, GeoMesh>& df2 = GeometricField<TypeR, PatchField, GeoMesh>& gf2 =
const_cast<GeometricField<TypeR, PatchField, GeoMesh>& >(tdf2()); const_cast<GeometricField<TypeR, PatchField, GeoMesh>& >(tgf2());
if (tdf2.isTmp()) if (reusable(tgf2))
{ {
df2.rename(name); gf2.rename(name);
df2.dimensions().reset(dimensions); gf2.dimensions().reset(dimensions);
return tdf2; return tgf2;
} }
else else
{ {
@ -223,10 +273,10 @@ public:
IOobject IOobject
( (
name, name,
df1.instance(), gf1.instance(),
df1.db() gf1.db()
), ),
df1.mesh(), gf1.mesh(),
dimensions dimensions
) )
); );
@ -235,14 +285,14 @@ public:
static void clear static void clear
( (
const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tdf1, const tmp<GeometricField<Type1, PatchField, GeoMesh>>& tgf1,
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tdf2 const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf2
) )
{ {
tdf1.clear(); tgf1.clear();
if (tdf2.isTmp()) if (reusable(tgf2))
{ {
tdf2.ptr(); tgf2.ptr();
} }
} }
}; };
@ -261,20 +311,20 @@ public:
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
( (
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tdf1, const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf1,
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2, const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2,
const word& name, const word& name,
const dimensionSet& dimensions const dimensionSet& dimensions
) )
{ {
GeometricField<TypeR, PatchField, GeoMesh>& df1 = GeometricField<TypeR, PatchField, GeoMesh>& gf1 =
const_cast<GeometricField<TypeR, PatchField, GeoMesh>& >(tdf1()); const_cast<GeometricField<TypeR, PatchField, GeoMesh>& >(tgf1());
if (tdf1.isTmp()) if (reusable(tgf1))
{ {
df1.rename(name); gf1.rename(name);
df1.dimensions().reset(dimensions); gf1.dimensions().reset(dimensions);
return tdf1; return tgf1;
} }
else else
{ {
@ -285,10 +335,10 @@ public:
IOobject IOobject
( (
name, name,
df1.instance(), gf1.instance(),
df1.db() gf1.db()
), ),
df1.mesh(), gf1.mesh(),
dimensions dimensions
) )
); );
@ -297,15 +347,15 @@ public:
static void clear static void clear
( (
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tdf1, const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf1,
const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tdf2 const tmp<GeometricField<Type2, PatchField, GeoMesh>>& tgf2
) )
{ {
if (tdf1.isTmp()) if (reusable(tgf1))
{ {
tdf1.ptr(); tgf1.ptr();
} }
tdf2.clear(); tgf2.clear();
} }
}; };
@ -317,28 +367,28 @@ public:
static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New static tmp<GeometricField<TypeR, PatchField, GeoMesh>> New
( (
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tdf1, const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf1,
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tdf2, const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf2,
const word& name, const word& name,
const dimensionSet& dimensions const dimensionSet& dimensions
) )
{ {
GeometricField<TypeR, PatchField, GeoMesh>& df1 = GeometricField<TypeR, PatchField, GeoMesh>& gf1 =
const_cast<GeometricField<TypeR, PatchField, GeoMesh>& >(tdf1()); const_cast<GeometricField<TypeR, PatchField, GeoMesh>& >(tgf1());
GeometricField<TypeR, PatchField, GeoMesh>& df2 = GeometricField<TypeR, PatchField, GeoMesh>& gf2 =
const_cast<GeometricField<TypeR, PatchField, GeoMesh>& >(tdf2()); const_cast<GeometricField<TypeR, PatchField, GeoMesh>& >(tgf2());
if (tdf1.isTmp()) if (reusable(tgf1))
{ {
df1.rename(name); gf1.rename(name);
df1.dimensions().reset(dimensions); gf1.dimensions().reset(dimensions);
return tdf1; return tgf1;
} }
else if (tdf2.isTmp()) else if (reusable(tgf2))
{ {
df2.rename(name); gf2.rename(name);
df2.dimensions().reset(dimensions); gf2.dimensions().reset(dimensions);
return tdf2; return tgf2;
} }
else else
{ {
@ -349,10 +399,10 @@ public:
IOobject IOobject
( (
name, name,
df1.instance(), gf1.instance(),
df1.db() gf1.db()
), ),
df1.mesh(), gf1.mesh(),
dimensions dimensions
) )
); );
@ -361,19 +411,19 @@ public:
static void clear static void clear
( (
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tdf1, const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf1,
const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tdf2 const tmp<GeometricField<TypeR, PatchField, GeoMesh>>& tgf2
) )
{ {
if (tdf1.isTmp()) if (reusable(tgf1))
{ {
tdf1.ptr(); tgf1.ptr();
tdf2.clear(); tgf2.clear();
} }
else if (tdf2.isTmp()) else if (reusable(tgf2))
{ {
tdf1.clear(); tgf1.clear();
tdf2.ptr(); tgf2.ptr();
} }
} }
}; };

View File

@ -63,6 +63,9 @@ class pointMesh;
template<class Type> template<class Type>
class pointPatchField; class pointPatchField;
template<class Type>
class calculatedPointPatchField;
template<class Type> template<class Type>
Ostream& operator<< Ostream& operator<<
( (
@ -99,6 +102,7 @@ class pointPatchField
public: public:
typedef pointPatch Patch; typedef pointPatch Patch;
typedef calculatedPointPatchField<Type> Calculated;
//- Runtime type information //- Runtime type information
@ -239,8 +243,7 @@ public:
const dictionary& const dictionary&
); );
//- Return a pointer to a new calculatedPointPatchField created on
//- Return a pointer to a new CalculatedpointPatchField created on
// freestore without setting patchField values // freestore without setting patchField values
template<class Type2> template<class Type2>
static autoPtr<pointPatchField<Type>> static autoPtr<pointPatchField<Type>>

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -77,7 +77,7 @@ Foam::LduMatrix<Type, DType, LUType>::LduMatrix(const LduMatrix& A)
template<class Type, class DType, class LUType> template<class Type, class DType, class LUType>
Foam::LduMatrix<Type, DType, LUType>::LduMatrix(LduMatrix& A, bool reUse) Foam::LduMatrix<Type, DType, LUType>::LduMatrix(LduMatrix& A, bool reuse)
: :
lduMesh_(A.lduMesh_), lduMesh_(A.lduMesh_),
diagPtr_(NULL), diagPtr_(NULL),
@ -88,7 +88,7 @@ Foam::LduMatrix<Type, DType, LUType>::LduMatrix(LduMatrix& A, bool reUse)
interfacesUpper_(0), interfacesUpper_(0),
interfacesLower_(0) interfacesLower_(0)
{ {
if (reUse) if (reuse)
{ {
if (A.diagPtr_) if (A.diagPtr_)
{ {

View File

@ -470,7 +470,7 @@ public:
LduMatrix(const LduMatrix<Type, DType, LUType>&); LduMatrix(const LduMatrix<Type, DType, LUType>&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
LduMatrix(LduMatrix<Type, DType, LUType>&, bool reUse); LduMatrix(LduMatrix<Type, DType, LUType>&, bool reuse);
//- Construct given an LDU addressed mesh and an Istream //- Construct given an LDU addressed mesh and an Istream
// from which the coefficients are read // from which the coefficients are read

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -70,14 +70,14 @@ Foam::lduMatrix::lduMatrix(const lduMatrix& A)
} }
Foam::lduMatrix::lduMatrix(lduMatrix& A, bool reUse) Foam::lduMatrix::lduMatrix(lduMatrix& A, bool reuse)
: :
lduMesh_(A.lduMesh_), lduMesh_(A.lduMesh_),
lowerPtr_(NULL), lowerPtr_(NULL),
diagPtr_(NULL), diagPtr_(NULL),
upperPtr_(NULL) upperPtr_(NULL)
{ {
if (reUse) if (reuse)
{ {
if (A.lowerPtr_) if (A.lowerPtr_)
{ {

View File

@ -521,7 +521,7 @@ public:
lduMatrix(const lduMatrix&); lduMatrix(const lduMatrix&);
//- Construct as copy or re-use as specified. //- Construct as copy or re-use as specified.
lduMatrix(lduMatrix&, bool reUse); lduMatrix(lduMatrix&, bool reuse);
//- Construct given an LDU addressed mesh and an Istream //- Construct given an LDU addressed mesh and an Istream
// from which the coefficients are read // from which the coefficients are read

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -69,7 +69,7 @@ public:
//- Construct either by transferring pointer or cloning. Should //- Construct either by transferring pointer or cloning. Should
// only be called with type that supports cloning. // only be called with type that supports cloning.
inline autoPtr(const autoPtr<T>&, const bool reUse); inline autoPtr(const autoPtr<T>&, const bool reuse);
//- Destructor, delete object if pointer is not NULL //- Destructor, delete object if pointer is not NULL

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,9 +45,9 @@ inline Foam::autoPtr<T>::autoPtr(const autoPtr<T>& ap)
template<class T> template<class T>
inline Foam::autoPtr<T>::autoPtr(const autoPtr<T>& ap, const bool reUse) inline Foam::autoPtr<T>::autoPtr(const autoPtr<T>& ap, const bool reuse)
{ {
if (reUse) if (reuse)
{ {
ptr_ = ap.ptr_; ptr_ = ap.ptr_;
ap.ptr_ = 0; ap.ptr_ = 0;

View File

@ -100,7 +100,8 @@ public:
// Edit // Edit
//- Return tmp pointer for reuse //- Return tmp pointer for reuse.
// Returns a clone if the object is not a temporary
inline T* ptr() const; inline T* ptr() const;
//- If object pointer points to valid object: //- If object pointer points to valid object:

View File

@ -1,4 +1,4 @@
/*---------------------------------------------------------------------------*\ /*--------------------------------------------------------------------r-------*\
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
@ -171,7 +171,7 @@ inline T* Foam::tmp<T>::ptr() const
template<class T> template<class T>
inline void Foam::tmp<T>::clear() const inline void Foam::tmp<T>::clear() const
{ {
if (isTmp_ && ptr_) // skip this bit: && ptr_->okToDelete()) if (isTmp_ && ptr_) // Skip this bit: && ptr_->okToDelete())
{ {
delete ptr_; delete ptr_;
ptr_ = 0; ptr_ = 0;
@ -326,7 +326,7 @@ inline void Foam::tmp<T>::operator=(const tmp<T>& t)
} }
ptr_ = t.ptr_; ptr_ = t.ptr_;
t.ptr_ = 0; const_cast<tmp<T>&>(t).ptr_ = 0;
ptr_->resetRefCount(); ptr_->resetRefCount();
} }
else else

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -206,12 +206,12 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
labelList& l, labelList& l,
labelList& u, labelList& u,
const label comm, const label comm,
bool reUse bool reuse
) )
: :
lduAddressing(nCells), lduAddressing(nCells),
lowerAddr_(l, reUse), lowerAddr_(l, reuse),
upperAddr_(u, reUse), upperAddr_(u, reuse),
comm_(comm) comm_(comm)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -117,7 +117,7 @@ public:
labelList& l, labelList& l,
labelList& u, labelList& u,
const label comm, const label comm,
bool reUse bool reuse
); );
//- Add interfaces to a mesh constructed without //- Add interfaces to a mesh constructed without

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -143,38 +143,38 @@ Foam::mapPolyMesh::mapPolyMesh
labelList& oldPatchStarts, labelList& oldPatchStarts,
labelList& oldPatchNMeshPoints, labelList& oldPatchNMeshPoints,
autoPtr<scalarField>& oldCellVolumesPtr, autoPtr<scalarField>& oldCellVolumesPtr,
const bool reUse const bool reuse
) )
: :
mesh_(mesh), mesh_(mesh),
nOldPoints_(nOldPoints), nOldPoints_(nOldPoints),
nOldFaces_(nOldFaces), nOldFaces_(nOldFaces),
nOldCells_(nOldCells), nOldCells_(nOldCells),
pointMap_(pointMap, reUse), pointMap_(pointMap, reuse),
pointsFromPointsMap_(pointsFromPoints, reUse), pointsFromPointsMap_(pointsFromPoints, reuse),
faceMap_(faceMap, reUse), faceMap_(faceMap, reuse),
facesFromPointsMap_(facesFromPoints, reUse), facesFromPointsMap_(facesFromPoints, reuse),
facesFromEdgesMap_(facesFromEdges, reUse), facesFromEdgesMap_(facesFromEdges, reuse),
facesFromFacesMap_(facesFromFaces, reUse), facesFromFacesMap_(facesFromFaces, reuse),
cellMap_(cellMap, reUse), cellMap_(cellMap, reuse),
cellsFromPointsMap_(cellsFromPoints, reUse), cellsFromPointsMap_(cellsFromPoints, reuse),
cellsFromEdgesMap_(cellsFromEdges, reUse), cellsFromEdgesMap_(cellsFromEdges, reuse),
cellsFromFacesMap_(cellsFromFaces, reUse), cellsFromFacesMap_(cellsFromFaces, reuse),
cellsFromCellsMap_(cellsFromCells, reUse), cellsFromCellsMap_(cellsFromCells, reuse),
reversePointMap_(reversePointMap, reUse), reversePointMap_(reversePointMap, reuse),
reverseFaceMap_(reverseFaceMap, reUse), reverseFaceMap_(reverseFaceMap, reuse),
reverseCellMap_(reverseCellMap, reUse), reverseCellMap_(reverseCellMap, reuse),
flipFaceFlux_(flipFaceFlux), flipFaceFlux_(flipFaceFlux),
patchPointMap_(patchPointMap, reUse), patchPointMap_(patchPointMap, reuse),
pointZoneMap_(pointZoneMap, reUse), pointZoneMap_(pointZoneMap, reuse),
faceZonePointMap_(faceZonePointMap, reUse), faceZonePointMap_(faceZonePointMap, reuse),
faceZoneFaceMap_(faceZoneFaceMap, reUse), faceZoneFaceMap_(faceZoneFaceMap, reuse),
cellZoneMap_(cellZoneMap, reUse), cellZoneMap_(cellZoneMap, reuse),
preMotionPoints_(preMotionPoints, reUse), preMotionPoints_(preMotionPoints, reuse),
oldPatchSizes_(oldPatchStarts.size()), oldPatchSizes_(oldPatchStarts.size()),
oldPatchStarts_(oldPatchStarts, reUse), oldPatchStarts_(oldPatchStarts, reuse),
oldPatchNMeshPoints_(oldPatchNMeshPoints, reUse), oldPatchNMeshPoints_(oldPatchNMeshPoints, reuse),
oldCellVolumesPtr_(oldCellVolumesPtr, reUse) oldCellVolumesPtr_(oldCellVolumesPtr, reuse)
{ {
if (oldPatchStarts_.size() > 0) if (oldPatchStarts_.size() > 0)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -349,7 +349,7 @@ public:
labelList& oldPatchStarts, labelList& oldPatchStarts,
labelList& oldPatchNMeshPoints, labelList& oldPatchNMeshPoints,
autoPtr<scalarField>& oldCellVolumesPtr, autoPtr<scalarField>& oldCellVolumesPtr,
const bool reUse const bool reuse
); );
// Member Functions // Member Functions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -112,7 +112,7 @@ public:
const label exposedPatchID, const label exposedPatchID,
labelList& oldPatchStarts, labelList& oldPatchStarts,
labelList& oldPatchNMeshPoints, labelList& oldPatchNMeshPoints,
const bool reUse const bool reuse
); );

View File

@ -111,11 +111,11 @@ PrimitivePatch
( (
FaceList<Face>& faces, FaceList<Face>& faces,
Field<PointType>& points, Field<PointType>& points,
const bool reUse const bool reuse
) )
: :
FaceList<Face>(faces, reUse), FaceList<Face>(faces, reuse),
points_(points, reUse), points_(points, reuse),
edgesPtr_(NULL), edgesPtr_(NULL),
nInternalEdges_(-1), nInternalEdges_(-1),
boundaryPointsPtr_(NULL), boundaryPointsPtr_(NULL),

View File

@ -255,7 +255,7 @@ public:
( (
FaceList<Face>& faces, FaceList<Face>& faces,
Field<PointType>& points, Field<PointType>& points,
const bool reUse const bool reuse
); );
//- Construct as copy //- Construct as copy

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -151,8 +151,7 @@ Foam::combustionModels::laminar<Type>::dQ() const
false false
), ),
this->mesh(), this->mesh(),
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0), dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
zeroGradientFvPatchScalarField::typeName
) )
); );
@ -183,8 +182,7 @@ Foam::combustionModels::laminar<Type>::Sh() const
false false
), ),
this->mesh(), this->mesh(),
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0), dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0)
zeroGradientFvPatchScalarField::typeName
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -90,8 +90,7 @@ Foam::combustionModels::noCombustion<CombThermoType>::dQ() const
false false
), ),
this->mesh(), this->mesh(),
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0), dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
zeroGradientFvPatchScalarField::typeName
) )
); );
@ -117,8 +116,7 @@ Foam::combustionModels::noCombustion<CombThermoType>::Sh() const
false false
), ),
this->mesh(), this->mesh(),
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0), dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0)
zeroGradientFvPatchScalarField::typeName
) )
); );

View File

@ -154,8 +154,7 @@ singleStepCombustion<CombThermoType, ThermoType>::dQ() const
false false
), ),
this->mesh_, this->mesh_,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0), dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
zeroGradientFvPatchScalarField::typeName
) )
); );

View File

@ -99,6 +99,7 @@ $(fvPatchFields)/fvPatchField/fvPatchFields.C
basicFvPatchFields = $(fvPatchFields)/basic basicFvPatchFields = $(fvPatchFields)/basic
$(basicFvPatchFields)/basicSymmetry/basicSymmetryFvPatchScalarField.C $(basicFvPatchFields)/basicSymmetry/basicSymmetryFvPatchScalarField.C
$(basicFvPatchFields)/calculated/calculatedFvPatchFields.C $(basicFvPatchFields)/calculated/calculatedFvPatchFields.C
$(basicFvPatchFields)/extrapolatedCalculated/extrapolatedCalculatedFvPatchFields.C
$(basicFvPatchFields)/coupled/coupledFvPatchFields.C $(basicFvPatchFields)/coupled/coupledFvPatchFields.C
$(basicFvPatchFields)/directionMixed/directionMixedFvPatchFields.C $(basicFvPatchFields)/directionMixed/directionMixedFvPatchFields.C
$(basicFvPatchFields)/fixedGradient/fixedGradientFvPatchFields.C $(basicFvPatchFields)/fixedGradient/fixedGradientFvPatchFields.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,6 +31,7 @@ License
#include "fvmLaplacian.H" #include "fvmLaplacian.H"
#include "fvcDiv.H" #include "fvcDiv.H"
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"
#include "zeroGradientFvPatchFields.H"
#include "adjustPhi.H" #include "adjustPhi.H"
#include "fvcMeshPhi.H" #include "fvcMeshPhi.H"
#include "pimpleControl.H" #include "pimpleControl.H"

View File

@ -221,47 +221,93 @@ void Foam::MRFZoneList::makeRelative(surfaceScalarField& phi) const
Foam::tmp<Foam::surfaceScalarField> Foam::MRFZoneList::relative Foam::tmp<Foam::surfaceScalarField> Foam::MRFZoneList::relative
( (
const tmp<surfaceScalarField>& phi const tmp<surfaceScalarField>& tphi
) const ) const
{ {
tmp<surfaceScalarField> rphi(phi.ptr()); if (size())
makeRelative(rphi()); {
return rphi; tmp<surfaceScalarField> rphi
(
reuseTmpGeometricField<scalar, scalar, fvsPatchField, surfaceMesh>
::New
(
tphi,
"relative(" + tphi().name() + ')',
tphi().dimensions(),
true
)
);
makeRelative(rphi());
reuseTmpGeometricField<scalar, scalar, fvsPatchField, surfaceMesh>
::clear(tphi);
return rphi;
}
else
{
return tmp<surfaceScalarField>(tphi, true);
}
} }
Foam::tmp<Foam::FieldField<Foam::fvsPatchField, Foam::scalar>> Foam::tmp<Foam::FieldField<Foam::fvsPatchField, Foam::scalar>>
Foam::MRFZoneList::relative Foam::MRFZoneList::relative
( (
const tmp<FieldField<fvsPatchField, scalar>>& phi const tmp<FieldField<fvsPatchField, scalar>>& tphi
) const ) const
{ {
tmp<FieldField<fvsPatchField, scalar>> rphi(phi.ptr()); if (size())
forAll(*this, i)
{ {
operator[](i).makeRelative(rphi()); tmp<FieldField<fvsPatchField, scalar>> rphi
} (
reuseTmpFieldField<fvsPatchField, scalar, scalar>::New(tphi, true)
);
return rphi; forAll(*this, i)
{
operator[](i).makeRelative(rphi());
}
reuseTmpFieldField<fvsPatchField, scalar, scalar>::clear(tphi);
return rphi;
}
else
{
return tmp<FieldField<fvsPatchField, scalar>>(tphi, true);
}
} }
Foam::tmp<Foam::Field<Foam::scalar>> Foam::tmp<Foam::Field<Foam::scalar>>
Foam::MRFZoneList::relative Foam::MRFZoneList::relative
( (
const tmp<Field<scalar>>& phi, const tmp<Field<scalar>>& tphi,
const label patchi const label patchi
) const ) const
{ {
tmp<Field<scalar>> rphi(phi.ptr()); if (size())
forAll(*this, i)
{ {
operator[](i).makeRelative(rphi(), patchi); tmp<Field<scalar>> rphi
} (
reuseTmp<scalar, scalar>::New(tphi, true)
);
return rphi; forAll(*this, i)
{
operator[](i).makeRelative(rphi(), patchi);
}
reuseTmp<scalar, scalar>::clear(tphi);
return rphi;
}
else
{
return tmp<Field<scalar>>(tphi, true);
}
} }
@ -298,12 +344,34 @@ void Foam::MRFZoneList::makeAbsolute(surfaceScalarField& phi) const
Foam::tmp<Foam::surfaceScalarField> Foam::MRFZoneList::absolute Foam::tmp<Foam::surfaceScalarField> Foam::MRFZoneList::absolute
( (
const tmp<surfaceScalarField>& phi const tmp<surfaceScalarField>& tphi
) const ) const
{ {
tmp<surfaceScalarField> rphi(phi.ptr()); if (size())
makeAbsolute(rphi()); {
return rphi; tmp<surfaceScalarField> rphi
(
reuseTmpGeometricField<scalar, scalar, fvsPatchField, surfaceMesh>
::New
(
tphi,
"absolute(" + tphi().name() + ')',
tphi().dimensions(),
true
)
);
makeAbsolute(rphi());
reuseTmpGeometricField<scalar, scalar, fvsPatchField, surfaceMesh>
::clear(tphi);
return rphi;
}
else
{
return tmp<surfaceScalarField>(tphi, true);
}
} }

View File

@ -20,7 +20,7 @@ if (LTS)
), ),
mesh, mesh,
dimensionedScalar("one", dimless/dimTime, 1), dimensionedScalar("one", dimless/dimTime, 1),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
} }

View File

@ -11,7 +11,9 @@
#include "linear.H" #include "linear.H"
#include "uniformDimensionedFields.H" #include "uniformDimensionedFields.H"
#include "calculatedFvPatchFields.H" #include "calculatedFvPatchFields.H"
#include "extrapolatedCalculatedFvPatchFields.H"
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"
#include "zeroGradientFvPatchFields.H"
#include "fixedFluxPressureFvPatchScalarField.H" #include "fixedFluxPressureFvPatchScalarField.H"
#include "constrainHbyA.H" #include "constrainHbyA.H"
#include "constrainPressure.H" #include "constrainPressure.H"

View File

@ -48,19 +48,6 @@ Foam::calculatedFvPatchField<Type>::calculatedFvPatchField
{} {}
template<class Type>
Foam::calculatedFvPatchField<Type>::calculatedFvPatchField
(
const calculatedFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type> template<class Type>
Foam::calculatedFvPatchField<Type>::calculatedFvPatchField Foam::calculatedFvPatchField<Type>::calculatedFvPatchField
( (
@ -74,6 +61,19 @@ Foam::calculatedFvPatchField<Type>::calculatedFvPatchField
{} {}
template<class Type>
Foam::calculatedFvPatchField<Type>::calculatedFvPatchField
(
const calculatedFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type> template<class Type>
Foam::calculatedFvPatchField<Type>::calculatedFvPatchField Foam::calculatedFvPatchField<Type>::calculatedFvPatchField
( (
@ -154,7 +154,7 @@ Foam::calculatedFvPatchField<Type>::valueInternalCoeffs
<< " in file " << this->dimensionedInternalField().objectPath() << " in file " << this->dimensionedInternalField().objectPath()
<< "\n You are probably trying to solve for a field with a " << "\n You are probably trying to solve for a field with a "
"default boundary condition." "default boundary condition."
<< exit(FatalError); << abort(FatalError);
return *this; return *this;
} }
@ -174,7 +174,7 @@ Foam::calculatedFvPatchField<Type>::valueBoundaryCoeffs
<< " in file " << this->dimensionedInternalField().objectPath() << " in file " << this->dimensionedInternalField().objectPath()
<< "\n You are probably trying to solve for a field with a " << "\n You are probably trying to solve for a field with a "
"default boundary condition." "default boundary condition."
<< exit(FatalError); << abort(FatalError);
return *this; return *this;
} }
@ -191,7 +191,7 @@ Foam::calculatedFvPatchField<Type>::gradientInternalCoeffs() const
<< " in file " << this->dimensionedInternalField().objectPath() << " in file " << this->dimensionedInternalField().objectPath()
<< "\n You are probably trying to solve for a field with a " << "\n You are probably trying to solve for a field with a "
"default boundary condition." "default boundary condition."
<< exit(FatalError); << abort(FatalError);
return *this; return *this;
} }
@ -208,7 +208,7 @@ Foam::calculatedFvPatchField<Type>::gradientBoundaryCoeffs() const
<< " in file " << this->dimensionedInternalField().objectPath() << " in file " << this->dimensionedInternalField().objectPath()
<< "\n You are probably trying to solve for a field with a " << "\n You are probably trying to solve for a field with a "
"default boundary condition." "default boundary condition."
<< exit(FatalError); << abort(FatalError);
return *this; return *this;
} }

View File

@ -0,0 +1,112 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "extrapolatedCalculatedFvPatchField.H"
#include "fvPatchFieldMapper.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::extrapolatedCalculatedFvPatchField<Type>::
extrapolatedCalculatedFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
calculatedFvPatchField<Type>(p, iF)
{}
template<class Type>
Foam::extrapolatedCalculatedFvPatchField<Type>::
extrapolatedCalculatedFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict,
const bool valueRequired
)
:
calculatedFvPatchField<Type>(p, iF, dict, valueRequired)
{}
template<class Type>
Foam::extrapolatedCalculatedFvPatchField<Type>::
extrapolatedCalculatedFvPatchField
(
const extrapolatedCalculatedFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
calculatedFvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
Foam::extrapolatedCalculatedFvPatchField<Type>::
extrapolatedCalculatedFvPatchField
(
const extrapolatedCalculatedFvPatchField<Type>& ptf
)
:
calculatedFvPatchField<Type>(ptf)
{}
template<class Type>
Foam::extrapolatedCalculatedFvPatchField<Type>::
extrapolatedCalculatedFvPatchField
(
const extrapolatedCalculatedFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
calculatedFvPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::extrapolatedCalculatedFvPatchField<Type>::evaluate
(
const Pstream::commsTypes
)
{
if (!this->updated())
{
this->updateCoeffs();
}
calculatedFvPatchField<Type>::operator==(this->patchInternalField());
calculatedFvPatchField<Type>::evaluate();
}
// ************************************************************************* //

View File

@ -0,0 +1,165 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::extrapolatedCalculatedFvPatchField
Group
grpGenericBoundaryConditions
Description
This boundary condition applies a zero-gradient condition from the patch
internal field onto the patch faces when \c evaluated but may also be
assigned. \c snGrad returns the patch gradient evaluated from the current
internal and patch field values rather than returning zero.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type extrapolatedCalculated;
}
\endverbatim
SourceFiles
extrapolatedCalculatedFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef extrapolatedCalculatedFvPatchField_H
#define extrapolatedCalculatedFvPatchField_H
#include "calculatedFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class extrapolatedCalculatedFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class extrapolatedCalculatedFvPatchField
:
public calculatedFvPatchField<Type>
{
public:
//- Runtime type information
TypeName("extrapolatedCalculated");
// Constructors
//- Construct from patch and internal field
extrapolatedCalculatedFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
extrapolatedCalculatedFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&,
const bool valueRequired=false
);
//- Construct by mapping given patchField<Type> onto a new patch
extrapolatedCalculatedFvPatchField
(
const extrapolatedCalculatedFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
extrapolatedCalculatedFvPatchField
(
const extrapolatedCalculatedFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type>> clone() const
{
return tmp<fvPatchField<Type>>
(
new extrapolatedCalculatedFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
extrapolatedCalculatedFvPatchField
(
const extrapolatedCalculatedFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type>> clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type>>
(
new extrapolatedCalculatedFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Evaluate the patch field
virtual void evaluate
(
const Pstream::commsTypes commsType=Pstream::blocking
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "extrapolatedCalculatedFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "extrapolatedCalculatedFvPatchFields.H"
#include "fvPatchFields.H"
#include "volMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(extrapolatedCalculated);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef extrapolatedCalculatedFvPatchFields_H
#define extrapolatedCalculatedFvPatchFields_H
#include "extrapolatedCalculatedFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(extrapolatedCalculated);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef extrapolatedCalculatedFvPatchFieldsFwd_H
#define extrapolatedCalculatedFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class extrapolatedCalculatedFvPatchField;
makePatchTypeFieldTypedefs(extrapolatedCalculated);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -65,6 +65,9 @@ class volMesh;
template<class Type> template<class Type>
class fvPatchField; class fvPatchField;
template<class Type>
class calculatedFvPatchField;
template<class Type> template<class Type>
class fvMatrix; class fvMatrix;
@ -106,6 +109,7 @@ class fvPatchField
public: public:
typedef fvPatch Patch; typedef fvPatch Patch;
typedef calculatedFvPatchField<Type> Calculated;
//- Runtime type information //- Runtime type information

View File

@ -65,6 +65,9 @@ class surfaceMesh;
template<class Type> template<class Type>
class fvsPatchField; class fvsPatchField;
template<class Type>
class calculatedFvsPatchField;
template<class Type> template<class Type>
Ostream& operator<<(Ostream&, const fvsPatchField<Type>&); Ostream& operator<<(Ostream&, const fvsPatchField<Type>&);
@ -90,6 +93,7 @@ class fvsPatchField
public: public:
typedef fvPatch Patch; typedef fvPatch Patch;
typedef calculatedFvsPatchField<Type> Calculated;
//- Runtime type information //- Runtime type information

View File

@ -57,7 +57,7 @@ tmp<volScalarField> CoEulerDdtScheme<Type>::CorDeltaT() const
), ),
mesh(), mesh(),
dimensionedScalar("CorDeltaT", cofrDeltaT.dimensions(), 0.0), dimensionedScalar("CorDeltaT", cofrDeltaT.dimensions(), 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );

View File

@ -107,7 +107,7 @@ tmp<volScalarField> SLTSDdtScheme<Type>::SLrDeltaT() const
), ),
mesh(), mesh(),
dimensionedScalar("rDeltaT", dimless/dimTime, 0.0), dimensionedScalar("rDeltaT", dimless/dimTime, 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );

View File

@ -27,7 +27,7 @@ License
#include "fvMesh.H" #include "fvMesh.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "zeroGradientFvPatchFields.H" #include "extrapolatedCalculatedFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,7 +66,7 @@ tmp<GeometricField<Type, fvPatchField, volMesh>> cellReduce
), ),
mesh, mesh,
dimensioned<Type>("0", ssf.dimensions(), pTraits<Type>::zero), dimensioned<Type>("0", ssf.dimensions(), pTraits<Type>::zero),
zeroGradientFvPatchField<Type>::typeName extrapolatedCalculatedFvPatchField<Type>::typeName
) )
); );

View File

@ -28,7 +28,7 @@ License
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "fvcSurfaceIntegrate.H" #include "fvcSurfaceIntegrate.H"
#include "zeroGradientFvPatchFields.H" #include "extrapolatedCalculatedFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -74,7 +74,7 @@ reconstruct
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
inv(surfaceSum(SfHat*mesh.Sf()))&surfaceSum(SfHat*ssf), inv(surfaceSum(SfHat*mesh.Sf()))&surfaceSum(SfHat*ssf),
zeroGradientFvPatchField<GradType>::typeName extrapolatedCalculatedFvPatchField<GradType>::typeName
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -27,7 +27,7 @@ License
#include "fvMesh.H" #include "fvMesh.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "zeroGradientFvPatchFields.H" #include "extrapolatedCalculatedFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -72,7 +72,7 @@ tmp<volScalarField> reconstructMag(const surfaceScalarField& ssf)
ssf.dimensions()/dimArea, ssf.dimensions()/dimArea,
scalar(0) scalar(0)
), ),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );

View File

@ -25,7 +25,7 @@ License
#include "fvcReconstruct.H" #include "fvcReconstruct.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "zeroGradientFvPatchFields.H" #include "extrapolatedCalculatedFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -81,7 +81,7 @@ reconstruct
ssf.dimensions()/dimArea, ssf.dimensions()/dimArea,
pTraits<GradType>::zero pTraits<GradType>::zero
), ),
zeroGradientFvPatchField<GradType>::typeName extrapolatedCalculatedFvPatchField<GradType>::typeName
) )
); );

View File

@ -25,7 +25,7 @@ License
#include "fvcSurfaceIntegrate.H" #include "fvcSurfaceIntegrate.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "zeroGradientFvPatchFields.H" #include "extrapolatedCalculatedFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -104,7 +104,7 @@ surfaceIntegrate
ssf.dimensions()/dimVol, ssf.dimensions()/dimVol,
pTraits<Type>::zero pTraits<Type>::zero
), ),
zeroGradientFvPatchField<Type>::typeName extrapolatedCalculatedFvPatchField<Type>::typeName
) )
); );
GeometricField<Type, fvPatchField, volMesh>& vf = tvf(); GeometricField<Type, fvPatchField, volMesh>& vf = tvf();
@ -155,7 +155,7 @@ surfaceSum
), ),
mesh, mesh,
dimensioned<Type>("0", ssf.dimensions(), pTraits<Type>::zero), dimensioned<Type>("0", ssf.dimensions(), pTraits<Type>::zero),
zeroGradientFvPatchField<Type>::typeName extrapolatedCalculatedFvPatchField<Type>::typeName
) )
); );
GeometricField<Type, fvPatchField, volMesh>& vf = tvf(); GeometricField<Type, fvPatchField, volMesh>& vf = tvf();

View File

@ -28,7 +28,7 @@ License
#include "gaussGrad.H" #include "gaussGrad.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "volMesh.H" #include "volMesh.H"
#include "zeroGradientFvPatchField.H" #include "extrapolatedCalculatedFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -77,7 +77,7 @@ Foam::fv::LeastSquaresGrad<Type, Stencil>::calcGrad
vtf.dimensions()/dimLength, vtf.dimensions()/dimLength,
pTraits<GradType>::zero pTraits<GradType>::zero
), ),
zeroGradientFvPatchField<GradType>::typeName extrapolatedCalculatedFvPatchField<GradType>::typeName
) )
); );
GeometricField<GradType, fvPatchField, volMesh>& lsGrad = tlsGrad(); GeometricField<GradType, fvPatchField, volMesh>& lsGrad = tlsGrad();

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "gaussGrad.H" #include "gaussGrad.H"
#include "zeroGradientFvPatchField.H" #include "extrapolatedCalculatedFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -67,7 +67,7 @@ Foam::fv::gaussGrad<Type>::gradf
ssf.dimensions()/dimLength, ssf.dimensions()/dimLength,
pTraits<GradType>::zero pTraits<GradType>::zero
), ),
zeroGradientFvPatchField<GradType>::typeName extrapolatedCalculatedFvPatchField<GradType>::typeName
) )
); );
GeometricField<GradType, fvPatchField, volMesh>& gGrad = tgGrad(); GeometricField<GradType, fvPatchField, volMesh>& gGrad = tgGrad();

View File

@ -30,7 +30,7 @@ License
#include "volMesh.H" #include "volMesh.H"
#include "surfaceMesh.H" #include "surfaceMesh.H"
#include "GeometricField.H" #include "GeometricField.H"
#include "zeroGradientFvPatchField.H" #include "extrapolatedCalculatedFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -73,7 +73,7 @@ Foam::fv::leastSquaresGrad<Type>::calcGrad
vsf.dimensions()/dimLength, vsf.dimensions()/dimLength,
pTraits<GradType>::zero pTraits<GradType>::zero
), ),
zeroGradientFvPatchField<GradType>::typeName extrapolatedCalculatedFvPatchField<GradType>::typeName
) )
); );
GeometricField<GradType, fvPatchField, volMesh>& lsGrad = tlsGrad(); GeometricField<GradType, fvPatchField, volMesh>& lsGrad = tlsGrad();

View File

@ -26,7 +26,7 @@ License
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "calculatedFvPatchFields.H" #include "calculatedFvPatchFields.H"
#include "zeroGradientFvPatchFields.H" #include "extrapolatedCalculatedFvPatchFields.H"
#include "coupledFvPatchFields.H" #include "coupledFvPatchFields.H"
#include "UIndirectList.H" #include "UIndirectList.H"
@ -739,7 +739,7 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::A() const
), ),
psi_.mesh(), psi_.mesh(),
dimensions_/psi_.dimensions()/dimVol, dimensions_/psi_.dimensions()/dimVol,
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
@ -768,7 +768,7 @@ Foam::fvMatrix<Type>::H() const
), ),
psi_.mesh(), psi_.mesh(),
dimensions_/dimVol, dimensions_/dimVol,
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
GeometricField<Type, fvPatchField, volMesh>& Hphi = tHphi(); GeometricField<Type, fvPatchField, volMesh>& Hphi = tHphi();
@ -830,7 +830,7 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::H1() const
), ),
psi_.mesh(), psi_.mesh(),
dimensions_/(dimVol*psi_.dimensions()), dimensions_/(dimVol*psi_.dimensions()),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
volScalarField& H1_ = tH1(); volScalarField& H1_ = tH1();
@ -2274,7 +2274,7 @@ Foam::operator&
), ),
psi.mesh(), psi.mesh(),
M.dimensions()/dimVol, M.dimensions()/dimVol,
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
GeometricField<Type, fvPatchField, volMesh>& Mphi = tMphi(); GeometricField<Type, fvPatchField, volMesh>& Mphi = tMphi();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvScalarMatrix.H" #include "fvScalarMatrix.H"
#include "zeroGradientFvPatchFields.H" #include "extrapolatedCalculatedFvPatchFields.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -224,7 +224,7 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Foam::scalar>::H() const
), ),
psi_.mesh(), psi_.mesh(),
dimensions_/dimVol, dimensions_/dimVol,
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
volScalarField& Hphi = tHphi(); volScalarField& Hphi = tHphi();
@ -256,7 +256,7 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Foam::scalar>::H1() const
), ),
psi_.mesh(), psi_.mesh(),
dimensions_/(dimVol*psi_.dimensions()), dimensions_/(dimVol*psi_.dimensions()),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
volScalarField& H1_ = tH1(); volScalarField& H1_ = tH1();

View File

@ -73,7 +73,7 @@ SourceFiles
#include "surfaceInterpolationScheme.H" #include "surfaceInterpolationScheme.H"
#include "blendedSchemeBase.H" #include "blendedSchemeBase.H"
#include "surfaceInterpolate.H" #include "surfaceInterpolate.H"
#include "zeroGradientFvPatchFields.H" #include "extrapolatedCalculatedFvPatchFields.H"
#include "fvcSurfaceIntegrate.H" #include "fvcSurfaceIntegrate.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -230,7 +230,7 @@ public:
), ),
mesh, mesh,
dimensionedScalar("Co", dimless, 0), dimensionedScalar("Co", dimless, 0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
); );
scalarField sumPhi scalarField sumPhi

View File

@ -44,6 +44,7 @@ SourceFiles
#include "skewCorrectionVectors.H" #include "skewCorrectionVectors.H"
#include "linear.H" #include "linear.H"
#include "gaussGrad.H" #include "gaussGrad.H"
#include "zeroGradientFvPatchField.H"
#include "mixedFvPatchField.H" #include "mixedFvPatchField.H"
#include "directionMixedFvPatchField.H" #include "directionMixedFvPatchField.H"

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -28,6 +28,7 @@ License
#include "basicThermo.H" #include "basicThermo.H"
#include "uniformDimensionedFields.H" #include "uniformDimensionedFields.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
#include "extrapolatedCalculatedFvPatchFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "geometricOneField.H" #include "geometricOneField.H"
@ -103,7 +104,7 @@ Foam::fv::solidificationMeltingSource::Cp() const
dimEnergy/dimMass/dimTemperature, dimEnergy/dimMass/dimTemperature,
CpRef CpRef
), ),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
} }

View File

@ -702,7 +702,7 @@ Foam::genericFvPatchField<Type>::valueInternalCoeffs
<< " in file " << this->dimensionedInternalField().objectPath() << " in file " << this->dimensionedInternalField().objectPath()
<< "\n You are probably trying to solve for a field with a " << "\n You are probably trying to solve for a field with a "
"generic boundary condition." "generic boundary condition."
<< exit(FatalError); << abort(FatalError);
return *this; return *this;
} }
@ -723,7 +723,7 @@ Foam::genericFvPatchField<Type>::valueBoundaryCoeffs
<< " in file " << this->dimensionedInternalField().objectPath() << " in file " << this->dimensionedInternalField().objectPath()
<< "\n You are probably trying to solve for a field with a " << "\n You are probably trying to solve for a field with a "
"generic boundary condition." "generic boundary condition."
<< exit(FatalError); << abort(FatalError);
return *this; return *this;
} }
@ -741,7 +741,7 @@ Foam::genericFvPatchField<Type>::gradientInternalCoeffs() const
<< " in file " << this->dimensionedInternalField().objectPath() << " in file " << this->dimensionedInternalField().objectPath()
<< "\n You are probably trying to solve for a field with a " << "\n You are probably trying to solve for a field with a "
"generic boundary condition." "generic boundary condition."
<< exit(FatalError); << abort(FatalError);
return *this; return *this;
} }
@ -758,7 +758,7 @@ Foam::genericFvPatchField<Type>::gradientBoundaryCoeffs() const
<< " in file " << this->dimensionedInternalField().objectPath() << " in file " << this->dimensionedInternalField().objectPath()
<< "\n You are probably trying to solve for a field with a " << "\n You are probably trying to solve for a field with a "
"generic boundary condition." "generic boundary condition."
<< exit(FatalError); << abort(FatalError);
return *this; return *this;
} }

View File

@ -470,7 +470,7 @@ Foam::KinematicCloud<CloudType>::vDotSweep() const
), ),
mesh_, mesh_,
dimensionedScalar("zero", dimless/dimTime, 0.0), dimensionedScalar("zero", dimless/dimTime, 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
@ -509,7 +509,7 @@ Foam::KinematicCloud<CloudType>::theta() const
), ),
mesh_, mesh_,
dimensionedScalar("zero", dimless, 0.0), dimensionedScalar("zero", dimless, 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "Basic.H" #include "Basic.H"
#include "zeroGradientFvPatchField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -30,6 +30,7 @@ License
#include "fvmLaplacian.H" #include "fvmLaplacian.H"
#include "fvcReconstruct.H" #include "fvcReconstruct.H"
#include "volPointInterpolation.H" #include "volPointInterpolation.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -43,8 +44,17 @@ Foam::PackingModels::Implicit<CloudType>::Implicit
PackingModel<CloudType>(dict, owner, typeName), PackingModel<CloudType>(dict, owner, typeName),
alpha_ alpha_
( (
this->owner().name() + ":alpha", IOobject
this->owner().theta() (
this->owner().name() + ":alpha",
this->owner().db().time().timeName(),
this->owner().mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->owner().mesh(),
dimensionedScalar("zero", dimless, 0.0),
zeroGradientFvPatchScalarField::typeName
), ),
phiCorrect_(NULL), phiCorrect_(NULL),
uCorrect_(NULL), uCorrect_(NULL),
@ -53,6 +63,7 @@ Foam::PackingModels::Implicit<CloudType>::Implicit
alphaMin_(readScalar(this->coeffDict().lookup("alphaMin"))), alphaMin_(readScalar(this->coeffDict().lookup("alphaMin"))),
rhoMin_(readScalar(this->coeffDict().lookup("rhoMin"))) rhoMin_(readScalar(this->coeffDict().lookup("rhoMin")))
{ {
alpha_ = this->owner().theta();
alpha_.oldTime(); alpha_.oldTime();
} }

View File

@ -54,7 +54,6 @@ License
#include "Random.H" #include "Random.H"
#include "searchableSurfaces.H" #include "searchableSurfaces.H"
#include "treeBoundBox.H" #include "treeBoundBox.H"
#include "zeroGradientFvPatchFields.H"
#include "fvMeshTools.H" #include "fvMeshTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -2789,8 +2788,7 @@ void Foam::meshRefinement::dumpRefinementLevel() const
false false
), ),
mesh_, mesh_,
dimensionedScalar("zero", dimless, 0), dimensionedScalar("zero", dimless, 0)
zeroGradientFvPatchScalarField::typeName
); );
const labelList& cellLevel = meshCutter_.cellLevel(); const labelList& cellLevel = meshCutter_.cellLevel();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,6 +26,7 @@ License
#include "CourantNo.H" #include "CourantNo.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "fvcSurfaceIntegrate.H" #include "fvcSurfaceIntegrate.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -26,6 +26,7 @@ License
#include "gaussConvectionScheme.H" #include "gaussConvectionScheme.H"
#include "blendedSchemeBase.H" #include "blendedSchemeBase.H"
#include "fvcCellReduce.H" #include "fvcCellReduce.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,7 +25,6 @@ License
#include "reactingOneDim.H" #include "reactingOneDim.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "zeroGradientFvPatchFields.H"
#include "surfaceInterpolate.H" #include "surfaceInterpolate.H"
#include "fvm.H" #include "fvm.H"
#include "fvcDiv.H" #include "fvcDiv.H"
@ -464,8 +463,6 @@ reactingOneDim::reactingOneDim
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
regionMesh() regionMesh()
//dimensionedScalar("zero", dimEnergy/dimArea/dimTime, 0.0),
//zeroGradientFvPatchVectorField::typeName
), ),
lostSolidMass_(dimensionedScalar("zero", dimMass, 0.0)), lostSolidMass_(dimensionedScalar("zero", dimMass, 0.0)),

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -223,8 +223,7 @@ inline tmp<volScalarField> kinematicSingleLayer::gNorm() const
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
g_ & nHat(), g_ & nHat()
zeroGradientFvPatchScalarField::typeName
) )
); );
@ -246,8 +245,7 @@ inline tmp<volScalarField> kinematicSingleLayer::gNormClipped() const
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
g_ & nHat(), g_ & nHat()
zeroGradientFvPatchScalarField::typeName
) )
); );
@ -272,8 +270,7 @@ inline tmp<volVectorField> kinematicSingleLayer::gTan() const
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
g_ - nHat()*gNorm(), g_ - nHat()*gNorm()
zeroGradientFvPatchVectorField::typeName
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "constantFilmThermo.H" #include "constantFilmThermo.H"
#include "extrapolatedCalculatedFvPatchFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -270,7 +271,7 @@ tmp<volScalarField> constantFilmThermo::rho() const
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("0", dimDensity, 0.0), dimensionedScalar("0", dimDensity, 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
@ -297,7 +298,7 @@ tmp<volScalarField> constantFilmThermo::mu() const
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("0", dimPressure*dimTime, 0.0), dimensionedScalar("0", dimPressure*dimTime, 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
@ -324,7 +325,7 @@ tmp<volScalarField> constantFilmThermo::sigma() const
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("0", dimMass/sqr(dimTime), 0.0), dimensionedScalar("0", dimMass/sqr(dimTime), 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
@ -351,7 +352,7 @@ tmp<volScalarField> constantFilmThermo::Cp() const
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("0", dimEnergy/dimMass/dimTemperature, 0.0), dimensionedScalar("0", dimEnergy/dimMass/dimTemperature, 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
@ -378,7 +379,7 @@ tmp<volScalarField> constantFilmThermo::kappa() const
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("0", dimPower/dimLength/dimTemperature, 0.0), dimensionedScalar("0", dimPower/dimLength/dimTemperature, 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -27,6 +27,7 @@ License
#include "demandDrivenData.H" #include "demandDrivenData.H"
#include "thermoSingleLayer.H" #include "thermoSingleLayer.H"
#include "SLGThermo.H" #include "SLGThermo.H"
#include "extrapolatedCalculatedFvPatchFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -250,7 +251,7 @@ tmp<volScalarField> liquidFilmThermo::rho() const
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("0", dimDensity, 0.0), dimensionedScalar("0", dimDensity, 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
@ -298,7 +299,7 @@ tmp<volScalarField> liquidFilmThermo::mu() const
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("0", dimPressure*dimTime, 0.0), dimensionedScalar("0", dimPressure*dimTime, 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
@ -346,7 +347,7 @@ tmp<volScalarField> liquidFilmThermo::sigma() const
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("0", dimMass/sqr(dimTime), 0.0), dimensionedScalar("0", dimMass/sqr(dimTime), 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
@ -394,7 +395,7 @@ tmp<volScalarField> liquidFilmThermo::Cp() const
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("0", dimEnergy/dimMass/dimTemperature, 0.0), dimensionedScalar("0", dimEnergy/dimMass/dimTemperature, 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );
@ -442,7 +443,7 @@ tmp<volScalarField> liquidFilmThermo::kappa() const
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("0", dimPower/dimLength/dimTemperature, 0.0), dimensionedScalar("0", dimPower/dimLength/dimTemperature, 0.0),
zeroGradientFvPatchScalarField::typeName extrapolatedCalculatedFvPatchScalarField::typeName
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,7 +31,7 @@ License
#include "volFields.H" #include "volFields.H"
#include "fvmSup.H" #include "fvmSup.H"
#include "kinematicSingleLayer.H" #include "kinematicSingleLayer.H"
#include "zeroGradientFvPatchFields.H" #include "extrapolatedCalculatedFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -84,7 +84,7 @@ tmp<volVectorField> laminar::Us() const
), ),
owner_.regionMesh(), owner_.regionMesh(),
dimensionedVector("zero", dimVelocity, vector::zero), dimensionedVector("zero", dimVelocity, vector::zero),
zeroGradientFvPatchVectorField::typeName extrapolatedCalculatedFvPatchVectorField::typeName
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,6 @@ License
#include "constantRadiation.H" #include "constantRadiation.H"
#include "volFields.H" #include "volFields.H"
#include "zeroGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -117,8 +116,7 @@ tmp<volScalarField> constantRadiation::Shs()
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0), dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0)
zeroGradientFvPatchScalarField::typeName
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,7 +26,6 @@ License
#include "noRadiation.H" #include "noRadiation.H"
#include "volFields.H" #include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -89,8 +88,7 @@ tmp<volScalarField> noRadiation::Shs()
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0), dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0)
zeroGradientFvPatchScalarField::typeName
) )
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,6 @@ License
#include "primaryRadiation.H" #include "primaryRadiation.H"
#include "volFields.H" #include "volFields.H"
#include "zeroGradientFvPatchFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -104,8 +103,7 @@ tmp<volScalarField> primaryRadiation::Shs()
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
owner().regionMesh(), owner().regionMesh(),
dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0), dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0)
zeroGradientFvPatchScalarField::typeName
) )
); );

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