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

The confusion of the meanings of `patchi` and `facei`

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2021, 21:29
Default The confusion of the meanings of `patchi` and `facei`
  #1
New Member
 
Zhang Qibo
Join Date: Oct 2021
Posts: 7
Rep Power: 4
Gareth_CN is on a distinguished road
Hello,

I have some doubts about the meaning of these two parameters: patchi and facei.
In my understanding, `patchi` points to the sequence number of boundary, for example 'INLET', and `facei` points to the sequence number of each mesh face on the 'INLET' boundary.

Is there something wrong with my understanding? Hope someone could give me some advice.

All regards!

Gareth
Gareth_CN is offline   Reply With Quote

Old   November 20, 2021, 06:01
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
It is even simpler than you think. In most (all?) places these are simply local loop variables. Instead of writing a loop "for (int i=...)" and another loop with "for (int j=...)" and then trying to remember what "i" and "j" represent within the loops, they are given more meaning names. Eg, "for (int patchi=...)" etc.

The next part is of course what you are indexing into. The patches are arranged internally as a list. All "normal" patches in the same sequence on all processors, followed by all of the processor-processor communication patches (obviously not the same on all processors). There is also a level of redundancy built in. Each patch also has an index() value, so it knows where it is located in the list.
olesen is offline   Reply With Quote

Old   November 22, 2021, 02:37
Default
  #3
New Member
 
Zhang Qibo
Join Date: Oct 2021
Posts: 7
Rep Power: 4
Gareth_CN is on a distinguished road
Hello Olesen!
Thank you very much for your precise advice. I will look into it.

Gareth
Gareth_CN is offline   Reply With Quote

Reply

Tags
patchi;facei


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



All times are GMT -4. The time now is 13:00.