{"id":5639,"date":"2024-11-22T11:17:13","date_gmt":"2024-11-22T10:17:13","guid":{"rendered":"https:\/\/www.nextfem.it\/it\/?page_id=5639"},"modified":"2024-12-24T14:18:21","modified_gmt":"2024-12-24T13:18:21","slug":"nextfem-viktor-integration","status":"publish","type":"page","link":"https:\/\/www.nextfem.it\/it\/nextfem-viktor-integration\/","title":{"rendered":"NextFEM &#038; VIKTOR integration"},"content":{"rendered":"<table style=\"width: 100%; border: none; border-collapse: collapse; border-radius: 15px; background-color: #dcebf7;\" border=\"medium\">\n<tbody>\n<tr>\n<td style=\"width: 29.7511%; border: medium;\" rowspan=\"2\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-5661\" src=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_nextfem.png\" alt=\"\" width=\"637\" height=\"325\" srcset=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_nextfem.png 637w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_nextfem-300x153.png 300w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_nextfem-600x306.png 600w\" sizes=\"(max-width: 637px) 100vw, 637px\" \/><\/td>\n<td style=\"width: 70.2489%; border: medium;\">\n<h2>NextFEM &amp; VIKTOR integration<\/h2>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 70.2489%; border: medium;\">\n<h5>nextfem designer &amp; viktor Work together to automate the boring<\/h5>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Use NextFEM and VIKTOR together to automate your tasks! Just a little knowledge of Python is required!<\/p>\n<p>Please find below instructions for use VIKTOR with your local installation of NextFEM Designer.<\/p>\n<h2>NextFEM-VIKTOR integration<\/h2>\n<h3>Prerequisites<\/h3>\n<ul>\n<li>You need a free VIKTOR account. <a href=\"https:\/\/www.viktor.ai\/start-building-apps\" target=\"_blank\" rel=\"noopener\"><strong>Register<\/strong><\/a> in order to get a VIKTOR workspace<\/li>\n<li>NextFEM Designer has to be installed on your machine. You don&#8217;t need a NextFEM license to use the sample code below, free version allows you to run analyses with no limits!<\/li>\n<li>Python 3.13 is advised, together with <a href=\"https:\/\/pypi.org\/project\/nextfempy\/\" target=\"_blank\" rel=\"noopener\"><strong>NextFEMpy package<\/strong><\/a> (<span style=\"font-family: terminal, monaco, monospace;\">pip install nextfempy<\/span>).<\/li>\n<\/ul>\n<h3>Installation instructions<\/h3>\n<p>1. <a href=\"https:\/\/docs.viktor.ai\/docs\/getting-started\/installation\/local-development-venv\/\" target=\"_blank\" rel=\"noopener\"><strong>install VIKTOR<\/strong><\/a> locally (you should be able to run <em>viktor-cli<\/em> in a command shell).<\/p>\n<p>2. obtain the source code of NextFEM app from <a href=\"https:\/\/github.com\/NextFEM\/VIKTOR-integration\" target=\"_blank\" rel=\"noopener\"><strong>our Github repo<\/strong><\/a>, you can <a href=\"https:\/\/github.com\/NextFEM\/VIKTOR-integration\/archive\/refs\/heads\/main.zip\" target=\"_blank\" rel=\"noopener\">donwload as a zip<\/a> or clone the repo from a shell with the command<br \/>\n<span style=\"font-family: terminal, monaco, monospace;\">git clone https:\/\/github.com\/NextFEM\/VIKTOR-integration.git<\/span><\/p>\n<p>3. inside the repository, open Powershell inside the folder <em><strong>NextFEM-VIKTOR<\/strong><\/em><\/p>\n<p>4. start the app with the command<br \/>\n<span style=\"font-family: terminal, monaco, monospace;\">viktor-cli clean-start<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-5670\" src=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_shell1.png\" alt=\"\" width=\"683\" height=\"296\" srcset=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_shell1.png 683w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_shell1-300x130.png 300w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_shell1-600x260.png 600w\" sizes=\"(max-width: 683px) 100vw, 683px\" \/><\/p>\n<p>5. log-in into <a href=\"https:\/\/cloud.viktor.ai\" target=\"_blank\" rel=\"noopener\"><strong>cloud.viktor.ai<\/strong><\/a> and open your Development workspace, or click in the link provided in the shell log (ctrl + click). You&#8217;ll get a blank workspace, hence click Create and then assign a name to the new app.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-5668\" src=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_create.png\" alt=\"\" width=\"979\" height=\"513\" srcset=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_create.png 1086w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_create-300x157.png 300w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_create-1024x537.png 1024w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_create-768x402.png 768w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_create-600x314.png 600w\" sizes=\"(max-width: 979px) 100vw, 979px\" \/><\/p>\n<p>6. when you&#8217;re done, click on Open<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5671\" src=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_open.png\" alt=\"\" width=\"1276\" height=\"234\" srcset=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_open.png 1276w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_open-300x55.png 300w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_open-1024x188.png 1024w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_open-768x141.png 768w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_open-600x110.png 600w\" sizes=\"(max-width: 1276px) 100vw, 1276px\" \/><\/p>\n<p>7. Now set up your local worker. A worker is able to connect your local copy of NextFEM Designer to VIKTOR cloud. From site <a href=\"http:\/\/cloud.viktor.ai\"><strong>cloud.viktor.ai<\/strong><\/a>, select <strong>Integrations<\/strong>, and <strong>Add integration<\/strong>. Select <em>Generic worker<\/em>, set scope as Specific and give it a name. The guided procedure let you download the worker installer and assign to you a key that must be used during installation on your machine.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5672\" src=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_worker.png\" alt=\"\" width=\"1687\" height=\"826\" srcset=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_worker.png 1687w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_worker-300x147.png 300w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_worker-1024x501.png 1024w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_worker-768x376.png 768w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_worker-1536x752.png 1536w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/vkt_worker-600x294.png 600w\" sizes=\"(max-width: 1687px) 100vw, 1687px\" \/><\/p>\n<p>8. We&#8217;re almost ready! Set your worker configuration in <em>config.yaml<\/em> like this, by changing <span style=\"font-family: terminal, monaco, monospace;\">[username]<\/span> with your username. In addition, set a scratch folder folder for the worker (e.g. create a folder named <span style=\"font-family: terminal, monaco, monospace;\">NextFEM_models<\/span> in drive C:).<\/p>\n<pre># CONFIGURATION FILE FOR VIKTOR WORKER TO RUN GENERIC EXECUTABLE \/ SCRIPT\r\n#\r\nexecutables: \r\n  get_model: \r\n    path: 'C:\\Users\\[username]\\AppData\\Local\\Programs\\Python\\Python313\\python.exe'\r\n    arguments:\r\n      - 'get-model.py'\r\n    workingDirectoryPath: 'C:\\NextFEM_models' \r\nmaxParallelProcesses: 1<\/pre>\n<p>9. Finally, start the worker. We&#8217;re almost ready! Remember also to start <em>NextFEM Designer<\/em> and the plugin <em>REST API server<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5755\" src=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/NFdes_APIserv.png\" alt=\"\" width=\"663\" height=\"427\" srcset=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/NFdes_APIserv.png 663w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/NFdes_APIserv-300x193.png 300w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/NFdes_APIserv-600x386.png 600w\" sizes=\"(max-width: 663px) 100vw, 663px\" \/><\/p>\n<h3>Usage<\/h3>\n<p>The sample code provided is aimed to share easily models and results. One the app is running and the worker is connected, you get this initial screen. Press <em>Reload model<\/em> and wait for execution. Then, click on the three dots in the upper-right corner of the viewport and select <em>Center camera<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5675\" src=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_centerCamera.png\" alt=\"\" width=\"1787\" height=\"624\" srcset=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_centerCamera.png 1787w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_centerCamera-300x105.png 300w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_centerCamera-1024x358.png 1024w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_centerCamera-768x268.png 768w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_centerCamera-1536x536.png 1536w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_centerCamera-600x210.png 600w\" sizes=\"(max-width: 1787px) 100vw, 1787px\" \/><\/p>\n<p>What happens when the button <em>Reload model<\/em> is pressed? The local worker executes the code in get-model.py. Your local copy of <em>NextFEM Designer<\/em> receives instructions and collects the model, running the analyses for the specified load cases.<\/p>\n<p>Here&#8217;s what you can see in your machine: the command prompt in which the app runs, the worker and NextFEM Designer with the computed model.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5756\" src=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/local_setup.png\" alt=\"\" width=\"1742\" height=\"750\" srcset=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/local_setup.png 1742w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/local_setup-300x129.png 300w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/local_setup-1024x441.png 1024w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/local_setup-768x331.png 768w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/local_setup-1536x661.png 1536w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/local_setup-600x258.png 600w\" sizes=\"(max-width: 1742px) 100vw, 1742px\" \/><\/p>\n<p>Finally, model and results are sent to VIKTOR; viewport and &#8220;Reactions&#8221; results table are populated.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5676\" src=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res1.png\" alt=\"\" width=\"1787\" height=\"572\" srcset=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res1.png 1787w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res1-300x96.png 300w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res1-1024x328.png 1024w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res1-768x246.png 768w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res1-1536x492.png 1536w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res1-600x192.png 600w\" sizes=\"(max-width: 1787px) 100vw, 1787px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5677\" src=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res2.png\" alt=\"\" width=\"1794\" height=\"600\" srcset=\"https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res2.png 1794w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res2-300x100.png 300w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res2-1024x342.png 1024w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res2-768x257.png 768w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res2-1536x514.png 1536w, https:\/\/www.nextfem.it\/it\/wp-content\/uploads\/viktor_res2-600x201.png 600w\" sizes=\"(max-width: 1794px) 100vw, 1794px\" \/><\/p>\n<p>The power of VIKTOR approach is allowing models and data to be shared and visualized with ease. With a bunch of Python lines of code, you can:<\/p>\n<ul>\n<li>run Finite Element analysis for free in VIKTOR platform<\/li>\n<li>share the analysis results and compile custom views as well<\/li>\n<li>get properties of every element in the model: materials (check our library), sections (area, inertias, etc.), elements, and so on<\/li>\n<li>develop any application working with your local copy of NextFEM Designer, including planar meshing with shell elements, model sanity checks on nodes and elements, and checking as per European design codes if you have a proper license.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NextFEM &amp; VIKTOR integration nextfem designer &amp; viktor Work together to automate the boring Use NextFEM and VIKTOR together to automate your tasks! Just a little knowledge of Python is &#8230;<\/p>\n","protected":false},"author":136,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-5639","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.nextfem.it\/it\/wp-json\/wp\/v2\/pages\/5639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nextfem.it\/it\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.nextfem.it\/it\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.nextfem.it\/it\/wp-json\/wp\/v2\/users\/136"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nextfem.it\/it\/wp-json\/wp\/v2\/comments?post=5639"}],"version-history":[{"count":0,"href":"https:\/\/www.nextfem.it\/it\/wp-json\/wp\/v2\/pages\/5639\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nextfem.it\/it\/wp-json\/wp\/v2\/media?parent=5639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}