Skip to content

Commit

Permalink
deploy: 0ffb9f9
Browse files Browse the repository at this point in the history
  • Loading branch information
Huite committed Aug 30, 2024
1 parent 471a1eb commit 5b99ebe
Show file tree
Hide file tree
Showing 52 changed files with 98 additions and 38 deletions.
Binary file modified .doctrees/api/api/pandamesh.GmshMesher.doctree
Binary file not shown.
Binary file modified .doctrees/api/api/pandamesh.TriangleMesher.doctree
Binary file not shown.
Binary file modified .doctrees/api/changelog.doctree
Binary file not shown.
Binary file modified .doctrees/api/index.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/examples/gmsh-basic.doctree
Binary file not shown.
Binary file modified .doctrees/examples/preprocessing.doctree
Binary file not shown.
Binary file modified .doctrees/examples/sg_execution_times.doctree
Binary file not shown.
Binary file modified .doctrees/examples/triangle-basic.doctree
Binary file not shown.
Binary file modified .doctrees/sg_execution_times.doctree
Binary file not shown.
Binary file modified _downloads/79a425db58e6180cef408093f1ab28a8/preprocessing.zip
Binary file not shown.
Binary file modified _downloads/7a7ce2204255f277838397c00eecb9b7/gmsh-basic.zip
Binary file not shown.
Binary file modified _downloads/8d89d0cac7b99393a56c43d6bed625ed/triangle-basic.zip
Binary file not shown.
Binary file not shown.
Binary file modified _images/sphx_glr_gmsh-basic_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_gmsh-basic_002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_gmsh-basic_003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_gmsh-basic_004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_gmsh-basic_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_013.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_014.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_015.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_016.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_preprocessing_018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_triangle-basic_008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_triangle-basic_010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_triangle-geospatial_003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/sphx_glr_triangle-geospatial_005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 14 additions & 3 deletions _modules/pandamesh/gmsh_mesher.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ <h1>Source code for pandamesh.gmsh_mesher</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">pandamesh.common</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">FloatArray</span><span class="p">,</span>
<span class="n">IntArray</span><span class="p">,</span>
<span class="n">central_origin</span><span class="p">,</span>
<span class="n">check_geodataframe</span><span class="p">,</span>
<span class="n">gmsh</span><span class="p">,</span>
<span class="nb">repr</span><span class="p">,</span>
Expand Down Expand Up @@ -457,7 +458,13 @@ <h1>Source code for pandamesh.gmsh_mesher</h1><div class="highlight"><pre>
<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> gdf: gpd.GeoDataFrame</span>
<span class="sd"> GeoDataFrame containing the vector geometry.</span>
<span class="sd"> GeoDataFrame containing the vector geometry. Must contain a &quot;cellsize&quot;</span>
<span class="sd"> column.</span>
<span class="sd"> shift_origin: bool, optional, default is True.</span>
<span class="sd"> If True, temporarily shifts the coordinate system origin to the centroid</span>
<span class="sd"> of the geometry&#39;s bounding box during mesh generation. This helps mitigate</span>
<span class="sd"> floating-point precision issues. The resulting mesh vertices are</span>
<span class="sd"> automatically translated back to the original coordinate system.</span>
<span class="sd"> read_config_files: bool</span>
<span class="sd"> Gmsh initialization option: Read system Gmsh configuration files</span>
<span class="sd"> (gmshrc and gmsh-options).</span>
Expand All @@ -468,14 +475,15 @@ <h1>Source code for pandamesh.gmsh_mesher</h1><div class="highlight"><pre>
<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">gdf</span><span class="p">:</span> <span class="n">gpd</span><span class="o">.</span><span class="n">GeoDataFrame</span><span class="p">,</span>
<span class="n">shift_origin</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
<span class="n">read_config_files</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
<span class="n">run</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="n">interruptible</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_initialize_gmsh</span><span class="p">(</span>
<span class="n">read_config_files</span><span class="o">=</span><span class="n">read_config_files</span><span class="p">,</span> <span class="n">interruptible</span><span class="o">=</span><span class="n">interruptible</span>
<span class="p">)</span>
<span class="n">check_geodataframe</span><span class="p">(</span><span class="n">gdf</span><span class="p">)</span>
<span class="n">gdf</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_xoff</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_yoff</span> <span class="o">=</span> <span class="n">central_origin</span><span class="p">(</span><span class="n">gdf</span><span class="p">,</span> <span class="n">shift_origin</span><span class="p">)</span>
<span class="n">polygons</span><span class="p">,</span> <span class="n">linestrings</span><span class="p">,</span> <span class="n">points</span> <span class="o">=</span> <span class="n">separate</span><span class="p">(</span><span class="n">gdf</span><span class="p">)</span>

