STYLE: adjust code format for trackingData
- rationalized some layout and comments
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user