本文整理汇总了C++中volScalarField::getField方法的典型用法代码示例。如果您正苦于以下问题:C++ volScalarField::getField方法的具体用法?C++ volScalarField::getField怎么用?C++ volScalarField::getField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类volScalarField
的用法示例。
在下文中一共展示了volScalarField::getField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Foam::MULES::explicitSolve
(
const RdeltaTType& rDeltaT,
const RhoType& rho,
volScalarField& psi,
const surfaceScalarField& phiPsi,
const SpType& Sp,
const SuType& Su
)
{
Info<< "MULES: Solving for " << psi.name() << endl;
const fvMesh& mesh = psi.mesh();
scalargpuField& psiIf = psi.getField();
const scalargpuField& psi0 = psi.oldTime();
psiIf = 0.0;
fvc::surfaceIntegrate(psiIf, phiPsi);
if (mesh.moving())
{
psiIf =
(
mesh.Vsc0()().getField()*rho.oldTime().getField()
*psi0*rDeltaT/mesh.Vsc()().getField()
+ Su.getField()
- psiIf
)/(rho.getField()*rDeltaT - Sp.getField());
}
else
{
psiIf =
(
rho.oldTime().getField()*psi0*rDeltaT
+ Su.getField()
- psiIf
)/(rho.getField()*rDeltaT - Sp.getField());
}
psi.correctBoundaryConditions();
}
示例2: psiMaxn
void Foam::MULES::limiter
(
scalargpuField& allLambda,
const RdeltaTType& rDeltaT,
const RhoType& rho,
const volScalarField& psi,
const surfaceScalarField& phiBD,
const surfaceScalarField& phiCorr,
const SpType& Sp,
const SuType& Su,
const scalar psiMax,
const scalar psiMin,
const label nLimiterIter
)
{
const scalargpuField& psiIf = psi.getField();
const volScalarField::GeometricBoundaryField& psiBf = psi.boundaryField();
const scalargpuField& psi0 = psi.oldTime();
const fvMesh& mesh = psi.mesh();
const labelgpuList& owner = mesh.owner();
const labelgpuList& neighb = mesh.neighbour();
const labelgpuList& losort = mesh.lduAddr().losortAddr();
const labelgpuList& ownStart = mesh.lduAddr().ownerStartAddr();
const labelgpuList& losortStart = mesh.lduAddr().losortStartAddr();
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
const scalargpuField& V = tVsc().getField();
const scalargpuField& phiBDIf = phiBD;
const surfaceScalarField::GeometricBoundaryField& phiBDBf =
phiBD.boundaryField();
const scalargpuField& phiCorrIf = phiCorr;
const surfaceScalarField::GeometricBoundaryField& phiCorrBf =
phiCorr.boundaryField();
slicedSurfaceScalarField lambda
(
IOobject
(
"lambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimless,
allLambda,
false // Use slices for the couples
);
scalargpuField& lambdaIf = lambda;
surfaceScalarField::GeometricBoundaryField& lambdaBf =
lambda.boundaryField();
scalargpuField psiMaxn(psiIf.size(), psiMin);
scalargpuField psiMinn(psiIf.size(), psiMax);
scalargpuField sumPhiBD(psiIf.size(), 0.0);
scalargpuField sumPhip(psiIf.size(), VSMALL);
scalargpuField mSumPhim(psiIf.size(), VSMALL);
thrust::for_each
(
thrust::make_counting_iterator(0),
thrust::make_counting_iterator(0)+psiIf.size(),
limiterMULESFunctor
(
owner.data(),
neighb.data(),
ownStart.data(),
losortStart.data(),
losort.data(),
psiIf.data(),
phiBDIf.data(),
phiCorrIf.data(),
psiMaxn.data(),
psiMinn.data(),
sumPhiBD.data(),
sumPhip.data(),
mSumPhim.data()
)
);
forAll(phiCorrBf, patchi)
{
const fvPatchScalarField& psiPf = psiBf[patchi];
const scalargpuField& phiBDPf = phiBDBf[patchi];
const scalargpuField& phiCorrPf = phiCorrBf[patchi];
const labelgpuList& pcells = mesh.lduAddr().patchSortCells(patchi);
//.........这里部分代码省略.........