From 98d05fa80ab77a0208b3a3ff895e0ab2fe18ecfc Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Sat, 24 Oct 2020 13:32:44 +0200 Subject: [PATCH] STYLE: prefix zero/one with Foam:: qualifier ENH: support construction of zero-sized IndirectList - useful when addressing is to be generated in-place after construction. Eg, indirectPrimitivePatch myPatches ( IndirectList<face>(mesh.faces(), Zero), mesh.points() ); labelList& patchFaces = myPatches.addressing(); patchFaces.resize(...); // populate patchFaces STYLE: add noexcept for zero/one fields and remove old dependency files COMP: correct typedefs for geometricOneField, geometricZeroField --- applications/test/List/Test-List.C | 8 +- applications/test/constantFields/Make/files | 3 + applications/test/constantFields/Make/options | 7 ++ .../test/constantFields/Test-constantFields.C | 63 ++++++++++++ applications/test/field1/Test-field1.C | 6 +- .../Test-tensorFieldFields1.C | 8 +- .../test/tensorFields1/Test-tensorFields1.C | 10 +- .../IndirectLists/IndirectList/IndirectList.H | 15 +-- .../IndirectList/IndirectListI.H | 16 ++++ .../IndirectListBase/IndirectListBase.H | 2 +- .../IndirectListBase/IndirectListBaseI.H | 2 +- .../UIndirectList/UIndirectList.H | 4 +- .../Lists/DynamicList/DynamicList.H | 4 +- .../containers/Lists/FixedList/FixedList.H | 2 +- .../containers/Lists/FixedList/FixedListI.H | 2 +- src/OpenFOAM/containers/Lists/List/List.C | 8 +- src/OpenFOAM/containers/Lists/List/List.H | 10 +- src/OpenFOAM/containers/Lists/List/ListI.H | 4 +- .../Lists/SortableList/SortableList.C | 6 +- .../Lists/SortableList/SortableList.H | 4 +- .../containers/Lists/SubList/SubList.H | 2 +- .../containers/Lists/SubList/SubListI.H | 4 +- src/OpenFOAM/containers/Lists/UList/UList.C | 4 +- src/OpenFOAM/containers/Lists/UList/UList.H | 2 +- .../FieldFields/oneFieldField/oneFieldField.H | 10 +- .../oneFieldField/oneFieldFieldI.H | 1 - .../zeroFieldField/zeroFieldField.H | 13 ++- .../zeroFieldField/zeroFieldFieldI.H | 1 - .../fields/Fields/DynamicField/DynamicField.H | 4 +- src/OpenFOAM/fields/Fields/Field/Field.H | 16 +++- src/OpenFOAM/fields/Fields/Field/FieldI.H | 27 +++++- src/OpenFOAM/fields/Fields/Field/SubField.H | 4 +- src/OpenFOAM/fields/Fields/Field/SubFieldI.H | 4 +- .../fields/Fields/oneField/oneField.H | 18 ++-- .../fields/Fields/oneField/oneFieldI.H | 15 ++- .../fields/Fields/zeroField/zeroField.H | 20 ++-- .../geometricOneField/geometricOneField.H | 96 +++++++++---------- .../geometricOneField/geometricOneFieldI.H | 92 +++++------------- .../geometricZeroField/geometricZeroField.H | 62 +++++++++--- .../geometricZeroField/geometricZeroFieldI.H | 35 ++----- .../matrices/DiagonalMatrix/DiagonalMatrix.C | 2 +- .../matrices/DiagonalMatrix/DiagonalMatrix.H | 2 +- src/OpenFOAM/matrices/Matrix/Matrix.C | 6 +- src/OpenFOAM/matrices/Matrix/Matrix.H | 6 +- src/OpenFOAM/matrices/Matrix/MatrixI.H | 4 +- .../RectangularMatrix/RectangularMatrix.H | 17 +++- .../RectangularMatrix/RectangularMatrixI.H | 6 +- .../matrices/SquareMatrix/SquareMatrix.H | 8 +- .../matrices/SquareMatrix/SquareMatrixI.H | 8 +- .../SymmetricSquareMatrix.H | 4 +- .../SymmetricSquareMatrixI.H | 4 +- src/OpenFOAM/meshes/ijkMesh/IjkField.H | 6 +- src/OpenFOAM/meshes/ijkMesh/IjkFieldI.H | 6 +- .../primitives/nullObject/nullObjectI.H | 1 - .../polynomialEqns/cubicEqn/cubicEqnI.H | 2 +- .../polynomialEqns/linearEqn/linearEqnI.H | 2 +- .../quadraticEqn/quadraticEqnI.H | 2 +- .../primitives/ranges/MinMax/MinMax.H | 4 +- .../primitives/ranges/MinMax/MinMaxI.H | 4 +- .../surfaceInterpolation/surfaceInterpolate.H | 4 +- .../ParticleForces/forceSuSp/forceSuSp.H | 2 +- .../ParticleForces/forceSuSp/forceSuSpI.H | 2 +- 62 files changed, 411 insertions(+), 305 deletions(-) create mode 100644 applications/test/constantFields/Make/files create mode 100644 applications/test/constantFields/Make/options create mode 100644 applications/test/constantFields/Test-constantFields.C delete mode 100644 src/OpenFOAM/fields/FieldFields/oneFieldField/oneFieldFieldI.H delete mode 100644 src/OpenFOAM/fields/FieldFields/zeroFieldField/zeroFieldFieldI.H delete mode 100644 src/OpenFOAM/primitives/nullObject/nullObjectI.H diff --git a/applications/test/List/Test-List.C b/applications/test/List/Test-List.C index a09ac01ab6f..c78ddaac88c 100644 --- a/applications/test/List/Test-List.C +++ b/applications/test/List/Test-List.C @@ -606,14 +606,14 @@ int main(int argc, char *argv[]) } { - labelListList listlist(one(), identity(5)); + labelListList listlist(one{}, identity(5)); Info<<"list-list 1/val:" << listlist << nl; } { labelList content = identity(5); - labelListList listlist(one(), content); + labelListList listlist(one{}, content); Info<<"list-list 1/copy val:" << listlist <<" - from " << content << nl; } @@ -621,13 +621,13 @@ int main(int argc, char *argv[]) { labelList content = identity(5); - labelListList listlist(one(), std::move(content)); + labelListList listlist(one{}, std::move(content)); Info<<"list-list 1/move val:" << listlist <<" - from " << content << nl; } { - labelListList listlist(one(), Zero); + labelListList listlist(one{}, Zero); Info<<"list-list 1/move val:" << listlist << nl; } diff --git a/applications/test/constantFields/Make/files b/applications/test/constantFields/Make/files new file mode 100644 index 00000000000..02ad66be1b5 --- /dev/null +++ b/applications/test/constantFields/Make/files @@ -0,0 +1,3 @@ +Test-constantFields.C + +EXE = $(FOAM_USER_APPBIN)/Test-constantFields diff --git a/applications/test/constantFields/Make/options b/applications/test/constantFields/Make/options new file mode 100644 index 00000000000..d27c95d033d --- /dev/null +++ b/applications/test/constantFields/Make/options @@ -0,0 +1,7 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/test/constantFields/Test-constantFields.C b/applications/test/constantFields/Test-constantFields.C new file mode 100644 index 00000000000..af34d90db54 --- /dev/null +++ b/applications/test/constantFields/Test-constantFields.C @@ -0,0 +1,63 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2020 OpenCFD Ltd. +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Application + Test-constantields + +Description + Simple compilation tests for constant fields + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "geometricOneField.H" +#include "geometricZeroField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + { + geometricZeroField fld0; + geometricOneField fld1; + + Info<< "dims 0: " << fld0.dimensions() << nl; + Info<< "internal 0: " << scalar(fld0.internalField()[0]) << nl; + Info<< "boundary 0: " << scalar(fld0.boundaryField()[0][0]) << nl; + + Info<< "dims 1: " << fld1.dimensions() << nl; + Info<< "internal 1: " << scalar(fld1.internalField()[0]) << nl; + Info<< "boundary 1: " << scalar(fld1.boundaryField()[0][0]) << nl; + } + + Info<< "\nDone\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/test/field1/Test-field1.C b/applications/test/field1/Test-field1.C index 77e046d1617..2cd6bc6c01d 100644 --- a/applications/test/field1/Test-field1.C +++ b/applications/test/field1/Test-field1.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -152,7 +152,7 @@ typename outerProduct1<Type>::type mySumSqr(const UList<Type>& f) int main(int argc, char *argv[]) { - scalarField sfield(10, one()); + scalarField sfield(10, one{}); forAll(sfield, i) { @@ -165,7 +165,7 @@ int main(int argc, char *argv[]) Info<< "negated: " << sfield << nl; // Does not compile (ambiguous) - // boolField lfield(10, one()); + // boolField lfield(10, one{}); boolField lfield(10, true); diff --git a/applications/test/tensorFieldFields1/Test-tensorFieldFields1.C b/applications/test/tensorFieldFields1/Test-tensorFieldFields1.C index 3c93f17753f..ad9cf11ddf2 100644 --- a/applications/test/tensorFieldFields1/Test-tensorFieldFields1.C +++ b/applications/test/tensorFieldFields1/Test-tensorFieldFields1.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) Info<< nl << "tensorFieldField" << nl; FieldField<Field, tensor> tff1(1); - tff1.set(0, new tensorField(1, t19)); + tff1.set(0, new tensorField(one{}, t19)); FixedList<FieldField<Field, scalar>, 9> cmpts; allocComponents(cmpts, 1); @@ -178,7 +178,7 @@ int main(int argc, char *argv[]) Info<< nl << "symmTensorField" << nl; FieldField<Field, symmTensor> sf1(1); - sf1.set(0, new symmTensorField(1, symmTensor(1, 2, 3, 4, 5, 6))); + sf1.set(0, new symmTensorField(one{}, symmTensor(1, 2, 3, 4, 5, 6))); FixedList<FieldField<Field, scalar>, 6> cmpts; allocComponents(cmpts, 1); @@ -224,7 +224,7 @@ int main(int argc, char *argv[]) Info<< nl << "sphericalTensorField" << nl; FieldField<Field, sphericalTensor> sf1(1); - sf1.set(0, new sphericalTensorField(1, sphericalTensor(4))); + sf1.set(0, new sphericalTensorField(one{}, sphericalTensor(4))); FixedList<FieldField<Field, scalar>, 1> cmpts; allocComponents(cmpts, 1); diff --git a/applications/test/tensorFields1/Test-tensorFields1.C b/applications/test/tensorFields1/Test-tensorFields1.C index 9604704f25e..c6e0598bd91 100644 --- a/applications/test/tensorFields1/Test-tensorFields1.C +++ b/applications/test/tensorFields1/Test-tensorFields1.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) tensorField tf1(2, tensor(1, 2, 3, 4, 5, 6, 7, 8, 9)); tf1.last() = tf1.last().T(); - scalarField f1(2, one()); + scalarField f1(2, one{}); symmTensorField sf1(2, symmTensor::one); symmTensorField sf2(2, symmTensor::one); @@ -210,9 +210,9 @@ int main(int argc, char *argv[]) { Info<< nl << "sphericalTensorField" << nl; - scalarField f1(2, one()); - sphericalTensorField sf1(2, 1); - sphericalTensorField sf2(2, 2); + scalarField f1(2, one{}); + sphericalTensorField sf1(2, sphericalTensor(1)); + sphericalTensorField sf2(2, sphericalTensor(2)); tensorField tf1(2, tensor::one); Info<< (tf1 & sf2) << nl; diff --git a/src/OpenFOAM/containers/IndirectLists/IndirectList/IndirectList.H b/src/OpenFOAM/containers/IndirectLists/IndirectList/IndirectList.H index f79a9a6c274..63c43d47927 100644 --- a/src/OpenFOAM/containers/IndirectLists/IndirectList/IndirectList.H +++ b/src/OpenFOAM/containers/IndirectLists/IndirectList/IndirectList.H @@ -31,7 +31,7 @@ Description A List with indirect addressing. See also - Foam::UIndirectList for a version without any addressing allocation. + Foam::UIndirectList for a version without addressing allocation. SourceFiles IndirectListI.H @@ -63,19 +63,22 @@ public: // Constructors - //- Copy construct addressing, shallow copy values list reference + //- Copy construct addressing, shallow copy values reference inline IndirectList(const UList<T>& values, const labelUList& addr); - //- Move construct addressing, shallow copy values list reference + //- Move construct addressing, shallow copy values reference inline IndirectList(const UList<T>& values, labelList&& addr); - //- Copy construct addressing, shallow copy values list reference + //- Zero-sized addressing, shallow copy values reference + inline IndirectList(const UList<T>& values, const Foam::zero); + + //- Copy construct addressing, shallow copy values reference inline IndirectList(const IndirectList<T>& list); - //- Move construct addressing, shallow copy values list reference + //- Move construct addressing, shallow copy values reference inline IndirectList(IndirectList<T>&& list); - //- Copy construct addressing, shallow copy values list reference + //- Copy construct addressing, shallow copy values reference inline explicit IndirectList(const UIndirectList<T>& list); diff --git a/src/OpenFOAM/containers/IndirectLists/IndirectList/IndirectListI.H b/src/OpenFOAM/containers/IndirectLists/IndirectList/IndirectListI.H index 13e8dcd7c51..76b34158448 100644 --- a/src/OpenFOAM/containers/IndirectLists/IndirectList/IndirectListI.H +++ b/src/OpenFOAM/containers/IndirectLists/IndirectList/IndirectListI.H @@ -60,6 +60,22 @@ inline Foam::IndirectList<T>::IndirectList {} +template<class T> +inline Foam::IndirectList<T>::IndirectList +( + const UList<T>& values, + const Foam::zero +) +: + IndirectListAddressing<labelList>(labelList()), // zero-size addressing + UIndirectList<T> + ( + values, + IndirectListAddressing<labelList>::addressing() + ) +{} + + template<class T> inline Foam::IndirectList<T>::IndirectList(const IndirectList<T>& list) : diff --git a/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBase.H b/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBase.H index ac10191c7bc..95fa0d3fe69 100644 --- a/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBase.H +++ b/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBase.H @@ -215,7 +215,7 @@ public: inline void operator=(const T& val); //- Assignment of all entries to zero - inline void operator=(const zero); + inline void operator=(const Foam::zero); //- Deep copy values from a list of the addressed elements // Fatal if list sizes are not identical diff --git a/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBaseI.H b/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBaseI.H index db117469e7f..bc1aa07431f 100644 --- a/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBaseI.H +++ b/src/OpenFOAM/containers/IndirectLists/IndirectListBase/IndirectListBaseI.H @@ -156,7 +156,7 @@ inline void Foam::IndirectListBase<T, Addr>::operator=(const T& val) template<class T, class Addr> -inline void Foam::IndirectListBase<T, Addr>::operator=(const zero) +inline void Foam::IndirectListBase<T, Addr>::operator=(const Foam::zero) { // Or std::fill(this->begin(), this->end(), Zero); for (const label idx : addr_) diff --git a/src/OpenFOAM/containers/IndirectLists/UIndirectList/UIndirectList.H b/src/OpenFOAM/containers/IndirectLists/UIndirectList/UIndirectList.H index f252a7921dd..8fc20ac6fe1 100644 --- a/src/OpenFOAM/containers/IndirectLists/UIndirectList/UIndirectList.H +++ b/src/OpenFOAM/containers/IndirectLists/UIndirectList/UIndirectList.H @@ -71,13 +71,13 @@ public: // Constructors - //- Shallow copy values and addressing arrays + //- Shallow copy values and addressing UIndirectList(const UList<T>& values, const labelUList& addr) : IndirectListBase<T, labelUList>(values, addr) {} - //- Copy construct (shallow copy of values and addressing arrays) + //- Copy construct (shallow copy values and addressing) UIndirectList(const UIndirectList<T>& list) : UIndirectList<T>(list.values(), list.addressing()) diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H index 2170385c51a..9a81878b5d9 100644 --- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H +++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H @@ -124,7 +124,7 @@ public: inline DynamicList(const label nElem, const T& val); //- Construct with given size initializing all elements to zero - inline DynamicList(const label nElem, const zero); + inline DynamicList(const label nElem, const Foam::zero); //- Copy construct. inline DynamicList(const DynamicList<T, SizeMin>& lst); @@ -319,7 +319,7 @@ public: inline void operator=(const T& val); //- Assignment of all entries to zero - inline void operator=(const zero); + inline void operator=(const Foam::zero); //- Assignment to UList inline void operator=(const UList<T>& lst); diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H index 6c0361c5497..ac652d033d9 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H @@ -150,7 +150,7 @@ public: inline explicit FixedList(const T& val); //- Construct and initialize all entries to zero - inline explicit FixedList(const zero); + inline explicit FixedList(const Foam::zero); //- Copy construct from C-array inline explicit FixedList(const T list[N]); diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H index bb24c9a64eb..e93be1b5fa7 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H @@ -53,7 +53,7 @@ inline Foam::FixedList<T, N>::FixedList(const T& val) template<class T, unsigned N> -inline Foam::FixedList<T, N>::FixedList(const zero) +inline Foam::FixedList<T, N>::FixedList(const Foam::zero) { for (unsigned i=0; i<N; ++i) { diff --git a/src/OpenFOAM/containers/Lists/List/List.C b/src/OpenFOAM/containers/Lists/List/List.C index 7dbb9cc9b2b..302529f81fb 100644 --- a/src/OpenFOAM/containers/Lists/List/List.C +++ b/src/OpenFOAM/containers/Lists/List/List.C @@ -132,7 +132,7 @@ Foam::List<T>::List(const label len, const T& val) template<class T> -Foam::List<T>::List(const label len, const zero) +Foam::List<T>::List(const label len, const Foam::zero) : UList<T>(nullptr, len) { @@ -157,7 +157,7 @@ Foam::List<T>::List(const label len, const zero) template<class T> -Foam::List<T>::List(const one, const T& val) +Foam::List<T>::List(const Foam::one, const T& val) : UList<T>(new T[1], 1) { @@ -166,7 +166,7 @@ Foam::List<T>::List(const one, const T& val) template<class T> -Foam::List<T>::List(const one, T&& val) +Foam::List<T>::List(const Foam::one, T&& val) : UList<T>(new T[1], 1) { @@ -175,7 +175,7 @@ Foam::List<T>::List(const one, T&& val) template<class T> -Foam::List<T>::List(const one, const zero) +Foam::List<T>::List(const Foam::one, const Foam::zero) : UList<T>(new T[1], 1) { diff --git a/src/OpenFOAM/containers/Lists/List/List.H b/src/OpenFOAM/containers/Lists/List/List.H index 3f8b19d71eb..fb07dc4b951 100644 --- a/src/OpenFOAM/containers/Lists/List/List.H +++ b/src/OpenFOAM/containers/Lists/List/List.H @@ -133,16 +133,16 @@ public: List(const label len, const T& val); //- Construct with given size initializing all elements to zero - List(const label len, const zero); + List(const label len, const Foam::zero); //- Construct with length=1, copying the value as the only content - List(const one, const T& val); + List(const Foam::one, const T& val); //- Construct with length=1, moving the value as the only content - List(const one, T&& val); + List(const Foam::one, T&& val); //- Construct with length=1, initializing content to zero - List(const one, const zero); + List(const Foam::one, const Foam::zero); //- Copy construct from list List(const List<T>& a); @@ -283,7 +283,7 @@ public: inline void operator=(const T& val); //- Assignment of all entries to zero - inline void operator=(const zero); + inline void operator=(const Foam::zero); //- Move assignment. Takes constant time void operator=(List<T>&& list); diff --git a/src/OpenFOAM/containers/Lists/List/ListI.H b/src/OpenFOAM/containers/Lists/List/ListI.H index f57187f9793..a7b0aca30c5 100644 --- a/src/OpenFOAM/containers/Lists/List/ListI.H +++ b/src/OpenFOAM/containers/Lists/List/ListI.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -242,7 +242,7 @@ inline void Foam::List<T>::operator=(const T& val) template<class T> -inline void Foam::List<T>::operator=(const zero) +inline void Foam::List<T>::operator=(const Foam::zero) { UList<T>::operator=(Zero); } diff --git a/src/OpenFOAM/containers/Lists/SortableList/SortableList.C b/src/OpenFOAM/containers/Lists/SortableList/SortableList.C index 4d3d755a2fd..5d006387ee3 100644 --- a/src/OpenFOAM/containers/Lists/SortableList/SortableList.C +++ b/src/OpenFOAM/containers/Lists/SortableList/SortableList.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,9 +46,9 @@ inline Foam::SortableList<T>::SortableList(const label size) template<class T> -inline Foam::SortableList<T>::SortableList(const label size, const zero) +inline Foam::SortableList<T>::SortableList(const label size, const Foam::zero) : - List<T>(size, zero()) + List<T>(size, Zero) {} diff --git a/src/OpenFOAM/containers/Lists/SortableList/SortableList.H b/src/OpenFOAM/containers/Lists/SortableList/SortableList.H index 263c56e411f..51da600d8eb 100644 --- a/src/OpenFOAM/containers/Lists/SortableList/SortableList.H +++ b/src/OpenFOAM/containers/Lists/SortableList/SortableList.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -81,7 +81,7 @@ public: //- Construct zero-initialized with given size, sort later. // The indices remain empty until the list is sorted - inline SortableList(const label size, const zero); + inline SortableList(const label size, const Foam::zero); //- Construct given size and initial value, sorting later. // The indices remain empty until the list is sorted diff --git a/src/OpenFOAM/containers/Lists/SubList/SubList.H b/src/OpenFOAM/containers/Lists/SubList/SubList.H index 02ab2d896ed..061028554c5 100644 --- a/src/OpenFOAM/containers/Lists/SubList/SubList.H +++ b/src/OpenFOAM/containers/Lists/SubList/SubList.H @@ -135,7 +135,7 @@ public: inline void operator=(const T& val); //- Assign all entries to zero - inline void operator=(const zero); + inline void operator=(const Foam::zero); }; diff --git a/src/OpenFOAM/containers/Lists/SubList/SubListI.H b/src/OpenFOAM/containers/Lists/SubList/SubListI.H index 796f09371bc..3ec6aa5fa34 100644 --- a/src/OpenFOAM/containers/Lists/SubList/SubListI.H +++ b/src/OpenFOAM/containers/Lists/SubList/SubListI.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -143,7 +143,7 @@ inline void Foam::SubList<T>::operator=(const T& val) template<class T> -inline void Foam::SubList<T>::operator=(const zero) +inline void Foam::SubList<T>::operator=(const Foam::zero) { UList<T>::operator=(Zero); } diff --git a/src/OpenFOAM/containers/Lists/UList/UList.C b/src/OpenFOAM/containers/Lists/UList/UList.C index 6564cf66423..118c4e1fc07 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.C +++ b/src/OpenFOAM/containers/Lists/UList/UList.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -172,7 +172,7 @@ void Foam::UList<T>::operator=(const T& val) template<class T> -void Foam::UList<T>::operator=(const zero) +void Foam::UList<T>::operator=(const Foam::zero) { const label len = this->size(); diff --git a/src/OpenFOAM/containers/Lists/UList/UList.H b/src/OpenFOAM/containers/Lists/UList/UList.H index 19c8321dcd0..4335993228d 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.H +++ b/src/OpenFOAM/containers/Lists/UList/UList.H @@ -365,7 +365,7 @@ public: void operator=(const T& val); //- Assignment of all entries to zero - void operator=(const zero); + void operator=(const Foam::zero); // Random access iterator (non-const) diff --git a/src/OpenFOAM/fields/FieldFields/oneFieldField/oneFieldField.H b/src/OpenFOAM/fields/FieldFields/oneFieldField/oneFieldField.H index 809e213b697..c6d31e6aca3 100644 --- a/src/OpenFOAM/fields/FieldFields/oneFieldField/oneFieldField.H +++ b/src/OpenFOAM/fields/FieldFields/oneFieldField/oneFieldField.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -59,15 +59,15 @@ public: // Constructors - //- Construct null - oneFieldField() = default; + //- Default construct + oneFieldField() noexcept = default; // Member Operators - oneField operator[](const label) const + oneField operator[](const label) const noexcept { - return oneField(); + return oneField{}; } }; diff --git a/src/OpenFOAM/fields/FieldFields/oneFieldField/oneFieldFieldI.H b/src/OpenFOAM/fields/FieldFields/oneFieldField/oneFieldFieldI.H deleted file mode 100644 index 7cec1b4541d..00000000000 --- a/src/OpenFOAM/fields/FieldFields/oneFieldField/oneFieldFieldI.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/OpenFOAM/fields/FieldFields/zeroFieldField/zeroFieldField.H b/src/OpenFOAM/fields/FieldFields/zeroFieldField/zeroFieldField.H index 200affc60de..1a2aa0f5a59 100644 --- a/src/OpenFOAM/fields/FieldFields/zeroFieldField/zeroFieldField.H +++ b/src/OpenFOAM/fields/FieldFields/zeroFieldField/zeroFieldField.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,27 +48,26 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class zeroField Declaration + Class zeroFieldField Declaration \*---------------------------------------------------------------------------*/ class zeroFieldField : public zero { - public: // Constructors - //- Construct null - zeroFieldField() = default; + //- Default construct + zeroFieldField() noexcept = default; // Member Operators - zeroField operator[](const label) const + zeroField operator[](const label) const noexcept { - return zeroField(); + return zeroField{}; } }; diff --git a/src/OpenFOAM/fields/FieldFields/zeroFieldField/zeroFieldFieldI.H b/src/OpenFOAM/fields/FieldFields/zeroFieldField/zeroFieldFieldI.H deleted file mode 100644 index 7cec1b4541d..00000000000 --- a/src/OpenFOAM/fields/FieldFields/zeroFieldField/zeroFieldFieldI.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H index fcf932f3ed0..75761896c6a 100644 --- a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H +++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -112,7 +112,7 @@ public: inline DynamicField(const label len, const T& val); //- Construct given size and initial value of zero - inline DynamicField(const label len, const zero); + inline DynamicField(const label len, const Foam::zero); //- Copy construct inline DynamicField(const DynamicField<T, SizeMin>& list); diff --git a/src/OpenFOAM/fields/Fields/Field/Field.H b/src/OpenFOAM/fields/Fields/Field/Field.H index 9737bbcab69..916c0944a15 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.H +++ b/src/OpenFOAM/fields/Fields/Field/Field.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2015-2019 OpenCFD Ltd. + Copyright (C) 2015-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -81,7 +81,6 @@ class Field public FieldBase, public List<Type> { - public: //- Component type @@ -114,7 +113,16 @@ public: inline Field(const label len, const Type& val); //- Construct given size and initial values of zero - inline Field(const label len, const zero); + inline Field(const label len, const Foam::zero); + + //- Construct with length=1, copying the value as the only content + inline Field(const Foam::one, const Type& val); + + //- Construct with length=1, moving the value as the only content + inline Field(const Foam::one, Type&& val); + + //- Construct with length=1, initializing content to zero + inline Field(const Foam::one, const Foam::zero); //- Copy construct inline Field(const Field<Type>& fld); @@ -379,7 +387,7 @@ public: //- Value assignment inline void operator=(const Type& val); - inline void operator=(const zero); + inline void operator=(const Foam::zero); template<class Form, class Cmpt, direction nCmpt> void operator=(const VectorSpace<Form,Cmpt,nCmpt>&); diff --git a/src/OpenFOAM/fields/Fields/Field/FieldI.H b/src/OpenFOAM/fields/Fields/Field/FieldI.H index 48984401dad..111c87115ec 100644 --- a/src/OpenFOAM/fields/Fields/Field/FieldI.H +++ b/src/OpenFOAM/fields/Fields/Field/FieldI.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -49,12 +49,33 @@ inline Foam::Field<Type>::Field(const label len, const Type& val) template<class Type> -inline Foam::Field<Type>::Field(const label len, const zero) +inline Foam::Field<Type>::Field(const label len, const Foam::zero) : List<Type>(len, Zero) {} +template<class Type> +inline Foam::Field<Type>::Field(const Foam::one, const Type& val) +: + List<Type>(Foam::one{}, val) +{} + + +template<class Type> +inline Foam::Field<Type>::Field(const Foam::one, Type&& val) +: + List<Type>(Foam::one{}, std::move(val)) +{} + + +template<class Type> +inline Foam::Field<Type>::Field(const Foam::one, const Foam::zero) +: + List<Type>(Foam::one{}, Zero) +{} + + template<class Type> inline Foam::Field<Type>::Field(const Field<Type>& fld) : @@ -181,7 +202,7 @@ inline void Foam::Field<Type>::operator=(const Type& val) template<class Type> -inline void Foam::Field<Type>::operator=(const zero) +inline void Foam::Field<Type>::operator=(const Foam::zero) { List<Type>::operator=(Zero); } diff --git a/src/OpenFOAM/fields/Fields/Field/SubField.H b/src/OpenFOAM/fields/Fields/Field/SubField.H index 7eb0979024a..324c3264225 100644 --- a/src/OpenFOAM/fields/Fields/Field/SubField.H +++ b/src/OpenFOAM/fields/Fields/Field/SubField.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -143,7 +143,7 @@ public: inline void operator=(const Type& val); //- Assign all entries to zero - inline void operator=(const zero); + inline void operator=(const Foam::zero); //- Copy assign via UList operator. Takes linear time. template<class Form, direction Ncmpts> diff --git a/src/OpenFOAM/fields/Fields/Field/SubFieldI.H b/src/OpenFOAM/fields/Fields/Field/SubFieldI.H index d14b9bc3ddf..36afaf93fa2 100644 --- a/src/OpenFOAM/fields/Fields/Field/SubFieldI.H +++ b/src/OpenFOAM/fields/Fields/Field/SubFieldI.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -161,7 +161,7 @@ inline void Foam::SubField<Type>::operator=(const Type& val) template<class Type> -inline void Foam::SubField<Type>::operator=(const zero) +inline void Foam::SubField<Type>::operator=(const Foam::zero) { SubList<Type>::operator=(Zero); } diff --git a/src/OpenFOAM/fields/Fields/oneField/oneField.H b/src/OpenFOAM/fields/Fields/oneField/oneField.H index c940233995c..523437756e3 100644 --- a/src/OpenFOAM/fields/Fields/oneField/oneField.H +++ b/src/OpenFOAM/fields/Fields/oneField/oneField.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -57,30 +57,30 @@ class oneField { public: - // Public typedefs + // Public Typedefs typedef oneField FieldType; // Constructors - //- Construct null - oneField() = default; + //- Default construct + oneField() noexcept = default; // Member Functions - oneField field() const + oneField field() const noexcept { - return oneField(); + return oneField{}; } // Member Operators - one operator[](const label) const + one operator[](const label) const noexcept { - return one(); + return one{}; } }; @@ -91,6 +91,8 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Global Operators + #include "oneFieldI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/Fields/oneField/oneFieldI.H b/src/OpenFOAM/fields/Fields/oneField/oneFieldI.H index bf0e4d0647e..80708081e42 100644 --- a/src/OpenFOAM/fields/Fields/oneField/oneFieldI.H +++ b/src/OpenFOAM/fields/Fields/oneField/oneFieldI.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,17 +31,26 @@ namespace Foam // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * // -inline const oneField& operator*(const oneField& of, const oneField&) +inline const oneField& operator* +( + const oneField& of, + const oneField& /*ignore*/ +) { return of; } -inline const oneField& operator/(const oneField& of, const oneField&) +inline const oneField& operator/ +( + const oneField& of, + const oneField& /*ignore*/ +) { return of; } + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/fields/Fields/zeroField/zeroField.H b/src/OpenFOAM/fields/Fields/zeroField/zeroField.H index 0269daccc4d..2969ec1393d 100644 --- a/src/OpenFOAM/fields/Fields/zeroField/zeroField.H +++ b/src/OpenFOAM/fields/Fields/zeroField/zeroField.H @@ -59,33 +59,33 @@ public: // Constructors - //- Construct null - zeroField() = default; + //- Default construct + zeroField() noexcept = default; // Member Functions - zeroField field() const + zeroField field() const noexcept { - return zeroField(); + return zeroField{}; } // Member Operators - scalar operator[](const label) const + scalar operator[](const label) const noexcept { return scalar(0); } - zeroField operator()() const + zeroField operator()() const noexcept { - return zeroField(); + return zeroField{}; } - zeroField operator-() const + zeroField operator-() const noexcept { - return zeroField(); + return zeroField{}; } }; @@ -96,6 +96,8 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Global Operators + #include "zeroFieldI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneField.H b/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneField.H index 9676fafde0d..7e2bf6320c3 100644 --- a/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneField.H +++ b/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -56,78 +57,73 @@ class geometricOneField : public one { - public: - // Public typedefs + // Public Typedefs typedef oneField Internal; typedef oneField Patch; typedef oneFieldField Boundary; typedef one cmptType; - // Constructors - - //- Construct null - geometricOneField() - {} - - - // Member Operators - inline const dimensionSet& dimensions() const; + // Constructors - inline one operator[](const label) const; + //- Default construct + geometricOneField() noexcept = default; - inline oneField field() const; - inline oneField oldTime() const; + // Member Functions - inline Internal operator()() const; + const dimensionSet& dimensions() const noexcept + { + return dimless; + } - inline Internal v() const; + oneField field() const noexcept + { + return oneField{}; + } - inline typename Internal::FieldType primitiveField() const; + oneField oldTime() const noexcept + { + return oneField{}; + } - inline Boundary boundaryField() const; -}; + Internal internalField() const noexcept + { + return Internal{}; + } + Internal primitiveField() const noexcept + { + return Internal{}; + } -inline const geometricOneField& operator* -( - const geometricOneField&, - const geometricOneField& -); + Boundary boundaryField() const noexcept + { + return Boundary{}; + } -inline const geometricOneField::Internal& operator* -( - const geometricOneField::Internal&, - const geometricOneField& -); + // Same as internalField() + Internal v() const noexcept + { + return Internal{}; + } -inline const geometricOneField::Internal& operator* -( - const geometricOneField&, - const geometricOneField::Internal& -); -inline const geometricOneField& operator/ -( - const geometricOneField&, - const geometricOneField& -); + // Member Operators -inline const geometricOneField::Internal& operator/ -( - const geometricOneField::Internal&, - const geometricOneField& -); + one operator[](const label) const noexcept + { + return one{}; + } -inline const geometricOneField::Internal& operator/ -( - const geometricOneField&, - const geometricOneField::Internal& -); + Internal operator()() const noexcept + { + return Internal{}; + } +}; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -136,6 +132,8 @@ inline const geometricOneField::Internal& operator/ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Global Operators + #include "geometricOneFieldI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneFieldI.H b/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneFieldI.H index dc78a4c9b17..3e3837f25bd 100644 --- a/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneFieldI.H +++ b/src/OpenFOAM/fields/GeometricFields/geometricOneField/geometricOneFieldI.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,85 +26,34 @@ License \*---------------------------------------------------------------------------*/ -#include "geometricOneField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -inline const Foam::dimensionSet& Foam::geometricOneField::dimensions() const -{ - return dimless; -} - - -inline Foam::one Foam::geometricOneField::operator[](const label) const +namespace Foam { - return one(); -} +// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * // -inline Foam::oneField Foam::geometricOneField::field() const -{ - return oneField(); -} - - -inline Foam::oneField Foam::geometricOneField::oldTime() const -{ - return oneField(); -} - - -inline Foam::geometricOneField::Internal -Foam::geometricOneField::operator()() const -{ - return Internal(); -} - - -inline Foam::geometricOneField::Internal -Foam::geometricOneField::v() const -{ - return Internal(); -} - - -inline typename Foam::geometricOneField::Internal::FieldType -Foam::geometricOneField::primitiveField() const -{ - return typename Internal::FieldType(); -} - - -inline Foam::geometricOneField::Boundary -Foam::geometricOneField::boundaryField() const -{ - return Boundary(); -} - - -inline const Foam::geometricOneField& Foam::operator* +inline const geometricOneField& operator* ( - const geometricOneField& gof, - const geometricOneField& + const geometricOneField& of, + const geometricOneField& /*ignore*/ ) { - return gof; + return of; } -inline const Foam::geometricOneField::Internal& Foam::operator* +inline const geometricOneField::Internal& operator* ( const geometricOneField::Internal& of, - const geometricOneField& + const geometricOneField& /*ignore*/ ) { return of; } -inline const Foam::geometricOneField::Internal& Foam::operator* +inline const geometricOneField::Internal& operator* ( - const geometricOneField&, + const geometricOneField& /*ignore*/, const geometricOneField::Internal& of ) { @@ -111,29 +61,29 @@ inline const Foam::geometricOneField::Internal& Foam::operator* } -inline const Foam::geometricOneField& Foam::operator/ +inline const geometricOneField& operator/ ( - const geometricOneField& gof, - const geometricOneField& + const geometricOneField& of, + const geometricOneField& /*ignore*/ ) { - return gof; + return of; } -inline const Foam::geometricOneField::Internal& Foam::operator/ +inline const geometricOneField::Internal& operator/ ( const geometricOneField::Internal& of, - const geometricOneField& + const geometricOneField& /*ignore*/ ) { return of; } -inline const Foam::geometricOneField::Internal& Foam::operator/ +inline const geometricOneField::Internal& operator/ ( - const geometricOneField&, + const geometricOneField& /*ignore*/, const geometricOneField::Internal& of ) { @@ -141,4 +91,8 @@ inline const Foam::geometricOneField::Internal& Foam::operator/ } +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + // ************************************************************************* // diff --git a/src/OpenFOAM/fields/GeometricFields/geometricZeroField/geometricZeroField.H b/src/OpenFOAM/fields/GeometricFields/geometricZeroField/geometricZeroField.H index 8a86cb787bb..957ed6f391a 100644 --- a/src/OpenFOAM/fields/GeometricFields/geometricZeroField/geometricZeroField.H +++ b/src/OpenFOAM/fields/GeometricFields/geometricZeroField/geometricZeroField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -56,10 +57,9 @@ class geometricZeroField : public zero { - public: - // Public typedefs + // Public Typedefs typedef zeroField Internal; typedef zeroField Patch; @@ -69,24 +69,60 @@ public: // Constructors - //- Construct null - geometricZeroField() - {} + //- Default construct + geometricZeroField() noexcept = default; - // Member Operators + // Member Functions + + const dimensionSet& dimensions() const noexcept + { + return dimless; + } + + zeroField field() const noexcept + { + return zeroField{}; + } + + zeroField oldTime() const noexcept + { + return zeroField{}; + } - inline const dimensionSet& dimensions() const; + Internal internalField() const noexcept + { + return Internal{}; + } - inline scalar operator[](const label) const; + Internal primitiveField() const noexcept + { + return Internal{}; + } - inline zeroField field() const; + Boundary boundaryField() const noexcept + { + return Boundary{}; + } - inline zeroField operator()() const; + // Same as internalField() + Internal v() const noexcept + { + return Internal{}; + } - inline zeroField oldTime() const; - inline zeroFieldField boundaryField() const; + // Member Operators + + scalar operator[](const label) const noexcept + { + return 0; + } + + Internal operator()() const noexcept + { + return Internal{}; + } }; @@ -96,6 +132,8 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Global Operators + #include "geometricZeroFieldI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/GeometricFields/geometricZeroField/geometricZeroFieldI.H b/src/OpenFOAM/fields/GeometricFields/geometricZeroField/geometricZeroFieldI.H index 311a19b99e7..eeaa69743ef 100644 --- a/src/OpenFOAM/fields/GeometricFields/geometricZeroField/geometricZeroFieldI.H +++ b/src/OpenFOAM/fields/GeometricFields/geometricZeroField/geometricZeroFieldI.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,39 +25,16 @@ License \*---------------------------------------------------------------------------*/ -#include "geometricZeroField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -inline const Foam::dimensionSet& Foam::geometricZeroField::dimensions() const -{ - return dimless; -} - -inline Foam::scalar Foam::geometricZeroField::operator[](const label) const +namespace Foam { - return scalar(0); -} -inline Foam::zeroField Foam::geometricZeroField::field() const -{ - return zeroField(); -} +// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * // -inline Foam::zeroField Foam::geometricZeroField::operator()() const -{ - return zeroField(); -} +// None defined -inline Foam::zeroField Foam::geometricZeroField::oldTime() const -{ - return zeroField(); -} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -inline Foam::zeroFieldField Foam::geometricZeroField::boundaryField() const -{ - return zeroFieldField(); -} +} // End namespace Foam // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.C b/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.C index 1d5146b4b71..df786419ce0 100644 --- a/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.C +++ b/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.C @@ -38,7 +38,7 @@ Foam::DiagonalMatrix<Type>::DiagonalMatrix(const label n) template<class Type> -Foam::DiagonalMatrix<Type>::DiagonalMatrix(const label n, const zero) +Foam::DiagonalMatrix<Type>::DiagonalMatrix(const label n, const Foam::zero) : List<Type>(n, Zero) {} diff --git a/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.H b/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.H index e08800bd77f..e9e80d4c239 100644 --- a/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.H +++ b/src/OpenFOAM/matrices/DiagonalMatrix/DiagonalMatrix.H @@ -82,7 +82,7 @@ public: explicit DiagonalMatrix<Type>(const label n); //- Construct from size and initialise all elems to zero - DiagonalMatrix<Type>(const label n, const zero); + DiagonalMatrix<Type>(const label n, const Foam::zero); //- Construct from size and initialise all elems to value DiagonalMatrix<Type>(const label n, const Type& val); diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.C b/src/OpenFOAM/matrices/Matrix/Matrix.C index 03beb2c5026..0deb4c0dd53 100644 --- a/src/OpenFOAM/matrices/Matrix/Matrix.C +++ b/src/OpenFOAM/matrices/Matrix/Matrix.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -119,7 +119,7 @@ Foam::Matrix<Form, Type>::Matrix(const label m, const label n) template<class Form, class Type> -Foam::Matrix<Form, Type>::Matrix(const label m, const label n, const zero) +Foam::Matrix<Form, Type>::Matrix(const label m, const label n, const Foam::zero) : mRows_(m), nCols_(n), @@ -538,7 +538,7 @@ void Foam::Matrix<Form, Type>::operator=(const Type& val) template<class Form, class Type> -void Foam::Matrix<Form, Type>::operator=(const zero) +void Foam::Matrix<Form, Type>::operator=(const Foam::zero) { std::fill(begin(), end(), Zero); } diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.H b/src/OpenFOAM/matrices/Matrix/Matrix.H index 673258a7c73..861d0b68414 100644 --- a/src/OpenFOAM/matrices/Matrix/Matrix.H +++ b/src/OpenFOAM/matrices/Matrix/Matrix.H @@ -131,7 +131,7 @@ public: //- Construct with given number of rows/columns //- initializing all elements to zero - Matrix(const label m, const label n, const zero); + Matrix(const label m, const label n, const Foam::zero); //- Construct with given number of rows/columns //- initializing all elements to the given value @@ -142,7 +142,7 @@ public: //- Construct given number of rows/columns //- initializing all elements to zero - inline Matrix(const labelPair& dims, const zero); + inline Matrix(const labelPair& dims, const Foam::zero); //- Construct with given number of rows/columns //- initializing all elements to the given value @@ -417,7 +417,7 @@ public: void operator=(const MatrixBlock<MatrixType>& Mb); //- Assignment of all elements to zero - void operator=(const zero); + void operator=(const Foam::zero); //- Assignment of all elements to the given value void operator=(const Type& val); diff --git a/src/OpenFOAM/matrices/Matrix/MatrixI.H b/src/OpenFOAM/matrices/Matrix/MatrixI.H index ab2909a6738..6d96f4c0e4d 100644 --- a/src/OpenFOAM/matrices/Matrix/MatrixI.H +++ b/src/OpenFOAM/matrices/Matrix/MatrixI.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -61,7 +61,7 @@ inline Foam::Matrix<Form, Type>::Matrix(const labelPair& dims) template<class Form, class Type> -inline Foam::Matrix<Form, Type>::Matrix(const labelPair& dims, const zero) +inline Foam::Matrix<Form, Type>::Matrix(const labelPair& dims, const Foam::zero) : Matrix<Form, Type>(dims.first(), dims.second(), Zero) {} diff --git a/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H b/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H index b5394f017aa..367f6c5d10a 100644 --- a/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H +++ b/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H @@ -84,7 +84,12 @@ public: //- Construct given number of rows/columns //- initializing all elements to zero - inline RectangularMatrix(const label m, const label n, const zero); + inline RectangularMatrix + ( + const label m, + const label n, + const Foam::zero + ); //- Construct given number of rows/columns //- initializing all elements to the given value @@ -93,14 +98,18 @@ public: //- Construct for given number of rows/columns //- initializing all elements to zero, and diagonal to one template<class AnyType> - inline RectangularMatrix(const labelPair& dims, const Identity<AnyType>); + inline RectangularMatrix + ( + const labelPair& dims, + const Identity<AnyType> + ); //- Construct given number of rows/columns by using a label pair inline explicit RectangularMatrix(const labelPair& dims); //- Construct given number of rows/columns by using a label pair //- and initializing all elements to zero - inline RectangularMatrix(const labelPair& dims, const zero); + inline RectangularMatrix(const labelPair& dims, const Foam::zero); //- Construct given number of rows/columns by using a label pair //- and initializing all elements to the given value @@ -127,7 +136,7 @@ public: // Member Operators //- Assign all elements to zero - inline void operator=(const zero); + inline void operator=(const Foam::zero); //- Assign all elements to value inline void operator=(const Type& val); diff --git a/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H b/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H index 9b98e72caaa..e3164483107 100644 --- a/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H +++ b/src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H @@ -54,7 +54,7 @@ inline Foam::RectangularMatrix<Type>::RectangularMatrix ( const label m, const label n, - const zero + const Foam::zero ) : Matrix<RectangularMatrix<Type>, Type>(m, n, Zero) @@ -104,7 +104,7 @@ template<class Type> inline Foam::RectangularMatrix<Type>::RectangularMatrix ( const labelPair& dims, - const zero + const Foam::zero ) : RectangularMatrix<Type>(dims.first(), dims.second(), Zero) @@ -172,7 +172,7 @@ Foam::RectangularMatrix<Type>::clone() const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class Type> -inline void Foam::RectangularMatrix<Type>::operator=(const zero) +inline void Foam::RectangularMatrix<Type>::operator=(const Foam::zero) { Matrix<RectangularMatrix<Type>, Type>::operator=(Zero); } diff --git a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H index a79f2d9f423..8937cfc775b 100644 --- a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H +++ b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H @@ -87,7 +87,7 @@ public: //- Construct for given size (rows == cols) //- initializing all elements to zero - inline SquareMatrix(const label n, const zero); + inline SquareMatrix(const label n, const Foam::zero); //- Construct for given size (rows == cols) //- initializing all elements to the given value @@ -112,7 +112,7 @@ public: //- by using a labelPair (checked to be equal) //- and initializing all elements to zero // For constructor consistency with rectangular matrices - inline SquareMatrix(const labelPair& dims, const zero); + inline SquareMatrix(const labelPair& dims, const Foam::zero); //- Construct given number of rows/columns //- by using a labelPair (checked to be equal) @@ -122,7 +122,7 @@ public: //- Construct given number of rows/columns (checked to be equal) //- initializing all elements to zero - inline SquareMatrix(const label m, const label n, const zero); + inline SquareMatrix(const label m, const label n, const Foam::zero); //- Construct from const sub-matrix block template<class MatrixType> @@ -182,7 +182,7 @@ public: // Member Operators //- Assign all elements to zero - inline void operator=(const zero); + inline void operator=(const Foam::zero); //- Assign all elements to value inline void operator=(const Type& val); diff --git a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H index 61933881e11..f72d26fe775 100644 --- a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H +++ b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H @@ -48,7 +48,7 @@ template<class Type> inline Foam::SquareMatrix<Type>::SquareMatrix ( const label n, - const zero + const Foam::zero ) : Matrix<SquareMatrix<Type>, Type>(n, n, Zero) @@ -118,7 +118,7 @@ template<class Type> inline Foam::SquareMatrix<Type>::SquareMatrix ( const labelPair& dims, - const zero + const Foam::zero ) : Matrix<SquareMatrix<Type>, Type>(dims, Zero) @@ -145,7 +145,7 @@ inline Foam::SquareMatrix<Type>::SquareMatrix ( const label m, const label n, - const zero + const Foam::zero ) : Matrix<SquareMatrix<Type>, Type>(m, n, Zero) @@ -291,7 +291,7 @@ inline bool Foam::SquareMatrix<Type>::tridiagonal() const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class Type> -inline void Foam::SquareMatrix<Type>::operator=(const zero) +inline void Foam::SquareMatrix<Type>::operator=(const Foam::zero) { Matrix<SquareMatrix<Type>, Type>::operator=(Zero); } diff --git a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H index c04ec0c8559..81f95366323 100644 --- a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H +++ b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrix.H @@ -81,7 +81,7 @@ public: //- Construct for given size (rows == cols) //- initializing all elements to zero - inline SymmetricSquareMatrix(const label n, const zero); + inline SymmetricSquareMatrix(const label n, const Foam::zero); //- Construct for given size (rows == cols) //- initializing all elements to the given value @@ -102,7 +102,7 @@ public: // Member Operators //- Assign all elements to zero - inline void operator=(const zero); + inline void operator=(const Foam::zero); //- Assign all elements to value inline void operator=(const Type& val); diff --git a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H index 31eff607659..f040dbdf19e 100644 --- a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H +++ b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H @@ -48,7 +48,7 @@ template<class Type> inline Foam::SymmetricSquareMatrix<Type>::SymmetricSquareMatrix ( const label n, - const zero + const Foam::zero ) : Matrix<SymmetricSquareMatrix<Type>, Type>(n, n, Zero) @@ -103,7 +103,7 @@ Foam::SymmetricSquareMatrix<Type>::clone() const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class Type> -inline void Foam::SymmetricSquareMatrix<Type>::operator=(const zero) +inline void Foam::SymmetricSquareMatrix<Type>::operator=(const Foam::zero) { Matrix<SymmetricSquareMatrix<Type>, Type>::operator=(Zero); } diff --git a/src/OpenFOAM/meshes/ijkMesh/IjkField.H b/src/OpenFOAM/meshes/ijkMesh/IjkField.H index 2b7f772f56b..26a2ca348dd 100644 --- a/src/OpenFOAM/meshes/ijkMesh/IjkField.H +++ b/src/OpenFOAM/meshes/ijkMesh/IjkField.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -81,7 +81,7 @@ public: inline IjkField(const labelVector& ijk, const Type& val); //- Construct with sizing information and initial values of zero - inline IjkField(const labelVector& ijk, const zero); + inline IjkField(const labelVector& ijk, const Foam::zero); //- Copy construct from components inline IjkField(const labelVector& ijk, const UList<Type>& list); @@ -161,7 +161,7 @@ public: //- Value assignment inline void operator=(const Type& val); - inline void operator=(const zero); + inline void operator=(const Foam::zero); }; diff --git a/src/OpenFOAM/meshes/ijkMesh/IjkFieldI.H b/src/OpenFOAM/meshes/ijkMesh/IjkFieldI.H index 69dc6b10ef5..5cb9e48047a 100644 --- a/src/OpenFOAM/meshes/ijkMesh/IjkFieldI.H +++ b/src/OpenFOAM/meshes/ijkMesh/IjkFieldI.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -75,7 +75,7 @@ template<class Type> inline Foam::IjkField<Type>::IjkField ( const labelVector& ijk, - const zero + const Foam::zero ) : Field<Type>(cmptProduct(ijk), Zero), @@ -245,7 +245,7 @@ inline void Foam::IjkField<Type>::operator=(const Type& val) template<class Type> -inline void Foam::IjkField<Type>::operator=(const zero) +inline void Foam::IjkField<Type>::operator=(const Foam::zero) { Field<Type>::operator=(Zero); } diff --git a/src/OpenFOAM/primitives/nullObject/nullObjectI.H b/src/OpenFOAM/primitives/nullObject/nullObjectI.H deleted file mode 100644 index 7cec1b4541d..00000000000 --- a/src/OpenFOAM/primitives/nullObject/nullObjectI.H +++ /dev/null @@ -1 +0,0 @@ -#warning File removed - left for old dependency check only diff --git a/src/OpenFOAM/primitives/polynomialEqns/cubicEqn/cubicEqnI.H b/src/OpenFOAM/primitives/polynomialEqns/cubicEqn/cubicEqnI.H index d4e2ef433a2..c770e646047 100644 --- a/src/OpenFOAM/primitives/polynomialEqns/cubicEqn/cubicEqnI.H +++ b/src/OpenFOAM/primitives/polynomialEqns/cubicEqn/cubicEqnI.H @@ -33,7 +33,7 @@ inline Foam::cubicEqn::cubicEqn() inline Foam::cubicEqn::cubicEqn(const Foam::zero) : - VectorSpace<cubicEqn, scalar, 4>(Foam::zero()) + VectorSpace<cubicEqn, scalar, 4>(Foam::zero{}) {} diff --git a/src/OpenFOAM/primitives/polynomialEqns/linearEqn/linearEqnI.H b/src/OpenFOAM/primitives/polynomialEqns/linearEqn/linearEqnI.H index 0f2fda08144..5daaea47a86 100644 --- a/src/OpenFOAM/primitives/polynomialEqns/linearEqn/linearEqnI.H +++ b/src/OpenFOAM/primitives/polynomialEqns/linearEqn/linearEqnI.H @@ -34,7 +34,7 @@ inline Foam::linearEqn::linearEqn() inline Foam::linearEqn::linearEqn(const Foam::zero) : - VectorSpace<linearEqn, scalar, 2>(Foam::zero()) + VectorSpace<linearEqn, scalar, 2>(Foam::zero{}) {} diff --git a/src/OpenFOAM/primitives/polynomialEqns/quadraticEqn/quadraticEqnI.H b/src/OpenFOAM/primitives/polynomialEqns/quadraticEqn/quadraticEqnI.H index 45f2f313eb0..4dadc77b5d8 100644 --- a/src/OpenFOAM/primitives/polynomialEqns/quadraticEqn/quadraticEqnI.H +++ b/src/OpenFOAM/primitives/polynomialEqns/quadraticEqn/quadraticEqnI.H @@ -33,7 +33,7 @@ inline Foam::quadraticEqn::quadraticEqn() inline Foam::quadraticEqn::quadraticEqn(const Foam::zero) : - VectorSpace<quadraticEqn, scalar, 3>(Foam::zero()) + VectorSpace<quadraticEqn, scalar, 3>(Foam::zero{}) {} diff --git a/src/OpenFOAM/primitives/ranges/MinMax/MinMax.H b/src/OpenFOAM/primitives/ranges/MinMax/MinMax.H index 07e895cfea5..7792a242dd9 100644 --- a/src/OpenFOAM/primitives/ranges/MinMax/MinMax.H +++ b/src/OpenFOAM/primitives/ranges/MinMax/MinMax.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -153,7 +153,7 @@ public: inline MinMax(const Pair<T>& range); //- Construct with a single zero value - inline explicit MinMax(const zero); + inline explicit MinMax(const Foam::zero); //- Construct with a single initial value inline explicit MinMax(const T& val); diff --git a/src/OpenFOAM/primitives/ranges/MinMax/MinMaxI.H b/src/OpenFOAM/primitives/ranges/MinMax/MinMaxI.H index 06dab36c48b..02d167f0504 100644 --- a/src/OpenFOAM/primitives/ranges/MinMax/MinMaxI.H +++ b/src/OpenFOAM/primitives/ranges/MinMax/MinMaxI.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,7 +79,7 @@ inline Foam::MinMax<T>::MinMax(const Pair<T>& range) template<class T> -inline Foam::MinMax<T>::MinMax(const zero) +inline Foam::MinMax<T>::MinMax(const Foam::zero) : Tuple2<T,T>(pTraits<T>::zero, pTraits<T>::zero) {} diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H index e12912607bb..066d34860ac 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H @@ -189,9 +189,9 @@ namespace fvc ); //- Interpolate 'one' returning 'one' - inline one interpolate(const one&) + inline Foam::one interpolate(const Foam::one&) { - return one(); + return Foam::one{}; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/forceSuSp/forceSuSp.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/forceSuSp/forceSuSp.H index 0c82746cb63..6644fa723a4 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/forceSuSp/forceSuSp.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/forceSuSp/forceSuSp.H @@ -74,7 +74,7 @@ public: forceSuSp() = default; //- Construct zero-initialized content - inline forceSuSp(const zero); + inline forceSuSp(const Foam::zero); //- Construct given Tuple2 inline forceSuSp(const Tuple2<vector, scalar>& susp); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/forceSuSp/forceSuSpI.H b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/forceSuSp/forceSuSpI.H index 8c13d855fb8..c4ebbed8e7e 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/forceSuSp/forceSuSpI.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/ParticleForces/forceSuSp/forceSuSpI.H @@ -28,7 +28,7 @@ License // * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * // -inline Foam::forceSuSp::forceSuSp(const zero) +inline Foam::forceSuSp::forceSuSp(const Foam::zero) : Tuple2<vector, scalar>(vector::zero, 0) {} -- GitLab