PyANSYS DPF-Core

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.

Brief Demo

Opening a result file generated from MAPDL (or other of ANSYS solvers) and extracting results from it is as easy as:

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

Out:

DPF Model
------------------------------
DPF Result Info
  Analysis: static
  Physics Type: mecanic
  Unit system: MKS: m, kg, N, s, V, A, degC
  Available results:
    U Displacement :nodal displacements
    ENF Element nodal Forces :element nodal forces
    ENG_VOL Volume :element volume
    ENG_SE Energy-stiffness matrix :element energy associated with the stiffness matrix
    ENG_AHO Hourglass Energy :artificial hourglass energy
    ENG_TH thermal dissipation energy :thermal dissipation energy
    ENG_KE Kinetic Energy :kinetic energy
    ENG_CO co-energy :co-energy (magnetics)
    ENG_INC incremental energy :incremental energy (magnetics)
    BFE Temperature :element structural nodal temperatures
------------------------------
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
disp = model.results.displacement().X()
model.metadata.meshed_region.plot(disp.outputs.fields_container())

Out:

_images/simple_example.png

See the Examples Gallery for detailed examples.

Key Features

Computation Efficiency

DPF is a modern framework and it has been developed by taking advantages of new hardware architectures. Thanks to continued development, new capabilities are frequently added.

Generic Interface

DPF is physic agnostic. Thus, its use is not limited to a particular field, physics solution, or file format.

Extensibility and Customization

DPF is developed around a two core entities: data represented as a field, and the operator to act upon that data. Each DPF capability is developed through operators which allows for a componentization of the framework. DPF is also plugin based, allowing new features or new formats to be easily added within the operators framework.