STYLE: code clean-up

This commit is contained in:
andy 2013-05-08 11:36:38 +01:00
parent c51d7eb60b
commit c87f83dc46
2 changed files with 7 additions and 9 deletions

View File

@ -190,12 +190,13 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights
wghtSum.setSize(wght.size());
forAll(wght, faceI)
{
scalar s = sum(wght[faceI]);
scalarList& w = wght[faceI];
scalar s = sum(w);
scalar t = s/patchAreas[faceI];
forAll(addr[faceI], i)
forAll(w, i)
{
wght[faceI][i] /= s;
w[i] /= s;
}
wghtSum[faceI] = t;

View File

@ -67,7 +67,7 @@ bool Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::processSourceFace
visitedFaces.append(tgtFaceI);
scalar area = interArea(srcFaceI, tgtFaceI);
// store when intersection area > 0
// store when intersection fractional area > tolerance
if (area/this->srcMagSf_[srcFaceI] > faceAreaIntersect::tolerance())
{
srcAddr[srcFaceI].append(tgtFaceI);
@ -227,12 +227,9 @@ Foam::scalar Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::interArea
const face& tgt = this->tgtPatch_[tgtFaceI];
// quick reject if either face has zero area
// Note: do not used stored face areas for target patch
// Note: do not use stored face areas for target patch
const scalar tgtMag = tgt.mag(tgtPoints);
if
(
(this->srcMagSf_[srcFaceI] < ROOTVSMALL) || (tgtMag < ROOTVSMALL)
)
if ((this->srcMagSf_[srcFaceI] < ROOTVSMALL) || (tgtMag < ROOTVSMALL))
{
return 0.0;
}