


{"id":455696,"date":"2026-04-02T21:55:00","date_gmt":"2026-04-02T21:55:00","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/em_control_magnet-syntax-issues\/"},"modified":"2026-04-02T21:55:00","modified_gmt":"2026-04-02T21:55:00","slug":"em_control_magnet-syntax-issues","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/em_control_magnet-syntax-issues\/","title":{"rendered":"EM_CONTROL_MAGNET syntax issues"},"content":{"rendered":"<p>&lt;p&gt;I recently noticed something I didn&#8217;t understand with the EM_CONTROL_MAGNET keyword. On page 385 of the keyword manual (<a href=\"https:\/\/lsdyna.ansys.com\/wp-content\/uploads\/2025\/04\/LS-DYNA_Manual_Vol_III_R16.pdf\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https:\/\/lsdyna.ansys.com\/wp-content\/uploads\/2025\/04\/LS-DYNA_Manual_Vol_III_R16.pdf<\/a>) it mentions there are two inputs, both mcomp to turn on the keyword, and ncycm to set the number of cycles. So it would be written like this:&lt;br&gt;*EM_CONTROL_MAGNET&lt;br&gt;$# mcomp ncycm&lt;br&gt;1 100&lt;br&gt;However, when I use lsprepost to make a keyword file and include the EM_CONTROL_MAGNET keyword, there is no ncycm command, only the mcomp, and it is automatically written as:&lt;br&gt;*EM_CONTROL_MAGNET&lt;br&gt;$# mcomp&lt;br&gt;1&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;&lt;p&gt;Moreover, with the syntax written by LSPP, the simulation will crash stating &#8220;forrtl: severe (164): Program Exception &#8211; integer divide by zero&#8221; after assembling Fem-Bem matricies, and building P mat, Q mat, and W mat through 100 percent.&nbsp; This may be a problem with the syntax, or maybe the rebuilding of magnetic vector of a deforming magnet happens too often and there is a threshold somewhere between NCYCM being undefined and 100 that allows the simulation to complete.&nbsp; If it helps, here is the EM chunk of my .k file&lt;br&gt;&lt;br&gt;*EM_PERMANENT_MAGNET&lt;br&gt;$# &nbsp; &nbsp; &nbsp;id &nbsp; &nbsp; &nbsp; pid &nbsp; &nbsp; mtype &nbsp; &nbsp; north &nbsp; &nbsp; south &nbsp; &nbsp; &nbsp; &nbsp;hc&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; 2 &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; 21033&lt;br&gt;*EM_CONTROL&lt;br&gt;$# &nbsp; emsol &nbsp; &nbsp; numls &nbsp; &nbsp; &nbsp; &nbsp; &#8211; &nbsp; dimtype &nbsp; &nbsp;nperio &nbsp; &nbsp; &nbsp; &nbsp; &#8211; &nbsp; ncylfem &nbsp; ncylbem&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp; 100 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; 1&lt;br&gt;*EM_CONTROL_MAGNET&lt;br&gt;$# &nbsp; mcomp&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1&lt;br&gt;*EM_CONTROL_TIMESTEP&lt;br&gt;$# &nbsp;tstype &nbsp; &nbsp;dtcons &nbsp; &nbsp; &nbsp;lcid &nbsp; &nbsp;factor &nbsp; &nbsp; tsmin &nbsp; &nbsp; tsmas &nbsp; &nbsp; rlcsf &nbsp; &nbsp;mecats&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 &nbsp; &nbsp; &nbsp; 0.0 &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; 1.0 &nbsp; &nbsp;1.0E-4 &nbsp; &nbsp; &nbsp;0.25 &nbsp; &nbsp; &nbsp; &nbsp;25 &nbsp; &nbsp; &nbsp; &nbsp; 0&lt;br&gt;*EM_CONTROL_COUPLING&lt;br&gt;$# &nbsp; thcpl &nbsp; &nbsp; smcpl &nbsp; &nbsp;thlcid &nbsp; &nbsp;smlcid &nbsp; thcplfl &nbsp; smcplfl&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp; &nbsp; 2 &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; 0&lt;br&gt;*EM_SOLVER_FEMBEM_MONOLITHIC&lt;br&gt;$# &nbsp; mtype &nbsp; &nbsp; stype &nbsp; &nbsp;abstol &nbsp; &nbsp;reltol &nbsp; &nbsp; maxit&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp;1.0E-6 &nbsp; &nbsp;1.0E-4 &nbsp; &nbsp; &nbsp; 100&lt;br&gt;*EM_MAT_002&lt;br&gt;$# &nbsp; &nbsp; mid &nbsp; &nbsp; mtype &nbsp; &nbsp; sigma &nbsp; &nbsp; eosid &nbsp; &nbsp; murel &nbsp; &nbsp; eosmu &nbsp; &nbsp;deatht&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp; &nbsp; 4 &nbsp; &nbsp; &nbsp; 0.0 &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; 1.1 &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp;1.0E28&lt;br&gt;*EM_EXTERNAL_FIELD&lt;br&gt;$# fieldid &nbsp; &nbsp; ftype &nbsp; &nbsp; &nbsp;fdef &nbsp; &nbsp; lcidx &nbsp; &nbsp; lcidy &nbsp; &nbsp; lcidz&lt;br&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; 4 &nbsp; &nbsp; &nbsp; &nbsp; 2 &nbsp; &nbsp; &nbsp; &nbsp; 4&lt;\/p&gt;<\/p>\n","protected":false},"template":"","class_list":["post-455696","topic","type-topic","status-publish","hentry","topic-tag-ansys-ls-dyna-1","topic-tag-ls_dyna-1"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_forum_id":["27814"],"_bbp_topic_id":["455696"],"_bbp_subscription":["645102","58821"],"_bbp_author_ip":["5.90.100.77"],"_bbp_last_reply_id":["455734"],"_bbp_last_active_id":["455734"],"_bbp_last_active_time":["2026-04-03 14:01:58"],"_bbp_reply_count":["7"],"_bbp_reply_count_hidden":["0"],"_bbp_voice_count":["2"],"_bbp_engagement":["645102","58821"],"_btv_view_count":["60"],"_bbp_topic_status":["unanswered"]},"test":"troy-bakersantannapisa-it"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/455696","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\/455696\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=455696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}