STYLE: adjust comments and iterator de-reference

STYLE: replace PackedListCore.H with in-file definition
This commit is contained in:
Mark Olesen
2024-03-15 13:06:55 +01:00
parent 77ec7ab679
commit 6d69506294
6 changed files with 32 additions and 83 deletions

View File

@ -83,8 +83,9 @@ See also
Foam::DynamicList
SourceFiles
PackedListI.H
PackedList.C
PackedListCore.C
PackedListI.H
PackedListIO.C
\*---------------------------------------------------------------------------*/
@ -92,11 +93,11 @@ SourceFiles
#ifndef Foam_PackedList_H
#define Foam_PackedList_H
#include "className.H"
#include "BitOps.H"
#include "labelList.H"
#include "IndirectListBase.H"
#include "InfoProxy.H"
#include "PackedListCore.H"
#include <type_traits>
@ -119,6 +120,23 @@ template<unsigned Width>
Ostream& operator<<(Ostream& os, const InfoProxy<PackedList<Width>>& info);
/*---------------------------------------------------------------------------*\
Class Detail::PackedListCore Declaration
\*---------------------------------------------------------------------------*/
namespace Detail
{
//- Template-invariant parts for PackedList
struct PackedListCore
{
//- Define template name
ClassNameNoDebug("PackedList");
};
} // End namespace Detail
/*---------------------------------------------------------------------------*\
Class PackedList Declaration
\*---------------------------------------------------------------------------*/

View File

@ -25,7 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include "PackedListCore.H"
#include "PackedList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -1,69 +1 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 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/>.
Class
Foam::Detail::PackedListCore
Description
Implementation of template-invariant details for Foam::PackedList
SourceFiles
PackedListCore.C
\*---------------------------------------------------------------------------*/
#ifndef PackedListCore_H
#define PackedListCore_H
#include "className.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace Detail
{
/*---------------------------------------------------------------------------*\
Class Detail::PackedListCore Declaration
\*---------------------------------------------------------------------------*/
//- Template-invariant parts for PackedList
struct PackedListCore
{
//- Define template name
ClassNameNoDebug("PackedList");
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Detail
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
#warning File removed - left for old dependency check only

View File

@ -96,7 +96,7 @@ void Foam::ZoneMesh<ZoneType, MeshType>::calcZoneMap() const
{
map.insert(id, zonei);
}
else if (fnd() != zonei)
else if (fnd.val() != zonei)
{
// Multiple zones for same id
@ -112,7 +112,7 @@ void Foam::ZoneMesh<ZoneType, MeshType>::calcZoneMap() const
: static_cast<const labelList&>(zn)
)
{
maxIndex = max(maxIndex, id);
maxIndex = Foam::max(maxIndex, id);
}
}
additionalMapPtr_.reset(new labelListList(maxIndex+1));
@ -135,7 +135,7 @@ void Foam::ZoneMesh<ZoneType, MeshType>::calcZoneMap() const
if (zones.size())
{
stableSort(zones);
Foam::stableSort(zones);
const label zonei = map[id];
const label index = findLower(zones, zonei);
if (index == -1)
@ -426,11 +426,11 @@ Foam::label Foam::ZoneMesh<ZoneType, MeshType>::whichZones
) const
{
zones.clear();
const auto fnd = zoneMap().find(objectIndex);
const auto fnd = zoneMap().cfind(objectIndex);
if (fnd)
{
// Add main element
zones.push_back(fnd());
zones.push_back(fnd.val());
if (additionalMapPtr_)
{
const auto& additionalMap = *additionalMapPtr_;
@ -967,7 +967,7 @@ bool Foam::ZoneMesh<ZoneType, MeshType>::checkParallelSync
const bool report
) const
{
if (!Pstream::parRun())
if (!UPstream::parRun())
{
return false;
}
@ -1025,7 +1025,7 @@ bool Foam::ZoneMesh<ZoneType, MeshType>::checkParallelSync
{
hasError = true;
if (debug || (report && Pstream::master()))
if (debug || (report && UPstream::master()))
{
Info<< " ***Zone " << zn.name()
<< " of type " << zn.type()

View File

@ -194,9 +194,8 @@ public:
// If object does not belong to any zones, return -1
label whichZone(const label objectIndex) const;
//- Given a global object index, return (in argument) the zones it is
// in. Returns number of zones (0 if object does not belong to any
// zones)
//- Given a global object index, return (in argument) its zones.
// Returns number of zones (0 if object does not belong to any zones)
label whichZones
(
const label objectIndex,

View File

@ -2817,7 +2817,7 @@ void Foam::polyMeshAdder::add
if (newNei < newOwn)
{
std::swap(newOwn, newNei);
newFace = newFace.reverseFace();
newFace.flip();
flipFaceFlux = !flipFaceFlux;
for (bool& flip : flips)
{