Pre-requisites
In order to use DPF in a C++ project, it is required to have access to the following files of the AWP_ROOT251/dpf/include folder (AWP_ROOT251 being an environment variable defining the root of the Ansys Inc or DPF Server product):- dpf_api.h
- dpf_api_i.cpp
set DPF_HGP_ROOT=%AWP_ROOT251%/dpf/include
It can also be set by editing the environment variables in Windows settings.
Here is the command for Linux: export DPF_HGP_ROOT=${AWP_ROOT251}/dpf/include
Moreover it is needed to have compilation tools. Both CMake and Visual Studio are supported for project management and compilation. Examples using both are provided in the following sections.
Create a DPF_Custom_Operators folder. The following sections of this tutorial are performed from this folder.
Create a C++ Custom operator’s library
This section details the C++ code to create a custom basic operator’s library. In the DPF_Custom_Operators folder previously created, create a MyCustomOperator.h file with the following content:- a name method (unique identifier)
- a specification method which defines and describes the operator inputs, outputs and data computation
- a run method which contains the data computation code