Skip to content

Commit

Permalink
Merge pull request #37 from nasa/metis
Browse files Browse the repository at this point in the history
converted plot3d to graph network
  • Loading branch information
pjuangph authored Jun 11, 2024
2 parents 2a76e43 + 7cb566a commit f9506ee
Show file tree
Hide file tree
Showing 60 changed files with 14,838 additions and 1,167 deletions.
25 changes: 14 additions & 11 deletions docs/_build/html/_modules/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@

<!DOCTYPE html>

<html lang="en" data-content_root="../">
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &#8212; Plot3D 1.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b76e3c8a" />
<link rel="stylesheet" type="text/css" href="../_static/classic.css?v=514cf933" />
<title>Overview: module code &#8212; Plot3D 1.6.3 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/classic.css" />

<script src="../_static/documentation_options.js?v=72d88caf"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>

<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
Expand All @@ -24,7 +27,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Plot3D 1.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../index.html">Plot3D 1.6.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Overview: module code</a></li>
</ul>
</div>
Expand Down Expand Up @@ -76,13 +79,13 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Plot3D 1.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../index.html">Plot3D 1.6.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Overview: module code</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2023, Paht Juangphanich.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.0.
&#169; Copyright 2024, Paht Juangphanich.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.1.1.
</div>
</body>
</html>
57 changes: 21 additions & 36 deletions docs/_build/html/_modules/plot3d/block.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@

<!DOCTYPE html>

<html lang="en" data-content_root="../../">
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>plot3d.block &#8212; Plot3D 1.6.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=b76e3c8a" />
<link rel="stylesheet" type="text/css" href="../../_static/classic.css?v=514cf933" />
<title>plot3d.block &#8212; Plot3D 1.6.3 documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../../_static/classic.css" />

<script src="../../_static/documentation_options.js?v=72d88caf"></script>
<script src="../../_static/doctools.js?v=888ff710"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../../_static/doctools.js"></script>

<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
Expand All @@ -24,7 +27,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">Plot3D 1.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">Plot3D 1.6.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">plot3d.block</a></li>
</ul>
Expand All @@ -41,9 +44,7 @@ <h1>Source code for plot3d.block</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">tqdm</span> <span class="kn">import</span> <span class="n">trange</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">List</span>

<div class="viewcode-block" id="Block">
<a class="viewcode-back" href="../../modules/block.html#plot3d.block.Block">[docs]</a>
<span class="k">class</span> <span class="nc">Block</span><span class="p">:</span>
<div class="viewcode-block" id="Block"><a class="viewcode-back" href="../../modules/block.html#plot3d.block.Block">[docs]</a><span class="k">class</span> <span class="nc">Block</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Plot3D Block definition</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">X</span><span class="p">:</span><span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">,</span><span class="n">Y</span><span class="p">:</span><span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">,</span><span class="n">Z</span><span class="p">:</span><span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">):</span>
Expand All @@ -65,9 +66,7 @@ <h1>Source code for plot3d.block</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">cz</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">Z</span><span class="p">)</span>


<div class="viewcode-block" id="Block.scale">
<a class="viewcode-back" href="../../modules/block.html#plot3d.block.Block.scale">[docs]</a>
<span class="k">def</span> <span class="nf">scale</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">factor</span><span class="p">:</span><span class="nb">float</span><span class="p">):</span>
<div class="viewcode-block" id="Block.scale"><a class="viewcode-back" href="../../modules/block.html#plot3d.block.Block.scale">[docs]</a> <span class="k">def</span> <span class="nf">scale</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">factor</span><span class="p">:</span><span class="nb">float</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Scales a mesh by a certain factor </span>

<span class="sd"> Args:</span>
Expand All @@ -78,10 +77,7 @@ <h1>Source code for plot3d.block</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">Y</span> <span class="o">*=</span> <span class="n">factor</span>
<span class="bp">self</span><span class="o">.</span><span class="n">Z</span> <span class="o">*=</span> <span class="n">factor</span></div>


<div class="viewcode-block" id="Block.shift">
<a class="viewcode-back" href="../../modules/block.html#plot3d.block.Block.shift">[docs]</a>
<span class="k">def</span> <span class="nf">shift</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">shift_amount</span><span class="p">:</span><span class="nb">float</span><span class="p">,</span><span class="n">direction</span><span class="p">:</span><span class="nb">str</span><span class="o">=</span><span class="s2">&quot;z&quot;</span><span class="p">):</span>
<div class="viewcode-block" id="Block.shift"><a class="viewcode-back" href="../../modules/block.html#plot3d.block.Block.shift">[docs]</a> <span class="k">def</span> <span class="nf">shift</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">shift_amount</span><span class="p">:</span><span class="nb">float</span><span class="p">,</span><span class="n">direction</span><span class="p">:</span><span class="nb">str</span><span class="o">=</span><span class="s2">&quot;z&quot;</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;shifts the blocks by a certain amount</span>

<span class="sd"> Args:</span>
Expand All @@ -95,19 +91,13 @@ <h1>Source code for plot3d.block</h1><div class="highlight"><pre>
<span class="k">elif</span> <span class="n">direction</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="s1">&#39;x&#39;</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">X</span> <span class="o">+=</span><span class="n">shift_amount</span></div>


<div class="viewcode-block" id="Block.cylindrical">
<a class="viewcode-back" href="../../modules/block.html#plot3d.block.Block.cylindrical">[docs]</a>
<span class="k">def</span> <span class="nf">cylindrical</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<div class="viewcode-block" id="Block.cylindrical"><a class="viewcode-back" href="../../modules/block.html#plot3d.block.Block.cylindrical">[docs]</a> <span class="k">def</span> <span class="nf">cylindrical</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Converts the block to cylindrical coordinate system. The rotation axis is assumed to be &quot;x&quot; direction</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">r</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">Z</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">Z</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">Y</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">Y</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arctan2</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">Y</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">Z</span><span class="p">)</span></div>


