@@ -1008,28 +1008,40 @@ negative, so a test ``retval`` :math:`<0` will catch any error.
10081008
10091009.. c:function:: int KINSetMAA(void * kin_mem, long int maa)
10101010
1011- The function :c:func:`KINSetMAA` specifies the size of the subspace used with
1012- Anderson acceleration in conjunction with Picard or fixed-point iteration.
1011+ The function :c:func:`KINSetMAA` specifies the Anderson acceleration subspace
1012+ size (depth) in the Picard or fixed-point iteration.
1013+
1014+ The default depth is 0, indicating no acceleration. Providing a value
1015+ :math:`> 0` will enable acceleration. The input ``maa`` must be less than the
1016+ maximum number of iterations allowed, ``mxiter`` (see
1017+ :c:func: `KINSetNumMaxIters `). This limit is enforced within :c:func:`KINSol`,
1018+ so :c:func:`KINSetMAA` and :c:func:`KINSetNumMaxIters` may be called in any
1019+ order. If ``maa`` is greater than or equal to ``mxiter``, it is set to the
1020+ maximum possible depth, ``maa = mxiter - 1``.
10131021
10141022 **Arguments:**
10151023 * ``kin_mem`` -- pointer to the KINSOL memory block.
1016- * ``maa`` -- subspace size for various methods. A value of 0 means no acceleration, while a positive value means acceleration will be done.
1024+ * ``maa`` -- subspace size for various methods. A value of 0 means no
1025+ acceleration, while a positive value means acceleration will be done.
10171026
10181027 **Return value:**
10191028 * ``KIN_SUCCESS`` -- The optional value has been successfully set.
10201029 * ``KIN_MEM_NULL`` -- The ``kin_mem`` pointer is ``NULL``.
10211030 * ``KIN_ILL_INPUT`` -- The argument ``maa`` was negative.
10221031
1023- **Notes:**
1024- This function sets the subspace size, which needs to be :math:`> 0` if
1025- Anderson Acceleration is to be used. It also allocates additional memory
1026- necessary for Anderson Acceleration. The default value of ``maa`` is 0,
1027- indicating no acceleration. The value of ``maa`` should always be less
1028- than ``mxiter``. This function MUST be called before calling
1029- :c:func:`KINInit`. If the user calls the function KINSetNumMaxIters, that
1030- call should be made before the call to KINSetMAA, as the latter uses the
1031- value of ``mxiter``.
1032+ .. note::
1033+
1034+ Users solving a series of problems with the same KINSOL instance and
1035+ changing the maximum number of iterations between :c:func:`KINSol` calls
1036+ may need to also call :c:func:`KINSetMAA` to adjust the depth as its value
1037+ may have been limited in the last :c:func:`KINSol` call to enforce ``maa <
1038+ mxiter``.
10321039
1040+ .. versionchanged:: x.y.z
1041+
1042+ This function can now be called any time after :c:func:`KINCreate` (i.e.,
1043+ it no longer needs to be call before :c:func: `KINInit `) and may be called
1044+ before or after :c:func:`KINSetNumMaxIters`.
10331045
10341046.. c:function:: int KINSetDampingAA(void * kin_mem, sunrealtype beta)
10351047
@@ -1098,12 +1110,14 @@ negative, so a test ``retval`` :math:`<0` will catch any error.
10981110 * ``KIN_ILL_INPUT`` -- The argument ``orthaa`` was not one of the predefined
10991111 orthogonalization routines defined in KINSOL.
11001112
1101- .. note::
1113+ **Examples codes:**
1114+
1115+ * ``examples/kinsol/serial/kinAnalytic_fp.c``
11021116
1103- This function *must* be called before calling :c:func:`KINInit`.
1117+ .. versionchanged:: x.y.z
11041118
1105- An example of how to use this function can be found in
1106- ``examples/kinsol/serial/kinAnalytic_fp.c``
1119+ This function can now be called any time after :c:func:`KINCreate` (i.e.,
1120+ it no longer needs to be call before :c:func: ` KINInit `).
11071121
11081122
11091123.. c:function:: int KINSetDampingFn(void* kin_mem, KINDampingFn damping_fn)
0 commit comments