mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: meshStructure: make sense in parallel. Fixes #732.
This commit is contained in:
@ -28,6 +28,7 @@ License
|
|||||||
#include "topoDistanceData.H"
|
#include "topoDistanceData.H"
|
||||||
#include "pointTopoDistanceData.H"
|
#include "pointTopoDistanceData.H"
|
||||||
#include "PointEdgeWave.H"
|
#include "PointEdgeWave.H"
|
||||||
|
#include "globalIndex.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -99,7 +100,10 @@ bool Foam::meshStructure::isStructuredCell
|
|||||||
void Foam::meshStructure::correct
|
void Foam::meshStructure::correct
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const uindirectPrimitivePatch& pp
|
const uindirectPrimitivePatch& pp,
|
||||||
|
const globalIndex& globalFaces,
|
||||||
|
const globalIndex& globalEdges,
|
||||||
|
const globalIndex& globalPoints
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Field on cells and faces.
|
// Field on cells and faces.
|
||||||
@ -121,7 +125,11 @@ void Foam::meshStructure::correct
|
|||||||
forAll(pp, patchFacei)
|
forAll(pp, patchFacei)
|
||||||
{
|
{
|
||||||
patchFaces[patchFacei] = pp.addressing()[patchFacei];
|
patchFaces[patchFacei] = pp.addressing()[patchFacei];
|
||||||
patchData[patchFacei] = topoDistanceData(patchFacei, 0);
|
patchData[patchFacei] = topoDistanceData
|
||||||
|
(
|
||||||
|
globalFaces.toGlobal(patchFacei),
|
||||||
|
0
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -230,7 +238,11 @@ void Foam::meshStructure::correct
|
|||||||
forAll(pp.meshPoints(), patchPointi)
|
forAll(pp.meshPoints(), patchPointi)
|
||||||
{
|
{
|
||||||
patchPoints[patchPointi] = pp.meshPoints()[patchPointi];
|
patchPoints[patchPointi] = pp.meshPoints()[patchPointi];
|
||||||
patchData[patchPointi] = pointTopoDistanceData(patchPointi, 0);
|
patchData[patchPointi] = pointTopoDistanceData
|
||||||
|
(
|
||||||
|
globalPoints.toGlobal(patchPointi),
|
||||||
|
0
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -257,7 +269,13 @@ void Foam::meshStructure::correct
|
|||||||
EdgeMap<label> pointsToEdge(pp.nEdges());
|
EdgeMap<label> pointsToEdge(pp.nEdges());
|
||||||
forAll(pp.edges(), edgeI)
|
forAll(pp.edges(), edgeI)
|
||||||
{
|
{
|
||||||
pointsToEdge.insert(pp.edges()[edgeI], edgeI);
|
const edge& e = pp.edges()[edgeI];
|
||||||
|
edge globalEdge
|
||||||
|
(
|
||||||
|
globalPoints.toGlobal(e[0]),
|
||||||
|
globalPoints.toGlobal(e[1])
|
||||||
|
);
|
||||||
|
pointsToEdge.insert(globalEdge, globalEdges.toGlobal(edgeI));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look up on faces
|
// Look up on faces
|
||||||
@ -380,7 +398,34 @@ Foam::meshStructure::meshStructure
|
|||||||
const uindirectPrimitivePatch& pp
|
const uindirectPrimitivePatch& pp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
correct(mesh, pp);
|
correct
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
pp,
|
||||||
|
globalIndex(pp.size()),
|
||||||
|
globalIndex(pp.nEdges()),
|
||||||
|
globalIndex(pp.nPoints())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::meshStructure::meshStructure
|
||||||
|
(
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const uindirectPrimitivePatch& pp,
|
||||||
|
const globalIndex& globalFaces,
|
||||||
|
const globalIndex& globalEdges,
|
||||||
|
const globalIndex& globalPoints
|
||||||
|
)
|
||||||
|
{
|
||||||
|
correct
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
pp,
|
||||||
|
globalFaces,
|
||||||
|
globalEdges,
|
||||||
|
globalPoints
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -25,7 +25,11 @@ Class
|
|||||||
Foam::meshStructure
|
Foam::meshStructure
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Detect extruded mesh structure given a set of patch faces.
|
Detect extruded mesh structure given a set of faces
|
||||||
|
(uindirectPrimitivePatch).
|
||||||
|
|
||||||
|
All indices to originating set are in terms of global faces,
|
||||||
|
global edges, global points.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
meshStructure.C
|
meshStructure.C
|
||||||
@ -46,7 +50,7 @@ namespace Foam
|
|||||||
|
|
||||||
// Forward declaration of classes
|
// Forward declaration of classes
|
||||||
class polyMesh;
|
class polyMesh;
|
||||||
|
class globalIndex;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class meshStructure Declaration
|
Class meshStructure Declaration
|
||||||
@ -95,7 +99,10 @@ class meshStructure
|
|||||||
void correct
|
void correct
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const uindirectPrimitivePatch& pp
|
const uindirectPrimitivePatch& pp,
|
||||||
|
const globalIndex& globalFaces,
|
||||||
|
const globalIndex& globalEdges,
|
||||||
|
const globalIndex& globalPoints
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -106,19 +113,30 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct from mesh and faces in mesh. Any addressing to
|
||||||
|
// faces/edges/points on patch are global indices
|
||||||
meshStructure(const polyMesh& mesh, const uindirectPrimitivePatch&);
|
meshStructure(const polyMesh& mesh, const uindirectPrimitivePatch&);
|
||||||
|
|
||||||
|
//- Construct from mesh and faces in mesh and global indexing
|
||||||
|
meshStructure
|
||||||
|
(
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const uindirectPrimitivePatch&,
|
||||||
|
const globalIndex& globalFaces,
|
||||||
|
const globalIndex& globalEdges,
|
||||||
|
const globalIndex& globalPoints
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Is mesh structured?
|
//- Is mesh structured?
|
||||||
inline bool structured() const;
|
inline bool structured() const;
|
||||||
|
|
||||||
//- Cell to patch face
|
//- Cell to (global) patch face
|
||||||
inline const labelList& cellToPatchFaceAddressing() const;
|
inline const labelList& cellToPatchFaceAddressing() const;
|
||||||
|
|
||||||
//- Cell to patch face
|
//- Cell to (global) patch face
|
||||||
inline labelList& cellToPatchFaceAddressing();
|
inline labelList& cellToPatchFaceAddressing();
|
||||||
|
|
||||||
//- Cell to layer
|
//- Cell to layer
|
||||||
@ -127,16 +145,16 @@ public:
|
|||||||
//- Cell to layer
|
//- Cell to layer
|
||||||
inline labelList& cellLayer();
|
inline labelList& cellLayer();
|
||||||
|
|
||||||
//- Face to patch face
|
//- Face to (global) patch face
|
||||||
inline const labelList& faceToPatchFaceAddressing() const;
|
inline const labelList& faceToPatchFaceAddressing() const;
|
||||||
|
|
||||||
//- Face to patch face
|
//- Face to (global) patch face
|
||||||
inline labelList& faceToPatchFaceAddressing();
|
inline labelList& faceToPatchFaceAddressing();
|
||||||
|
|
||||||
//- Face to patch edge
|
//- Face to (global) patch edge
|
||||||
inline const labelList& faceToPatchEdgeAddressing() const;
|
inline const labelList& faceToPatchEdgeAddressing() const;
|
||||||
|
|
||||||
//- Face to patch edge
|
//- Face to (global) patch edge
|
||||||
inline labelList& faceToPatchEdgeAddressing();
|
inline labelList& faceToPatchEdgeAddressing();
|
||||||
|
|
||||||
//- Face to layer
|
//- Face to layer
|
||||||
@ -145,10 +163,10 @@ public:
|
|||||||
//- Face to layer
|
//- Face to layer
|
||||||
inline labelList& faceLayer();
|
inline labelList& faceLayer();
|
||||||
|
|
||||||
//- Point to patch point
|
//- Point to (global) patch point
|
||||||
inline const labelList& pointToPatchPointAddressing() const;
|
inline const labelList& pointToPatchPointAddressing() const;
|
||||||
|
|
||||||
//- Point to patch point
|
//- Point to (global) patch point
|
||||||
inline labelList& pointToPatchPointAddressing();
|
inline labelList& pointToPatchPointAddressing();
|
||||||
|
|
||||||
//- Point to layer
|
//- Point to layer
|
||||||
@ -156,7 +174,6 @@ public:
|
|||||||
|
|
||||||
//- Point to layer
|
//- Point to layer
|
||||||
inline labelList& pointLayer();
|
inline labelList& pointLayer();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user