mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
face master
This commit is contained in:
@ -169,7 +169,7 @@ Foam::PackedList<1> Foam::syncTools::getMasterPoints(const polyMesh& mesh)
|
||||
else
|
||||
{
|
||||
FatalErrorIn("syncTools::getMasterPoints(const polyMesh&)")
|
||||
<< "Cannot handle patch " << patches[patchI].name()
|
||||
<< "Cannot handle coupled patch " << patches[patchI].name()
|
||||
<< " of type " << patches[patchI].type()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -290,7 +290,7 @@ Foam::PackedList<1> Foam::syncTools::getMasterEdges(const polyMesh& mesh)
|
||||
else
|
||||
{
|
||||
FatalErrorIn("syncTools::getMasterEdges(const polyMesh&)")
|
||||
<< "Cannot handle patch " << patches[patchI].name()
|
||||
<< "Cannot handle coupled patch " << patches[patchI].name()
|
||||
<< " of type " << patches[patchI].type()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -314,6 +314,54 @@ Foam::PackedList<1> Foam::syncTools::getMasterEdges(const polyMesh& mesh)
|
||||
}
|
||||
|
||||
|
||||
// Determines for every face whether it is coupled and if so sets only one.
|
||||
Foam::PackedList<1> Foam::syncTools::getMasterFaces(const polyMesh& mesh)
|
||||
{
|
||||
PackedList<1> isMasterFace(mesh.nFaces(), 1);
|
||||
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
forAll(patches, patchI)
|
||||
{
|
||||
if (patches[patchI].coupled())
|
||||
{
|
||||
if (Pstream::parRun() && isA<processorPolyPatch>(patches[patchI]))
|
||||
{
|
||||
const processorPolyPatch& pp =
|
||||
refCast<const processorPolyPatch>(patches[patchI]);
|
||||
|
||||
if (!pp.owner())
|
||||
{
|
||||
forAll(pp, i)
|
||||
{
|
||||
isMasterFace.set(pp.start()+i, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (isA<cyclicPolyPatch>(patches[patchI]))
|
||||
{
|
||||
const cyclicPolyPatch& pp =
|
||||
refCast<const cyclicPolyPatch>(patches[patchI]);
|
||||
|
||||
for (label i = pp.size()/2; i < pp.size(); i++)
|
||||
{
|
||||
isMasterFace.set(pp.start()+i, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn("syncTools::getMasterFaces(const polyMesh&)")
|
||||
<< "Cannot handle coupled patch " << patches[patchI].name()
|
||||
<< " of type " << patches[patchI].type()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isMasterFace;
|
||||
}
|
||||
|
||||
|
||||
template <>
|
||||
void Foam::syncTools::separateList
|
||||
(
|
||||
|
||||
@ -226,9 +226,12 @@ public:
|
||||
//- Get per point whether is it master (of a coupled set of points)
|
||||
static PackedList<1> getMasterPoints(const polyMesh&);
|
||||
|
||||
//- Get per edge whether is it master (of a coupled set of edge)
|
||||
//- Get per edge whether is it master (of a coupled set of edges)
|
||||
static PackedList<1> getMasterEdges(const polyMesh&);
|
||||
|
||||
//- Get per face whether is it master (of a coupled set of faces)
|
||||
static PackedList<1> getMasterFaces(const polyMesh&);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user