<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html
  SYSTEM "about:legacy-compat">
<html xmlns:mml = "http://www.w3.org/1998/Math/MathML" lang = "en"><head><meta charset = "UTF-8"/><meta name = "copyright" content = "(C) Copyright 2020"/><meta name = "DC.rights.owner" content = "(C) Copyright 2020"/><meta name = "DC.type" content = "concept"/><meta name = "abstract" content = "In Tosca Structure, scripts might be specified at several positions in the Tosca Structure optimization workflow."/><meta name = "description" content = "In Tosca Structure, scripts might be specified at several positions in the Tosca Structure optimization workflow."/><meta name = "DC.format" content = "HTML5"/><meta name = "DC.identifier" content = "tso-c-usr-control-script"/><meta name = "DC.language" content = "en"/><link rel = "stylesheet" type = "text/css" href = "../DSDocUI_XML34.css"/><title>Script Entry Points</title>
<script type = "text/javascript" src = "../DSDocUI_Highlight34.js">
  	/* */
  	</script></head><body onLoad = "highlightSearchTerms();" id = "tso-c-usr-control-script">
<a name = "hj-top"> </a><table class = "table1" id = "table11"><tr><td><table class = "DocHeader"><tr><td class = "DocHeader1" colspan = "2"><h1>Script Entry Points</h1></td></tr><tr><td class = "DocHeader4" colspan = "2"/></tr><tr><td class = "DocHeader3" colspan = "2"><table class = "DocThemeIntro" id = "table12"><tr><td class = "Intro1Only"><p class = "header"><p class = "abstract">
<span class = "shortdesc">
In <span class = "ph">Tosca Structure</span>, scripts might be 
specified at several positions in the <span class = "ph">Tosca Structure</span> optimization workflow.</span>

</p>
<p>This page discusses: </p><ul><li><a href = "#tso-c-usr-control-script__tso-c-user-control-script-main" id = "toc_rg" title = "">
  <span class = "ph">Tosca Structure</span> Workflow</a></li><li><a href = "#tso-c-usr-control-script__tso-c-user-control-optPreProc-Files" id = "toc_rg" title = "">Adding Files to the Working Directory</a></li></ul>
</p></td></tr></table></td></tr></table>





<div class = "body conbody">

<div class = "section" id = "tso-c-usr-control-script__tso-c-user-control-script-main"><h2 class = "title sectiontitle">
  <span class = "ph">Tosca Structure</span> Workflow</h2>

  <p>
    Adding user-defined scripts, called <code class = "ph codeph">Hooks</code>, to the <span class = "ph">Tosca Structure</span> workflow is possible before and after every module shown in the figure below.
  </p>
  <table class = "table"><caption/><colgroup><col/></colgroup><tbody class = "tbody">
        <tr class = "row">
          <td class = "entry">
            <br/><img class = "image" src = "../TsoUserImages/usr_control_101.png" width = "900"/><br/>
          </td>
        </tr>
      </tbody></table>
  
<p>A simple example for adding such a script is</p>
<pre class = "codeblock">
  <code class = "ph codeph">
    DRIVER
      driver.registerModuleHook( ToscaModules.TOSCA_PREP, HookTypes.PRE, EventTimes.EVER, "user_script.bat" )
    END_
  </code>
</pre>
  <p>
    More details regarding <code class = "ph codeph">Hooks</code> can be found here: <a class = "xref" href = "../TsoCmdMap/tso-r-cmd-driver-hooks.htm#tso-r-cmd-driver-hooks" title = "This section shows how to configure the execution of custom modules at certain points of the Python Driver workflow.">User Script Entry Points</a>.
  </p>

</div>


<div class = "section" id = "tso-c-usr-control-script__tso-c-user-control-optPreProc-Files"><p><map name = "FPMap1"><area href = "#hj-top" title = "Back to Top" shape = "rect" coords = "416, 0, 435, 10"/></map><span class = "itemsprite"/></p><h2 class = "title sectiontitle">Adding Files to the Working Directory</h2>

<p>An often needed functionality is to have the script files or other files copied
into the working directory. The most simple way is to use the <code class = "ph codeph">FEM_INPUT</code> command <code class = "ph codeph">COPY_FILE</code>:</p>
<pre class = "codeblock"><code class = "ph codeph">FEM_INPUT
 ID_NAME = fem_input
 FILE = my_solver_file.ext
 COPY_FILE = file1.ext
 COPY_FILE = file2.ext
END_</code></pre>
  <p>Remark:</p>
  <p><code class = "ph codeph">file1.ext</code> and <code class = "ph codeph">file2.ext</code> must exist in the starting directory and
both files are copied into the working directory right after starting <span class = "ph">Tosca Structure</span>.</p>
</div>

</div>


</td></tr></table><script type = "text/javascript" src = "../DSDocUI_Bottom34.js">/* */</script></body>
</html>
