Getting Started

Architecture

DPF-Core is a python grpc client communicating with the Ans.Dpf.Grpc server. To use the native DPF server, you need to have a local installation of Ansys 2021R2. Visit https://www.ansys.com/ for more information on getting a licensed copy of Ansys.

Installation

Installation with PIP

Once you’ve installed Ansys 2021R1 or newer, you can install DPF with:

pip install ansys-dpf-core

This will install the latest version of ansys-dpf-core and all the necessary dependencies.

If you are unable to install the module on the host machine due to network isolation, download the latest release wheel at DPF-Core GitHub or from PyPi at DPF-Core PyPi

Editable Install (Development Mode)

If you wish to edit and potentially contribute to the DPF-Core python module, clone the repository and install it using pip with the -e development flag.

git clone https://github.com/pyansys/DPF-Core
cd DPF-Core
pip install -e .

Try Installation

A quick try out of the installation can be done with:

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

Dependencies

DPF-Core dependencies are automatically checked installed when the packages is installed. Those dependencies are:

  • ansys.grpc.dpf : package with grpc code generated from protobufs

  • psutil

  • progressbar2

Optional Dependencies

Optional dependencies can be installed for specific usage:

  • matplotlib : for chart plotting

  • pyvista : for 3D plotting

  • scooby : for dependency reports

Compatibility

As of 20201R2, DPF supports Windows 10 and CentOS 7 and newer. For more details, see Ansys Platform Support.

Other platforms may be supported by using DPF within a containerization ecosystem such as Docker or Kubernetes. See Using DPF Through Docker for more details.