STYLE: additional storage checks, noexcept, spelling

- prune unneeded demandDrivenData.H includes
This commit is contained in:
Mark Olesen
2021-11-02 16:58:05 +01:00
parent 851be8ea33
commit a19f03a5cb
26 changed files with 152 additions and 119 deletions

View File

@ -45,7 +45,6 @@ Description
#include "pointSet.H"
#include "topoSetSource.H"
#include "Fstream.H"
#include "demandDrivenData.H"
#include "foamVtkWriteTopoSet.H"
#include "IOobjectList.H"
#include "cellZoneSet.H"

View File

@ -29,7 +29,6 @@ License
#include "facePointPatch.H"
#include "pointBoundaryMesh.H"
#include "pointMesh.H"
#include "demandDrivenData.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -1310,13 +1310,13 @@ const Foam::globalMeshData& Foam::polyMesh::globalData() const
}
Foam::label Foam::polyMesh::comm() const
Foam::label Foam::polyMesh::comm() const noexcept
{
return comm_;
}
Foam::label& Foam::polyMesh::comm()
Foam::label& Foam::polyMesh::comm() noexcept
{
return comm_;
}

View File

@ -478,19 +478,19 @@ public:
const indexedOctree<treeDataCell>& cellTree() const;
//- Return point zone mesh
const pointZoneMesh& pointZones() const
const pointZoneMesh& pointZones() const noexcept
{
return pointZones_;
}
//- Return face zone mesh
const faceZoneMesh& faceZones() const
const faceZoneMesh& faceZones() const noexcept
{
return faceZones_;
}
//- Return cell zone mesh
const cellZoneMesh& cellZones() const
const cellZoneMesh& cellZones() const noexcept
{
return cellZones_;
}
@ -499,13 +499,13 @@ public:
const globalMeshData& globalData() const;
//- Return communicator used for parallel communication
label comm() const;
label comm() const noexcept;
//- Return communicator used for parallel communication
label& comm();
label& comm() noexcept;
//- Return the object registry
const objectRegistry& thisDb() const
const objectRegistry& thisDb() const noexcept
{
return *this;
}
@ -520,37 +520,37 @@ public:
}
//- Is mesh moving
bool moving() const
bool moving() const noexcept
{
return moving_;
}
//- Set the mesh to be moving
bool moving(const bool m)
bool moving(const bool on) noexcept
{
bool m0 = moving_;
moving_ = m;
return m0;
bool old(moving_);
moving_ = on;
return old;
}
//- Is mesh topology changing
bool topoChanging() const
bool topoChanging() const noexcept
{
return topoChanging_;
}
//- Set the mesh topology to be changing
bool topoChanging(const bool c)
bool topoChanging(const bool on) noexcept
{
bool c0 = topoChanging_;
topoChanging_ = c;
return c0;
bool old(topoChanging_);
topoChanging_ = on;
return old;
}
//- Is mesh changing (topology changing and/or moving)
bool changing() const
bool changing() const noexcept
{
return moving()||topoChanging();
return (moving() || topoChanging());
}
//- Move points, returns volumes swept by faces in motion
@ -563,19 +563,19 @@ public:
// Topological change
//- Return non-const access to the pointZones
pointZoneMesh& pointZones()
pointZoneMesh& pointZones() noexcept
{
return pointZones_;
}
//- Return non-const access to the faceZones
faceZoneMesh& faceZones()
faceZoneMesh& faceZones() noexcept
{
return faceZones_;
}
//- Return non-const access to the cellZones
cellZoneMesh& cellZones()
cellZoneMesh& cellZones() noexcept
{
return cellZones_;
}
@ -669,6 +669,9 @@ public:
void removeFiles() const;
bool hasTetBasePtIs() const { return bool(tetBasePtIsPtr_); }
// Geometric checks. Selectively override primitiveMesh functionality.
//- Check non-orthogonality

View File