<div class="viewcode-block" id="Block.cell_volumes">
<a class="viewcode-back" href="../../modules/block.html#plot3d.block.Block.cell_volumes">[docs]</a>
<span class="k">def</span> <span class="nf">cell_volumes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<div class="viewcode-block" id="Block.cell_volumes"><a class="viewcode-back" href="../../modules/block.html#plot3d.block.Block.cell_volumes">[docs]</a> <span class="k">def</span> <span class="nf">cell_volumes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Compute volume of all cells</span>

<span class="sd"> Returns:</span>
Expand Down Expand Up @@ -213,9 +203,7 @@ <h1>Source code for plot3d.block</h1><div class="highlight"><pre>
<span class="o">+</span><span class="n">cf</span><span class="p">[</span><span class="mi">2</span><span class="o">+</span><span class="n">n</span><span class="p">,</span><span class="n">l</span><span class="p">]</span><span class="o">*</span><span class="n">a</span><span class="p">[</span><span class="mi">3</span><span class="o">+</span><span class="n">l</span><span class="p">][</span><span class="n">i</span><span class="p">,</span><span class="n">j</span><span class="o">-</span><span class="mi">1</span><span class="o">+</span><span class="n">n</span><span class="p">,</span><span class="n">k</span><span class="p">]</span>
<span class="o">+</span><span class="n">cf</span><span class="p">[</span><span class="mi">4</span><span class="o">+</span><span class="n">n</span><span class="p">,</span><span class="n">l</span><span class="p">]</span><span class="o">*</span><span class="n">a</span><span class="p">[</span><span class="mi">6</span><span class="o">+</span><span class="n">l</span><span class="p">][</span><span class="n">i</span><span class="p">,</span><span class="n">j</span><span class="p">,</span><span class="n">k</span><span class="o">-</span><span class="mi">1</span><span class="o">+</span><span class="n">n</span><span class="p">])</span>
<span class="n">v</span><span class="p">[</span><span class="n">i</span><span class="p">,</span><span class="n">j</span><span class="p">,</span><span class="n">k</span><span class="p">]</span><span class="o">=</span> <span class="n">vol12</span><span class="o">/</span><span class="mi">12</span>
<span class="k">return</span> <span class="n">v</span></div>
</div>

<span class="k">return</span> <span class="n">v</span></div></div>

<span class="k">def</span> <span class="nf">checkCollinearity</span><span class="p">(</span><span class="n">v1</span><span class="p">:</span><span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">,</span> <span class="n">v2</span><span class="p">:</span><span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">):</span>
<span class="c1"># Calculate their cross product</span>
Expand Down Expand Up @@ -289,9 +277,7 @@ <h1>Source code for plot3d.block</h1><div class="highlight"><pre>

<span class="k">return</span> <span class="n">n_imin</span><span class="p">,</span><span class="n">n_jmin</span><span class="p">,</span><span class="n">n_kmin</span><span class="p">,</span><span class="n">n_imax</span><span class="p">,</span><span class="n">n_jmax</span><span class="p">,</span><span class="n">n_kmax</span>

<div class="viewcode-block" id="reduce_blocks">
<a class="viewcode-back" href="../../modules/block.html#plot3d.block.reduce_blocks">[docs]</a>
<span class="k">def</span> <span class="nf">reduce_blocks</span><span class="p">(</span><span class="n">blocks</span><span class="p">:</span><span class="n">List</span><span class="p">[</span><span class="n">Block</span><span class="p">],</span><span class="n">factor</span><span class="p">:</span><span class="nb">int</span><span class="p">):</span>
<div class="viewcode-block" id="reduce_blocks"><a class="viewcode-back" href="../../modules/block.html#plot3d.block.reduce_blocks">[docs]</a><span class="k">def</span> <span class="nf">reduce_blocks</span><span class="p">(</span><span class="n">blocks</span><span class="p">:</span><span class="n">List</span><span class="p">[</span><span class="n">Block</span><span class="p">],</span><span class="n">factor</span><span class="p">:</span><span class="nb">int</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;reduce the blocks by a factor of (factor)</span>

<span class="sd"> Args:</span>
Expand All @@ -307,7 +293,6 @@ <h1>Source code for plot3d.block</h1><div class="highlight"><pre>
<span class="n">blocks</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">Z</span> <span class="o">=</span> <span class="n">blocks</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">Z</span><span class="p">[::</span><span class="n">factor</span><span class="p">,::</span><span class="n">factor</span><span class="p">,::</span><span class="n">factor</span><span class="p">]</span>
<span class="n">blocks</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">IMAX</span><span class="p">,</span><span class="n">blocks</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">JMAX</span><span class="p">,</span><span class="n">blocks</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">KMAX</span> <span class="o">=</span> <span class="n">blocks</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">X</span><span class="o">.</span><span class="n">shape</span>
<span class="k">return</span> <span class="n">blocks</span></div>

</pre></div>

<div class="clearer"></div>
Expand Down Expand Up @@ -339,14 +324,14 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">Plot3D 1.6.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../index.html">Plot3D 1.6.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">plot3d.block</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2023, Paht Juangphanich.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.0.
&#169; Copyright 2024, Paht Juangphanich.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.1.1.
</div>
</body>
</html>
Loading

0 comments on commit f9506ee

Please sign in to comment.