|
funkalicious 0.1
|
00001 /* 00002 * matdb: generic materials database information. 00003 00004 Copyright (C) 2009 Joseph Pingenot 00005 00006 This program is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU Affero General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU Affero General Public License for more details. 00015 00016 You should have received a copy of the GNU Affero General Public License 00017 along with this program. If not, see <http://www.gnu.org/licenses/>. 00018 00019 */ 00020 00021 #ifndef MATDB_H_ 00022 #define MATDB_H_ 00023 00024 #include <glib-2.0/glib.h> 00025 00026 struct matdb_material { 00027 GString *name; 00028 GHashTable *properties; 00029 }; 00030 00031 struct matdb_bowing { 00032 GString *from; 00033 GString *to; 00034 GHashTable *properties; 00035 }; 00036 00037 struct matdb { 00038 GHashTable *materials; 00039 GHashTable *bowings; 00040 }; 00041 00042 void print_matdb(const struct matdb *mdb); 00043 void destroy_material_gpointer(gpointer data); 00044 void destroy_bowing_gpointer(gpointer data); 00045 void destroy_material(struct matdb_material *mat); 00046 void destroy_bowing(struct matdb_bowing *bow); 00047 /*Inserts a material which is solely used to mark a region, e.g. when optimizing 00048 * the material properties by steepest descent 00049 *When queried, this material only returns NaNs. 00050 **/ 00051 void insert_external_material(struct matdb* matdb, const char* matname); 00052 double get_property(const struct matdb* matdb, const char* ppt, const char* matstring, int* err); 00053 double get_property1(const struct matdb* matdb, const char* ppt, const char* mat, int* err); 00054 double get_property2(const struct matdb* matdb, const char* ppt, const char* mat, const char* mat2, double x, int* err); 00055 double get_bowing(const struct matdb* matdb, const char* ppt, const char* mat1, const char* mat2, int* err) ; 00056 00057 GHashTable* get_material(const struct matdb* matdb, const char* mat1, const char* mat2, double x); 00058 00059 00060 #endif