Skip to content

Commit

Permalink
Merge pull request #30 from daavid00/deb
Browse files Browse the repository at this point in the history
Rename to hello world
  • Loading branch information
daavid00 authored Jan 10, 2025
2 parents ab12565 + 7888259 commit 569b5ca
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 26 deletions.
8 changes: 4 additions & 4 deletions docs/_sources/examples.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
Examples
********

======
SPE11B
======
===========
Hello world
===========

The simulation files located in the `examples folder <https://github.com/cssr-tools/plopm/blob/main/examples>`_ were generated using
`pyopmspe11 <https://github.com/OPM/pyopmspe11>`_ by running this `configuration file <https://github.com/OPM/pyopmspe11/blob/main/examples/hello_world/spe11b.txt>`_.
Then, if you succeed in installing **plopm**, inside the `examples folder <https://github.com/cssr-tools/plopm/blob/main/examples>`_ by typing in the terminal

.. code-block:: bash
plopm
plopm -i SPE11B
the following figure should be generated (this example is used in the `tests <https://github.com/cssr-tools/plopm/blob/main/tests>`_, then it runs with the default terminal argument options).

Expand Down
8 changes: 4 additions & 4 deletions docs/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#spe11b">SPE11B</a></li>
<li class="toctree-l2"><a class="reference internal" href="#hello-world">Hello world</a></li>
<li class="toctree-l2"><a class="reference internal" href="#generic-deck">Generic deck</a></li>
<li class="toctree-l2"><a class="reference internal" href="#rotation-translation-and-zoom">Rotation, translation, and zoom</a></li>
<li class="toctree-l2"><a class="reference internal" href="#convert-to-vtk">Convert to VTK</a></li>
Expand Down Expand Up @@ -88,12 +88,12 @@

<section id="examples">
<h1>Examples<a class="headerlink" href="#examples" title="Link to this heading"></a></h1>
<section id="spe11b">
<h2>SPE11B<a class="headerlink" href="#spe11b" title="Link to this heading"></a></h2>
<section id="hello-world">
<h2>Hello world<a class="headerlink" href="#hello-world" title="Link to this heading"></a></h2>
<p>The simulation files located in the <a class="reference external" href="https://github.com/cssr-tools/plopm/blob/main/examples">examples folder</a> were generated using
<a class="reference external" href="https://github.com/OPM/pyopmspe11">pyopmspe11</a> by running this <a class="reference external" href="https://github.com/OPM/pyopmspe11/blob/main/examples/hello_world/spe11b.txt">configuration file</a>.
Then, if you succeed in installing <strong>plopm</strong>, inside the <a class="reference external" href="https://github.com/cssr-tools/plopm/blob/main/examples">examples folder</a> by typing in the terminal</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>plopm
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>plopm<span class="w"> </span>-i<span class="w"> </span>SPE11B
</pre></div>
</div>
<p>the following figure should be generated (this example is used in the <a class="reference external" href="https://github.com/cssr-tools/plopm/blob/main/tests">tests</a>, then it runs with the default terminal argument options).</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h1>Welcome to plopm’s documentation!<a class="headerlink" href="#welcome-to-p
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="examples.html#spe11b">SPE11B</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#hello-world">Hello world</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#generic-deck">Generic deck</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#rotation-translation-and-zoom">Rotation, translation, and zoom</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples.html#convert-to-vtk">Convert to VTK</a></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/text/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
Examples
********

======
SPE11B
======
===========
Hello world
===========

The simulation files located in the `examples folder <https://github.com/cssr-tools/plopm/blob/main/examples>`_ were generated using
`pyopmspe11 <https://github.com/OPM/pyopmspe11>`_ by running this `configuration file <https://github.com/OPM/pyopmspe11/blob/main/examples/hello_world/spe11b.txt>`_.
Then, if you succeed in installing **plopm**, inside the `examples folder <https://github.com/cssr-tools/plopm/blob/main/examples>`_ by typing in the terminal

.. code-block:: bash
plopm
plopm -i SPE11B
the following figure should be generated (this example is used in the `tests <https://github.com/cssr-tools/plopm/blob/main/tests>`_, then it runs with the default terminal argument options).

Expand Down
51 changes: 39 additions & 12 deletions src/plopm/utils/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,22 +401,22 @@ def find_min_max(dic):
else:
map_xycoords(dic, var, quan, 1)
dic["diffa"].append(dic[var + "a"])
for m, var in enumerate(dic["vrs"]):
dic["minc"].append(dic["minc"][-1])
dic["maxc"].append(dic["maxc"][-1])
for n, deck in enumerate(dic["names"][0]):
if len(dic["vrs"]) == len(dic["names"][0]) and len(dic["names"][0]) > 1:
for m, var in enumerate(dic["vrs"]):
dic["minc"].append(dic["minc"][-1])
dic["maxc"].append(dic["maxc"][-1])
for t, _ in enumerate(dic["restart"]):
dic["deck"] = deck
dic["ndeck"] = n
prepare_maps(dic, n)
dic["deck"] = dic["names"][0][m]
dic["ndeck"] = m
prepare_maps(dic, m)
_, quan = get_quantity(dic, var.upper(), m, dic["restart"][t])
dic[var + "a"] = np.ones(dic["mx"] * dic["my"]) * np.nan
if dic["slide"][n][0][0] > -1:
map_yzcoords(dic, var, quan, n)
elif dic["slide"][n][1][0] > -1:
map_xzcoords(dic, var, quan, n)
if dic["slide"][m][0][0] > -1:
map_yzcoords(dic, var, quan, m)
elif dic["slide"][m][1][0] > -1:
map_xzcoords(dic, var, quan, m)
else:
map_xycoords(dic, var, quan, n)
map_xycoords(dic, var, quan, m)
if dic["diff"]:
dic[var + "a"] -= dic["diffa"][t]
if int(dic["log"][m]) == 1:
Expand All @@ -427,6 +427,33 @@ def find_min_max(dic):
dic["maxc"][-2] = max(
dic["maxc"][-2], dic[var + "a"][~np.isnan(dic[var + "a"])].max()
)
else:
for m, var in enumerate(dic["vrs"]):
dic["minc"].append(dic["minc"][-1])
dic["maxc"].append(dic["maxc"][-1])
for n, deck in enumerate(dic["names"][0]):
for t, _ in enumerate(dic["restart"]):
dic["deck"] = deck
dic["ndeck"] = n
prepare_maps(dic, n)
_, quan = get_quantity(dic, var.upper(), m, dic["restart"][t])
dic[var + "a"] = np.ones(dic["mx"] * dic["my"]) * np.nan
if dic["slide"][n][0][0] > -1:
map_yzcoords(dic, var, quan, n)
elif dic["slide"][n][1][0] > -1:
map_xzcoords(dic, var, quan, n)
else:
map_xycoords(dic, var, quan, n)
if dic["diff"]:
dic[var + "a"] -= dic["diffa"][t]
if int(dic["log"][m]) == 1:
dic[var + "a"][dic[var + "a"] <= 0] = np.nan
dic["minc"][-2] = min(
dic["minc"][-2], dic[var + "a"][~np.isnan(dic[var + "a"])].min()
)
dic["maxc"][-2] = max(
dic["maxc"][-2], dic[var + "a"][~np.isnan(dic[var + "a"])].max()
)
if dic["mask"]:
var = dic["mask"]
dic["maska"] = []
Expand Down

0 comments on commit 569b5ca

Please sign in to comment.