Licensing#
This section details how to properly set up licensing, as well as what the user should expect in terms of limitations or license usage when running PyDPF scripts.
DPF follows a client-server architecture, which means that the PyDPF client library must interact with a running DPF Server. It either starts a DPF Server via a local installation of DPF Server, 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, the user has already agreed to the licensing terms when installing Ansys.
When using a standalone DPF Server, the user must accept the DPF Preview License Agreement
by following the indications below.
Starting a DPF Server without agreeing to the DPF Preview License Agreement
throws 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 need to 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 check-out a compatible license increment.
DPF is by default allowed to check-out license increments as needed. To change this behavior, see here.
To know if operators require a license increment check-out 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 here.
Even if an operator does not require a license check-out to run, most DPF operators still require DPF to check for a reachable license server or license file.
Operators which do not perform any kind of license check are source operators (data extraction operators) which 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:
preppost
available in theAnsys Mechanical Enterprise PrepPost
productmeba
available in theANSYS Mechanical Enterprise Solver
productmech_2
available in theANSYS Mechanical Premium
productmech_1
available in theANSYS Mechanical Pro
productansys
available in theANSYS Mechanical Enterprise
productdynapp
available in theANSYS LS-DYNA PrepPost
productdyna
available in theANSYS LS-DYNA
productvmotion
available in theAnsys Motion
productacpreppost
available in theAnsys Mechanical Enterprise
productacdi_adprepost
available in theAnsys AUTODYN
andAnsys AUTODYN PrepPost
productscfd_preppost
available in theAnsys CFD Enterprise
productcfd_preppost_pro
available in theAnsys CFD Enterprise
productvmotion_post
available in theAnsys Motion Post
productvmotion_pre
available in theAnsys Motion Pre
productadvanced_meshing
available in theAnsys CFD Enterprise
productfluent_meshing_pro
available in theAnsys CFD Enterprise
productfluent_setup_post
available in theAnsys CFD Enterprise
productfluent_setup_post_pro
available in theAnsys CFD Enterprise
productacfx_pre
available in theAnsys CFD Enterprise
productcfd_base
available in theAnsys CFD Enterprise
productcfd_solve_level1
available in theAnsys CFD Enterprise
productcfd_solve_level2
available in theAnsys CFD Enterprise
productcfd_solve_level3
available in theAnsys CFD Enterprise
productfluent_meshing
available in theAnsys CFD Enterprise
productavrxp_snd_level1
available in theAnsys Sound Pro
productsherlock
available in theAnsys Sherlock
product
Each increment may be available in other products. On the Ansys Customer Portal, the Licensing section provides product/increment mapping.