Giter VIP home page Giter VIP logo

pydpf-core's Introduction

DPF - Ansys Data Processing Framework

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

The 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.

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.

.. image:: https://github.com/ansys/pydpf-core/raw/main/docs/source/images/drawings/dpf-flow.png :width: 670 :alt: 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

Visit the DPF-Core Documentation for comprehensive information on this library. See the Examples for how-to information.

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 ansys-dpf-server server package or with Ansys 2021 R2 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[plotting]

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

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

   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.

pydpf-core's People

Contributors

cbellot000 avatar pprofizi avatar anslpa avatar akaszynski avatar dependabot[bot] avatar rlagha avatar pipkat avatar guillembarroso avatar jleonatti avatar github-actions[bot] avatar ayush-kumar-423 avatar ansys-akaszyns avatar rafacanton avatar janvonrickenbach avatar robpasmue avatar jennapaikowsky avatar guptadivya1501 avatar ansys-akarcher avatar jorgepiloto avatar plule-ansys avatar jose-henriquezroa avatar thegoldfish01 avatar revathyvenugopal162 avatar jviqueg avatar vsousacosta avatar kmahajan-cadfem avatar hoangxuyenle avatar michaelnale avatar maxjprey avatar jfthuong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.