introspection.yaml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. Molecule:
  2. superclass: BaseIntrospectionClass
  3. doc: |
  4. Representation of a molecule obtained from Model
  5. during simulation obtained through Model.get_molecule.
  6. Changes through changing attributes of this object are not allowed except
  7. for complete removal of this molecule.
  8. examples: tests/pymcell4_positive/1900_molecule_introspection/model.py
  9. items:
  10. - name: id
  11. type: int
  12. default: ID_INVALID
  13. doc: |
  14. Unique id of this molecule. MCell assigns this unique id to each created
  15. molecule. All reactions change ID of molecules even in reactions such as
  16. A@CP -> A@EC.
  17. - name: type
  18. type: MoleculeType
  19. default: MoleculeType.UNSET
  20. doc: |
  21. Type of this molecule, either volume or surface.
  22. - name: species_id
  23. type: int
  24. default: ID_INVALID
  25. doc: |
  26. Species id of this molecule.
  27. The species_id value is only temporary. Species ids are created and removed as needed
  28. automatically and if this species is removed, this particular species_id value
  29. won't be valid. This can happen when a following iteration is simulated.
  30. - name: pos3d
  31. type: List[float]
  32. default: unset
  33. doc: |
  34. Contains position of a molecule in 3D space.
  35. - name: orientation
  36. type: Orientation
  37. default: Orientation.NOT_SET
  38. doc: |
  39. Contains orientation for surface molecule. Volume molecules
  40. have always orientation set to Orientation.NONE.
  41. - name: pos2d
  42. type: List[float]
  43. default: unset
  44. doc: |
  45. Set only for surface molecules. Position on a wall in UV coordinates
  46. relative to the triangle of the wall.
  47. - name: geometry_object
  48. type: GeometryObject*
  49. default: unset
  50. doc: |
  51. Set only for surface molecules.
  52. Is set to a reference to the geometry object on whose surface is the molecule located.
  53. - name: wall_index
  54. type: int
  55. default: -1
  56. doc: |
  57. Set only for surface molecules.
  58. Index of wall belonging to the geometry_object where is the
  59. molecule located.
  60. methods:
  61. - name: remove
  62. doc: |
  63. Removes this molecule from simulation. Any subsequent modifications
  64. of this molecule won't have any effect.
  65. examples: tests/pymcell4_positive/1920_molecule_remove/model.py
  66. Wall:
  67. superclass: BaseIntrospectionClass
  68. doc: |
  69. Constant representation of wall of a geometry object.
  70. Changes through changing attributes of this object are not allowed
  71. except for the attribute is_movable.
  72. examples: tests/pymcell4_positive/1330_get_wall/model.py
  73. items:
  74. - name: geometry_object
  75. type: GeometryObject*
  76. doc: Object to which this wall belongs.
  77. - name: wall_index
  78. type: int
  79. doc: Index of this wall in the object to which this wall belongs.
  80. - name: vertices
  81. type: List[List[float]]
  82. doc: Vertices of the triangle that represents this wall.
  83. - name: area
  84. type: float
  85. doc: Area of the wall in um^2.
  86. - name: unit_normal
  87. type: List[float]
  88. doc: |
  89. Normal of this wall with unit length of 1 um.
  90. There is also a method Model.get_wall_unit_normal that allows to
  91. retrieve just the normal value without the need to prepare this
  92. whole Wall object.
  93. - name: is_movable
  94. type: bool
  95. default: true
  96. doc: |
  97. If True, whis wall can be moved through Model.apply_vertex_moves,
  98. if False, wall moves are ignored.
  99. Can be set during simulation.
  100. WallWallHitInfo:
  101. superclass: BaseIntrospectionClass
  102. doc: |
  103. This class is used in the return type of Model.apply_vertex_moves.
  104. Contains pair of walls that collided.
  105. examples: tests/pymcell4_positive/1515_tetrahedron_box_collision_moving_3_w_wall_wall_hit/model.py
  106. items:
  107. - name: wall1
  108. type: Wall*
  109. doc: First colliding wall.
  110. - name: wall2
  111. type: Wall*
  112. doc: Second colliding wall.
  113. Introspection:
  114. doc:
  115. Only internal.
  116. This class is used only as a base class to Model, it is not provided through API.
  117. Defines interface to introspect simulation state.
  118. methods:
  119. - name: get_molecule_ids
  120. doc: |
  121. Returns a list of ids of molecules.
  122. If the arguments pattern is not set, the list of all molecule ids is returned.
  123. If the argument pattern is set, the list of all molecule ids whose species match
  124. the pattern is returned.
  125. examples: tests/pymcell4_positive/1910_get_molecule_ids_w_pattern/model.py
  126. return_type: List[int]
  127. params:
  128. - name: pattern
  129. type: Complex*
  130. default: unset
  131. doc: BNGL pattern to select molecules based on their species, might use compartments.
  132. - name: get_molecule
  133. doc: |
  134. Returns a information on a molecule from the simulated environment,
  135. None if the molecule does not exist.
  136. examples: tests/pymcell4_positive/1900_molecule_introspection/model.py
  137. return_type: Molecule*
  138. params:
  139. - name: id
  140. type: int
  141. doc: Unique id of the molecule to be retrieved.
  142. - name: get_species_name
  143. doc: |
  144. Returns a string representing canonical species name in the BNGL format.
  145. examples: tests/pymcell4_positive/1850_run_unimol_rxn_in_callback/model.py
  146. return_type: str
  147. params:
  148. - name: species_id
  149. type: int
  150. doc: Id of the species.
  151. # --- geometry ---
  152. - name: get_vertex
  153. doc: Returns coordinates of a vertex.
  154. examples: tests/pymcell4_positive/1340_get_vertex/model.py
  155. return_type: List[float]
  156. params:
  157. - name: object
  158. type: GeometryObject*
  159. - name: vertex_index
  160. type: int
  161. doc: This is the index of the vertex in the geometry object's walls (wall_list).
  162. - name: get_wall
  163. doc: Returns information about a wall belonging to a given object.
  164. examples: tests/pymcell4_positive/1330_get_wall/model.py
  165. return_type: Wall*
  166. params:
  167. - name: object
  168. type: GeometryObject*
  169. doc: Geometry object whose wall to retrieve.
  170. - name: wall_index
  171. type: int
  172. doc: This is the index of the wall in the geometry object's walls (wall_list).
  173. - name: get_vertex_unit_normal
  174. doc: |
  175. Returns sum of all wall normals that use this vertex converted to a unit vector of
  176. length 1 um (micrometer).
  177. This represents the unit vector pointing outwards from the vertex.
  178. examples: tests/pymcell4_positive/1320_get_vertex_unit_normal/model.py
  179. return_type: List[float]
  180. params:
  181. - name: object
  182. type: GeometryObject*
  183. doc: Geometry object whose vertex to retrieve.
  184. - name: vertex_index
  185. type: int
  186. doc: This is the index of the vertex in the geometry object's vertex_list.
  187. - name: get_wall_unit_normal
  188. doc: Returns wall normal converted to a unit vector of length 1um.
  189. examples: tests/pymcell4_positive/1310_get_wall_unit_normal/model.py
  190. return_type: List[float]
  191. params:
  192. - name: object
  193. type: GeometryObject*
  194. doc: Geometry object whose wall's normal to retrieve.
  195. - name: wall_index
  196. type: int
  197. doc: This is the index of the vertex in the geometry object's walls (wall_list).
  198. # --- display/export manipulation ---
  199. - name: get_wall_color
  200. doc: Returns color of a wall.
  201. return_type: Color*
  202. params:
  203. - name: object
  204. type: GeometryObject*
  205. doc: Geometry object whose wall's color to retrieve.
  206. - name: wall_index
  207. type: int
  208. doc: This is the index of the vertex in the geometry object's walls (wall_list).
  209. - name: set_wall_color
  210. doc: Sets color of a wall.
  211. params:
  212. - name: object
  213. type: GeometryObject*
  214. doc: Geometry object whose wall's color to retrieve.
  215. - name: wall_index
  216. type: int
  217. doc: This is the index of the vertex in the geometry object's walls (wall_list).
  218. - name: color
  219. type: Color*
  220. doc: Color to be set.