Skip to content
Permalink
Browse files

reconstructPar: Add support for reconstructing surfaceVectorFields

  • Loading branch information...
Henry Weller
Henry Weller committed Apr 1, 2019
1 parent 51247ee commit 44742d235eb02d916d83ba46212c95cdb86268a7
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -38,6 +38,7 @@ namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

UNARY_FUNCTION(label, label, mag)
BINARY_TYPE_OPERATOR(label, label, label, +, add)
BINARY_TYPE_OPERATOR(label, label, label, -, subtract)

@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -50,6 +50,7 @@ typedef Field<label> labelField;

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

UNARY_FUNCTION(label, label, mag)
BINARY_TYPE_OPERATOR(label, label, label, +, add)
BINARY_TYPE_OPERATOR(label, label, label, -, subtract)

@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -366,21 +366,22 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField

// Set the face values in the reconstructed field

// It is necessary to create a copy of the addressing array to
// take care of the face direction offset trick.
//
if (pTraits<Type>::nComponents == 1)
{
// Assume all scalar surfaceFields are oriented flux fields
const labelList& faceMap = faceProcAddressing_[proci];

// Correctly oriented copy of internal field
Field<Type> procInternalField(procField.primitiveField());

// Addressing into original field
// It is necessary to create a copy of the addressing array to
// take care of the face direction offset trick.
labelList curAddr(procInternalField.size());

forAll(procInternalField, addrI)
{
curAddr[addrI] = mag(faceMap[addrI])-1;
curAddr[addrI] = mag(faceMap[addrI]) - 1;
if (faceMap[addrI] < 0)
{
procInternalField[addrI] = -procInternalField[addrI];
@@ -390,6 +391,15 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
// Map
internalField.rmap(procInternalField, curAddr);
}
else
{
// Map
internalField.rmap
(
procField.primitiveField(),
mag(labelField(faceProcAddressing_[proci])) - 1
);
}

// Set the boundary patch values in the reconstructed field
forAll(boundaryProcAddressing_[proci], patchi)

0 comments on commit 44742d2

Please sign in to comment.
You can’t perform that action at this time.