mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Adding a wallFaces list to the DirectInteractionList specifying the
wall patch faces that each cell is potentially in range of.
This commit is contained in:
@ -37,7 +37,7 @@ void Foam::DirectInteractionList<ParticleType>::buildDirectInteractionList
|
|||||||
{
|
{
|
||||||
Info<< " Building list of direct interaction neighbours" << endl;
|
Info<< " Building list of direct interaction neighbours" << endl;
|
||||||
|
|
||||||
const polyMesh& mesh(il_.mesh());
|
const polyMesh& mesh = il_.mesh();
|
||||||
|
|
||||||
List<DynamicList<label> > DirectInteractionList(mesh.nCells());
|
List<DynamicList<label> > DirectInteractionList(mesh.nCells());
|
||||||
|
|
||||||
@ -294,9 +294,94 @@ void Foam::DirectInteractionList<ParticleType>::buildDirectInteractionList
|
|||||||
|
|
||||||
// sorting DILs
|
// sorting DILs
|
||||||
|
|
||||||
forAll((*this), dIL)
|
forAll((*this), dilI)
|
||||||
{
|
{
|
||||||
sort((*this)[dIL]);
|
sort((*this)[dilI]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParticleType>
|
||||||
|
void Foam::DirectInteractionList<ParticleType>::buildWallFaces()
|
||||||
|
{
|
||||||
|
Info<< " Building list of wall faces in range of cells" << endl;
|
||||||
|
|
||||||
|
const polyMesh& mesh = il_.mesh();
|
||||||
|
|
||||||
|
// DynamicLists for data gathering
|
||||||
|
DynamicList<label> thisCellOnlyWallFaces;
|
||||||
|
DynamicList<label> otherCellOnlyWallFaces;
|
||||||
|
|
||||||
|
forAll(wallFaces_, thisCellI)
|
||||||
|
{
|
||||||
|
// Find all of the wall faces for the current cell
|
||||||
|
|
||||||
|
const labelList& thisCellFaces = mesh.cells()[thisCellI];
|
||||||
|
|
||||||
|
labelList& thisCellWallFaces = wallFaces_[thisCellI];
|
||||||
|
|
||||||
|
thisCellOnlyWallFaces.clear();
|
||||||
|
|
||||||
|
forAll(thisCellFaces, tCFI)
|
||||||
|
{
|
||||||
|
label faceI = thisCellFaces[tCFI];
|
||||||
|
|
||||||
|
if (!mesh.isInternalFace(faceI))
|
||||||
|
{
|
||||||
|
label patchI = mesh.boundaryMesh().whichPatch(faceI);
|
||||||
|
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||||
|
|
||||||
|
// move reference point for wall
|
||||||
|
if (isA<wallPolyPatch>(patch))
|
||||||
|
{
|
||||||
|
thisCellOnlyWallFaces.append(faceI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add all the found wall faces to this cell's list, and
|
||||||
|
// retain the wall faces for this cell only to add to other
|
||||||
|
// cells.
|
||||||
|
thisCellWallFaces.append(thisCellOnlyWallFaces);
|
||||||
|
|
||||||
|
// Loop over all of the cells in the DIL for this cell, adding
|
||||||
|
// the wallFaces for this cell to the other cell's wallFace
|
||||||
|
// list, and all of the wallFaces for the other cell to this
|
||||||
|
// cell's list
|
||||||
|
|
||||||
|
const labelList& dil = (*this)[thisCellI];
|
||||||
|
|
||||||
|
forAll(dil, i)
|
||||||
|
{
|
||||||
|
label otherCellI = dil[i];
|
||||||
|
|
||||||
|
const labelList& otherCellFaces = mesh.cells()[otherCellI];
|
||||||
|
|
||||||
|
labelList& otherCellWallFaces = wallFaces_[otherCellI];
|
||||||
|
|
||||||
|
otherCellOnlyWallFaces.clear();
|
||||||
|
|
||||||
|
forAll(otherCellFaces, oCFI)
|
||||||
|
{
|
||||||
|
label faceI = otherCellFaces[oCFI];
|
||||||
|
|
||||||
|
if (!mesh.isInternalFace(faceI))
|
||||||
|
{
|
||||||
|
label patchI = mesh.boundaryMesh().whichPatch(faceI);
|
||||||
|
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||||
|
|
||||||
|
// move reference point for wall
|
||||||
|
if (isA<wallPolyPatch>(patch))
|
||||||
|
{
|
||||||
|
otherCellOnlyWallFaces.append(faceI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
thisCellWallFaces.append(otherCellOnlyWallFaces);
|
||||||
|
|
||||||
|
otherCellWallFaces.append(thisCellOnlyWallFaces);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,7 +396,8 @@ Foam::DirectInteractionList<ParticleType>::DirectInteractionList
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
labelListList(il.mesh().nCells()),
|
labelListList(il.mesh().nCells()),
|
||||||
il_(il)
|
il_(il),
|
||||||
|
wallFaces_(il.mesh().nCells())
|
||||||
{
|
{
|
||||||
if ((*this).size() > 1)
|
if ((*this).size() > 1)
|
||||||
{
|
{
|
||||||
@ -324,6 +410,8 @@ Foam::DirectInteractionList<ParticleType>::DirectInteractionList
|
|||||||
|
|
||||||
(*this)[0].setSize(0);
|
(*this)[0].setSize(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildWallFaces();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -334,7 +422,8 @@ Foam::DirectInteractionList<ParticleType>::DirectInteractionList
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
labelListList(il.mesh().nCells()),
|
labelListList(il.mesh().nCells()),
|
||||||
il_(il)
|
il_(il),
|
||||||
|
wallFaces_(il.mesh().nCells())
|
||||||
{
|
{
|
||||||
Info<< " Read DirectInteractionList from disk not implemented" << endl;
|
Info<< " Read DirectInteractionList from disk not implemented" << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,8 +59,13 @@ class DirectInteractionList
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
//- A reference to the InteractionLists object holding this object
|
||||||
const InteractionLists<ParticleType>& il_;
|
const InteractionLists<ParticleType>& il_;
|
||||||
|
|
||||||
|
//- Data specifying which patch faces of type "wall" are in range
|
||||||
|
// of each cell
|
||||||
|
labelListList wallFaces_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -69,6 +74,8 @@ class DirectInteractionList
|
|||||||
bool pointPointListBuild
|
bool pointPointListBuild
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void buildWallFaces();
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
DirectInteractionList(const DirectInteractionList&);
|
DirectInteractionList(const DirectInteractionList&);
|
||||||
|
|
||||||
@ -103,6 +110,8 @@ public:
|
|||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
|
inline const labelListList& wallFaces() const;
|
||||||
|
|
||||||
inline const InteractionLists<ParticleType>& il() const;
|
inline const InteractionLists<ParticleType>& il() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,14 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ParticleType>
|
||||||
|
inline const Foam::labelListList&
|
||||||
|
Foam::DirectInteractionList<ParticleType>::wallFaces() const
|
||||||
|
{
|
||||||
|
return wallFaces_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ParticleType>
|
template<class ParticleType>
|
||||||
inline const Foam::InteractionLists<ParticleType>&
|
inline const Foam::InteractionLists<ParticleType>&
|
||||||
Foam::DirectInteractionList<ParticleType>::il() const
|
Foam::DirectInteractionList<ParticleType>::il() const
|
||||||
|
|||||||
@ -156,7 +156,7 @@ void Foam::ReferredCell<ParticleType>::locallyMapFaceList
|
|||||||
{
|
{
|
||||||
const labelList& sourceCellFace(sourceCellFaces[sCF]);
|
const labelList& sourceCellFace(sourceCellFaces[sCF]);
|
||||||
|
|
||||||
labelList& localFace(faces_[sCF]);
|
face& localFace(faces_[sCF]);
|
||||||
|
|
||||||
localFace.setSize(sourceCellFace.size());
|
localFace.setSize(sourceCellFace.size());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user