CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Finding Cell neighbours using mesh.cellCells() in parallel

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 14, 2024, 06:05
Default Finding Cell neighbours using mesh.cellCells() in parallel
  #1
Member
 
Divyaprakash
Join Date: Jun 2014
Posts: 69
Rep Power: 11
Divyaprakash is on a distinguished road
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.
Divyaprakash is offline   Reply With Quote

Reply

Tags
cellcells(), neighbours, parallel


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sloshingTank3D6DoF failed to run in parallel phsieh2005 OpenFOAM Running, Solving & CFD 1 May 18, 2023 23:51
Finding a cell closest to a point Mohammad74 Fluent UDF and Scheme Programming 2 May 24, 2022 08:17
UDF in case with DPM modle POSTHU Fluent UDF and Scheme Programming 0 March 3, 2021 07:21
Journal file error magicalmarshmallow FLUENT 3 April 4, 2014 12:25
finding the size of smallest cell cfdiscool FLUENT 6 June 18, 2013 05:20


All times are GMT -4. The time now is 04:07.