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

How to get the neighbour of one cell?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 12, 2018, 04:12
Question How to get the neighbour of one cell?
  #1
Senior Member
 
LT
Join Date: Dec 2010
Posts: 104
Rep Power: 15
NewKid is on a distinguished road
As shown in the title, this one is about how to get all the neighbour of one cell?
Still in OF 4.0.
NewKid is offline   Reply With Quote

Old   September 12, 2018, 16:19
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
For one cell -- some combination of pseudo code and workable code below. The relevant part is .cellCells(). Searching the code for cellCells() should give you plenty of ideas.

Code:
 //label for cell ,eg. cell 1
label someCell = mesh.Cells[1]

//list of labels for neighbor cells
labelList neighborCells = mesh[someCell].cellCells();
Caelan
clapointe is offline   Reply With Quote

Old   September 12, 2018, 23:21
Smile
  #3
Senior Member
 
LT
Join Date: Dec 2010
Posts: 104
Rep Power: 15
NewKid is on a distinguished road
cellCells() works!
Thank you so much!
NewKid is offline   Reply With Quote

Reply


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
Neighbour cell centre to face distance fportela OpenFOAM Programming & Development 11 May 31, 2018 09:11
[blockMesh] Fatal FOAM Error: does not have neighbour cell face aru.potter OpenFOAM Meshing & Mesh Conversion 2 August 10, 2015 08:32
[General] 2 datas on one plot Akuji ParaView 46 December 1, 2013 14:06
monitoring cell Jane Siemens 2 March 4, 2004 21:01
cell to cell relation CMB Siemens 1 December 4, 2003 04:05


All times are GMT -4. The time now is 19:25.