|
[Sponsors] |
How to count the number of cells of some selected domains? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 10, 2014, 04:06 |
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 |
It's seems pointwise only provide total cell count...but what if I want to know the cell number of some specific domains ?
|
|
December 10, 2014, 10:49 |
|
#2 |
Senior Member
Travis Carrigan
Join Date: Jul 2010
Location: Arlington, TX
Posts: 161
Rep Power: 16 |
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]" } Travis |
|
December 10, 2014, 13:29 |
|
#3 |
New Member
Join Date: Sep 2012
Posts: 5
Rep Power: 14 |
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. |
|
April 9, 2015, 10:44 |
|
#4 |
New Member
anonymous
Join Date: Mar 2015
Location: Trento,Italy
Posts: 5
Rep Power: 11 |
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. |
|
April 10, 2015, 10:56 |
|
#5 |
Senior Member
David Garlisch
Join Date: Jan 2013
Location: Fidelity Pointwise, Cadence Design Systems (Fort Worth, Texas Office)
Posts: 307
Rep Power: 14 |
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] 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 11:13. Reason: added code |
|
April 11, 2015, 04:27 |
|
#6 |
New Member
anonymous
Join Date: Mar 2015
Location: Trento,Italy
Posts: 5
Rep Power: 11 |
Thank you for the quick and exhaustive response.
Regards Victor |
|
Tags |
cell count, pointwise |
|
|
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 |