Skip to main content

DPF Python gRPC client

Project description

DPF - Ansys Data Processing Framework

PyPI version

Build Status

The Data Processing Framework (DPF) is designed to provide numerical simulation users/engineers with a toolbox for accessing and transforming simulation data. DPF can access data from solver result files as well as several neutral formats (csv, hdf5, vtk, etc.). Various operators are available allowing the manipulation and the transformation of this data.

DPF is a workflow-based framework which allows simple and/or complex evaluations by chaining operators. The data in DPF is defined based on physics agnostic mathematical quantities described in a self-sufficient entity called field. This allows DPF to be a modular and easy to use tool with a large range of capabilities. It's a product designed to handle large amount of data.

The Python ansys.dpf.core module provides a Python interface to the powerful DPF framework enabling rapid post-processing of a variety of Ansys file formats and physics solutions without ever leaving a Python environment.

Documentation

Visit the DPF-Core Documentation for a detailed description of the library, or see the Examples Gallery for more detailed examples.

Installation

Install this repository with:

pip install ansys-dpf-core 

You can also clone and install this repository with:

git clone https://github.com/pyansys/pydpf-core
cd pydpf-core
pip install . --user

Running DPF

See the example scripts in the examples folder for some basic example. More will be added later.

Brief Demo

Provided you have ANSYS 2021R1 or higher installed, a DPF server will start automatically once you start using DPF.

To open a result file and explore what's inside, do:

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

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

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

Then start connecting operators with:

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

Starting the Service

The ansys.dpf.core 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 function:

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

Once connected, this connection will remain for the duration of the module until you exit python or connect to a different server.

Project details


Download files

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

Source Distribution

ansys-dpf-core-0.4.0.tar.gz (9.9 MB view details)

Uploaded Source

Built Distribution

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

ansys_dpf_core-0.4.0-py3-none-any.whl (10.7 MB view details)

Uploaded Python 3

File details

Details for the file ansys-dpf-core-0.4.0.tar.gz.

File metadata

  • Download URL: ansys-dpf-core-0.4.0.tar.gz
  • Upload date:
  • Size: 9.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for ansys-dpf-core-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5bbb7392b56bef4ab536332955ca13637652883bfcc86bc1aa3d9c3e4f198e9b
MD5 34c88c28439ad10a94ede040fbcf3954
BLAKE2b-256 b98d9c0a08f173b0fd88d32cabe29ebd51b4c29ebf44ec7457b52a9604671a9d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ansys_dpf_core-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for ansys_dpf_core-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43ddcf6a162d505eac464ca9c41591680131e9adbe7a5444aeb639d9019af7f9
MD5 b49c4d581355fea90ae87889ac67f5db
BLAKE2b-256 55053cc734fe3bcc018567f35a2c813e4f3227e45f0a6f28e577f0d0c0e72f52

See more details on using hashes here.

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