10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-15 10:33:39 +01:00
QCaml/Nuclei/Element.mli

53 lines
1.2 KiB
OCaml
Raw Normal View History

2018-03-03 21:33:32 +01:00
(** Chemical elements. *)
2018-01-02 22:02:01 +01:00
exception ElementError of string
2018-01-17 15:56:57 +01:00
type t =
|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
|Pt
2018-01-02 22:02:01 +01:00
val of_string : string -> t
2018-03-03 21:33:32 +01:00
(** Creates an {!Element.t} from a chemical symbol or from the full name of the
element (case insensitive).
@raise ElementError upon failure
Examples:
{[
Element.of_string "Fe" -> Element.Fe
Element.of_string "hydrogen" -> Element.H
Element.of_string "pouet" -> ElementError "Element pouet unknown"
]}
*)
2018-01-02 22:02:01 +01:00
val to_string : t -> string
2018-03-03 21:33:32 +01:00
(** Gets the chemical symbol of the {!Element.t} in a string.
Example:
[Element.(to_string Fe) -> "Fe"]
*)
2018-01-02 22:02:01 +01:00
val to_long_string : t -> string
2018-03-03 21:33:32 +01:00
(** Gets the full name of the {!Element.t} in a string.
Example:
[Element.(to_long_string Fe) -> "Iron"]
*)
2018-01-02 22:02:01 +01:00
(** Properties *)
2018-01-17 15:56:57 +01:00
val to_int : t -> int
val of_int : int -> t
2018-01-02 22:02:01 +01:00
val to_charge : t -> Charge.t
val of_charge : Charge.t -> t
2018-02-24 23:57:38 +01:00
val covalent_radius : t -> NonNegativeFloat.t
val vdw_radius : t -> NonNegativeFloat.t
2018-01-02 22:02:01 +01:00
val mass : t -> Mass.t