Skip to content

Commit

Permalink
Deploying to gh-pages from @ 5948e1a 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
A-CGray committed Feb 9, 2024
1 parent 296e481 commit a1b7fff
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 10 deletions.
25 changes: 21 additions & 4 deletions _modules/tacs/mphys/builder.html
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ <h1>Source code for tacs.mphys.builder</h1><div class="highlight"><pre>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> tags : list[str]</span>
<span class="sd"> tags : list[str, int]</span>
<span class="sd"> list of component names or node IDs to include in body</span>

<span class="sd"> Returns</span>
<span class="sd"> -------</span>
Expand All @@ -473,13 +474,29 @@ <h1>Source code for tacs.mphys.builder</h1><div class="highlight"><pre>
<span class="c1"># Select all node IDs</span>
<span class="n">masked_local_nodes</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="n">nnodes</span><span class="p">)</span>

<span class="c1"># Get the compIDs associated with tags</span>
<span class="c1"># Get the node IDs associated with tags</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">tagged_comps</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fea_assembler</span><span class="o">.</span><span class="n">selectCompIDs</span><span class="p">(</span><span class="n">include</span><span class="o">=</span><span class="n">tags</span><span class="p">)</span>
<span class="c1"># Select local node IDs for tags</span>
<span class="c1"># Pick out any component names in supplied tags</span>
<span class="n">comp_names</span> <span class="o">=</span> <span class="p">[</span><span class="n">comp_name</span> <span class="k">for</span> <span class="n">comp_name</span> <span class="ow">in</span> <span class="n">tags</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">comp_name</span><span class="p">,</span> <span class="nb">str</span><span class="p">)]</span>
<span class="n">tagged_comps</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fea_assembler</span><span class="o">.</span><span class="n">selectCompIDs</span><span class="p">(</span><span class="n">include</span><span class="o">=</span><span class="n">comp_names</span><span class="p">)</span>
<span class="c1"># Select local node IDs for components</span>
<span class="n">masked_local_nodes</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fea_assembler</span><span class="o">.</span><span class="n">getLocalNodeIDsForComps</span><span class="p">(</span>
<span class="n">tagged_comps</span>
<span class="p">)</span>
<span class="c1"># Pick out any node IDs in supplied tags</span>
<span class="n">global_node_ids</span> <span class="o">=</span> <span class="p">[</span>
<span class="n">comp_name</span>
<span class="k">for</span> <span class="n">comp_name</span> <span class="ow">in</span> <span class="n">tags</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">comp_name</span><span class="p">,</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">integer</span><span class="p">))</span>
<span class="p">]</span>
<span class="c1"># Select local node IDs from global node IDs</span>
<span class="n">local_node_ids</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fea_assembler</span><span class="o">.</span><span class="n">getLocalNodeIDsFromGlobal</span><span class="p">(</span>
<span class="n">global_node_ids</span><span class="p">,</span> <span class="n">nastranOrdering</span><span class="o">=</span><span class="kc">True</span>
<span class="p">)</span>
<span class="c1"># getLocalNodeIDsFromGlobal returns -1 for nodes not on this processor, so remove those</span>
<span class="n">local_node_ids</span><span class="p">[:]</span> <span class="o">=</span> <span class="p">[</span><span class="nb">id</span> <span class="k">for</span> <span class="nb">id</span> <span class="ow">in</span> <span class="n">local_node_ids</span> <span class="k">if</span> <span class="nb">id</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">]</span>
<span class="n">masked_local_nodes</span> <span class="o">+=</span> <span class="n">local_node_ids</span>
<span class="n">masked_local_nodes</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">unique</span><span class="p">(</span><span class="n">masked_local_nodes</span><span class="p">)</span>

<span class="c1"># Select local node IDs and multiplier node IDs</span>
<span class="n">local_mnodes</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fea_assembler</span><span class="o">.</span><span class="n">getLocalMultiplierNodeIDs</span><span class="p">()</span>
Expand Down
35 changes: 31 additions & 4 deletions _modules/tacs/pytacs.html
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ <h1>Source code for tacs.pytacs</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="n">compIDs</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">return</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">compDescripts</span><span class="p">)</span>
<span class="c1"># Convert to list</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">compIDs</span><span class="p">,</span> <span class="nb">int</span><span class="p">):</span>
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">compIDs</span><span class="p">,</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">integer</span><span class="p">)):</span>
<span class="n">compIDs</span> <span class="o">=</span> <span class="p">[</span><span class="n">compIDs</span><span class="p">]</span>
<span class="c1"># Make sure list is flat</span>
<span class="k">else</span><span class="p">:</span>
Expand Down Expand Up @@ -781,6 +781,31 @@ <h1>Source code for tacs.pytacs</h1><div class="highlight"><pre>

