mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: Updated fieldMinMax function object to handle empty patches
This commit is contained in:
@ -75,6 +75,8 @@ void Foam::fieldMinMax::calcMinMaxFields
|
|||||||
forAll(magFieldBoundary, patchI)
|
forAll(magFieldBoundary, patchI)
|
||||||
{
|
{
|
||||||
const scalarField& mfp = magFieldBoundary[patchI];
|
const scalarField& mfp = magFieldBoundary[patchI];
|
||||||
|
if (mfp.size())
|
||||||
|
{
|
||||||
const vectorField& Cfp = CfBoundary[patchI];
|
const vectorField& Cfp = CfBoundary[patchI];
|
||||||
|
|
||||||
label minPI = findMin(mfp);
|
label minPI = findMin(mfp);
|
||||||
@ -91,6 +93,7 @@ void Foam::fieldMinMax::calcMinMaxFields
|
|||||||
maxCs[procI] = Cfp[maxPI];
|
maxCs[procI] = Cfp[maxPI];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Pstream::gatherList(minVs);
|
Pstream::gatherList(minVs);
|
||||||
Pstream::gatherList(minCs);
|
Pstream::gatherList(minCs);
|
||||||
@ -173,6 +176,8 @@ void Foam::fieldMinMax::calcMinMaxFields
|
|||||||
forAll(fieldBoundary, patchI)
|
forAll(fieldBoundary, patchI)
|
||||||
{
|
{
|
||||||
const Field<Type>& fp = fieldBoundary[patchI];
|
const Field<Type>& fp = fieldBoundary[patchI];
|
||||||
|
if (fp.size())
|
||||||
|
{
|
||||||
const vectorField& Cfp = CfBoundary[patchI];
|
const vectorField& Cfp = CfBoundary[patchI];
|
||||||
|
|
||||||
label minPI = findMin(fp);
|
label minPI = findMin(fp);
|
||||||
@ -189,6 +194,7 @@ void Foam::fieldMinMax::calcMinMaxFields
|
|||||||
maxCs[procI] = Cfp[maxPI];
|
maxCs[procI] = Cfp[maxPI];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Pstream::gatherList(minVs);
|
Pstream::gatherList(minVs);
|
||||||
Pstream::gatherList(minCs);
|
Pstream::gatherList(minCs);
|
||||||
@ -250,7 +256,14 @@ void Foam::fieldMinMax::calcMinMaxFields
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
FatalErrorIn("Foam::fieldMinMax::calcMinMaxFields(const word&)")
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"Foam::fieldMinMax::calcMinMaxFields"
|
||||||
|
"("
|
||||||
|
"const word&, "
|
||||||
|
"const modeType&"
|
||||||
|
")"
|
||||||
|
)
|
||||||
<< "Unknown min/max mode: " << modeTypeNames_[mode_]
|
<< "Unknown min/max mode: " << modeTypeNames_[mode_]
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user