<span class="c1"># Include geometry into gmsh</span>
Expand Down Expand Up @@ -819,7 +827,10 @@ <h1>Source code for pandamesh.gmsh_mesher</h1><div class="highlight"><pre>
<span class="c1"># getNodes returns: node_tags, coord, parametric_coord</span>
<span class="n">_</span><span class="p">,</span> <span class="n">vertices</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">gmsh</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">mesh</span><span class="o">.</span><span class="n">getNodes</span><span class="p">()</span>
<span class="c1"># Return x and y</span>
<span class="k">return</span> <span class="n">vertices</span><span class="o">.</span><span class="n">reshape</span><span class="p">((</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">))[:,</span> <span class="p">:</span><span class="mi">2</span><span class="p">]</span>
<span class="n">vertices</span> <span class="o">=</span> <span class="n">vertices</span><span class="o">.</span><span class="n">reshape</span><span class="p">((</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">))[:,</span> <span class="p">:</span><span class="mi">2</span><span class="p">]</span>
<span class="n">vertices</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span> <span class="o">+=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_xoff</span>
<span class="n">vertices</span><span class="p">[:,</span> <span class="mi">1</span><span class="p">]</span> <span class="o">+=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_yoff</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">ascontiguousarray</span><span class="p">(</span><span class="n">vertices</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">_faces</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">element_types</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">node_tags</span> <span class="o">=</span> <span class="n">gmsh</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">mesh</span><span class="o">.</span><span class="n">getElements</span><span class="p">()</span>
Expand Down
20 changes: 18 additions & 2 deletions _modules/pandamesh/triangle_mesher.html
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ <h1>Source code for pandamesh.triangle_mesher</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">pandamesh.common</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">FloatArray</span><span class="p">,</span>
<span class="n">IntArray</span><span class="p">,</span>
<span class="n">central_origin</span><span class="p">,</span>
<span class="n">check_geodataframe</span><span class="p">,</span>
<span class="nb">repr</span><span class="p">,</span>
<span class="n">separate</span><span class="p">,</span>
Expand Down Expand Up @@ -409,12 +410,24 @@ <h1>Source code for pandamesh.triangle_mesher</h1><div class="highlight"><pre>

<span class="sd"> For more details on Triangle, see:</span>
<span class="sd"> https://www.cs.cmu.edu/~quake/triangle.defs.html</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
<span class="sd"> gdf: gpd.GeoDataFrame</span>
<span class="sd"> GeoDataFrame containing the vector geometry. Must contain a &quot;cellsize&quot;</span>
<span class="sd"> column.</span>
<span class="sd"> shift_origin: bool, optional, default is True.</span>
<span class="sd"> If True, temporarily shifts the coordinate system origin to the centroid</span>
<span class="sd"> of the geometry&#39;s bounding box during mesh generation. This helps mitigate</span>
<span class="sd"> floating-point precision issues. The resulting mesh vertices are</span>
<span class="sd"> automatically translated back to the original coordinate system.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<div class="viewcode-block" id="TriangleMesher.__init__">
<a class="viewcode-back" href="../../api/api/pandamesh.TriangleMesher.html#pandamesh.TriangleMesher.__init__">[docs]</a>
<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">gdf</span><span class="p">:</span> <span class="n">gpd</span><span class="o">.</span><span class="n">GeoDataFrame</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</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">gdf</span><span class="p">:</span> <span class="n">gpd</span><span class="o">.</span><span class="n">GeoDataFrame</span><span class="p">,</span> <span class="n">shift_origin</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">check_geodataframe</span><span class="p">(</span><span class="n">gdf</span><span class="p">)</span>
<span class="n">gdf</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_xoff</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_yoff</span> <span class="o">=</span> <span class="n">central_origin</span><span class="p">(</span><span class="n">gdf</span><span class="p">,</span> <span class="n">shift_origin</span><span class="p">)</span>
<span class="n">polygons</span><span class="p">,</span> <span class="n">linestrings</span><span class="p">,</span> <span class="n">points</span> <span class="o">=</span> <span class="n">separate</span><span class="p">(</span><span class="n">gdf</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">vertices</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">segments</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">regions</span> <span class="o">=</span> <span class="n">collect_geometry</span><span class="p">(</span>
<span class="n">polygons</span><span class="p">,</span> <span class="n">linestrings</span><span class="p">,</span> <span class="n">points</span>
Expand Down Expand Up @@ -562,7 +575,10 @@ <h1>Source code for pandamesh.triangle_mesher</h1><div class="highlight"><pre>
<span class="n">tri</span><span class="p">[</span><span class="s2">&quot;regions&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">regions</span>

<span class="n">result</span> <span class="o">=</span> <span class="n">triangle</span><span class="o">.</span><span class="n">triangulate</span><span class="p">(</span><span class="n">tri</span><span class="o">=</span><span class="n">tri</span><span class="p">,</span> <span class="n">opts</span><span class="o">=</span><span class="n">options</span><span class="p">)</span>
<span class="k">return</span> <span class="n">result</span><span class="p">[</span><span class="s2">&quot;vertices&quot;</span><span class="p">],</span> <span class="n">result</span><span class="p">[</span><span class="s2">&quot;triangles&quot;</span><span class="p">]</span></div>
<span class="n">vertices</span> <span class="o">=</span> <span class="n">result</span><span class="p">[</span><span class="s2">&quot;vertices&quot;</span><span class="p">]</span>
<span class="n">vertices</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span> <span class="o">+=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_xoff</span>
<span class="n">vertices</span><span class="p">[:,</span> <span class="mi">1</span><span class="p">]</span> <span class="o">+=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_yoff</span>
<span class="k">return</span> <span class="n">vertices</span><span class="p">,</span> <span class="n">result</span><span class="p">[</span><span class="s2">&quot;triangles&quot;</span><span class="p">]</span></div>
</div>

</pre></div>
Expand Down
4 changes: 4 additions & 0 deletions _sources/api/changelog.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Changed
:class:`pandamesh.GmshMesher`, :class:`pandamesh.MeshAlgorithm`, or
:class:`pandamesh.SubdivisionAlgorithm` will now accept one of these enums,
or the enum member name as a string.
- :class:`pandamesh.TriangleMesher` and :class:`pandamesh.GmshMesher` now take
a ``shift_origin`` argument to temporarily shift the coordinate system to the
centroid of the geometries' bounding box to mitigate floating point precision
problems. This is enabled by default.

[0.1.6] 2024-07-17
------------------
Expand Down
6 changes: 4 additions & 2 deletions _sources/examples/gmsh-basic.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ The GmshMesher class is initialized with a number of default parameters:
.. code-block:: none
GmshMesher
xoff = 5.0
yoff = 5.0
current_field_id = 1
fields_list = []
distance_fields_list = []
fields = Empty GeoDataFrame
Columns: []
Index: []
tmpdir = <TemporaryDirectory '/tmp/tmpdmt9qtcw'>
tmpdir = <TemporaryDirectory '/tmp/tmpb99abr5o'>
recombine_all = False
mesh_size_extend_from_boundary = True
mesh_size_from_points = True
Expand Down Expand Up @@ -318,7 +320,7 @@ polygons.

.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 0.335 seconds)
**Total running time of the script:** (0 minutes 0.340 seconds)


.. _sphx_glr_download_examples_gmsh-basic.py:
Expand Down
6 changes: 3 additions & 3 deletions _sources/examples/preprocessing.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ are inserted, such that the polygons share an edge.
.. code-block:: none
<matplotlib.collections.PathCollection object at 0x7efc8e5f5fa0>
<matplotlib.collections.PathCollection object at 0x7f59e110e4e0>
Expand Down Expand Up @@ -575,7 +575,7 @@ triangles around the line intersection have disappeared:
.. code-block:: none
<matplotlib.collections.PathCollection object at 0x7efc8e316540>
<matplotlib.collections.PathCollection object at 0x7f59d3b764e0>
Expand Down Expand Up @@ -619,7 +619,7 @@ from any polygon boundary by providing a distance to ``clip_lines``:
.. code-block:: none
<matplotlib.collections.PathCollection object at 0x7efc8e34f4d0>
<matplotlib.collections.PathCollection object at 0x7f59d3b77890>
Expand Down
6 changes: 3 additions & 3 deletions _sources/examples/sg_execution_times.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Computation times
=================
**00:02.911** total execution time for 4 files **from examples**:
**00:02.918** total execution time for 4 files **from examples**:

.. container::

Expand Down Expand Up @@ -36,11 +36,11 @@ Computation times
- 00:01.388
- 0.0
* - :ref:`sphx_glr_examples_triangle-basic.py` (``triangle-basic.py``)
- 00:00.663
- 00:00.664
- 0.0
* - :ref:`sphx_glr_examples_triangle-geospatial.py` (``triangle-geospatial.py``)
- 00:00.525
- 0.0
* - :ref:`sphx_glr_examples_gmsh-basic.py` (``gmsh-basic.py``)
- 00:00.335
- 00:00.340
- 0.0
4 changes: 3 additions & 1 deletion _sources/examples/triangle-basic.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ The TriangleMesher class is initialized with a number of default parameters:
.. code-block:: none
TriangleMesher
xoff = 5.0
yoff = 5.0
vertices = np.ndarray with shape (4, 2)
segments = np.ndarray with shape (4, 2)
regions = np.ndarray with shape (1, 4)
Expand Down Expand Up @@ -475,7 +477,7 @@ sizes, and linestrings and points to steer the triangulation.

.. rst-class:: sphx-glr-timing

**Total running time of the script:** (0 minutes 0.663 seconds)
**Total running time of the script:** (0 minutes 0.664 seconds)


.. _sphx_glr_download_examples_triangle-basic.py:
Expand Down
6 changes: 3 additions & 3 deletions _sources/sg_execution_times.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Computation times
=================
**00:02.911** total execution time for 4 files **from all galleries**:
**00:02.918** total execution time for 4 files **from all galleries**:

.. container::

Expand Down Expand Up @@ -36,11 +36,11 @@ Computation times
- 00:01.388
- 0.0
* - :ref:`sphx_glr_examples_triangle-basic.py` (``../examples/triangle-basic.py``)
- 00:00.663
- 00:00.664
- 0.0
* - :ref:`sphx_glr_examples_triangle-geospatial.py` (``../examples/triangle-geospatial.py``)
- 00:00.525
- 0.0
* - :ref:`sphx_glr_examples_gmsh-basic.py` (``../examples/gmsh-basic.py``)
- 00:00.335
- 00:00.340
- 0.0
Loading

0 comments on commit 5b99ebe

Please sign in to comment.