From bfe333ff64a8838ddff768cd717f14fad69b7b49 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 8 May 2018 21:15:51 +0100 Subject: [PATCH] Added support for gcc-8.1 --- etc/config.csh/settings | 7 ++-- etc/config.sh/compiler | 5 ++- src/OpenFOAM/containers/Lists/List/ListI.H | 4 +-- .../containers/Lists/PackedList/PackedListI.H | 8 ++--- src/OpenFOAM/db/typeInfo/typeInfo.H | 6 ++-- .../primitives/VectorSpace/VectorSpace.H | 6 +--- .../primitives/VectorSpace/VectorSpaceI.H | 33 +++++++------------ .../reaction/Reactions/Reaction/Reaction.H | 3 +- .../reaction/Reactions/Reaction/ReactionI.H | 9 +---- 9 files changed, 32 insertions(+), 49 deletions(-) diff --git a/etc/config.csh/settings b/etc/config.csh/settings index aa8243d9a..c618f9f21 100644 --- a/etc/config.csh/settings +++ b/etc/config.csh/settings @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -216,7 +216,7 @@ endif switch ("$WM_COMPILER_TYPE") case OpenFOAM: case ThirdParty: - # Default versions of GMP, MPFR and MPC, overide as necessary + # Default versions of GMP, MPFR and MPC, override as necessary set gmp_version=gmp-5.1.2 set mpfr_version=mpfr-3.1.2 set mpc_version=mpc-1.0.1 @@ -240,6 +240,9 @@ case ThirdParty: case Gcc61: set gcc_version=gcc-6.1.0 breaksw + case Gcc81: + set gcc_version=gcc-8.1.0 + breaksw case Clang: # Using clang - not gcc setenv WM_CC 'clang' diff --git a/etc/config.sh/compiler b/etc/config.sh/compiler index 9042a5f17..dac2c1e33 100644 --- a/etc/config.sh/compiler +++ b/etc/config.sh/compiler @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -57,6 +57,9 @@ OpenFOAM | ThirdParty) Gcc61) gcc_version=gcc-6.1.0 ;; + Gcc81) + gcc_version=gcc-8.1.0 + ;; Clang) # Using clang - not gcc export WM_CC='clang' diff --git a/src/OpenFOAM/containers/Lists/List/ListI.H b/src/OpenFOAM/containers/Lists/List/ListI.H index 5709c258e..e760ae43b 100644 --- a/src/OpenFOAM/containers/Lists/List/ListI.H +++ b/src/OpenFOAM/containers/Lists/List/ListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,7 +28,7 @@ License template inline void Foam::List::alloc() { - if (this->size_) + if (this->size_ > 0) { this->v_ = new T[this->size_]; } diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H b/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H index c945ca0ba..4df923d61 100644 --- a/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H +++ b/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -369,7 +369,7 @@ inline void Foam::PackedList::iteratorBase::operator= const unsigned int val ) { - // Lazy evaluation - increase size on assigment + // Lazy evaluation - increase size on assignment if (index_ >= list_->size_) { list_->resize(index_ + 1); @@ -546,8 +546,6 @@ inline void Foam::PackedList::const_iterator::operator= { this->index_ = this->list_->size_; } - - return *this; } @@ -1003,7 +1001,7 @@ inline bool Foam::PackedList::set } else if (i >= size_) { - // Lazy evaluation - increase size on assigment + // Lazy evaluation - increase size on assignment resize(i + 1); } diff --git a/src/OpenFOAM/db/typeInfo/typeInfo.H b/src/OpenFOAM/db/typeInfo/typeInfo.H index 71155aeb8..542a27bea 100644 --- a/src/OpenFOAM/db/typeInfo/typeInfo.H +++ b/src/OpenFOAM/db/typeInfo/typeInfo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -88,7 +88,7 @@ inline To& dynamicCast(From& r) { return dynamic_cast(r); } - catch (std::bad_cast) + catch (const std::bad_cast&) { FatalErrorInFunction << "Attempt to cast type " << typeid(r).name() @@ -109,7 +109,7 @@ inline To& refCast(From& r) { return dynamic_cast(r); } - catch (std::bad_cast) + catch (const std::bad_cast&) { FatalErrorInFunction << "Attempt to cast type " << r.type() diff --git a/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H b/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H index 940294b8e..be204399f 100644 --- a/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H +++ b/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -159,9 +159,6 @@ public: //- Construct from Istream VectorSpace(Istream&); - //- Construct as copy - inline VectorSpace(const VectorSpace&); - //- Construct as copy of a VectorSpace with the same size template inline explicit VectorSpace(const VectorSpace&); @@ -190,7 +187,6 @@ public: inline const Cmpt& operator[](const direction) const; inline Cmpt& operator[](const direction); - inline void operator=(const VectorSpace&); inline void operator+=(const VectorSpace&); inline void operator-=(const VectorSpace&); diff --git a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H index 1a9f5de22..afd654cd3 100644 --- a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H +++ b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,16 +48,6 @@ inline VectorSpace::VectorSpace(const Foam::zero) } -template -inline VectorSpace::VectorSpace -( - const VectorSpace& vs -) -{ - VectorSpaceOps::eqOp(*this, vs, eqOp()); -} - - template template inline VectorSpace::VectorSpace @@ -285,16 +275,6 @@ ConstBlock::operator() } -template -inline void VectorSpace::operator= -( - const VectorSpace& vs -) -{ - VectorSpaceOps::eqOp(*this, vs, eqOp()); -} - - template inline void VectorSpace::operator+= ( @@ -428,6 +408,17 @@ inline scalar mag } +template +inline VectorSpace normalised +( + const VectorSpace& vs +) +{ + const scalar magVs = mag(vs); + return magVs > 0 ? vs/magVs : Zero; +} + + template inline VectorSpace cmptMultiply ( diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H index d96134aac..13f6d9a53 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -242,7 +242,6 @@ public: // Access - inline word& name(); inline const word& name() const; // - Access to basic components of the reaction diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H index 55287cbfd..eba046f64 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,13 +32,6 @@ namespace Foam // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -inline word& Reaction::name() -{ - return name_; -} - - template inline const word& Reaction::name() const {