.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated_examples/aggregate_warpage.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_generated_examples_aggregate_warpage.py: Aggregate Warpage =================== .. GENERATED FROM PYTHON SOURCE LINES 5-12 .. code-block:: default # pylint: disable=pointless-statement from pathlib import Path import numpy as np from mesh2vec.mesh2vec_cae import Mesh2VecCae .. GENERATED FROM PYTHON SOURCE LINES 13-15 Load Shell from ANSA, simulation results from d3plot ----------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 15-21 .. code-block:: default hg = Mesh2VecCae.from_ansa_shell( 3, Path("../../data/hat/Hatprofile.k"), json_mesh_file=Path("../../data/hat/cached_hat_key.json"), ) .. GENERATED FROM PYTHON SOURCE LINES 22-24 Plot Feature locally ------------------------ .. GENERATED FROM PYTHON SOURCE LINES 24-34 .. code-block:: default hg.add_features_from_ansa( ["warpage"], Path("../../data/hat/Hatprofile.k"), json_mesh_file=Path("../../data/hat/cached_hat_key.json"), ) name = hg.aggregate("warpage", 0, np.nanmean) fig = hg.get_visualization_plotly(str(name)) fig.update_layout(title=name[0]) fig .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 35-37 Aggregate Feature and plot --------------------------- .. GENERATED FROM PYTHON SOURCE LINES 37-42 .. code-block:: default name = hg.aggregate("warpage", 3, np.nanmean) fig = hg.get_visualization_plotly(str(name)) fig.update_layout(title=name) fig .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 43-45 Access the results ------------------- .. GENERATED FROM PYTHON SOURCE LINES 45-46 .. code-block:: default hg.to_dataframe() .. raw:: html
vtx_id warpage-nanmean-0 warpage-nanmean-3
0 4700000 0.000000 0.000000
1 4700001 0.000000 0.000000
2 4700002 0.000000 0.000000
3 4700003 0.000034 0.005791
4 4700004 0.000008 0.000726
... ... ... ...
6395 2002173 0.000000 0.000000
6396 2002174 0.000000 0.000000
6397 2002175 0.000000 0.000000
6398 2002176 0.000000 0.000000
6399 2002177 0.000000 0.000000

6400 rows × 3 columns



.. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.714 seconds) .. _sphx_glr_download_generated_examples_aggregate_warpage.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: aggregate_warpage.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: aggregate_warpage.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_