|
[Sponsors] |
January 27, 2015, 05:34 |
philosophy of using Headers!
|
#1 |
New Member
Majid Zarif
Join Date: May 2014
Posts: 19
Rep Power: 12 |
Hi Every body
I know that every UDF file should include #include "udf.h" but I saw other things like: sg.h or prop.h do any body know how can we understand how to use these headers?and also WHY we use them? Thanks |
|
January 27, 2015, 11:04 |
|
#2 |
Senior Member
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25 |
Header files in C are essentially just another container for functions, variable declarations, and macros. They are not usually compiled by themselves into a standalone executable files. "Proper use" of header files are mostly to provide function prototypes for functions that are defined in a different .c file or exist in a pre-compiled library or executable, and maybe some supporting macros.
That is the case with udf.h. That header file (and it is distributed as source code with FLUENT ANSYS) has function prototypes and (many) macro definitions. F_C0, C_UDMI, etc are all defined as macros. All of the variables, function prototypes, and macros that UDFs generally need to access are defined in the udf.h file. But, there are other header files as well and those may contain function prototype/macro definitions that are not in udf.h but still may be useful. What those variables are and what use they are can only be sorted out by careful reading of the header files and trial-and-error testing, or by getting documentation or assistance from ANSYS. |
|
January 27, 2015, 13:43 |
|
#3 |
New Member
Majid Zarif
Join Date: May 2014
Posts: 19
Rep Power: 12 |
So it's essential to know other header's usage in UDF ?
I mean I can always use udf.h instead of these headers? |
|
January 27, 2015, 13:46 |
|
#4 |
Senior Member
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25 |
Likely not. udf.h has most everything you should need to code UDFs.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
can not include Windows.h and sys/stat.h headers | eromon84 | Fluent UDF and Scheme Programming | 3 | February 7, 2017 06:38 |
[ICEM] Blocking Philosophy Query | aerospaceman | ANSYS Meshing & Geometry | 4 | June 15, 2011 12:46 |
Borked license headers | mwild | OpenFOAM Bugs | 2 | July 2, 2010 05:34 |
ubuntu 9.10 64bit - wmake missing headers | soeren87 | OpenFOAM Installation | 5 | November 11, 2009 11:01 |
Philosophy of implicit solution of different regions | Louis Le Grange | OpenFOAM | 0 | October 5, 2009 11:53 |