00001
00002
00003
00004
00005
00006 #include "isotrmat.h"
00007 #include "stochdrivert.h"
00008 #include "globalt.h"
00009
00010 isotrmat::isotrmat (void)
00011 {
00012
00013 k=0.0;
00014
00015 c=0.0;
00016 }
00017
00018
00019
00020 isotrmat::~isotrmat (void)
00021 {
00022 }
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 void isotrmat::matcond (matrix &d,long ri,long ci,long ipp)
00037 {
00038 long n;
00039 n = d.n;
00040
00041 switch (n){
00042 case 1:{
00043 matcond1d (d,ri,ci,ipp);
00044 break;
00045 }
00046 case 2:{
00047 matcond2d (d,ri,ci,ipp);
00048 break;
00049 }
00050 case 3:{
00051 matcond3d (d,ri,ci,ipp);
00052 break;
00053 }
00054 default:{
00055 print_err("unknown number of components of conductivity tensor is required",__FILE__,__LINE__,__func__);
00056 }
00057 }
00058 }
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 void isotrmat::matcond1d (matrix &d,long ri,long ci,long ipp)
00070 {
00071 double kk;
00072
00073 kk = get_k();
00074
00075 d[0][0] = kk;
00076 }
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 void isotrmat::matcond2d (matrix &d,long ri,long ci,long ipp)
00087 {
00088 double kk;
00089
00090 kk = get_k();
00091
00092 fillm(0.0,d);
00093
00094 d[0][0] = kk; d[0][1] = 0.0;
00095 d[1][0] = 0.0; d[1][1] = kk;
00096 }
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 void isotrmat::matcond3d (matrix &d,long ri,long ci,long ipp)
00108 {
00109 double kk;
00110
00111 kk = get_k();
00112
00113 fillm(0.0,d);
00114
00115 d[0][0]=kk; d[0][1]=0.0; d[0][2]=0.0;
00116 d[1][0]=0.0; d[1][1]=kk; d[1][2]=0.0;
00117 d[2][0]=0.0; d[2][1]=0.0; d[2][2]=kk;
00118 }
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 void isotrmat::matcap (double &cc,long ri,long ci,long ipp)
00130 {
00131 cc = 0.0;
00132
00133 cc = get_c();
00134 }
00135
00136
00137
00138
00139
00140
00141
00142 void isotrmat::read (XFILE *in)
00143 {
00144 xfscanf (in,"%lf %lf",&c,&k);
00145 }
00146
00147
00148
00149
00150
00151
00152
00153 void isotrmat::print (FILE *out)
00154 {
00155 fprintf (out," %e %e",c,k);
00156 }
00157
00158
00159
00160
00161
00162
00163
00164 double isotrmat::get_k()
00165 {
00166 return(k);
00167 }
00168
00169
00170
00171
00172
00173
00174 double isotrmat::get_c()
00175 {
00176 return(c);
00177 }
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191 void isotrmat::give_dof_names(namevart *dofname, long ntm)
00192 {
00193 if (ntm < 1)
00194 {
00195 print_err("the model defines %ld unknowns but number of transported media is %ld",
00196 __FILE__, __LINE__, __func__, 1, ntm);
00197 abort();
00198 }
00199 dofname[0] = trf_temperature;
00200 }
00201
00202
00203
00204
00205
00206
00207
00208 void isotrmat::changeparam (atsel &atm,vector &val)
00209 {
00210 long i;
00211
00212 for (i=0;i<atm.num;i++){
00213 switch (atm.atrib[i]){
00214 case 0:{
00215 c=val[0];
00216 break;
00217 }
00218 case 1:{
00219 k=val[1];
00220 break;
00221 }
00222 default:{
00223 print_err("wrong number of atribute is required",__FILE__,__LINE__,__func__);
00224 }
00225 }
00226 }
00227 }
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242 void isotrmat::give_reqntq(long *antq)
00243 {
00244 }