AFLR2C Integration
AFLR2C can be integrated within other systems relatively easily.
Integration requires access to and installation of the AFLR2C developer
libary package file AFLR2C_LIB.*. Installation of package files is described in
the links shown on the SimSys
Software page and the developer installation is described
specifically in SimSys Developer_Install
and Setup Instructions (pdf). Integration is typically handled
individually. Please contact David L. Marcum for assistance. AFLR2C
also allows for integration with external routines to replace built-in
functionality. A common request is for integration of alternative sizing
functions and is described below.
External Sizing Function Integration
AFLR2C can be built using externally defined procedures for the
distribution function, metric and/or transformation vectors. To add your own
external procedures to AFLR2C the names of the routines with those
procedures must be registered. The registration routines are part of the DFTR2
library, libdftr2.a. If the routines are registered in
the main or driver routine then AFLR2C will have the capability to use
the external routines to evaluate the distribution function, metric and/or
transformation vectors when new nodes are created during field grid generation.
To register the external routines then either of the DFTR2 registration
routines dftr2_register_eval_inl or dftr2_register_eval_inl_flag_data must be
called with the names of those routines. The DFTR2 registration routines are
within the file dftr2_ext_eval.c in the src/dftr2 directory. Calls to register
the routine names must be added to the main program, aflr2c.c, or whatever
routine is used to call aflr2_grid_generator (see built-in example within
aflr2c.c that is registered with dftr2_register_eval). Replace the call to
dftr2_register_eval and the call to dftr2_register_eval_inl with your routines.
The evaluation routine must be registered using dftr2_register_eval and one of
the initialization routines must be registered. Either the full initialization
routine must be registered with dftr2_register_eval_inl or the flag
initialization routine must be registered with
dftr2_register_eval_inl_flag_data. Example external evaluation routines are
provided within the DFTR2 library in file dftr2_test_eval.c. After
re-compilation the modified program will use the external routines.
If you are using the provided SimSys scripts (suggested) to build AFLR2C
then the following will re-link the AFLR2C executable, aflr2c.exe (assuming all
other libraries are as provided or have been rebuilt).
simsys_compile aflr2c+exe [other options]
This compiles the main program aflr2c.c, links the appropriate libraries and
builds the executeable aflr2c.exe. The above command assumes you add your
routine to the aflr2c.c file or added a #include of your source code to it.
Otherwise additional options must be included. Use the following command
simsys_compile -help
for a description of options. If you add your code to the DFTR2 library
then use the following.
simsys_compile dftr2 aflr2c+exe [other options]
This compiles any files in the dftr2 source directory that are newer than the
corresponding object code in the existing DFTR2 object code library, compiles
the main program aflr2c.c, links the appropriate libraries and builds the
executeable aflr2c.exe. Here the order is important as the DFTR2 library must
be updated before AFLR2C is built. If your external routines are
included in a separate library then you must compile it separately and add that
library name to the compile options using a -llib_name. You can add a
search path for the library using -Ldir and for include files using -Idir.
The options -l, -L, and -I have the same meaning as they do in a standard
compiler or linker like gcc.
A few examples on use of AFLR2C with an external sizing function are
provided at the end of the AFLR2C Example
Cases Tutotrial.
AFLR2C Home