mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Use edgeHashes.H and labelPairHashes.H
- avoids some duplicate code.
This commit is contained in:
@ -25,7 +25,7 @@ License
|
||||
|
||||
#include "DelaunayMesh.H"
|
||||
#include "polyMesh.H"
|
||||
#include "labelPair.H"
|
||||
#include "labelPairHashes.H"
|
||||
#include "PrintTable.H"
|
||||
#include "pointIOField.H"
|
||||
#include "scalarIOField.H"
|
||||
|
||||
@ -37,9 +37,7 @@ SourceFiles
|
||||
#ifndef DelaunayMesh_H
|
||||
#define DelaunayMesh_H
|
||||
|
||||
#include "Pair.H"
|
||||
#include "HashSet.H"
|
||||
#include "FixedList.H"
|
||||
#include "labelPairHashes.H"
|
||||
#include "boundBox.H"
|
||||
#include "indexedVertex.H"
|
||||
#include "CGALTriangulation3Ddefs.H"
|
||||
@ -77,20 +75,6 @@ public:
|
||||
typedef typename Triangulation::Finite_facets_iterator
|
||||
Finite_facets_iterator;
|
||||
|
||||
typedef HashSet
|
||||
<
|
||||
Pair<label>,
|
||||
FixedList<label, 2>::Hash<>
|
||||
> labelPairHashSet;
|
||||
|
||||
typedef HashTable
|
||||
<
|
||||
label,
|
||||
labelPair,
|
||||
FixedList<label, 2>::Hash<>
|
||||
> labelTolabelPairHashTable;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
@ -263,7 +247,7 @@ public:
|
||||
autoPtr<polyMesh> createMesh
|
||||
(
|
||||
const fileName& name,
|
||||
labelTolabelPairHashTable& vertexMap,
|
||||
labelPairLookup& vertexMap,
|
||||
labelList& cellMap,
|
||||
const bool writeDelaunayData = true
|
||||
) const;
|
||||
|
||||
@ -337,7 +337,7 @@ Foam::autoPtr<Foam::polyMesh>
|
||||
Foam::DelaunayMesh<Triangulation>::createMesh
|
||||
(
|
||||
const fileName& name,
|
||||
labelTolabelPairHashTable& vertexMap,
|
||||
labelPairLookup& vertexMap,
|
||||
labelList& cellMap,
|
||||
const bool writeDelaunayData
|
||||
) const
|
||||
|
||||
@ -31,9 +31,6 @@ License
|
||||
#include "indexedVertexEnum.H"
|
||||
#include "IOmanip.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Triangulation>
|
||||
@ -541,8 +538,7 @@ Foam::label Foam::DistributedDelaunayMesh<Triangulation>::referVertices
|
||||
{
|
||||
for
|
||||
(
|
||||
typename labelPairHashSet::const_iterator iter
|
||||
= pointsNotInserted.begin();
|
||||
labelPairHashSet::const_iterator iter = pointsNotInserted.begin();
|
||||
iter != pointsNotInserted.end();
|
||||
++iter
|
||||
)
|
||||
@ -863,7 +859,7 @@ void Foam::DistributedDelaunayMesh<Triangulation>::sync(const boundBox& bb)
|
||||
|
||||
template<class Triangulation>
|
||||
template<class PointIterator>
|
||||
typename Foam::DistributedDelaunayMesh<Triangulation>::labelPairHashSet
|
||||
Foam::labelPairHashSet
|
||||
Foam::DistributedDelaunayMesh<Triangulation>::rangeInsertReferredWithInfo
|
||||
(
|
||||
PointIterator begin,
|
||||
|
||||
@ -71,10 +71,6 @@ public:
|
||||
typedef typename Triangulation::All_cells_iterator
|
||||
All_cells_iterator;
|
||||
|
||||
typedef typename DelaunayMesh<Triangulation>::labelPairHashSet
|
||||
labelPairHashSet;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
autoPtr<List<boundBox>> allBackgroundMeshBounds_;
|
||||
@ -193,12 +189,6 @@ public:
|
||||
bool printErrors = true
|
||||
);
|
||||
|
||||
// distributeField();
|
||||
|
||||
|
||||
// Queries
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -635,7 +635,7 @@ void Foam::cellShapeControlMesh::write() const
|
||||
}
|
||||
}
|
||||
|
||||
DelaunayMesh<CellSizeDelaunay>::labelTolabelPairHashTable vertexMap;
|
||||
labelPairLookup vertexMap;
|
||||
labelList cellMap;
|
||||
|
||||
autoPtr<polyMesh> meshPtr = DelaunayMesh<CellSizeDelaunay>::createMesh
|
||||
|
||||
@ -105,7 +105,7 @@ public:
|
||||
typedef Delaunay::Facet Facet;
|
||||
typedef Delaunay::Point Point;
|
||||
|
||||
typedef List<DynamicList<Pair<labelPair>>> labelPairPairDynListList;
|
||||
typedef List<DynamicList<labelPairPair>> labelPairPairDynListList;
|
||||
|
||||
typedef Tuple2<pointIndexHit, label> pointIndexHitAndFeature;
|
||||
typedef List<pointIndexHitAndFeature> pointIndexHitAndFeatureList;
|
||||
@ -706,7 +706,7 @@ private:
|
||||
(
|
||||
labelList& owner,
|
||||
labelList& neighbour,
|
||||
const HashSet<labelPair, labelPair::Hash<>>& deferredCollapseFaces
|
||||
const labelPairHashSet& deferredCollapseFaces
|
||||
) const;
|
||||
|
||||
//- Check whether the cell sizes are fine enough. Creates a polyMesh.
|
||||
|
||||
@ -673,7 +673,7 @@ void Foam::conformalVoronoiMesh::deferredCollapseFaceSet
|
||||
(
|
||||
labelList& owner,
|
||||
labelList& neighbour,
|
||||
const HashSet<labelPair, labelPair::Hash<>>& deferredCollapseFaces
|
||||
const labelPairHashSet& deferredCollapseFaces
|
||||
) const
|
||||
{
|
||||
DynamicList<label> faceLabels;
|
||||
@ -2131,14 +2131,14 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
||||
// Use this processor's vertex index as the master
|
||||
// for sorting
|
||||
|
||||
DynamicList<Pair<labelPair>>& sortingIndex =
|
||||
DynamicList<labelPairPair>& sortingIndex =
|
||||
procPatchSortingIndex[patchIndex];
|
||||
|
||||
if (vB->internalOrBoundaryPoint() && vB->referred())
|
||||
{
|
||||
sortingIndex.append
|
||||
(
|
||||
Pair<labelPair>
|
||||
labelPairPair
|
||||
(
|
||||
labelPair(vA->index(), vA->procIndex()),
|
||||
labelPair(vB->index(), vB->procIndex())
|
||||
@ -2149,7 +2149,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
||||
{
|
||||
sortingIndex.append
|
||||
(
|
||||
Pair<labelPair>
|
||||
labelPairPair
|
||||
(
|
||||
labelPair(vB->index(), vB->procIndex()),
|
||||
labelPair(vA->index(), vA->procIndex())
|
||||
@ -2162,14 +2162,14 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
||||
// Use the other processor's vertex index as the
|
||||
// master for sorting
|
||||
|
||||
DynamicList<Pair<labelPair>>& sortingIndex =
|
||||
DynamicList<labelPairPair>& sortingIndex =
|
||||
procPatchSortingIndex[patchIndex];
|
||||
|
||||
if (vA->internalOrBoundaryPoint() && vA->referred())
|
||||
{
|
||||
sortingIndex.append
|
||||
(
|
||||
Pair<labelPair>
|
||||
labelPairPair
|
||||
(
|
||||
labelPair(vA->index(), vA->procIndex()),
|
||||
labelPair(vB->index(), vB->procIndex())
|
||||
@ -2180,7 +2180,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
||||
{
|
||||
sortingIndex.append
|
||||
(
|
||||
Pair<labelPair>
|
||||
labelPairPair
|
||||
(
|
||||
labelPair(vB->index(), vB->procIndex()),
|
||||
labelPair(vA->index(), vA->procIndex())
|
||||
@ -2463,7 +2463,7 @@ void Foam::conformalVoronoiMesh::sortProcPatches
|
||||
faceList& faces = patchFaces[patchi];
|
||||
labelList& owner = patchOwners[patchi];
|
||||
DynamicList<label>& slaves = patchPointPairSlaves[patchi];
|
||||
DynamicList<Pair<labelPair>>& sortingIndices
|
||||
DynamicList<labelPairPair>& sortingIndices
|
||||
= patchSortingIndices[patchi];
|
||||
|
||||
if (!sortingIndices.empty())
|
||||
|
||||
@ -199,7 +199,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
||||
|
||||
Info<< nl << "Writing " << "tetDualMesh" << endl;
|
||||
|
||||
DistributedDelaunayMesh<Delaunay>::labelTolabelPairHashTable vertexMap;
|
||||
labelPairLookup vertexMap;
|
||||
labelList cellMap;
|
||||
autoPtr<polyMesh> tetMesh =
|
||||
createMesh("tetDualMesh", vertexMap, cellMap);
|
||||
|
||||
@ -28,7 +28,7 @@ License
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
template<class Triangulation>
|
||||
inline Foam::Pair<Foam::labelPair>
|
||||
inline Foam::labelPairPair
|
||||
Foam::pointPairs<Triangulation>::orderPointPair
|
||||
(
|
||||
const labelPair& vA,
|
||||
@ -38,8 +38,8 @@ Foam::pointPairs<Triangulation>::orderPointPair
|
||||
return
|
||||
(
|
||||
(vA < vB)
|
||||
? Pair<labelPair>(vA, vB)
|
||||
: Pair<labelPair>(vB, vA)
|
||||
? labelPairPair(vA, vB)
|
||||
: labelPairPair(vB, vA)
|
||||
);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ inline bool Foam::pointPairs<Triangulation>::insertPointPair
|
||||
template<class Triangulation>
|
||||
Foam::pointPairs<Triangulation>::pointPairs(const Triangulation& triangulation)
|
||||
:
|
||||
ptPairTable(),
|
||||
StorageContainer(),
|
||||
triangulation_(triangulation)
|
||||
{}
|
||||
|
||||
@ -181,7 +181,7 @@ void Foam::pointPairs<Triangulation>::reIndex(const Map<label>& oldToNewIndices)
|
||||
|
||||
forAllConstIter(pointPairs, *this, iter)
|
||||
{
|
||||
Pair<labelPair> e = iter.key();
|
||||
labelPairPair e = iter.key();
|
||||
|
||||
labelPair& start = e.first();
|
||||
labelPair& end = e.second();
|
||||
|
||||
@ -39,20 +39,13 @@ Description
|
||||
#ifndef pointPairs_H
|
||||
#define pointPairs_H
|
||||
|
||||
#include "labelPair.H"
|
||||
#include "HashSet.H"
|
||||
#include "labelPairHashes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
typedef HashSet
|
||||
<
|
||||
Pair<labelPair>,
|
||||
FixedList<labelPair, 2>::Hash<>
|
||||
> ptPairTable;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class pointPairs Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -60,11 +53,12 @@ typedef HashSet
|
||||
template<class Triangulation>
|
||||
class pointPairs
|
||||
:
|
||||
public ptPairTable
|
||||
public HashSet<labelPairPair, labelPairPair::Hash<>>
|
||||
{
|
||||
// Private typedefs
|
||||
|
||||
typedef typename Triangulation::Vertex_handle Vertex_handle;
|
||||
typedef HashSet<labelPairPair, labelPairPair::Hash<>> StorageContainer;
|
||||
typedef typename Triangulation::Vertex_handle Vertex_handle;
|
||||
|
||||
|
||||
// Private data
|
||||
@ -74,7 +68,7 @@ class pointPairs
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
inline Pair<labelPair> orderPointPair
|
||||
inline labelPairPair orderPointPair
|
||||
(
|
||||
const labelPair& vA,
|
||||
const labelPair& vB
|
||||
|
||||
Reference in New Issue
Block a user