


{"id":285117,"date":"2023-05-22T11:37:46","date_gmt":"2023-05-22T11:37:46","guid":{"rendered":"\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/"},"modified":"2023-05-22T11:37:46","modified_gmt":"2023-05-22T11:37:46","slug":"topology-inverse-design-mesh-interpolation","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/","title":{"rendered":"Topology inverse design mesh interpolation"},"content":{"rendered":"<p>Dear ansys team .<br \/>TLDR: why does topological optimization use the spatial interpolation of &#8220;specified position&#8221;, instead of &#8220;nearest mesh cell&#8221;, it creates errors.&nbsp;<\/p>\n<p>Long:<br \/>I am learning how to use the topological optimization in lumopt + FDTD. when working on my project, I stumbled upon FDTD mesh grid vs optimised geomtry error, which I also found how to recreate using the following example.<\/p>\n<p>following the 2d example in y splitter topology example &nbsp;<a href=\"https:\/\/optics.ansys.com\/hc\/en-us\/articles\/1500007182141-Inverse-Design-of-a-Splitter-Using-Topology-Optimization\">link <\/a>the example runs ok as-is.&nbsp;<br \/>However, when changing line 26 in file &#8220;splitter_base_2D_TE_topology.lsf&#8221; to<br \/>set(&#8216;x max&#8217;,-opt_size_x\/2 &#8211; 0.5e-7);&nbsp;<br \/>which means making the input waveguide to be outside of the optimization area, I get this error:<br \/><span>&nbsp; File &#8220;C:\\Program Files\\Lumerical\\v231\\api\\python\\lumopt\\geometries\\topology.py&#8221;, line 158, in check_param_count_matches_bounds&nbsp;<\/span><br \/><span>UserWarning: Project file structure &#8216;initial_guess&#8217; reports 13832 parameters where expected 13741. This can occur when the number of x, y coordinates specificed to LumOpt do not match the dimensions of the FDTD grid. Try using similar or divisible delta values (size of a pixel) across all the axes.<\/span><\/p>\n<p>Note that the amount of displacment is important, -0.5e-7 will cause the error, whereas -1e-7 wont.&nbsp;<br \/>Also note, I didnt change the optimization area, the FDTD size, the mesh grid setting or anything relevant. just the WG<br \/><span style=\"text-decoration: underline\">my debugging:<br \/><\/span>after adding a breakpoint in topology.py, line 185<br \/>I noticed that indeed the &#8220;opt_fields&#8221; x resolution is of 152, whereas the x_geo resolution is of 151.<br \/>I think that somehow changing the wg position changes the mesh.<br \/><span style=\"text-decoration: underline\">possible fix I found:<br \/><\/span>change lines 366-367 in topology.py to:&nbsp;<\/p>\n<p>set_spatial_interp(sim.fdtd, &#8216;opt_fields&#8217;, &#8216;nearest mesh cell&#8217;)<br \/>set_spatial_interp(sim.fdtd, &#8216;opt_fields_index&#8217;, &#8216;nearest mesh cell&#8217;).<br \/>Then optimization runs OK.<\/p>\n<p><span style=\"text-decoration: underline\">My question<\/span>: why does the spatial interpolation of opt_fields &amp; opt_fields_index set to &#8220;specifed postion&#8221;? The goal should be to force that three data positions are identical: &nbsp;<\/p>\n<ul>\n<li>opt_fields (for gradient calcualtion)<\/li>\n<li>opt_fields_index (for reading the eps )<\/li>\n<li>import object(through which the epsilon is changed)<\/li>\n<\/ul>\n<p>&nbsp;Then why not force all three to &#8220;snap&#8221; to the same grid? is it because I cant set the import object to snap to the FDTD mesh?<br \/>Thanks, Noam<\/p>\n","protected":false},"template":"","class_list":["post-285117","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Dear ansys team .TLDR: why does topological optimization use the spatial interpolation of &quot;specified position&quot;, instead of &quot;nearest mesh cell&quot;, it creates errors. Long:I am learning how to use the topological optimization in lumopt + FDTD. when working on my project, I stumbled upon FDTD mesh grid vs optimised geomtry error, which I also found how\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ansys Learning Forum | Ansys Innovation Space\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Topology inverse design mesh interpolation | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"Dear ansys team .TLDR: why does topological optimization use the spatial interpolation of &quot;specified position&quot;, instead of &quot;nearest mesh cell&quot;, it creates errors. Long:I am learning how to use the topological optimization in lumopt + FDTD. when working on my project, I stumbled upon FDTD mesh grid vs optimised geomtry error, which I also found how\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-05-22T11:37:46+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-05-22T11:37:46+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Topology inverse design mesh interpolation | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Dear ansys team .TLDR: why does topological optimization use the spatial interpolation of &quot;specified position&quot;, instead of &quot;nearest mesh cell&quot;, it creates errors. Long:I am learning how to use the topological optimization in lumopt + FDTD. when working on my project, I stumbled upon FDTD mesh grid vs optimised geomtry error, which I also found how\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/topology-inverse-design-mesh-interpolation\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/topology-inverse-design-mesh-interpolation\\\/#listItem\",\"name\":\"Topology inverse design mesh interpolation\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/topology-inverse-design-mesh-interpolation\\\/#listItem\",\"position\":3,\"name\":\"Topology inverse design mesh interpolation\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/topology-inverse-design-mesh-interpolation\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/topology-inverse-design-mesh-interpolation\\\/\",\"name\":\"Topology inverse design mesh interpolation | Ansys Learning Forum\",\"description\":\"Dear ansys team .TLDR: why does topological optimization use the spatial interpolation of \\\"specified position\\\", instead of \\\"nearest mesh cell\\\", it creates errors. Long:I am learning how to use the topological optimization in lumopt + FDTD. when working on my project, I stumbled upon FDTD mesh grid vs optimised geomtry error, which I also found how\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/topology-inverse-design-mesh-interpolation\\\/#breadcrumblist\"},\"datePublished\":\"2023-05-22T11:37:46+00:00\",\"dateModified\":\"2023-05-22T11:37:46+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Topology inverse design mesh interpolation | Ansys Learning Forum","description":"Dear ansys team .TLDR: why does topological optimization use the spatial interpolation of \"specified position\", instead of \"nearest mesh cell\", it creates errors. Long:I am learning how to use the topological optimization in lumopt + FDTD. when working on my project, I stumbled upon FDTD mesh grid vs optimised geomtry error, which I also found how","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","position":1,"name":"Home","item":"https:\/\/innovationspace.ansys.com\/forum","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","position":2,"name":"Topics","item":"https:\/\/innovationspace.ansys.com\/forum\/topics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/#listItem","name":"Topology inverse design mesh interpolation"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/#listItem","position":3,"name":"Topology inverse design mesh interpolation","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}}]},{"@type":"Organization","@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization","name":"Ansys Learning Forum","description":"Ansys Innovation Space","url":"https:\/\/innovationspace.ansys.com\/forum\/"},{"@type":"WebPage","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/","name":"Topology inverse design mesh interpolation | Ansys Learning Forum","description":"Dear ansys team .TLDR: why does topological optimization use the spatial interpolation of \"specified position\", instead of \"nearest mesh cell\", it creates errors. Long:I am learning how to use the topological optimization in lumopt + FDTD. when working on my project, I stumbled upon FDTD mesh grid vs optimised geomtry error, which I also found how","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/#breadcrumblist"},"datePublished":"2023-05-22T11:37:46+00:00","dateModified":"2023-05-22T11:37:46+00:00"},{"@type":"WebSite","@id":"https:\/\/innovationspace.ansys.com\/forum\/#website","url":"https:\/\/innovationspace.ansys.com\/forum\/","name":"Ansys Learning Forum","description":"Ansys Innovation Space","inLanguage":"en-US","publisher":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization"}}]},"og:locale":"en_US","og:site_name":"Ansys Learning Forum | Ansys Innovation Space","og:type":"article","og:title":"Topology inverse design mesh interpolation | Ansys Learning Forum","og:description":"Dear ansys team .TLDR: why does topological optimization use the spatial interpolation of &quot;specified position&quot;, instead of &quot;nearest mesh cell&quot;, it creates errors. Long:I am learning how to use the topological optimization in lumopt + FDTD. when working on my project, I stumbled upon FDTD mesh grid vs optimised geomtry error, which I also found how","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/","article:published_time":"2023-05-22T11:37:46+00:00","article:modified_time":"2023-05-22T11:37:46+00:00","twitter:card":"summary_large_image","twitter:title":"Topology inverse design mesh interpolation | Ansys Learning Forum","twitter:description":"Dear ansys team .TLDR: why does topological optimization use the spatial interpolation of &quot;specified position&quot;, instead of &quot;nearest mesh cell&quot;, it creates errors. Long:I am learning how to use the topological optimization in lumopt + FDTD. when working on my project, I stumbled upon FDTD mesh grid vs optimised geomtry error, which I also found how"},"aioseo_meta_data":{"post_id":"285117","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"content","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":true,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2024-10-28 18:07:51","updated":"2024-10-28 18:07:51","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/topics\/\" title=\"Topics\">Topics<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tTopology inverse design mesh interpolation\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/innovationspace.ansys.com\/forum"},{"label":"Topics","link":"https:\/\/innovationspace.ansys.com\/forum\/topics\/"},{"label":"Topology inverse design mesh interpolation","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/topology-inverse-design-mesh-interpolation\/"}],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["285485","30281"],"_bbp_author_ip":["23.217.200.46"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["613"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["285117"],"_bbp_forum_id":["27833"],"_bbp_engagement":["30281","285485"],"_bbp_voice_count":["2"],"_bbp_reply_count":["2"],"_bbp_last_reply_id":["286276"],"_bbp_last_active_id":["286276"],"_bbp_last_active_time":["2023-05-30 07:44:50"]},"test":"nbadtapple-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/285117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/285117\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=285117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}