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.

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

See vfx_LogFileBegin()

Vint vfx_LogFileError(vfx_LogFile *p)

return the current value of a LogFile object error flag

See vfx_LogFileBegin()

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 if vfx_LogFileTableInit() has already been called without a corresponding vfx_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

See vfx_LogFileTableEntryc()

void vfx_LogFileTableEntryd(vfx_LogFile *p, const Vchar *message, Vdouble dval)

create table entry with string

See vfx_LogFileTableEntryc()

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

See vfx_LogFileTableEntry1()

void vfx_LogFileTableEntry3(vfx_LogFile *p, Vint type1, Vobject *obj1, Vint type2, Vobject *obj2, Vint type3, Vobject *obj3)

create one typed table entry

See vfx_LogFileTableEntry1()

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

See vfx_LogFileTableEntry1()

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

See vfx_LogFileTableEntry1()

void vfx_LogFileTableTerm(vfx_LogFile *p)

flag end of a table

Flag the end of a table.

Errors

SYS_ERROR_OPERATION is generated if vfx_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() and vut_ErrorSetObject().

Parameters:

p – Pointer to LogFile object.