idas_impl.h 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061
  1. /*
  2. * -----------------------------------------------------------------
  3. * $Revision: 4378 $
  4. * $Date: 2015-02-19 10:55:14 -0800 (Thu, 19 Feb 2015) $
  5. * -----------------------------------------------------------------
  6. * Programmer(s): Radu Serban @ LLNL
  7. * -----------------------------------------------------------------
  8. * LLNS Copyright Start
  9. * Copyright (c) 2014, Lawrence Livermore National Security
  10. * This work was performed under the auspices of the U.S. Department
  11. * of Energy by Lawrence Livermore National Laboratory in part under
  12. * Contract W-7405-Eng-48 and in part under Contract DE-AC52-07NA27344.
  13. * Produced at the Lawrence Livermore National Laboratory.
  14. * All rights reserved.
  15. * For details, see the LICENSE file.
  16. * LLNS Copyright End
  17. * -----------------------------------------------------------------
  18. * This is the header file (private version) for the main IDAS solver.
  19. * -----------------------------------------------------------------
  20. */
  21. #ifndef _IDAS_IMPL_H
  22. #define _IDAS_IMPL_H
  23. #include <stdarg.h>
  24. #include <idas/idas.h>
  25. #include <sundials/sundials_nvector.h>
  26. #include <sundials/sundials_types.h>
  27. #ifdef __cplusplus /* wrapper to enable C++ usage */
  28. extern "C" {
  29. #endif
  30. /*
  31. * =================================================================
  32. * M A I N I N T E G R A T O R M E M O R Y B L O C K
  33. * =================================================================
  34. */
  35. /* Basic IDA constants */
  36. #define HMAX_INV_DEFAULT RCONST(0.0) /* hmax_inv default value */
  37. #define MAXORD_DEFAULT 5 /* maxord default value */
  38. #define MXORDP1 6 /* max. number of N_Vectors in phi */
  39. #define MXSTEP_DEFAULT 500 /* mxstep default value */
  40. /* itol */
  41. #define IDA_NN 0
  42. #define IDA_SS 1
  43. #define IDA_SV 2
  44. #define IDA_WF 3
  45. #define IDA_EE 4
  46. /*
  47. * -----------------------------------------------------------------
  48. * Types: struct IDAMemRec, IDAMem
  49. * -----------------------------------------------------------------
  50. * The type IDAMem is type pointer to struct IDAMemRec.
  51. * This structure contains fields to keep track of problem state.
  52. * -----------------------------------------------------------------
  53. */
  54. typedef struct IDAMemRec {
  55. realtype ida_uround; /* machine unit roundoff */
  56. /*--------------------------
  57. Problem Specification Data
  58. --------------------------*/
  59. IDAResFn ida_res; /* F(t,y(t),y'(t))=0; the function F */
  60. void *ida_user_data; /* user pointer passed to res */
  61. int ida_itol; /* itol = IDA_SS, IDA_SV, IDA_WF, IDA_NN */
  62. realtype ida_rtol; /* relative tolerance */
  63. realtype ida_Satol; /* scalar absolute tolerance */
  64. N_Vector ida_Vatol; /* vector absolute tolerance */
  65. booleantype ida_user_efun; /* TRUE if user provides efun */
  66. IDAEwtFn ida_efun; /* function to set ewt */
  67. void *ida_edata; /* user pointer passed to efun */
  68. /*-----------------------
  69. Quadrature Related Data
  70. -----------------------*/
  71. booleantype ida_quadr;
  72. IDAQuadRhsFn ida_rhsQ;
  73. void *ida_user_dataQ;
  74. booleantype ida_errconQ;
  75. int ida_itolQ;
  76. realtype ida_rtolQ;
  77. realtype ida_SatolQ; /* scalar absolute tolerance for quadratures */
  78. N_Vector ida_VatolQ; /* vector absolute tolerance for quadratures */
  79. /*------------------------
  80. Sensitivity Related Data
  81. ------------------------*/
  82. booleantype ida_sensi;
  83. int ida_Ns;
  84. int ida_ism;
  85. IDASensResFn ida_resS;
  86. void *ida_user_dataS;
  87. booleantype ida_resSDQ;
  88. realtype *ida_p;
  89. realtype *ida_pbar;
  90. int *ida_plist;
  91. int ida_DQtype;
  92. realtype ida_DQrhomax;
  93. booleantype ida_errconS; /* TRUE if sensitivities in err. control */
  94. int ida_itolS;
  95. realtype ida_rtolS; /* relative tolerance for sensitivities */
  96. realtype *ida_SatolS; /* scalar absolute tolerances for sensi. */
  97. N_Vector *ida_VatolS; /* vector absolute tolerances for sensi. */
  98. /*-----------------------------------
  99. Quadrature Sensitivity Related Data
  100. -----------------------------------*/
  101. booleantype ida_quadr_sensi; /* TRUE if computing sensitivities of quadrs.*/
  102. IDAQuadSensRhsFn ida_rhsQS; /* fQS = (dfQ/dy)*yS + (dfQ/dp) */
  103. void *ida_user_dataQS; /* data pointer passed to fQS */
  104. booleantype ida_rhsQSDQ; /* TRUE if using internal DQ functions */
  105. booleantype ida_errconQS; /* TRUE if yQS are considered in err. con. */
  106. int ida_itolQS;
  107. realtype ida_rtolQS; /* relative tolerance for yQS */
  108. realtype *ida_SatolQS; /* scalar absolute tolerances for yQS */
  109. N_Vector *ida_VatolQS; /* vector absolute tolerances for yQS */
  110. /*-----------------------------------------------
  111. Divided differences array and associated arrays
  112. -----------------------------------------------*/
  113. N_Vector ida_phi[MXORDP1]; /* phi = (maxord+1) arrays of divided differences */
  114. realtype ida_psi[MXORDP1]; /* differences in t (sums of recent step sizes) */
  115. realtype ida_alpha[MXORDP1]; /* ratios of current stepsize to psi values */
  116. realtype ida_beta[MXORDP1]; /* ratios of current to previous product of psi's */
  117. realtype ida_sigma[MXORDP1]; /* product successive alpha values and factorial */
  118. realtype ida_gamma[MXORDP1]; /* sum of reciprocals of psi values */
  119. /*-------------------------
  120. N_Vectors for integration
  121. -------------------------*/
  122. N_Vector ida_ewt; /* error weight vector */
  123. N_Vector ida_yy; /* work space for y vector (= user's yret) */
  124. N_Vector ida_yp; /* work space for y' vector (= user's ypret) */
  125. N_Vector ida_delta; /* residual vector */
  126. N_Vector ida_id; /* bit vector for diff./algebraic components */
  127. N_Vector ida_constraints; /* vector of inequality constraint options */
  128. N_Vector ida_savres; /* saved residual vector (= tempv1) */
  129. N_Vector ida_ee; /* accumulated corrections to y vector, but
  130. set equal to estimated local errors upon
  131. successful return */
  132. N_Vector ida_mm; /* mask vector in constraints tests (= tempv2) */
  133. N_Vector ida_tempv1; /* work space vector */
  134. N_Vector ida_tempv2; /* work space vector */
  135. N_Vector ida_ynew; /* work vector for y in IDACalcIC (= tempv2) */
  136. N_Vector ida_ypnew; /* work vector for yp in IDACalcIC (= ee) */
  137. N_Vector ida_delnew; /* work vector for delta in IDACalcIC (= phi[2]) */
  138. N_Vector ida_dtemp; /* work vector in IDACalcIC (= phi[3]) */
  139. /*----------------------------
  140. Quadrature Related N_Vectors
  141. ----------------------------*/
  142. N_Vector ida_phiQ[MXORDP1];
  143. N_Vector ida_yyQ;
  144. N_Vector ida_ypQ;
  145. N_Vector ida_ewtQ;
  146. N_Vector ida_eeQ;
  147. /*---------------------------
  148. Sensitivity Related Vectors
  149. ---------------------------*/
  150. N_Vector *ida_phiS[MXORDP1];
  151. N_Vector *ida_ewtS;
  152. N_Vector *ida_eeS; /* cumulative sensitivity corrections */
  153. N_Vector *ida_yyS; /* allocated and used for: */
  154. N_Vector *ida_ypS; /* ism = SIMULTANEOUS */
  155. N_Vector *ida_deltaS; /* ism = STAGGERED */
  156. N_Vector ida_tmpS1; /* work space vectors | tmpS1 = tempv1 */
  157. N_Vector ida_tmpS2; /* for resS | tmpS2 = tempv2 */
  158. N_Vector ida_tmpS3; /* | tmpS3 = allocated */
  159. N_Vector *ida_savresS; /* work vector in IDACalcIC for stg (= phiS[2]) */
  160. N_Vector *ida_delnewS; /* work vector in IDACalcIC for stg (= phiS[3]) */
  161. N_Vector *ida_yyS0; /* initial yS, ypS vectors allocated and */
  162. N_Vector *ida_ypS0; /* deallocated in IDACalcIC function */
  163. N_Vector *ida_yyS0new; /* work vector in IDASensLineSrch (= phiS[4]) */
  164. N_Vector *ida_ypS0new; /* work vector in IDASensLineSrch (= eeS) */
  165. /*--------------------------------------
  166. Quadrature Sensitivity Related Vectors
  167. --------------------------------------*/
  168. N_Vector *ida_phiQS[MXORDP1];/* Mod. div. diffs. for quadr. sensitivities */
  169. N_Vector *ida_ewtQS; /* error weight vectors for sensitivities */
  170. N_Vector *ida_eeQS; /* cumulative quadr.sensi.corrections */
  171. N_Vector *ida_yyQS; /* Unlike yS, yQS is not allocated by the user */
  172. N_Vector *ida_tempvQS; /* temporary storage vector (~ tempv) */
  173. N_Vector ida_savrhsQ; /* saved quadr. rhs (needed for rhsQS calls) */
  174. /*------------------------------
  175. Variables for use by IDACalcIC
  176. ------------------------------*/
  177. realtype ida_t0; /* initial t */
  178. N_Vector ida_yy0; /* initial y vector (user-supplied). */
  179. N_Vector ida_yp0; /* initial y' vector (user-supplied). */
  180. int ida_icopt; /* IC calculation user option */
  181. booleantype ida_lsoff; /* IC calculation linesearch turnoff option */
  182. int ida_maxnh; /* max. number of h tries in IC calculation */
  183. int ida_maxnj; /* max. number of J tries in IC calculation */
  184. int ida_maxnit; /* max. number of Netwon iterations in IC calc. */
  185. int ida_nbacktr; /* number of IC linesearch backtrack operations */
  186. int ida_sysindex; /* computed system index (0 or 1) */
  187. realtype ida_epiccon; /* IC nonlinear convergence test constant */
  188. realtype ida_steptol; /* minimum Newton step size in IC calculation */
  189. realtype ida_tscale; /* time scale factor = abs(tout1 - t0) */
  190. /* Tstop information */
  191. booleantype ida_tstopset;
  192. realtype ida_tstop;
  193. /* Step Data */
  194. int ida_kk; /* current BDF method order */
  195. int ida_knew; /* order for next step from order decrease decision */
  196. int ida_phase; /* flag to trigger step doubling in first few steps */
  197. int ida_ns; /* counts steps at fixed stepsize and order */
  198. realtype ida_hin; /* initial step */
  199. realtype ida_hh; /* current step size h */
  200. realtype ida_rr; /* rr = hnext / hused */
  201. realtype ida_tn; /* current internal value of t */
  202. realtype ida_tretlast; /* value of tret previously returned by IDASolve */
  203. realtype ida_cj; /* current value of scalar (-alphas/hh) in Jacobian */
  204. realtype ida_cjlast; /* cj value saved from last successful step */
  205. realtype ida_cjold; /* cj value saved from last call to lsetup */
  206. realtype ida_cjratio; /* ratio of cj values: cj/cjold */
  207. realtype ida_ss; /* scalar used in Newton iteration convergence test */
  208. realtype ida_epsNewt; /* test constant in Newton convergence test */
  209. realtype ida_epcon; /* coeficient of the Newton covergence test */
  210. realtype ida_toldel; /* tolerance in direct test on Newton corrections */
  211. realtype ida_ssS; /* scalar ss for staggered sensitivities */
  212. /*------
  213. Limits
  214. ------*/
  215. int ida_maxncf; /* max numer of convergence failures */
  216. int ida_maxcor; /* max number of Newton corrections */
  217. int ida_maxnef; /* max number of error test failures */
  218. int ida_maxord; /* max value of method order k: */
  219. int ida_maxord_alloc; /* value of maxord used when allocating memory */
  220. long int ida_mxstep; /* max number of internal steps for one user call */
  221. realtype ida_hmax_inv; /* inverse of max. step size hmax (default = 0.0) */
  222. int ida_maxcorS; /* max number of Newton corrections for sensitivity
  223. systems (staggered method) */
  224. /*--------
  225. Counters
  226. --------*/
  227. long int ida_nst; /* number of internal steps taken */
  228. long int ida_nre; /* number of function (res) calls */
  229. long int ida_nrQe;
  230. long int ida_nrSe;
  231. long int ida_nrQSe; /* number of fQS calls */
  232. long int ida_nreS;
  233. long int ida_nrQeS; /* number of fQ calls from sensi DQ */
  234. long int ida_ncfn; /* number of corrector convergence failures */
  235. long int ida_ncfnQ;
  236. long int ida_ncfnS;
  237. long int ida_netf; /* number of error test failures */
  238. long int ida_netfQ;
  239. long int ida_netfS;
  240. long int ida_netfQS; /* number of quadr. sensi. error test failures */
  241. long int ida_nni; /* number of Newton iterations performed */
  242. long int ida_nniS;
  243. long int ida_nsetups; /* number of lsetup calls */
  244. long int ida_nsetupsS;
  245. /*---------------------------
  246. Space requirements for IDAS
  247. ---------------------------*/
  248. long int ida_lrw1; /* no. of realtype words in 1 N_Vector */
  249. long int ida_liw1; /* no. of integer words in 1 N_Vector */
  250. long int ida_lrw1Q;
  251. long int ida_liw1Q;
  252. long int ida_lrw; /* number of realtype words in IDA work vectors */
  253. long int ida_liw; /* no. of integer words in IDA work vectors */
  254. /*-------------------------------------------
  255. Error handler function and error ouput file
  256. -------------------------------------------*/
  257. IDAErrHandlerFn ida_ehfun; /* Error messages are handled by ehfun */
  258. void *ida_eh_data; /* dats pointer passed to ehfun */
  259. FILE *ida_errfp; /* IDA error messages are sent to errfp */
  260. /* Flags to verify correct calling sequence */
  261. booleantype ida_SetupDone; /* set to FALSE by IDAInit and IDAReInit
  262. set to TRUE by IDACalcIC or IDASolve */
  263. booleantype ida_VatolMallocDone;
  264. booleantype ida_constraintsMallocDone;
  265. booleantype ida_idMallocDone;
  266. booleantype ida_MallocDone; /* set to FALSE by IDACreate
  267. set to TRUE by IDAInit
  268. tested by IDAReInit and IDASolve */
  269. booleantype ida_VatolQMallocDone;
  270. booleantype ida_quadMallocDone;
  271. booleantype ida_VatolSMallocDone;
  272. booleantype ida_SatolSMallocDone;
  273. booleantype ida_sensMallocDone;
  274. booleantype ida_VatolQSMallocDone;
  275. booleantype ida_SatolQSMallocDone;
  276. booleantype ida_quadSensMallocDone;
  277. /*------------------
  278. Linear Solver Data
  279. ------------------*/
  280. /* Linear Solver functions to be called */
  281. int (*ida_linit)(struct IDAMemRec *idamem);
  282. int (*ida_lsetup)(struct IDAMemRec *idamem, N_Vector yyp,
  283. N_Vector ypp, N_Vector resp,
  284. N_Vector tempv1, N_Vector tempv2, N_Vector tempv3);
  285. int (*ida_lsolve)(struct IDAMemRec *idamem, N_Vector b, N_Vector weight,
  286. N_Vector ycur, N_Vector ypcur, N_Vector rescur);
  287. int (*ida_lperf)(struct IDAMemRec *idamem, int perftask);
  288. int (*ida_lfree)(struct IDAMemRec *idamem);
  289. /* Linear Solver specific memory */
  290. void *ida_lmem;
  291. /* Flag to request a call to the setup routine */
  292. booleantype ida_forceSetup;
  293. /* Flag to indicate successful ida_linit call */
  294. booleantype ida_linitOK;
  295. /*------------
  296. Saved Values
  297. ------------*/
  298. booleantype ida_setupNonNull; /* Does setup do something? */
  299. booleantype ida_constraintsSet; /* constraints vector present */
  300. booleantype ida_suppressalg; /* TRUE if suppressing algebraic vars.
  301. in local error tests */
  302. int ida_kused; /* method order used on last successful step */
  303. realtype ida_h0u; /* actual initial stepsize */
  304. realtype ida_hused; /* step size used on last successful step */
  305. realtype ida_tolsf; /* tolerance scale factor (saved value) */
  306. /*----------------
  307. Rootfinding Data
  308. ----------------*/
  309. IDARootFn ida_gfun; /* Function g for roots sought */
  310. int ida_nrtfn; /* number of components of g */
  311. int *ida_iroots; /* array for root information */
  312. int *ida_rootdir; /* array specifying direction of zero-crossing */
  313. realtype ida_tlo; /* nearest endpoint of interval in root search */
  314. realtype ida_thi; /* farthest endpoint of interval in root search */
  315. realtype ida_trout; /* t return value from rootfinder routine */
  316. realtype *ida_glo; /* saved array of g values at t = tlo */
  317. realtype *ida_ghi; /* saved array of g values at t = thi */
  318. realtype *ida_grout; /* array of g values at t = trout */
  319. realtype ida_toutc; /* copy of tout (if NORMAL mode) */
  320. realtype ida_ttol; /* tolerance on root location */
  321. int ida_taskc; /* copy of parameter itask */
  322. int ida_irfnd; /* flag showing whether last step had a root */
  323. long int ida_nge; /* counter for g evaluations */
  324. booleantype *ida_gactive; /* array with active/inactive event functions */
  325. int ida_mxgnull; /* number of warning messages about possible g==0 */
  326. /*------------------------
  327. Adjoint sensitivity data
  328. ------------------------*/
  329. booleantype ida_adj; /* TRUE if performing ASA */
  330. struct IDAadjMemRec *ida_adj_mem; /* Pointer to adjoint memory structure */
  331. booleantype ida_adjMallocDone;
  332. } *IDAMem;
  333. /*
  334. * =================================================================
  335. * A D J O I N T M O D U L E M E M O R Y B L O C K
  336. * =================================================================
  337. */
  338. /*
  339. * -----------------------------------------------------------------
  340. * Forward references for pointers to various structures
  341. * -----------------------------------------------------------------
  342. */
  343. typedef struct IDAadjMemRec *IDAadjMem;
  344. typedef struct CkpntMemRec *CkpntMem;
  345. typedef struct DtpntMemRec *DtpntMem;
  346. typedef struct IDABMemRec *IDABMem;
  347. /*
  348. * -----------------------------------------------------------------
  349. * Types for functions provided by an interpolation module
  350. * -----------------------------------------------------------------
  351. * IDAAMMallocFn: Type for a function that initializes the content
  352. * field of the structures in the dt array
  353. * IDAAMFreeFn: Type for a function that deallocates the content
  354. * field of the structures in the dt array
  355. * IDAAGetYFn: Function type for a function that returns the
  356. * interpolated forward solution.
  357. * IDAAStorePnt: Function type for a function that stores a new
  358. * point in the structure d
  359. * -----------------------------------------------------------------
  360. */
  361. typedef booleantype (*IDAAMMallocFn)(IDAMem IDA_mem);
  362. typedef void (*IDAAMFreeFn)(IDAMem IDA_mem);
  363. typedef int (*IDAAGetYFn)(IDAMem IDA_mem, realtype t,
  364. N_Vector yy, N_Vector yp,
  365. N_Vector *yyS, N_Vector *ypS);
  366. typedef int (*IDAAStorePntFn)(IDAMem IDA_mem, DtpntMem d);
  367. /*
  368. * -----------------------------------------------------------------
  369. * Types : struct CkpntMemRec, CkpntMem
  370. * -----------------------------------------------------------------
  371. * The type CkpntMem is type pointer to struct CkpntMemRec.
  372. * This structure contains fields to store all information at a
  373. * check point that is needed to 'hot' start IDAS.
  374. * -----------------------------------------------------------------
  375. */
  376. struct CkpntMemRec {
  377. /* Integration limits */
  378. realtype ck_t0;
  379. realtype ck_t1;
  380. /* Modified divided difference array */
  381. N_Vector ck_phi[MXORDP1];
  382. /* Do we need to carry quadratures? */
  383. booleantype ck_quadr;
  384. /* Modified divided difference array for quadratures */
  385. N_Vector ck_phiQ[MXORDP1];
  386. /* Do we need to carry sensitivities? */
  387. booleantype ck_sensi;
  388. /* number of sensitivities */
  389. int ck_Ns;
  390. /* Modified divided difference array for sensitivities */
  391. N_Vector *ck_phiS[MXORDP1];
  392. /* Do we need to carry quadrature sensitivities? */
  393. booleantype ck_quadr_sensi;
  394. /* Modified divided difference array for quadrature sensitivities */
  395. N_Vector *ck_phiQS[MXORDP1];
  396. /* Step data */
  397. long int ck_nst;
  398. realtype ck_tretlast;
  399. long int ck_ns;
  400. int ck_kk;
  401. int ck_kused;
  402. int ck_knew;
  403. int ck_phase;
  404. realtype ck_hh;
  405. realtype ck_hused;
  406. realtype ck_rr;
  407. realtype ck_cj;
  408. realtype ck_cjlast;
  409. realtype ck_cjold;
  410. realtype ck_cjratio;
  411. realtype ck_ss;
  412. realtype ck_ssS;
  413. realtype ck_psi[MXORDP1];
  414. realtype ck_alpha[MXORDP1];
  415. realtype ck_beta[MXORDP1];
  416. realtype ck_sigma[MXORDP1];
  417. realtype ck_gamma[MXORDP1];
  418. /* How many phi, phiS, phiQ and phiQS were allocated? */
  419. int ck_phi_alloc;
  420. /* Pointer to next structure in list */
  421. struct CkpntMemRec *ck_next;
  422. };
  423. /*
  424. * -----------------------------------------------------------------
  425. * Type : struct DtpntMemRec
  426. * -----------------------------------------------------------------
  427. * This structure contains fields to store all information at a
  428. * data point that is needed to interpolate solution of forward
  429. * simulations. Its content field is interpType-dependent.
  430. * -----------------------------------------------------------------
  431. */
  432. struct DtpntMemRec {
  433. realtype t; /* time */
  434. void *content; /* interpType-dependent content */
  435. };
  436. /* Data for cubic Hermite interpolation */
  437. typedef struct HermiteDataMemRec {
  438. N_Vector y;
  439. N_Vector yd;
  440. N_Vector *yS;
  441. N_Vector *ySd;
  442. } *HermiteDataMem;
  443. /* Data for polynomial interpolation */
  444. typedef struct PolynomialDataMemRec {
  445. N_Vector y;
  446. N_Vector *yS;
  447. /* yd and ySd store the derivative(s) only for the first dt
  448. point. NULL otherwise. */
  449. N_Vector yd;
  450. N_Vector *ySd;
  451. int order;
  452. } *PolynomialDataMem;
  453. /*
  454. * -----------------------------------------------------------------
  455. * Type : struct IDABMemRec
  456. * -----------------------------------------------------------------
  457. * The type IDABMemRec is a pointer to a structure which stores all
  458. * information for ONE backward problem.
  459. * The IDAadjMem struct contains a linked list of IDABMem pointers
  460. * -----------------------------------------------------------------
  461. */
  462. struct IDABMemRec {
  463. /* Index of this backward problem */
  464. int ida_index;
  465. /* Time at which the backward problem is initialized. */
  466. realtype ida_t0;
  467. /* Memory for this backward problem */
  468. IDAMem IDA_mem;
  469. /* Flags to indicate that this backward problem's RHS or quad RHS
  470. * require forward sensitivities */
  471. booleantype ida_res_withSensi;
  472. booleantype ida_rhsQ_withSensi;
  473. /* Residual function for backward run */
  474. IDAResFnB ida_res;
  475. IDAResFnBS ida_resS;
  476. /* Right hand side quadrature function (fQB) for backward run */
  477. IDAQuadRhsFnB ida_rhsQ;
  478. IDAQuadRhsFnBS ida_rhsQS;
  479. /* User user_data */
  480. void *ida_user_data;
  481. /* Linear solver's data and functions */
  482. /* Memory block for a linear solver's interface to IDAA */
  483. void *ida_lmem;
  484. /* Function to free any memory allocated by the linear solver */
  485. void (*ida_lfree)(IDABMem IDAB_mem);
  486. /* Memory block for a preconditioner's module interface to IDAA */
  487. void *ida_pmem;
  488. /* Function to free any memory allocated by the preconditioner module */
  489. void (*ida_pfree)(IDABMem IDAB_mem);
  490. /* Time at which to extract solution / quadratures */
  491. realtype ida_tout;
  492. /* Workspace Nvectors */
  493. N_Vector ida_yy;
  494. N_Vector ida_yp;
  495. /* Link to next structure in list. */
  496. struct IDABMemRec *ida_next;
  497. };
  498. /*
  499. * -----------------------------------------------------------------
  500. * Type : struct IDAadjMemRec
  501. * -----------------------------------------------------------------
  502. * The type IDAadjMem is type pointer to struct IDAadjMemRec.
  503. * This structure contins fields to store all information
  504. * necessary for adjoint sensitivity analysis.
  505. * -----------------------------------------------------------------
  506. */
  507. struct IDAadjMemRec {
  508. /* --------------------
  509. * Forward problem data
  510. * -------------------- */
  511. /* Integration interval */
  512. realtype ia_tinitial, ia_tfinal;
  513. /* Flag for first call to IDASolveF */
  514. booleantype ia_firstIDAFcall;
  515. /* Flag if IDASolveF was called with TSTOP */
  516. booleantype ia_tstopIDAFcall;
  517. realtype ia_tstopIDAF;
  518. /* ----------------------
  519. * Backward problems data
  520. * ---------------------- */
  521. /* Storage for backward problems */
  522. struct IDABMemRec *IDAB_mem;
  523. /* Number of backward problems. */
  524. int ia_nbckpbs;
  525. /* Address of current backward problem (iterator). */
  526. struct IDABMemRec *ia_bckpbCrt;
  527. /* Flag for first call to IDASolveB */
  528. booleantype ia_firstIDABcall;
  529. /* ----------------
  530. * Check point data
  531. * ---------------- */
  532. /* Storage for check point information */
  533. struct CkpntMemRec *ck_mem;
  534. /* address of the check point structure for which data is available */
  535. struct CkpntMemRec *ia_ckpntData;
  536. /* Number of checkpoints. */
  537. int ia_nckpnts;
  538. /* ------------------
  539. * Interpolation data
  540. * ------------------ */
  541. /* Number of steps between 2 check points */
  542. long int ia_nsteps;
  543. /* Storage for data from forward runs */
  544. struct DtpntMemRec **dt_mem;
  545. /* Actual number of data points saved in current dt_mem */
  546. /* Commonly, np = nsteps+1 */
  547. long int ia_np;
  548. /* Interpolation type */
  549. int ia_interpType;
  550. /* Functions set by the interpolation module */
  551. IDAAStorePntFn ia_storePnt; /* store a new interpolation point */
  552. IDAAGetYFn ia_getY; /* interpolate forward solution */
  553. IDAAMMallocFn ia_malloc; /* allocate new data point */
  554. IDAAMFreeFn ia_free; /* destroys data point */
  555. /* Flags controlling the interpolation module */
  556. booleantype ia_mallocDone; /* IM initialized? */
  557. booleantype ia_newData; /* new data available in dt_mem? */
  558. booleantype ia_storeSensi; /* store sensitivities? */
  559. booleantype ia_interpSensi; /* interpolate sensitivities? */
  560. booleantype ia_noInterp; /* interpolations are temporarly */
  561. /* disabled ( IDACalcICB ) */
  562. /* Workspace for polynomial interpolation */
  563. N_Vector ia_Y[MXORDP1]; /* pointers phi[i] */
  564. N_Vector *ia_YS[MXORDP1]; /* pointers phiS[i] */
  565. realtype ia_T[MXORDP1];
  566. /* Workspace for wrapper functions */
  567. N_Vector ia_yyTmp, ia_ypTmp;
  568. N_Vector *ia_yySTmp, *ia_ypSTmp;
  569. };
  570. /*
  571. * =================================================================
  572. * I N T E R F A C E T O L I N E A R S O L V E R S
  573. * =================================================================
  574. */
  575. /*
  576. * -----------------------------------------------------------------
  577. * int (*ida_linit)(IDAMem IDA_mem);
  578. * -----------------------------------------------------------------
  579. * The purpose of ida_linit is to allocate memory for the
  580. * solver-specific fields in the structure *(idamem->ida_lmem) and
  581. * perform any needed initializations of solver-specific memory,
  582. * such as counters/statistics. An (*ida_linit) should return
  583. * 0 if it has successfully initialized the IDA linear solver and
  584. * a non-zero value otherwise. If an error does occur, an
  585. * appropriate message should be issued.
  586. * ----------------------------------------------------------------
  587. */
  588. /*
  589. * -----------------------------------------------------------------
  590. * int (*ida_lsetup)(IDAMem IDA_mem, N_Vector yyp, N_Vector ypp,
  591. * N_Vector resp,
  592. * N_Vector tempv1, N_Vector tempv2, N_Vector tempv3);
  593. * -----------------------------------------------------------------
  594. * The job of ida_lsetup is to prepare the linear solver for
  595. * subsequent calls to ida_lsolve. Its parameters are as follows:
  596. *
  597. * idamem - problem memory pointer of type IDAMem. See the big
  598. * typedef earlier in this file.
  599. *
  600. *
  601. * yyp - the predicted y vector for the current IDA internal
  602. * step.
  603. *
  604. * ypp - the predicted y' vector for the current IDA internal
  605. * step.
  606. *
  607. * resp - F(tn, yyp, ypp).
  608. *
  609. * tempv1, tempv2, tempv3 - temporary N_Vectors provided for use
  610. * by ida_lsetup.
  611. *
  612. * The ida_lsetup routine should return 0 if successful,
  613. * a positive value for a recoverable error, and a negative value
  614. * for an unrecoverable error.
  615. * -----------------------------------------------------------------
  616. */
  617. /*
  618. * -----------------------------------------------------------------
  619. * int (*ida_lsolve)(IDAMem IDA_mem, N_Vector b, N_Vector weight,
  620. * N_Vector ycur, N_Vector ypcur, N_Vector rescur);
  621. * -----------------------------------------------------------------
  622. * ida_lsolve must solve the linear equation P x = b, where
  623. * P is some approximation to the system Jacobian
  624. * J = (dF/dy) + cj (dF/dy')
  625. * evaluated at (tn,ycur,ypcur) and the RHS vector b is input.
  626. * The N-vector ycur contains the solver's current approximation
  627. * to y(tn), ypcur contains that for y'(tn), and the vector rescur
  628. * contains the N-vector residual F(tn,ycur,ypcur).
  629. * The solution is to be returned in the vector b.
  630. *
  631. * The ida_lsolve routine should return 0 if successful,
  632. * a positive value for a recoverable error, and a negative value
  633. * for an unrecoverable error.
  634. * -----------------------------------------------------------------
  635. */
  636. /*
  637. * -----------------------------------------------------------------
  638. * int (*ida_lperf)(IDAMem IDA_mem, int perftask);
  639. * -----------------------------------------------------------------
  640. * ida_lperf is called two places in IDAS where linear solver
  641. * performance data is required by IDAS. For perftask = 0, an
  642. * initialization of performance variables is performed, while for
  643. * perftask = 1, the performance is evaluated.
  644. * -----------------------------------------------------------------
  645. */
  646. /*
  647. * =================================================================
  648. * I D A S I N T E R N A L F U N C T I O N S
  649. * =================================================================
  650. */
  651. /* Prototype of internal ewtSet function */
  652. int IDAEwtSet(N_Vector ycur, N_Vector weight, void *data);
  653. /* High level error handler */
  654. void IDAProcessError(IDAMem IDA_mem,
  655. int error_code, const char *module, const char *fname,
  656. const char *msgfmt, ...);
  657. /* Prototype of internal errHandler function */
  658. void IDAErrHandler(int error_code, const char *module, const char *function,
  659. char *msg, void *data);
  660. /* Prototype for internal sensitivity residual DQ function */
  661. int IDASensResDQ(int Ns, realtype t,
  662. N_Vector yy, N_Vector yp, N_Vector resval,
  663. N_Vector *yyS, N_Vector *ypS, N_Vector *resvalS,
  664. void *user_dataS,
  665. N_Vector ytemp, N_Vector yptemp, N_Vector restemp);
  666. /*
  667. * =================================================================
  668. * I D A S E R R O R M E S S A G E S
  669. * =================================================================
  670. */
  671. #if defined(SUNDIALS_EXTENDED_PRECISION)
  672. #define MSG_TIME "t = %Lg, "
  673. #define MSG_TIME_H "t = %Lg and h = %Lg, "
  674. #define MSG_TIME_INT "t = %Lg is not between tcur - hu = %Lg and tcur = %Lg."
  675. #define MSG_TIME_TOUT "tout = %Lg"
  676. #define MSG_TIME_TSTOP "tstop = %Lg"
  677. #elif defined(SUNDIALS_DOUBLE_PRECISION)
  678. #define MSG_TIME "t = %lg, "
  679. #define MSG_TIME_H "t = %lg and h = %lg, "
  680. #define MSG_TIME_INT "t = %lg is not between tcur - hu = %lg and tcur = %lg."
  681. #define MSG_TIME_TOUT "tout = %lg"
  682. #define MSG_TIME_TSTOP "tstop = %lg"
  683. #else
  684. #define MSG_TIME "t = %g, "
  685. #define MSG_TIME_H "t = %g and h = %g, "
  686. #define MSG_TIME_INT "t = %g is not between tcur - hu = %g and tcur = %g."
  687. #define MSG_TIME_TOUT "tout = %g"
  688. #define MSG_TIME_TSTOP "tstop = %g"
  689. #endif
  690. /* General errors */
  691. #define MSG_MEM_FAIL "A memory request failed."
  692. #define MSG_NO_MEM "ida_mem = NULL illegal."
  693. #define MSG_NO_MALLOC "Attempt to call before IDAMalloc."
  694. #define MSG_BAD_NVECTOR "A required vector operation is not implemented."
  695. /* Initialization errors */
  696. #define MSG_Y0_NULL "y0 = NULL illegal."
  697. #define MSG_YP0_NULL "yp0 = NULL illegal."
  698. #define MSG_BAD_ITOL "Illegal value for itol. The legal values are IDA_SS, IDA_SV, and IDA_WF."
  699. #define MSG_RES_NULL "res = NULL illegal."
  700. #define MSG_BAD_RTOL "rtol < 0 illegal."
  701. #define MSG_ATOL_NULL "atol = NULL illegal."
  702. #define MSG_BAD_ATOL "Some atol component < 0.0 illegal."
  703. #define MSG_ROOT_FUNC_NULL "g = NULL illegal."
  704. #define MSG_MISSING_ID "id = NULL but suppressalg option on."
  705. #define MSG_NO_TOLS "No integration tolerances have been specified."
  706. #define MSG_FAIL_EWT "The user-provide EwtSet function failed."
  707. #define MSG_BAD_EWT "Some initial ewt component = 0.0 illegal."
  708. #define MSG_Y0_FAIL_CONSTR "y0 fails to satisfy constraints."
  709. #define MSG_BAD_ISM_CONSTR "Constraints can not be enforced while forward sensitivity is used with simultaneous method."
  710. #define MSG_LSOLVE_NULL "The linear solver's solve routine is NULL."
  711. #define MSG_LINIT_FAIL "The linear solver's init routine failed."
  712. #define MSG_NO_QUAD "Illegal attempt to call before calling IDAQuadInit."
  713. #define MSG_BAD_EWTQ "Initial ewtQ has component(s) equal to zero (illegal)."
  714. #define MSG_BAD_ITOLQ "Illegal value for itolQ. The legal values are IDA_SS and IDA_SV."
  715. #define MSG_NO_TOLQ "No integration tolerances for quadrature variables have been specified."
  716. #define MSG_NULL_ATOLQ "atolQ = NULL illegal."
  717. #define MSG_BAD_RTOLQ "rtolQ < 0 illegal."
  718. #define MSG_BAD_ATOLQ "atolQ has negative component(s) (illegal)."
  719. #define MSG_NO_SENSI "Illegal attempt to call before calling IDASensInit."
  720. #define MSG_BAD_EWTS "Initial ewtS has component(s) equal to zero (illegal)."
  721. #define MSG_BAD_ITOLS "Illegal value for itolS. The legal values are IDA_SS, IDA_SV, and IDA_EE."
  722. #define MSG_NULL_ATOLS "atolS = NULL illegal."
  723. #define MSG_BAD_RTOLS "rtolS < 0 illegal."
  724. #define MSG_BAD_ATOLS "atolS has negative component(s) (illegal)."
  725. #define MSG_BAD_PBAR "pbar has zero component(s) (illegal)."
  726. #define MSG_BAD_PLIST "plist has negative component(s) (illegal)."
  727. #define MSG_BAD_NS "NS <= 0 illegal."
  728. #define MSG_NULL_YYS0 "yyS0 = NULL illegal."
  729. #define MSG_NULL_YPS0 "ypS0 = NULL illegal."
  730. #define MSG_BAD_ISM "Illegal value for ism. Legal values are: IDA_SIMULTANEOUS and IDA_STAGGERED."
  731. #define MSG_BAD_IS "Illegal value for is."
  732. #define MSG_NULL_DKYA "dkyA = NULL illegal."
  733. #define MSG_BAD_DQTYPE "Illegal value for DQtype. Legal values are: IDA_CENTERED and IDA_FORWARD."
  734. #define MSG_BAD_DQRHO "DQrhomax < 0 illegal."
  735. #define MSG_NULL_ABSTOLQS "abstolQS = NULL illegal parameter."
  736. #define MSG_BAD_RELTOLQS "reltolQS < 0 illegal parameter."
  737. #define MSG_BAD_ABSTOLQS "abstolQS has negative component(s) (illegal)."
  738. #define MSG_NO_QUADSENSI "Forward sensitivity analysis for quadrature variables was not activated."
  739. #define MSG_NULL_YQS0 "yQS0 = NULL illegal parameter."
  740. /* IDACalcIC error messages */
  741. #define MSG_IC_BAD_ICOPT "icopt has an illegal value."
  742. #define MSG_IC_MISSING_ID "id = NULL conflicts with icopt."
  743. #define MSG_IC_TOO_CLOSE "tout1 too close to t0 to attempt initial condition calculation."
  744. #define MSG_IC_BAD_ID "id has illegal values."
  745. #define MSG_IC_BAD_EWT "Some initial ewt component = 0.0 illegal."
  746. #define MSG_IC_RES_NONREC "The residual function failed unrecoverably. "
  747. #define MSG_IC_RES_FAIL "The residual function failed at the first call. "
  748. #define MSG_IC_SETUP_FAIL "The linear solver setup failed unrecoverably."
  749. #define MSG_IC_SOLVE_FAIL "The linear solver solve failed unrecoverably."
  750. #define MSG_IC_NO_RECOVERY "The residual routine or the linear setup or solve routine had a recoverable error, but IDACalcIC was unable to recover."
  751. #define MSG_IC_FAIL_CONSTR "Unable to satisfy the inequality constraints."
  752. #define MSG_IC_FAILED_LINS "The linesearch algorithm failed with too small a step."
  753. #define MSG_IC_CONV_FAILED "Newton/Linesearch algorithm failed to converge."
  754. /* IDASolve error messages */
  755. #define MSG_YRET_NULL "yret = NULL illegal."
  756. #define MSG_YPRET_NULL "ypret = NULL illegal."
  757. #define MSG_TRET_NULL "tret = NULL illegal."
  758. #define MSG_BAD_ITASK "itask has an illegal value."
  759. #define MSG_TOO_CLOSE "tout too close to t0 to start integration."
  760. #define MSG_BAD_HINIT "Initial step is not towards tout."
  761. #define MSG_BAD_TSTOP "The value " MSG_TIME_TSTOP " is behind current " MSG_TIME "in the direction of integration."
  762. #define MSG_CLOSE_ROOTS "Root found at and very near " MSG_TIME "."
  763. #define MSG_MAX_STEPS "At " MSG_TIME ", mxstep steps taken before reaching tout."
  764. #define MSG_EWT_NOW_FAIL "At " MSG_TIME "the user-provide EwtSet function failed."
  765. #define MSG_EWT_NOW_BAD "At " MSG_TIME "some ewt component has become <= 0.0."
  766. #define MSG_TOO_MUCH_ACC "At " MSG_TIME "too much accuracy requested."
  767. #define MSG_BAD_T "Illegal value for t. " MSG_TIME_INT
  768. #define MSG_BAD_TOUT "Trouble interpolating at " MSG_TIME_TOUT ". tout too far back in direction of integration."
  769. #define MSG_BAD_K "Illegal value for k."
  770. #define MSG_NULL_DKY "dky = NULL illegal."
  771. #define MSG_NULL_DKYP "dkyp = NULL illegal."
  772. #define MSG_ERR_FAILS "At " MSG_TIME_H "the error test failed repeatedly or with |h| = hmin."
  773. #define MSG_CONV_FAILS "At " MSG_TIME_H "the corrector convergence failed repeatedly or with |h| = hmin."
  774. #define MSG_SETUP_FAILED "At " MSG_TIME "the linear solver setup failed unrecoverably."
  775. #define MSG_SOLVE_FAILED "At " MSG_TIME "the linear solver solve failed unrecoverably."
  776. #define MSG_REP_RES_ERR "At " MSG_TIME "repeated recoverable residual errors."
  777. #define MSG_RES_NONRECOV "At " MSG_TIME "the residual function failed unrecoverably."
  778. #define MSG_FAILED_CONSTR "At " MSG_TIME "unable to satisfy inequality constraints."
  779. #define MSG_RTFUNC_FAILED "At " MSG_TIME ", the rootfinding routine failed in an unrecoverable manner."
  780. #define MSG_NO_ROOT "Rootfinding was not initialized."
  781. #define MSG_INACTIVE_ROOTS "At the end of the first step, there are still some root functions identically 0. This warning will not be issued again."
  782. #define MSG_EWTQ_NOW_BAD "At " MSG_TIME ", a component of ewtQ has become <= 0."
  783. #define MSG_QRHSFUNC_FAILED "At " MSG_TIME ", the quadrature right-hand side routine failed in an unrecoverable manner."
  784. #define MSG_QRHSFUNC_UNREC "At " MSG_TIME ", the quadrature right-hand side failed in a recoverable manner, but no recovery is possible."
  785. #define MSG_QRHSFUNC_REPTD "At " MSG_TIME "repeated recoverable quadrature right-hand side function errors."
  786. #define MSG_QRHSFUNC_FIRST "The quadrature right-hand side routine failed at the first call."
  787. #define MSG_NULL_P "p = NULL when using internal DQ for sensitivity residual is illegal."
  788. #define MSG_EWTS_NOW_BAD "At " MSG_TIME ", a component of ewtS has become <= 0."
  789. #define MSG_SRHSFUNC_FAILED "At " MSG_TIME ", the sensitivity residual routine failed in an unrecoverable manner."
  790. #define MSG_SRHSFUNC_UNREC "At " MSG_TIME ", the sensitivity residual failed in a recoverable manner, but no recovery is possible."
  791. #define MSG_SRHSFUNC_REPTD "At " MSG_TIME "repeated recoverable sensitivity residual function errors."
  792. #define MSG_NO_TOLQS "No integration tolerances for quadrature sensitivity variables have been specified."
  793. #define MSG_NULL_RHSQ "IDAS is expected to use DQ to evaluate the RHS of quad. sensi., but quadratures were not initialized."
  794. #define MSG_BAD_EWTQS "Initial ewtQS has component(s) equal to zero (illegal)."
  795. #define MSG_EWTQS_NOW_BAD "At " MSG_TIME ", a component of ewtQS has become <= 0."
  796. #define MSG_QSRHSFUNC_FAILED "At " MSG_TIME ", the sensitivity quadrature right-hand side routine failed in an unrecoverable manner."
  797. #define MSG_QSRHSFUNC_FIRST "The quadrature right-hand side routine failed at the first call."
  798. /* IDASet* / IDAGet* error messages */
  799. #define MSG_NEG_MAXORD "maxord<=0 illegal."
  800. #define MSG_BAD_MAXORD "Illegal attempt to increase maximum order."
  801. #define MSG_NEG_HMAX "hmax < 0 illegal."
  802. #define MSG_NEG_EPCON "epcon <= 0.0 illegal."
  803. #define MSG_BAD_CONSTR "Illegal values in constraints vector."
  804. #define MSG_BAD_EPICCON "epiccon <= 0.0 illegal."
  805. #define MSG_BAD_MAXNH "maxnh <= 0 illegal."
  806. #define MSG_BAD_MAXNJ "maxnj <= 0 illegal."
  807. #define MSG_BAD_MAXNIT "maxnit <= 0 illegal."
  808. #define MSG_BAD_STEPTOL "steptol <= 0.0 illegal."
  809. #define MSG_TOO_LATE "IDAGetConsistentIC can only be called before IDASolve."
  810. /*
  811. * =================================================================
  812. * I D A A E R R O R M E S S A G E S
  813. * =================================================================
  814. */
  815. #define MSGAM_NULL_IDAMEM "ida_mem = NULL illegal."
  816. #define MSGAM_NO_ADJ "Illegal attempt to call before calling IDAadjInit."
  817. #define MSGAM_BAD_INTERP "Illegal value for interp."
  818. #define MSGAM_BAD_STEPS "Steps nonpositive illegal."
  819. #define MSGAM_BAD_WHICH "Illegal value for which."
  820. #define MSGAM_NO_BCK "No backward problems have been defined yet."
  821. #define MSGAM_NO_FWD "Illegal attempt to call before calling IDASolveF."
  822. #define MSGAM_BAD_TB0 "The initial time tB0 is outside the interval over which the forward problem was solved."
  823. #define MSGAM_BAD_SENSI "At least one backward problem requires sensitivities, but they were not stored for interpolation."
  824. #define MSGAM_BAD_ITASKB "Illegal value for itaskB. Legal values are IDA_NORMAL and IDA_ONE_STEP."
  825. #define MSGAM_BAD_TBOUT "The final time tBout is outside the interval over which the forward problem was solved."
  826. #define MSGAM_BACK_ERROR "Error occured while integrating backward problem # %d"
  827. #define MSGAM_BAD_TINTERP "Bad t = %g for interpolation."
  828. #define MSGAM_BAD_T "Bad t for interpolation."
  829. #define MSGAM_WRONG_INTERP "This function cannot be called for the specified interp type."
  830. #define MSGAM_MEM_FAIL "A memory request failed."
  831. #define MSGAM_NO_INITBS "Illegal attempt to call before calling IDAInitBS."
  832. #ifdef __cplusplus
  833. }
  834. #endif
  835. #endif