Commit 8886e908 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Progagted oriented() flag through field mapping

parent f71e4ff5
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -269,7 +269,7 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField
}
// Map all faces
Field<Type> internalField(flatFld, mapper);
Field<Type> internalField(flatFld, mapper, fld.oriented()());
// Trim to internal faces (note: could also have special mapper)
internalField.setSize
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -205,6 +205,8 @@ void Foam::fvMeshDistribute::mapExposedFaces
forAllIter(typename HashTable<fldType*>, flds, iter)
{
fldType& fld = *iter();
const bool oriented = fld.oriented()();
typename fldType::Boundary& bfld = fld.boundaryFieldRef();
const Field<T>& oldInternal = oldFlds[fieldI++];
......@@ -225,7 +227,7 @@ void Foam::fvMeshDistribute::mapExposedFaces
{
patchFld[i] = oldInternal[oldFaceI];
if (map.flipFaceFlux().found(faceI))
if (oriented && map.flipFaceFlux().found(faceI))
{
patchFld[i] = flipOp()(patchFld[i]);
}
......
......@@ -275,16 +275,14 @@ public:
const fvMesh& sMesh,
const labelList& patchMap,
const labelList& cellMap,
const labelList& faceMap,
const bool negateIfFlipped = true
const labelList& faceMap
);
template<class Type>
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
interpolate
(
const GeometricField<Type, fvsPatchField, surfaceMesh>&,
const bool negateIfFlipped = true
const GeometricField<Type, fvsPatchField, surfaceMesh>&
) const;
//- Map point field
......
......@@ -180,10 +180,11 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> fvMeshSubset::interpolate
const fvMesh& sMesh,
const labelList& patchMap,
const labelList& cellMap,
const labelList& faceMap,
const bool negateIfFlipped
const labelList& faceMap
)
{
const bool negateIfFlipped = vf.oriented()();
// 1. Create the complete field with dummy patch fields
PtrList<fvsPatchField<Type>> patchFields(patchMap.size());
......@@ -342,8 +343,7 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> fvMeshSubset::interpolate
template<class Type>
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> fvMeshSubset::interpolate
(
const GeometricField<Type, fvsPatchField, surfaceMesh>& sf,
const bool negateIfFlipped
const GeometricField<Type, fvsPatchField, surfaceMesh>& sf
) const
{
return interpolate
......@@ -352,8 +352,7 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> fvMeshSubset::interpolate
subMesh(),
patchMap(),
cellMap(),
faceMap(),
negateIfFlipped
faceMap()
);
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -26,6 +26,7 @@ License
#include "IOobject.H"
#include "dictionary.H"
#include "fvMesh.H"
#include "surfaceMesh.H"
#include "fvPatchFieldMapper.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -93,20 +94,15 @@ Foam::fvsPatchField<Type>::fvsPatchField
}
else
{
FatalIOErrorInFunction
(
dict
) << "essential value entry not provided"
FatalIOErrorInFunction(dict)
<< "essential 'value' entry not provided"
<< exit(FatalIOError);
}
}
template<class Type>
Foam::fvsPatchField<Type>::fvsPatchField
(
const fvsPatchField<Type>& ptf
)
Foam::fvsPatchField<Type>::fvsPatchField(const fvsPatchField<Type>& ptf)
:
Field<Type>(ptf),
patch_(ptf.patch_),
......@@ -149,12 +145,10 @@ void Foam::fvsPatchField<Type>::check(const fvsPatchField<Type>& ptf) const
template<class Type>
void Foam::fvsPatchField<Type>::autoMap
(
const fvPatchFieldMapper& m
)
void Foam::fvsPatchField<Type>::autoMap(const fvPatchFieldMapper& m)
{
Field<Type>::autoMap(m);
const bool oriented = internalField_.oriented()();
Field<Type>::autoMap(m, oriented);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment