00001 #define EXTERN 00002 #include "globalt.h" 00003 00004 #include "stochdrivert.h" 00005 #include "trfelinit.h" 00006 #include "hermtrf.h" 00007 00008 /** 00009 The function returns required conductivity coefficient 00010 from the material conductivity %matrix. 00011 00012 @param phi - relative humidity at given integration point 00013 @param t - temperature at given integration point 00014 @param cm - required conductivity %matrix 00015 @param ri - block row index of transported media 00016 @param ci - block column index of transported media 00017 @param im - index of material (default 0 for homogeneous domain) 00018 00019 @return The function returns required conductivity coefficient. 00020 00021 Created 04.2011 by Tomas Koudelka, koudelka@cml.fsv.cvut.cz 00022 */ 00023 void condmat(double phi, double t, double *cm, long ri, long ci, long im) 00024 { 00025 matrix d(2,2); // conductivity matrix for 2D problem 00026 Tm->ip[im].av[0] = phi; 00027 if (Tp->ntm > 1) 00028 Tm->ip[im].av[1] = t; 00029 Tm->matcond(d, im, ri, ci); 00030 cm[0] = d[0][0]; 00031 cm[1] = d[0][1]; 00032 cm[2] = d[1][0]; 00033 cm[3] = d[1][1]; 00034 return; 00035 } 00036 00037 00038 00039 /** 00040 The function returns required capacity coefficient 00041 from the material capacity %matrix. 00042 @param phi - relative humidity at given integration point 00043 @param t - temperature at given integration point 00044 @param ri - block row index of transported media 00045 @param ci - block column index of transported media 00046 @param im - index of material (default 0 for homogeneous domain) 00047 00048 @return The function returns required capacity coefficient. 00049 00050 Created 04.2011 by Tomas Koudelka, koudelka@cml.fsv.cvut.cz 00051 */ 00052 double capcoeff(double phi, double t, long ri, long ci, long im) 00053 { 00054 double ret; 00055 Tm->ip[im].av[0] = phi; 00056 if (Tp->ntm > 1) 00057 Tm->ip[im].av[1] = t; 00058 ret = Tm->capcoeff(im, ri, ci); 00059 return ret; 00060 } 00061 00062 00063 00064 /** 00065 The function initializes the TRFEL from the HERMES code. 00066 It serves for the separation of codes due to conflicts in the 00067 used type names. 00068 00069 @param argc - number of arguments passed by the command line 00070 (it has to be 2 or 3) 00071 @param argv - array of pinters to strings with command line arguments 00072 argv[0] has to be string with the program name 00073 argv[1] has to be string with the input file name 00074 argv[2] is optional and it should contain keyword specificator (see trfelinit.cpp for more details) 00075 00076 @return The function does not return anything. 00077 00078 Created 04.2011 by Tomas Koudelka, koudelka@cml.fsv.cvut.cz 00079 */ 00080 void hermtrf_init(int argc, const char *argv[]) 00081 { 00082 stochdrivert stochd; 00083 00084 Stt = NULL; 00085 Kmat = NULL; 00086 Cmat = NULL; 00087 Jmat = NULL; 00088 Bmat = NULL; 00089 Lbt = NULL; 00090 Lbat = NULL; 00091 Qbt = NULL; 00092 Qbat = NULL; 00093 Ltt = NULL; 00094 Ltat = NULL; 00095 Lqt = NULL; 00096 Qqt = NULL; 00097 Qqat = NULL; 00098 Lqat = NULL; 00099 Ltett = NULL; 00100 Lht = NULL; 00101 Qht = NULL; 00102 G2d = NULL; 00103 00104 // program initiation and data reading 00105 trfel_init (argc,argv,&stochd); 00106 } 00107 00108 00109 00110 /** 00111 The function performs a cleanup of the TRFEL global variables 00112 and it closes opened files. 00113 00114 Created 04.2011 by Tomas Koudelka, koudelka@cml.fsv.cvut.cz 00115 */ 00116 void hermtrf_close() 00117 { 00118 /* 00119 delete Tp; 00120 delete Gtt; 00121 delete Tt; 00122 delete Tm; 00123 delete Tc; 00124 delete Tb; 00125 delete Lsrst; 00126 delete Stt; 00127 delete Outdt; 00128 delete Kmat; 00129 delete Cmat; 00130 delete Jmat; 00131 delete Bmat; 00132 delete Lbt; 00133 delete Lbat; 00134 delete Qbt; 00135 delete Qbat; 00136 delete Ltt; 00137 delete Ltat; 00138 delete Lqt; 00139 delete Qqt; 00140 delete Qqat; 00141 delete Lqat; 00142 delete Ltett; 00143 delete Lht; 00144 delete Qht; 00145 */ 00146 fclose(Outt); 00147 }