Skip to main content

Data Processing Framework - Python Core

Project description

DPF - Ansys Data Processing Framework

PyAnsys Python pypi freq-PyDPF-Core GH-CI docs MIT pypidl cov

Ansys Data Processing Framework (DPF) provides numerical simulation users and engineers with a toolbox for accessing and transforming simulation data. With DPF, you can perform complex preprocessing or postprocessing of large amounts of simulation data within a simulation workflow.

DPF is an independent, physics-agnostic tool that you can plug into many apps for both data input and data output, including visualization and result plots. It can access data from solver result files and other neutral formats, such as CSV, HDF5, and VTK files.

The latest version of DPF supports Ansys solver results files for:

  • Mechanical APDL (.rst, .mode, .rfrq, .rdsp, .rth)
  • LS-DYNA (.d3plot, .binout)
  • Fluent (.cas/dat.h5, .flprj)
  • CFX (.cas/dat.cff, .flprj, .res)

For more information on file support, see the main page in the PyDPF-Core documentation.

Using the many DPF operators that are available, you can manipulate and transform this data. You can also chain operators together to create simple or complex data-processing workflows that you can reuse for repeated or future evaluations.

The data in DPF is defined based on physics-agnostic mathematical quantities described in self-sufficient entities called fields. This allows DPF to be a modular and easy-to-use tool with a large range of capabilities.

DPF flow

The ansys.dpf.core package provides a Python interface to DPF, enabling rapid postprocessing of a variety of Ansys file formats and physics solutions without ever leaving the Python environment.

Documentation and issues

Documentation for the latest stable release of PyDPF-Core is hosted at PyDPF-Core documentation.

In the upper right corner of the documentation's title bar, there is an option for switching from viewing the documentation for the latest stable release to viewing the documentation for the development version or previously released versions.

You can also view or download the PyDPF-Core cheat sheet. This one-page reference provides syntax rules and commands for using PyDPF-Core.

On the PyDPF-Core Issues page, you can create issues to report bugs and request new features. On the PyDPF-Core Discussions page or the Discussions page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.

To reach the project support team, email pyansys.core@ansys.com.

Installation

PyDPF-Core requires DPF to be available. You can either have a compatible Ansys version installed or install the standalone ansys-dpf-server server package. For more information, see Getting Started with DPF Server in the PyDPF-Core documentation.

For the compatibility between PyDPF-Core and Ansys, see Compatibility in the PyDPF-Core documentation.

To use PyDPF-Core with the standalone ansys-dpf-server server package 8.0 or later; or with Ansys 2024 R1 or later, install the latest version with this command:

   pip install ansys-dpf-core

PyDPF-Core plotting capabilities require PyVista <https://pyvista.org/>_ to be installed. To install PyDPF-Core with its optional plotting functionalities, use this command:

   pip install ansys-dpf-core[graphics]

For more information on PyDPF-Core plotting capabilities, see Plot in the PyDPF-Core documentation.

To use PyDPF-Core with Ansys 2022 R2 up to Ansys 2023 R2, install the latest compatible version with this command:

   pip install ansys-dpf-core<0.16.0

To use PyDPF-Core with Ansys 2022 R1, install the latest compatible version with this command:

   pip install ansys-dpf-core<0.10.0

To use PyDPF-Core with Ansys 2021 R2, install the latest compatible version with this command:

   pip install ansys-grpc-dpf<0.4.0; pip install ansys-dpf-core<0.10.0

To use PyDPF-Core with Ansys 2021 R1, install the latest compatible version with this command:

   pip install ansys-grpc-dpf<0.3.0; pip install ansys-dpf-core<0.3.0

Brief demo

Provided you have DPF available, a DPF server automatically starts once you start using PyDPF-Core.

To open a result file and explore what's inside, use this code:

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> model = dpf.Model(examples.find_simple_bar())
>>> print(model)

    DPF Model
    ------------------------------
    Static analysis
    Unit system: Metric (m, kg, N, s, V, A)
    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
         -  structural_temperature: ElementalNodal 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               

Read a result with this command:

>>> result = model.results.displacement.eval()

Then, start connecting operators with this code:

>>> from ansys.dpf.core import operators as ops
>>> norm = ops.math.norm(model.results.displacement())

Starting the service

The ansys.dpf.core library automatically starts a local instance of the DPF service in the background and connects to it. If you need to connect to an existing remote or local DPF instance, use the connect_to_server method:

>>> from ansys.dpf import core as dpf
>>> dpf.connect_to_server(ip='10.0.0.22', port=50054)

Once connected, this connection remains for the duration of the module. It closes when you exit Python or connect to a different server.

License and acknowledgments

PyDPF-Core is licensed under the MIT license. For more information, see the LICENSE file.

PyDPF-Core makes no commercial claim over Ansys whatsoever. This library extends the functionality of Ansys DPF by adding a Python interface to DPF without changing the core behavior or license of the original software.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ansys_dpf_core-0.16.0-py3-none-win_amd64.whl (8.5 MB view details)

Uploaded Python 3Windows x86-64

ansys_dpf_core-0.16.0-py3-none-manylinux_2_17_x86_64.whl (12.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

ansys_dpf_core-0.16.0-py3-none-manylinux1_x86_64.whl (12.5 MB view details)

Uploaded Python 3

ansys_dpf_core-0.16.0-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

Details for the file ansys_dpf_core-0.16.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for ansys_dpf_core-0.16.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a9d62f75ad0f40c2952465209895d3f40ccf10138947526abfc55abbd871b527
MD5 27b0ca228539235933cfe963f84c4b52
BLAKE2b-256 ab496237ad0192ec69dcb8aa0268f936a421f45e8dd23bc2d6d1d7f7392b8bbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansys_dpf_core-0.16.0-py3-none-win_amd64.whl:

Publisher: releaser.yml on ansys/pydpf-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ansys_dpf_core-0.16.0-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for ansys_dpf_core-0.16.0-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0416ddf22aca0b40388a6c0482322ea9fb623f58569c0da8a6da5429a8d1400f
MD5 5de2f21c71578a1913b652199806140d
BLAKE2b-256 60cb468dfc2c50e093356d6323079c2ce2f2b5b5816fe5750a6efd27b8d148e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansys_dpf_core-0.16.0-py3-none-manylinux_2_17_x86_64.whl:

Publisher: releaser.yml on ansys/pydpf-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ansys_dpf_core-0.16.0-py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for ansys_dpf_core-0.16.0-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ecfcb7ddbad0914195c109be2ffd566b66d5b0e0d5f18a516d2be5f2cbe54cad
MD5 1c8d5881f63a700cdc008be2b6976601
BLAKE2b-256 9d38ec8ff4e0bb06cdd29ee2df613231b7b70c4903141a32bcdb88a30cbb22cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansys_dpf_core-0.16.0-py3-none-manylinux1_x86_64.whl:

Publisher: releaser.yml on ansys/pydpf-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ansys_dpf_core-0.16.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ansys_dpf_core-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 464e6762f5eca8a598267aaeafcaba625e8f9b44da6928a3442a9ea9b9fc9c55
MD5 8181ca25336652ea8694312fe7f1d24c
BLAKE2b-256 b68a6a0f03dc482fecfae2d8a9fce14c592c1d6de34c7bdc9dc9b2658bcc283a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ansys_dpf_core-0.16.0-py3-none-any.whl:

Publisher: releaser.yml on ansys/pydpf-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page