The Gnome Chemistry Utils
0.13.7
|
00001 // -*- C -*- 00002 00003 /* 00004 * Gnome Chemisty Utils 00005 * chemistry.h 00006 * 00007 * Copyright (C) 2003-2011 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 3 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 00044 #ifndef GCU_CHEMISTRY_H 00045 #define GCU_CHEMISTRY_H 00046 00056 #ifdef __cplusplus 00057 extern "C" { 00058 #endif 00059 00063 #define MAX_ELT 116 00064 00074 enum gcu_spin_state 00075 { 00076 GCU_N_A_SPIN, 00077 GCU_LOW_SPIN, 00078 GCU_HIGH_SPIN 00079 }; 00080 00093 enum gcu_radius_type 00094 { 00095 GCU_RADIUS_UNKNOWN, 00096 GCU_ATOMIC, 00097 GCU_IONIC, 00098 GCU_METALLIC, 00099 GCU_COVALENT, 00100 GCU_VAN_DER_WAALS 00101 }; 00102 00106 typedef struct 00107 { 00109 double value; 00111 int prec; 00113 int delta; 00114 } GcuValue; 00115 00119 typedef struct 00120 { 00122 double value; 00124 int prec; 00126 int delta; 00128 const char *unit; 00129 } GcuDimensionalValue; 00130 00134 typedef struct 00135 { 00137 unsigned char Z; 00139 enum gcu_radius_type type; 00141 GcuDimensionalValue value; 00143 char charge; 00145 char const* scale; 00147 char cn; //coordination number: -1: unspecified 00149 enum gcu_spin_state spin; 00150 } GcuAtomicRadius; 00151 00155 typedef struct 00156 { 00158 unsigned char Z; 00160 GcuValue value; 00162 char const *scale; 00163 } GcuElectronegativity; 00164 00168 typedef struct 00169 { 00171 unsigned char A; 00173 char *name; 00175 GcuValue abundance; 00177 GcuValue mass; 00179 char spin; 00181 char *decay_modes; 00183 GcuDimensionalValue decay_period; 00184 } GcuIsotope; 00185 00192 const double* gcu_element_get_default_color (int Z); 00198 const char* gcu_element_get_symbol (int Z); 00203 const char* gcu_element_get_name (int Z); 00209 int gcu_element_get_Z (char* symbol); 00227 int gcu_element_get_radius (GcuAtomicRadius* radius); 00240 int gcu_element_get_electronegativity (GcuElectronegativity* en); 00250 GcuDimensionalValue const *gcu_element_get_ionization_energy (int Z, int N); 00263 GcuDimensionalValue const *gcu_element_get_electron_affinity (int Z, int N); 00269 char *gcu_element_get_weight_as_string (int Z); 00275 char const *gcu_element_get_electronic_configuration (int Z); 00282 const GcuAtomicRadius** gcu_element_get_radii (int Z); 00289 const GcuElectronegativity** gcu_element_get_electronegativities (int Z); 00296 void gcu_element_load_databases (char const *name, ...); 00297 00304 char* gcu_value_get_string (GcuValue const *value); 00305 00312 char* gcu_dimensional_value_get_string (GcuDimensionalValue const *value); 00313 00314 #ifdef __cplusplus 00315 } // extern "C" 00316 #endif 00317 00318 #endif //GCU_CHEMISTRY_H