An External function (

) interfaces to other external functions written in the C language (using a native C function or, through a wrapper function, interfacing with source code written in, for example, Fortran). Then use those functions as any other functions defined in COMSOL. For example, use it for a user-created shared library (depending on the platform, a DLL, .so, or .dylib file).
Enter a Library path and name (the complete network path), or click
Browse to locate a library to import. For each row in the table, enter a
Function name (
myfun, for example) and a space-separated or comma-separated list of the names of its input
Arguments (
x y, for example).
Enter a value in the Initialization data field. The value is sent to the library when it is loaded. Select the
Thread safe check box to declare that the function is a thread-safe pure function (that is, a function that always returns the same results using the same input argument values and that do not have any side effects or output). Select this check box to then improve performance.