March 14, 2024, 06:05
|
Finding Cell neighbours using mesh.cellCells() in parallel
|
#1
|
Member
Divyaprakash
Join Date: Jun 2014
Posts: 69
Rep Power: 12
|
Hello everyone,
For my application I need to find cells around a point so that I can perform some operation on them. I need to do this for many such points at every time-step. Currently I am using the following set of lines.
Code:
label cellIndex = mesh.findCell(rr);
labelList appended;
appended.append(cellIndex);
// Info << "Cell Index: " << cellIndex << endl;
// Get the neighbouring cells 4 times
for (int l = 0; l < 4; ++l) {
int nn = appended.size();
for (int m = 0; m < nn; ++m) {
labelList neighbors = mesh.cellCells()[appended[m]];
appended.append(neighbors);
}
// Get rid of repeating values and also sort the array
Foam::inplaceUniqueSort(appended);
}
However, it won't work when I discretize the domain since the neighbours may be located in some other processor. I have gone through the forum and although I found some threads which mention this issue, they haven't been resolved.
So I am asking again if this is possible in newer versions or some alternatives exist to accomplish the above goal.
|
|
|