4. Report Writing - LogFile
The modules LogFile is designed to facilitate the generation of text and graphics content for report writing.
4.1. Log File Content - LogFile
The LogFile module is designed to generate text content for monitoring the progress of a finite element solution. The methods associated with a LogFile object are the following.
- Begin and end an instance of an object, generic object functions
vfx_LogFileBegin()
- create an instance of a LogFile objectvfx_LogFileEnd()
- destroy an instance of a LogFile objectvfx_LogFileError()
- return LogFile object error flag
- Operations
vfx_LogFileSetError()
- set error handler to use with LogFilevfx_LogFileSetObject()
- set attribute objects
- Output
vfx_LogFileTableInit()
- flag beginning of a tablevfx_LogFileTableTerm()
- flag end of a tablevfx_LogFileTableEntryc()
- create table entry with stringvfx_LogFileTableEntryd()
- create table entry with doublevfx_LogFileTableEntryi()
- create table entry with integervfx_LogFileTableEntry1()
- create one typed table entryvfx_LogFileTableEntry2()
- create two typed table entryvfx_LogFileTableEntry3()
- create three typed table entryvfx_LogFileTableEntry4()
- create four typed table entryvfx_LogFileTableEntry5()
- create five typed table entryvfx_LogFileTextString()
- write unformatted string
Instance a LogFile object using vfx_LogFileBegin()
.
Use vfx_LogFileSetObject()
to register the TextFun object where output
will be written to. Use vfx_LogFileSetError()
to use the internally-defined
error handler so all solver output is integrated with the TextFun object
registered. Send messages and/or tables to the log file using vfx_LogFileTextString()
and/or any of the table entry function variations.
Destroy an instance of a LogFile object using vfx_LogFileEnd()
.
4.2. Function Descriptions
The currently available LogFile functions are described in detail in this section.
-
vfx_LogFile *
vfx_LogFileBegin
(void) create an instance of a
LogFile object
Create an instance of a LogFile object. Memory is allocated for the object private data and the pointer to the object is returned.
Destroy an instance of a LogFile object using
void vfx_LogFileEnd (vfx_LogFile *logfile)
Return the current value of a LogFile object error flag using
Vint vfx_LogFileError (vfx_LogFile *logfile)
Returns: The function returns a pointer to the newly created LogFile object. If the object creation fails, NULL is returned.
-
void
vfx_LogFileEnd
(vfx_LogFile *p) destroy an instance of a LogFile object
-
Vint
vfx_LogFileError
(vfx_LogFile *p) return the current value of a LogFile object error flag
-
void
vfx_LogFileSetObject
(vfx_LogFile *p, Vint objecttype, Vobject *object) set attribute objects
Set a pointer to an attribute object. The TextFun object must be registered.
- Errors
SYS_ERROR_OBJECTTYPE
is generated if an improper objecttype is specified.
Parameters: - p – Pointer to LogFile object.
- objecttype – The object type identifier
x=VSY_TEXTFUN TextFun object
- object – Pointer to the object to be set.
-
void
vfx_LogFileTableInit
(vfx_LogFile *p, const Vchar *message) flag beginning of a table
Flag the beginning of a new table.
- Errors
SYS_ERROR_OPERATION
is generated ifvfx_LogFileTableInit()
has already been called without a correspondingvfx_LogFileTableTerm()
call to indicate the end of the table.
Parameters: - p – Pointer to LogFile object.
- message – Table title
-
void
vfx_LogFileTableEntryi
(vfx_LogFile *p, const Vchar *message, Vint ival) create table entry with string
-
void
vfx_LogFileTableEntryd
(vfx_LogFile *p, const Vchar *message, Vdouble dval) create table entry with string
-
void
vfx_LogFileTableEntryc
(vfx_LogFile *p, const Vchar *message, const Vchar *cvalue) create table entry with string
Adds a line to the table of the form
Parameters: - p – Pointer to LogFile object.
- message – Descriptive string
- cvalue – Value corresponding to descriptive string
-
void
vfx_LogFileTableEntry1
(vfx_LogFile *p, Vint type1, Vobject *value1) create one typed table entry
Adds a line to the table of the form
Parameters: - p – Pointer to LogFile object.
- type1 – Type of value
x=LOGFILE_STRING Null-terminated string =LOGFILE_SPACE A null-terminated string of spaces =LOGFILE_IMAGE File name with image =LOGFILE_INTEGER An integer value =LOGFILE_DOUBLE A double value =LOGFILE_FLOAT A float value
- value1 – Object with value data
-
void
vfx_LogFileTableEntry2
(vfx_LogFile *p, Vint type1, Vobject *obj1, Vint type2, Vobject *obj2) create one typed table entry
-
void
vfx_LogFileTableEntry3
(vfx_LogFile *p, Vint type1, Vobject *obj1, Vint type2, Vobject *obj2, Vint type3, Vobject *obj3) create one typed table entry
-
void
vfx_LogFileTableEntry4
(vfx_LogFile *p, Vint type1, Vobject *obj1, Vint type2, Vobject *obj2, Vint type3, Vobject *obj3, Vint type4, Vobject *obj4) create one typed table entry
-
void
vfx_LogFileTableEntry5
(vfx_LogFile *p, Vint type1, Vobject *obj1, Vint type2, Vobject *obj2, Vint type3, Vobject *obj3, Vint type4, Vobject *obj4, Vint type5, Vobject *obj5) create one typed table entry
-
void
vfx_LogFileTableTerm
(vfx_LogFile *p) flag end of a table
Flag the end of a table.
- Errors
SYS_ERROR_OPERATION
is generated ifvfx_LogFileTableInit()
has
Parameters: p – Pointer to LogFile object.
-
void
vfx_LogFileTextString
(vfx_LogFile *p, const Vchar *message) write unformatted string
Sends the string to the log file.
Parameters: - p – Pointer to LogFile object.
- message – String to be displayed
-
void
vfx_LogFileSetError
(vfx_LogFile *p) set error handler to use with LogFile
Set the error handler to a LogFile specific function which will stream error messages through LogFile. This function will replace the currently defined error handler and error object. Please see
vut_ErrorSetHandler()
andvut_ErrorSetObject()
.Parameters: p – Pointer to LogFile object.