# chemistry.h

Go to the documentation of this file.

    00001 // -*- C -*-
    00002
    00003 /*
    00004  * Gnome Chemisty Utils
    00005  * chemistry.h
    00006  *
    00007  * Copyright (C) 2003-2006 Jean Bréfort <jean.brefort@normalesup.org>
    00008  *
    00009  * This program is free software; you can redistribute it and/or
    00010  * modify it under the terms of the GNU General Public License as
    00011  * published by the Free Software Foundation; either version 2 of the
    00012  * License, or (at your option) any later version.
    00013  *
    00014  * This program is distributed in the hope that it will be useful,
    00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00017  * GNU General Public License for more details.
    00018  *
    00019  * You should have received a copy of the GNU General Public License
    00020  * along with this program; if not, write to the Free Software
    00021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
    00022  * USA
    00023  */
    00024
    00025
    00043 #ifndef GCU_CHEMISTRY_H
    00044 #define GCU_CHEMISTRY_H
    00045
    00046 #include <glib.h>
    00047
    00057 G_BEGIN_DECLS
    00058
    00062 #define MAX_ELT 116
    00063
    00073 enum gcu_spin_state
    00074 {
    00075         GCU_N_A_SPIN,
    00076         GCU_LOW_SPIN,
    00077         GCU_HIGH_SPIN
    00078 };
    00079
    00092 enum gcu_radius_type
    00093 {
    00094         GCU_RADIUS_UNKNOWN,
    00095         GCU_ATOMIC,
    00096         GCU_IONIC,
    00097         GCU_METALLIC,
    00098         GCU_COVALENT,
    00099         GCU_VAN_DER_WAALS
    00100 };
    00101
    00105 typedef struct
    00106 {
    00108         double value;
    00110         int prec;
    00112         int delta;
    00113 } GcuValue;
    00114
    00118 typedef struct
    00119 {
    00121         double value;
    00123         int prec;
    00125         int delta;
    00127         const char *unit;
    00128 } GcuDimensionalValue;
    00129
    00133 typedef struct
    00134 {
    00136         unsigned char Z;
    00138         enum gcu_radius_type type;
    00140         GcuDimensionalValue value;
    00142         char charge;
    00144         char const* scale;
    00146         char cn;        //coordination number: -1: unspecified
    00148         enum gcu_spin_state spin;
    00149 } GcuAtomicRadius;
    00150
    00154 typedef struct
    00155 {
    00157         unsigned char Z;
    00159         GcuValue value;
    00161         char const *scale;
    00162 } GcuElectronegativity;
    00163
    00167 typedef struct
    00168 {
    00170         unsigned char A;
    00172         char *name;
    00174         GcuValue abundance;
    00176         GcuValue mass;
    00178         char spin;
    00180         char *decay_modes;
    00182         GcuDimensionalValue decay_period;
    00183 } GcuIsotope;
    00184
    00191 const gdouble* gcu_element_get_default_color (gint Z);
    00197 const gchar* gcu_element_get_symbol (gint Z);
    00202 const gchar* gcu_element_get_name (gint Z);
    00208 gint gcu_element_get_Z (gchar* symbol);
    00226 gboolean gcu_element_get_radius (GcuAtomicRadius* radius);
    00239 gboolean gcu_element_get_electronegativity (GcuElectronegativity* en);
    00249 GcuDimensionalValue const *gcu_element_get_ionization_energy (int Z, int N);
    00262 GcuDimensionalValue const *gcu_element_get_electron_affinity (int Z, int N);
    00269 const GcuAtomicRadius** gcu_element_get_radii (gint Z);
    00276 const GcuElectronegativity** gcu_element_get_electronegativities (gint Z);
    00283 void gcu_element_load_databases (char const *name, ...);
    00284
    00291 gchar* gcu_value_get_string (GcuValue const *value);
    00292
    00299 gchar* gcu_dimensional_value_get_string (GcuDimensionalValue const *value);
    00300
    00301 G_END_DECLS
    00302
    00303 #endif //GCU_CHEMISTRY_H