00001 #ifndef DBMATT_H 00002 #define DBMATT_H 00003 00004 #include <stdio.h> 00005 #include "aliast.h" 00006 #include "iotools.h" 00007 00008 00009 00010 /** 00011 Material class 00012 00013 Created by Tomas Koudelka, koudelka@cml.fsv.cvut.cz 00014 Modified 04.2008 by Tomas Koudelka, koudelka@cml.fsv.cvut.cz 00015 */ 00016 class matrt 00017 { 00018 public : 00019 mattypet type; ///< material type number 00020 long ninst; ///< number of indeces 00021 char **inst; ///< array of strings with material properties (material indeces) 00022 long *instu; ///< array indicators of indeces which are used 00023 long *ridx; ///< array with renumbered used indeces 00024 long ninstu; ///< counter used indeces this material type 00025 00026 matrt(void); 00027 ~matrt(void); 00028 00029 /// allocates memory for material paramaters stored as strings 00030 void alloc(long ni); 00031 00032 /// allocates memory for material paramaters read/stored by transmat procedures 00033 void alloctm(long ni); 00034 00035 /// reads material parameters from the opened text file as strings 00036 long read(XFILE *in); 00037 }; 00038 00039 class transmat; 00040 struct descript; 00041 00042 00043 /** 00044 Material database class 00045 00046 Created by Tomas Koudelka, koudelka@cml.fsv.cvut.cz 00047 */ 00048 class dbmatt 00049 { 00050 public : 00051 long numt; ///< number of material entries 00052 matrt *mat; ///< array with materials 00053 long *matu; ///< array with indicators of material usage in the given problem 00054 long nmatu; ///< number of used materials in the given problem 00055 00056 dbmatt(void); 00057 ~dbmatt(void); 00058 00059 /// reads materials from the text file as strings 00060 long read(XFILE *in); 00061 00062 /// reads materials from the text file via mechmat procedures 00063 long readtm(XFILE *in, transmat *mechm, descript *d); 00064 00065 /// searches for given material type and index 00066 long search_mat(mattypet ce, long ci); 00067 00068 /// marks used materials 00069 void mark_used(long ic, long csti); 00070 00071 /// renumbers instance indeces of particular material types 00072 void renumber_id(void); 00073 }; 00074 00075 #endif