@ -92,7 +92,7 @@ void Foam::polyMesh::updateGeomPoints
<< exit(FatalError);
}
// Clear all geometric mesh objects that are not 'moveable'
// Clear all geometric mesh objects that are not 'movable'
meshObject::clearUpto
<
pointMesh,
@ -143,7 +143,7 @@ void Foam::polyMesh::updateGeomPoints
geometricD_ = Zero;
solutionD_ = Zero;
// Update all 'moveable' objects
// Update all 'movable' objects
meshObject::movePoints<polyMesh>(*this);
meshObject::movePoints<pointMesh>(*this);
}

View File

@ -30,7 +30,6 @@ License
#include "addToRunTimeSelectionTable.H"
#include "polyBoundaryMesh.H"
#include "polyMesh.H"
#include "demandDrivenData.H"
#include "OFstream.H"
#include "patchZones.H"
#include "matchPoints.H"

View File

@ -30,7 +30,6 @@ License
#include "addToRunTimeSelectionTable.H"
#include "dictionary.H"
#include "SubField.H"
#include "demandDrivenData.H"
#include "matchPoints.H"
#include "OFstream.H"
#include "polyMesh.H"

View File

@ -249,13 +249,6 @@ public:
//- Set/add group with zones
void setGroup(const word& groupName, const labelUList& zoneIDs);
//- Clear addressing
void clearAddressing();
//- Clear the zones
void clear();
//- Check zone definition. Return true if in error.
bool checkDefinition(const bool report = false) const;
@ -267,6 +260,17 @@ public:
void movePoints(const pointField& pts);
// Storage Management
//- Clear addressing
void clearAddressing();
//- Clear the zones
void clear();
bool hasFaceAreas() const { return bool(zoneMapPtr_); }
// Member Operators
//- Return const and non-const reference to zone by index.

View File

@ -297,13 +297,13 @@ public:
// Access
//- Return reference to global points
const Field<point_type>& points() const
const Field<point_type>& points() const noexcept
{
return points_;
}
//- Number of faces in the patch
label nFaces() const
label nFaces() const noexcept
{
return FaceList::size();
}

View File

