Skip to content
Snippets Groups Projects
Commit 5bbbcdd5 authored by mattijs's avatar mattijs
Browse files

ENH: syncTools: additional face selection routines

parent 333d37ea
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -27,7 +27,6 @@ License ...@@ -27,7 +27,6 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Determines for every point whether it is coupled and if so sets only one.
Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh) Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
{ {
PackedBoolList isMasterPoint(mesh.nPoints()); PackedBoolList isMasterPoint(mesh.nPoints());
...@@ -72,7 +71,6 @@ Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh) ...@@ -72,7 +71,6 @@ Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
} }
// Determines for every edge whether it is coupled and if so sets only one.
Foam::PackedBoolList Foam::syncTools::getMasterEdges(const polyMesh& mesh) Foam::PackedBoolList Foam::syncTools::getMasterEdges(const polyMesh& mesh)
{ {
PackedBoolList isMasterEdge(mesh.nEdges()); PackedBoolList isMasterEdge(mesh.nEdges());
...@@ -117,7 +115,6 @@ Foam::PackedBoolList Foam::syncTools::getMasterEdges(const polyMesh& mesh) ...@@ -117,7 +115,6 @@ Foam::PackedBoolList Foam::syncTools::getMasterEdges(const polyMesh& mesh)
} }
// Determines for every face whether it is coupled and if so sets only one.
Foam::PackedBoolList Foam::syncTools::getMasterFaces(const polyMesh& mesh) Foam::PackedBoolList Foam::syncTools::getMasterFaces(const polyMesh& mesh)
{ {
PackedBoolList isMasterFace(mesh.nFaces(), 1); PackedBoolList isMasterFace(mesh.nFaces(), 1);
...@@ -145,4 +142,66 @@ Foam::PackedBoolList Foam::syncTools::getMasterFaces(const polyMesh& mesh) ...@@ -145,4 +142,66 @@ Foam::PackedBoolList Foam::syncTools::getMasterFaces(const polyMesh& mesh)
} }
Foam::PackedBoolList Foam::syncTools::getInternalOrMasterFaces
(
const polyMesh& mesh
)
{
PackedBoolList isMasterFace(mesh.nFaces(), 1);
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (pp.coupled())
{
if (!refCast<const coupledPolyPatch>(pp).owner())
{
forAll(pp, i)
{
isMasterFace.unset(pp.start()+i);
}
}
}
else
{
forAll(pp, i)
{
isMasterFace.unset(pp.start()+i);
}
}
}
return isMasterFace;
}
Foam::PackedBoolList Foam::syncTools::getInternalOrCoupledFaces
(
const polyMesh& mesh
)
{
PackedBoolList isMasterFace(mesh.nFaces(), 1);
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (!pp.coupled())
{
forAll(pp, i)
{
isMasterFace.unset(pp.start()+i);
}
}
}
return isMasterFace;
}
// ************************************************************************* // // ************************************************************************* //
...@@ -579,15 +579,25 @@ public: ...@@ -579,15 +579,25 @@ public:
// Other // Other
//- Get per point whether is it master (of a coupled set of points) //- Get per point whether it is uncoupled or a master of a
// coupled set of points
static PackedBoolList getMasterPoints(const polyMesh&); static PackedBoolList getMasterPoints(const polyMesh&);
//- Get per edge whether is it master (of a coupled set of edges) //- Get per edge whether it is uncoupled or a master of a
// coupled set of edges
static PackedBoolList getMasterEdges(const polyMesh&); static PackedBoolList getMasterEdges(const polyMesh&);
//- Get per face whether is it master (of a coupled set of faces) //- Get per face whether it is uncoupled or a master of a
// coupled set of faces
static PackedBoolList getMasterFaces(const polyMesh&); static PackedBoolList getMasterFaces(const polyMesh&);
//- Get per face whether it is internal or a master of a
// coupled set of faces
static PackedBoolList getInternalOrMasterFaces(const polyMesh&);
//- Get per face whether it is internal or coupled
static PackedBoolList getInternalOrCoupledFaces(const polyMesh&);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment