本文整理汇总了C++中tmp::ref方法的典型用法代码示例。如果您正苦于以下问题:C++ tmp::ref方法的具体用法?C++ tmp::ref怎么用?C++ tmp::ref使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tmp
的用法示例。
在下文中一共展示了tmp::ref方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tfield
bool Foam::functionObjects::regionFunctionObject::store
(
word& fieldName,
const tmp<ObjectType>& tfield,
bool cacheable
)
{
if (cacheable && fieldName == tfield().name())
{
WarningInFunction
<< "Cannot store cache-able field with the named used in the cache."
<< nl
<< " Either choose a different name or cache the field"
<< " and use the 'writeObjects' functionObject."
<< endl;
return false;
}
if
(
fieldName.size()
&& obr_.foundObject<ObjectType>(fieldName)
)
{
const ObjectType& field =
(
obr_.lookupObject<ObjectType>(fieldName)
);
// If there is a result field already registered assign to the new
// result field otherwise transfer ownership of the new result field to
// the object registry
if (&field != &tfield())
{
const_cast<ObjectType&>(field) = tfield;
}
else
{
obr_.objectRegistry::store(tfield.ptr());
}
}
else
{
if (fieldName.size() && fieldName != tfield().name())
{
tfield.ref().rename(fieldName);
}
else
{
fieldName = tfield().name();
}
obr_.objectRegistry::store(tfield.ptr());
}
return true;
}
示例2: forAll
Foam::tmp<Foam::volVectorField> Foam::wallLubricationModel::zeroGradWalls
(
tmp<volVectorField> tFi
) const
{
volVectorField& Fi = tFi.ref();
const fvPatchList& patches = Fi.mesh().boundary();
forAll(patches, patchi)
{
if (isA<wallFvPatch>(patches[patchi]))
{
fvPatchVectorField& Fiw = Fi.boundaryField()[patchi];
Fiw = Fiw.patchInternalField();
}
}
return tFi;
}
示例3: twoDCorrectPoints
{
pointLocation_()[pz[i]] = points0()[pz[i]];
}
}
twoDCorrectPoints(pointLocation_().primitiveFieldRef());
return tmp<pointField>(pointLocation_().primitiveField());
}
else
{
tmp<pointField> tcurPoints
(
points0() + pointDisplacement_.primitiveField()
);
pointField& curPoints = tcurPoints.ref();
// Implement frozen points
if (frozenPointsZone_ != -1)
{
const pointZone& pz = fvMesh_.pointZones()[frozenPointsZone_];
forAll(pz, i)
{
curPoints[pz[i]] = points0()[pz[i]];
}
}
twoDCorrectPoints(curPoints);
return tcurPoints;
示例4: fvOptions
+ fvm::Sp(((C1_/2)*epsilon_ + (C1s_/2)*G)*alpha*rho/k_, R)
==
alpha*rho*P
- ((1.0/3.0)*I)*(((2.0 - C1_)*epsilon_ - C1s_*G)*alpha*rho)
+ (C2_*(alpha*rho*epsilon_))*dev(innerSqr(b))
+ alpha*rho*k_
*(
(C3_ - C3s_*mag(b))*dev(S)
+ C4_*dev(twoSymm(b&S))
+ C5_*twoSymm(b&Omega)
)
+ fvOptions(alpha, rho, R)
);
REqn.ref().relax();
fvOptions.constrain(REqn.ref());
solve(REqn);
fvOptions.correct(R);
this->boundNormalStress(R);
k_ = 0.5*tr(R);
correctNut();
// Correct wall shear-stresses when applying wall-functions
this->correctWallShearStress(R);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //