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

How to find the number of points in a boundary?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Jerryfan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 19, 2016, 09:39
Default How to find the number of points in a boundary?
  #1
New Member
 
Dominic
Join Date: May 2016
Posts: 27
Rep Power: 9
Verse is on a distinguished road
Hello, I was wondering if someone could help me with a simple problem - I'm looking to be able to obtain the total number of points in a certain boundary (say, "wall"). I know to obtain the total number of points one needs, say:

Code:
int nPoints = mesh.nPoints();
But how do I do this for just one specific boundary?

Last edited by Verse; August 18, 2016 at 08:59.
Verse is offline   Reply With Quote

Old   July 20, 2016, 12:28
Default
  #2
Member
 
Jerry
Join Date: Oct 2013
Location: Salt Lake City, UT, USA
Posts: 52
Rep Power: 12
Jerryfan is on a distinguished road
Hi Verse,


The following is my idea, I hope it can help you.

Quote:
//First of all, you need to get the patch you are interested in, for example, "movingwall"
const label patchI = mesh.findPatchID("movingwall");
const fvPatch& patch = mesh.boundary()[patchI];
//Then return the total points in the patch
const label ntPoints = patch.nPoints();
Verse likes this.
Jerryfan is offline   Reply With Quote

Old   July 20, 2016, 13:45
Default
  #3
New Member
 
Dominic
Join Date: May 2016
Posts: 27
Rep Power: 9
Verse is on a distinguished road
Thanks Jerry! Works perfectly, really appreciate it.
Verse 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
Decomposing meshes Tobi OpenFOAM Pre-Processing 22 February 24, 2023 09:23
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 91 December 21, 2022 04:50
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
Wind turbine simulation Saturn CFX 58 July 3, 2020 01:13
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36


All times are GMT -4. The time now is 02:53.