meshTools/algorithms/PatchEdgeFaceWave: Added point object with data

This commit is contained in:
Will Bainbridge
2023-02-15 12:37:05 +00:00
parent f95eb5fd11
commit 2c247c3e8f
19 changed files with 645 additions and 350 deletions

View File

@ -31,7 +31,7 @@ Description
#include "fvMesh.H"
#include "volFields.H"
#include "PatchEdgeFaceWave.H"
#include "patchEdgeFaceInfo.H"
#include "patchEdgeFacePoint.H"
#include "patchPatchDist.H"
using namespace Foam;
@ -55,12 +55,12 @@ int main(int argc, char *argv[])
// 1. Walk from a single edge
{
// Data on all edges and faces
List<patchEdgeFaceInfo> allEdgeInfo(patch.nEdges());
List<patchEdgeFaceInfo> allFaceInfo(patch.size());
List<patchEdgeFacePoint> allEdgeInfo(patch.nEdges());
List<patchEdgeFacePoint> allFaceInfo(patch.size());
// Initial seed
DynamicList<label> initialEdges;
DynamicList<patchEdgeFaceInfo> initialEdgesInfo;
DynamicList<patchEdgeFacePoint> initialEdgesInfo;
// Just set an edge on the master
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
const edge& e = patch.edges()[edgeI];
initialEdgesInfo.append
(
patchEdgeFaceInfo
patchEdgeFacePoint
(
e.centre(patch.localPoints()),
0.0
@ -83,11 +83,7 @@ int main(int argc, char *argv[])
// Walk
PatchEdgeFaceWave
<
primitivePatch,
patchEdgeFaceInfo
> calc
PatchEdgeFaceWave<primitivePatch, patchEdgeFacePoint> calc
(
mesh,
patch,

View File

@ -71,21 +71,10 @@ meshSearch/meshSearchMeshObject.C
meshTools/meshTools.C
algorithms = algorithms
pWave = $(algorithms)/PointEdgeWave
$(pWave)/PointEdgeWaveName.C
$(pWave)/pointEdgePoint.C
patchWave = $(algorithms)/PatchEdgeFaceWave
$(patchWave)/PatchEdgeFaceWaveName.C
$(patchWave)/patchEdgeFaceInfo.C
$(patchWave)/patchPatchDist.C
$(patchWave)/patchEdgeFaceRegion.C
$(patchWave)/patchEdgeFaceRegions.C
meshWave = $(algorithms)/FaceCellWave
$(meshWave)/FaceCellWaveName.C
algorithms/FaceCellWave/FaceCellWaveName.C
algorithms/PointEdgeWave/PointEdgeWaveName.C
algorithms/PatchEdgeFaceWave/PatchEdgeFaceWaveName.C
algorithms/PatchEdgeFaceWave/patchPatchDist.C
regionSplit/regionSplit.C
regionSplit/localPointRegion.C

View File

@ -0,0 +1,191 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::PatchEdgeFacePointData
Description
Transport of nearest point location, plus data, for use in
PatchEdgeFaceWave
SourceFiles
PatchEdgeFacePointDataI.H
\*---------------------------------------------------------------------------*/
#ifndef PatchEdgeFacePointData_H
#define PatchEdgeFacePointData_H
#include "patchEdgeFacePoint.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class polyPatch;
class polyMesh;
// Forward declaration of friend functions and operators
template<class Type>
class PatchEdgeFacePointData;
template<class Type>
Istream& operator>>(Istream&, PatchEdgeFacePointData<Type>&);
template<class Type>
Ostream& operator<<(Ostream&, const PatchEdgeFacePointData<Type>&);
/*---------------------------------------------------------------------------*\
Class PatchEdgeFacePointData Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class PatchEdgeFacePointData
:
public patchEdgeFacePoint
{
// Private Data
//- Data at nearest wall centre
Type data_;
public:
// Constructors
//- Construct null
inline PatchEdgeFacePointData();
//- Construct from data, origin, distance
inline PatchEdgeFacePointData(const Type&, const point&, const scalar);
// Member Functions
// Access
inline const Type& data() const;
inline Type& data();
template<class TrackingData>
inline const Type& data(TrackingData& td) const;
// Needed by meshWave
//- Apply rotation matrix
template<class TrackingData>
inline void transform
(
const polyMesh& mesh,
const primitivePatch& patch,
const tensor& rotTensor,
const scalar tol,
TrackingData& td
);
//- Influence of face on edge
template<class TrackingData>
inline bool updateEdge
(
const polyMesh& mesh,
const primitivePatch& patch,
const label edgei,
const label facei,
const PatchEdgeFacePointData<Type>& faceInfo,
const scalar tol,
TrackingData& td
);
//- New information for edge (from e.g. coupled edge)
template<class TrackingData>
inline bool updateEdge
(
const polyMesh& mesh,
const primitivePatch& patch,
const PatchEdgeFacePointData<Type>& edgeInfo,
const bool sameOrientation,
const scalar tol,
TrackingData& td
);
//- Influence of edge on face
template<class TrackingData>
inline bool updateFace
(
const polyMesh& mesh,
const primitivePatch& patch,
const label facei,
const label edgei,
const PatchEdgeFacePointData<Type>& edgeInfo,
const scalar tol,
TrackingData& td
);
// IOstream Operators
friend Ostream& operator<< <Type>
(
Ostream&,
const PatchEdgeFacePointData<Type>&
);
friend Istream& operator>> <Type>
(
Istream&,
PatchEdgeFacePointData<Type>&
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DefineContiguousPatchEdgeFacePointDataType(Type, nullArg) \
template<> \
inline bool contiguous<PatchEdgeFacePointData<Type>>() \
{ \
return true; \
}
DefineContiguousPatchEdgeFacePointDataType(bool, );
DefineContiguousPatchEdgeFacePointDataType(label, );
FOR_ALL_FIELD_TYPES(DefineContiguousPatchEdgeFacePointDataType);
#undef DefineContiguousPatchEdgeFacePointDataType
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "PatchEdgeFacePointDataI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,223 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "PatchEdgeFacePointData.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
inline Foam::PatchEdgeFacePointData<Type>::PatchEdgeFacePointData()
:
patchEdgeFacePoint(),
data_()
{}
template<class Type>
inline Foam::PatchEdgeFacePointData<Type>::PatchEdgeFacePointData
(
const Type& data,
const point& origin,
const scalar distSqr
)
:
patchEdgeFacePoint(origin, distSqr),
data_(data)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
inline const Type& Foam::PatchEdgeFacePointData<Type>::data() const
{
return data_;
}
template<class Type>
inline Type& Foam::PatchEdgeFacePointData<Type>::data()
{
return data_;
}
template<class Type>
template<class TrackingData>
inline const Type& Foam::PatchEdgeFacePointData<Type>::data
(
TrackingData& td
) const
{
return data_;
}
template<class Type>
template<class TrackingData>
inline void Foam::PatchEdgeFacePointData<Type>::transform
(
const polyMesh& mesh,
const primitivePatch& patch,
const tensor& rotTensor,
const scalar tol,
TrackingData& td
)
{
patchEdgeFacePoint::transform(mesh, patch, rotTensor, tol, td);
data_ = Foam::transform(rotTensor, data_);
}
template<class Type>
template<class TrackingData>
inline bool Foam::PatchEdgeFacePointData<Type>::updateEdge
(
const polyMesh& mesh,
const primitivePatch& patch,
const label edgei,
const label facei,
const PatchEdgeFacePointData<Type>& faceInfo,
const scalar tol,
TrackingData& td
)
{
const bool result =
patchEdgeFacePoint::updateEdge
(
mesh,
patch,
edgei,
facei,
faceInfo,
tol,
td
);
if (result)
{
data_ = faceInfo.data_;
}
return result;
}
template<class Type>
template<class TrackingData>
inline bool Foam::PatchEdgeFacePointData<Type>::updateEdge
(
const polyMesh& mesh,
const primitivePatch& patch,
const PatchEdgeFacePointData<Type>& edgeInfo,
const bool sameOrientation,
const scalar tol,
TrackingData& td
)
{
const bool result =
patchEdgeFacePoint::updateEdge
(
mesh,
patch,
edgeInfo,
sameOrientation,
tol,
td
);
if (result)
{
data_ = edgeInfo.data_;
}
return result;
}
template<class Type>
template<class TrackingData>
inline bool Foam::PatchEdgeFacePointData<Type>::updateFace
(
const polyMesh& mesh,
const primitivePatch& patch,
const label facei,
const label edgei,
const PatchEdgeFacePointData<Type>& edgeInfo,
const scalar tol,
TrackingData& td
)
{
const bool result =
patchEdgeFacePoint::updateFace
(
mesh,
patch,
edgei,
facei,
edgeInfo,
tol,
td
);
if (result)
{
data_ = edgeInfo.data_;
}
return result;
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class Type>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const PatchEdgeFacePointData<Type>& wDist
)
{
return
os
<< static_cast<const patchEdgeFacePoint&>(wDist)
<< token::SPACE
<< wDist.data_;
}
template<class Type>
Foam::Istream& Foam::operator>>
(
Istream& is,
PatchEdgeFacePointData<Type>& wDist
)
{
return is >> static_cast<patchEdgeFacePoint&>(wDist) >> wDist.data_;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,7 +51,7 @@ defaultTrackingData_ = -1;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update info for edgeI, at position pt, with information from
// Update info for edgei, at position pt, with information from
// neighbouring face.
// Updates:
// - changedEdge_, changedEdges_,
@ -65,7 +65,7 @@ template
bool Foam::PatchEdgeFaceWave<PrimitivePatchType, Type, TrackingData>::
updateEdge
(
const label edgeI,
const label edgei,
const label neighbourFacei,
const Type& neighbourInfo,
Type& edgeInfo
@ -80,7 +80,7 @@ updateEdge
(
mesh_,
patch_,
edgeI,
edgei,
neighbourFacei,
neighbourInfo,
propagationTol_,
@ -89,10 +89,10 @@ updateEdge
if (propagate)
{
if (!changedEdge_[edgeI])
if (!changedEdge_[edgei])
{
changedEdge_[edgeI] = true;
changedEdges_.append(edgeI);
changedEdge_[edgei] = true;
changedEdges_.append(edgei);
}
}
@ -455,25 +455,25 @@ setEdgeInfo
{
forAll(changedEdges, changedEdgeI)
{
label edgeI = changedEdges[changedEdgeI];
label edgei = changedEdges[changedEdgeI];
bool wasValid = allEdgeInfo_[edgeI].valid(td_);
bool wasValid = allEdgeInfo_[edgei].valid(td_);
// Copy info for edgeI
allEdgeInfo_[edgeI] = changedEdgesInfo[changedEdgeI];
// Copy info for edgei
allEdgeInfo_[edgei] = changedEdgesInfo[changedEdgeI];
// Maintain count of unset edges
if (!wasValid && allEdgeInfo_[edgeI].valid(td_))
if (!wasValid && allEdgeInfo_[edgei].valid(td_))
{
--nUnvisitedEdges_;
}
// Mark edgeI as changed, both on list and on edge itself.
// Mark edgei as changed, both on list and on edge itself.
if (!changedEdge_[edgeI])
if (!changedEdge_[edgei])
{
changedEdge_[edgeI] = true;
changedEdges_.append(edgeI);
changedEdge_[edgei] = true;
changedEdges_.append(edgei);
}
}
}
@ -512,15 +512,15 @@ faceToEdge()
forAll(fEdges, fEdgeI)
{
label edgeI = fEdges[fEdgeI];
label edgei = fEdges[fEdgeI];
Type& currentWallInfo = allEdgeInfo_[edgeI];
Type& currentWallInfo = allEdgeInfo_[edgei];
if (!currentWallInfo.equal(neighbourWallInfo, td_))
{
updateEdge
(
edgeI,
edgei,
facei,
neighbourWallInfo,
currentWallInfo
@ -559,22 +559,22 @@ edgeToFace()
forAll(changedEdges_, changedEdgeI)
{
label edgeI = changedEdges_[changedEdgeI];
label edgei = changedEdges_[changedEdgeI];
if (!changedEdge_[edgeI])
if (!changedEdge_[edgei])
{
FatalErrorInFunction
<< "edge " << edgeI
<< "edge " << edgei
<< " not marked as having been changed" << nl
<< "This might be caused by multiple occurrences of the same"
<< " seed edge." << abort(FatalError);
}
const Type& neighbourWallInfo = allEdgeInfo_[edgeI];
const Type& neighbourWallInfo = allEdgeInfo_[edgei];
// Evaluate all connected faces
const labelList& eFaces = edgeFaces[edgeI];
const labelList& eFaces = edgeFaces[edgei];
forAll(eFaces, eFacei)
{
label facei = eFaces[eFacei];
@ -586,7 +586,7 @@ edgeToFace()
updateFace
(
facei,
edgeI,
edgei,
neighbourWallInfo,
currentWallInfo
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -128,7 +128,7 @@ class PatchEdgeFaceWave
// statistics.
bool updateEdge
(
const label edgeI,
const label edgei,
const label neighbourFacei,
const Type& neighbourInfo,
Type& edgeInfo

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "patchEdgeFaceInfo.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::patchEdgeFaceInfo& wDist
)
{
return os << wDist.origin() << wDist.distSqr();
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::patchEdgeFaceInfo& wDist
)
{
return is >> wDist.origin_ >> wDist.distSqr_;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,18 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::patchEdgeFaceInfo
Foam::patchEdgeFacePoint
Description
Transport of nearest point location for use in PatchEdgeFaceWave.
SourceFiles
patchEdgeFaceInfoI.H
patchEdgeFaceInfo.C
patchEdgeFacePointI.H
\*---------------------------------------------------------------------------*/
#ifndef patchEdgeFaceInfo_H
#define patchEdgeFaceInfo_H
#ifndef patchEdgeFacePoint_H
#define patchEdgeFacePoint_H
#include "point.H"
#include "label.H"
@ -55,17 +55,17 @@ class polyMesh;
// Forward declaration of friend functions and operators
class patchEdgeFaceInfo;
class patchEdgeFacePoint;
Istream& operator>>(Istream&, patchEdgeFaceInfo&);
Ostream& operator<<(Ostream&, const patchEdgeFaceInfo&);
Istream& operator>>(Istream&, patchEdgeFacePoint&);
Ostream& operator<<(Ostream&, const patchEdgeFacePoint&);
/*---------------------------------------------------------------------------*\
Class patchEdgeFaceInfo Declaration
Class patchEdgeFacePoint Declaration
\*---------------------------------------------------------------------------*/
class patchEdgeFaceInfo
class patchEdgeFacePoint
{
// Private Data
@ -85,7 +85,7 @@ class patchEdgeFaceInfo
inline bool update
(
const point&,
const patchEdgeFaceInfo& w2,
const patchEdgeFacePoint& w2,
const scalar tol,
TrackingData& td
);
@ -95,7 +95,7 @@ class patchEdgeFaceInfo
template<class TrackingData>
inline bool update
(
const patchEdgeFaceInfo& w2,
const patchEdgeFacePoint& w2,
const scalar tol,
TrackingData& td
);
@ -106,10 +106,10 @@ public:
// Constructors
//- Construct null
inline patchEdgeFaceInfo();
inline patchEdgeFacePoint();
//- Construct from origin, distance
inline patchEdgeFaceInfo(const point&, const scalar);
inline patchEdgeFacePoint(const point&, const scalar);
// Member Functions
@ -145,9 +145,9 @@ public:
(
const polyMesh& mesh,
const primitivePatch& patch,
const label edgeI,
const label edgei,
const label facei,
const patchEdgeFaceInfo& faceInfo,
const patchEdgeFacePoint& faceInfo,
const scalar tol,
TrackingData& td
);
@ -158,7 +158,7 @@ public:
(
const polyMesh& mesh,
const primitivePatch& patch,
const patchEdgeFaceInfo& edgeInfo,
const patchEdgeFacePoint& edgeInfo,
const bool sameOrientation,
const scalar tol,
TrackingData& td
@ -171,34 +171,38 @@ public:
const polyMesh& mesh,
const primitivePatch& patch,
const label facei,
const label edgeI,
const patchEdgeFaceInfo& edgeInfo,
const label edgei,
const patchEdgeFacePoint& edgeInfo,
const scalar tol,
TrackingData& td
);
//- Same (like operator==)
template<class TrackingData>
inline bool equal(const patchEdgeFaceInfo&, TrackingData& td) const;
inline bool equal
(
const patchEdgeFacePoint&,
TrackingData& td
) const;
// Member Operators
// Needed for List IO
inline bool operator==(const patchEdgeFaceInfo&) const;
inline bool operator!=(const patchEdgeFaceInfo&) const;
inline bool operator==(const patchEdgeFacePoint&) const;
inline bool operator!=(const patchEdgeFacePoint&) const;
// IOstream Operators
friend Ostream& operator<<(Ostream&, const patchEdgeFaceInfo&);
friend Istream& operator>>(Istream&, patchEdgeFaceInfo&);
inline friend Ostream& operator<<(Ostream&, const patchEdgeFacePoint&);
inline friend Istream& operator>>(Istream&, patchEdgeFacePoint&);
};
//- Data associated with patchEdgeFaceInfo type are contiguous
//- Data associated with patchEdgeFacePoint type are contiguous
template<>
inline bool contiguous<patchEdgeFaceInfo>()
inline bool contiguous<patchEdgeFacePoint>()
{
return true;
}
@ -210,7 +214,7 @@ inline bool contiguous<patchEdgeFaceInfo>()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "patchEdgeFaceInfoI.H"
#include "patchEdgeFacePointI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,10 +30,10 @@ License
// Update this with w2 if w2 nearer to pt.
template<class TrackingData>
inline bool Foam::patchEdgeFaceInfo::update
inline bool Foam::patchEdgeFacePoint::update
(
const point& pt,
const patchEdgeFaceInfo& w2,
const patchEdgeFacePoint& w2,
const scalar tol,
TrackingData& td
)
@ -75,9 +75,9 @@ inline bool Foam::patchEdgeFaceInfo::update
// Update this with w2 (information on same edge)
template<class TrackingData>
inline bool Foam::patchEdgeFaceInfo::update
inline bool Foam::patchEdgeFacePoint::update
(
const patchEdgeFaceInfo& w2,
const patchEdgeFacePoint& w2,
const scalar tol,
TrackingData& td
)
@ -117,14 +117,14 @@ inline bool Foam::patchEdgeFaceInfo::update
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline Foam::patchEdgeFaceInfo::patchEdgeFaceInfo()
inline Foam::patchEdgeFacePoint::patchEdgeFacePoint()
:
origin_(point::max),
distSqr_(sqr(great))
{}
inline Foam::patchEdgeFaceInfo::patchEdgeFaceInfo
inline Foam::patchEdgeFacePoint::patchEdgeFacePoint
(
const point& origin,
const scalar distSqr
@ -137,27 +137,27 @@ inline Foam::patchEdgeFaceInfo::patchEdgeFaceInfo
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::point& Foam::patchEdgeFaceInfo::origin() const
inline const Foam::point& Foam::patchEdgeFacePoint::origin() const
{
return origin_;
}
inline Foam::scalar Foam::patchEdgeFaceInfo::distSqr() const
inline Foam::scalar Foam::patchEdgeFacePoint::distSqr() const
{
return distSqr_;
}
template<class TrackingData>
inline bool Foam::patchEdgeFaceInfo::valid(TrackingData& td) const
inline bool Foam::patchEdgeFacePoint::valid(TrackingData& td) const
{
return origin_ != point::max;
}
template<class TrackingData>
inline void Foam::patchEdgeFaceInfo::transform
inline void Foam::patchEdgeFacePoint::transform
(
const polyMesh& mesh,
const primitivePatch& patch,
@ -171,18 +171,18 @@ inline void Foam::patchEdgeFaceInfo::transform
template<class TrackingData>
inline bool Foam::patchEdgeFaceInfo::updateEdge
inline bool Foam::patchEdgeFacePoint::updateEdge
(
const polyMesh& mesh,
const primitivePatch& patch,
const label edgeI,
const label edgei,
const label facei,
const patchEdgeFaceInfo& faceInfo,
const patchEdgeFacePoint& faceInfo,
const scalar tol,
TrackingData& td
)
{
const edge& e = patch.edges()[edgeI];
const edge& e = patch.edges()[edgei];
point eMid =
0.5
* (
@ -194,11 +194,11 @@ inline bool Foam::patchEdgeFaceInfo::updateEdge
template<class TrackingData>
inline bool Foam::patchEdgeFaceInfo::updateEdge
inline bool Foam::patchEdgeFacePoint::updateEdge
(
const polyMesh& mesh,
const primitivePatch& patch,
const patchEdgeFaceInfo& edgeInfo,
const patchEdgeFacePoint& edgeInfo,
const bool sameOrientation,
const scalar tol,
TrackingData& td
@ -209,13 +209,13 @@ inline bool Foam::patchEdgeFaceInfo::updateEdge
template<class TrackingData>
inline bool Foam::patchEdgeFaceInfo::updateFace
inline bool Foam::patchEdgeFacePoint::updateFace
(
const polyMesh& mesh,
const primitivePatch& patch,
const label facei,
const label edgeI,
const patchEdgeFaceInfo& edgeInfo,
const label edgei,
const patchEdgeFacePoint& edgeInfo,
const scalar tol,
TrackingData& td
)
@ -225,9 +225,9 @@ inline bool Foam::patchEdgeFaceInfo::updateFace
template<class TrackingData>
inline bool Foam::patchEdgeFaceInfo::equal
inline bool Foam::patchEdgeFacePoint::equal
(
const patchEdgeFaceInfo& rhs,
const patchEdgeFacePoint& rhs,
TrackingData& td
) const
{
@ -237,22 +237,44 @@ inline bool Foam::patchEdgeFaceInfo::equal
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::patchEdgeFaceInfo::operator==
inline bool Foam::patchEdgeFacePoint::operator==
(
const Foam::patchEdgeFaceInfo& rhs
const Foam::patchEdgeFacePoint& rhs
) const
{
return origin() == rhs.origin();
}
inline bool Foam::patchEdgeFaceInfo::operator!=
inline bool Foam::patchEdgeFacePoint::operator!=
(
const Foam::patchEdgeFaceInfo& rhs
const Foam::patchEdgeFacePoint& rhs
) const
{
return !(*this == rhs);
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
inline Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::patchEdgeFacePoint& wDist
)
{
return os << wDist.origin() << token::SPACE << wDist.distSqr();
}
inline Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::patchEdgeFacePoint& wDist
)
{
return is >> wDist.origin_ >> wDist.distSqr_;
}
// ************************************************************************* //

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "patchEdgeFaceRegion.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::patchEdgeFaceRegion& wDist
)
{
return os << wDist.region_;
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::patchEdgeFaceRegion& wDist
)
{
return is >> wDist.region_;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,12 +26,10 @@ Class
Description
Transport of region for use in PatchEdgeFaceWave.
Set element to -2 to denote blocked.
SourceFiles
patchEdgeFaceRegionI.H
patchEdgeFaceRegion.C
\*---------------------------------------------------------------------------*/
@ -128,7 +126,7 @@ public:
(
const polyMesh& mesh,
const indirectPrimitivePatch& patch,
const label edgeI,
const label edgei,
const label facei,
const patchEdgeFaceRegion& faceInfo,
const scalar tol,
@ -154,7 +152,7 @@ public:
const polyMesh& mesh,
const indirectPrimitivePatch& patch,
const label facei,
const label edgeI,
const label edgei,
const patchEdgeFaceRegion& edgeInfo,
const scalar tol,
TrackingData& td
@ -174,8 +172,8 @@ public:
// IOstream Operators
friend Ostream& operator<<(Ostream&, const patchEdgeFaceRegion&);
friend Istream& operator>>(Istream&, patchEdgeFaceRegion&);
inline friend Ostream& operator<<(Ostream&, const patchEdgeFaceRegion&);
inline friend Istream& operator>>(Istream&, patchEdgeFaceRegion&);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -121,7 +121,7 @@ inline bool Foam::patchEdgeFaceRegion::updateEdge
(
const polyMesh& mesh,
const indirectPrimitivePatch& patch,
const label edgeI,
const label edgei,
const label facei,
const patchEdgeFaceRegion& faceInfo,
const scalar tol,
@ -153,7 +153,7 @@ inline bool Foam::patchEdgeFaceRegion::updateFace
const polyMesh& mesh,
const indirectPrimitivePatch& patch,
const label facei,
const label edgeI,
const label edgei,
const patchEdgeFaceRegion& edgeInfo,
const scalar tol,
TrackingData& td
@ -194,4 +194,26 @@ inline bool Foam::patchEdgeFaceRegion::operator!=
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
inline Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::patchEdgeFaceRegion& wDist
)
{
return os << wDist.region_;
}
inline Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::patchEdgeFaceRegion& wDist
)
{
return is >> wDist.region_;
}
// ************************************************************************* //

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "patchEdgeFaceRegions.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::patchEdgeFaceRegions& wDist
)
{
return os << wDist.regions_;
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::patchEdgeFaceRegions& wDist
)
{
return is >> wDist.regions_;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,12 +26,10 @@ Class
Description
Transport of regions for use in PatchEdgeFaceWave.
Set element to -1 to denote blocked.
SourceFiles
patchEdgeFaceRegionsI.H
patchEdgeFaceRegions.C
\*---------------------------------------------------------------------------*/
@ -116,7 +114,7 @@ public:
(
const polyMesh& mesh,
const Patch& patch,
const label edgeI,
const label edgei,
const label facei,
const patchEdgeFaceRegions& faceInfo,
const scalar tol,
@ -142,7 +140,7 @@ public:
const polyMesh& mesh,
const Patch& patch,
const label facei,
const label edgeI,
const label edgei,
const patchEdgeFaceRegions& edgeInfo,
const scalar tol,
TrackingData& td
@ -162,8 +160,16 @@ public:
// IOstream Operators
friend Ostream& operator<<(Ostream&, const patchEdgeFaceRegions&);
friend Istream& operator>>(Istream&, patchEdgeFaceRegions&);
inline friend Ostream& operator<<
(
Ostream&,
const patchEdgeFaceRegions&
);
inline friend Istream& operator>>
(
Istream&,
patchEdgeFaceRegions&
);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -84,7 +84,7 @@ inline bool Foam::patchEdgeFaceRegions::updateEdge
(
const polyMesh& mesh,
const Patch& patch,
const label edgeI,
const label edgei,
const label facei,
const patchEdgeFaceRegions& faceInfo,
const scalar tol,
@ -92,9 +92,9 @@ inline bool Foam::patchEdgeFaceRegions::updateEdge
)
{
const face& f = patch.localFaces()[facei];
const edge& e = patch.edges()[edgeI];
const edge& e = patch.edges()[edgei];
label index = findIndex(patch.faceEdges()[facei], edgeI);
label index = findIndex(patch.faceEdges()[facei], edgei);
bool sameOrientation = (f[index] == e.start());
// Get information in edge-order
@ -189,17 +189,17 @@ inline bool Foam::patchEdgeFaceRegions::updateFace
const polyMesh& mesh,
const Patch& patch,
const label facei,
const label edgeI,
const label edgei,
const patchEdgeFaceRegions& edgeInfo,
const scalar tol,
TrackingData& td
)
{
const face& f = patch.localFaces()[facei];
const edge& e = patch.edges()[edgeI];
const edge& e = patch.edges()[edgei];
// Find starting point of edge on face.
label index0 = findIndex(patch.faceEdges()[facei], edgeI);
label index0 = findIndex(patch.faceEdges()[facei], edgei);
label index1 = f.fcIndex(index0);
bool sameOrientation = (f[index0] == e.start());
@ -279,4 +279,26 @@ inline bool Foam::patchEdgeFaceRegions::operator!=
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
inline Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::patchEdgeFaceRegions& wDist
)
{
return os << wDist.regions_;
}
inline Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::patchEdgeFaceRegions& wDist
)
{
return is >> wDist.regions_;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,7 +27,7 @@ License
#include "PatchEdgeFaceWave.H"
#include "syncTools.H"
#include "polyMesh.H"
#include "patchEdgeFaceInfo.H"
#include "patchEdgeFacePoint.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -76,12 +76,12 @@ void Foam::patchPatchDist::correct()
for
(
label edgeI = nbrPatch.nInternalEdges();
edgeI < nbrPatch.nEdges();
edgeI++
label edgei = nbrPatch.nInternalEdges();
edgei < nbrPatch.nEdges();
edgei++
)
{
const edge& e = nbrPatch.edges()[edgeI];
const edge& e = nbrPatch.edges()[edgei];
const edge meshE = edge(nbrMp[e[0]], nbrMp[e[1]]);
nbrEdges.insert(meshE, nbrPatchi);
}
@ -98,13 +98,13 @@ void Foam::patchPatchDist::correct()
// Data on all edges and faces
List<patchEdgeFaceInfo> allEdgeInfo(patch_.nEdges());
List<patchEdgeFaceInfo> allFaceInfo(patch_.size());
List<patchEdgeFacePoint> allEdgeInfo(patch_.nEdges());
List<patchEdgeFacePoint> allFaceInfo(patch_.size());
// Initial seed
label nBndEdges = patch_.nEdges() - patch_.nInternalEdges();
DynamicList<label> initialEdges(2*nBndEdges);
DynamicList<patchEdgeFaceInfo> initialEdgesInfo(2*nBndEdges);
DynamicList<patchEdgeFacePoint> initialEdgesInfo(2*nBndEdges);
// Seed all my edges that are also nbrEdges
@ -113,20 +113,20 @@ void Foam::patchPatchDist::correct()
for
(
label edgeI = patch_.nInternalEdges();
edgeI < patch_.nEdges();
edgeI++
label edgei = patch_.nInternalEdges();
edgei < patch_.nEdges();
edgei++
)
{
const edge& e = patch_.edges()[edgeI];
const edge& e = patch_.edges()[edgei];
const edge meshE = edge(mp[e[0]], mp[e[1]]);
EdgeMap<label>::const_iterator edgeFnd = nbrEdges.find(meshE);
if (edgeFnd != nbrEdges.end())
{
initialEdges.append(edgeI);
initialEdges.append(edgei);
initialEdgesInfo.append
(
patchEdgeFaceInfo
patchEdgeFacePoint
(
e.centre(patch_.localPoints()),
0.0
@ -137,11 +137,7 @@ void Foam::patchPatchDist::correct()
// Walk
PatchEdgeFaceWave
<
primitivePatch,
patchEdgeFaceInfo
> calc
PatchEdgeFaceWave<primitivePatch, patchEdgeFacePoint> calc
(
patch_.boundaryMesh().mesh(),
patch_,

View File

@ -1,46 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "pointEdgePoint.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::pointEdgePoint& wDist
)
{
return os << wDist.origin() << wDist.distSqr();
}
Foam::Istream& Foam::operator>>(Foam::Istream& is, Foam::pointEdgePoint& wDist)
{
return is >> wDist.origin_ >> wDist.distSqr_;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -209,8 +209,8 @@ public:
// IOstream Operators
friend Ostream& operator<<(Ostream&, const pointEdgePoint&);
friend Istream& operator>>(Istream&, pointEdgePoint&);
inline friend Ostream& operator<<(Ostream&, const pointEdgePoint&);
inline friend Istream& operator>>(Istream&, pointEdgePoint&);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -287,4 +287,26 @@ const
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
inline Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::pointEdgePoint& wDist
)
{
return os << wDist.origin() << token::SPACE << wDist.distSqr();
}
inline Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::pointEdgePoint& wDist
)
{
return is >> wDist.origin_ >> wDist.distSqr_;
}
// ************************************************************************* //