Add the HRR related function and parameters into LTORC
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

66 Zeilen
2.1KB

  1. #ifndef MACRO_DEF
  2. #define MACRO_DEF
  3. //#define SUNDIALS_DOUBLE_PRECISION 1
  4. //#define SUNDIALS_SINGLE_PRECISION 1
  5. #define ZERO RCONST(0.0)
  6. #define HALF RCONST(0.5)
  7. #define ONE RCONST(1.0)
  8. #define TWO RCONST(2.0)
  9. #define THREE RCONST(3.0)
  10. #define FOUR RCONST(4.0)
  11. #define TEN RCONST(10.0)
  12. /* In order to keep begin the index numbers from 1 instead of 0, we define
  13. * macros here. Also, we define macros to ease referencing various variables in
  14. * the sundials nvector.
  15. */
  16. #define psi(i) psidata[i-1]
  17. #define T(i) ydata[((i-1)*data->nvar)+data->nt]
  18. #define Y(i,k) ydata[((i-1)*data->nvar)+data->ny+k-1]
  19. #define R(i) ydata[((i-1)*data->nvar)+data->nr]
  20. #define P(i) ydata[((i-1)*data->nvar)+data->np]
  21. #define HRRdata(i) HRRdata[i-1]
  22. #define Tdot(i) ydotdata[((i-1)*data->nvar)+data->nt]
  23. #define Ydot(i,k) ydotdata[((i-1)*data->nvar)+data->ny+k-1]
  24. #define Rdot(i) ydotdata[((i-1)*data->nvar)+data->nr]
  25. #define Pdot(i) ydotdata[((i-1)*data->nvar)+data->np]
  26. #define Tres(i) resdata[((i-1)*data->nvar)+data->nt]
  27. #define Yres(i,k) resdata[((i-1)*data->nvar)+data->ny+k-1]
  28. #define Rres(i) resdata[((i-1)*data->nvar)+data->nr]
  29. #define Pres(i) resdata[((i-1)*data->nvar)+data->np]
  30. #define Tid(i) iddata[((i-1)*data->nvar)+data->nt]
  31. #define Yid(i,k) iddata[((i-1)*data->nvar)+data->ny+k-1]
  32. #define Rid(i) iddata[((i-1)*data->nvar)+data->nr]
  33. #define Pid(i) iddata[((i-1)*data->nvar)+data->np]
  34. #define Yav(i) Yav[i-1]
  35. #define YAvg(i) YAvg[i-1]
  36. #define YVmhalf(i) YVmhalf[i-1]
  37. #define YVphalf(i) YVphalf[i-1]
  38. #define X(i) X[i-1]
  39. #define Xp(i) Xp[i-1]
  40. #define Xgradhalf(i) Xgradhalf[i-1]
  41. #define XLeft(i) XLeft[i-1]
  42. #define XRight(i) XRight[i-1]
  43. #define gradX(i) gradX[i-1]
  44. #define wdot(i) wdot[i-1]
  45. #define enthalpy(i) enthalpy[i-1]
  46. #define energy(i) energy[i-1]
  47. #define Cp(i) Cp[i-1]
  48. #define atolT(i) atolvdata[((i-1)*data->nvar)+data->nt]
  49. #define atolY(i,k) atolvdata[((i-1)*data->nvar)+data->ny+k-1]
  50. #define atolR(i) atolvdata[((i-1)*data->nvar)+data->nr]
  51. #define atolP(i) atolvdata[((i-1)*data->nvar)+data->np]
  52. #define constraintsY(i,k) constraintsdata[((i-1)*data->nvar)+data->ny+k-1]
  53. #endif