00001
00002
00003
00004
00005
00006
00007 #include <stdio.h>
00008 #include <stdlib.h>
00009 #include <math.h>
00010 #include "aliast.h"
00011 #include "fourmedia.h"
00012 #include "multiphase.h"
00013 #include "gmultiphase.h"
00014 #include "constrel.h"
00015 #include "globalt.h"
00016 #include "glasgowmat.h"
00017 #include "meshtransfert.h"
00018
00019 med4::med4()
00020 {
00021
00022 scale_w = 1.0;
00023 scale_t = 1.0;
00024 }
00025
00026 med4::~med4()
00027 {}
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 void med4::matcond (matrix &d,long ri,long ci,long ipp)
00038 {
00039 long i;
00040
00041
00042 i = Tm->ip[ipp].idm;
00043
00044 switch (Tm->ip[ipp].tm){
00045 case salt4mat:{
00046 Tm->salt4[i].matcond(d,ri,ci,ipp);
00047 break;
00048 }
00049
00050 default:{
00051 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
00052 }
00053 }
00054
00055 }
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 void med4::matcond2 (matrix &d,long ri,long ci,long ipp)
00066 {
00067 long i;
00068
00069
00070 i = Tm->ip[ipp].idm;
00071
00072 switch (Tm->ip[ipp].tm){
00073 case salt4mat:{
00074 Tm->salt4[i].matcond2 (d,ri,ci,ipp);
00075 break;
00076 }
00077
00078 default:{
00079 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
00080 }
00081 }
00082 }
00083
00084
00085
00086
00087
00088
00089
00090
00091 void med4::matcap (double &c,long ri,long ci,long ipp)
00092 {
00093 long i;
00094
00095
00096 i = Tm->ip[ipp].idm;
00097
00098 switch (Tm->ip[ipp].tm){
00099 case salt4mat:{
00100 Tm->salt4[i].matcap(c,ri,ci,ipp);
00101 break;
00102 }
00103
00104 default:{
00105 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
00106 }
00107 }
00108 }
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 double med4::transmission_transcoeff(double trc,long ri,long ci,long nid,long bc,long ipp)
00122 {
00123 double new_trc;
00124 long i;
00125
00126
00127 i = Tm->ip[ipp].idm;
00128
00129 switch (Tm->ip[ipp].tm){
00130 case salt4mat:{
00131 new_trc = Tm->salt4[i].transmission_transcoeff (trc,ri,ci,nid,bc);
00132 break;
00133 }
00134
00135 default:{
00136 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
00137 }
00138 }
00139
00140 return(new_trc);
00141 }
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 double med4::transmission_nodval(double nodval,double trc2,long ri,long ci,long nid,long bc,long ipp)
00157 {
00158 double new_nodval;
00159 long i;
00160
00161
00162 i = Tm->ip[ipp].idm;
00163
00164 switch (Tm->ip[ipp].tm){
00165 case salt4mat:{
00166 new_nodval = Tm->salt4[i].transmission_nodval (nodval,ri,ci,nid,bc);
00167 break;
00168 }
00169 default:{
00170 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
00171 }
00172 }
00173
00174 return(new_nodval);
00175 }
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190 double med4::transmission_flux(double nodval,double trc2,long ri,long ci,long nid,long bc,long ipp)
00191 {
00192 double flux;
00193 long i;
00194
00195
00196 i = Tm->ip[ipp].idm;
00197
00198 switch (Tm->ip[ipp].tm){
00199 case salt4mat:{
00200 flux = Tm->salt4[i].transmission_flux (nodval,ri,ci,nid,bc);
00201 break;
00202 }
00203
00204 default:{
00205 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
00206 }
00207 }
00208
00209 return(flux);
00210 }
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224 double med4::compute_othervalues (long compother,long ipp,double *r)
00225 {
00226 double other;
00227 long i;
00228
00229
00230 i = Tm->ip[ipp].idm;
00231
00232 switch (Tm->ip[ipp].tm){
00233 case salt4mat:{
00234
00235 double w,cf,cfmax,t;
00236 w = r[0];
00237 cf = r[1];
00238 cfmax = r[2];
00239 t = r[3];
00240
00241 w = w*scale_w;
00242 t = t*scale_w;
00243 cf = cf*scale_w;
00244 cfmax = cfmax*scale_w;
00245
00246
00247 other = Tm->salt4[i].get_othervalue(compother,ipp,w,cf,cfmax,t);
00248
00249 break;
00250 }
00251
00252 default:{
00253 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
00254 }
00255 }
00256
00257 return(other);
00258 }
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269 void med4::print_othervaluesnames (FILE *out,long ipp,long compother)
00270 {
00271
00272
00273
00274
00275
00276 }
00277