@ -26,7 +26,6 @@ License
\*---------------------------------------------------------------------------*/
#include "primitiveMesh.H"
#include "demandDrivenData.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -69,7 +69,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
// Forward Declarations
class bitSet;
/*---------------------------------------------------------------------------*\
@ -484,28 +484,28 @@ public:
// Mesh size parameters
//- Number of mesh points
inline label nPoints() const;
inline label nPoints() const noexcept;
//- Number of mesh edges
inline label nEdges() const;
//- Number of mesh faces
inline label nFaces() const;
inline label nFaces() const noexcept;
//- Number of mesh cells
inline label nCells() const;
inline label nCells() const noexcept;
//- Number of internal faces
inline label nInternalFaces() const;
inline label nInternalFaces() const noexcept;
//- Number of boundary faces (== nFaces - nInternalFaces)
inline label nBoundaryFaces() const;
inline label nBoundaryFaces() const noexcept;
// If points are ordered (nInternalPoints != -1):
//- Points not on boundary
inline label nInternalPoints() const;
inline label nInternalPoints() const noexcept;
//- Internal edges (i.e. not on boundary face) using
//- no boundary point
@ -607,7 +607,7 @@ public:
//- Return true if given face label is internal to the mesh
inline bool isInternalFace(const label faceIndex) const;
inline bool isInternalFace(const label faceIndex) const noexcept;
// Topological checks
@ -795,23 +795,23 @@ public:
void printAllocated() const;
// Per storage whether allocated
inline bool hasCellShapes() const;
inline bool hasEdges() const;
inline bool hasCellCells() const;
inline bool hasEdgeCells() const;
inline bool hasPointCells() const;
inline bool hasCells() const;
inline bool hasEdgeFaces() const;
inline bool hasPointFaces() const;
inline bool hasCellEdges() const;
inline bool hasFaceEdges() const;
inline bool hasPointEdges() const;
inline bool hasPointPoints() const;
inline bool hasCellPoints() const;
inline bool hasCellCentres() const;
inline bool hasFaceCentres() const;
inline bool hasCellVolumes() const;
inline bool hasFaceAreas() const;
inline bool hasCellShapes() const noexcept;
inline bool hasEdges() const noexcept;
inline bool hasCellCells() const noexcept;
inline bool hasEdgeCells() const noexcept;
inline bool hasPointCells() const noexcept;
inline bool hasCells() const noexcept;
inline bool hasEdgeFaces() const noexcept;
inline bool hasPointFaces() const noexcept;
inline bool hasCellEdges() const noexcept;
inline bool hasFaceEdges() const noexcept;
inline bool hasPointEdges() const noexcept;
inline bool hasPointPoints() const noexcept;
inline bool hasCellPoints() const noexcept;
inline bool hasCellCentres() const noexcept;
inline bool hasFaceCentres() const noexcept;
inline bool hasCellVolumes() const noexcept;
inline bool hasFaceAreas() const noexcept;
// On-the-fly addressing calculation. These functions return either
// a reference to the full addressing (if already calculated) or

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -28,13 +28,13 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::label Foam::primitiveMesh::nInternalPoints() const
inline Foam::label Foam::primitiveMesh::nInternalPoints() const noexcept
{
return nInternalPoints_;
}
inline Foam::label Foam::primitiveMesh::nPoints() const
inline Foam::label Foam::primitiveMesh::nPoints() const noexcept
{
return nPoints_;
}
@ -75,133 +75,136 @@ inline Foam::label Foam::primitiveMesh::nEdges() const
}
inline Foam::label Foam::primitiveMesh::nInternalFaces() const
inline Foam::label Foam::primitiveMesh::nInternalFaces() const noexcept
{
return nInternalFaces_;
}
inline Foam::label Foam::primitiveMesh::nBoundaryFaces() const
inline Foam::label Foam::primitiveMesh::nBoundaryFaces() const noexcept
{
return (nFaces_ - nInternalFaces_);
}
inline Foam::label Foam::primitiveMesh::nFaces() const
inline Foam::label Foam::primitiveMesh::nFaces() const noexcept
{
return nFaces_;
}
inline Foam::label Foam::primitiveMesh::nCells() const
inline Foam::label Foam::primitiveMesh::nCells() const noexcept
{
return nCells_;
}
inline bool Foam::primitiveMesh::isInternalFace(const label faceIndex) const
inline bool Foam::primitiveMesh::isInternalFace
(
const label faceIndex
) const noexcept
{
return faceIndex < nInternalFaces_;
}
inline bool Foam::primitiveMesh::hasCellShapes() const
inline bool Foam::primitiveMesh::hasCellShapes() const noexcept
{
return cellShapesPtr_;
}
inline bool Foam::primitiveMesh::hasEdges() const
inline bool Foam::primitiveMesh::hasEdges() const noexcept
{
return edgesPtr_;
}
inline bool Foam::primitiveMesh::hasCellCells() const
inline bool Foam::primitiveMesh::hasCellCells() const noexcept
{
return ccPtr_;
}
inline bool Foam::primitiveMesh::hasEdgeCells() const
inline bool Foam::primitiveMesh::hasEdgeCells() const noexcept
{
return ecPtr_;
}
inline bool Foam::primitiveMesh::hasPointCells() const
inline bool Foam::primitiveMesh::hasPointCells() const noexcept
{
return pcPtr_;
}
inline bool Foam::primitiveMesh::hasCells() const
inline bool Foam::primitiveMesh::hasCells() const noexcept
{
return cfPtr_;
}
inline bool Foam::primitiveMesh::hasEdgeFaces() const
inline bool Foam::primitiveMesh::hasEdgeFaces() const noexcept
{
return efPtr_;
}
inline bool Foam::primitiveMesh::hasPointFaces() const
inline bool Foam::primitiveMesh::hasPointFaces() const noexcept
{
return pfPtr_;
}
inline bool Foam::primitiveMesh::hasCellEdges() const
inline bool Foam::primitiveMesh::hasCellEdges() const noexcept
{
return cePtr_;
}
inline bool Foam::primitiveMesh::hasFaceEdges() const
inline bool Foam::primitiveMesh::hasFaceEdges() const noexcept
{
return fePtr_;
}
inline bool Foam::primitiveMesh::hasPointEdges() const
inline bool Foam::primitiveMesh::hasPointEdges() const noexcept
{
return pePtr_;
}
inline bool Foam::primitiveMesh::hasPointPoints() const
inline bool Foam::primitiveMesh::hasPointPoints() const noexcept
{
return ppPtr_;
}
inline bool Foam::primitiveMesh::hasCellPoints() const
inline bool Foam::primitiveMesh::hasCellPoints() const noexcept
{
return cpPtr_;
}
inline bool Foam::primitiveMesh::hasCellCentres() const
inline bool Foam::primitiveMesh::hasCellCentres() const noexcept
{
return cellCentresPtr_;
}
inline bool Foam::primitiveMesh::hasFaceCentres() const
inline bool Foam::primitiveMesh::hasFaceCentres() const noexcept
{
return faceCentresPtr_;
}
inline bool Foam::primitiveMesh::hasCellVolumes() const
inline bool Foam::primitiveMesh::hasCellVolumes() const noexcept
{
return cellVolumesPtr_;
}
inline bool Foam::primitiveMesh::hasFaceAreas() const
inline bool Foam::primitiveMesh::hasFaceAreas() const noexcept
{
return faceAreasPtr_;
}

View File

@ -28,7 +28,6 @@ License
#include "ccmReader.H"
#include "IFstream.H"
#include "IOdictionary.H"
#include "demandDrivenData.H"
#include "ccmInternal.H" // include last to avoid any strange interactions

View File

@ -27,7 +27,7 @@ License
#include "ccmWriter.H"
#include "cellModel.H"
#include "demandDrivenData.H"
#include "ccmInternal.H" // include last to avoid any strange interactions
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -32,7 +32,6 @@ License
#include "pointIndList.H"
#include "Pstream.H"
#include "emptyPolyPatch.H"
#include "demandDrivenData.H"
#include "cyclicPolyPatch.H"
#include "removeCells.H"
#include "polyTopoChange.H"

View File

@ -30,7 +30,6 @@ License
#include "polyMesh.H"
#include "mapPolyMesh.H"
#include "polyTopoChanger.H"
#include "demandDrivenData.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -308,10 +308,7 @@ Foam::faMatrix<Type>::faMatrix
template<class Type>
Foam::tmp<Foam::faMatrix<Type>> Foam::faMatrix<Type>::clone() const
{
return tmp<faMatrix<Type>>
(
new faMatrix<Type>(*this)
);
return tmp<faMatrix<Type>>::New(*this);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 Wikki Ltd
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -74,11 +74,28 @@ class faMatrix
public refCount,
public lduMatrix
{
public:
// Public Types
//- Field type for psi
typedef
GeometricField<Type, faPatchField, areaMesh>
psiFieldType;
//- Field type for face flux (for non-orthogonal correction)
typedef
GeometricField<Type, faePatchField, edgeMesh>
faceFluxFieldType;
private:
// Private Data
//- Const reference to field
// Converted into a non-const reference at the point of solution.
const GeometricField<Type, faPatchField, areaMesh>& psi_;
const psiFieldType& psi_;
//- Dimension set
dimensionSet dimensions_;
@ -95,8 +112,7 @@ class faMatrix
FieldField<Field, Type> boundaryCoeffs_;
//- Face flux field for non-orthogonal correction
mutable GeometricField<Type, faePatchField, edgeMesh>
*faceFluxCorrectionPtr_;
mutable faceFluxFieldType* faceFluxCorrectionPtr_;
protected:
@ -285,17 +301,22 @@ public:
return boundaryCoeffs_;
}
//- Declare return type of the faceFluxCorrectionPtr() function
typedef GeometricField<Type, faePatchField, edgeMesh>
*edgeTypeFieldPtr;
*faceFluxFieldPtrType;
//- Return pointer to face-flux non-orthogonal correction field
edgeTypeFieldPtr& faceFluxCorrectionPtr()
faceFluxFieldPtrType& faceFluxCorrectionPtr()
{
return faceFluxCorrectionPtr_;
}
//- True if face-flux non-orthogonal correction field exists
bool hasFaceFluxCorrection() const noexcept
{
return bool(faceFluxCorrectionPtr_);
}
// Operations

View File

@ -27,7 +27,6 @@ License
#include "processorCyclicFvPatchField.H"
#include "processorCyclicFvPatch.H"
#include "demandDrivenData.H"
#include "transformField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -528,10 +528,7 @@ Foam::fvMatrix<Type>::fvMatrix
template<class Type>
Foam::tmp<Foam::fvMatrix<Type>> Foam::fvMatrix<Type>::clone() const
{
return tmp<fvMatrix<Type>>
(
new fvMatrix<Type>(*this)
);
return tmp<fvMatrix<Type>>::New(*this);
}

View File

@ -121,11 +121,27 @@ class fvMatrix
public refCount,
public lduMatrix
{
public:
// Public Types
//- Field type for psi
typedef
GeometricField<Type, fvPatchField, volMesh>
psiFieldType;
//- Field type for face flux (for non-orthogonal correction)
typedef
GeometricField<Type, fvsPatchField, surfaceMesh>
faceFluxFieldType;
private:
// Private Data
//- Const reference to field
// Converted into a non-const reference at the point of solution.
const GeometricField<Type, fvPatchField, volMesh>& psi_;
const psiFieldType& psi_;
//- Originating fvMatrices when assembling matrices. Empty if not used.
PtrList<fvMatrix<Type>> subMatrices_;
@ -154,8 +170,7 @@ class fvMatrix
FieldField<Field, Type> boundaryCoeffs_;
//- Face flux field for non-orthogonal correction
mutable GeometricField<Type, fvsPatchField, surfaceMesh>
*faceFluxCorrectionPtr_;
mutable faceFluxFieldType* faceFluxCorrectionPtr_;
protected:
@ -468,14 +483,20 @@ public:
//- Declare return type of the faceFluxCorrectionPtr() function
typedef GeometricField<Type, fvsPatchField, surfaceMesh>
*surfaceTypeFieldPtr;
*faceFluxFieldPtrType;
//- Return pointer to face-flux non-orthogonal correction field
surfaceTypeFieldPtr& faceFluxCorrectionPtr()
faceFluxFieldPtrType& faceFluxCorrectionPtr()
{
return faceFluxCorrectionPtr_;
}
//- True if face-flux non-orthogonal correction field exists
bool hasFaceFluxCorrection() const noexcept
{
return bool(faceFluxCorrectionPtr_);
}
// Operations

View File

@ -30,7 +30,6 @@ License
#include "fvMesh.H"
#include "volFields.H"
#include "pointFields.H"
#include "demandDrivenData.H"
#include "pointConstraints.H"
#include "surfaceFields.H"
#include "processorPointPatch.H"

View File

@ -83,7 +83,7 @@ class FaceCellWave
protected:
//- Information tagged with a source or destination id.
// With std::pair as lightweight, moveable container.
// With std::pair as lightweight, movable container.
typedef std::pair<label,Type> taggedInfoType;

View File

@ -30,7 +30,6 @@ License
#include "polyMesh.H"
#include "indexedOctree.H"
#include "DynamicList.H"
#include "demandDrivenData.H"
#include "treeDataCell.H"
#include "treeDataFace.H"

View File

@ -28,7 +28,6 @@ License
#include "sampledSurface.H"
#include "polyMesh.H"
#include "demandDrivenData.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -28,7 +28,6 @@ License
#include "sampledSurface.H"
#include "fvMesh.H"
#include "MeshedSurface.H"
#include "demandDrivenData.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //