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, 10:39
Default How to find the number of points in a boundary?
  #1
New Member
 
Dominic
Join Date: May 2016
Posts: 27
Rep Power: 10
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 09:59.
Verse is offline   Reply With Quote

Old   July 20, 2016, 13:28
Default
  #2
Member
 
Jerry
Join Date: Oct 2013
Location: Salt Lake City, UT, USA
Posts: 52
Rep Power: 13
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, 14:45
Default
  #3
New Member
 
Dominic
Join Date: May 2016
Posts: 27
Rep Power: 10
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
Wind turbine simulation Saturn CFX 60 July 17, 2024 06:45
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 08:56
Decomposing meshes Tobi OpenFOAM Pre-Processing 22 February 24, 2023 10:23
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 06:38
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 08:36


All times are GMT -4. The time now is 20:18.