A class for managing temporary objects. More...
Public Types | |
typedef T | Type |
typedef Foam::refCount | refCount |
Public Member Functions | |
tmp (T *=0, bool nonReusable=false) | |
Store object pointer of a non-reusable or reusable temporary object. More... | |
tmp (const T &) | |
Store object const reference. More... | |
tmp (const tmp< T > &) | |
Construct copy and increment reference count. More... | |
tmp (const tmp< T > &&) | |
Construct copy moving content, does not increment reference count. More... | |
tmp (const tmp< T > &, bool allowTransfer) | |
Construct copy transferring content of temporary if required. More... | |
~tmp () | |
Destructor: deletes temporary object when the reference count is 0. More... | |
bool | isTmp () const |
Return true if this is really a temporary object. More... | |
bool | empty () const |
Return true if this temporary object empty,. More... | |
bool | valid () const |
Is this temporary object valid,. More... | |
word | typeName () const |
Return the type name of the tmp. More... | |
T & | ref () const |
Return non-const reference or generate a fatal error. More... | |
T * | ptr () const |
Return tmp pointer for reuse. More... | |
void | clear () const |
If object pointer points to valid object: More... | |
const T & | operator() () const |
Const dereference operator. More... | |
operator const T & () const | |
Const cast to the underlying type reference. More... | |
T * | operator-> () |
Return object pointer. More... | |
const T * | operator-> () const |
Return const object pointer. More... | |
void | operator= (T *) |
Assignment to pointer changing this tmp to a temporary T. More... | |
void | operator= (const tmp< T > &) |
Assignment transferring the temporary T to this tmp. More... | |
void | operator= (const tmp< T > &&) |
Move assignment transferring the temporary T to this tmp. More... | |
A class for managing temporary objects.
typedef Foam::refCount refCount |
Store object pointer of a non-reusable or reusable temporary object.
Definition at line 49 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and tmp< T >::typeName().
Construct copy and increment reference count.
Definition at line 73 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and tmp< T >::typeName().
|
inline |
|
inline |
Return true if this is really a temporary object.
Definition at line 153 of file tmpI.H.
Referenced by coupledTemperatureFvPatchScalarField::add(), MomentumTransferPhaseSystem< BasePhaseSystem >::addTmpField(), DispersionRASModel< CloudType >::cacheFields(), BrownianMotionForce< CloudType >::cacheFields(), Foam::constrainPhiHbyA(), and fvSpecificSource::source().
|
inline |
|
inline |
Is this temporary object valid,.
ie, it is a reference or a temporary that has been allocated
Definition at line 167 of file tmpI.H.
Referenced by coupledTemperatureFvPatchScalarField::add(), MomentumTransferPhaseSystem< BasePhaseSystem >::addTmpField(), externalTemperatureFvPatchScalarField::getKappa(), coupledTemperatureFvPatchScalarField::getThis(), OldTimeField< DimensionedField< Type, GeoMesh > >::OldTimeField(), coupledTemperatureFvPatchScalarField::updateCoeffs(), layerAverage::write(), and subCycleField< GeometricField >::~subCycleField().
|
inline |
Return the type name of the tmp.
constructed from the type name of T
Definition at line 174 of file tmpI.H.
References Foam::name(), and Foam::T().
Referenced by tmp< T >::tmp(), and tmp< Foam::fvPatchField >::typeName().
|
inline |
Return non-const reference or generate a fatal error.
if the object is const.
Definition at line 181 of file tmpI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
Referenced by fvMatrix< Type >::A(), MRFZoneList::absolute(), greyMean::aCont(), wideBand::aCont(), coupledTemperatureFvPatchScalarField::add(), interRegionHeatTransfer::addSup(), MomentumTransferPhaseSystem< BasePhaseSystem >::addTmpField(), phaseChange::addToDriftRate(), cloud::aDisp(), pairGAMGAgglomeration::agglomerate(), GAMGInterface::agglomerateCoeffs(), MomentumCloud< CloudType >::alpha(), parcelCloudList::alpha(), blendingMethod::alpha(), compressibleMultiphaseVoFMixture::alphaEff(), waveAlphaFvPatchScalarField::alphan(), twoPhaseSolver::alphaPredictor(), compressibleVoF::alphaSuSp(), incompressibleDriftFlux::alphaSuSp(), incompressibleVoF::alphaSuSp(), alphatJayatillekeWallFunctionFvPatchScalarField::alphat(), ThermoCloud< CloudType >::ap(), parcelCloudList::ap(), patchCutLayerAverage::applyWeights(), Foam::atan2(), velocityGroup::Av(), Foam::fvc::average(), layerAverage::average(), motionSmootherAlgo::avg(), snappySnapDriver::avgCellCentres(), GeometricBoundaryField< Type, PatchField, GeoMesh >::boundaryInternalField(), GeometricBoundaryField< Type, PatchField, GeoMesh >::boundaryNeighbourField(), cellMDLimitedGrad< Type >::calcGrad(), faceLimitedGrad< Type >::calcGrad(), faceMDLimitedGrad< Type >::calcGrad(), nutUSpaldingWallFunctionFvPatchScalarField::calcUTau(), Foam::meshCheck::cellDeterminant(), BasicThermo< MixtureType, BasicThermoType >::cellSetProperty(), MRFZoneList::centrifugalAcceleration(), Foam::meshCheck::checkCellDeterminant(), Foam::meshCheck::checkFaceOrthogonality(), Foam::meshCheck::checkFaceSkewness(), Foam::meshCheck::checkFaceWeight(), Foam::meshCheck::checkVolRatio(), filmCloudTransfer::CloudToFilmTransferRate(), Foam::cmptAv(), Foam::cmptMag(), Foam::cmptMax(), Foam::cmptMin(), fvPatch::Cn(), FieldField< Field, Type >::component(), Field< Type >::component(), isothermalFilm::constrainedField(), Foam::constrainHbyA(), Foam::constrainPhid(), Foam::constrainPhiHbyA(), searchableBox::coordinates(), searchableSurfaceCollection::coordinates(), triSurfaceMesh::coordinates(), PDRkEpsilon::correct(), kEpsilonLopesdaCosta< BasicMomentumTransportModel >::correct(), kOmegaSST< MomentumTransportModel, BasicMomentumTransportModel >::correct(), lambdaThixotropic< BasicMomentumTransportModel >::correct(), DeardorffDiffStress< BasicMomentumTransportModel >::correct(), SpalartAllmarasDES< BasicMomentumTransportModel >::correct(), kEpsilon< BasicMomentumTransportModel >::correct(), kOmega< BasicMomentumTransportModel >::correct(), kOmega2006< BasicMomentumTransportModel >::correct(), LaunderSharmaKE< BasicMomentumTransportModel >::correct(), LRR< BasicMomentumTransportModel >::correct(), realizableKE< BasicMomentumTransportModel >::correct(), RNGkEpsilon< BasicMomentumTransportModel >::correct(), SpalartAllmaras< BasicMomentumTransportModel >::correct(), SSG< BasicMomentumTransportModel >::correct(), v2f< BasicMomentumTransportModel >::correct(), mixtureKEpsilon< BasicMomentumTransportModel >::correct(), InterfaceCompositionPhaseChangePhaseSystem< BasePhaseSystem >::correctInterfaceThermo(), correctedSnGrad< Type >::correction(), faceCorrectedSnGrad< Type >::correction(), linearUpwindV< Type >::correction(), CentredFitSnGradScheme< Type, Polynomial, Stencil >::correction(), cubic< Type >::correction(), outletStabilised< Type >::correction(), pointLinear< Type >::correction(), linearUpwind< Type >::correction(), multicomponentThermo::implementation::correctMassFractions(), kOmegaSSTLM< BasicMomentumTransportModel >::correctReThetatGammaInt(), Foam::fvc::curl(), displacementComponentLaplacianFvMotionSolver::curPoints(), velocityComponentLaplacianFvMotionSolver::curPoints(), displacementLaplacianFvMotionSolver::curPoints(), displacementSBRStressFvMotionSolver::curPoints(), velocityLaplacianFvMotionSolver::curPoints(), motionSmootherAlgo::curPoints(), displacementLinearMotionMotionSolver::curPoints(), interpolatingSolidBodyMotionSolver::curPoints(), multiSolidBodyMotionSolver::curPoints(), solidBodyMotionSolver::curPoints(), triSurface::curvature(), fvMatrix< Type >::D(), cavitation::d2mdtdpf(), wallDampingModel::damping(), basic::Dcu(), fvMatrix< Type >::DD(), MRFZoneList::DDt(), fvMesh::delta(), blackBodyEmission::deltaLambdaT(), nonlinearEddyViscosity< BasicMomentumTransportModel >::devTau(), mappedInternalPatchBase::distribute(), Foam::fvm::divc(), regionSizeDistribution::divide(), Fickian< BasicThermophysicalTransportModel >::divq(), MaxwellStefan< BasicThermophysicalTransportModel >::divq(), nonUnityLewisEddyDiffusivity< TurbulenceThermophysicalTransportModel >::divq(), cavitation::dmdtf(), InterfaceCompositionPhaseChangePhaseSystem< BasePhaseSystem >::dmdtf(), PhaseTransferPhaseSystem< BasePhaseSystem >::dmdtf(), PopulationBalancePhaseSystem< BasePhaseSystem >::dmdtf(), ThermalPhaseChangePhaseSystem< BasePhaseSystem >::dmdtf(), blackBodyEmission::EbDeltaLambdaT(), greyMeanCombustion::ECont(), wideBandCombustion::ECont(), PatchTools::edgeNormals(), cloud::EDisp(), irregular::elevation(), ThermoCloud< CloudType >::Ep(), parcelCloudList::Ep(), atmBoundaryLayer::epsilon(), age::execute(), wallHeatTransferCoeff::execute(), kOmegaSST< MomentumTransportModel, BasicMomentumTransportModel >::F23(), polyPatch::faceCellCentres(), Foam::meshCheck::faceConcavity(), Foam::meshCheck::faceFlatness(), lduMatrix::faceH(), Foam::meshCheck::faceOrthogonality(), Foam::meshCheck::faceSkewness(), PrimitivePatchInterpolation< Patch >::faceToEdgeInterpolate(), PrimitivePatchInterpolation< Patch >::faceToPointInterpolate(), Foam::meshCheck::faceWeights(), BasicThermo< MixtureType, BasicThermoType >::fieldSourceProperty(), VoFFilmTransfer::filmVoFTransferRate(), zoneCombustion::filter(), surfaceFieldValue::filterField(), kOmegaSSTLM< BasicMomentumTransportModel >::Flength(), fvMatrix< Type >::flux(), forcing::forceCoeff(), fft::forwardTransform(), mappedPatchBase::fromNeighbour(), correctedSnGrad< Type >::fullGradCorrection(), faceCorrectedSnGrad< Type >::fullGradCorrection(), backwardDdtScheme< Type >::fvcDdt(), CoEulerDdtScheme< Type >::fvcDdt(), CrankNicolsonDdtScheme< Type >::fvcDdt(), EulerDdtScheme< Type >::fvcDdt(), SLTSDdtScheme< Type >::fvcDdt(), ddtScheme< Type >::fvcDdtPhiCoeff(), gaussConvectionScheme< Type >::fvcDiv(), gaussDivScheme< Type >::fvcDiv(), gaussLaplacianScheme< Type, GType >::fvcLaplacian(), EulerD2dt2Scheme< Type >::fvmD2dt2(), backwardDdtScheme< Type >::fvmDdt(), CoEulerDdtScheme< Type >::fvmDdt(), EulerDdtScheme< Type >::fvmDdt(), localEulerDdtScheme< Type >::fvmDdt(), SLTSDdtScheme< Type >::fvmDdt(), gaussConvectionScheme< Type >::fvmDiv(), gaussLaplacianScheme< Type, GType >::fvmLaplacian(), gaussLaplacianScheme< Type, GType >::fvmLaplacianUncorrected(), surfaceFieldValue::getFieldValues(), coupledMultiphaseTemperatureFvPatchScalarField::getNbr(), basic::Gk(), fvMatrix< Type >::H(), lduMatrix::H(), fvMatrix< Type >::H1(), lduMatrix::H1(), AnisothermalPhaseModel< BasePhaseModel >::heEqn(), parcelCloudList::hsCoeff(), parcelCloudList::hsTrans(), kappaEff::htcByRhoCp(), ReynoldsAnalogy::htcByRhoCp(), FieldFunction1< Type, Function1Type >::integral(), unintegrable::integrate(), unintegrable::integrateX(), twoPhaseMixture::interfaceFraction(), GAMGInterface::interfaceInternalField(), cyclicGAMGInterface::internalFieldTransfer(), fieldInterpolation< Type, InterpolationType >::interpolate(), cutPolyIsoSurface::interpolate(), pointToPointPlanarInterpolation::interpolate(), vtkMesh::interpolate(), surfaceInterpolationScheme< scalar >::interpolate(), singleCellFvMesh::interpolate(), surfaceInterpolationScheme< Type >::interpolate(), localMax< Type >::interpolate(), localMin< Type >::interpolate(), fvMeshSubset::interpolate(), volPointInterpolation::interpolate(), interfaceCompressionNew::interpolate(), PLIC::interpolate(), PLICU::interpolate(), patch::interpolateField(), thresholdCellFaces::interpolateField(), triSurfaceMesh::interpolateField(), interpolation< Foam::Vector >::interpolation(), Foam::inv(), MaxwellStefan< BasicThermophysicalTransportModel >::j(), segregated::K(), SpalartAllmarasDES< BasicMomentumTransportModel >::k(), ReynoldsStress< BasicMomentumTransportModel >::k(), phaseSystem::K(), atmBoundaryLayer::k(), multiphaseVoFMixture::K(), Foam::levelSetFraction(), LimitedScheme< Type, Limiter, LimitFunc >::limiter(), PhiScheme< Type, PhiLimiter >::limiter(), Foam::mag(), Foam::magSqr(), Foam::fvc::magSqrGradGrad(), main(), timeVaryingMappedFvPatchField< Type >::map(), nonConformalMappedFvPatchBase::map(), mappedValueFvPatchField< Type >::mappedValues(), multicomponentPhaseChange::mDot(), momentOfInertia::meshInertia(), fvMesh::movePoints(), primitiveMesh::movePoints(), phaseSystem::nearInterface(), multiphaseVoFMixture::nearInterface(), Foam::New(), nonlinearEddyViscosity< incompressible::RASModel >::nonlinearEddyViscosity(), multicomponentThermo::normaliseY(), JohnsonJacksonSchaeffer::nu(), Schaeffer::nu(), strainRateFunction::nu(), nutkAtmRoughWallFunctionFvPatchScalarField::nut(), nutkRoughWallFunctionFvPatchScalarField::nut(), nutkWallFunctionFvPatchScalarField::nut(), nutURoughWallFunctionFvPatchScalarField::nut(), nutUWallFunctionFvPatchScalarField::nut(), consumptionSpeed::omega0Sigma(), inversePointDistanceDiffusivity::operator()(), RaviPetersen::operator()(), anisotropicFilter::operator()(), Foam::fvMeshStitcherTools::origNcMagSfb(), blendingMethod::parameter(), BasicThermo< MixtureType, BasicThermoType >::patchFieldProperty(), fvPatch::patchInternalField(), cyclicFvPatchField< Type >::patchNeighbourField(), cyclicFvsPatchField< Type >::patchNeighbourField(), fixedValue::PDF(), tabulatedCumulative::PDF(), tabulatedDensity::PDF(), noiseFFT::Pf(), specieTransferTemperatureFvPatchScalarField::phiHep(), specieTransferVelocityFvPatchVectorField::phip(), PatchTools::pointNormals(), searchableCylinder::points(), searchablePlate::points(), searchableSurfaceCollection::points(), boundBox::points(), treeBoundBox::points(), PrimitivePatchInterpolation< Patch >::pointToFaceInterpolate(), blockEdge::position(), projectCurveEdge::position(), projectEdge::position(), Foam::pow(), compressibleMultiphaseVoF::pressureCorrector(), compressibleVoF::pressureCorrector(), sampledSurface::project(), compressibleMultiphaseVoFMixture::psiByRho(), Fickian< BasicThermophysicalTransportModel >::q(), MaxwellStefan< BasicThermophysicalTransportModel >::q(), nonUnityLewisEddyDiffusivity< TurbulenceThermophysicalTransportModel >::q(), chemistryModel< ThermoType >::Qdot(), EDC::R(), laminar::R(), compressibleMultiphaseVoFMixture::rCv(), Foam::fvc::reconstruct(), Foam::fvc::reconstructMag(), MRFZoneList::relative(), fvMatrix< Type >::residual(), LduMatrix< Type, DType, LUType >::residual(), lduMatrix::residual(), kOmegaSSTLM< BasicMomentumTransportModel >::ReThetac(), kOmegaSSTLM< BasicMomentumTransportModel >::ReThetat0(), fft::reverseTransform(), MomentumCloud< CloudType >::rhoEff(), fvDOM::Rp(), fvDOM::Ru(), FieldDistribution< Base, Derived >::sample(), patchProbes::sample(), probes::sample(), randomGenerator::sample01(), randomGenerator::sampleAB(), patch::sampleField(), patchInternalField::sampleField(), triSurfaceMesh::sampleField(), sampledSets::sampleLocalType(), mappedInternalPatchBase::samplePoints(), randomGenerator::scalar01(), randomGenerator::scalarAB(), MulticomponentThermo< BaseThermo >::scalarFieldPropertyi(), forcing::scale(), waveSuperposition::scale(), ThermoCloud< CloudType >::Sh(), parcelCloudList::Sh(), temperatureDependent::sigma(), cloud::sigmaEff(), ThermoCloud< CloudType >::sigmap(), parcelCloudList::sigmap(), skewCorrected< Type >::skewCorrection(), snGradScheme< Type >::snGrad(), QRMatrix< MatrixType >::solve(), LLTMatrix< Type >::solve(), LUscalarMatrix::solve(), fvSpecificSource::source(), fvModels::sourceTerm(), fvModel::sourceTerm(), SlicedGeometricField< Type, PatchField, SlicedPatchField, GeoMesh >::splice(), Foam::sqr(), fvMeshToFvMesh::srcToTgt(), ReactingCloud< CloudType >::Srho(), parcelCloudList::Srho(), Foam::stabilise(), regionFunctionObject::store(), MomentumCloud< CloudType >::SU(), parcelCloudList::SU(), layerAverage::sum(), MPLIC::surfaceAlpha(), Foam::fvc::surfaceIntegrate(), Foam::fvc::surfaceSum(), phaseSystem::surfaceTension(), multiphaseVoFMixture::surfaceTensionForce(), ReactingCloud< CloudType >::SYi(), parcelCloudList::SYi(), DimensionedField< Type, GeoMesh >::T(), FieldField< Field, Type >::T(), Field< Type >::T(), GeometricField< Type, PatchField, GeoMesh >::T(), KochFriedlander::tau(), chemistryModel< ThermoType >::tc(), targetCoeffTrim::thetag(), mappedPatchBase::toNeighbour(), sixDoFRigidBodyMotion::transform(), Foam::transform(), axesRotation::transformDiagTensor(), cylindrical::transformDiagTensor(), EulerCoordinateRotation::transformDiagTensor(), STARCDCoordinateRotation::transformDiagTensor(), Foam::transformPoints(), function1Temperature::Tsat(), polynomialTemperature::Tsat(), parcelCloudList::UCoeff(), waveAtmBoundaryLayerSuperposition::UGas(), waveVelocityFvPatchVectorField::Un(), parcelCloudList::UTrans(), FieldFunction1< Type, Function1Type >::value(), FieldFunction2< Type, Function2Type >::value(), MomentumCloud< CloudType >::vDotSweep(), irregular::velocity(), filmVoFTransfer::VoFToFilmTransferRate(), Foam::meshCheck::volRatio(), BasicThermo< MixtureType, BasicThermoType >::volScalarFieldProperty(), MulticomponentThermo< BaseThermo >::volScalarFieldPropertyi(), extendedFaceToCellStencil::weightedSum(), extendedCellToFaceStencil::weightedSum(), extendedUpwindCellToFaceStencil::weightedSum(), clippedLinear< Type >::weights(), midPoint< Type >::weights(), reverseLinear< Type >::weights(), limitedSurfaceInterpolationScheme< Type >::weights(), outletStabilised< Type >::weights(), noiseFFT::window(), Table< Type >::x(), distribution::x(), exponential::x(), fixedValue::x(), normal::x(), RosinRammler::x(), standardNormal::x(), tabulatedCumulative::x(), tabulatedDensity::x(), SCOPEXiEq::XiEq(), MomentumCloud< CloudType >::Y(), Table< Type >::y(), nutURoughWallFunctionFvPatchScalarField::yPlus(), nutUWallFunctionFvPatchScalarField::yPlus(), alphatJayatillekeWallFunctionFvPatchScalarField::yPlusTherm(), wallLubricationModel::zeroGradWalls(), and Foam::zip().
|
inline |
Return tmp pointer for reuse.
Returns a clone if the object is not a temporary
Definition at line 205 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::T().
Referenced by DispersionRASModel< CloudType >::cacheFields(), BrownianMotionForce< CloudType >::cacheFields(), MovingPhaseModel< BasePhaseModel >::divU(), gaussConvectionScheme< Type >::fvmDiv(), gaussLaplacianScheme< Type, GType >::fvmLaplacian(), volPointInterpolation::interpolate(), sampledSets::sampleLocalType(), regionFunctionObject::store(), phaseChange::vfToVif(), and waveSurfacePressureFvPatchScalarField::waveSurfacePressureFvPatchScalarField().
|
inline |
If object pointer points to valid object:
delete object and set pointer to nullptr
Definition at line 237 of file tmpI.H.
Referenced by MRFZoneList::absolute(), lduMatrix::Amul(), PDRkEpsilon::correct(), kEpsilonLopesdaCosta< BasicMomentumTransportModel >::correct(), kOmegaSST< MomentumTransportModel, BasicMomentumTransportModel >::correct(), dynamicKEqn< BasicMomentumTransportModel >::correct(), kEqn< BasicMomentumTransportModel >::correct(), SpalartAllmarasDES< BasicMomentumTransportModel >::correct(), kEpsilon< BasicMomentumTransportModel >::correct(), kOmega< BasicMomentumTransportModel >::correct(), LaunderSharmaKE< BasicMomentumTransportModel >::correct(), RNGkEpsilon< BasicMomentumTransportModel >::correct(), mixtureKEpsilon< BasicMomentumTransportModel >::correct(), kOmegaSSTLM< BasicMomentumTransportModel >::correctReThetatGammaInt(), Foam::fvc::DDt(), Foam::fvc::div(), Foam::fvm::div(), Foam::fvc::flux(), fft::forwardTransform(), surfaceInterpolationScheme< scalar >::interpolate(), main(), Field< Type >::map(), anisotropicFilter::operator()(), noiseFFT::Pf(), realizableKE< BasicMomentumTransportModel >::rCmu(), Foam::fvc::reconstructMag(), MRFZoneList::relative(), fft::reverseTransform(), Field< Type >::rmap(), snGradScheme< Type >::snGrad(), Foam::stabilise(), lduMatrix::Tmul(), Foam::transform(), Foam::transformPoints(), phaseChange::vfToVif(), phaseChange::vifToVf(), and Foam::fvc::volumeIntegrate().
|
inline |
Const dereference operator.
Definition at line 279 of file tmpI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
inline |
|
inline |
Return object pointer.
Definition at line 304 of file tmpI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
inline |
Return const object pointer.
Definition at line 327 of file tmpI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
inline |
Assignment to pointer changing this tmp to a temporary T.
Definition at line 341 of file tmpI.H.
References Foam::abort(), clear(), Foam::FatalError, and FatalErrorInFunction.
Assignment transferring the temporary T to this tmp.
Definition at line 366 of file tmpI.H.
References Foam::abort(), clear(), Foam::FatalError, FatalErrorInFunction, Foam::name(), and Foam::T().