{"id":2108,"date":"2024-01-19T23:31:08","date_gmt":"2024-01-20T07:31:08","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=2108"},"modified":"2024-01-20T01:06:38","modified_gmt":"2024-01-20T09:06:38","slug":"412-calculate-average-element-size-of-quad-and-tria-elements-using-tcl-script-in-hypermesh","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2024\/01\/412-calculate-average-element-size-of-quad-and-tria-elements-using-tcl-script-in-hypermesh\/","title":{"rendered":"#412 Calculate average element size of QUAD and TRIA elements using tcl script in HyperMesh"},"content":{"rendered":"<p>Average element size is calculated as follows through command hm_getaverageelemsize:<br \/>\nQUAD elements:  average size of one element = sqrt(1\/2 * (longest diagonal) * (sum of the parallel altitudes))<br \/>\nTRIA elements:  average size of one element = sqrt(area)<br \/>\n# The total average size is then calculated by summing each average size and dividing by the number of elements considered.<br \/>\n# Value is rounded to 3 digits. Change parameter 3 of command to 1 to deactivate rounding.<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nhm_getaverageelemsize mark_id ?panel_sensitive? ?round?\r\n<\/pre>\n<p># mark_id = The ID of the mark containing the shell elements.<br \/>\n# panel_sensitive = can be used when multiple panel levels have been pushed, either using the shortcut function keys, or the hm_pushpanel command. This option determines whether to use the<br \/>\n# current panel or the previous panel for the operation. This option is relevant only when the mark has been created from a panel entity selector under the above conditions. Valid options are:<br \/>\n# panel_sensitive = 0 &#8211; Use the previous panel.<br \/>\n# panel_sensitive = 1 &#8211; Use the current panel (default).<br \/>\n# round_to = 0 &#8211; Round up to 3 significant digits (default).<br \/>\n# round_to = 1 &#8211; Do not round.<\/p>\n<p>To get the average element size for elements 1-200:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n*createmark elems 1 1-200\r\nset elem_average &#x5B;hm_getaverageelemsize 1 1 0]\r\nputs &quot;Average element size = $elem_average&quot;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>test<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"yes","_lmt_disable":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[24,27],"tags":[],"class_list":["post-2108","post","type-post","status-publish","format-standard","hentry","category-hypermesh","category-tcl"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-y0","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":2235,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/06\/432-hypermesh-tcl-script-to-mark-and-print-all-adjacent-element-ids\/","url_meta":{"origin":2108,"position":0},"title":"#432 Hypermesh tcl script to mark and print all adjacent element IDs","author":"gantovnik","date":"2024-06-30","format":false,"excerpt":"[code language=\"python\"] *createmark elements 1 \"all\" *numbersmark elements 1 0 *clearmark elems 1 *clearmark elems 2 *createmarkpanel elems 1 \"Select elements\" set selected [hm_getmark elems 1] *setoption force_text_black=1 *setoption element_color_mode=2 *numbersmark elements 1 1 foreach ID $selected { puts \"Selected elements ID: $ID\" #select attached *createmark elems 1 $ID *findmark\u2026","rel":"","context":"In &quot;HyperMesh&quot;","block_context":{"text":"HyperMesh","link":"https:\/\/gantovnik.com\/bio-tips\/category\/hypermesh\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/06\/ex432.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/06\/ex432.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/06\/ex432.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/06\/ex432.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/06\/ex432.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":2032,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/01\/403-get-nodes-for-all-elements-in-the-fem-model-in-hypermesh-using-tcl-script\/","url_meta":{"origin":2108,"position":1},"title":"#403 Get nodes for all elements in the FEM model in HyperMesh using tcl script","author":"gantovnik","date":"2024-01-13","format":false,"excerpt":"ex403.tcl [code language=\"python\"] set script_path [ file dirname [ file normalize [ info script ] ] ] puts $script_path cd $script_path pwd *createmark elems 1 all set elemList [ hm_getmark elements 1 ] *clearmark elements 1 set outfile [open \"ex403.txt\" w] foreach elem_id $elemList { # Get the list of\u2026","rel":"","context":"In &quot;HyperMesh&quot;","block_context":{"text":"HyperMesh","link":"https:\/\/gantovnik.com\/bio-tips\/category\/hypermesh\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":760,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/10\/127-create-rbe3-element-using-hypermesh-tcl\/","url_meta":{"origin":2108,"position":2},"title":"#127 Create RBE3 element using tcl in HyperMesh","author":"gantovnik","date":"2020-10-29","format":false,"excerpt":"#127 Create RBE3 element using HyperMesh tcl To create an RBE3 element with dependent node 100 and independent nodes 101,102, and 103 with all of the nodes having all six degrees of freedom and a weight of 1.23 [code language=\"python\"] *createmark nodes 1 101 102 103 *createarray 3 123456 123456\u2026","rel":"","context":"In &quot;HyperMesh&quot;","block_context":{"text":"HyperMesh","link":"https:\/\/gantovnik.com\/bio-tips\/category\/hypermesh\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2124,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/02\/413-1d-elements-in-hypermesh\/","url_meta":{"origin":2108,"position":3},"title":"#413 1D elements in HyperMesh","author":"gantovnik","date":"2024-02-05","format":false,"excerpt":"Bar elements: Bar2 = Configuration 60 (1st order) elements with 2 nodes used to model axial, bending, and torsion behavior. Bar2 elements have a property reference, an orientation vector, offset vectors and ends A and B, and pin flags at ends A and B. Bar3 = Configuration 63 - 1D\u2026","rel":"","context":"In &quot;fem&quot;","block_context":{"text":"fem","link":"https:\/\/gantovnik.com\/bio-tips\/category\/fem\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1353,"url":"https:\/\/gantovnik.com\/bio-tips\/2022\/01\/133-create-vectors-and-planes-using-tcl-in-hypermesh-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2\/","url_meta":{"origin":2108,"position":4},"title":"#256 Create a list of elements in tcl","author":"gantovnik","date":"2022-01-05","format":false,"excerpt":"Example: [code language=\"python\"] set t \"0.1 0.2 0.3\" set i 0; foreach j $t { puts \"$j is element number $i of list t\" incr i; } [\/code] Result: [code language=\"python\"] 0.1 is element number 0 of list t 0.2 is element number 1 of list t 0.3 is element\u2026","rel":"","context":"In &quot;tcl&quot;","block_context":{"text":"tcl","link":"https:\/\/gantovnik.com\/bio-tips\/category\/tcl\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4445,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/09\/447-command-loadsize-in-tcl-for-hypermesh\/","url_meta":{"origin":2108,"position":5},"title":"#447 Command *loadsize in tcl for HyperMesh","author":"gantovnik","date":"2024-09-16","format":false,"excerpt":"This command is deprecated but can be found in old tcl scripts. It is replaced with setoption load_size_magnitude, *setoption load_size_type,\u00a0setoption load_size_uniform *loadsize Sets the display size of loads. Syntax *loadsize config size option scale Inputs config The load config to set. Valid values are: 1 \u2013 forces 2 \u2013 moments\u2026","rel":"","context":"In &quot;HyperMesh&quot;","block_context":{"text":"HyperMesh","link":"https:\/\/gantovnik.com\/bio-tips\/category\/hypermesh\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/2108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/comments?post=2108"}],"version-history":[{"count":9,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/2108\/revisions"}],"predecessor-version":[{"id":2121,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/2108\/revisions\/2121"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=2108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=2108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=2108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}