diff --git a/applications/test/List/Test-List.C b/applications/test/List/Test-List.C index a09ac01ab6f5781fee0595e98f05c3f40b849f94..c78ddaac88cefb33c3904757efdd6d1f33b5e063 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 0000000000000000000000000000000000000000..02ad66be1b57326ef60d0160e4f8e1f82b0be34d --- /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 0000000000000000000000000000000000000000..d27c95d033dd5d7b1995c8ff8dc406e35ca1f586 --- /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 0000000000000000000000000000000000000000..af34d90db54090820b91cf7a51f5c6039502e873 --- /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 77e046d16178f730e04f612b1173a7d28dc90c67..2cd6bc6c01d9f6ede80ea2d8f32097b5e2d25597 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 3c93f17753fc89753a05e1a848126c6b3e04dea9..ad9cf11ddf27da0a13720e7719ec5ee4fbb76201 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 9604704f25efca09fbd6f801b8f6ced7934ccfc9..c6e0598bd91363d80be3349b1e6403bfe42a5659 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 f79a9a6c27417e5ae25f7786ec23f6badd137cd6..63c43d479272d0666229f015a382cf056edb9832 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 13e8dcd7c51f4ad4c48fd5602c0a59b1235fb2cc..76b34158448db8645e67aa79b7e517fa7c4d4787 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 ac10191c7bca748ac788ffa8ccca45ca749a1aea..95fa0d3fe69757ee33631d66a77a0590fb51640c 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 db117469e7f675862bed879347f37b8bc5b6b59e..bc1aa07431f943b3b880ee980f924e6d3bfda5f6 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 f252a7921dd5cfc5e7e603e0182f93a8b2b89c26..8fc20ac6fe10911305e6d721e454d8879bf5da44 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 2170385c51a9d2e9fdcae181e4fe40805a0cb20e..9a81878b5d905c9e074156cb083e2f6da6b2d253 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 6c0361c5497b50cc09d592ef8c88a25eada74bf5..ac652d033d91cadb44988e45af55f49740f465ee 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 bb24c9a64ebfcf5b64a01856e30ba7d455ec4568..e93be1b5fa710375dcf93368f6c169279a8e138c 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 7dbb9cc9b2b69ee23e2871a6359af072d1670839..302529f81fb598fb65350e19f792630f1bd219c9 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 3f8b19d71eb5870acea6ed1736ef8d82f5cf8155..fb07dc4b951378275e58faa3fee863817c75250f 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 f57187f97930eb198de233d134160cb1651b433e..a7b0aca30c5aa85fa09512a73bd97878e852984f 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 4d3d755a2fd94bb5c439dc338d65265b80024e9c..5d006387ee35ab6508a7469a5ebac2a3b37b9cdd 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 263c56e411f8d33765d8ffcab3d9798cf7db94ef..51da600d8eb0942c26aaebbdc5c3227b96ed28b4 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 02ab2d896ededfa6c784fcd191b1a9958cad22af..061028554c598dcfdc7214f55397d305c3e4538b 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 796f09371bcf433053d12b0c7c62433aa9981c8c..3ec6aa5fa34d8fe07a55c2cf35e0056b3365e177 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 6564cf664239727c23fde748604a90d02240f486..118c4e1fc074b725ceb3dd1a1ba80dc8294f936f 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 19c8321dcd086b457d6f7fb786c210e733f575f4..4335993228de8f3c298295165ecdb46f90eb5d0e 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 809e213b6974040d60559480497c2f508b3c5b4a..c6d31e6aca38d4ae20a926af62d1a9c2acb16d60 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 7cec1b4541d1553571d30afa2aac3b841f6c3d51..0000000000000000000000000000000000000000 --- 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 200affc60deb41b376f341b68f8549f02bd66246..1a2aa0f5a59fb98baf72a428fc7d4bab7e0457a5 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 7cec1b4541d1553571d30afa2aac3b841f6c3d51..0000000000000000000000000000000000000000 --- 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 fcf932f3ed00e4f9cfe6dd7be99d1f3e7ae73cb2..75761896c6a460804bc7256e65156164bc5c9a27 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 9737bbcab6906017db9a45eccd422c591c5f79c2..916c0944a15c860895fe586e42d1baf4a7700202 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 48984401dad5d25f98abf2612696a75e3e6e1d39..111c87115ece66797b4a3f7802cd8ee67aca6bd0 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 7eb0979024ac285233e644df47ec56501ae87c31..324c326422507de0f9df00fb57cea639ec260181 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 d14b9bc3ddf951918d47935e2d8247e72a8618b4..36afaf93fa2880e635b3397d6461da73056749ce 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 c940233995c960659cb40e2d1229766166e3228e..523437756e3fd7e0c3b8e3013b1a44aad497310c 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 bf0e4d0647ed4dd520b6ce7525913704ee466379..80708081e426ce0ba14369c013fe8698f6b8f7aa 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 0269daccc4d83b95f4bf55a9e770c72d0de812c6..2969ec1393dca665de8c0e9bd210613b560570af 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 9676fafde0d89a366dfde7d0be5297cfba02f883..7e2bf6320c36a1d8cfd042744009e332be7e5218 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 dc78a4c9b17a0f366ec3e68a1a07f461f39f7e32..3e3837f25bd82382175d9603d1a1cf2fc356a703 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 8a86cb787bb3eae3ae6bf94860cbe90e3acba793..957ed6f391a6037e7a071ccc2ae65b76ef2582c1 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 311a19b99e774ea99f721b9a9aa85d46f0f13952..eeaa69743efa7dc60e5a8ca7a9726d9ec2ce5c30 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 1d5146b4b7170daead7531ccc0590112a483706e..df786419ce00745597f8f22073a2a7bd9a2cac62 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 e08800bd77f8101b4bc59fd02af7cf4e87182ac6..e9e80d4c2395580a2dde2e07e946e88621730b3c 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 03beb2c5026b595c15d52f05f4423d728f701ec5..0deb4c0dd53769be31689b02e3e8550eba168d5c 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 673258a7c737baa135dc42f04cc02a74c008410f..861d0b6841444ede86d495d1fa7c78649888d952 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 ab2909a6738cfd8e22602f9df24b162ca76cda54..6d96f4c0e4ddead2e03c554eaed4bae328e012ba 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 b5394f017aa69929b9562bbdedeae619b81cbd79..367f6c5d10a95ea095465804be0453c505ef2476 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 9b98e72caaa5fcee6b1dcfee4595abf711a89a36..e3164483107c1b4ed9ed76a79ce1afb504f1b233 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 a79f2d9f4230d6a8335adfb5390c6a2610be9ddb..8937cfc775b10d667c9c11df6a64d0f83d5a93cd 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 61933881e1139aced6e9e74a8caa7403e29f917c..f72d26fe775c9f4ea5ceb36862c77b863bd59561 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 c04ec0c8559f1a6677847b5d5006b5609afe3ed5..81f9536632300c038f14c86afb364fd991e43c45 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 31eff6076595dfecab80516349f2e9196614daa6..f040dbdf19ec076f285b11e037c65ecc3e318bd3 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 2b7f772f56bfe94fbdec664218fe610ea0801fb7..26a2ca348ddea8a260bed0ab6acfabb3ce0b6be9 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 69dc6b10ef54c58cd3500f9bdaf44ba7c8c435be..5cb9e48047a536038eabebf49e7b30d929278a48 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 7cec1b4541d1553571d30afa2aac3b841f6c3d51..0000000000000000000000000000000000000000 --- 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 d4e2ef433a2d8e8ad0305ed008627210dbd703a5..c770e64604703a77f8df71ba2da40df405cc6627 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 0f2fda08144847011443ae12f950778f8831919b..5daaea47a864098cc1d0fd2ad8e14a42b24919aa 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 45f2f313eb0d847ade01a68a0f7e47f2c4ecc9e2..4dadc77b5d839895f26e835c8fc9ab1c34d02fb4 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 07e895cfea50f32d7aa938e5e1619f3fd3a1a0dd..7792a242dd9e907549b1247ef04b009e7e61a596 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 06dab36c48b23724d5030c12fb353b51b555aba8..02d167f05046acc7a6ab86f5510ffd61954a1081 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 e12912607bb63db49996b8201976e15cd69ea518..066d34860acf6d3e7ee22d1a8a1dbf8a3680db63 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 0c82746cb63608c40da2289d9350fe0d2b78cfde..6644fa723a4a69417555a79e47783f2e7009b48e 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 8c13d855fb842c14ad897612e08838dc4e167eb9..c4ebbed8e7e6ddf1ef6502015338405bfe2fa196 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) {}