<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">meshLoader</span><span class="o">.</span><span class="n">getLocalNodeIDsForComps</span><span class="p">(</span><span class="n">compIDs</span><span class="p">)</span></div>

<div class="viewcode-block" id="pyTACS.getLocalNodeIDsFromGlobal"><a class="viewcode-back" href="../../pytacs/pytacs_module.html#tacs.pytacs.pyTACS.getLocalNodeIDsFromGlobal">[docs]</a> <span class="k">def</span> <span class="nf">getLocalNodeIDsFromGlobal</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">globalIDs</span><span class="p">,</span> <span class="n">nastranOrdering</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Given a list of node IDs in global (non-partitioned) ordering</span>
<span class="sd"> returns the local (partitioned) node IDs on each processor.</span>
<span class="sd"> If a requested node is not included on this processor,</span>
<span class="sd"> an entry of -1 will be returned.</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> globalIDs : int or list[int]</span>
<span class="sd"> List of global node IDs.</span>

<span class="sd"> nastranOrdering : bool</span>
<span class="sd"> Flag signaling whether globalIDs is in TACS (default) or NASTRAN (grid IDs in bdf file) ordering</span>
<span class="sd"> Defaults to False.</span>

<span class="sd"> Returns</span>
<span class="sd"> -------</span>
<span class="sd"> localIDs : list[int]</span>
<span class="sd"> List of local node IDs for each entry in globalIDs.</span>
<span class="sd"> If the node is not owned by this processor, its index is filled with a value of -1.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">meshLoader</span><span class="o">.</span><span class="n">getLocalNodeIDsFromGlobal</span><span class="p">(</span><span class="n">globalIDs</span><span class="p">,</span> <span class="n">nastranOrdering</span><span class="p">)</span></div>

<div class="viewcode-block" id="pyTACS.initialize"><a class="viewcode-back" href="../../pytacs/pytacs_module.html#tacs.pytacs.pyTACS.initialize">[docs]</a> <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">elemCallBack</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This is the &#39;last&#39; method to be called during the setup. The</span>
Expand Down Expand Up @@ -894,10 +919,12 @@ <h1>Source code for tacs.pytacs</h1><div class="highlight"><pre>
<span class="c1"># Check if (res2-res0) - 2 * (res1 - res0) is zero (or very close to it)</span>
<span class="n">resNorm</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">real</span><span class="p">(</span><span class="n">res1</span><span class="o">.</span><span class="n">norm</span><span class="p">())</span>
<span class="n">res2</span><span class="o">.</span><span class="n">axpy</span><span class="p">(</span><span class="o">-</span><span class="mf">2.0</span><span class="p">,</span> <span class="n">res1</span><span class="p">)</span>
<span class="k">if</span> <span class="n">resNorm</span> <span class="o">==</span> <span class="mf">0.0</span> <span class="ow">or</span> <span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">real</span><span class="p">(</span><span class="n">res2</span><span class="o">.</span><span class="n">norm</span><span class="p">())</span> <span class="o">/</span> <span class="n">resNorm</span><span class="p">)</span> <span class="o">&lt;=</span> <span class="bp">self</span><span class="o">.</span><span class="n">getOption</span><span class="p">(</span><span class="s2">&quot;linearityTol&quot;</span><span class="p">):</span>
<span class="k">return</span> <span class="kc">False</span> <span class="c1"># not nonlinear case</span>
<span class="k">if</span> <span class="n">resNorm</span> <span class="o">==</span> <span class="mf">0.0</span> <span class="ow">or</span> <span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">real</span><span class="p">(</span><span class="n">res2</span><span class="o">.</span><span class="n">norm</span><span class="p">())</span> <span class="o">/</span> <span class="n">resNorm</span><span class="p">)</span> <span class="o">&lt;=</span> <span class="bp">self</span><span class="o">.</span><span class="n">getOption</span><span class="p">(</span>
<span class="s2">&quot;linearityTol&quot;</span>
<span class="p">):</span>
<span class="k">return</span> <span class="kc">False</span> <span class="c1"># not nonlinear case</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">True</span> <span class="c1"># nonlinear case</span>
<span class="k">return</span> <span class="kc">True</span> <span class="c1"># nonlinear case</span>

