Package: ansys-dpf-core
DPF - Ansys Data Processing FrameworkAnsys 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)LS-DYNA (.d3plot,.binout)Fluent (.cas/dat.h5,.flprj)CFX (.cad/dat.cff,.flprj)For more information on file support, see themain pagein 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 calledfields. This allows DPF to be
a modular and easy-to-use tool with a large range of capabilities.Theansys.dpf.corepackage 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 issuesDocumentation for the latest stable release of PyDPF-Core is hosted atPyDPF-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 alsoviewordownloadthe
PyDPF-Core cheat sheet. This one-page reference provides syntax rules and commands
for using PyDPF-Core.On thePyDPF-Core Issuespage,
you can create issues to report bugs and request new features. On thePyDPF-Core Discussionspage or theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, emailpyansys.core@ansys.com.InstallationPyDPF-Core requires DPF to be available. You can either have a compatible Ansys version installed
or install the standaloneansys-dpf-serverserver package. For more information, seeGetting Started with DPF Serverin the PyDPF-Core documentation.For the compatibility between PyDPF-Core and Ansys, seeCompatibilityin
the PyDPF-Core documentation.To use PyDPF-Core with theansys-dpf-serverserver package or with Ansys 2022 R2 or later,
install the latest version with this command:pip install ansys-dpf-corePyDPF-Core plotting capabilities requirePyVista <https://pyvista.org/>_ to be installed.
To install PyDPF-Core with its optional plotting functionalities, use this command:pip install ansys-dpf-core[plotting]For more information on PyDPF-Core plotting capabilities, seePlotin the PyDPF-Core documentation.To use PyDPF-Core with Ansys 2022 R1, install the latest compatible version
with this command:pip install ansys-dpf-core<0.10.0To 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.0To 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.0Brief demoProvided 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:>>>fromansys.dpfimportcoreasdpf>>>fromansys.dpf.coreimportexamples>>>model=dpf.Model(examples.find_simple_bar())>>>print(model)DPF Model------------------------------Static analysisUnit system: Metric (m, kg, N, s, V, A)Physics Type: MechanicalAvailable 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 nodes3000 elementsUnit: mWith solid (3D) elements------------------------------DPF  Time/Freq Support:Number of sets: 1Cumulative     Time (s)       LoadStep       Substep1              1.000000       1              1Read a result with this command:>>>result=model.results.displacement.eval()Then, start connecting operators with this code:>>>fromansys.dpf.coreimportoperatorsasops>>>norm=ops.math.norm(model.results.displacement())Starting the serviceTheansys.dpf.corelibrary 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 theconnect_to_servermethod:>>>fromansys.dpfimportcoreasdpf>>>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 acknowledgmentsPyDPF-Core is licensed under the MIT license. For more information, see theLICENSEfile.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.