Add the HRR related function and parameters into LTORC
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

4 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 Tdot(i) ydotdata[((i-1)*data->nvar)+data->nt]
  22. #define Ydot(i,k) ydotdata[((i-1)*data->nvar)+data->ny+k-1]
  23. #define Rdot(i) ydotdata[((i-1)*data->nvar)+data->nr]
  24. #define Pdot(i) ydotdata[((i-1)*data->nvar)+data->np]
  25. #define Tres(i) resdata[((i-1)*data->nvar)+data->nt]
  26. #define Yres(i,k) resdata[((i-1)*data->nvar)+data->ny+k-1]
  27. #define Rres(i) resdata[((i-1)*data->nvar)+data->nr]
  28. #define Pres(i) resdata[((i-1)*data->nvar)+data->np]
  29. #define Tid(i) iddata[((i-1)*data->nvar)+data->nt]
  30. #define Yid(i,k) iddata[((i-1)*data->nvar)+data->ny+k-1]
  31. #define Rid(i) iddata[((i-1)*data->nvar)+data->nr]
  32. #define Pid(i) iddata[((i-1)*data->nvar)+data->np]
  33. #define Yav(i) Yav[i-1]
  34. #define YAvg(i) YAvg[i-1]
  35. #define YVmhalf(i) YVmhalf[i-1]
  36. #define YVphalf(i) YVphalf[i-1]
  37. #define X(i) X[i-1]
  38. #define Xp(i) Xp[i-1]
  39. #define Xgradhalf(i) Xgradhalf[i-1]
  40. #define XLeft(i) XLeft[i-1]
  41. #define XRight(i) XRight[i-1]
  42. #define gradX(i) gradX[i-1]
  43. #define wdot(i) wdot[i-1]
  44. #define enthalpy(i) enthalpy[i-1]
  45. #define energy(i) energy[i-1]
  46. #define Cp(i) Cp[i-1]
  47. #define atolT(i) atolvdata[((i-1)*data->nvar)+data->nt]
  48. #define atolY(i,k) atolvdata[((i-1)*data->nvar)+data->ny+k-1]
  49. #define atolR(i) atolvdata[((i-1)*data->nvar)+data->nr]
  50. #define atolP(i) atolvdata[((i-1)*data->nvar)+data->np]
  51. #define constraintsY(i,k) constraintsdata[((i-1)*data->nvar)+data->ny+k-1]
  52. #endif