callbacks.yaml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # this file defines structures passed back through callbacks
  2. MolWallHitInfo:
  3. doc: |
  4. Data structure passed to a callback function registered through
  5. Model.register_mol_wall_hit_callback.
  6. examples: tests/pymcell4_positive/1300_wall_hit_callback/model.py
  7. items:
  8. - name: molecule_id
  9. type: int
  10. doc: Id of molecule that hit the wall.
  11. - name: geometry_object
  12. type: GeometryObject*
  13. doc: Object that was hit.
  14. - name: wall_index
  15. type: int
  16. doc: Index of the wall belonging to the geometry_object.
  17. - name: time
  18. type: float
  19. doc: Time of the hit.
  20. - name: pos3d
  21. type: List[float]
  22. doc: Position of the hit.
  23. - name: time_before_hit
  24. type: float
  25. doc: |
  26. The time when the molecule started to diffuse towards the hit wall.
  27. It is either the start of the molecule's diffusion or
  28. when the molecule reflected from another wall.
  29. - name: pos3d_before_hit
  30. type: List[float]
  31. doc: Position of the molecule at time_before_hit.
  32. ReactionInfo:
  33. doc: |
  34. Data structure passed to a reaction callback registered with
  35. Model.register_reaction_callback.
  36. examples: tests/pymcell4_positive/1800_vol_rxn_callback/model.py
  37. items:
  38. - name: type
  39. type: ReactionType
  40. doc: |
  41. Specifies whether the reaction is unimolecular or bimolecular and
  42. also provides information on reactant types.
  43. - name: reactant_ids
  44. type: List[int]
  45. doc: |
  46. IDs of the reacting molecules, contains 1 ID for a unimolecular or a molecule+surface class reaction,
  47. 2 IDs for a bimolecular reaction.
  48. For a bimolecular reaction, the first ID is always the molecule that diffused and the second one
  49. is the molecule that was hit.
  50. IDs can be used to obtain the location of the molecules. The position of the first molecule obtained through
  51. model.get_molecule() is the position of the diffusing molecule before the collision.
  52. All the reactants are removed after return from this callback, unless they are kept by the reaction such as A in A + B -> A + C.
  53. - name: product_ids
  54. type: List[int]
  55. doc: |
  56. IDs of reaction product molecules. They already exist in the simulated system together with reactants; however reactants
  57. will be removed after return from this callback.
  58. - name: reaction_rule
  59. type: ReactionRule*
  60. doc: Reaction rule of the reaction that occured.
  61. - name: time
  62. type: float
  63. doc: Time of the reaction.
  64. - name: pos3d
  65. type: List[float]
  66. doc: |
  67. Specifies where reaction occurred in the 3d space, the specific meaning depends on the reaction type\:
  68. - unimolecular reaction - position of the reacting molecule,
  69. - volume-volume or surface-surface reaction - position of the first reactant,
  70. - volume-surface reaction - position where the volume molecule hit the wall with the surface molecule.
  71. - name: geometry_object
  72. type: GeometryObject*
  73. default: unset
  74. doc: |
  75. The object on whose surface where the reaction occurred.
  76. Set only for surface reactions or reactions with surface classes.
  77. - name: wall_index
  78. type: int
  79. default: -1
  80. doc: |
  81. Set only for surface reactions or reactions with surface classes.
  82. Index of wall belonging to the geometry_object where the reaction occured,
  83. i.e. wall where a volume molecule hit the surface molecule or
  84. wall where the diffusing surface reactant reacted.
  85. - name: pos2d
  86. type: List[float]
  87. default: unset
  88. doc: |
  89. Set only for surface reactions or reactions with surface classes.
  90. Specifies where reaction occurred in the 2d UV coordinates defined by the wall where the reaction occured,
  91. the rspecific meaning depends on the reaction type\:
  92. - unimolecular reaction - position of the reacting molecule,
  93. - volume-surface and surface-surface reaction - position of the second reactant.