CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Pointwise & Gridgen

How to count the number of cells of some selected domains?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 2 Post By tcarrigan
  • 1 Post By jrhoads

Reply
 
LinkBack Thread Tools Display Modes
Old   December 10, 2014, 04:06
Question How to count the number of cells of some selected domains?
  #1
New Member
 
XieQing
Join Date: Mar 2013
Location: Capital of Qin Dynasty
Posts: 10
Rep Power: 4
xq712000 is on a distinguished road
It's seems pointwise only provide total cell count...but what if I want to know the cell number of some specific domains ?
xq712000 is offline   Reply With Quote

Old   December 10, 2014, 10:49
Default
  #2
Senior Member
 
Travis Carrigan
Join Date: Jul 2010
Location: Arlington, TX
Posts: 127
Rep Power: 7
tcarrigan is on a distinguished road
Hello,

You can accomplish this easily using a Glyph script. To get the cell count of an initialized structured or unstructured domain, use the following code:

Code:
package require PWI_Glyph

set sm [pw::Display createSelectionMask -requireDomain {Defined}]
pw::Display getSelectedEntities -selectionmask $sm ents

foreach ent $ents(Domains) {
    puts "[$ent getName] cell count: [$ent getCellCount]"
}
Be sure to save this as a .glf script. You'll need to be running Pointwise V17.2R2 to take advantage of the new getSelectedEntities command.

Travis
cnsidero and xq712000 like this.
__________________
Travis Carrigan
Senior Engineer
Pointwise, Inc.
tcarrigan is offline   Reply With Quote

Old   December 10, 2014, 13:29
Default
  #3
New Member
 
Join Date: Sep 2012
Posts: 5
Rep Power: 4
jrhoads is on a distinguished road
This information is also available (and sortable) in the List panel. Click the arrow beside Domains. There are columns for the number of points (nodes) and cells for each domain. Clicking the column header will sort by that field; useful for finding very small domains.

If you want a cumulative count of several domains though, scripting is the way to go as Travis pointed out.
xq712000 likes this.
__________________
John Rhoads, Ph.D.
Senior Engineer
Pointwise, Inc.
jrhoads is offline   Reply With Quote

Old   April 9, 2015, 09:44
Default
  #4
vic
New Member
 
anonymous
Join Date: Mar 2015
Posts: 4
Rep Power: 2
vic is on a distinguished road
Hi,
sorry bui I'd want to know the total amount of cells instead, while using your script it shows a list of the selected domains with the related number of cells,
without computing the sum.
Could you help me ?
Thanks
Victor
PS I'm fairly new at pw.
vic is offline   Reply With Quote

Old   April 10, 2015, 09:56
Default
  #5
Member
 
David Garlisch
Join Date: Jan 2013
Location: Pointwise HQ
Posts: 83
Rep Power: 4
dgarlisch is on a distinguished road
use the Grid / Cell count... menu

or if you want the total cell count for the selected domains, you can change the script to:

Code:
package require PWI_Glyph

set sm [pw::Display createSelectionMask -requireDomain {Defined}]
pw::Display getSelectedEntities -selectionmask $sm ents

set dash "-----------------------------------------------"
set fmt "| %-20.20s | %8.8s |"

set totalCellCount 0
puts "Cell counts:"
puts [format $fmt {Entity name} {Count}]
puts [format $fmt $dash $dash]
foreach ent $ents(Domains) {
    set domCellCount [$ent getCellCount]
    puts [format $fmt [$ent getName] $domCellCount]
    incr totalCellCount $domCellCount
}
puts [format $fmt $dash $dash]
puts [format $fmt {Total} $totalCellCount]
Generates something like:

Code:
Script: Cell counts:
Script: | Entity name          |    Count |
Script: | -------------------- | -------- |
Script: | dom-15               |        4 |
Script: | dom-2                |        4 |
Script: | dom-5                |        4 |
Script: | dom-9                |        4 |
Script: | dom-33               |        8 |
Script: | dom-4                |        4 |
Script: | -------------------- | -------- |
Script: | Total                |       28 |

Last edited by dgarlisch; April 10, 2015 at 10:13. Reason: added code
dgarlisch is offline   Reply With Quote

Old   April 11, 2015, 03:27
Default
  #6
vic
New Member
 
anonymous
Join Date: Mar 2015
Posts: 4
Rep Power: 2
vic is on a distinguished road
Thank you for the quick and exhaustive response.
Regards
Victor
vic is offline   Reply With Quote

Reply

Tags
cell count, pointwise

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Decomposing meshes Tobi OpenFOAM Pre-Processing 1 September 9, 2014 05:30
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 15:03
how to call my .stl file in the terminal izna OpenFOAM Meshing & Mesh Conversion 21 July 9, 2013 16:17
No layers in a small gap bobburnquist OpenFOAM Native Meshers: snappyHexMesh and Others 2 November 25, 2012 09:54
meshing F1 front wing Steve FLUENT 0 April 17, 2003 12:37


All times are GMT -4. The time now is 01:59.