{"id":164604,"date":"2023-03-17T08:58:09","date_gmt":"2023-03-17T08:58:09","guid":{"rendered":"\/knowledge\/forums\/topic\/using-a-cfd-post-perl-script-how-can-i-determine-if-a-point-is-in-the-domain\/"},"modified":"2023-07-31T12:25:54","modified_gmt":"2023-07-31T12:25:54","slug":"using-a-cfd-post-perl-script-how-can-i-determine-if-a-point-is-in-the-domain","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/knowledge\/forums\/topic\/using-a-cfd-post-perl-script-how-can-i-determine-if-a-point-is-in-the-domain\/","title":{"rendered":"Using a CFD-Post Perl script, how can I determine if a point is in the domain?"},"content":{"rendered":"<p>To see if a point is inside a domain, you could check whether the nearest vertex parameter is defined for the Point. When inside the domain, CFD-Post populates this parameter with the nearest vertex. If the point is outside the domain, it will still find the nearest point but only within a limited tolerance (~0.01 x Mesh Extents by default)  The parameter name is &#8220;Nearest Node Number&#8221; but it&#8217;s a hidden CCL parameter, so you won&#8217;t see it in the CCL editor. If the point is too far from the domain to find the nearest node, the parameter value is -1. So any positive value indicates the point is inside one of the domains in which it is defined.   The Perl script for this is:  !$nearestNode = getValue(&#8216;Point 1&#8242;,&#8217;Nearest Node Number&#8217;); !    if ($nearestNode>0) { !        $inside = &#8216;true&#8217;; !        print(&#8220;I&#8217;m in!n&#8221;); !    } else { !        $inside = &#8216;false&#8217;; !        print(&#8220;I&#8217;m out!n&#8221;); !}<\/p>\n","protected":false},"template":"","class_list":["post-164604","topic","type-topic","status-publish","hentry","topic-tag-2022-r1","topic-tag-cfd-post","topic-tag-fluid-dynamics","topic-tag-perl-and-power-syntax","topic-tag-post-processing"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_wp_page_template":["default"],"_bbp_last_active_time":["3-15-2023  20:20:51"],"_bbp_forum_id":["27796"],"_bbp_author_ip":["23.56.168.180"],"_btv_view_count":["593"],"siebel_km_number":["2067881"],"product_version":["2022 R1"],"km_published_date":["2022-06-01T00:00:00.000Z"],"family":["Fluid Dynamics"],"application_name":["CFD-Post"]},"test":"articlesansys-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/164604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/topics\/164604\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/knowledge\/wp-json\/wp\/v2\/media?parent=164604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}