STYLE: adjust code format for trackingData

- rationalized some layout and comments
This commit is contained in:
Mark Olesen
2020-01-20 12:14:18 +01:00
parent 0a9295b219
commit f4ee841c6d
84 changed files with 1140 additions and 1224 deletions

View File

@ -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.
@ -59,15 +59,18 @@ class smoothDelta
{
public:
//- Public member class used by mesh-wave to propagate the delta-ratio
//- Public class used by mesh-wave to propagate the delta-ratio
class deltaData
{
scalar delta_;
// Private Data
scalar delta_;
// Private Member Functions
//- Update. Gets information from neighbouring face/cell and
// uses this to update itself (if necessary) and return true.
//- Update gets information from neighbouring face/cell and
//- uses this to update itself (if necessary) and return true.
template<class TrackingData>
inline bool update
(
@ -82,7 +85,7 @@ public:
// Constructors
//- Construct null
//- Default construct
inline deltaData();
//- Construct from delta value
@ -93,21 +96,19 @@ public:
// Access
scalar delta() const
{
return delta_;
}
scalar delta() const
{
return delta_;
}
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data.
// Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -118,7 +119,7 @@ public:
) const;
//- Convert any absolute coordinates into relative to
// (patch)face centre
//- (patch)face centre
template<class TrackingData>
inline void leaveDomain
(
@ -184,40 +185,40 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const deltaData&, TrackingData& td) const;
// Member Operators
// Needed for List IO
inline bool operator==(const deltaData&) const;
// Member Operators
inline bool operator!=(const deltaData&) const;
//- Test for equality
inline bool operator==(const deltaData&) const;
// IOstream Operators
//- Test for inequality
inline bool operator!=(const deltaData&) const;
friend Ostream& operator<<
(
Ostream& os,
const deltaData& wDist
)
{
return os << wDist.delta_;
}
friend Istream& operator>>(Istream& is, deltaData& wDist)
{
return is >> wDist.delta_;
}
// IOstream Operators
friend Ostream& operator<<(Ostream& os, const deltaData& rhs)
{
return os << rhs.delta_;
}
friend Istream& operator>>(Istream& is, deltaData& rhs)
{
return is >> rhs.delta_;
}
};
private:
// Private data
// Private Data
autoPtr<LESdelta> geometricDelta_;
scalar maxDeltaRatio_;
@ -253,10 +254,9 @@ private:
DynamicList<deltaData>& changedFacesInfo
);
public:
//- Runtime type information
//- Declare type-name, virtual type (with debug switch)
TypeName("smooth");
@ -278,7 +278,7 @@ public:
// Member Functions
//- Read the LESdelta dictionary
virtual void read(const dictionary&);
virtual void read(const dictionary& dict);
// Correct values
virtual void correct();

View File

@ -198,7 +198,7 @@ inline bool Foam::LESModels::smoothDelta::deltaData::operator==
const deltaData& rhs
) const
{
return delta_ == rhs.delta();
return delta_ == rhs.delta_;
}

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.
@ -199,23 +200,23 @@ Foam::label Foam::directionInfo::edgeToFaceIndex
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::directionInfo& wDist
Ostream& os,
const directionInfo& rhs
)
{
if (os.format() == IOstream::ASCII)
{
os << wDist.index_ << wDist.n_;
os << rhs.index_ << rhs.n_;
}
else
{
os.write
(
reinterpret_cast<const char*>(&wDist.index_),
reinterpret_cast<const char*>(&rhs.index_),
sizeof(directionInfo)
);
}
@ -225,19 +226,23 @@ Foam::Ostream& Foam::operator<<
}
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::directionInfo& wDist)
Foam::Istream& Foam::operator>>
(
Istream& is,
directionInfo& rhs
)
{
if (is.format() == IOstream::ASCII)
{
is >> wDist.index_ >> wDist.n_;
is >> rhs.index_ >> rhs.n_;
}
else if (!is.checkLabelSize<>() || !is.checkScalarSize<>())
{
// Non-native label or scalar size
is.beginRawRead();
readRawLabel(is, &wDist.index_);
readRawScalar(is, wDist.n_.data(), vector::nComponents);
readRawLabel(is, &rhs.index_);
readRawScalar(is, rhs.n_.data(), vector::nComponents);
is.endRawRead();
}
@ -245,7 +250,7 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::directionInfo& wDist)
{
is.read
(
reinterpret_cast<char*>(&wDist.index_),
reinterpret_cast<char*>(&rhs.index_),
sizeof(directionInfo)
);
}

View File

@ -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.
@ -72,13 +72,11 @@ class polyMesh;
class primitiveMesh;
class edge;
class face;
class polyMesh;
class directionInfo;
Istream& operator>>(Istream&, directionInfo&);
Ostream& operator<<(Ostream&, const directionInfo&);
/*---------------------------------------------------------------------------*\
Class directionInfo Declaration
\*---------------------------------------------------------------------------*/
@ -87,10 +85,10 @@ class directionInfo
{
// Private Data
// Either mesh edge or face point
//- The mesh edge or face point
label index_;
// Local n axis
//- The local n axis
vector n_;
@ -128,44 +126,42 @@ public:
const label edgeI
);
// Constructors
//- Construct null
//- Default construct, index=-1, vector::zero
inline directionInfo();
//- Construct from components
inline directionInfo
(
const label,
const label index,
const vector& n
);
//- Construct as copy
inline directionInfo(const directionInfo&);
// Member Functions
// Access
inline label index() const
label index() const
{
return index_;
}
inline const vector& n() const
const vector& n() const
{
return n_;
}
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -242,15 +238,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const directionInfo&, TrackingData& td) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const directionInfo&) const;
//- Test for inequality
inline bool operator!=(const directionInfo&) const;

View File

@ -31,7 +31,6 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::directionInfo::directionInfo()
:
index_(-3),
@ -39,7 +38,6 @@ inline Foam::directionInfo::directionInfo()
{}
// Construct from components
inline Foam::directionInfo::directionInfo
(
const label index,
@ -51,14 +49,6 @@ inline Foam::directionInfo::directionInfo
{}
// Construct as copy
inline Foam::directionInfo::directionInfo(const directionInfo& w2)
:
index_(w2.index()),
n_(w2.n())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class TrackingData>
@ -76,8 +66,7 @@ inline bool Foam::directionInfo::sameGeometry
const directionInfo& w2,
const scalar tol,
TrackingData& td
)
const
) const
{
return true;
}
@ -253,7 +242,6 @@ inline bool Foam::directionInfo::updateFace
index_ = -2;
}
n_ = neighbourInfo.n();
return true;
@ -300,15 +288,19 @@ inline bool Foam::directionInfo::equal
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::directionInfo::operator==(const Foam::directionInfo& rhs)
const
inline bool Foam::directionInfo::operator==
(
const directionInfo& rhs
) const
{
return index() == rhs.index() && n() == rhs.n();
return index_ == rhs.index_ && n_ == rhs.n_;
}
inline bool Foam::directionInfo::operator!=(const Foam::directionInfo& rhs)
const
inline bool Foam::directionInfo::operator!=
(
const directionInfo& rhs
) const
{
return !(*this == rhs);
}

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,23 +28,23 @@ License
#include "wallNormalInfo.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::wallNormalInfo& wDist
Ostream& os,
const wallNormalInfo& rhs
)
{
if (os.format() == IOstream::ASCII)
{
os << wDist.normal();
os << rhs.normal();
}
else
{
os.write
(
reinterpret_cast<const char*>(&wDist.normal_),
reinterpret_cast<const char*>(&rhs.normal_),
sizeof(vector)
);
}
@ -53,18 +54,22 @@ Foam::Ostream& Foam::operator<<
}
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::wallNormalInfo& wDist)
Foam::Istream& Foam::operator>>
(
Istream& is,
wallNormalInfo& rhs
)
{
if (is.format() == IOstream::ASCII)
{
is >> wDist.normal_;
is >> rhs.normal_;
}
else if (!is.checkLabelSize<>() || !is.checkScalarSize<>())
{
// Non-native label or scalar size
is.beginRawRead();
readRawScalar(is, wDist.normal_.data(), vector::nComponents);
readRawScalar(is, rhs.normal_.data(), vector::nComponents);
is.endRawRead();
}
@ -72,7 +77,7 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::wallNormalInfo& wDist)
{
is.read
(
reinterpret_cast<char*>(&wDist.normal_),
reinterpret_cast<char*>(&rhs.normal_),
sizeof(vector)
);
}

View File

