Licensing#
This section describes how to properly set up licensing, as well as limitations and license usage when running PyDPF scripts.
DPF follows a client-server architecture, so the PyDPF client library must interact with a running DPF Server. It either starts a DPF Server via a local DPF Server installation, or it connects to an already running local or remote DPF Server.
DPF Server is packaged within the Ansys installer in Ansys 2021 R1 and later. It is also available as a standalone application. For more information on installing DPF Server, see DPF Server.
License terms#
When using the DPF Server from an Ansys installation, you have already agreed to the licensing terms when installing Ansys.
When using a standalone DPF Server, you must accept the DPF Preview License Agreement
by following the indications below.
Starting a DPF Server without agreeing to the DPF Preview License Agreement creates an exception.
DPF Preview License Agreement#
The standalone versions of DPF Server are protected using license terms specified in the DPFPreviewLicenseAgreement
file that can be found on the DPF Pre-Release page
of the Ansys Customer Portal.
The DPFPreviewLicenseAgreement file is a text file, which means that you can open it with a text editor, such as Notepad.
To accept the terms of this license agreement, you must set the following environment variable:
ANSYS_DPF_ACCEPT_LA=Y
The ANSYS_DPF_ACCEPT_LA environment variable confirms your acceptance of the DPF License Agreement.
By passing the value Y to this environment variable, you are indicating that you have a valid and
existing license for the edition and version of DPF Server that you intend to use.
Configure licensing#
If your machine does not have a local Ansys installation, you must define where DPF should look for a valid license.
To use a local license file, set the ANSYSLMD_LICENSE_FILE environment
variable to point to an Ansys license file <license_file_to_use>:
ANSYSLMD_LICENSE_FILE=<license_file_to_use>
To use a remote license, set the ANSYSLMD_LICENSE_FILE environment
variable to point to an Ansys license server <license_server_to_use>:
ANSYSLMD_LICENSE_FILE=1055@<license_server_to_use>
For DPF Docker container usage only, you can use the following code to set both the ANSYS_DPF_ACCEPT_LA
and ANSYSLMD_LICENSE_FILE environment variables. For the ANSYSLMD_LICENSE_FILE environment variable,
ensure that you replace <license_server_to_use> to point to the Ansys license server.
docker run -e "ANSYS_DPF_ACCEPT_LA=Y" -e ANSYSLMD_LICENSE_FILE=1055@<license_server_to_use> -p 50052:50052 -e DOCKER_SERVER_PORT=50052 --expose=50052 dpf-core:v2024_2_pre0
The next section provides information on the Ansys license mechanism that is used with DPF Server.
License checks and usage#
Some DPF operators require DPF to check for an existing license and some require DPF to checkout a compatible license increment.
DPF is by default allowed to checkout license increments as needed. To change this behavior, see here.
To know if operators require a license increment checkout to run, check their license
attribute in Operators or directly in Python by checking the operator’s
properties for a license key:
import ansys.dpf.core as dpf
operator = dpf.operators.averaging.elemental_difference()
print(operator.specification.properties)
{'category': 'averaging', 'exposure': 'public', 'license': 'any_dpf_supported_increments', 'plugin': 'core', 'scripting_name': 'elemental_difference', 'user_name': 'elemental difference (field)'}
To check which Ansys licensing increments correspond to any_dpf_supported_increments,
see Compatible Ansys license increments.
Even if an operator does not require a license checkout to run, most DPF operators still require DPF to check for a reachable license server or license file.
Operators that do not perform any kind of license check are source operators (data extraction operators). These operators do not perform any data transformation.
For example, when considering result operators, they perform data transformation if the requested location is not the native result location. In that case, averaging occurs which is considered as data transformation (such as elemental to nodal, nodal to elemental, or any other location change).
Server context#
You can allow or prevent licensed operators from running and using a license with a server context:
Premium: This default context allows DPF to perform license checkouts, making licensed DPF operators available.
Entry: This context does not allow DPF to perform any license checkout, meaning that licensed DPF operators fail.
To update the context, apply a new server context:
server.apply_context(dpf.AvailableServerContexts.premium)
Licensing errors#
The following user actions may fail due to licensing:
Starting a standalone DPF Server may fail due to the
DPF Preview License Agreement(see License terms).Creating an operator may fail if the operator performs data transformation and no license server or license file is found (see License checks and usage).
Running an operator requiring a license checkout may fail if no compatible license increment is available or if the DPF Server context is Entry, preventing any license check-out (see Server context).
Compatible Ansys license increments#
The following Ansys licensing increments provide rights to use the licensed DPF capabilities:
preppostavailable in theAnsys Mechanical Enterprise PrepPostproductmebaavailable in theANSYS Mechanical Enterprise Solverproductmech_2available in theANSYS Mechanical Premiumproductmech_1available in theANSYS Mechanical Proproductansysavailable in theANSYS Mechanical Enterpriseproductdynappavailable in theANSYS LS-DYNA PrepPostproductdynaavailable in theANSYS LS-DYNAproductvmotionavailable in theAnsys Motionproductacpreppostavailable in theAnsys Mechanical Enterpriseproductacdi_adprepostavailable in theAnsys AUTODYNandAnsys AUTODYN PrepPostproductscfd_preppostavailable in theAnsys CFD Enterpriseproductcfd_preppost_proavailable in theAnsys CFD Enterpriseproductvmotion_postavailable in theAnsys Motion Postproductvmotion_preavailable in theAnsys Motion Preproductadvanced_meshingavailable in theAnsys CFD Enterpriseproductfluent_meshing_proavailable in theAnsys CFD Enterpriseproductfluent_setup_postavailable in theAnsys CFD Enterpriseproductfluent_setup_post_proavailable in theAnsys CFD Enterpriseproductacfx_preavailable in theAnsys CFD Enterpriseproductcfd_baseavailable in theAnsys CFD Enterpriseproductcfd_solve_level1available in theAnsys CFD Enterpriseproductcfd_solve_level2available in theAnsys CFD Enterpriseproductcfd_solve_level3available in theAnsys CFD Enterpriseproductfluent_meshingavailable in theAnsys CFD Enterpriseproductavrxp_snd_level1available in theAnsys Sound Proproductsherlockavailable in theAnsys Sherlockproduct
Each increment may be available in other products. On the Ansys Customer Portal, the Licensing section provides product/increment mapping.