10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-12-22 20:33:36 +01:00
QCaml/particles/lib/element.mli

80 lines
2.1 KiB
OCaml
Raw Permalink Normal View History

2024-02-28 10:34:39 +01:00
(** Chemical elements *)
2018-01-02 22:02:01 +01:00
2018-01-17 15:56:57 +01:00
type t =
2020-12-28 23:27:33 +01:00
|X
|H |He
|Li|Be |B |C |N |O |F |Ne
|Na|Mg |Al|Si|P |S |Cl|Ar
|K |Ca|Sc|Ti|V |Cr|Mn|Fe|Co|Ni|Cu|Zn|Ga|Ge|As|Se|Br|Kr
|Rb|Sr|Y |Zr|Nb|Mo|Tc|Ru|Rh|Pd|Ag|Cd|In|Sn|Sb|Te|I |Xe
2024-02-28 10:34:39 +01:00
|Pt
2018-01-02 22:02:01 +01:00
2020-12-28 23:27:33 +01:00
exception ElementError of string
2018-03-03 21:33:32 +01:00
2020-12-28 23:27:33 +01:00
open Common
2018-03-03 21:33:32 +01:00
2024-02-28 10:34:39 +01:00
(** Conversion *)
(**
* Element.of_string "Fe" ;;
* - : Element.t = Particles.Element.Fe
*
* Element.of_string "hydrogen" ;;
* - : Element.t = Particles.Element.H
*
* Element.of_string "Kryptonite" ;;
* Exception: Particles.Element.ElementError "Element Kryptonite unknown".
*
* Element.(to_long_string Fe) ;;
* - : string = "Iron"
*
* Element.(to_string Fe);;
* - : string = "Fe"
*)
2018-03-03 21:33:32 +01:00
2020-12-28 23:27:33 +01:00
val of_string : string -> t
2024-02-28 10:34:39 +01:00
(** Creates an ~Element.t~ from a chemical symbol or from the full name of the element (case insensitive) *)
2020-12-28 23:27:33 +01:00
val to_string : t -> string
2024-02-28 10:34:39 +01:00
(** Gets the chemical symbol of the ~Element.t~ in a string *)
2018-01-02 22:02:01 +01:00
val to_long_string : t -> string
2024-02-28 10:34:39 +01:00
(** Gets the full name of the ~Element.t~ in a string *)
val to_int : t -> int
(** Convert to the atomic charge, with ~int~ type *)
2018-01-02 22:02:01 +01:00
2018-01-17 15:56:57 +01:00
val of_int : int -> t
2024-02-28 10:34:39 +01:00
(** Create from the atomic charge, with ~int~ type *)
2018-03-03 22:13:14 +01:00
2018-01-02 22:02:01 +01:00
val to_charge : t -> Charge.t
2024-02-28 10:34:39 +01:00
(** Convert to the atomic charge, with ~Charge.t~ type *)
2018-01-02 22:02:01 +01:00
val of_charge : Charge.t -> t
2024-02-28 10:34:39 +01:00
(** Create from the atomic charge, with ~Charge.t~ type *)
2018-03-03 22:13:14 +01:00
2024-02-28 10:34:39 +01:00
(** Database information *)
2018-03-03 22:13:14 +01:00
2020-12-28 23:27:33 +01:00
val covalent_radius : t -> Non_negative_float.t
2024-02-28 10:34:39 +01:00
(** Covalent radii of the elements, in atomic units *)
2020-12-28 23:27:33 +01:00
val vdw_radius : t -> Non_negative_float.t
2024-02-28 10:34:39 +01:00
(** Van der Waals radii of the elements, in atomic units *)
2020-12-28 23:27:33 +01:00
val mass : t -> Mass.t
2024-02-28 10:34:39 +01:00
(** Atomic mass of the elements, in atomic units) *)
2020-12-28 23:27:33 +01:00
val small_core : t -> int
2024-02-28 10:34:39 +01:00
(** Number of electrons in the small core model (all except the outermost two shells) *)
2020-12-28 23:27:33 +01:00
val large_core : t -> int
2024-02-28 10:34:39 +01:00
(** Number of electrons in the large core model (all except the outermost shell) *)
2018-03-03 22:13:14 +01:00
2020-10-08 11:42:33 +02:00
2024-02-28 10:34:39 +01:00
(** Printers *)
2020-10-08 11:42:33 +02:00
2020-12-28 23:27:33 +01:00
val pp : Format.formatter -> t -> unit
2020-10-08 11:42:33 +02:00
val pp_long : Format.formatter -> t -> unit