mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: synctools: get remote cell data
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -481,6 +481,15 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//- Swap to obtain neighbour cell values for all boundary faces
|
||||
template <class T>
|
||||
static void swapBoundaryCellList
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const UList<T>& cellData,
|
||||
List<T>& neighbourCellData
|
||||
);
|
||||
|
||||
// Sparse versions
|
||||
|
||||
//- Synchronize values on selected points.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -1553,6 +1553,45 @@ void Foam::syncTools::syncFaceList
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
void Foam::syncTools::swapBoundaryCellList
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const UList<T>& cellData,
|
||||
List<T>& neighbourCellData
|
||||
)
|
||||
{
|
||||
if (cellData.size() != mesh.nCells())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"syncTools<class T>::swapBoundaryCellList"
|
||||
"(const polyMesh&, const UList<T>&, List<T>&)"
|
||||
) << "Number of cell values " << cellData.size()
|
||||
<< " is not equal to the number of cells in the mesh "
|
||||
<< mesh.nCells() << abort(FatalError);
|
||||
}
|
||||
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
label nBnd = mesh.nFaces()-mesh.nInternalFaces();
|
||||
|
||||
neighbourCellData.setSize(nBnd);
|
||||
|
||||
forAll(patches, patchI)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const labelUList& faceCells = pp.faceCells();
|
||||
forAll(faceCells, i)
|
||||
{
|
||||
label bFaceI = pp.start()+i-mesh.nInternalFaces();
|
||||
neighbourCellData[bFaceI] = cellData[faceCells[i]];
|
||||
}
|
||||
}
|
||||
syncTools::swapBoundaryFaceList(mesh, neighbourCellData);
|
||||
}
|
||||
|
||||
|
||||
template <unsigned nBits>
|
||||
void Foam::syncTools::swapFaceList
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user