


{"id":318496,"date":"2023-11-20T13:20:56","date_gmt":"2023-11-20T13:20:56","guid":{"rendered":"\/forum\/forums\/reply\/318496\/"},"modified":"2023-11-20T13:20:56","modified_gmt":"2023-11-20T13:20:56","slug":"318496","status":"publish","type":"reply","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/318496\/","title":{"rendered":"Reply To: Error with Mesh Deformation"},"content":{"rendered":"<p>&lt;p&gt;Hello,&nbsp;&lt;\/p&gt;&lt;p&gt;can you try something like this, where you loop over the cells of your deforming zonne?&lt;\/p&gt;&lt;div&gt;&lt;div&gt;Node *node_p&nbsp;&nbsp;&lt;\/div&gt;&lt;div&gt;begin_c_loop (f, tf)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; c_node_loop (f, tf, n)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; node_p = C_NODE (f, tf, n);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (NODE_POS_NEED_UPDATE (node_p))&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NODE_POS_UPDATED (node_p);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xold = NODE_X (node_p); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xnew = xold+delta_x;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NODE_X (node_p) = xnew;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; }&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; }&lt;\/div&gt;&lt;div&gt;&nbsp; end_c_loop (f, tf);&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;where NODE_POS_NEED_UPDATE(node_p) is ensures that the position gets updated only than once for any given time step (if running in parallel).&nbsp;&lt;\/div&gt;&lt;div&gt;Also, use CURRENT_TIME instead of time to access flow_time variable.&lt;\/div&gt;&lt;div&gt;Note that we can only provide limited support for customization. Hence, the above is only a general suggestion and we cannot guarantee that it will work as intended for your application.&lt;\/div&gt;&lt;\/div&gt;<\/p>\n","protected":false},"template":"","class_list":["post-318496","reply","type-reply","status-publish","hentry"],"aioseo_notices":[],"acf":[],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/318496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/reply"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/318496\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=318496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}