.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/05-Legacy/01-introduction.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_05-Legacy_01-introduction.py: .. _ref_introduction: Introduction ============ This example shows how to load a solution and access some basic help. .. GENERATED FROM PYTHON SOURCE LINES 9-12 Perform required imports ------------------------ Perform required imports. .. GENERATED FROM PYTHON SOURCE LINES 12-16 .. code-block:: Python from ansys.dpf import post from ansys.dpf.post import examples .. GENERATED FROM PYTHON SOURCE LINES 17-21 Get ``Solution`` object ----------------------- Get the ``Solution`` object. This example loads a simple file supplied with PyDPF-Post. .. GENERATED FROM PYTHON SOURCE LINES 21-25 .. code-block:: Python simple_bar = examples.simple_bar solution = post.load_solution(simple_bar) .. GENERATED FROM PYTHON SOURCE LINES 26-28 Use helpers ----------- .. GENERATED FROM PYTHON SOURCE LINES 30-33 Get solution information ~~~~~~~~~~~~~~~~~~~~~~~~ Get solution information. .. GENERATED FROM PYTHON SOURCE LINES 33-36 .. code-block:: Python print(solution) .. rst-class:: sphx-glr-script-out .. code-block:: none Static Analysis Solution object. Data Sources ------------------------------ DPF DataSources: Result files: result key: rst and path: /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/ansys/dpf/core/examples/result_files/ASimpleBar.rst Secondary files: DPF Model ------------------------------ Static analysis Unit system: MKS: m, kg, N, s, V, A, degC Physics Type: Mechanical Available results: - displacement: Nodal Displacement - element_nodal_forces: ElementalNodal Element nodal Forces - elemental_volume: Elemental Volume - stiffness_matrix_energy: Elemental Energy-stiffness matrix - artificial_hourglass_energy: Elemental Hourglass Energy - thermal_dissipation_energy: Elemental thermal dissipation energy - kinetic_energy: Elemental Kinetic Energy - co_energy: Elemental co-energy - incremental_energy: Elemental incremental energy - element_euler_angles: ElementalNodal Element Euler Angles - structural_temperature: ElementalNodal Structural temperature ------------------------------ DPF Meshed Region: 3751 nodes 3000 elements Unit: m With solid (3D) elements ------------------------------ DPF Time/Freq Support: Number of sets: 1 Cumulative Time (s) LoadStep Substep 1 1.000000 1 1 .. GENERATED FROM PYTHON SOURCE LINES 37-41 Get locations information ~~~~~~~~~~~~~~~~~~~~~~~~~ Get location information. Locations are used to defined where the result must be set. .. GENERATED FROM PYTHON SOURCE LINES 41-44 .. code-block:: Python help(post.locations) .. rst-class:: sphx-glr-script-out .. code-block:: none Help on class locations in module ansys.dpf.gate.common: class locations(builtins.object) | Contains strings for scoping and field locations. | | Attributes | ----------- | none = "none" | | elemental = "Elemental" | data is one per element | | elemental_nodal = "ElementalNodal" | one per node per element | | nodal = "Nodal" | one per node | | time_freq = "TimeFreq_sets" | one per time set | | overall = "overall" | applies everywhere | | time_freq_step = "TimeFreq_steps" | one per time step | | faces = "Faces" | one per face | | zone = "zone" | one per zone | | elemental_and_faces = "ElementalAndFaces" | data available in elements and faces of the model | | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | elemental = 'Elemental' | | elemental_and_faces = 'ElementalAndFaces' | | elemental_nodal = 'ElementalNodal' | | faces = 'Faces' | | nodal = 'Nodal' | | none = 'none' | | overall = 'overall' | | time_freq = 'TimeFreq_sets' | | time_freq_step = 'TimeFreq_steps' | | zone = 'zone' .. GENERATED FROM PYTHON SOURCE LINES 45-49 Get available keywords ~~~~~~~~~~~~~~~~~~~~~~ Get the available keywords. Keywords can be used as attributes of a ``Result`` object. .. GENERATED FROM PYTHON SOURCE LINES 49-51 .. code-block:: Python post.print_available_keywords() .. rst-class:: sphx-glr-script-out .. code-block:: none element_scoping: list, int or dpf.core.Scoping grouping: str. Use post.grouping.(...) as helper. location: str. Use post.locations.(...) as helper. mapdl_grouping: int. Write 186 to get mapdl_elements solid_186. named_selection: str. Name of named_selection. node_scoping: list, int or dpf.core.Scoping path: DpfPath object that contains a list of coordinates, e.g. [[0.1, 0.0, 0.0], [0.0, 0.1, 0.0]]. set: int time: float time_scoping: list, int or dpf.core.Scoping .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.512 seconds) .. _sphx_glr_download_examples_05-Legacy_01-introduction.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 01-introduction.ipynb <01-introduction.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 01-introduction.py <01-introduction.py>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_