00001 #ifndef DBMAT_H 00002 #define DBMAT_H 00003 00004 #include <stdio.h> 00005 #include "alias.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 matr 00017 { 00018 public : 00019 mattype 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 matr(void); 00027 ~matr(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 mechmat procedures 00033 void allocmm(long ni); 00034 00035 /// reads material parameters from the opened text file as strings 00036 long read(XFILE *in); 00037 }; 00038 00039 class mechmat; 00040 struct descrip; 00041 00042 /** 00043 Material database class 00044 00045 Created by Tomas Koudelka, koudelka@cml.fsv.cvut.cz 00046 */ 00047 class dbmat 00048 { 00049 public : 00050 long numt; ///< number of material entries 00051 matr *mat; ///< array with materials 00052 long *matu; ///< array with indicators of material usage in the given problem 00053 long nmatu; ///< number of used materials in the given problem 00054 00055 dbmat(void); 00056 ~dbmat(void); 00057 00058 /// reads materials from the text file as strings 00059 long read(XFILE *in); 00060 00061 /// reads materials from the text file via mechmat procedures 00062 long readmm(XFILE *in, mechmat *mechm, descrip *d); 00063 00064 /// searches material database for the given material type and index 00065 long search_mat(mattype ce, long ci); 00066 00067 /// marks used materials 00068 void mark_used(long ic, long csti); 00069 00070 /// renumbers instance indeces of particular material types 00071 void renumber_id(void); 00072 }; 00073 00074 #endif