1 KINSOL
2 Release 2.8.1, arch 30, 2015
3 Aaron Collier, Alan C. Hindmarsh, Radu Serban, and Carol S. Woodward
4 Center for Applied Scientific Computing, LLNL
5
6KINSOL is a solver for nonlinear algebraic systems which can be
7described as F(u) = 0. It is written in the C language and based
8on the previous Fortran package NKSOL [4], written by Peter Brown and
9Youcef Saad. Nonlinear solver methods available include Newton-Krylov,
10Picard, and fixed point. Both Picard and fixed point can be accelerated
11with Anderson acceleration.
12
13KINSOL can be used both on serial and parallel computers.
14The difference is only in the NVECTOR module of vector functions.
15The desired version is obtained when compiling the example files
16by linking with the appropriate library of NVECTOR functions. In the
17parallel versions, communication between processes is done
18with MPI, with OpenMP, or with Pthreads.
19
20When used with the serial NVECTOR module, KINSOL provides both direct (dense
21and band) and preconditioned Krylov (iterative) linear solvers. Four different
22iterative solvers are available: scaled preconditioned GMRES (SPGMR), scaled
23preconditioned BiCGStab (SPBCG), scaled preconditioned TFQMR (SPTFQMR), and
24scaled preconditioned Flexible GMRES (SPFGMR).
25When used with the parallel NVECTOR module, KINSOL provides a
26preconditioner module called KINBBDPRE, which provides a
27band-block-diagonal preconditioner for use with the Krylov linear
28solvers. However, within KINSOL any NVECTOR module may be combined
29with an appropriate user-supplied preconditioning module for
30acceleration of the Krylov solvers.
31
32KINSOL is part of a software family called SUNDIALS: SUite of Nonlinear
33and DIfferential/ALgebraic equation Solvers. This suite consists of
34CVODE, CVODES, ARKode, KINSOL, IDA, and IDAS. The directory
35structure of the package supplied reflects this family relationship.
36
37For use with Fortran applications, a set of Fortran/C interface routines,
38called FKINSOL, is also supplied. These are written in C, but assume that
39the user calling program and all user-supplied routines are in Fortran.
40
41The notes below provide the location of documentation, directions for the
42installation of the KINSOL package, and relevant references. Following that
43is a brief history of revisions to the package.
44
45
46A. Documentation
47----------------
48
49/sundials/doc/kinsol/ contains PDF files for the KINSOL User Guide [1] (kin_guide.pdf)
50and the KINSOL Examples [2] (kin_examples.pdf) documents.
51
52
53B. Installation
54---------------
55
56For basic installation instructions see the file /sundials/INSTALL_GUIDE.pdf.
57For complete installation instructions see the "Installation Procedure"
58chapter in the KINSOL User Guide [1].
59
60
61C. References
62-------------
63
64[1] A. M. Collier, A. C. Hindmarsh, R. Serban, and C. S. Woodward,
65 "User Documentation for KINSOL v2.8.1," LLNL technical report
66 UCRL-SM-208116, March 2015.
67
68[2] A. M. Collier and R. Serban, "Example Programs for KINSOL v2.8.1,"
69 LLNL technical report UCRL-SM-208114, March 2015.
70
71[3] A. C. Hindmarsh, P. N. Brown, K. E. Grant, S. L. Lee, R. Serban,
72 D. E. Shumaker, and C. S. Woodward, "SUNDIALS, Suite of Nonlinear and
73 Differential/Algebraic Equation Solvers," ACM Trans. Math. Softw.,
74 31(3), pp. 363-396, 2005.
75
76[4] Peter N. Brown and Youcef Saad, "Hybrid Krylov Methods for
77 Nonlinear Systems of Equations," SIAM J. Sci. Stat. Comput.,
78 Vol 11, no 3, pp. 450-481, May 1990.
79
80[5] A. G. Taylor and A. C. Hindmarsh, "User Documentation for KINSOL,
81 A Nonlinear Solver for Sequential and Parallel Computers," LLNL
82 technical report UCRL-ID-131185, July 1998.
83
84
85D. Releases
86-----------
87
88v. 2.8.1 - Mar. 2015
89v. 2.8.0 - Mar. 2015
90v. 2.7.0 - Mar. 2012
91v. 2.6.0 - May 2009
92v. 2.5.0 - Nov. 2006
93v. 2.4.0 - Mar. 2006
94v. 2.3.0 - Apr. 2005
95v. 2.2.2 - Mar. 2005
96v. 2.2.1 - Jan. 2005
97v. 2.2.0 - Dec. 2004
98v. 2.0 - Jul. 2002 (first SUNDIALS release)
99v. 1.0 - Aug. 1998 (date written)
100
101
102E. Revision History
103-------------------
104
105v. 2.8.0 (Mar. 2015) ---> v. 2.8.1 (Mar. 2015)
106---------------------------------------------
107
108- Bug fixes
109 - Fixed loop limit bug in SlsAddMat function.
110 - In interfaces to KLU and SuperLUMT, added #include lines,
111 and removed redundant KLU structure allocations.
112 - Minor documentation updates
113
114v. 2.7.0 (Mar. 2012) ---> v. 2.8.0 (Mar. 2015)
115---------------------------------------------
116
117- New features
118 - Two major additions were made to the globalization strategy options
119 (KINSol argument strategy). One is fixed-point iteration,
120 and the other is Picard iteration. Both can be accelerated by use
121 of the Anderson acceleration method.
122 - Three major additions were made to the linear system solvers that are
123 availble for use with the KINSOL solver. If using the supplied serial
124 NVECTOR module, interfaces to the KLU sparse direct solver and to the
125 SuperLU_MT solver (the multi-threaded version of SuperLU) were added.
126 As part of these additions, a sparse matrix (CSC format) structure
127 was added to KINSOL. Finally, a variation of GMRES called Flexible GMRES
128 was added.
129 - Two new NVECTOR modules have been added for parallel computing
130 environments --- one for openMP, denoted NVECTOR_OPENMP,
131 and one for Pthreads, denoted NVECTOR_PTHREADS.
132
133- Bug fixes
134 - In function KINStop, two return values were corrected to make the values
135 of uu and fval consistent.
136 - A bug involving initialization of mxnewtstep was fixed.
137 The error affects the case of repeated user calls to KINSol with no
138 intervening call to KINSetMaxNewtonStep.
139 - A bug in the increments for difference quotient Jacobian approximations
140 was fixed in function kinDlsBandDQJac.
141 - In KINLapackBand, the line smu = MIN(N-1,mu+ml) was changed to
142 smu = mu + ml to correct an illegal input error for DGBTRF/DGBTRS.
143 - In the FKINSOL module, an incorrect return value ier in FKINfunc
144 was fixed.
145
146- Changes to user interface
147 - In the FKINSOL optional input routines FKINSETIIN, FKINSETRIN, and
148 FKINSETVIN, the optional fourth argument key_length was removed,
149 with hardcoded key string lengths passed to all strncmp tests.
150
151- Other
152 - In order to avoid possible name conflicts, the mathematical macro and
153 function names MIN, MAX, SQR, RAbs, RSqrt, RExp, RPowerI, and RPowerR
154 were changed to SUNMIN, SUNMAX, SUNSQR, SUNRabs, SUNRsqrt, SUNRexp,
155 SRpowerI, and SUNRpowerR, respectively. These names occur in both the
156 solver and in various example programs.
157
158v. 2.6.0 (May 2009) ---> v. 2.7.0 (Mar. 2012)
159---------------------------------------------
160
161- Bug fixes
162 - Three major logic bugs were fixed -- involving updating the solution
163 vector, updating the linesearch parameter, and a missing error return.
164 - Three minor errors were fixed -- involving setting etachoice in the
165 Matlab/KINSOL interface, a missing error case in KINPrintInfo,
166 and avoiding an exponential overflow in the evaluation of omega.
167 - In each linear solver interface function, the linear solver memory is
168 freed on an error return, and the **Free function now includes a
169 line setting to NULL the main memory pointer to the linear solver memory.
170
171- Changes to user interface
172 - One significant design change was made with this release: The problem
173 size and its relatives, bandwidth parameters, related internal indices,
174 pivot arrays, and the optional output lsflag, have all been
175 changed from type int to type long int, except for the
176 problem size and bandwidths in user calls to routines specifying
177 BLAS/LAPACK routines for the dense/band linear solvers. The function
178 NewIntArray is replaced by a pair NewIntArray/NewLintArray,
179 for int and long int arrays, respectively.
180 - in the installation files, we modified the treatment of the macro
181 SUNDIALS_USE_GENERIC_MATH, so that the parameter GENERIC_MATH_LIB
182 is either defined (with no value) or not defined.
183
184
185v. 2.5.0 (Nov. 2006) ---> v. 2.6.0 (May 2009)
186---------------------------------------------
187
188- New features
189 - added a new linear solver module based on Blas + Lapack for
190 both dense and banded matrices.
191
192- Bug fixes
193 - added logic to ensure omega is updated every iteration.
194 - fixed difference-quotient Jacobian memory reset bug.
195
196- Changes to user interface
197 - renamed all **Malloc functions to **Init
198 - all user-supplied functions now receive the same pointer to user data
199 (instead of having different ones for the system evaluation, Jacobian
200 information functions, etc.
201 - common functionality for all direct linear solvers (dense, band, and
202 the new Lapack solver) has been collected into the DLS (Direct Linear
203 Solver) module, similar to the SPILS module for the iterative linear
204 solvers. All optional input and output functions for these linear
205 solver now have the prefix 'KINDls'. In addition, in order to include
206 the new Lapack-based linear solver, all dimensions for these linear
207 solvers (problem sizes, bandwidths, etc) are now of type 'int'
208 (instead of 'long int').
209 - the initialization function for the preconditioner module KINBBDPRE
210 was renamed KINBBDInit (from KINBBDAlloc) and it does not return
211 a pointer to preconditioner memory anymore. Instead, all preconditioner
212 module-related functions are now called with the main solver memory
213 pointer as their first argument. When using the KINBBDPRE module,
214 there is no need to use special functions to attach one of the SPILS
215 linear solvers (instead use one of KINSpgmr, KINSpbcg, or KINSptfqmr).
216 Moreover, there is no need to call a memory deallocation function for
217 the preconditioner module.
218 - changes corresponding to the above were made to the FCMIX interface.
219
220v. 2.4.0 (Mar. 2006) ---> v. 2.5.0 (Oct. 2006)
221----------------------------------------------
222
223- Changes related to the build system
224 - reorganized source tree: header files in ${srcdir}/include/kinsol,
225 source files in ${srcdir}/src/kinsol, fcmix source files in
226 ${srcdir}/src/kinsol/fcmix, examples in ${srcdir}/examples/kinsol
227 - exported header files are installed unde ${includedir}/kinsol
228
229- Changes to user interface
230 - all included header files use relative paths from ${includedir}
231
232v. 2.3.0 (Apr. 2005) ---> v. 2.4.0 (Mar. 2006)
233----------------------------------------------
234
235- New features
236 - added direct linear solvers (dense and band, provided
237 through the KINDENSE and KINBAND modules, respectively) thus adding
238 modified (and exact) Newton methods to KINSOL.
239 - added KINSPBCG interface module to allow KINSOL to interface with the
240 shared SPBCG (scaled preconditioned Bi-CGSTAB) linear solver module.
241 - added KINSPTFQMR interface module to allow KINSOL to interface with
242 the shared SPTFQMR (scaled preconditioned TFQMR) linear solver module
243 - added support for SPBCG and SPTFQMR to the KINBBDPRE preconditioner module.
244 - added option to KINBBDPRE preconditioner module to allow specification
245 of different half-bandwidths for difference quotient approximation and
246 retained matrix.
247 - added support for interpreting failures in user-supplied functions.
248
249- Bug fixes
250 - corrected a bug in the preconditioner logic that caused the initial call
251 to the preconditioner setup routine (controlled by KINSetNoInitSetup) to
252 be skipped during subsequent calls to KINSol
253
254- Changes to underlying algorithms
255 - modified the KINBBDPRE preconditioner module to allow the use of
256 different half-bandwidths for the difference quotient approximation
257 and the retained matrix.
258 - added nonlinear residual monitoring scheme to control Jacobian updating
259 when a direct linear solver is used (modified Newton iteration)
260
261- Changes to user interface
262 - changed argument of KINFree and KINBBDPrecFree to be the address of
263 the respective memory block pointer, so that its NULL value is
264 propagated back to the calling function.
265 - modified the argument list of KINBBDPrecAlloc to allow specification
266 of the upper and lower half-bandwidths to be used in the computation
267 of the local Jacobian blocks (mudq, mldq), and the half-bandwidths
268 of the retained banded approximation to the local Jacobian block
269 (mukeep, mlkeep).
270 - added KINSPBCG module which defines appropriate KINSpbcg* functions to
271 allow KINSOL to interface with the shared SPBCG linear solver module.
272 - added KINBBDSpbcg function to KINBBDPRE module to support SPBCG linear
273 solver module.
274 - changed function type names (not the actual definitions) to accomodate
275 all the Scaled Preconditioned Iterative Linear Solvers now available:
276 KINSpgmrJactimesVecFn -> KINSpilsJacTimesVecFn
277 KINSpgmrPrecSetupFn -> KINSpilsPrecSetupFn
278 KINSpgmrPrecSolveFn -> KINSpilsPrecSolveFn
279 - changed function types so that all user-supplied functions return
280 an integer flag (not all of them currently used).
281 - changed some names for KINBBDPRE function outputs
282 - added option for user-supplied error handler function.
283 - added option for user-supplied info handler function.
284 - renamed all exported header files (except for kinsol.h, all header files
285 have the prefix 'kinsol_')
286 - changed naming scheme for KINSOL examples
287
288- Changes to the FKINSOL module
289 - modified argument list of FKINBBDINIT to accomadate changes made
290 to KINBBDPRE module, so now user must specify the upper and lower
291 half-bandwidths for the difference quotient approximation (mudq, mldq)
292 and the retained matrix (mukeep, mlkeep).
293 - added support for KINSPBCG/SPBCG (added FKIN*SPBCG* functions).
294 - added support for KINSPTFQMR/SPTFQMR (added FKIN*SPTFQMR* functions).
295 - added support for KINDENSE/DENSE (added FKIN*DENSE* functions).
296 - added support for KINBAND/BAND (added FKIN*DENSE* functions).
297 - Optional inputs are now set using routines FKINSETIIN (integer inputs),
298 FKINSETRIN (real inputs), and FKINSETVIN (vector inputs) through pairs
299 key-value. Optional outputs are still obtained from two arrays (IOUT and
300 ROUT), owned by the user and passed as arguments to FKINMALLOC.
301
302- Changes related to the build system
303 - updated configure script and Makefiles for Fortran examples to avoid C++
304 compiler errors (now use CC and MPICC to link only if necessary)
305 - the main KINSOL header file (kinsol.h) is still exported to the install include
306 directory. However, all other KINSOL header files are exported into an 'kinsol'
307 subdirectory of the install include directory.
308 - the KINSOL library now contains all shared object files (there is no separate
309 libsundials_shared library anymore)
310
311v. 2.2.2 (Mar. 2005) ---> v. 2.3.0 (Apr. 2005)
312----------------------------------------------
313
314- Changes to user interface
315 - KINSOL now stores an actual copy of the constraints vector rather than
316 just a pointer in order to resolve potential scoping issues
317 - several optional input functions were combined into a single function:
318 - KINSpgmrSetPrecSetupFn, KINSpgmrSetPrecSolveFn and KINSpgmrSetPrecData
319 were combined into KINSpgmrSetPreconditioner
320 - KINSpgmrSetJacTimesVecFn and KINSpgmrSetJacData were combined into
321 KINSpgmrSetJacTimesVecFn
322
323- Changes to FKINSOL module:
324 - FKINSPGMRSETPSET and FKINSPGMRSETPSOL were combined into FKINSPGMRSETPREC
325 - due to changes to the main solver, if FKPSOL is provided, then FKPSET
326 must also be defined, even if it is empty
327
328v. 2.2.1 (Jan. 2005) ---> v. 2.2.2 (Mar. 2005)
329----------------------------------------------
330
331- Bug fixes
332 - fixed bug in computation of the scaled step length
333 - fixed bug in logic for disabling the call to the preconditioner setup function
334 at the first iteration
335 - modified FCMIX files to avoid C++ compiler errors
336 - changed implicit type conversion to explicit in check_flag() routine in
337 examples to avoid C++ compiler errors
338
339- Changes to documentation
340 - added section with numerical values of all input and output solver constants
341 - added description of --with-mpi-flags option
342
343- Changes related to the build system
344 - fixed autoconf-related bug to allow configuration with the PGI Fortran compiler
345 - modified to use customized detection of the Fortran name mangling scheme
346 (autoconf's AC_F77_WRAPPERS routine is problematic on some platforms)
347 - added --with-mpi-flags as a configure option to allow user to specify
348 MPI-specific flags
349 - updated Makefiles for Fortran examples to avoid C++ compiler errors (now use
350 CC and MPICC to link)
351
352v. 2.2.0 (Dec. 2004) ---> v. 2.2.1 (Jan. 2005)
353----------------------------------------------
354
355- Changes related to the build system
356 - changed order of compiler directives in header files to avoid compilation
357 errors when using a C++ compiler.
358
359v. 2.0 (Jul. 2002) ---> v. 2.2.0 (Dec. 2004)
360--------------------------------------------
361
362- New feature
363 - added option to disable all error messages.
364
365- Bug fixes
366 - fixed constraints-related bug.
367 - fixed bug in implementation of line-search method related to
368 beta-condition.
369 - corrected value of ealpha variable (related to forcing term).
370
371- Changes related to NVECTOR module
372 (see also the file sundials/shared/README)
373 - removed machEnv, redefined table of vector operations (now contained
374 in the N_Vector structure itself).
375 - all KINSOL functions create new N_Vector variables through cloning,
376 using an N_Vector passed by the user as a template.
377
378- Changes to type names and KINSOL constants
379 - removed type 'integertype'; instead use 'int' or 'long int', as
380 appropriate.
381 - restructured the list of return values from the various KINSOL
382 functions.
383 - changed all KINSOL constants (inputs and return values) to have
384 the prefix 'KIN_' (e.g. KIN_SUCCESS).
385 - renamed function type 'SysFn' to 'KINSysFn'.
386
387- Changes to underlying algorithms
388 - modified line-search backtracking scheme to use cubic interpolation
389 after the first backtrack, if possible.
390 - changed implementation of constraints:
391 if constraints[i] =
392 0 u[i] NOT constrained
393 +1 u[i] >= 0
394 -1 u[i] <= 0
395 +2 u[i] > 0
396 -2 u[i] < 0
397 where u is the solution vector (see the KINSOL User Guide [1] for
398 additional details).
399
400- Changes to optional input/output
401 - added KINSet* and KINGet* functions for optional inputs/outputs,
402 replacing the arrays iopt and ropt.
403 - added new optional inputs (e.g. maximum number of nonlinear iterations
404 between calls to preconditioner setup routine, etc.).
405 - the value of the last return flag from any function within the SPGMR
406 linear solver module can be obtained as an optional output using
407 KINSpgmrGetLastFlag.
408
409- Changes to user-callable functions
410 - added new function KINCreate which initializes the KINSOL solver object
411 and returns a pointer to the KINSOL memory block.
412 - removed N (problem size) from all functions.
413 - shortened argument lists of most KINSOL functions (the arguments that
414 were dropped can now be specified through KINSet* functions).
415 - removed reinitialization functions for SPGMR linear solver (same
416 functionality can be obtained using KINSpgmrSet* functions).
417
418- Changes to user-supplied functions
419 - removed N (problem dimension) from argument lists.
420 - in KINSPGMR, shortened argument lists for user preconditioner functions.
421
422- Changes to the FKINSOL module
423 - revised to use underscore and precision flags at compile time (from
424 configure); example sources are preprocessed accordingly.
425 - use KIN*Set* and KIN*Get* functions from KINSOL (although the optional
426 I/O is still communicated to the user of FKINSOL through arrays IOPT
427 and ROPT).
428 - added new optional inputs and outputs (e.g. last return flag from the
429 linear solver, etc.).
430
431v. 1.0 (Aug. 1998) ---> v. 2.0 (Jul. 2002)
432------------------------------------------
433
434YYYYMMDD
435
43619980802 DATE WRITTEN - KINSOL released.
43719981203 Implemented serial Fortran/C interface (fkinsols.c).
43819990301 Fixed bug in nbktrk.
43919990325 Removed machEnv as an argument to KINSol.
44019991229 Fixed preconditioner evaluation logic;
441 revised SPGMR module to treat scalings correctly.
44220000324 Upgraded serial and parallel versions of NVECTOR module.
44320000706 Fixed bug in use of vtemp1 in KINSpgmrSolve call to KINAtimes etc.
44420000808 Fixed bug in N_VMin routine.
44520010118 Minor corrections, notably:
446 In fkinsol.h, KINUAtimes prototype fixed. In fkinsols.c and
447 fkinsolp.c, N_Vector's disposed with N_VDISPOSE after KINSol call.
448 In all fkin*.c, #include lines for header files corrected.
44920011212 Corrected 4 N_VDISPOSE arguments in FKINSOL.
45020011212 Added missing error flag print in KINSol, and changed 5 return
451 values in KINStop to enum-defined expressions.
45220011220 Default type 'integer' changed to 'long int' in llnltyps.h.
45320011221 In FKINSOL, corrected type (integer) for Neq in KINPreco, KINPSol.
45420020313 Modified to work with new NVECTOR abstraction.
45520020627 Modified to reflect type name changes.
456