本文整理汇总了C++中scalargpuField::end方法的典型用法代码示例。如果您正苦于以下问题:C++ scalargpuField::end方法的具体用法?C++ scalargpuField::end怎么用?C++ scalargpuField::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scalargpuField
的用法示例。
在下文中一共展示了scalargpuField::end方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deltas
void Foam::cyclicACMIFvPatch::makeWeights(scalargpuField& w) const
{
if (coupled())
{
const cyclicACMIFvPatch& nbrPatch = neighbFvPatch();
const fvPatch& nbrPatchNonOverlap = nonOverlapPatch();
const scalargpuField deltas(nf() & coupledFvPatch::delta());
const scalargpuField nbrDeltas
(
interpolate
(
nbrPatch.nf() & nbrPatch.coupledFvPatch::delta(),
nbrPatchNonOverlap.nf() & nbrPatchNonOverlap.delta()
)
);
thrust::transform
(
deltas.begin(),
deltas.end(),
nbrDeltas.begin(),
w.begin(),
cyclicACMIFvPatchMakeWeightsFunctor()
);
}
else
{
// Behave as uncoupled patch
fvPatch::makeWeights(w);
}
}
示例2: dummyField
//.........这里部分代码省略.........
matrixLevels_[leveli],
interfaceLevelsBouCoeffs_[leveli],
interfaceLevels_[leveli],
coarseSources[leveli],
cmpt
);
}
// Correct the residual with the new solution
matrixLevels_[leveli].Amul
(
ACf,
coarseCorrFields[leveli],
interfaceLevelsBouCoeffs_[leveli],
interfaceLevels_[leveli],
cmpt
);
coarseSources[leveli] -= ACf;
}
// Residual is equal to source
agglomeration_.restrictField
(
coarseSources[leveli + 1],
coarseSources[leveli],
leveli + 1
);
}
}
if (debug >= 2 && nPreSweeps_)
{
Pout<< endl;
}
// Solve Coarsest level with either an iterative or direct solver
if (coarseCorrFields.set(coarsestLevel))
{
solveCoarsestLevel
(
coarseCorrFields[coarsestLevel],
coarseSources[coarsestLevel]
);
}
if (debug >= 2)
{
Pout<< "Post-smoothing scaling factors: ";
}
// Smoothing and prolongation of the coarse correction fields
// (going to finer levels)
scalargpuField dummyField(0);
for (label leveli = coarsestLevel - 1; leveli >= 0; leveli--)
{
if (coarseCorrFields.set(leveli))
{
// Create a field for the pre-smoothed correction field
// as a sub-field of the finestCorrection which is not
// currently being used
scalargpuField preSmoothedCoarseCorrField
(
示例3: scalingVector
void Foam::GAMGSolver::scale
(
scalargpuField& field,
scalargpuField& Acf,
const lduMatrix& A,
const FieldField<gpuField, scalar>& interfaceLevelBouCoeffs,
const lduInterfaceFieldPtrsList& interfaceLevel,
const scalargpuField& source,
const direction cmpt
) const
{
A.Amul
(
Acf,
field,
interfaceLevelBouCoeffs,
interfaceLevel,
cmpt
);
scalar scalingFactorNum = 0.0;
scalar scalingFactorDenom = 0.0;
scalingFactorNum =
thrust::reduce
(
thrust::make_transform_iterator
(
thrust::make_zip_iterator(thrust::make_tuple
(
source.begin(),
field.begin()
)),
multiplyTupleFunctor()
),
thrust::make_transform_iterator
(
thrust::make_zip_iterator(thrust::make_tuple
(
source.end(),
field.end()
)),
multiplyTupleFunctor()
),
0.0,
thrust::plus<scalar>()
);
scalingFactorDenom =
thrust::reduce
(
thrust::make_transform_iterator
(
thrust::make_zip_iterator(thrust::make_tuple
(
Acf.begin(),
field.begin()
)),
multiplyTupleFunctor()
),
thrust::make_transform_iterator
(
thrust::make_zip_iterator(thrust::make_tuple
(
Acf.end(),
field.end()
)),
multiplyTupleFunctor()
),
0.0,
thrust::plus<scalar>()
);
/*
forAll(field, i)
{
scalingFactorNum += source[i]*field[i];
scalingFactorDenom += Acf[i]*field[i];
}
*/
vector2D scalingVector(scalingFactorNum, scalingFactorDenom);
A.mesh().reduce(scalingVector, sumOp<vector2D>());
scalar sf = scalingVector.x()/stabilise(scalingVector.y(), VSMALL);
if (debug >= 2)
{
Pout<< sf << " ";
}
const scalargpuField& D = A.diag();
/*
forAll(field, i)
{
field[i] = sf*field[i] + (source[i] - sf*Acf[i])/D[i];
}
*/
thrust::transform
//.........这里部分代码省略.........