ENH: various: move boundaryField(), internalField() out of loop

This commit is contained in:
mattijs
2011-12-02 10:38:18 +00:00
parent cb6b31621c
commit 8667536a2b
15 changed files with 169 additions and 113 deletions

View File

@ -360,9 +360,11 @@ Foam::dynamicRefineFvMesh::refine
}
// Recalculate new boundary faces.
forAll(phi.boundaryField(), patchI)
surfaceScalarField::GeometricBoundaryField& bphi =
phi.boundaryField();
forAll(bphi, patchI)
{
fvsPatchScalarField& patchPhi = phi.boundaryField()[patchI];
fvsPatchScalarField& patchPhi = bphi[patchI];
const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI];
@ -404,8 +406,7 @@ Foam::dynamicRefineFvMesh::refine
const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI];
fvsPatchScalarField& patchPhi =
phi.boundaryField()[patchI];
fvsPatchScalarField& patchPhi = bphi[patchI];
patchPhi[i] = patchPhiU[i];
}
@ -549,6 +550,9 @@ Foam::dynamicRefineFvMesh::unrefine
}
surfaceScalarField& phi = const_cast<surfaceScalarField&>(*iter());
surfaceScalarField::GeometricBoundaryField& bphi =
phi.boundaryField();
const surfaceScalarField phiU
(
fvc::interpolate
@ -582,10 +586,7 @@ Foam::dynamicRefineFvMesh::unrefine
const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI];
fvsPatchScalarField& patchPhi =
phi.boundaryField()[patchI];
fvsPatchScalarField& patchPhi = bphi[patchI];
patchPhi[i] = patchPhiU[i];
}
}