ENH: additional face constructors, cellModel methods

- support construct face from subset of labels.

- additional cellModel face() method to return a single face.

- reduce some allocations in cellModel centre/mag methods

STYLE: mark old cellModeller methods as compile-time deprecated

- deprecated in 2017, but not marked as such

STYLE: indentation, spacing in some headers
This commit is contained in:
Mark Olesen
2020-10-05 16:49:15 +02:00
parent 525ad206be
commit 0783bd28d1
53 changed files with 265 additions and 253 deletions

View File

@ -8,8 +8,7 @@
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM, licensed under GNU General Public License
<http://www.gnu.org/licenses/>.
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
Typedef
Foam::PackedBoolList

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,17 +33,15 @@ License
const char* const Foam::cell::typeName = "cell";
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::labelList Foam::cell::labels(const faceUList& f) const
{
// return the unordered list of vertex labels supporting the cell
// count the maximum size of all vertices
label maxVert = 0;
const labelList& faces = *this;
// Count the maximum size of all vertices
label maxVert = 0;
forAll(faces, facei)
{
maxVert += f[faces[facei]].size();
@ -65,6 +64,7 @@ Foam::labelList Foam::cell::labels(const faceUList& f) const
// go through the rest of the faces. For each vertex, check if the point is
// already inserted (up to maxVert, which now carries the number of real
// points. If not, add it at the end of the list.
for (label facei = 1; facei < faces.size(); facei++)
{
const labelList& curFace = f[faces[facei]];
@ -87,8 +87,7 @@ Foam::labelList Foam::cell::labels(const faceUList& f) const
if (!found)
{
p[maxVert] = curPoint;
maxVert++;
++maxVert;
}
}
}
@ -121,11 +120,8 @@ Foam::pointField Foam::cell::points
Foam::edgeList Foam::cell::edges(const faceUList& f) const
{
// return the lisf of cell edges
const labelList& curFaces = *this;
// create a list of edges
label maxNoEdges = 0;
forAll(curFaces, facei)
@ -140,10 +136,8 @@ Foam::edgeList Foam::cell::edges(const faceUList& f) const
{
const edgeList curFaceEdges = f[curFaces[facei]].edges();
forAll(curFaceEdges, faceEdgeI)
for (const edge& curEdge : curFaceEdges)
{
const edge& curEdge = curFaceEdges[faceEdgeI];
bool edgeFound = false;
for (label addedEdgeI = 0; addedEdgeI < nEdges; addedEdgeI++)
@ -160,7 +154,7 @@ Foam::edgeList Foam::cell::edges(const faceUList& f) const
{
// Add the new edge onto the list
allEdges[nEdges] = curEdge;
nEdges++;
++nEdges;
}
}
}
@ -194,6 +188,7 @@ Foam::point Foam::cell::centre
// first calculate the approximate cell centre as the average of all
// face centres
vector cEst = Zero;
scalar sumArea = 0;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -56,27 +56,37 @@ class cell
:
public labelList
{
public:
// Static data members
// Static Data Members
static const char* const typeName;
// Constructors
//- Construct null
inline cell();
//- Default construct
constexpr cell() noexcept = default;
//- Construct given size, with invalid point labels (-1)
inline explicit cell(const label sz);
//- Copy construct from list of labels
inline explicit cell(const labelUList& lst);
//- Copy construct from list of face labels
inline explicit cell(const labelUList& list);
//- Move construct from list of labels
inline explicit cell(labelList&& lst);
//- Move construct from list of face labels
inline explicit cell(labelList&& list);
//- Copy construct from list of face labels
template<unsigned N>
inline explicit cell(const FixedList<label, N>& list);
//- Copy construct from subset of face labels
inline cell(const labelUList& list, const labelUList& indices);
//- Copy construct from subset of face labels
template<unsigned N>
inline cell(const labelUList& list, const FixedList<label, N>& indices);
//- Construct from Istream
inline cell(Istream& is);
@ -88,17 +98,17 @@ public:
inline label nFaces() const;
//- Return unordered list of cell vertices given the list of faces
labelList labels(const faceUList& f) const;
labelList labels(const faceUList& meshFaces) const;
//- Return the cell vertices given the list of faces and mesh points
pointField points
(
const faceUList& f,
const faceUList& meshFaces,
const UList<point>& meshPoints
) const;
//- Return cell edges
edgeList edges(const faceUList& f) const;
edgeList edges(const faceUList& meshFaces) const;
//- Return index of opposite face
label opposingFaceLabel
@ -124,10 +134,18 @@ public:
// future.
//- Returns cell centre
point centre(const UList<point>& p, const faceUList& f) const;
point centre
(
const UList<point>& meshPoints,
const faceUList& meshFaces
) const;
//- Returns cell volume
scalar mag(const UList<point>& p, const faceUList& f) const;
scalar mag
(
const UList<point>& meshPoints,
const faceUList& meshFaces
) const;
};

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,25 +28,45 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline Foam::cell::cell()
{}
inline Foam::cell::cell(const label sz)
:
labelList(sz, -1)
{}
inline Foam::cell::cell(const labelUList& lst)
inline Foam::cell::cell(const labelUList& list)
:
labelList(lst)
labelList(list)
{}
inline Foam::cell::cell(labelList&& lst)
template<unsigned N>
inline Foam::cell::cell(const FixedList<label, N>& list)
:
labelList(std::move(lst))
labelList(list)
{}
inline Foam::cell::cell(labelList&& list)
:
labelList(std::move(list))
{}
inline Foam::cell::cell(const labelUList& list, const labelUList& indices)
:
labelList(list, indices)
{}
template<unsigned N>
inline Foam::cell::cell
(
const labelUList& list,
const FixedList<label, N>& indices
)
:
labelList(list, indices)
{}

View File

@ -80,8 +80,7 @@ SourceFiles
#ifndef cellMatcher_H
#define cellMatcher_H
#include "labelList.H"
#include "faceList.H"
#include "cellModel.H"
#include "Map.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -89,11 +88,10 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
class primitiveMesh;
// Forward Declarations
class cell;
class cellModel;
class cellShape;
class primitiveMesh;
/*---------------------------------------------------------------------------*\
Class cellMatcher Declaration
@ -103,7 +101,7 @@ class cellMatcher
{
protected:
// Static functions
// Static Functions
//- Given start and end of edge generate unique key
inline static label edgeKey
@ -116,7 +114,8 @@ protected:
//- Step along face either in righthand or lefthand direction
inline static label nextVert(const label, const label, const bool);
// Protected data
// Protected Data
// Map from mesh to local vertex numbering
Map<label> localPoint_;
@ -174,11 +173,6 @@ protected:
const label localFacei
) const;
private:
// Private Member Functions
//- No copy construct
cellMatcher(const cellMatcher&) = delete;
@ -224,6 +218,7 @@ public:
void write(Ostream& os) const;
// Cell shape dependent
virtual label nVertPerCell() const = 0;
@ -271,7 +266,6 @@ public:
const label celli,
cellShape& shape
) = 0;
};

View File

@ -25,9 +25,6 @@ License
\*---------------------------------------------------------------------------*/
#include "primitiveMesh.H"
#include "cellModel.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::Map<Foam::label>& Foam::cellMatcher::localPoint() const

View File

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

View File

@ -60,8 +60,7 @@ namespace Foam
class degenerateMatcher
{
// Static data members
// Static Data Members
//- Matchers for all degenerate hex shapes
static hexMatcher hex;
@ -71,7 +70,8 @@ class degenerateMatcher
static pyrMatcher pyr;
static tetMatcher tet;
// Static functions
// Static Functions
//- Recognize basic shape
static cellShape match
@ -84,13 +84,13 @@ class degenerateMatcher
public:
// Static data members
// Static Functions
//- Recognize shape given faces of a cell
static cellShape match(const faceList& faces);
//- Recognize given uncollapsed shape (usually hex) with duplicate
// vertices. cellShape just used to extract faces.
//- vertices. cellShape just used to extract faces.
static cellShape match(const cellShape& shape);
//- Recognize shape given mesh and celli

View File

@ -38,17 +38,11 @@ Foam::hexMatcher::hexMatcher()
vertPerCell,
facePerCell,
maxVertPerFace,
"hex" // same as cellModel::modelNames[cellModel::HEX]
"hex" // == cellModel::modelNames[cellModel::HEX]
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::hexMatcher::~hexMatcher()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::hexMatcher::matchShape

View File

@ -76,11 +76,12 @@ public:
// Constructors
//- Construct null
//- Default construct
hexMatcher();
//- Destructor
~hexMatcher();
~hexMatcher() = default;
// Member Functions

View File

@ -38,14 +38,10 @@ Foam::prismMatcher::prismMatcher()
vertPerCell,
facePerCell,
maxVertPerFace,
"prism" // same as cellModel::modelNames[cellModel::PRISM]
"prism" // == cellModel::modelNames[cellModel::PRISM]
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::prismMatcher::~prismMatcher()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -76,11 +76,12 @@ public:
// Constructors
//- Construct
//- Default construct
prismMatcher();
//- Destructor
~prismMatcher();
~prismMatcher() = default;
// Member Functions

View File

@ -40,17 +40,11 @@ Foam::pyrMatcher::pyrMatcher()
vertPerCell,
facePerCell,
maxVertPerFace,
"pyr" // same as cellModel::modelNames[cellModel::PYR]
"pyr" // == cellModel::modelNames[cellModel::PYR]
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pyrMatcher::~pyrMatcher()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::pyrMatcher::matchShape

View File

@ -76,11 +76,12 @@ public:
// Constructors
//- Construct null
//- Default construct
pyrMatcher();
//- Destructor
~pyrMatcher();
~pyrMatcher() = default;
// Member Functions

View File

@ -40,20 +40,13 @@ Foam::tetMatcher::tetMatcher()
vertPerCell,
facePerCell,
maxVertPerFace,
"tet" // same as cellModel::modelNames[cellModel::TET]
"tet" // == cellModel::modelNames[cellModel::TET]
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::tetMatcher::~tetMatcher()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::tetMatcher::matchShape
(
const bool checkOnly,

View File

@ -76,11 +76,12 @@ public:
// Constructors
//- Construct null
//- Default construct
tetMatcher();
//- Destructor
~tetMatcher();
~tetMatcher() = default;
// Member Functions

View File

@ -40,17 +40,11 @@ Foam::tetWedgeMatcher::tetWedgeMatcher()
vertPerCell,
facePerCell,
maxVertPerFace,
"tetWedge" // same as cellModel::modelNames[cellModel::TETWEDGE]
"tetWedge" // == cellModel::modelNames[cellModel::TETWEDGE]
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::tetWedgeMatcher::~tetWedgeMatcher()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::tetWedgeMatcher::matchShape

View File

@ -76,11 +76,12 @@ public:
// Constructors
//- Construct null
//- Default construct
tetWedgeMatcher();
//- Destructor
~tetWedgeMatcher();
~tetWedgeMatcher() = default;
// Member Functions

View File

@ -38,17 +38,11 @@ Foam::wedgeMatcher::wedgeMatcher()
vertPerCell,
facePerCell,
maxVertPerFace,
"wedge" // same as cellModel::modelNames[cellModel::WEDGE]
"wedge" // == cellModel::modelNames[cellModel::WEDGE]
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::wedgeMatcher::~wedgeMatcher()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::wedgeMatcher::matchShape

View File

@ -76,11 +76,12 @@ public:
// Constructors
//- Construct null
//- Default construct
wedgeMatcher();
//- Destructor
~wedgeMatcher();
~wedgeMatcher() = default;
// Member Functions

View File

@ -27,7 +27,7 @@ License
\*---------------------------------------------------------------------------*/
#include "cellModel.H"
#include "pyramid.H"
#include "pyramidPointFaceRef.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -37,51 +37,37 @@ Foam::vector Foam::cellModel::centre
const UList<point>& points
) const
{
// Estimate centre of cell
// Estimate cell centre by averaging the cell points
vector cEst = Zero;
// Sum the points indicated by the label list
forAll(pointLabels, i)
for (const label pointi : pointLabels)
{
cEst += points[pointLabels[i]];
cEst += points[pointi];
}
// Average by dividing by the number summed over.
cEst /= scalar(pointLabels.size());
// Calculate the centre by breaking the cell into pyramids and
// volume-weighted averaging their centres
scalar sumV = 0.0;
scalar sumV = 0;
vector sumVc = Zero;
const faceList cellFaces = faces(pointLabels);
forAll(cellFaces, i)
forAll(faces_, facei)
{
const face& curFace = cellFaces[i];
const Foam::face f(pointLabels, faces_[facei]);
scalar pyrVol =
pyramid<point, const point&, const face&>
(
curFace,
cEst
).mag(points);
const scalar pyrVol = pyramidPointFaceRef(f, cEst).mag(points);
if (pyrVol > SMALL)
{
WarningInFunction
<< "zero or negative pyramid volume: " << -pyrVol
<< " for face " << i
<< " for face " << facei
<< endl;
}
sumVc -=
pyrVol
*pyramid<point, const point&, const face&>(curFace, cEst)
.centre(points);
sumV -= pyrVol;
sumVc -= pyrVol * pyramidPointFaceRef(f, cEst).centre(points);
}
return sumVc/(sumV + VSMALL);
@ -94,16 +80,12 @@ Foam::scalar Foam::cellModel::mag
const UList<point>& points
) const
{
// Estimate centre of cell
// Estimate cell centre by averaging the cell points
vector cEst = Zero;
// Sum the points indicated by the label list
forAll(pointLabels, i)
for (const label pointi : pointLabels)
{
cEst += points[pointLabels[i]];
cEst += points[pointi];
}
// Average by dividing by the number summed over.
cEst /= scalar(pointLabels.size());
@ -111,33 +93,27 @@ Foam::scalar Foam::cellModel::mag
// The sign change is because the faces point outwards
// and a pyramid is constructed from an inward pointing face
// and the base centre-apex vector
scalar v = 0;
const faceList cellFaces = faces(pointLabels);
scalar sumV = 0;
forAll(cellFaces, i)
forAll(faces_, facei)
{
const face& curFace =cellFaces[i];
const Foam::face f(pointLabels, faces_[facei]);
scalar pyrVol =
pyramid<point, const point&, const face&>
(
curFace,
cEst
).mag(points);
const scalar pyrVol = pyramidPointFaceRef(f, cEst).mag(points);
if (pyrVol > SMALL)
{
WarningInFunction
<< "zero or negative pyramid volume: " << -pyrVol
<< " for face " << i
<< " for face " << facei
<< endl;
}
v -= pyrVol;
sumV -= pyrVol;
}
return v;
return sumV;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -62,7 +62,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
// Forward Declarations
class cellModel;
Ostream& operator<<(Ostream& os, const cellModel& cm);
@ -93,7 +93,7 @@ public:
static const Enum<modelType> modelNames;
// Lookup Static Models
// Lookup Methods
//- Look up pointer to cellModel by enumeration, or nullptr on failure.
static const cellModel* ptr(const modelType model);
@ -155,9 +155,9 @@ public:
// Constructors
//- Construct from Istream
cellModel(Istream& is);
explicit cellModel(Istream& is);
//- Return a new cellModel on free-store created from Istream
//- Return a new cellModel created from Istream
static autoPtr<cellModel> New(Istream& is)
{
return autoPtr<cellModel>::New(is);
@ -170,7 +170,7 @@ public:
}
// Member functions
// Member Functions
//- Return model name
inline const word& name() const;
@ -193,12 +193,19 @@ public:
//- Return a raw list of model faces
inline const faceList& modelFaces() const;
//- Return list of edges
//- Return list of cell edges
inline edgeList edges(const labelUList& pointLabels) const;
//- Return list of faces
//- Return list of cell faces
inline faceList faces(const labelUList& pointLabels) const;
//- Return the cell face for specified model face
inline Foam::face face
(
const label modelFacei,
const labelUList& pointLabels
) const;
//- Vector centroid
vector centre
@ -221,7 +228,7 @@ public:
return *this;
}
//- WriteData member function required by regIOobject
//- The writeData member function required by regIOobject
bool writeData(Ostream& os) const
{
os << *this;
@ -229,20 +236,19 @@ public:
}
// Ostream operator
friend Ostream& operator<<(Ostream& os, const cellModel& cm);
// Ostream Operator
friend Ostream& operator<<(Ostream& os, const cellModel& cm);
};
// Ostream operators
// Ostream Operators
template<>
Ostream& operator<<(Ostream& os, const InfoProxy<cellModel>& ip);
// Global operators
// Global Operators
//- Equality: true when model pointers are identical
inline bool operator==(const cellModel& lhs, const cellModel& rhs);

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -69,55 +70,53 @@ inline const Foam::faceList& Foam::cellModel::modelFaces() const
}
// Return the faces of a cellModel by untangling the geometry
// supplied in terms of the face labels
inline Foam::edgeList Foam::cellModel::edges
(
const labelUList& pointLabels
) const
{
edgeList e(edges_.size());
edgeList theEdges(edges_.size());
// Translate model labels into global labels
forAll(edges_, edgei)
{
e[edgei] =
edge
(
pointLabels[edges_[edgei].start()],
pointLabels[edges_[edgei].end()]
);
// From model labels to global labels
theEdges[edgei] =
edge
(
pointLabels[edges_[edgei].first()],
pointLabels[edges_[edgei].second()]
);
}
return e;
return theEdges;
}
// Return the faces of a cellModel by untangling the geometry
// supplied in terms of the face labels
inline Foam::faceList Foam::cellModel::faces
(
const labelUList& pointLabels
) const
{
faceList f(faces_.size());
faceList theFaces(faces_.size());
// Translate model labels into global labels
forAll(faces_, facei)
{
const labelList& curModelLabels = faces_[facei];
face& curFace = f[facei];
curFace.setSize(curModelLabels.size());
forAll(curModelLabels, labeli)
{
curFace[labeli] = pointLabels[curModelLabels[labeli]];
}
// From model labels to global labels
theFaces[facei] = Foam::face(pointLabels, faces_[facei]);
}
return f;
return theFaces;
}
inline Foam::face Foam::cellModel::face
(
const label modelFacei,
const labelUList& pointLabels
) const
{
// From model labels to global labels
return Foam::face(pointLabels, faces_[modelFacei]);
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.

View File

@ -5,11 +5,10 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM, licensed under GNU General Public License
<http://www.gnu.org/licenses/>.
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
Namespace
Foam::cellModeller
@ -20,6 +19,7 @@ Description
Superseded (NOV-2017) by cellModel methods.
\*---------------------------------------------------------------------------*/
#ifndef cellModeller_H
#define cellModeller_H
@ -34,14 +34,16 @@ namespace cellModeller
//- Deprecated(2017-11) equivalent to cellModel::ptr static method.
// \deprecated(2017-11) use cellModel::ptr instead
inline const cellModel* lookup(const word& modelName)
FOAM_DEPRECATED_FOR(2017-11, "cellModel::ptr() static method")
const cellModel* lookup(const word& modelName)
{
return cellModel::ptr(modelName);
}
//- Deprecated(2017-11) equivalent to cellModel::ptr static method.
// \deprecated(2017-11) use cellModel::ptr instead
inline const cellModel* lookup(const label modelIndex)
FOAM_DEPRECATED_FOR(2017-11, "cellModel::ptr() static method")
const cellModel* lookup(const label modelIndex)
{
return cellModel::ptr(modelIndex);
}

View File

@ -54,11 +54,8 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
// Forward Declarations
class cell;
// Forward declaration of friend functions and operators
class cellShape;
bool operator==(const cellShape& a, const cellShape& b);
Istream& operator>>(Istream& is, cellShape& s);
@ -73,7 +70,7 @@ class cellShape
:
public labelList
{
// Private data
// Private Data
//- Access to the cellShape's model
const cellModel *m;
@ -83,10 +80,10 @@ public:
// Constructors
//- Construct null
inline cellShape();
//- Default construct
inline constexpr cellShape() noexcept;
//- Construct from components
//- Copy construct from components
inline cellShape
(
const cellModel& model,
@ -94,7 +91,7 @@ public:
const bool doCollapse = false
);
//- Construct from components
//- Move construct from components
inline cellShape
(
const cellModel& model,
@ -102,7 +99,7 @@ public:
const bool doCollapse = false
);
//- Construct from components
//- Copy construct from components
inline cellShape
(
const word& modelName,

View File

@ -23,9 +23,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Equality operator for cellShape class
\*---------------------------------------------------------------------------*/
#include "cellShape.H"

View File

@ -31,8 +31,9 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline Foam::cellShape::cellShape()
inline constexpr Foam::cellShape::cellShape() noexcept
:
labelList(),
m(nullptr)
{}

View File

@ -72,7 +72,7 @@ Foam::Istream& Foam::operator>>(Istream& is, cellShape& s)
}
// Check that a model was found
if (!s.m)
if (s.m == nullptr)
{
FatalIOErrorInFunction(is)
<< "CellShape has unknown model " << t.info()

View File

@ -74,16 +74,16 @@ public:
// Constructors
//- Construct null with invalid point labels (-1)
//- Default construct, with invalid point labels (-1)
inline edge();
//- Construct from two point labels
inline edge(const label from, const label to);
//- Construct from pair of labels
//- Construct from pair of point labels
inline edge(const labelPair& pair);
//- Construct from list
//- Construct from list of point labels
inline edge(const FixedList<label, 2>& list);
//- Construct from two point labels, sorted with first less-than second
@ -92,7 +92,7 @@ public:
//- Construct from list, sorted with first less-than second
inline edge(const FixedList<label, 2>& list, const bool doSort);
//- Copy construct from a subset of the input
//- Copy construct from a subset of point labels
inline edge
(
const UList<label>& list,

View File

@ -42,6 +42,7 @@ SourceFiles
faceTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef face_H
#define face_H
@ -63,7 +64,6 @@ namespace Foam
// Forward Declarations
class face;
class triFace;
template<class T, int SizeMin> class DynamicList;
/*---------------------------------------------------------------------------*\
@ -136,6 +136,7 @@ public:
EDGE // Close to edge
};
// Static Data Members
static const char* const typeName;
@ -144,23 +145,30 @@ public:
// Constructors
//- Default construct
face() = default;
constexpr face() noexcept = default;
//- Construct given size, with invalid point labels (-1)
inline explicit face(const label sz);
//- Copy construct from list of labels
//- Copy construct from list of point labels
inline explicit face(const labelUList& list);
//- Copy construct from list of labels
//- Move construct from list of point labels
inline explicit face(labelList&& list);
//- Copy construct from an initializer list of point labels
inline explicit face(std::initializer_list<label> list);
//- Copy construct from list of point labels
template<unsigned N>
inline explicit face(const FixedList<label, N>& list);
//- Copy construct from an initializer list of labels
inline explicit face(std::initializer_list<label> list);
//- Copy construct from subset of point labels
inline face(const labelUList& list, const labelUList& indices);
//- Move construct from list of labels
inline explicit face(labelList&& list);
//- Copy construct from subset of point labels
template<unsigned N>
inline face(const labelUList& list, const FixedList<label, N>& indices);
//- Copy construct from triFace
face(const triFace& f);
@ -214,6 +222,7 @@ public:
// The starting points of the original and reverse face are identical.
face reverseFace() const;
// Navigation through face vertices
//- Return true if the point label is found in face.
@ -238,7 +247,7 @@ public:
) const;
//- Return the inertia tensor, with optional reference
// point and density specification
//- point and density specification
tensor inertia
(
const UList<point>& p,
@ -247,7 +256,7 @@ public:
) const;
//- Return potential intersection with face with a ray starting
// at p, direction n (does not need to be normalized)
//- at p, direction n (does not need to be normalized)
// Does face-centre decomposition and returns triangle intersection
// point closest to p. Face-centre is calculated from point average.
// For a hit, the distance is signed. Positive number
@ -450,6 +459,7 @@ struct offsetOp<face>
//- Deprecated(2017-04) find the longest edge on a face.
//- Face point labels index into pts.
// \deprecated(2017-04) use class method instead
FOAM_DEPRECATED_FOR(2017-04, "use face::longestEdge() method")
label longestEdge(const face& f, const UList<point>& pts);

View File

@ -54,10 +54,9 @@ inline Foam::face::face(const labelUList& list)
{}
template<unsigned N>
inline Foam::face::face(const FixedList<label, N>& list)
inline Foam::face::face(labelList&& list)
:
labelList(list)
labelList(std::move(list))
{}
@ -67,9 +66,27 @@ inline Foam::face::face(std::initializer_list<label> list)
{}
inline Foam::face::face(labelList&& list)
template<unsigned N>
inline Foam::face::face(const FixedList<label, N>& list)
:
labelList(std::move(list))
labelList(list)
{}
inline Foam::face::face(const labelUList& list, const labelUList& indices)
:
labelList(list, indices)
{}
template<unsigned N>
inline Foam::face::face
(
const labelUList& list,
const FixedList<label, N>& indices
)
:
labelList(list, indices)
{}

View File

@ -51,7 +51,6 @@ class labelledTri;
Istream& operator>>(Istream&, labelledTri&);
Ostream& operator<<(Ostream&, const labelledTri&);
/*---------------------------------------------------------------------------*\
Class labelledTri Declaration
\*---------------------------------------------------------------------------*/
@ -60,7 +59,7 @@ class labelledTri
:
public triFace
{
// Private data
// Private Data
label region_;
@ -75,7 +74,7 @@ public:
// Constructors
//- Construct null with invalid point labels and region (-1).
//- Default construct, with invalid point labels and region (-1).
inline labelledTri();
//- Construct from triFace and region label.

View File

@ -64,7 +64,6 @@ class tetCell
:
public FixedList<label, 4>
{
public:
// Constructors
@ -87,7 +86,7 @@ public:
//- Construct from FixedList of four point labels
inline tetCell(const FixedList<label, 4>& list);
//- Copy construct from a subset of the input list
//- Copy construct from a subset of point labels
inline tetCell
(
const labelUList& list,

View File

@ -63,7 +63,6 @@ class triFace;
inline bool operator==(const triFace& a, const triFace& b);
inline bool operator!=(const triFace& a, const triFace& b);
/*---------------------------------------------------------------------------*\
Class triFace Declaration
\*---------------------------------------------------------------------------*/
@ -76,7 +75,7 @@ public:
// Constructors
//- Construct null with invalid point labels (-1)
//- Default construct, with invalid point labels (-1)
inline triFace();
//- Construct from three point labels
@ -93,7 +92,7 @@ public:
//- Copy construct from a list of three point labels.
inline explicit triFace(const labelUList& list);
//- Copy construct from a subset of the input
//- Copy construct from a subset of point labels
inline triFace
(
const labelUList& list,

View File

@ -34,6 +34,7 @@ SourceFiles
polyMeshTools.C
\*---------------------------------------------------------------------------*/
#ifndef polyMeshTools_H
#define polyMeshTools_H

View File

@ -34,6 +34,7 @@ SourceFiles
primitiveMeshTools.C
\*---------------------------------------------------------------------------*/
#ifndef primitiveMeshTools_H
#define primitiveMeshTools_H

View File

@ -27,6 +27,7 @@ Typedef
Foam::linePoint2DRef
Description
A line using referred 2D points
\*---------------------------------------------------------------------------*/

View File

@ -27,7 +27,7 @@ Typedef
Foam::linePointRef
Description
Line using referred points
A line using referred points
\*---------------------------------------------------------------------------*/

View File

@ -44,7 +44,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
// Forward Declarations
template<class Point, class PointRef, class polygonRef>
class pyramid;
@ -71,9 +71,10 @@ inline Ostream& operator<<
template<class Point, class PointRef, class polygonRef>
class pyramid
{
// Private data
// Private Data
polygonRef base_;
PointRef apex_;
@ -88,7 +89,7 @@ public:
inline pyramid(Istream& is);
// Member functions
// Member Functions
// Access

View File

@ -27,6 +27,7 @@ Typedef
Foam::pyramidPointFaceRef
Description
A pyramid using referred points and faces
\*---------------------------------------------------------------------------*/

View File

@ -27,6 +27,7 @@ Typedef
Foam::tetPointRef
Description
A tetrahedron using referred points
\*---------------------------------------------------------------------------*/

View File

@ -27,6 +27,7 @@ Typedef
Foam::triPointRef
Description
A triangle using referred points
\*---------------------------------------------------------------------------*/

View File

@ -43,6 +43,7 @@ SourceFiles
scalarRange.C
\*---------------------------------------------------------------------------*/
#ifndef scalarRange_H
#define scalarRange_H

View File

@ -35,6 +35,7 @@ SourceFiles
parsingI.H
\*---------------------------------------------------------------------------*/
#ifndef parsing_H
#define parsing_H

View File

@ -8,8 +8,7 @@
Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM, licensed under GNU General Public License
<http://www.gnu.org/licenses/>.
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
Typedef
Foam::wordReListMatcher

View File

@ -27,6 +27,7 @@ Description
Internal bits for wrapping libccmio - do not use directly
\*---------------------------------------------------------------------------*/
#ifndef ccmInternal_H
#define ccmInternal_H

View File

@ -27,6 +27,7 @@ Description
Container for holding STARCCM boundary information
\*---------------------------------------------------------------------------*/
#ifndef ccmBoundaryInfo_H
#define ccmBoundaryInfo_H

View File

@ -27,6 +27,7 @@ Description
Containers for holding STARCCM interface definitions
\*---------------------------------------------------------------------------*/
#ifndef ccmInterfaceDefinitions_H
#define ccmInterfaceDefinitions_H

View File

@ -27,6 +27,7 @@ Description
Containers for holding ccm solution and field listings.
\*---------------------------------------------------------------------------*/
#ifndef ccmSolutionTable_H
#define ccmSolutionTable_H

View File

@ -87,6 +87,7 @@ SourceFiles
ccmWriterSolution.C
\*---------------------------------------------------------------------------*/
#ifndef ccmWriter_H
#define ccmWriter_H

View File

@ -8,14 +8,13 @@
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM, licensed under GNU General Public License
<http://www.gnu.org/licenses/>.
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
Typedef
Foam::meshSubsetHelper
Description
Compatibility name. Rename (JUL-2018) as Foam::fvMeshSubsetProxy
Compatibility name. Renamed (JUL-2018) as Foam::fvMeshSubsetProxy
\*---------------------------------------------------------------------------*/

View File

@ -58,6 +58,7 @@ SourceFiles
coordinateSystems.C
\*---------------------------------------------------------------------------*/
#ifndef coordinateSystems_H
#define coordinateSystems_H