Skip to content

Commit

Permalink
remove KINSetInfofile
Browse files Browse the repository at this point in the history
  • Loading branch information
balos1 committed Nov 6, 2023
1 parent 31d3115 commit 2b39a12
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
32 changes: 1 addition & 31 deletions doc/kinsol/guide/source/Usage/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,6 @@ negative, so a test ``retval`` :math:`<0` will catch any error.
+--------------------------------------------------------+----------------------------------+------------------------------+
| Info handler function | :c:func:`KINSetInfoHandlerFn` | internal fn. |
+--------------------------------------------------------+----------------------------------+------------------------------+
| Pointer to an info file | :c:func:`KINSetInfoFile` | ``stdout`` |
+--------------------------------------------------------+----------------------------------+------------------------------+
| Data for problem-defining function | :c:func:`KINSetUserData` | ``NULL`` |
+--------------------------------------------------------+----------------------------------+------------------------------+
| Verbosity level of output | :c:func:`KINSetPrintLevel` | 0 |
Expand Down Expand Up @@ -601,27 +599,6 @@ negative, so a test ``retval`` :math:`<0` will catch any error.
``NULL`` will always be directed to ``stderr``.
.. c:function:: int KINSetInfoFile(void * kin_mem, FILE * infofp)
The function :c:func:`KINSetInfoFile` specifies the pointer to the file
where all informative (non-error) messages should be directed.
**Arguments:**
* ``kin_mem`` -- pointer to the KINSOL memory block.
* ``infofp`` -- pointer to output file.
**Return value:**
* ``KIN_SUCCESS`` -- The optional value has been successfully set.
* ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``.
**Notes:**
The default value for ``infofp`` is ``stdout``.
.. deprecated:: 6.2.0
Use :c:func:`SUNLogger_SetInfoFilename` instead.
.. c:function:: int KINSetInfoHandlerFn(void * kin_mem, KINInfoHandlerFn ihfun, void * ih_data)
The function :c:func:`KINSetInfoHandlerFn` specifies the optional
Expand All @@ -637,11 +614,6 @@ negative, so a test ``retval`` :math:`<0` will catch any error.
* ``KIN_SUCCESS`` -- The function ``ihfun`` and data pointer ``ih_data`` have been successfully set.
* ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``.
**Notes:**
The default internal information handler function directs informative
(non-error) messages to the file specified by the file pointer ``infofp``
(see :c:func:`KINSetInfoFile` above).
.. c:function:: int KINSetPrintLevel(void * kin_mem, int printfl)
Expand Down Expand Up @@ -2005,9 +1977,7 @@ follows:
Informational message handler function
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As an alternative to the default behavior of directing informational (meaning non-error) messages
to the file pointed to by ``infofp`` (see :c:func:`KINSetInfoFile`), the user may
provide a function of type :c:type:`KINInfoHandlerFn` to process any such messages.
The user may provide a function of type :c:type:`KINInfoHandlerFn` to process any such messages.
The function type :c:type:`KINInfoHandlerFn` is defined as follows:

.. c:type:: void (*KINInfoHandlerFn)(const char *module, const char *function, char *msg, void *ih_data)
Expand Down
10 changes: 0 additions & 10 deletions examples/kinsol/F2003_serial/kinLaplace_picard_kry_f2003.f90
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ program main
type(SUNLinearSolver), pointer :: sunlinsol_LS ! sundials linear solver

type(c_ptr) :: kmem ! KINSOL memory
type(c_ptr) :: infofp ! info file

! solution and scaling vectors; nx, ny are set in the prob_mod module
real(c_double), dimension(nx,ny) :: u, scale
Expand Down Expand Up @@ -298,14 +297,6 @@ program main

! Set information file

infofp = FSUNDIALSFileOpen("KINSOL.log", "w");

ierr = FKINSetInfoFile(kmem, infofp);
if (ierr /= 0) then
print *, 'Error in FKINSetInfoFile, ierr = ', ierr, '; halting'
stop 1
end if

ierr = FKINSetPrintLevel(kmem, 3);
if (ierr /= 0) then
print *, 'Error in FKINSetPrintLevel, ierr = ', ierr, '; halting'
Expand Down Expand Up @@ -372,7 +363,6 @@ program main
call PrintFinalStats(kmem)

! clean up
call FSUNDIALSFileClose(infofp)
call FKINFree(kmem)
ierr = FSUNLinSolFree(sunlinsol_LS)
call FN_VDestroy(sunvec_u)
Expand Down

0 comments on commit 2b39a12

Please sign in to comment.