AFLR3 Developer Integration Notes
AFLR3 can be integrated within other systems relatively easily. Integration
requires access to and installation of the AFLR3 developer libary package file AFLR3_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. AFLR3
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
AFLR3 can be built using externally defined procedures for the
distribution function, metric and/or transformation vectors. To add your own
external procedures to AFLR3 the names of the routines with those
procedures must be registered. The registration routines are part of the DFTR3
library, libdftr3.a. If the routines are registered in
the main or driver routine then AFLR3 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 DFTR3 registration
routines dftr3_register_eval_inl or dftr3_register_eval_inl_flag_data must be
called with the names of those routines. The DFTR3 registration routines are
within the file dftr3_ext_eval.c in the src/dftr3
directory. Calls to register the routine names must be added to the main
program, aflr3.c, or whatever routine is used to call aflr3_grid_generator (see
built-in example within aflr3.c that is registered with dftr3_register_eval).
Replace the call to dftr3_register_eval and the call to dftr3_register_eval_inl
with your routines. The evaluation routine must be registered using
dftr3_register_eval and one of the initialization routines must be registered.
Either the full initialization routine must be registered with
dftr3_register_eval_inl or the flag initialization routine must be registered
with dftr3_register_eval_inl_flag_data. Example external evaluation routines
are provided within the DFTR3 library in file dftr3_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 AFLR3 then the following will re-link the AFLR3
executable, aflr3.exe (assuming all other libraries are as provided or have
been rebuilt).
simsys_compile
aflr3+exe [other options]
This compiles the main program aflr3.c, links the appropriate libraries and
builds the executeable aflr3.exe. The above command
assumes you add your routine to the aflr3.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 DFTR3 library
then use the following.
simsys_compile dftr3
aflr3+exe [other options]
This compiles any files in the dftr3 source directory that are newer than the
corresponding object code in the existing DFTR3 object code library, compiles
the main program aflr3.c, links the appropriate libraries and builds the
executable aflr3.exe. Here the order is important as the DFTR3 library must be
updated before AFLR3 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.
Note that AFLR2C has a similar capability for 2D with the DFTR2 library.
If you generate a volume grid in 3D using AFLR3 then there is no need to
add code for a 2D version of your procedure to evaluate the distribution
function, metric, and/or transformation vectors. Registering external 2D
procedures is only required to use AFLR2C in purely 2D mode.
AFLR3 calls AFLR2C routines through the ANBL3 library when
generating a volume grid with a BL region and one or more boundary surfaces
that intersect the BL region. During regeneration of those surfaces the 2D
routines that evaluate the distribution function, metric and/or transformation
vectors will call their 3D equivalents. The 3D metric or transformation vectors
will be projected onto the surface being regenerated (metric
projection/intersection is not currently implemented).
A few examples on use of AFLR3 with an external sizing function are
provided at the end of the AFLR3 Example
Cases Tutorial.
AFLR3 Home