|
| 1 | +.. _ref_dpf_server: |
| 2 | + |
| 3 | +========== |
| 4 | +DPF Server |
| 5 | +========== |
| 6 | + |
| 7 | +DPF provides numerical simulation users and engineers with a toolbox for accessing and transforming |
| 8 | +simulation data. With DPF, you can perform complex preprocessing or postprocessing of large amounts of simulation data within a |
| 9 | +simulation workflow. |
| 10 | + |
| 11 | +The DPF Server is packaged within the **Ansys installer** in Ansys 2021 R1 and later. |
| 12 | + |
| 13 | +It is also available as a standalone package that contains all the necessary files to run, enabling DPF capabilities. |
| 14 | +The standalone DPF Server is available on the `DPF Pre-Release page <https://download.ansys.com/Others/DPF%20Pre-Release>`_ of the Ansys Customer Portal. |
| 15 | +The first standalone version of DPF Server available is 6.0 (2023 R2). |
| 16 | + |
| 17 | +The sections on this page describe how to install and use a standalone DPF Server. |
| 18 | + |
| 19 | +* For a quick start on using PyDPF, see :ref:`ref_getting_started`. |
| 20 | +* For more information on DPF and its use, see :ref:`ref_user_guide`. |
| 21 | + |
| 22 | + |
| 23 | +Install DPF Server |
| 24 | +------------------ |
| 25 | + |
| 26 | +.. _target_installing_server: |
| 27 | + |
| 28 | +#. Download the ``ansys_dpf_server_win_v2024.2.pre0.zip`` or ``ansys_dpf_server_lin_v2024.2.pre0.zip`` file as appropriate. |
| 29 | +#. Unzip the package. |
| 30 | +#. Optional: download any other plugin ZIP file as appropriate and unzip the package. For example, to access the ``composites`` plugin for Linux, |
| 31 | + download ``ansys_dpf_composites_lin_v2024.2.pre0.zip`` and unzip the package in the same location as ``ansys_dpf_server_lin_v2024.2.pre0.zip``. |
| 32 | +#. Change to the root folder (``ansys_dpf_server_win_v2024.2.pre0``) of the unzipped package. |
| 33 | +#. In a Python environment, run this command: |
| 34 | + |
| 35 | +.. code:: |
| 36 | +
|
| 37 | + pip install -e . |
| 38 | +
|
| 39 | +
|
| 40 | +As detailed in :ref:`licensing`, a standalone DPF Server is protected using the license terms specified in the |
| 41 | +`DPFPreviewLicenseAgreement <https://download.ansys.com/-/media/dpf/dpfpreviewlicenseagreement.ashx?la=en&hash=CCFB07AE38C638F0D43E50D877B5BC87356006C9>`_ |
| 42 | +file, which is available on the `DPF Pre-Release page <https://download.ansys.com/Others/DPF%20Pre-Release>`_ |
| 43 | +of the Ansys Customer Portal. |
| 44 | +To accept these terms, you must set this environment variable: |
| 45 | + |
| 46 | +.. code:: |
| 47 | +
|
| 48 | + ANSYS_DPF_ACCEPT_LA=Y |
| 49 | +
|
| 50 | +To use :ref:`licensed DPF capabilities <target_to_ansys_license_mechanism>` you must set the |
| 51 | +``ANSYSLMD_LICENSE_FILE`` environment variable to point to a valid local or remote license |
| 52 | +following indications in :ref:`configure_licensing`. |
| 53 | + |
| 54 | + |
| 55 | +Use DPF Server |
| 56 | +-------------- |
| 57 | + |
| 58 | +DPF Server is protected using the license terms specified in the |
| 59 | +`DPFPreviewLicenseAgreement <https://download.ansys.com/-/media/dpf/dpfpreviewlicenseagreement.ashx?la=en&hash=CCFB07AE38C638F0D43E50D877B5BC87356006C9>`_ |
| 60 | +file, which is available on the `DPF Pre-Release page <https://download.ansys.com/Others/DPF%20Pre-Release>`_ |
| 61 | +of the Ansys Customer Portal. |
| 62 | + |
| 63 | +Run DPF Server with PyDPF |
| 64 | +~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 65 | + |
| 66 | +PyDPF-Core is a Python client API communicating with a **DPF Server**, either |
| 67 | +through the network using gRPC or directly in the same process. PyDPF-Post is a Python |
| 68 | +module for postprocessing based on PyDPF-Core. |
| 69 | + |
| 70 | +Both PyDPF-Core and PyDPF-Post can be used with DPF Server. Installation instructions |
| 71 | +for PyDPF-Core are available in the PyDPF-Core `Getting started <https://dpf.docs.pyansys.com/version/stable/getting_started/install.html>`_. |
| 72 | +Installation instructions for PyDPF-Post are available in the PyDPF-Post `Getting started <https://post.docs.pyansys.com/version/stable/getting_started/install.html>`_. |
| 73 | + |
| 74 | +With PyDPF-Core and PyDPF-Post, the first creation of most DPF entities starts a DPF Server with the current default configuration and context. |
| 75 | +For example, the following code automatically starts a DPF Server behind the scenes: |
| 76 | + |
| 77 | +.. code:: |
| 78 | +
|
| 79 | + from ansys.dpf import core as dpf |
| 80 | + data_sources = dpf.DataSources() |
| 81 | +
|
| 82 | +With PyDPF-Core, you can also explicitly start a DPF Server using this code: |
| 83 | + |
| 84 | +.. code:: |
| 85 | +
|
| 86 | + from ansys.dpf import core as dpf |
| 87 | + server = dpf.start_local_server() |
| 88 | +
|
| 89 | +To start a DPF Server from outside a Python environment, you can also use the execution script provided with your DPF Server package. |
| 90 | +On Windows, start the DPF Server by running the ``Ans.Dpf.Grpc.bat`` file in the unzipped package. |
| 91 | +On Linux, start the DPF Server by running the ``Ans.Dpf.Grpc.sh`` file in the unzipped package. |
| 92 | + |
| 93 | +Manage multiple DPF Server installations |
| 94 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 95 | + |
| 96 | +PyDPF automatically starts a local instance of a DPF Server when you run a method requiring a |
| 97 | +connection to a server, or when you use the ``start_local_server()`` method. |
| 98 | +The ``start_local_server()`` method allows to choose, if necessary, which DPF Server installation |
| 99 | +to use thanks to its ``ansys_path`` argument. |
| 100 | +PyDPF otherwise follows the logic below to automatically detect and choose which locally installed |
| 101 | +version of DPF Server to run: |
| 102 | + |
| 103 | +- it uses the ``ANSYS_DPF_PATH`` environment variable in priority if set and targeting a valid path to a DPF Server installation. |
| 104 | +- it then checks the currently active Python environment for any installed standalone DPF Server, and uses the latest version available. |
| 105 | +- it then checks for ``AWP_ROOTXXX`` environment variables, which are set by the **Ansys installer**, and uses the latest version available. |
| 106 | +- if then raises an error if all of the steps above failed to return a valid path to a DPF Server installation. |
| 107 | + |
| 108 | +Run DPF Server in a Docker container |
| 109 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 110 | +DPF Server can be run in a Docker container. |
| 111 | + |
| 112 | +#. Along with the ``ansys_dpf_server_lin_v2024.2.pre0.zip`` file mentioned earlier |
| 113 | + in :ref:`Install DPF Server <target_installing_server>`, download the ``Dockerfile`` file. |
| 114 | +#. Optional: download any other plugin ZIP file as appropriate. For example, to access the ``composites`` plugin for Linux, |
| 115 | + download ``ansys_dpf_composites_lin_v2024.2.pre0.zip``. |
| 116 | +#. Copy all the ZIP files and ``Dockerfile`` file in a folder and navigate into that folder. |
| 117 | +#. To build the DPF Docker container, run the following command: |
| 118 | + |
| 119 | +.. code:: |
| 120 | +
|
| 121 | + docker build . -t dpf-core:v2024.2.pre0 --build-arg DPF_VERSION=242 |
| 122 | +
|
| 123 | +5. To run the DPF Docker container, license it. For more information, see :ref:`DPF Preview License Agreement<target_to_license_terms>`. |
0 commit comments