Skip to content

Commit 7cb5b11

Browse files
authored
Fixed a bug in the size check in variance function
1 parent 4657bad commit 7cb5b11

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/adjoint/DAFunction/DAFunctionVariance.C

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ DAFunctionVariance::DAFunctionVariance(
3838
if (mode_ == "surface")
3939
{
4040
// check if the faceSources is set
41-
if (faceSources_.size() == 0)
41+
label size = faceSources_.size();
42+
reduce(size, sumOp<label>());
43+
if (size == 0)
4244
{
4345
FatalErrorIn("") << "surface mode is used but patchToFace is not set!"
4446
<< abort(FatalError);

0 commit comments

Comments
 (0)