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

@ -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) 2013-2016 OpenFOAM Foundation
@ -69,10 +69,8 @@ bool Foam::functionObjects::Lambda2::calc()
-eigenValues(SSplusWW)().component(vector::Y)
);
}
else
{
return false;
}
return false;
}

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) 2016 OpenFOAM Foundation
@ -68,10 +68,8 @@ bool Foam::functionObjects::MachNo::calc()
mag(U)/sqrt(thermo.gamma()*thermo.p()/thermo.rho())
);
}
else
{
return false;
}
return false;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2013-2016 OpenFOAM Foundation
@ -120,10 +120,8 @@ bool Foam::functionObjects::PecletNo::calc()
)
);
}
else
{
return false;
}
return false;
}

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) 2013-2016 OpenFOAM Foundation
@ -63,10 +63,8 @@ bool Foam::functionObjects::Q::calc()
0.5*(sqr(tr(gradU)) - tr(((gradU) & (gradU))))
);
}
else
{
return false;
}
return false;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2013-2016 OpenFOAM Foundation
@ -130,10 +130,8 @@ bool Foam::functionObjects::blendingFactor::read(const dictionary& dict)
return true;
}
else
{
return false;
}
return false;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -104,10 +104,8 @@ bool Foam::functionObjects::columnAverage::columnAverageField
return true;
}
else
{
return false;
}
return false;
}

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) 2016 OpenFOAM Foundation
@ -67,10 +67,8 @@ bool Foam::functionObjects::components::calcComponents()
{
return calcFieldComponents<SurfaceFieldType>();
}
else
{
return false;
}
return false;
}

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) 2017 OpenFOAM Foundation
@ -42,10 +42,8 @@ bool Foam::functionObjects::ddt::calcDdt()
fvc::ddt(lookupObject<VolFieldType>(fieldName_))
);
}
else
{
return false;
}
return false;
}

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) 2012-2016 OpenFOAM Foundation
@ -40,10 +40,8 @@ bool Foam::functionObjects::div::calcDiv()
fvc::div(lookupObject<FieldType>(fieldName_))
);
}
else
{
return false;
}
return false;
}

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
@ -73,10 +73,8 @@ bool Foam::functionObjects::flowType::calc()
(magD - magOmega)/(magD + magOmega + smallMagD)
);
}
else
{
return false;
}
return false;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,10 +39,8 @@ bool Foam::functionObjects::flux::calcVolFlux(const RhoFieldType& rho)
fvc::flux(rho*lookupObject<FieldType>(fieldName_))
);
}
else
{
return false;
}
return false;
}
@ -60,10 +58,8 @@ bool Foam::functionObjects::flux::calcSurFlux(const RhoFieldType& rho)
) & mesh_.Sf()
);
}
else
{
return false;
}
return false;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2012-2016 OpenFOAM Foundation
@ -87,20 +87,18 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::rhoScale
fvPatchField<scalar>::calculatedType()
);
}
else
{
if (!rhoInfInitialised_)
{
FatalErrorInFunction
<< type() << " " << name() << ": "
<< "pressure identified as incompressible, but reference "
<< "density is not set. Please set 'rho' to 'rhoInf', and "
<< "set an appropriate value for 'rhoInf'"
<< exit(FatalError);
}
return dimensionedScalar("rhoInf", dimDensity, rhoInf_)*p;
if (!rhoInfInitialised_)
{
FatalErrorInFunction
<< type() << " " << name() << ": "
<< "pressure identified as incompressible, but reference "
<< "density is not set. Please set 'rho' to 'rhoInf', and "
<< "set an appropriate value for 'rhoInf'"
<< exit(FatalError);
}
return dimensionedScalar("rhoInf", dimDensity, rhoInf_)*p;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -710,10 +710,8 @@ bool Foam::functionObjects::stabilityBlendingFactor::read
return true;
}
else
{
return false;
}
return false;
}

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) 2016 OpenFOAM Foundation
@ -416,10 +416,8 @@ bool Foam::functionObjects::streamFunction::calc()
return store(resultName_, calc(phi));
}
else
{
return false;
}
return false;
}