You can create your own customized program using the 'C' programming language or Fortran programming language. A number of API functions are provided in a library supplied with the Ansys CFX installation. For details, see Details of the Mesh Import API.
The installation contains a C source code example file that
can be used as the basis of your custom executable. This file, ImportTemplate.c, is provided in <CFXROOT>
/examples/, and is listed in: An Example of a Customized C Program for Importing Meshes into CFX-Pre.
The basic structure of a program written to import a 3rd-party mesh into CFX-Pre is as follows:
Inclusion of the cfxImport.h header file (for C programs and not Fortran programs).
Initialization for import with the
cfxImportInit
routine.Definition of node data with
cfxImportNode
.Definition of element data with
cfxImportElement
.Optionally, definitions of 2D and 3D regions with either
cfxImportRegion
or the following three functions:cfxImportBegReg
,cfxImportAddReg
,cfxImportEndReg
Data transfer with
cfxImportDone
.
The header files associated with the API are located in <CFXROOT>
/include/. If you do not use the header
file cfxImport.h, the functionality of the routines
contained within the API may not follow defined behavior.
After writing the program, you will need to compile the source code. For details, see Compiling Code with the Mesh Import API.
You will also need to link your routine with the API routine libraries. For details, see Linking Code with the Mesh Import API.
After a customized executable has been produced, it can be run in CFX-Pre. For details, see User Import.