CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Mesh Generation & Pre-Processing Software > Pointwise & Gridgen

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

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By tcarrigan
  • 1 Post By jrhoads
  • 1 Post By dgarlisch

Reply
 
LinkBack Thread Tools Search this Thread 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: 22
Rep Power: 13
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: 161
Rep Power: 16
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
Manager, Business Development
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: 14
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, 10:44
Default
  #4
vic
New Member
 
anonymous
Join Date: Mar 2015
Location: Trento,Italy
Posts: 5
Rep Power: 11
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, 10:56
Default
  #5
Senior Member
 
David Garlisch
Join Date: Jan 2013
Location: Fidelity Pointwise, Cadence Design Systems (Fort Worth, Texas Office)
Posts: 307
Rep Power: 14
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 |
xq712000 likes this.

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

Old   April 11, 2015, 04:27
Default
  #6
vic
New Member
 
anonymous
Join Date: Mar 2015
Location: Trento,Italy
Posts: 5
Rep Power: 11
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


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 10:23
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 16:03
[CAD formats] how to call my .stl file in the terminal izna OpenFOAM Meshing & Mesh Conversion 21 July 9, 2013 17:17
meshing F1 front wing Steve FLUENT 0 April 17, 2003 13:37


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