@ -58,52 +58,58 @@ class wallNormalInfo;
Istream& operator>>(Istream&, wallNormalInfo&);
Ostream& operator<<(Ostream&, const wallNormalInfo&);
/*---------------------------------------------------------------------------*\
Class wallNormalInfo Declaration
\*---------------------------------------------------------------------------*/
class wallNormalInfo
{
// Private data
// Private Data
//- Normal at nearest wall point
vector normal_;
// Private Member Functions
//- Evaluate distance to point. Update normal_
//- Evaluate distance to point and update normal_
template<class TrackingData>
inline bool update(const wallNormalInfo& w2, TrackingData& td);
public:
// Constructors
//- Construct null
//- Default construct
inline wallNormalInfo();
//- Construct from normal
inline wallNormalInfo(const vector& normal);
//- Construct as copy
inline wallNormalInfo(const wallNormalInfo&);
// Member Functions
// Access
inline const vector& normal() const;
const vector& normal() const
{
return normal_;
}
vector& normal()
{
return normal_;
}
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -180,15 +186,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const wallNormalInfo&, TrackingData& td) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const wallNormalInfo&) const;
//- Test for inequality
inline bool operator!=(const wallNormalInfo&) const;

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.
@ -60,35 +61,20 @@ inline bool Foam::wallNormalInfo::update
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::wallNormalInfo::wallNormalInfo()
:
normal_(point::max)
{}
// Construct from normal
inline Foam::wallNormalInfo::wallNormalInfo(const vector& normal)
:
normal_(normal)
{}
// Construct as copy
inline Foam::wallNormalInfo::wallNormalInfo(const wallNormalInfo& wpt)
:
normal_(wpt.normal())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::vector& Foam::wallNormalInfo::normal() const
{
return normal_;
}
template<class TrackingData>
inline bool Foam::wallNormalInfo::valid(TrackingData& td) const
{
@ -207,15 +193,19 @@ inline bool Foam::wallNormalInfo::equal
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::wallNormalInfo::operator==(const Foam::wallNormalInfo& rhs)
const
inline bool Foam::wallNormalInfo::operator==
(
const wallNormalInfo& rhs
) const
{
return normal() == rhs.normal();
return normal_ == rhs.normal_;
}
inline bool Foam::wallNormalInfo::operator!=(const Foam::wallNormalInfo& rhs)
const
inline bool Foam::wallNormalInfo::operator!=
(
const wallNormalInfo& rhs
) const
{
return !(*this == rhs);
}

View File

@ -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.
@ -55,7 +55,6 @@ class pointEdgeStructuredWalk;
Istream& operator>>(Istream&, pointEdgeStructuredWalk&);
Ostream& operator<<(Ostream&, const pointEdgeStructuredWalk&);
/*---------------------------------------------------------------------------*\
Class pointEdgeStructuredWalk Declaration
\*---------------------------------------------------------------------------*/
@ -95,7 +94,7 @@ public:
// Constructors
//- Construct null
//- Default construct
inline pointEdgeStructuredWalk();
//- Construct from components
@ -113,27 +112,35 @@ public:
// Access
//- The distance information
scalar dist() const
{
return dist_;
}
//- Tracking data
const vector& data() const
{
return data_;
}
//- Index (if any) associated with data
label index() const
{
return index_;
}
//- True if starting point is valid (ie, not point::max)
inline bool inZone() const;
//- The distance information
inline scalar dist() const;
//- Tracking data
inline const vector& data() const;
// Needed by MeshWave
//- Index (if any) associated with data
inline label index() const;
// Needed by meshWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -217,16 +224,21 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const pointEdgeStructuredWalk&, TrackingData&)
const;
inline bool equal
(
const pointEdgeStructuredWalk&,
TrackingData&
) const;
// Member Operators
//Note: Used to determine whether to call update.
//- Test for equality
inline bool operator==(const pointEdgeStructuredWalk&) const;
//- Test for inequality
inline bool operator!=(const pointEdgeStructuredWalk&) const;

View File

@ -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.
@ -91,24 +91,6 @@ inline bool Foam::pointEdgeStructuredWalk::inZone() const
}
inline Foam::scalar Foam::pointEdgeStructuredWalk::dist() const
{
return dist_;
}
inline const Foam::vector& Foam::pointEdgeStructuredWalk::data() const
{
return data_;
}
inline Foam::label Foam::pointEdgeStructuredWalk::index() const
{
return index_;
}
template<class TrackingData>
inline bool Foam::pointEdgeStructuredWalk::valid(TrackingData& td) const
{
@ -125,7 +107,7 @@ inline bool Foam::pointEdgeStructuredWalk::sameGeometry
TrackingData& td
) const
{
scalar diff = Foam::mag(dist() - w2.dist());
const scalar diff = Foam::mag(dist() - w2.dist());
if (diff < SMALL)
{
@ -275,7 +257,7 @@ inline bool Foam::pointEdgeStructuredWalk::equal
inline bool Foam::pointEdgeStructuredWalk::operator==
(
const Foam::pointEdgeStructuredWalk& rhs
const pointEdgeStructuredWalk& rhs
) const
{
return previousPoint_ == rhs.previousPoint_;
@ -284,7 +266,7 @@ inline bool Foam::pointEdgeStructuredWalk::operator==
inline bool Foam::pointEdgeStructuredWalk::operator!=
(
const Foam::pointEdgeStructuredWalk& rhs
const pointEdgeStructuredWalk& rhs
) const
{
return !(*this == rhs);

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,25 +28,25 @@ License
#include "externalPointEdgePoint.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::externalPointEdgePoint& wDist
Ostream& os,
const externalPointEdgePoint& rhs
)
{
return os << wDist.origin() << wDist.distSqr();
return os << rhs.origin() << rhs.distSqr();
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::externalPointEdgePoint& wDist
Istream& is,
externalPointEdgePoint& rhs
)
{
return is >> wDist.origin_ >> wDist.distSqr_;
return is >> rhs.origin_ >> rhs.distSqr_;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -56,14 +56,13 @@ class externalPointEdgePoint;
Istream& operator>>(Istream&, externalPointEdgePoint&);
Ostream& operator<<(Ostream&, const externalPointEdgePoint&);
/*---------------------------------------------------------------------------*\
Class externalPointEdgePoint Declaration
Class externalPointEdgePoint Declaration
\*---------------------------------------------------------------------------*/
class externalPointEdgePoint
{
// Private data
// Private Data
//- Position of nearest wall center
point origin_;
@ -74,9 +73,9 @@ class externalPointEdgePoint
// Private Member Functions
//- Evaluate distance to point. Update distSqr, origin from whomever
// is nearer pt. Return true if w2 is closer to point,
// false otherwise.
//- Evaluate distance to point.
// Update distSqr, origin from whomever is nearer pt.
// \return true if w2 is closer to point, false otherwise.
template<class TrackingData>
inline bool update
(
@ -86,8 +85,8 @@ class externalPointEdgePoint
TrackingData& td
);
//- Combine current with w2. Update distSqr, origin if w2 has smaller
// quantities and returns true.
//- Combine current with w2.
// Update distSqr, origin if w2 has smaller quantities and return true
template<class TrackingData>
inline bool update
(
@ -103,6 +102,7 @@ public:
class trackingData
{
public:
const pointField& points_;
trackingData(const pointField& points)
@ -112,36 +112,37 @@ public:
};
// Constructors
//- Construct null
//- Default construct
inline externalPointEdgePoint();
//- Construct from origin, distance
inline externalPointEdgePoint(const point&, const scalar);
//- Construct as copy
inline externalPointEdgePoint(const externalPointEdgePoint&);
// Member Functions
// Access
inline const point& origin() const;
const point& origin() const
{
return origin_;
}
inline scalar distSqr() const;
scalar distSqr() const
{
return distSqr_;
}
// Needed by PointEdgeWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -151,7 +152,7 @@ public:
) const;
//- Convert origin to relative vector to leaving point
// (= point coordinate)
//- (= point coordinate)
template<class TrackingData>
inline void leaveDomain
(
@ -225,7 +226,7 @@ public:
TrackingData& td
);
//- Equivalent to operator== with TrackingData
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal
(
@ -236,8 +237,10 @@ public:
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const externalPointEdgePoint&) const;
//- Test for inequality
inline bool operator!=(const externalPointEdgePoint&) const;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -39,7 +40,7 @@ inline bool Foam::externalPointEdgePoint::update
TrackingData& td
)
{
scalar dist2 = magSqr(pt - w2.origin());
const scalar dist2 = magSqr(pt - w2.origin());
if (!valid(td))
{
@ -50,7 +51,7 @@ inline bool Foam::externalPointEdgePoint::update
return true;
}
scalar diff = distSqr_ - dist2;
const scalar diff = distSqr_ - dist2;
if (diff < 0)
{
@ -91,7 +92,7 @@ inline bool Foam::externalPointEdgePoint::update
return true;
}
scalar diff = distSqr_ - w2.distSqr();
const scalar diff = distSqr_ - w2.distSqr();
if (diff < 0)
{
@ -135,30 +136,8 @@ inline Foam::externalPointEdgePoint::externalPointEdgePoint
{}
inline Foam::externalPointEdgePoint::externalPointEdgePoint
(
const externalPointEdgePoint& wpt
)
:
origin_(wpt.origin()),
distSqr_(wpt.distSqr())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::point& Foam::externalPointEdgePoint::origin() const
{
return origin_;
}
inline Foam::scalar Foam::externalPointEdgePoint::distSqr() const
{
return distSqr_;
}
template<class TrackingData>
inline bool Foam::externalPointEdgePoint::valid(TrackingData& td) const
{
@ -175,7 +154,7 @@ inline bool Foam::externalPointEdgePoint::sameGeometry
TrackingData& td
) const
{
scalar diff = Foam::mag(distSqr() - w2.distSqr());
const scalar diff = Foam::mag(distSqr() - w2.distSqr());
if (diff < SMALL)
{
@ -305,19 +284,17 @@ inline bool Foam::externalPointEdgePoint::equal
inline bool Foam::externalPointEdgePoint::operator==
(
const Foam::externalPointEdgePoint& rhs
)
const
const externalPointEdgePoint& rhs
) const
{
return (origin() == rhs.origin()) && (distSqr() == rhs.distSqr());
return origin_ == rhs.origin_ && distSqr_ == rhs.distSqr_;
}
inline bool Foam::externalPointEdgePoint::operator!=
(
const Foam::externalPointEdgePoint& rhs
)
const
const externalPointEdgePoint& rhs
) const
{
return !(*this == rhs);
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,30 +28,31 @@ License
#include "pointEdgeCollapse.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::pointEdgeCollapse& wDist
Ostream& os,
const pointEdgeCollapse& rhs
)
{
return os
<< wDist.collapsePoint_
<< wDist.collapseIndex_
<< wDist.collapsePriority_;
<< rhs.collapsePoint_
<< rhs.collapseIndex_
<< rhs.collapsePriority_;
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::pointEdgeCollapse& wDist
Istream& is,
pointEdgeCollapse& rhs
)
{
return is
>> wDist.collapsePoint_
>> wDist.collapseIndex_
>> wDist.collapsePriority_;
>> rhs.collapsePoint_
>> rhs.collapseIndex_
>> rhs.collapsePriority_;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -55,14 +55,13 @@ class pointEdgeCollapse;
Istream& operator>>(Istream&, pointEdgeCollapse&);
Ostream& operator<<(Ostream&, const pointEdgeCollapse&);
/*---------------------------------------------------------------------------*\
Class pointEdgeCollapse Declaration
Class pointEdgeCollapse Declaration
\*---------------------------------------------------------------------------*/
class pointEdgeCollapse
{
// Private data
// Private Data
//- Collapse location
point collapsePoint_;
@ -85,7 +84,6 @@ class pointEdgeCollapse
TrackingData& td
);
//- Check for same coordinate
inline bool samePoint(const point& pt) const;
@ -93,7 +91,7 @@ public:
// Constructors
//- Construct null
//- Default construct
inline pointEdgeCollapse();
//- Construct from components
@ -109,17 +107,25 @@ public:
// Access
inline const point& collapsePoint() const;
const point& collapsePoint() const
{
return collapsePoint_;
}
inline label collapseIndex() const;
label collapseIndex() const
{
return collapseIndex_;
}
inline label collapsePriority() const;
label collapsePriority() const
{
return collapsePriority_;
}
// Needed by meshWave
// Needed by MeshWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
@ -198,16 +204,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const pointEdgeCollapse&, TrackingData&)
const;
inline bool equal(const pointEdgeCollapse&, TrackingData&) const;
// Member Operators
//Note: Used to determine whether to call update.
//- Test for equality
inline bool operator==(const pointEdgeCollapse&) const;
//- Test for inequality
inline bool operator!=(const pointEdgeCollapse&) const;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -31,7 +31,6 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update this with w2.
template<class TrackingData>
inline bool Foam::pointEdgeCollapse::update
(
@ -99,51 +98,6 @@ inline bool Foam::pointEdgeCollapse::update
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::pointEdgeCollapse::pointEdgeCollapse()
:
collapsePoint_(GREAT, GREAT, GREAT),
collapseIndex_(-2),
collapsePriority_(-2)
{}
// Construct from origin, distance
inline Foam::pointEdgeCollapse::pointEdgeCollapse
(
const point& collapsePoint,
const label collapseIndex,
const label collapsePriority
)
:
collapsePoint_(collapsePoint),
collapseIndex_(collapseIndex),
collapsePriority_(collapsePriority)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::point& Foam::pointEdgeCollapse::collapsePoint() const
{
return collapsePoint_;
}
inline Foam::label Foam::pointEdgeCollapse::collapseIndex() const
{
return collapseIndex_;
}
inline Foam::label Foam::pointEdgeCollapse::collapsePriority() const
{
return collapsePriority_;
}
inline bool Foam::pointEdgeCollapse::samePoint(const point& pt) const
{
bool isLegal1 = (cmptMin(collapsePoint_) < 0.5*GREAT);
@ -160,6 +114,31 @@ inline bool Foam::pointEdgeCollapse::samePoint(const point& pt) const
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline Foam::pointEdgeCollapse::pointEdgeCollapse()
:
collapsePoint_(GREAT, GREAT, GREAT),
collapseIndex_(-2),
collapsePriority_(-2)
{}
inline Foam::pointEdgeCollapse::pointEdgeCollapse
(
const point& collapsePoint,
const label collapseIndex,
const label collapsePriority
)
:
collapsePoint_(collapsePoint),
collapseIndex_(collapseIndex),
collapsePriority_(collapsePriority)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class TrackingData>
inline bool Foam::pointEdgeCollapse::valid(TrackingData& td) const
{
@ -282,7 +261,7 @@ inline bool Foam::pointEdgeCollapse::equal
inline bool Foam::pointEdgeCollapse::operator==
(
const Foam::pointEdgeCollapse& rhs
const pointEdgeCollapse& rhs
) const
{
return
@ -294,7 +273,7 @@ inline bool Foam::pointEdgeCollapse::operator==
inline bool Foam::pointEdgeCollapse::operator!=
(
const Foam::pointEdgeCollapse& rhs
const pointEdgeCollapse& rhs
) const
{
return !(*this == rhs);

View File

@ -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.
@ -28,23 +28,23 @@ License
#include "refinementData.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::refinementData& wDist
Ostream& os,
const refinementData& rhs
)
{
if (os.format() == IOstream::ASCII)
{
os << wDist.refinementCount_ << token::SPACE << wDist.count_;
os << rhs.refinementCount_ << token::SPACE << rhs.count_;
}
else
{
os.write
(
reinterpret_cast<const char*>(&wDist.refinementCount_),
reinterpret_cast<const char*>(&rhs.refinementCount_),
sizeof(refinementData)
);
}
@ -54,18 +54,22 @@ Foam::Ostream& Foam::operator<<
}
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::refinementData& wDist)
Foam::Istream& Foam::operator>>
(
Istream& is,
refinementData& rhs
)
{
if (is.format() == IOstream::ASCII)
{
is >> wDist.refinementCount_ >> wDist.count_;
is >> rhs.refinementCount_ >> rhs.count_;
}
else
{
Detail::readContiguous<refinementData>
(
is,
reinterpret_cast<char*>(&wDist.refinementCount_),
reinterpret_cast<char*>(&rhs.refinementCount_),
sizeof(refinementData)
);
}

View File

@ -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.
@ -56,14 +56,13 @@ class refinementData;
Istream& operator>>(Istream&, refinementData&);
Ostream& operator<<(Ostream&, const refinementData&);
/*---------------------------------------------------------------------------*\
Class refinementData Declaration
\*---------------------------------------------------------------------------*/
class refinementData
{
// Private data
// Private Data
//- Count which triggers refinement
label refinementCount_;
@ -75,7 +74,7 @@ public:
// Constructors
//- Construct null
//- Default construct
inline refinementData();
//- Construct from count
@ -86,27 +85,25 @@ public:
// Access
inline label refinementCount() const
label refinementCount() const
{
return refinementCount_;
}
label& refinementCount()
{
return refinementCount_;
}
inline label& refinementCount()
label count() const
{
return refinementCount_;
return count_;
}
inline label count() const
label& count()
{
return count_;
}
inline label& count()
{
return count_;
}
inline bool isRefined() const
bool isRefined() const
{
return count_ >= refinementCount_;
}
@ -115,12 +112,11 @@ public:
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -197,16 +193,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const refinementData&, TrackingData& td) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const refinementData&) const;
//- Test for inequality
inline bool operator!=(const refinementData&) const;

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.
@ -27,7 +28,6 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::refinementData::refinementData()
:
refinementCount_(-1),
@ -35,7 +35,6 @@ inline Foam::refinementData::refinementData()
{}
// Construct from components
inline Foam::refinementData::refinementData
(
const label refinementCount,
@ -251,15 +250,19 @@ inline bool Foam::refinementData::equal
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::refinementData::operator==(const Foam::refinementData& rhs)
const
inline bool Foam::refinementData::operator==
(
const refinementData& rhs
) const
{
return count() == rhs.count() && refinementCount() == rhs.refinementCount();
return count_ == rhs.count_ && refinementCount_ == rhs.refinementCount_;
}
inline bool Foam::refinementData::operator!=(const Foam::refinementData& rhs)
const
inline bool Foam::refinementData::operator!=
(
const refinementData& rhs
) const
{
return !(*this == rhs);
}

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,27 +28,27 @@ License
#include "refinementDistanceData.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::refinementDistanceData& wDist
Ostream& os,
const refinementDistanceData& rhs
)
{
return os
<< wDist.level0Size_ << token::SPACE << wDist.origin_
<< token::SPACE << wDist.originLevel_;
<< rhs.level0Size_ << token::SPACE << rhs.origin_
<< token::SPACE << rhs.originLevel_;
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::refinementDistanceData& wDist
Istream& is,
refinementDistanceData& rhs
)
{
return is >> wDist.level0Size_ >> wDist.origin_ >> wDist.originLevel_;
return is >> rhs.level0Size_ >> rhs.origin_ >> rhs.originLevel_;
}

View File

@ -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.
@ -63,7 +63,7 @@ Ostream& operator<<(Ostream&, const refinementDistanceData&);
class refinementDistanceData
{
// Private data
// Private Data
//- Unrefined (level0) buffer size (nBufferLayers*level0Size)
scalar level0Size_;
@ -75,7 +75,8 @@ class refinementDistanceData
// Private Member Functions
//- Updates with neighbouring data. Returns true if something changed.
//- Updates with neighbouring data.
// \return true if something changed.
template<class TrackingData>
inline bool update
(
@ -89,7 +90,7 @@ public:
// Constructors
//- Construct null
//- Default construct
inline refinementDistanceData();
//- Construct from count
@ -105,32 +106,29 @@ public:
// Access
inline scalar level0Size() const
scalar level0Size() const
{
return level0Size_;
}
scalar& level0Size()
{
return level0Size_;
}
inline scalar& level0Size()
const point& origin() const
{
return level0Size_;
return origin_;
}
inline const point& origin() const
point& origin()
{
return origin_;
}
inline point& origin()
{
return origin_;
}
inline label originLevel() const
label originLevel() const
{
return originLevel_;
}
inline label& originLevel()
label& originLevel()
{
return originLevel_;
}
@ -138,19 +136,18 @@ public:
// Other
//- Calculates the wanted level at a given point. Walks out from
// the origin.
//- Calculates the wanted level at a given point.
// Walks out from the origin.
inline label wantedLevel(const point& pt) const;
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData&) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -227,19 +224,18 @@ public:
TrackingData&
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal
(
const refinementDistanceData&,
TrackingData&
) const;
inline bool equal(const refinementDistanceData&, TrackingData&)
const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const refinementDistanceData&) const;
//- Test for inequality
inline bool operator!=(const refinementDistanceData&) const;

View File

@ -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,9 +31,10 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Returns the wanted level
inline Foam::label Foam::refinementDistanceData::wantedLevel(const point& pt)
const
inline Foam::label Foam::refinementDistanceData::wantedLevel
(
const point& pt
) const
{
const scalar distSqr = magSqr(pt-origin_);
@ -122,14 +123,12 @@ inline bool Foam::refinementDistanceData::update
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::refinementDistanceData::refinementDistanceData()
:
level0Size_(-1)
{}
// Construct from components
inline Foam::refinementDistanceData::refinementDistanceData
(
const scalar level0Size,
@ -283,7 +282,7 @@ inline bool Foam::refinementDistanceData::equal
inline bool Foam::refinementDistanceData::operator==
(
const Foam::refinementDistanceData& rhs
const refinementDistanceData& rhs
) const
{
return
@ -295,7 +294,7 @@ inline bool Foam::refinementDistanceData::operator==
inline bool Foam::refinementDistanceData::operator!=
(
const Foam::refinementDistanceData& rhs
const refinementDistanceData& rhs
) const
{
return !(*this == rhs);

View File

@ -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.
@ -44,12 +44,36 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class smoothData;
Ostream& operator<<(Ostream&, const smoothData&);
Istream& operator>>(Istream&, smoothData&);
/*---------------------------------------------------------------------------*\
Class smoothData Declaration
\*---------------------------------------------------------------------------*/
class smoothData
{
// Private Data
scalar value_;
// Private Member Functions
//- Update gets information from neighbouring face/cell and
//- uses this to update itself (if necessary) and return true
template<class TrackingData>
inline bool update
(
const smoothData& svf,
const scalar scale,
const scalar tol,
TrackingData& td
);
public:
@ -63,30 +87,18 @@ public:
};
private:
// Generated Methods
scalar value_;
//- Copy construct
smoothData(const smoothData&) = default;
// Private Member Functions
//- Update - gets information from neighbouring face/cell and
// uses this to update itself (if necessary) and return true
template<class TrackingData>
inline bool update
(
const smoothData& svf,
const scalar scale,
const scalar tol,
TrackingData& td
);
public:
//- Copy assignment
smoothData& operator=(const smoothData&) = default;
// Constructors
//- Construct null
//- Default construct
inline smoothData();
//- Construct from inverse field value
@ -103,16 +115,20 @@ public:
return value_;
}
//- The value
scalar& value()
{
return value_;
}
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data
// Used for cyclics checking
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -123,7 +139,7 @@ public:
) const;
//- Convert any absolute coordinates into relative to
// (patch)face centre
//- (patch)face centre
template<class TrackingData>
inline void leaveDomain
(
@ -189,36 +205,37 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const smoothData&, TrackingData& td) const;
// Member Operators
// Member Operators
inline void operator=(const scalar value);
//- Assign new value
void operator=(const scalar value)
{
value_ = value;
}
// Needed for List IO
inline bool operator==(const smoothData&) const;
//- Test for equality
inline bool operator==(const smoothData&) const;
inline bool operator!=(const smoothData&) const;
//- Test for inequality
inline bool operator!=(const smoothData&) const;
// IOstream Operators
// IOstream Operators
friend Ostream& operator<<
(
Ostream& os,
const smoothData& svf
)
{
return os << svf.value_;
}
friend Ostream& operator<<(Ostream& os, const smoothData& rhs)
{
return os << rhs.value_;
}
friend Istream& operator>>(Istream& is, smoothData& svf)
{
return is >> svf.value_;
}
friend Istream& operator>>(Istream& is, smoothData& rhs)
{
return is >> rhs.value_;
}
};

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -192,21 +193,12 @@ inline bool Foam::smoothData::equal
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline void Foam::smoothData::operator=
(
const scalar value
)
{
value_ = value;
}
inline bool Foam::smoothData::operator==
(
const smoothData& rhs
) const
{
return value_ == rhs.value();
return value_ == rhs.value_;
}

View File

@ -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.
@ -44,19 +44,29 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class sweepData;
Ostream& operator<<(Ostream&, const sweepData&);
Istream& operator>>(Istream&, sweepData&);
/*---------------------------------------------------------------------------*\
Class sweepData Declaration
\*---------------------------------------------------------------------------*/
class sweepData
{
scalar value_;
point origin_;
// Private Data
scalar value_;
point origin_;
// Private Member Functions
//- Update - gets information from neighbouring face/cell and
// uses this to update itself (if necessary) and return true
//- Update gets information from neighbouring face/cell and
//- uses this to update itself (if necessary) and return true
template<class TrackingData>
inline bool update
(
@ -69,12 +79,21 @@ class sweepData
public:
// Generated Methods
//- Copy construct
sweepData(const sweepData&) = default;
//- Copy assignment
sweepData& operator=(const sweepData&) = default;
// Constructors
//- Construct null
//- Default construct
inline sweepData();
//- Construct from component
//- Construct from components
inline sweepData(const scalar value, const point& origin);
@ -88,6 +107,12 @@ public:
return value_;
}
//- The value
scalar& value()
{
return value_;
}
//- Return origin
const point& origin() const
{
@ -97,13 +122,11 @@ public:
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data
// Used for cyclics checking
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -180,36 +203,37 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const sweepData&, TrackingData& td) const;
// Member Operators
// Member Operators
inline void operator=(const scalar value);
//- Assign new value
void operator=(const scalar value)
{
value_ = value;
}
// Needed for List IO
inline bool operator==(const sweepData&) const;
//- Test for equality
inline bool operator==(const sweepData&) const;
inline bool operator!=(const sweepData&) const;
//- Test for inequality
inline bool operator!=(const sweepData&) const;
// IOstream Operators
// IOstream Operators
friend Ostream& operator<<
(
Ostream& os,
const sweepData& svf
)
{
return os << svf.value_ << svf.origin_;
}
friend Ostream& operator<<(Ostream& os, const sweepData& rhs)
{
return os << rhs.value_ << rhs.origin_;
}
friend Istream& operator>>(Istream& is, sweepData& svf)
{
return is >> svf.value_ >> svf.origin_;
}
friend Istream& operator>>(Istream& is, sweepData& rhs)
{
return is >> rhs.value_ >> rhs.origin_;
}
};

View File

@ -44,7 +44,7 @@ inline bool Foam::sweepData::update
return true;
}
scalar myDist2 = magSqr(position - origin());
const scalar myDist2 = magSqr(position - origin());
if (myDist2 < SMALL)
{
@ -76,11 +76,15 @@ inline bool Foam::sweepData::update
inline Foam::sweepData::sweepData()
:
value_(-GREAT),
origin_(vector::max)
origin_(point::max)
{}
inline Foam::sweepData::sweepData(const scalar value, const point& origin)
inline Foam::sweepData::sweepData
(
const scalar value,
const point& origin
)
:
value_(value),
origin_(origin)
@ -208,21 +212,12 @@ inline bool Foam::sweepData::equal
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline void Foam::sweepData::operator=
(
const scalar value
)
{
value_ = value;
}
inline bool Foam::sweepData::operator==
(
const sweepData& rhs
) const
{
return origin() == rhs.origin();
return origin_ == rhs.origin_;
}

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.
@ -25,16 +26,11 @@ License
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool wallPointYPlus::update
inline bool Foam::wallPointYPlus::update
(
const point& pt,
const wallPointYPlus& w2,
@ -42,11 +38,11 @@ inline bool wallPointYPlus::update
TrackingData& td
)
{
scalar dist2 = magSqr(pt - w2.origin());
const scalar dist2 = magSqr(pt - w2.origin());
if (valid(td))
{
scalar diff = distSqr() - dist2;
const scalar diff = distSqr() - dist2;
if (diff < 0)
{
@ -65,7 +61,7 @@ inline bool wallPointYPlus::update
// Either *this is not yet valid or w2 is closer
{
// only propagate if interesting (i.e. y+ < 100)
scalar yPlus = Foam::sqrt(dist2)/w2.data();
const scalar yPlus = Foam::sqrt(dist2)/w2.data();
if (yPlus < yPlusCutOff)
{
@ -86,8 +82,7 @@ inline bool wallPointYPlus::update
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline wallPointYPlus::wallPointYPlus()
inline Foam::wallPointYPlus::wallPointYPlus()
:
wallPointData<scalar>()
{
@ -96,8 +91,7 @@ inline wallPointYPlus::wallPointYPlus()
}
// Construct from components
inline wallPointYPlus::wallPointYPlus
inline Foam::wallPointYPlus::wallPointYPlus
(
const point& origin,
const scalar yStar,
@ -112,7 +106,7 @@ inline wallPointYPlus::wallPointYPlus
// Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool wallPointYPlus::updateCell
inline bool Foam::wallPointYPlus::updateCell
(
const polyMesh& mesh,
const label thisCelli,
@ -136,7 +130,7 @@ inline bool wallPointYPlus::updateCell
// Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool wallPointYPlus::updateFace
inline bool Foam::wallPointYPlus::updateFace
(
const polyMesh& mesh,
const label thisFacei,
@ -160,7 +154,7 @@ inline bool wallPointYPlus::updateFace
// Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool wallPointYPlus::updateFace
inline bool Foam::wallPointYPlus::updateFace
(
const polyMesh& mesh,
const label thisFacei,
@ -181,8 +175,4 @@ inline bool wallPointYPlus::updateFace
}
// ************************************************************************* //
} // End namespace Foam
// ************************************************************************* //

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,25 +28,25 @@ License
#include "patchFaceOrientation.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::patchFaceOrientation& wDist
Ostream& os,
const patchFaceOrientation& rhs
)
{
return os << wDist.flipStatus_;
return os << rhs.flipStatus_;
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::patchFaceOrientation& wDist
Istream& is,
patchFaceOrientation& rhs
)
{
return is >> wDist.flipStatus_;
return is >> rhs.flipStatus_;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -54,14 +54,13 @@ class patchFaceOrientation;
Istream& operator>>(Istream&, patchFaceOrientation&);
Ostream& operator<<(Ostream&, const patchFaceOrientation&);
/*---------------------------------------------------------------------------*\
Class patchFaceOrientation Declaration
Class patchFaceOrientation Declaration
\*---------------------------------------------------------------------------*/
class patchFaceOrientation
{
// Private data
// Private Data
//- Flip status
label flipStatus_;
@ -70,7 +69,7 @@ public:
// Constructors
//- Construct null
//- Default construct
inline patchFaceOrientation();
//- Construct from components
@ -79,17 +78,21 @@ public:
// Member Functions
//- Orientation
inline label flipStatus() const;
// Access
//- Reverse orientation
//- Orientation
label flipStatus() const
{
return flipStatus_;
}
//- Reverse the orientation
inline void flip();
// Needed by meshWave
// Needed by MeshWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
@ -142,15 +145,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const patchFaceOrientation&, TrackingData&) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const patchFaceOrientation&) const;
//- Test for equality
inline bool operator!=(const patchFaceOrientation&) const;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -29,7 +30,7 @@ License
#include "transform.H"
#include "orientedSurface.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline Foam::patchFaceOrientation::patchFaceOrientation()
:
@ -48,12 +49,6 @@ inline Foam::patchFaceOrientation::patchFaceOrientation
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::label Foam::patchFaceOrientation::flipStatus() const
{
return flipStatus_;
}
inline void Foam::patchFaceOrientation::flip()
{
if (flipStatus_ == orientedSurface::NOFLIP)
@ -210,16 +205,16 @@ inline bool Foam::patchFaceOrientation::equal
inline bool Foam::patchFaceOrientation::operator==
(
const Foam::patchFaceOrientation& rhs
const patchFaceOrientation& rhs
) const
{
return flipStatus() == rhs.flipStatus();
return flipStatus_ == rhs.flipStatus_;
}
inline bool Foam::patchFaceOrientation::operator!=
(
const Foam::patchFaceOrientation& rhs
const patchFaceOrientation& rhs
) const
{
return !(*this == rhs);

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -77,9 +77,9 @@ private:
// Private Member Functions
//- Evaluate distance to point. Update distSqr, origin from whomever
// is nearer pt. Return true if w2 is closer to point,
// false otherwise.
//- Evaluate distance to point.
// Update distSqr, origin from whomever is nearer pt.
// \return true if w2 is closer to point, false otherwise.
template<class TrackingData>
inline bool update
(

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -40,11 +40,11 @@ inline bool Foam::transportData::update
TrackingData& td
)
{
scalar dist2 = magSqr(pt - w2.origin());
const scalar dist2 = magSqr(pt - w2.origin());
if (valid(td))
{
scalar diff = distSqr() - dist2;
const scalar diff = distSqr() - dist2;
if (diff < 0)
{

View File

@ -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.
@ -27,29 +27,29 @@ License
#include "wallPoints.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::wallPoints& wDist
Ostream& os,
const wallPoints& rhs
)
{
return os
<< wDist.origin_ << token::SPACE << wDist.distSqr_
<< token::SPACE << wDist.surface_; // << token::SPACE << wDist.normal_;
<< rhs.origin_ << token::SPACE << rhs.distSqr_
<< token::SPACE << rhs.surface_; // << token::SPACE << rhs.normal_;
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::wallPoints& wDist
Istream& is,
wallPoints& rhs
)
{
return is
>> wDist.origin_ >> wDist.distSqr_>> wDist.surface_;
//>> wDist.normal_;
>> rhs.origin_ >> rhs.distSqr_ >> rhs.surface_;
//>> rhs.normal_;
}

View File

@ -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.
@ -48,17 +48,13 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class polyPatch;
class polyMesh;
// Forward declaration of friend functions and operators
class wallPoints;
Istream& operator>>(Istream&, wallPoints&);
Ostream& operator<<(Ostream&, const wallPoints&);
/*---------------------------------------------------------------------------*\
Class wallPoints Declaration
\*---------------------------------------------------------------------------*/
@ -67,7 +63,7 @@ class wallPoints
{
protected:
// Protected data
// Protected Data
//- Starting points
DynamicList<point> origin_;
@ -84,9 +80,9 @@ protected:
// Protected Member Functions
//- Evaluate distance to point. Update distSqr, origin from whomever
// is nearer pt. Return true if w2 is closer to point,
// false otherwise.
//- Evaluate distance to point.
// Update distSqr, origin from whomever is nearer pt.
// \return true if w2 is closer to point, false otherwise.
template<class TrackingData>
inline bool update
(
@ -104,7 +100,7 @@ public:
// Constructors
//- Construct null
//- Default construct
inline wallPoints();
//- Construct from count
@ -121,21 +117,21 @@ public:
// Access
inline const List<point>& origin() const
const List<point>& origin() const
{
return origin_;
}
inline const List<scalar>& distSqr() const
const List<scalar>& distSqr() const
{
return distSqr_;
}
inline const List<FixedList<label, 3>>& surface() const
const List<FixedList<label, 3>>& surface() const
{
return surface_;
}
//inline const List<vector>& normal() const
//const List<vector>& normal() const
//{
// return normal_;
//}
@ -143,12 +139,11 @@ public:
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -225,16 +220,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const wallPoints&, TrackingData&) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const wallPoints&) const;
//- Test for inequality
inline bool operator!=(const wallPoints&) const;

View File

@ -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.
@ -42,7 +42,7 @@ inline bool Foam::wallPoints::update
TrackingData& td
)
{
scalar dist2 = magSqr(pt - w2.origin_[index2]);
const scalar dist2 = magSqr(pt - w2.origin_[index2]);
if (!valid(td))
{
@ -55,7 +55,7 @@ inline bool Foam::wallPoints::update
return true;
}
scalar diff = distSqr_[index1] - dist2;
const scalar diff = distSqr_[index1] - dist2;
if (diff < 0)
{
@ -329,7 +329,7 @@ inline bool Foam::wallPoints::equal
inline bool Foam::wallPoints::operator==
(
const Foam::wallPoints& rhs
const wallPoints& rhs
) const
{
return
@ -342,7 +342,7 @@ inline bool Foam::wallPoints::operator==
inline bool Foam::wallPoints::operator!=
(
const Foam::wallPoints& rhs
const wallPoints& rhs
) const
{
return !(*this == rhs);

View File

@ -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.
@ -59,9 +59,7 @@ Istream& operator>>(Istream&, PointIntegrateData<DataType>&);
template<class DataType>
class PointIntegrateData
{
private:
// Private data
// Private Data
//- Valid flag
bool valid_;
@ -88,7 +86,7 @@ public:
// Constructors
//- Construct null
//- Default construct
inline PointIntegrateData();
//- Construct from data
@ -99,8 +97,11 @@ public:
// Access
//- Const access the data
inline const DataType& data() const
const DataType& data() const
{
return data_;
};
DataType& data()
{
return data_;
};
@ -108,11 +109,11 @@ public:
// Needed by PointEdgeWave
//- Check whether original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -122,7 +123,7 @@ public:
) const;
//- Convert origin to relative vector to leaving point
// (= point coordinate)
//- (= point coordinate)
template<class TrackingData>
inline void leaveDomain
(
@ -196,7 +197,7 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal
(
@ -207,8 +208,10 @@ public:
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const PointIntegrateData<DataType>&) const;
//- Test for inequality
inline bool operator!=(const PointIntegrateData<DataType>&) const;

View File

@ -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.
@ -215,7 +215,6 @@ inline bool Foam::PointIntegrateData<DataType>::updateEdge
}
//- Same (like operator==)
template<class DataType>
template<class TrackingData>
inline bool Foam::PointIntegrateData<DataType>::equal
@ -246,9 +245,8 @@ inline bool Foam::PointIntegrateData<DataType>::equal
template<class DataType>
inline bool Foam::PointIntegrateData<DataType>::operator==
(
const Foam::PointIntegrateData<DataType>& rhs
)
const
const PointIntegrateData<DataType>& rhs
) const
{
return this->data_ == rhs.data_;
}
@ -257,30 +255,29 @@ const
template<class DataType>
inline bool Foam::PointIntegrateData<DataType>::operator!=
(
const Foam::PointIntegrateData<DataType>& rhs
)
const
const PointIntegrateData<DataType>& rhs
) const
{
return !(*this == rhs);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class DataType>
inline Foam::Ostream& Foam::operator<<
(
Ostream& os,
const PointIntegrateData<DataType>& pd
const PointIntegrateData<DataType>& rhs
)
{
if (os.format() == IOstream::ASCII)
{
return os << pd.valid_ << token::SPACE << pd.data();
return os << rhs.valid_ << token::SPACE << rhs.data();
}
else
{
return os << pd.valid_ << pd.data();
return os << rhs.valid_ << rhs.data();
}
}
@ -289,10 +286,10 @@ template<class DataType>
inline Foam::Istream& Foam::operator>>
(
Istream& is,
PointIntegrateData<DataType>& pd
PointIntegrateData<DataType>& rhs
)
{
return is >> pd.valid_ >> pd.data_;
return is >> rhs.valid_ >> rhs.data_;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -50,6 +50,7 @@ Foam::scalar Foam::FaceCellWave<Type, TrackingData>::propagationTol_ = 0.01;
template<class Type, class TrackingData>
int Foam::FaceCellWave<Type, TrackingData>::dummyTrackData_ = 12345;
namespace Foam
{
template<class Type, class TrackingData>
@ -61,7 +62,7 @@ namespace Foam
const cyclicAMIPolyPatch& patch_;
public:
public:
combine
(

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,7 +60,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
// Forward Declarations
class polyMesh;
class polyPatch;
@ -80,15 +80,6 @@ class FaceCellWave
:
public FaceCellWaveName
{
// Private Member Functions
//- No copy construct
FaceCellWave(const FaceCellWave&) = delete;
//- No copy assignment
void operator=(const FaceCellWave&) = delete;
protected:
//- Information tagged with a source or destination id.
@ -96,6 +87,15 @@ protected:
typedef std::pair<label,Type> taggedInfoType;
// Protected Static Data
static const scalar geomTol_;
static scalar propagationTol_;
//- Default trackdata value to satisfy default template argument.
static int dummyTrackData_;
// Protected Data
//- Reference to mesh
@ -257,14 +257,11 @@ protected:
void handleExplicitConnections();
// Protected static data
//- No copy construct
FaceCellWave(const FaceCellWave&) = delete;
static const scalar geomTol_;
static scalar propagationTol_;
//- Used as default trackdata value to satisfy default template
// argument.
static int dummyTrackData_;
//- No copy assignment
void operator=(const FaceCellWave&) = delete;
public:
@ -397,7 +394,6 @@ public:
//- Iterate until no changes or maxIter reached.
// \return the number of iterations taken.
virtual label iterate(const label maxIter);
};

View File

@ -31,7 +31,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(FaceCellWaveName, 0);
defineTypeNameAndDebug(FaceCellWaveName, 0);
}

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.
@ -60,7 +61,13 @@ class MeshWave
:
public MeshWaveName
{
// Private data
// Private Static Data
//- Default trackdata value to satisfy default template argument.
static int dummyTrackData_;
// Private Data
//- Wall information for all faces
List<Type> allFaceInfo_;
@ -71,6 +78,7 @@ class MeshWave
//- Wave calculation engine.
FaceCellWave<Type, TrackingData> calc_;
// Private Member Functions
//- No copy construct
@ -79,18 +87,14 @@ class MeshWave
//- No copy assignment
void operator=(const MeshWave&) = delete;
// Private static data
//- Used as default trackdata value to satisfy default template
// argument.
static int dummyTrackData_;
public:
// Constructors
//- Construct from mesh and list of changed faces with the Type
// for these faces. Iterates until nothing changes or maxIter reached.
//- for these faces.
// Iterates until nothing changes or maxIter reached.
// (maxIter can be 0)
MeshWave
(
@ -102,7 +106,7 @@ public:
);
//- Construct from mesh, list of changed faces with the Type
// for these faces and initial field.
//- for these faces and initial field.
// Iterates until nothing changes or maxIter reached.
// (maxIter can be 0)
MeshWave
@ -136,15 +140,17 @@ public:
return calc_.data();
}
//- Iterate until no changes or maxIter reached. Returns actual
// number of iterations.
//- Iterate until no changes or maxIter reached.
// \return actual number of iterations.
label iterate(const label maxIter)
{
return calc_.iterate(maxIter);
}
//- Number of unvisited cells, i.e. cells that were not (yet)
// reached from walking across mesh. This can happen from
//- reached from walking across mesh.
//
// This can happen from
// - not enough iterations done
// - a disconnected mesh
// - a mesh without walls in it

View File

@ -415,32 +415,6 @@ PatchEdgeFaceWave
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class PrimitivePatchType,
class Type,
class TrackingData
>
Foam::label Foam::PatchEdgeFaceWave<PrimitivePatchType, Type, TrackingData>::
nUnvisitedEdges() const
{
return nUnvisitedEdges_;
}
template
<
class PrimitivePatchType,
class Type,
class TrackingData
>
Foam::label Foam::PatchEdgeFaceWave<PrimitivePatchType, Type, TrackingData>::
nUnvisitedFaces() const
{
return nUnvisitedFaces_;
}
// Copy edge information into member data
template
<

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.
@ -49,7 +50,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
// Forward Declarations
class polyMesh;
/*---------------------------------------------------------------------------*\
@ -73,19 +74,18 @@ class PatchEdgeFaceWave
:
public PatchEdgeFaceWaveName
{
// Private static data
// Private Static Data
//- Relative tolerance. Stop propagation if relative changes
// less than this tolerance (responsibility for checking this is
// up to Type implementation)
//- Relative tolerance.
// Stop propagation if relative changes less than this tolerance
// (responsibility for checking this is up to Type implementation)
static scalar propagationTol_;
//- Used as default trackdata value to satisfy default template
// argument.
//- Default trackdata value to satisfy default template argument.
static label dummyTrackData_;
// Private data
// Private Data
//- Reference to mesh
const polyMesh& mesh_;
@ -130,8 +130,8 @@ class PatchEdgeFaceWave
// Private Member Functions
//- Updates edgeInfo with information from neighbour. Updates all
// statistics.
//- Updates edgeInfo with information from neighbour.
// Updates all statistics.
bool updateEdge
(
const label edgeI,
@ -140,8 +140,8 @@ class PatchEdgeFaceWave
Type& edgeInfo
);
//- Updates faceInfo with information from neighbour. Updates all
// statistics.
//- Updates faceInfo with information from neighbour.
// Updates all statistics.
bool updateFace
(
const label facei,
@ -180,7 +180,8 @@ public:
// Constructors
//- Construct from patch, list of changed edges with the Type
// for these edges. Gets work arrays to operate on, one of size
//- for these edges.
// Obtains work arrays to operate on, one of size
// number of patch edges, the other number of patch faces.
// Iterates until nothing changes or maxIter reached.
// (maxIter can be 0)
@ -196,8 +197,8 @@ public:
TrackingData& td = dummyTrackData_
);
//- Construct from patch. Use setEdgeInfo and iterate() to do
// actual calculation
//- Construct from patch.
// Use setEdgeInfo() and iterate() to do actual calculation
PatchEdgeFaceWave
(
const polyMesh& mesh,
@ -229,13 +230,21 @@ public:
}
//- Number of unvisited faces, i.e. faces that were not (yet)
// reached from walking across patch. This can happen from
//- reached from walking across patch.
//
// This can happen from
// - not enough iterations done
// - a disconnected patch
// - a patch without walls in it
label nUnvisitedFaces() const;
label nUnvisitedFaces() const
{
return nUnvisitedFaces_;
}
label nUnvisitedEdges() const;
label nUnvisitedEdges() const
{
return nUnvisitedEdges_;
}
//- Copy initial data into allEdgeInfo_
void setEdgeInfo
@ -244,16 +253,16 @@ public:
const List<Type>& changedEdgesInfo
);
//- Propagate from edge to face. Returns total number of faces
// (over all processors) changed.
//- Propagate from edge to face.
// \return total number of faces (over all processors) changed.
label edgeToFace();
//- Propagate from face to edge. Returns total number of edges
// (over all processors) changed.
//- Propagate from face to edge.
// \return total number of edges (over all processors) changed.
label faceToEdge();
//- Iterate until no changes or maxIter reached. Returns actual
// number of iterations.
//- Iterate until no changes or maxIter reached.
// \return actual number of iterations.
label iterate(const label maxIter);
};
@ -276,6 +285,7 @@ class updateOp
TrackingData& td_;
public:
updateOp
(
const polyMesh& mesh,
@ -316,6 +326,7 @@ class transformOp
TrackingData& td_;
public:
transformOp
(
const polyMesh& mesh,

View File

@ -31,7 +31,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(PatchEdgeFaceWaveName, 0);
defineTypeNameAndDebug(PatchEdgeFaceWaveName, 0);
}

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,25 @@ License
#include "patchEdgeFaceInfo.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::patchEdgeFaceInfo& wDist
Ostream& os,
const patchEdgeFaceInfo& rhs
)
{
return os << wDist.origin() << wDist.distSqr();
return os << rhs.origin() << rhs.distSqr();
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::patchEdgeFaceInfo& wDist
Istream& is,
patchEdgeFaceInfo& rhs
)
{
return is >> wDist.origin_ >> wDist.distSqr_;
return is >> rhs.origin_ >> rhs.distSqr_;
}

View File

@ -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.
@ -58,14 +58,13 @@ class patchEdgeFaceInfo;
Istream& operator>>(Istream&, patchEdgeFaceInfo&);
Ostream& operator<<(Ostream&, const patchEdgeFaceInfo&);
/*---------------------------------------------------------------------------*\
Class patchEdgeFaceInfo Declaration
\*---------------------------------------------------------------------------*/
class patchEdgeFaceInfo
{
// Private data
// Private Data
//- Position of nearest wall center
point origin_;
@ -76,9 +75,9 @@ class patchEdgeFaceInfo
// Private Member Functions
//- Evaluate distance to point. Update distSqr, origin from whomever
// is nearer pt. Return true if w2 is closer to point,
// false otherwise.
//- Evaluate distance to point.
// Update distSqr, origin from whomever is nearer pt.
// \return true if w2 is closer to point, false otherwise.
template<class TrackingData>
inline bool update
(
@ -103,29 +102,31 @@ public:
// Constructors
//- Construct null
//- Default construct
inline patchEdgeFaceInfo();
//- Construct from origin, distance
inline patchEdgeFaceInfo(const point&, const scalar);
//- Construct as copy
inline patchEdgeFaceInfo(const patchEdgeFaceInfo&);
//- Construct from origin, distance squared
inline patchEdgeFaceInfo(const point& origin, const scalar distSqr);
// Member Functions
// Access
inline const point& origin() const;
const point& origin() const
{
return origin_;
}
inline scalar distSqr() const;
scalar distSqr() const
{
return distSqr_;
}
// Needed by meshWave
// Needed by MeshWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
@ -178,15 +179,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const patchEdgeFaceInfo&, TrackingData& td) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const patchEdgeFaceInfo&) const;
//- Test for inequality
inline bool operator!=(const patchEdgeFaceInfo&) const;

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.
@ -40,7 +41,7 @@ inline bool Foam::patchEdgeFaceInfo::update
TrackingData& td
)
{
scalar dist2 = magSqr(pt - w2.origin());
const scalar dist2 = magSqr(pt - w2.origin());
if (!valid(td))
{
@ -51,7 +52,7 @@ inline bool Foam::patchEdgeFaceInfo::update
return true;
}
scalar diff = distSqr_ - dist2;
const scalar diff = distSqr_ - dist2;
if (diff < 0)
{
@ -93,7 +94,7 @@ inline bool Foam::patchEdgeFaceInfo::update
return true;
}
scalar diff = distSqr_ - w2.distSqr();
const scalar diff = distSqr_ - w2.distSqr();
if (diff < 0)
{
@ -119,15 +120,12 @@ inline bool Foam::patchEdgeFaceInfo::update
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::patchEdgeFaceInfo::patchEdgeFaceInfo()
:
origin_(point::max),
distSqr_(sqr(GREAT))
patchEdgeFaceInfo(point::max, sqr(GREAT))
{}
// Construct from origin, distance
inline Foam::patchEdgeFaceInfo::patchEdgeFaceInfo
(
const point& origin,
@ -139,28 +137,8 @@ inline Foam::patchEdgeFaceInfo::patchEdgeFaceInfo
{}
// Construct as copy
inline Foam::patchEdgeFaceInfo::patchEdgeFaceInfo(const patchEdgeFaceInfo& wpt)
:
origin_(wpt.origin()),
distSqr_(wpt.distSqr())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::point& Foam::patchEdgeFaceInfo::origin() const
{
return origin_;
}
inline Foam::scalar Foam::patchEdgeFaceInfo::distSqr() const
{
return distSqr_;
}
template<class TrackingData>
inline bool Foam::patchEdgeFaceInfo::valid(TrackingData& td) const
{
@ -195,12 +173,14 @@ inline bool Foam::patchEdgeFaceInfo::updateEdge
)
{
const edge& e = patch.edges()[edgeI];
point eMid =
const point eMid
(
0.5
* (
patch.points()[patch.meshPoints()[e[0]]]
+ patch.points()[patch.meshPoints()[e[1]]]
);
)
);
return update(eMid, faceInfo, tol, td);
}
@ -251,10 +231,10 @@ inline bool Foam::patchEdgeFaceInfo::equal
inline bool Foam::patchEdgeFaceInfo::operator==
(
const Foam::patchEdgeFaceInfo& rhs
const patchEdgeFaceInfo& rhs
) const
{
return origin() == rhs.origin();
return origin_ == rhs.origin_;
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,25 +28,25 @@ License
#include "patchEdgeFaceRegion.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::patchEdgeFaceRegion& wDist
Ostream& os,
const patchEdgeFaceRegion& rhs
)
{
return os << wDist.region_;
return os << rhs.region_;
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::patchEdgeFaceRegion& wDist
Istream& is,
patchEdgeFaceRegion& rhs
)
{
return is >> wDist.region_;
return is >> rhs.region_;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -67,15 +67,16 @@ Ostream& operator<<(Ostream&, const patchEdgeFaceRegion&);
class patchEdgeFaceRegion
{
// Private data
// Private Data
//- region
//- The region
label region_;
// Private Member Functions
//- Combine current with w2. Update region_ if w2 has smaller
// quantities and returns true.
//- Combine current with w2.
// Update region_ if w2 has smaller quantities and return true.
template<class TrackingData>
inline bool update
(
@ -89,24 +90,26 @@ public:
// Constructors
//- Construct null
//- Default construct
inline patchEdgeFaceRegion();
//- Construct from origin, distance
inline patchEdgeFaceRegion(const label);
//- Construct from region
inline patchEdgeFaceRegion(const label regioni);
// Member Functions
// Access
inline label region() const;
label region() const
{
return region_;
}
// Needed by meshWave
// Needed by MeshWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
@ -159,15 +162,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const patchEdgeFaceRegion&, TrackingData&) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const patchEdgeFaceRegion&) const;
//- Test for inequality
inline bool operator!=(const patchEdgeFaceRegion&) const;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -74,31 +75,23 @@ inline bool Foam::patchEdgeFaceRegion::update
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::patchEdgeFaceRegion::patchEdgeFaceRegion()
:
region_(-1)
{}
// Construct from origin, distance
inline Foam::patchEdgeFaceRegion::patchEdgeFaceRegion
(
const label region
const label regioni
)
:
region_(region)
region_(regioni)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::label Foam::patchEdgeFaceRegion::region() const
{
return region_;
}
template<class TrackingData>
inline bool Foam::patchEdgeFaceRegion::valid(TrackingData& td) const
{
@ -180,16 +173,16 @@ inline bool Foam::patchEdgeFaceRegion::equal
inline bool Foam::patchEdgeFaceRegion::operator==
(
const Foam::patchEdgeFaceRegion& rhs
const patchEdgeFaceRegion& rhs
) const
{
return region() == rhs.region();
return region_ == rhs.region_;
}
inline bool Foam::patchEdgeFaceRegion::operator!=
(
const Foam::patchEdgeFaceRegion& rhs
const patchEdgeFaceRegion& rhs
) const
{
return !(*this == rhs);

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,25 +28,25 @@ License
#include "patchEdgeFaceRegions.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::patchEdgeFaceRegions& wDist
Ostream& os,
const patchEdgeFaceRegions& rhs
)
{
return os << wDist.regions_;
return os << rhs.regions();
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::patchEdgeFaceRegions& wDist
Istream& is,
patchEdgeFaceRegions& rhs
)
{
return is >> wDist.regions_;
return is >> rhs.regions();
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -50,25 +51,19 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
// Forward Declarations
class polyMesh;
// Forward declaration of friend functions and operators
class patchEdgeFaceRegions;
Istream& operator>>(Istream&, patchEdgeFaceRegions&);
Ostream& operator<<(Ostream&, const patchEdgeFaceRegions&);
/*---------------------------------------------------------------------------*\
Class patchEdgeFaceRegions Declaration
Class patchEdgeFaceRegions Declaration
\*---------------------------------------------------------------------------*/
class patchEdgeFaceRegions
{
// Private data
// Private Data
//- Region per point
labelList regions_;
@ -77,27 +72,33 @@ public:
// Constructors
//- Construct null
//- Default construct
inline patchEdgeFaceRegions();
//- Construct from regions
inline patchEdgeFaceRegions(const labelList&);
inline patchEdgeFaceRegions(const labelList& regions);
//- Construct from regions (on edge)
inline patchEdgeFaceRegions(const labelPair&);
inline patchEdgeFaceRegions(const labelPair& regions);
// Member Functions
// Access
inline const labelList& regions() const;
const labelList& regions() const
{
return regions_;
}
labelList& regions()
{
return regions_;
}
// Needed by meshWave
// Needed by MeshWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
@ -150,15 +151,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const patchEdgeFaceRegions&, TrackingData&) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const patchEdgeFaceRegions&) const;
//- Test for inequality
inline bool operator!=(const patchEdgeFaceRegions&) const;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -56,12 +57,6 @@ inline Foam::patchEdgeFaceRegions::patchEdgeFaceRegions
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::labelList& Foam::patchEdgeFaceRegions::regions() const
{
return regions_;
}
template<class TrackingData>
inline bool Foam::patchEdgeFaceRegions::valid(TrackingData& td) const
{
@ -265,16 +260,16 @@ inline bool Foam::patchEdgeFaceRegions::equal
inline bool Foam::patchEdgeFaceRegions::operator==
(
const Foam::patchEdgeFaceRegions& rhs
const patchEdgeFaceRegions& rhs
) const
{
return regions() == rhs.regions();
return regions_ == rhs.regions_;
}
inline bool Foam::patchEdgeFaceRegions::operator!=
(
const Foam::patchEdgeFaceRegions& rhs
const patchEdgeFaceRegions& rhs
) const
{
return !(*this == rhs);

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,30 +28,38 @@ License
#include "PointData.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class DataType>
Foam::Ostream& Foam::operator<<(Ostream& os, const PointData<DataType>& pd)
template<class T>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const PointData<T>& rhs
)
{
if (os.format() == IOstream::ASCII)
{
return os
<< static_cast<const pointEdgePoint&>(pd)
<< token::SPACE << pd.data();
<< static_cast<const pointEdgePoint&>(rhs)
<< token::SPACE << rhs.data();
}
else
{
return os
<< static_cast<const pointEdgePoint&>(pd)
<< pd.data();
<< static_cast<const pointEdgePoint&>(rhs)
<< rhs.data();
}
}
template<class DataType>
Foam::Istream& Foam::operator>>(Istream& is, PointData<DataType>& pd)
template<class T>
Foam::Istream& Foam::operator>>
(
Istream& is,
PointData<T>& rhs
)
{
return is >> static_cast<pointEdgePoint&>(pd) >> pd.data_;
return is >> static_cast<pointEdgePoint&>(rhs) >> rhs.data();
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -66,7 +66,7 @@ class PointData
:
public pointEdgePoint
{
// Private data
// Private Data
//- Additional transported data
DataType data_;
@ -76,7 +76,7 @@ public:
// Constructors
//- Construct null
//- Default construct
inline PointData();
//- Construct from origin, distance and data
@ -87,19 +87,22 @@ public:
const DataType& data
);
//- Construct as copy
inline PointData(const PointData&);
// Member Functions
// Access
//- Const access the data
inline const DataType& data() const;
const DataType& data() const
{
return data_;
}
DataType& data()
{
return data_;
}
// Needed by meshWave
// Needed by MeshWave
//- Apply rotation matrix to the data
template<class TrackingData>
@ -155,9 +158,13 @@ public:
TrackingData& td
);
// Member Operators
//- Test for equality
inline bool operator==(const PointData<DataType>&) const;
//- Test for inequality
inline bool operator!=(const PointData<DataType>&) const;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -51,23 +51,8 @@ inline Foam::PointData<DataType>::PointData
{}
template<class DataType>
inline Foam::PointData<DataType>::PointData(const PointData<DataType>& wpt)
:
pointEdgePoint(wpt),
data_(wpt.data())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class DataType>
inline const DataType& Foam::PointData<DataType>::data() const
{
return data_;
}
template<class DataType>
template<class TrackingData>
inline void Foam::PointData<DataType>::transform
@ -207,9 +192,8 @@ inline bool Foam::PointData<DataType>::updateEdge
template<class DataType>
inline bool Foam::PointData<DataType>::operator==
(
const Foam::PointData<DataType>& rhs
)
const
const PointData<DataType>& rhs
) const
{
return pointEdgePoint::operator==(rhs) && (data() == rhs.data());
}
@ -218,9 +202,8 @@ const
template<class DataType>
inline bool Foam::PointData<DataType>::operator!=
(
const Foam::PointData<DataType>& rhs
)
const
const PointData<DataType>& rhs
) const
{
return !(*this == rhs);
}

View File

@ -53,11 +53,12 @@ namespace Foam
{
TrackingData& td_;
public:
combineEqOp(TrackingData& td)
:
td_(td)
{}
public:
combineEqOp(TrackingData& td)
:
td_(td)
{}
void operator()(Type& x, const Type& y) const
{
@ -705,16 +706,8 @@ Foam::PointEdgeWave<Type, TrackingData>::PointEdgeWave
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type, class TrackingData>
Foam::PointEdgeWave<Type, TrackingData>::~PointEdgeWave()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type, class TrackingData>
Foam::label Foam::PointEdgeWave<Type, TrackingData>::nUnvisitedPoints() const
{

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,7 +70,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
// Forward Declarations
class polyMesh;
class polyPatch;
@ -89,19 +90,18 @@ class PointEdgeWave
:
public PointEdgeWaveName
{
// Private static data
// Private Static Data
//- Relative tolerance. Stop propagation if relative changes
// less than this tolerance (responsibility for checking this is
// up to Type implementation)
static scalar propagationTol_;
//- Used as default trackdata value to satisfy default template
// argument.
//- Default trackdata value to satisfy default template argument.
static int dummyTrackData_;
// Private data
// Private Data
//- Reference to mesh
const polyMesh& mesh_;
@ -167,8 +167,8 @@ class PointEdgeWave
List<Type>& pointInfo
) const;
//- Updates pointInfo with information from neighbour. Updates all
// statistics.
//- Updates pointInfo with information from neighbour.
// Updates all statistics.
bool updatePoint
(
const label pointi,
@ -177,8 +177,8 @@ class PointEdgeWave
Type& pointInfo
);
//- Updates pointInfo with information from same point. Updates all
// statistics.
//- Updates pointInfo with information from same point.
// Updates all statistics.
bool updatePoint
(
const label pointi,
@ -186,8 +186,8 @@ class PointEdgeWave
Type& pointInfo
);
//- Updates edgeInfo with information from neighbour. Updates all
// statistics.
//- Updates edgeInfo with information from neighbour.
// Updates all statistics.
bool updateEdge
(
const label edgeI,
@ -196,6 +196,7 @@ class PointEdgeWave
Type& edgeInfo
);
// Parallel, cyclic
//- Has patches of certain type?
@ -266,7 +267,7 @@ public:
//- Destructor
~PointEdgeWave();
~PointEdgeWave() = default;
// Member Functions
@ -336,6 +337,7 @@ class listUpdateOp
TrackingData& td_;
public:
listUpdateOp(const scalar tol, TrackingData& td)
:
tol_(tol),

View File

@ -31,7 +31,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(PointEdgeWaveName, 0);
defineTypeNameAndDebug(PointEdgeWaveName, 0);
}

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,21 +28,25 @@ License
#include "pointEdgePoint.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::pointEdgePoint& wDist
Ostream& os,
const pointEdgePoint& rhs
)
{
return os << wDist.origin() << wDist.distSqr();
return os << rhs.origin() << rhs.distSqr();
}
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::pointEdgePoint& wDist)
Foam::Istream& Foam::operator>>
(
Istream& is,
pointEdgePoint& rhs
)
{
return is >> wDist.origin_ >> wDist.distSqr_;
return is >> rhs.origin() >> rhs.distSqr();
}

View File

@ -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.
@ -60,14 +60,13 @@ class pointEdgePoint;
Istream& operator>>(Istream&, pointEdgePoint&);
Ostream& operator<<(Ostream&, const pointEdgePoint&);
/*---------------------------------------------------------------------------*\
Class pointEdgePoint Declaration
Class pointEdgePoint Declaration
\*---------------------------------------------------------------------------*/
class pointEdgePoint
{
// Private data
// Private Data
//- Position of nearest wall center
point origin_;
@ -78,9 +77,9 @@ class pointEdgePoint
// Private Member Functions
//- Evaluate distance to point. Update distSqr, origin from whomever
// is nearer pt. Return true if w2 is closer to point,
// false otherwise.
//- Evaluate distance to point.
// Update distSqr, origin from whomever is nearer pt.
// \return true if w2 is closer to point, false otherwise.
template<class TrackingData>
inline bool update
(
@ -105,33 +104,43 @@ public:
// Constructors
//- Construct null
//- Default construct
inline pointEdgePoint();
//- Construct from origin, distance
inline pointEdgePoint(const point&, const scalar);
//- Construct as copy
inline pointEdgePoint(const pointEdgePoint&);
inline pointEdgePoint(const point& origin, const scalar distSqr);
// Member Functions
// Access
inline const point& origin() const;
const point& origin() const
{
return origin_;
}
point& origin()
{
return origin_;
}
inline scalar distSqr() const;
scalar distSqr() const
{
return distSqr_;
}
scalar& distSqr()
{
return distSqr_;
}
// Needed by PointEdgeWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -215,15 +224,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const pointEdgePoint&, TrackingData& td) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const pointEdgePoint&) const;
//- Test for inequality
inline bool operator!=(const pointEdgePoint&) const;

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.
@ -40,7 +41,7 @@ inline bool Foam::pointEdgePoint::update
TrackingData& td
)
{
scalar dist2 = magSqr(pt - w2.origin());
const scalar dist2 = magSqr(pt - w2.origin());
if (!valid(td))
{
@ -51,7 +52,7 @@ inline bool Foam::pointEdgePoint::update
return true;
}
scalar diff = distSqr_ - dist2;
const scalar diff = distSqr_ - dist2;
if (diff < 0)
{
@ -93,7 +94,7 @@ inline bool Foam::pointEdgePoint::update
return true;
}
scalar diff = distSqr_ - w2.distSqr();
const scalar diff = distSqr_ - w2.distSqr();
if (diff < 0)
{
@ -119,7 +120,6 @@ inline bool Foam::pointEdgePoint::update
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::pointEdgePoint::pointEdgePoint()
:
origin_(point::max),
@ -127,7 +127,6 @@ inline Foam::pointEdgePoint::pointEdgePoint()
{}
// Construct from origin, distance
inline Foam::pointEdgePoint::pointEdgePoint
(
const point& origin,
@ -139,28 +138,8 @@ inline Foam::pointEdgePoint::pointEdgePoint
{}
// Construct as copy
inline Foam::pointEdgePoint::pointEdgePoint(const pointEdgePoint& wpt)
:
origin_(wpt.origin()),
distSqr_(wpt.distSqr())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::point& Foam::pointEdgePoint::origin() const
{
return origin_;
}
inline Foam::scalar Foam::pointEdgePoint::distSqr() const
{
return distSqr_;
}
template<class TrackingData>
inline bool Foam::pointEdgePoint::valid(TrackingData& td) const
{
@ -177,7 +156,7 @@ inline bool Foam::pointEdgePoint::sameGeometry
TrackingData& td
) const
{
scalar diff = Foam::mag(distSqr() - w2.distSqr());
const scalar diff = Foam::mag(distSqr() - w2.distSqr());
if (diff < SMALL)
{
@ -311,15 +290,19 @@ inline bool Foam::pointEdgePoint::equal
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::pointEdgePoint::operator==(const Foam::pointEdgePoint& rhs)
const
inline bool Foam::pointEdgePoint::operator==
(
const pointEdgePoint& rhs
) const
{
return (origin() == rhs.origin()) && (distSqr() == rhs.distSqr());
return origin_ == rhs.origin_ && distSqr_ == rhs.distSqr_;
}
inline bool Foam::pointEdgePoint::operator!=(const Foam::pointEdgePoint& rhs)
const
inline bool Foam::pointEdgePoint::operator!=
(
const pointEdgePoint& rhs
) const
{
return !(*this == rhs);
}

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,17 +28,26 @@ License
#include "cellInfo.H"
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::cellInfo& wDist)
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const cellInfo& rhs
)
{
return os << wDist.type_;
return os << rhs.type();
}
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::cellInfo& wDist)
Foam::Istream& Foam::operator>>
(
Istream& is,
cellInfo& rhs
)
{
return is >> wDist.type_;
return is >> rhs.type();
}
// ************************************************************************* //

View File

@ -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.
@ -64,16 +64,15 @@ Ostream& operator<<(Ostream&, const cellInfo&);
class cellInfo
{
// Private data
// Private Data
label type_;
// Private Member Functions
//- Update current cell/face type with neighbouring
// type. Return true if information needs to propagate,
// false otherwise.
//- Update current cell/face type with neighbouring type.
// \return true if information needs to propagate, false otherwise.
template<class TrackingData>
inline bool update
(
@ -85,38 +84,39 @@ class cellInfo
TrackingData& td
);
public:
// Constructors
//- Construct null
//- Default construct - as cellClassification::NOTSET
inline cellInfo();
//- Construct from cType
inline cellInfo(const label);
//- Construct as copy
inline cellInfo(const cellInfo&);
//- Construct from cellClassification type
inline explicit cellInfo(const label ctype);
// Member Functions
// Access
inline label type() const
label type() const
{
return type_;
}
label& type()
{
return type_;
}
// Needed by meshWave
// Needed by MeshWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -193,15 +193,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const cellInfo&, TrackingData& td) const;
// Member Operators
//Note: Used to determine whether to call update.
//- Test for equality
inline bool operator==(const cellInfo&) const;
//- Test for inequality
inline bool operator!=(const cellInfo&) const;

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.
@ -94,24 +95,15 @@ inline bool Foam::cellInfo::update
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::cellInfo::cellInfo()
:
type_(cellClassification::NOTSET)
{}
// Construct from components
inline Foam::cellInfo::cellInfo(const label type)
inline Foam::cellInfo::cellInfo(const label ctype)
:
type_(type)
{}
// Construct as copy
inline Foam::cellInfo::cellInfo(const cellInfo& w2)
:
type_(w2.type())
type_(ctype)
{}
@ -132,8 +124,7 @@ inline bool Foam::cellInfo::sameGeometry
const cellInfo& w2,
const scalar tol,
TrackingData& td
)
const
) const
{
return true;
}
@ -223,6 +214,7 @@ inline bool Foam::cellInfo::updateFace
);
}
// Update this with neighbour information
template<class TrackingData>
inline bool Foam::cellInfo::updateFace
@ -259,13 +251,19 @@ inline bool Foam::cellInfo::equal
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::cellInfo::operator==(const Foam::cellInfo& rhs) const
inline bool Foam::cellInfo::operator==
(
const cellInfo& rhs
) const
{
return type() == rhs.type();
return type_ == rhs.type_;
}
inline bool Foam::cellInfo::operator!=(const Foam::cellInfo& rhs) const
inline bool Foam::cellInfo::operator!=
(
const cellInfo& rhs
) const
{
return !(*this == rhs);
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,16 +28,26 @@ License
#include "wallPoint.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::wallPoint& wDist)
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const wallPoint& rhs
)
{
return os << wDist.origin() << token::SPACE << wDist.distSqr();
return os << rhs.origin() << token::SPACE << rhs.distSqr();
}
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::wallPoint& wDist)
Foam::Istream& Foam::operator>>
(
Istream& is,
wallPoint& rhs
)
{
return is >> wDist.origin() >> wDist.distSqr();
return is >> rhs.origin() >> rhs.distSqr();
}
// ************************************************************************* //

View File

@ -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.
@ -76,9 +76,9 @@ class wallPoint
// Private Member Functions
//- Evaluate distance to point. Update distSqr, origin from whomever
// is nearer pt. Return true if w2 is closer to point,
// false otherwise.
//- Evaluate distance to point.
// Update distSqr, origin from whomever is nearer pt.
// \return true if w2 is closer to point, false otherwise.
template<class TrackingData>
inline bool update
(
@ -93,37 +93,43 @@ public:
// Constructors
//- Construct null
//- Default construct
inline wallPoint();
//- Construct from origin, distance
//- Construct from origin, distance-squared
inline wallPoint(const point& origin, const scalar distSqr);
//- Construct as copy
inline wallPoint(const wallPoint&);
// Member Functions
// Access
inline const point& origin() const;
const point& origin() const
{
return origin_;
}
point& origin()
{
return origin_;
}
inline point& origin();
inline scalar distSqr() const;
inline scalar& distSqr();
scalar distSqr() const
{
return distSqr_;
}
scalar& distSqr()
{
return distSqr_;
}
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -134,7 +140,7 @@ public:
) const;
//- Convert any absolute coordinates into relative to (patch)face
// centre
//- centre
template<class TrackingData>
inline void leaveDomain
(
@ -200,15 +206,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const wallPoint&, TrackingData& td) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const wallPoint&) const;
//- Test for inequality
inline bool operator!=(const wallPoint&) const;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,40 +28,31 @@ License
#include "wallPointData.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class Type>
Ostream& operator<<
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const wallPointData<Type>& wDist
const wallPointData<Type>& rhs
)
{
return os
<< static_cast<const wallPoint&>(wDist)
<< static_cast<const wallPoint&>(rhs)
<< token::SPACE
<< wDist.data();
<< rhs.data();
}
template<class Type>
Istream& operator>>
Foam::Istream& Foam::operator>>
(
Istream& is,
wallPointData<Type>& wDist
wallPointData<Type>& rhs
)
{
return is >> static_cast<wallPoint&>(wDist) >> wDist.data_;
return is >> static_cast<wallPoint&>(rhs) >> rhs.data_;
}
// ************************************************************************* //
} // End namespace Foam
// ************************************************************************* //

View File

@ -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,7 +57,7 @@ template<class Type> Ostream& operator<<(Ostream&, const wallPointData<Type>&);
/*---------------------------------------------------------------------------*\
Class wallPointData Declaration
Class wallPointData Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
@ -65,7 +65,7 @@ class wallPointData
:
public wallPoint
{
// Private data
// Private Data
//- Data at nearest wall center
Type data_;
@ -73,9 +73,9 @@ class wallPointData
// Private Member Functions
//- Evaluate distance to point. Update distSqr, origin from whomever
// is nearer pt. Return true if w2 is closer to point,
// false otherwise.
//- Evaluate distance to point.
// Update distSqr, origin from whomever is nearer pt.
// \return true if w2 is closer to point, false otherwise.
template<class TrackingData>
inline bool update
(
@ -88,12 +88,15 @@ class wallPointData
public:
typedef Type dataType;
// Public Typedefs
//- Type of additional data carried
typedef Type dataType;
// Constructors
//- Construct null
//- Default construct
inline wallPointData();
//- Construct from origin, normal, distance
@ -109,10 +112,17 @@ public:
// Access
inline const Type& data() const;
inline Type& data();
const Type& data() const
{
return data_;
}
Type& data()
{
return data_;
}
// Needed by meshWave
// Needed by MeshWave
//- Influence of neighbouring face.
// Calls update(...) with cellCentre of celli
@ -153,7 +163,6 @@ public:
TrackingData& td
);
// Member Operators
// IOstream Operators

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.
@ -25,17 +26,12 @@ License
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update this with w2 if w2 nearer to pt.
template<class Type>
template<class TrackingData>
inline bool wallPointData<Type>::update
inline bool Foam::wallPointData<Type>::update
(
const point& pt,
const wallPointData<Type>& w2,
@ -43,11 +39,11 @@ inline bool wallPointData<Type>::update
TrackingData& td
)
{
scalar dist2 = magSqr(pt - w2.origin());
const scalar dist2 = magSqr(pt - w2.origin());
if (valid(td))
{
scalar diff = distSqr() - dist2;
const scalar diff = distSqr() - dist2;
if (diff < 0)
{
@ -76,18 +72,16 @@ inline bool wallPointData<Type>::update
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
template<class Type>
inline wallPointData<Type>::wallPointData()
inline Foam::wallPointData<Type>::wallPointData()
:
wallPoint(),
data_()
{}
// Construct from components
template<class Type>
inline wallPointData<Type>::wallPointData
inline Foam::wallPointData<Type>::wallPointData
(
const point& origin,
const Type& data,
@ -101,24 +95,10 @@ inline wallPointData<Type>::wallPointData
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
inline const Type& wallPointData<Type>::data() const
{
return data_;
}
template<class Type>
inline Type& wallPointData<Type>::data()
{
return data_;
}
// Update this with w2 if w2 nearer to pt.
template<class Type>
template<class TrackingData>
inline bool wallPointData<Type>::updateCell
inline bool Foam::wallPointData<Type>::updateCell
(
const polyMesh& mesh,
const label thisCelli,
@ -143,7 +123,7 @@ inline bool wallPointData<Type>::updateCell
// Update this with w2 if w2 nearer to pt.
template<class Type>
template<class TrackingData>
inline bool wallPointData<Type>::updateFace
inline bool Foam::wallPointData<Type>::updateFace
(
const polyMesh& mesh,
const label thisFacei,
@ -168,7 +148,7 @@ inline bool wallPointData<Type>::updateFace
// Update this with w2 if w2 nearer to pt.
template<class Type>
template<class TrackingData>
inline bool wallPointData<Type>::updateFace
inline bool Foam::wallPointData<Type>::updateFace
(
const polyMesh& mesh,
const label thisFacei,
@ -189,8 +169,4 @@ inline bool wallPointData<Type>::updateFace
}
// ************************************************************************* //
} // End namespace Foam
// ************************************************************************* //

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.
@ -47,7 +48,7 @@ inline bool Foam::wallPoint::update
// return false;
//}
scalar dist2 = magSqr(pt - w2.origin());
const scalar dist2 = magSqr(pt - w2.origin());
if (!valid(td))
{
@ -58,7 +59,7 @@ inline bool Foam::wallPoint::update
return true;
}
scalar diff = distSqr_ - dist2;
const scalar diff = distSqr_ - dist2;
if (diff < 0)
{
@ -98,39 +99,8 @@ inline Foam::wallPoint::wallPoint(const point& origin, const scalar distSqr)
{}
inline Foam::wallPoint::wallPoint(const wallPoint& wpt)
:
origin_(wpt.origin()),
distSqr_(wpt.distSqr())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::point& Foam::wallPoint::origin() const
{
return origin_;
}
inline Foam::point& Foam::wallPoint::origin()
{
return origin_;
}
inline Foam::scalar Foam::wallPoint::distSqr() const
{
return distSqr_;
}
inline Foam::scalar& Foam::wallPoint::distSqr()
{
return distSqr_;
}
template<class TrackingData>
inline bool Foam::wallPoint::valid(TrackingData& td) const
{
@ -148,7 +118,7 @@ inline bool Foam::wallPoint::sameGeometry
TrackingData& td
) const
{
scalar diff = mag(distSqr() - w2.distSqr());
const scalar diff = mag(distSqr() - w2.distSqr());
if (diff < SMALL)
{
@ -231,7 +201,7 @@ inline bool Foam::wallPoint::updateCell
tol,
td
);
}
}
// Update this with w2 if w2 nearer to pt.
@ -256,6 +226,7 @@ inline bool Foam::wallPoint::updateFace
);
}
// Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool Foam::wallPoint::updateFace
@ -291,13 +262,19 @@ inline bool Foam::wallPoint::equal
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::wallPoint::operator==(const Foam::wallPoint& rhs) const
inline bool Foam::wallPoint::operator==
(
const wallPoint& rhs
) const
{
return origin() == rhs.origin();
return origin_ == rhs.origin_;
}
inline bool Foam::wallPoint::operator!=(const Foam::wallPoint& rhs) const
inline bool Foam::wallPoint::operator!=
(
const wallPoint& rhs
) const
{
return !(*this == rhs);
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,25 +28,25 @@ License
#include "pointTopoDistanceData.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::pointTopoDistanceData& wDist
Ostream& os,
const pointTopoDistanceData& rhs
)
{
return os << wDist.data_ << token::SPACE << wDist.distance_;
return os << rhs.data_ << token::SPACE << rhs.distance_;
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::pointTopoDistanceData& wDist
Istream& is,
pointTopoDistanceData& rhs
)
{
return is >> wDist.data_ >> wDist.distance_;
return is >> rhs.data_ >> rhs.distance_;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -56,14 +56,13 @@ class pointTopoDistanceData;
Istream& operator>>(Istream&, pointTopoDistanceData&);
Ostream& operator<<(Ostream&, const pointTopoDistanceData&);
/*---------------------------------------------------------------------------*\
Class pointTopoDistanceData Declaration
\*---------------------------------------------------------------------------*/
class pointTopoDistanceData
{
// Private data
// Private Data
//- Starting data
label data_;
@ -76,7 +75,7 @@ public:
// Constructors
//- Construct null with invalid (-1) for data and distance
//- Default construct, with invalid (-1) for data and distance
inline pointTopoDistanceData();
//- Construct from components
@ -91,11 +90,12 @@ public:
// Access
inline label data() const
label data() const
{
return data_;
}
inline label distance() const
label distance() const
{
return distance_;
}
@ -103,13 +103,11 @@ public:
// Needed by PointEdgeWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -193,7 +191,7 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const pointTopoDistanceData&, TrackingData&)
const;
@ -201,8 +199,10 @@ public:
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const pointTopoDistanceData&) const;
//- Test for inequality
inline bool operator!=(const pointTopoDistanceData&) const;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -204,16 +204,16 @@ inline bool Foam::pointTopoDistanceData::equal
inline bool Foam::pointTopoDistanceData::operator==
(
const Foam::pointTopoDistanceData& rhs
const pointTopoDistanceData& rhs
) const
{
return data() == rhs.data() && distance() == rhs.distance();
return data_ == rhs.data_ && distance_ == rhs.distance_;
}
inline bool Foam::pointTopoDistanceData::operator!=
(
const Foam::pointTopoDistanceData& rhs
const pointTopoDistanceData& rhs
) const
{
return !(*this == rhs);

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,25 +28,25 @@ License
#include "topoDistanceData.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::topoDistanceData& wDist
Ostream& os,
const topoDistanceData& rhs
)
{
return os << wDist.data_ << token::SPACE << wDist.distance_;
return os << rhs.data_ << token::SPACE << rhs.distance_;
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::topoDistanceData& wDist
Istream& is,
topoDistanceData& rhs
)
{
return is >> wDist.data_ >> wDist.distance_;
return is >> rhs.data_ >> rhs.distance_;
}

View File

@ -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.
@ -55,14 +55,13 @@ class topoDistanceData;
Istream& operator>>(Istream&, topoDistanceData&);
Ostream& operator<<(Ostream&, const topoDistanceData&);
/*---------------------------------------------------------------------------*\
Class topoDistanceData Declaration
Class topoDistanceData Declaration
\*---------------------------------------------------------------------------*/
class topoDistanceData
{
// Private data
// Private Data
//- Starting data
label data_;
@ -75,7 +74,7 @@ public:
// Constructors
//- Construct null with invalid (-1) for data and distance
//- Default construct, with invalid (-1) for data and distance
inline topoDistanceData();
//- Construct from components
@ -90,11 +89,12 @@ public:
// Access
inline label data() const
label data() const
{
return data_;
}
inline label distance() const
label distance() const
{
return distance_;
}
@ -102,12 +102,11 @@ public:
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -184,16 +183,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const topoDistanceData&, TrackingData& td) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const topoDistanceData&) const;
//- Test for inequality
inline bool operator!=(const topoDistanceData&) const;

View File

@ -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.
@ -192,16 +192,16 @@ inline bool Foam::topoDistanceData::equal
inline bool Foam::topoDistanceData::operator==
(
const Foam::topoDistanceData& rhs
const topoDistanceData& rhs
) const
{
return data() == rhs.data() && distance() == rhs.distance();
return data_ == rhs.data_ && distance_ == rhs.distance_;
}
inline bool Foam::topoDistanceData::operator!=
(
const Foam::topoDistanceData& rhs
const topoDistanceData& rhs
) const
{
return !(*this == rhs);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2016 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -46,8 +46,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
// Forward Declarations
class polyPatch;
class polyMesh;
class minData;
@ -55,14 +54,13 @@ class minData;
Istream& operator>>(Istream&, minData&);
Ostream& operator<<(Ostream&, const minData&);
/*---------------------------------------------------------------------------*\
Class minData Declaration
\*---------------------------------------------------------------------------*/
class minData
{
// Private data
// Private Data
//- Starting data
label data_;
@ -72,10 +70,10 @@ public:
// Constructors
//- Construct null
//- Default construct
inline minData();
//- Construct from count
//- Construct from min value
inline minData(const label data);
@ -83,7 +81,7 @@ public:
// Access
inline label data() const
label data() const
{
return data_;
}
@ -91,12 +89,11 @@ public:
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -173,15 +170,17 @@ public:
TrackingData& td
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal(const minData&, TrackingData& td) const;
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const minData&) const;
//- Test for inequality
inline bool operator!=(const minData&) const;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014-2016 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -177,16 +177,16 @@ inline bool Foam::minData::equal
inline bool Foam::minData::operator==
(
const Foam::minData& rhs
const minData& rhs
) const
{
return data() == rhs.data();
return data_ == rhs.data_;
}
inline bool Foam::minData::operator!=
(
const Foam::minData& rhs
const minData& rhs
) const
{
return !(*this == rhs);
@ -197,21 +197,21 @@ inline bool Foam::minData::operator!=
inline Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::minData& wDist
Ostream& os,
const minData& rhs
)
{
return os << wDist.data_;
return os << rhs.data_;
}
inline Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::minData& wDist
Istream& is,
minData& rhs
)
{
return is >> wDist.data_;
return is >> rhs.data_;
}

View File

@ -5,7 +5,7 @@
\\ / 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.
@ -27,25 +27,25 @@ License
#include "meshToMeshData.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::meshToMeshData& wDist
Ostream& os,
const meshToMeshData& rhs
)
{
return os << wDist.tgtCelli_;
return os << rhs.tgtCelli_;
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::meshToMeshData& wDist
Istream& is,
meshToMeshData& rhs
)
{
return is >> wDist.tgtCelli_;
return is >> rhs.tgtCelli_;
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -57,61 +57,53 @@ Ostream& operator<<(Ostream&, const meshToMeshData&);
/*---------------------------------------------------------------------------*\
Class meshToMeshData Declaration
Class meshToMeshData Declaration
\*---------------------------------------------------------------------------*/
class meshToMeshData
{
public:
// Private Data
//- Class used to pass non-cell data to the update function
class trackData
{
public:
const polyMesh& tgtMesh_;
// Constructors
trackData(const polyMesh& tgtMesh)
:
tgtMesh_(tgtMesh)
{}
};
// Private data
// Corresponding cell in tgtMesh
//- Corresponding cell in tgtMesh
label tgtCelli_;
public:
// Public Classes
//- Class used to pass non-cell data to the update function
class trackData
{
public:
const polyMesh& tgtMesh_;
trackData(const polyMesh& tgtMesh)
:
tgtMesh_(tgtMesh)
{}
};
// Constructors
//- Construct null
//- Default construct
inline meshToMeshData();
//- Construct from count
inline meshToMeshData
(
const label tgtCelli
);
//- Construct from target cell
inline meshToMeshData(const label tgtCelli);
// Member Functions
// Access
inline label tgtCell() const
label tgtCell() const
{
return tgtCelli_;
}
inline label& tgtCell()
label& tgtCell()
{
return tgtCelli_;
}
@ -119,12 +111,11 @@ public:
// Needed by FaceCellWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
//- Changed or contains original (invalid) value
template<class TrackingData>
inline bool valid(TrackingData&) const;
//- Check for identical geometrical data. Used for cyclics checking.
//- Check for identical geometrical data (eg, cyclics checking)
template<class TrackingData>
inline bool sameGeometry
(
@ -134,8 +125,8 @@ public:
TrackingData&
) const;
//- Convert any absolute coordinates into relative to (patch)face
// centre
//- Convert absolute coordinates into relative
//- to (patch)face centre
template<class TrackingData>
inline void leaveDomain
(
@ -201,7 +192,7 @@ public:
TrackingData&
);
//- Same (like operator==)
//- Test for equality, with TrackingData
template<class TrackingData>
inline bool equal
(
@ -212,9 +203,10 @@ public:
// Member Operators
// Needed for List IO
//- Test for equality
inline bool operator==(const meshToMeshData&) const;
//- Test for inequality
inline bool operator!=(const meshToMeshData&) const;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -116,7 +116,7 @@ inline bool Foam::meshToMeshData::updateCell
const point& cc = mesh.cellCentres()[thisCelli];
// See if we are in the neighbour
label tgti = neighbourInfo.tgtCelli_;
const label tgti = neighbourInfo.tgtCelli_;
// Try match of neighbour
if (td.tgtMesh_.pointInCell(cc, tgti, polyMesh::CELL_TETS))
@ -127,10 +127,8 @@ inline bool Foam::meshToMeshData::updateCell
// Try match of neighbour's neighbours
const labelList& tgtNbrs = td.tgtMesh_.cellCells(tgti);
forAll(tgtNbrs, i)
for (const label tgti : tgtNbrs)
{
label tgti = tgtNbrs[i];
// Try match of neighbour
if (td.tgtMesh_.pointInCell(cc, tgti, polyMesh::CELL_TETS))
{
@ -211,7 +209,7 @@ inline bool Foam::meshToMeshData::equal
inline bool Foam::meshToMeshData::operator==
(
const Foam::meshToMeshData& rhs
const meshToMeshData& rhs
) const
{
return tgtCelli_ == rhs.tgtCelli_;
@ -220,7 +218,7 @@ inline bool Foam::meshToMeshData::operator==
inline bool Foam::meshToMeshData::operator!=
(
const Foam::meshToMeshData& rhs
const meshToMeshData& rhs
) const
{
return !(*this == rhs);

View File

@ -140,7 +140,7 @@ void Foam::waveMethod::calculate
forAll(cellData, celli)
{
srcToTgtAddr[celli] = cellData[celli].tgtCelli_;
srcToTgtAddr[celli] = cellData[celli].tgtCell();
}
}
@ -172,6 +172,7 @@ Foam::waveMethod::waveMethod
Foam::waveMethod::~waveMethod()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::waveMethod::calculate

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -72,7 +73,7 @@ class OppositeFaceCellWave
{
protected:
// Protected data
// Protected Data
//- For every entry in changedCells (i.e. the cell front) gives
// the face that it needs to transfer to
@ -95,7 +96,8 @@ public:
// Constructors
//- Construct from mesh and list of changed faces with the Type
// for these faces. Iterates until nothing changes or maxIter reached.
//- for these faces.
// Iterates until nothing changes or maxIter reached.
// (maxIter can be 0)
OppositeFaceCellWave
(