[ANSYS, Inc. Logo] return to home search
next up previous contents index

2.2.7 DEFINE_EXECUTE_AFTER_CASE/DATA



Description


DEFINE_EXECUTE_AFTER_CASE and DEFINE_EXECUTE_AFTER_DATA are general-purpose macros that can be used to specify a function that executes after the case and/or data file is read in ANSYS FLUENT. This is useful because it provides access to UDF functions after the case and/or data file is read.

Compiled UDF libraries are loaded using either the Compiled UDFs or the UDF Library Manager dialog box (see Section  5.5).

figure   

DEFINE_EXECUTE_AFTER_CASE and DEFINE_EXECUTE_AFTER_DATA UDFs can be executed only as compiled UDFs.



Usage



DEFINE_EXECUTE_AFTER_CASE( name, libname) or
DEFINE_EXECUTE_AFTER_DATA( name, libname)


Argument Type Description
symbol name UDF name.
char *libname compiled UDF library name.
   
Function returns  
void  
   

There are two arguments to DEFINE_EXECUTE_AFTER_CASE and DEFINE_EXECUTE_AFTER_DATA: name and libname. You supply a name for the UDF which will be used by ANSYS FLUENT when reporting that the EXECUTE_AFTER_CASE or EXECUTE_AFTER_DATA UDF is being run. The libname is set by ANSYS FLUENT to be the name of the library (e.g., libudf) that you have specified (by entering a name or keeping the default libudf). libname is passed so that you can use it in messages within your UDF.



Example


The following simple UDF named after_case and after_data, prints a message to the console that contains the name of the library being loaded.

#include "udf.h"
 
DEFINE_EXECUTE_AFTER_CASE(after_case, libname)

{
Message("EXECUTE_AFTER_CASE called from $s\n", libname);

}
DEFINE_EXECUTE_AFTER_DATA(after_data, libname)

{
Message("EXECUTE_AFTER_DATA called from $s\n", libname);
}



Hooking an Execute After Reading Case and Data File UDF to ANSYS FLUENT


After the UDF that you have defined using DEFINE_EXECUTE_AFTER_CASE or DEFINE_EXECUTE_AFTER_DATA is compiled (Chapter  5), the function will not need to be hooked to ANSYS FLUENT through any graphics dialog boxes. Instead, ANSYS FLUENT searches the newly-loaded library for any UDFs of the type EXECUTE_AFTER_CASE or EXECUTE_AFTER_DATA, and will automatically execute them in the order they appear in the library.


next up previous contents index Previous: 2.2.6 DEFINE_EXECUTE_ON_LOADING
Up: 2.2 General Purpose DEFINE
Next: 2.2.8 DEFINE_INIT
Release 12.0 © ANSYS, Inc. 2009-01-14