diff --git a/meshLibrary/utilities/containers/DynList/DynList.H b/meshLibrary/utilities/containers/DynList/DynList.H index c5ee94274110e6f408ba22e5f10e7fe7448a01c6..9dbb81b9babe0e2902d5068f06a9f764a0ad4692 100644 --- a/meshLibrary/utilities/containers/DynList/DynList.H +++ b/meshLibrary/utilities/containers/DynList/DynList.H @@ -119,6 +119,14 @@ public: //- Construct given size explicit inline DynList(const label); + //- Construct given integer size + #if WM_LABEL_SIZE == 64 + explicit inline DynList(const int32_t nElem) + : + DynList(label(nElem)) + {} + #endif + //- Construct from given size and defualt value explicit inline DynList(const label, const T&); @@ -217,10 +225,6 @@ public: //- Copy of another list inline void operator=(const DynList<T, staticSize>&); - //- Copy of another list type - template<class ListType> - inline void operator=(const ListType&); - //- Compare the list with the another one inline bool operator==(const DynList<T, staticSize>&) const; inline bool operator!=(const DynList<T, staticSize>&) const; diff --git a/meshLibrary/utilities/containers/DynList/DynListI.H b/meshLibrary/utilities/containers/DynList/DynListI.H index 37902f4f92257a4188e253d5feef37219c047c10..cc62a2bbe5c5c797ffd8a18206332e49ea713643 100644 --- a/meshLibrary/utilities/containers/DynList/DynListI.H +++ b/meshLibrary/utilities/containers/DynList/DynListI.H @@ -606,28 +606,6 @@ inline void Foam::Module::DynList<T, staticSize>::operator= } -template<class T, Foam::label staticSize> -template<class ListType> -inline void Foam::Module::DynList<T, staticSize>::operator=(const ListType& l) -{ - # ifdef DEBUG - checkAllocation(); - # endif - - allocateSize(l.size()); - nextFree_ = l.size(); - - # ifdef DEBUG - checkAllocation(); - # endif - - for (label i = 0; i < nextFree_; ++i) - { - this->operator[](i) = l[i]; - } -} - - template<class T, Foam::label staticSize> inline bool Foam::Module::DynList<T, staticSize>::operator== ( diff --git a/meshLibrary/utilities/octrees/meshOctree/meshOctree.C b/meshLibrary/utilities/octrees/meshOctree/meshOctree.C index 557e1ad322380b676e6896cc6e0e0119caff1d8a..4331d70d4ea6a0063294f0aa67599b48db92bac1 100644 --- a/meshLibrary/utilities/octrees/meshOctree/meshOctree.C +++ b/meshLibrary/utilities/octrees/meshOctree/meshOctree.C @@ -121,7 +121,7 @@ void Foam::Module::meshOctree::setOctantVectorsAndPositions() // set vrtLeavesPos_ for (label vrtI = 0; vrtI < 8; ++vrtI) { - FixedList<label, 3> vc(0); + FixedList<label, 3> vc(Zero); if (vrtI & 1) { @@ -142,7 +142,7 @@ void Foam::Module::meshOctree::setOctantVectorsAndPositions() for (label i = 0; i < 8; ++i) { - FixedList<label, 3> pos; + FixedList<label, 3> pos(Zero); for (label j = 0; j < 3; ++j) { diff --git a/meshLibrary/utilities/octrees/meshOctree/meshOctreeAutomaticRefinement/meshOctreeAutomaticRefinement.C b/meshLibrary/utilities/octrees/meshOctree/meshOctreeAutomaticRefinement/meshOctreeAutomaticRefinement.C index b79ef18d54523ea25e711e21a744bb015a0ecf51..9c21b8ce28d8923d432a0306208a36064788d47f 100644 --- a/meshLibrary/utilities/octrees/meshOctree/meshOctreeAutomaticRefinement/meshOctreeAutomaticRefinement.C +++ b/meshLibrary/utilities/octrees/meshOctree/meshOctreeAutomaticRefinement/meshOctreeAutomaticRefinement.C @@ -136,7 +136,8 @@ void Foam::Module::meshOctreeAutomaticRefinement::setMaxRefLevel() { finished = false; - const scalar lSize = size/pow(2, label(maxRefLevel_)); + const scalar lSize = size/pow(label(2), label(maxRefLevel_)); + // Or: const scalar lSize = size/(1L << maxRefLevel_); if (lSize < cs) { diff --git a/meshLibrary/utilities/octrees/meshOctree/meshOctreeCreator/meshOctreeCreatorCreateOctreeBoxes.C b/meshLibrary/utilities/octrees/meshOctree/meshOctreeCreator/meshOctreeCreatorCreateOctreeBoxes.C index 374c00c5c5a0012aea4e627ff9833707b582ee7f..89e994bb8c1406ad97bb276d75da5dc5eadb8b70 100644 --- a/meshLibrary/utilities/octrees/meshOctree/meshOctreeCreator/meshOctreeCreatorCreateOctreeBoxes.C +++ b/meshLibrary/utilities/octrees/meshOctree/meshOctreeCreator/meshOctreeCreatorCreateOctreeBoxes.C @@ -81,12 +81,15 @@ void Foam::Module::meshOctreeCreator::setRootCubeSizeAndRefParameters() { finished = false; - const scalar lSize = size/Foam::pow(2, label(globalRefLevel_)); + const scalar lSize = size/Foam::pow(label(2), label(globalRefLevel_)); + // Or: const scalar lSize = size/(1L << globalRefLevel_); if (lSize <(maxSize*(1.0 - SMALL))) { const scalar bbSize = - 0.5*maxSize*Foam::pow(2, label(globalRefLevel_)); + 0.5*maxSize*Foam::pow(label(2), label(globalRefLevel_)); + // Or: const scalar bbSize = 0.5*maxSize*(1L << globalRefLevel_); + rootBox.max() = c + point(bbSize, bbSize, bbSize); rootBox.min() = c - point(bbSize, bbSize, bbSize); finished = true; @@ -132,7 +135,8 @@ void Foam::Module::meshOctreeCreator::setRootCubeSizeAndRefParameters() { finished = false; - const scalar lSize = maxSize/Foam::pow(2, addLevel); + const scalar lSize = maxSize/Foam::pow(label(2), addLevel); + // Or: const scalar lSize = maxSize/(1L << addLevel); if (lSize <= cs) { @@ -237,7 +241,8 @@ void Foam::Module::meshOctreeCreator::setRootCubeSizeAndRefParameters() { finished = false; - const scalar lSize = maxSize/Foam::pow(2, addLevel); + const scalar lSize = maxSize/Foam::pow(label(2), addLevel); + // Or: const scalar lSize = maxSize/(1L << addLevel); if (lSize <= cs) { @@ -321,7 +326,8 @@ void Foam::Module::meshOctreeCreator::setRootCubeSizeAndRefParameters() { finished = false; - const scalar lSize = maxSize/Foam::pow(2, addLevel); + const scalar lSize = maxSize/Foam::pow(label(2), addLevel); + // Or: const scalar lSize = maxSize/(1L << addLevel); if (lSize <= cs) { @@ -405,7 +411,9 @@ void Foam::Module::meshOctreeCreator::setRootCubeSizeAndRefParameters() { finished = false; - const scalar lSize = maxSize/Foam::pow(2, nLevel); + const scalar lSize = + maxSize/Foam::pow(label(2), nLevel); + // Or: const scalar lSize = maxSize/(1L << nLevel); if (lSize <= cs) { diff --git a/meshLibrary/utilities/octrees/meshOctree/meshOctreeCube/meshOctreeCubeCoordinatesI.H b/meshLibrary/utilities/octrees/meshOctree/meshOctreeCube/meshOctreeCubeCoordinatesI.H index 2679e329ff64b13fb0ea9710f58b8a29019a9323..e32d1c749def8dfb48ee4e408dbef939e71c7ceb 100644 --- a/meshLibrary/utilities/octrees/meshOctree/meshOctreeCube/meshOctreeCubeCoordinatesI.H +++ b/meshLibrary/utilities/octrees/meshOctree/meshOctreeCube/meshOctreeCubeCoordinatesI.H @@ -96,7 +96,7 @@ Foam::Module::meshOctreeCubeCoordinates::refineForPosition ) const { //- create new boxes in z-order fashion - FixedList<label, 3> addPos(0); + FixedList<label, 3> addPos(Zero); if (i & 1) { addPos[0] = 1;