STYLE: reduced nesting on return branching

This commit is contained in:
Mark Olesen
2019-02-13 08:06:36 +01:00
committed by Andrew Heather
parent 4bc3b2b9cb
commit 60234ab007
208 changed files with 1052 additions and 1759 deletions

View File

@ -423,30 +423,26 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType
// Content. Defer to shapes.
return volumeType(shapes_.getVolumeType(*this, sample));
}
else
{
// Empty node. Cannot have 'mixed' as its type since not divided
// up and has no items inside it.
FatalErrorInFunction
<< "Sample:" << sample << " node:" << nodeI
<< " with bb:" << nodes_[nodeI].bb_ << nl
<< "Empty subnode has invalid volume type MIXED."
<< abort(FatalError);
return volumeType::UNKNOWN;
}
}
else
{
// Empty node. Cannot have 'mixed' as its type since not divided
// up and has no items inside it.
FatalErrorInFunction
<< "Sample:" << sample << " at node:" << nodeI
<< " octant:" << octant
<< " with bb:" << nod.bb_.subBbox(octant) << nl
<< "Node has invalid volume type " << octantType
<< "Sample:" << sample << " node:" << nodeI
<< " with bb:" << nodes_[nodeI].bb_ << nl
<< "Empty subnode has invalid volume type MIXED."
<< abort(FatalError);
return volumeType::UNKNOWN;
}
FatalErrorInFunction
<< "Sample:" << sample << " at node:" << nodeI
<< " octant:" << octant
<< " with bb:" << nod.bb_.subBbox(octant) << nl
<< "Node has invalid volume type " << octantType
<< abort(FatalError);
return volumeType::UNKNOWN;
}

View File

@ -441,30 +441,26 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType
// Content. Defer to shapes.
return volumeType(shapes_.getVolumeType(*this, sample));
}
else
{
// Empty node. Cannot have 'mixed' as its type since not divided
// up and has no items inside it.
FatalErrorInFunction
<< "Sample:" << sample << " node:" << nodeI
<< " with bb:" << nodes_[nodeI].bb_ << nl
<< "Empty subnode has invalid volume type MIXED."
<< abort(FatalError);
return volumeType::UNKNOWN;
}
}
else
{
// Empty node. Cannot have 'mixed' as its type since not divided
// up and has no items inside it.
FatalErrorInFunction
<< "Sample:" << sample << " at node:" << nodeI
<< " octant:" << octant
<< " with bb:" << nod.bb_.subBbox(octant) << nl
<< "Node has invalid volume type " << octantType
<< "Sample:" << sample << " node:" << nodeI
<< " with bb:" << nodes_[nodeI].bb_ << nl
<< "Empty subnode has invalid volume type MIXED."
<< abort(FatalError);
return volumeType::UNKNOWN;
}
FatalErrorInFunction
<< "Sample:" << sample << " at node:" << nodeI
<< " octant:" << octant
<< " with bb:" << nod.bb_.subBbox(octant) << nl
<< "Node has invalid volume type " << octantType
<< abort(FatalError);
return volumeType::UNKNOWN;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -33,7 +33,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(treeDataCell, 0);
defineTypeNameAndDebug(treeDataCell, 0);
}
@ -178,10 +178,8 @@ bool Foam::treeDataCell::overlaps
{
return cubeBb.overlaps(bbs_[index]);
}
else
{
return cubeBb.overlaps(calcCellBb(cellLabels_[index]));
}
return cubeBb.overlaps(calcCellBb(cellLabels_[index]));
}