Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Mark Olesen 2021-01-26 17:06:33 +01:00
commit 8bda4fadbe
9 changed files with 36 additions and 19 deletions

View File

@ -52,7 +52,7 @@ Foam::functionObjects::FUNCTIONOBJECT::FUNCTIONOBJECT
) )
: :
fvMeshFunctionObject(name, runTime, dict), fvMeshFunctionObject(name, runTime, dict),
boolData_(dict.getOrDefault<bool>("boolData"), true), boolData_(dict.getOrDefault<bool>("boolData", true)),
labelData_(dict.get<label>("labelData")), labelData_(dict.get<label>("labelData")),
wordData_(dict.getOrDefault<word>("wordData", "defaultWord")), wordData_(dict.getOrDefault<word>("wordData", "defaultWord")),
scalarData_(dict.getOrDefault<scalar>("scalarData", 1.0)) scalarData_(dict.getOrDefault<scalar>("scalarData", 1.0))

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2017-2019,2021 OpenCFD Ltd. Copyright (C) 2017-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -136,8 +136,8 @@ public:
// Read Functions // Read Functions
//- Read into given buffer from given processor and return the //- Read into given buffer from given processor
// message size // \return the message size
static label read static label read
( (
const commsTypes commsType, const commsTypes commsType,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2014 OpenFOAM Foundation Copyright (C) 2011-2014 OpenFOAM Foundation
Copyright (C) 2017-2018,2021 OpenCFD Ltd. Copyright (C) 2017-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -104,7 +104,7 @@ public:
// Constructors // Constructors
//- Construct given process index to send to and optional buffer size, //- Construct given process index to send to and optional buffer size,
// write format and IO version //- write format and IO version
UOPstream UOPstream
( (
const commsTypes commsType, const commsTypes commsType,

View File

@ -115,8 +115,8 @@ void Foam::primitiveMeshTools::makeCellCentresAndVols
typedef Vector<solveScalar> solveVector; typedef Vector<solveScalar> solveVector;
PrecisionAdaptor<solveVector, vector> tcellCtrs(cellCtrs_s, false); PrecisionAdaptor<solveVector, vector> tcellCtrs(cellCtrs_s, false);
Field<solveVector>& cellCtrs = tcellCtrs.ref();
PrecisionAdaptor<solveScalar, scalar> tcellVols(cellVols_s, false); PrecisionAdaptor<solveScalar, scalar> tcellVols(cellVols_s, false);
Field<solveVector>& cellCtrs = tcellCtrs.ref();
Field<solveScalar>& cellVols = tcellVols.ref(); Field<solveScalar>& cellVols = tcellVols.ref();
// Clear the fields for accumulation // Clear the fields for accumulation

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd. Copyright (C) 2017-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -1034,6 +1034,16 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read
mesh_, mesh_,
dict.subDict("sampledSurfaceDict") dict.subDict("sampledSurfaceDict")
); );
if (sampledPtr_->interpolate())
{
// Should probably ignore interpolate entirely,
// but the oldest isoSurface algorithm requires it!
WarningInFunction
<< type() << ' ' << name() << ": "
<< "sampledSurface with interpolate = true "
<< "is likely incorrect" << nl << nl;
}
} }
Info<< type() << ' ' << name() << ':' << nl Info<< type() << ' ' << name() << ':' << nl

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd. Copyright (C) 2015-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -388,6 +388,15 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
false // serial - already merged false // serial - already merged
); );
// Point data? Should probably disallow
if (sampledPtr_)
{
surfaceWriterPtr_->isPointData() =
sampledPtr_->interpolate();
}
surfaceWriterPtr_->nFields() = 1; // Needed for VTK legacy
surfaceWriterPtr_->write(fieldName, allValues); surfaceWriterPtr_->write(fieldName, allValues);
surfaceWriterPtr_->clear(); surfaceWriterPtr_->clear();

View File

@ -29,7 +29,7 @@ template<class Type>
void Foam::mappedPatchBase::distribute(List<Type>& lst) const void Foam::mappedPatchBase::distribute(List<Type>& lst) const
{ {
const label oldComm(Pstream::warnComm); const label oldComm(Pstream::warnComm);
Pstream::warnComm = map().comm(); Pstream::warnComm = comm_;
switch (mode_) switch (mode_)
{ {
case NEARESTPATCHFACEAMI: case NEARESTPATCHFACEAMI:
@ -96,7 +96,7 @@ template<class Type>
void Foam::mappedPatchBase::reverseDistribute(List<Type>& lst) const void Foam::mappedPatchBase::reverseDistribute(List<Type>& lst) const
{ {
const label oldComm(Pstream::warnComm); const label oldComm(Pstream::warnComm);
Pstream::warnComm = map().comm(); Pstream::warnComm = comm_;
switch (mode_) switch (mode_)
{ {
case NEARESTPATCHFACEAMI: case NEARESTPATCHFACEAMI:
@ -125,7 +125,7 @@ void Foam::mappedPatchBase::reverseDistribute
) const ) const
{ {
const label oldComm(Pstream::warnComm); const label oldComm(Pstream::warnComm);
Pstream::warnComm = map().comm(); Pstream::warnComm = comm_;
switch (mode_) switch (mode_)
{ {
case NEARESTPATCHFACEAMI: case NEARESTPATCHFACEAMI:

View File

@ -27,8 +27,7 @@ Class
Foam::sampledFaceZone Foam::sampledFaceZone
Description Description
A sampledSurface defined by the cell faces corresponding to a threshold A sampledSurface defined by a faceZone or faceZones.
value.
This is often embedded as part of a sampled surfaces function object. This is often embedded as part of a sampled surfaces function object.
@ -287,7 +286,6 @@ public:
) const; ) const;
// Interpolate // Interpolate
//- Interpolate volume field onto surface points //- Interpolate volume field onto surface points

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -416,11 +416,11 @@ bool Foam::surfaceWriter::empty() const
Foam::label Foam::surfaceWriter::size() const Foam::label Foam::surfaceWriter::size() const
{ {
const bool value = const label value =
( (
useComponents_ useComponents_
? surfComp_.faces().empty() ? surfComp_.faces().size()
: surf_.get().faces().empty() : surf_.get().faces().size()
); );
return (parallel_ ? returnReduce(value, sumOp<label>()) : value); return (parallel_ ? returnReduce(value, sumOp<label>()) : value);