ENH: fvFieldReconstructorReconstructFields.C: handle face flip of internal faces

This commit is contained in:
mattijs
2012-04-24 16:10:51 +01:00
parent 7f7786ec12
commit 4190e3e5a5

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -377,18 +377,24 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
// take care of the face direction offset trick. // take care of the face direction offset trick.
// //
{ {
labelList curAddr(faceProcAddressing_[procI]); const labelList& faceMap = faceProcAddressing_[procI];
forAll(curAddr, addrI) // Addressing into original field
labelList curAddr(faceMap.size());
// Correctly oriented copy of internal field
Field<Type> procInternalField(procField.internalField());
forAll(faceMap, addrI)
{ {
curAddr[addrI] -= 1; curAddr[addrI] = mag(faceMap[addrI])-1;
if (faceMap[addrI] < 0)
{
procInternalField[addrI] = -procInternalField[addrI];
}
} }
internalField.rmap // Map
( internalField.rmap(procInternalField, curAddr);
procField.internalField(),
curAddr
);
} }
// Set the boundary patch values in the reconstructed field // Set the boundary patch values in the reconstructed field