<span class="k">def</span> <span class="nf">_elemCallBackFromBDF</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
Expand Down
2 changes: 2 additions & 0 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,8 @@ <h2 id="G">G</h2>
<li><a href="pytacs/pytacs_module.html#tacs.pytacs.pyTACS.getLocalMultiplierNodeIDs">getLocalMultiplierNodeIDs() (tacs.pytacs.pyTACS method)</a>
</li>
<li><a href="pytacs/pytacs_module.html#tacs.pytacs.pyTACS.getLocalNodeIDsForComps">getLocalNodeIDsForComps() (tacs.pytacs.pyTACS method)</a>
</li>
<li><a href="pytacs/pytacs_module.html#tacs.pytacs.pyTACS.getLocalNodeIDsFromGlobal">getLocalNodeIDsFromGlobal() (tacs.pytacs.pyTACS method)</a>
</li>
<li><a href="core/constitutive.html#tacs.constitutive.MaterialProperties.getMaterialProperties">getMaterialProperties() (tacs.constitutive.MaterialProperties method)</a>

Expand Down
2 changes: 1 addition & 1 deletion mphys/builder.html
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ <h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to
<dd><p>Method that returns grid IDs for a list of body/boundary tags.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>tags</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.12)"><em>list</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><em>str</em></a><em>]</em>) -- </p>
<dd class="field-odd"><p><strong>tags</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.12)"><em>list</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><em>str</em></a><em>, </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><em>int</em></a><em>]</em>) -- list of component names or node IDs to include in body</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>grid_ids</strong> -- list of grid IDs that correspond to given body/boundary tags</p>
Expand Down
Binary file modified objects.inv
Binary file not shown.
26 changes: 26 additions & 0 deletions pytacs/pytacs_module.html
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,31 @@ <h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tacs.pytacs.pyTACS.getLocalNodeIDsFromGlobal">
<span class="sig-name descname"><span class="pre">getLocalNodeIDsFromGlobal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">globalIDs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nastranOrdering</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/tacs/pytacs.html#pyTACS.getLocalNodeIDsFromGlobal"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#tacs.pytacs.pyTACS.getLocalNodeIDsFromGlobal" title="Permalink to this definition"></a></dt>
<dd><p>Given a list of node IDs in global (non-partitioned) ordering
returns the local (partitioned) node IDs on each processor.
If a requested node is not included on this processor,
an entry of -1 will be returned.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>globalIDs</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><em>int</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.12)"><em>list</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><em>int</em></a><em>]</em>) -- List of global node IDs.</p></li>
<li><p><strong>nastranOrdering</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.12)"><em>bool</em></a>) -- Flag signaling whether globalIDs is in TACS (default) or NASTRAN (grid IDs in bdf file) ordering
Defaults to False.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>localIDs</strong> -- List of local node IDs for each entry in globalIDs.
If the node is not owned by this processor, its index is filled with a value of -1.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.12)">list</a>[<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)">int</a>]</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tacs.pytacs.pyTACS.initialize">
<span class="sig-name descname"><span class="pre">initialize</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">elemCallBack</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/tacs/pytacs.html#pyTACS.initialize"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#tacs.pytacs.pyTACS.initialize" title="Permalink to this definition"></a></dt>
Expand Down Expand Up @@ -1232,6 +1257,7 @@ <h3><a href="../index.html">Table of Contents</a></h3>
<li><a class="reference internal" href="#tacs.pytacs.pyTACS.getCompNames"><code class="docutils literal notranslate"><span class="pre">pyTACS.getCompNames()</span></code></a></li>
<li><a class="reference internal" href="#tacs.pytacs.pyTACS.getGlobalNodeIDsForComps"><code class="docutils literal notranslate"><span class="pre">pyTACS.getGlobalNodeIDsForComps()</span></code></a></li>
<li><a class="reference internal" href="#tacs.pytacs.pyTACS.getLocalNodeIDsForComps"><code class="docutils literal notranslate"><span class="pre">pyTACS.getLocalNodeIDsForComps()</span></code></a></li>
<li><a class="reference internal" href="#tacs.pytacs.pyTACS.getLocalNodeIDsFromGlobal"><code class="docutils literal notranslate"><span class="pre">pyTACS.getLocalNodeIDsFromGlobal()</span></code></a></li>
<li><a class="reference internal" href="#tacs.pytacs.pyTACS.initialize"><code class="docutils literal notranslate"><span class="pre">pyTACS.initialize()</span></code></a></li>
<li><a class="reference internal" href="#tacs.pytacs.pyTACS.getOrigDesignVars"><code class="docutils literal notranslate"><span class="pre">pyTACS.getOrigDesignVars()</span></code></a></li>
<li><a class="reference internal" href="#tacs.pytacs.pyTACS.getDesignVarRange"><code class="docutils literal notranslate"><span class="pre">pyTACS.getDesignVarRange()</span></code></a></li>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit a1b7fff

Please sign in to comment.