mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use returnReduceAnd(), returnReduceOr() functions
DOC: document which MPI send/recv are associated with commType
This commit is contained in:
committed by
Andrew Heather
parent
473e14418a
commit
70208a7399
@ -156,7 +156,7 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::setFaceZoneFaces()
|
||||
|
||||
// Could also check this
|
||||
#if 0
|
||||
if (!returnReduce(bool(numFaces), orOp<bool>()))
|
||||
if (!returnReduceOr(numFaces))
|
||||
{
|
||||
WarningInFunction
|
||||
<< type() << ' ' << name() << ": "
|
||||
@ -314,7 +314,7 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::setPatchFaces()
|
||||
|
||||
// Could also check this
|
||||
#if 0
|
||||
if (!returnReduce(bool(numFaces), orOp<bool>()))
|
||||
if (!returnReduceOr(numFaces))
|
||||
{
|
||||
WarningInFunction
|
||||
<< type() << ' ' << name() << ": "
|
||||
@ -807,7 +807,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::weightingFactor
|
||||
// scalar * unit-normal
|
||||
|
||||
// Can skip this check - already used canWeight()
|
||||
/// if (returnReduce(weightField.empty(), andOp<bool>()))
|
||||
/// if (returnReduceAnd(weightField.empty()))
|
||||
/// {
|
||||
/// // No weight field - revert to unweighted form?
|
||||
/// return tmp<scalarField>::New(Sf.size(), scalar(1));
|
||||
@ -835,7 +835,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::areaWeightingFactor
|
||||
// scalar * Area
|
||||
|
||||
// Can skip this check - already used canWeight()
|
||||
/// if (returnReduce(weightField.empty(), andOp<bool>()))
|
||||
/// if (returnReduceAnd(weightField.empty()))
|
||||
/// {
|
||||
/// // No weight field - revert to unweighted form
|
||||
/// return mag(Sf);
|
||||
@ -862,7 +862,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::weightingFactor
|
||||
// vector (dot) unit-normal
|
||||
|
||||
// Can skip this check - already used canWeight()
|
||||
/// if (returnReduce(weightField.empty(), andOp<bool>()))
|
||||
/// if (returnReduceAnd(weightField.empty()))
|
||||
/// {
|
||||
/// // No weight field - revert to unweighted form
|
||||
/// return tmp<scalarField>::New(Sf.size(), scalar(1));
|
||||
@ -903,7 +903,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::areaWeightingFactor
|
||||
// vector (dot) Area
|
||||
|
||||
// Can skip this check - already used canWeight()
|
||||
/// if (returnReduce(weightField.empty(), andOp<bool>()))
|
||||
/// if (returnReduceAnd(weightField.empty()))
|
||||
/// {
|
||||
/// // No weight field - revert to unweighted form
|
||||
/// return mag(Sf);
|
||||
@ -1297,7 +1297,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::write()
|
||||
|
||||
|
||||
// Process the fields
|
||||
if (returnReduce(!vectorWeights.empty(), orOp<bool>()))
|
||||
if (returnReduceOr(!vectorWeights.empty()))
|
||||
{
|
||||
if (scalarWeights.size())
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -60,7 +60,7 @@ inline bool Foam::functionObjects::fieldValues::surfaceFieldValue::canWeight
|
||||
) const
|
||||
{
|
||||
// Non-empty on some processor
|
||||
return returnReduce(!fld.empty(), orOp<bool>());
|
||||
return returnReduceOr(!fld.empty());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -49,7 +49,7 @@ inline bool Foam::functionObjects::fieldValues::volFieldValue::canWeight
|
||||
) const
|
||||
{
|
||||
// Non-empty on some processor
|
||||
return returnReduce(!fld.empty(), orOp<bool>());
|
||||
return returnReduceOr(!fld.empty());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -54,7 +54,7 @@ bool Foam::functionObjects::reference::calc()
|
||||
|
||||
Log << endl;
|
||||
|
||||
return returnReduce(processed, orOp<bool>());
|
||||
return returnReduceOr(processed);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -70,7 +70,7 @@ int Foam::functionObjects::zeroGradient::apply
|
||||
|
||||
const VolFieldType& input = lookupObject<VolFieldType>(inputName);
|
||||
|
||||
if (!returnReduce(accept(input), orOp<bool>()))
|
||||
if (!returnReduceOr(accept(input)))
|
||||
{
|
||||
state = -1;
|
||||
return state;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -82,7 +82,7 @@ bool Foam::functionObjects::dataCloud::writeCloud
|
||||
}
|
||||
|
||||
applyFilter_ = calculateFilter(obrTmp, log);
|
||||
reduce(applyFilter_, orOp<bool>());
|
||||
Pstream::reduceOr(applyFilter_);
|
||||
|
||||
|
||||
// Number of parcels (locally)
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -188,7 +188,7 @@ bool Foam::functionObjects::dataCloud::writeField
|
||||
const List<Type>* fldPtr = obrTmp.findObject<IOField<Type>>(fieldName_);
|
||||
const List<Type>& values = (fldPtr ? *fldPtr : List<Type>());
|
||||
|
||||
if (!returnReduce((fldPtr != nullptr), orOp<bool>()))
|
||||
if (!returnReduceOr(fldPtr != nullptr))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -157,7 +157,7 @@ bool Foam::functionObjects::dsmcFields::write()
|
||||
Member##Ptr = obr_.cfindObject<FieldType>(fldName); \
|
||||
} \
|
||||
\
|
||||
if (returnReduce(!Member##Ptr, orOp<bool>())) \
|
||||
if (returnReduceOr(!Member##Ptr)) \
|
||||
{ \
|
||||
Log << type() << ' ' << name() << " : no " << Name \
|
||||
<< " field found - not calculating\n"; \
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -131,7 +131,7 @@ bool Foam::functionObjects::vtkCloud::writeCloud
|
||||
}
|
||||
|
||||
applyFilter_ = calculateFilter(obrTmp, log);
|
||||
reduce(applyFilter_, orOp<bool>());
|
||||
Pstream::reduceOr(applyFilter_);
|
||||
|
||||
|
||||
// Number of parcels (locally)
|
||||
|
||||
Reference in New Issue
Block a user