00001 #include <math.h>
00002 #include <string.h>
00003 #include <stdlib.h>
00004 #include "transmat.h"
00005 #include "globalt.h"
00006 #include "globmatt.h"
00007 #include "intpointst.h"
00008 #include "elementt.h"
00009 #include "nodet.h"
00010 #include "onemedium.h"
00011 #include "twomedia.h"
00012 #include "threemedia.h"
00013 #include "fourmedia.h"
00014 #include "multiphase.h"
00015 #include "gmultiphase.h"
00016 #include "elemswitcht.h"
00017
00018 transmat::transmat (void)
00019 {
00020
00021 tnip=0;
00022
00023
00024 ip=NULL;
00025
00026 elip = NULL;
00027
00028
00029 itrm=NULL;
00030
00031 nlitrm=NULL;
00032
00033 hommat=NULL;
00034
00035
00036 cernym=NULL;
00037
00038 sejtkrm=NULL;
00039
00040 kun=NULL;
00041 kun2=NULL;
00042 grunw=NULL;
00043 dvries=NULL;
00044 bazped=NULL;
00045 ped=NULL;
00046 carb1=NULL;
00047 sdmat=NULL;
00048 mill = NULL;
00049 moisth = NULL;
00050
00051 salt1 = NULL;
00052 salt2 = NULL;
00053 salt3 = NULL;
00054 salt4 = NULL;
00055
00056 consol_awf1 = NULL;
00057 consol_awf2 = NULL;
00058
00059 concrete = NULL;
00060 baroghel = NULL;
00061 C60baroghel = NULL;
00062 C30baroghel = NULL;
00063 o30bazant = NULL;
00064 C60bazant = NULL;
00065 C30bazant = NULL;
00066 tench = NULL;
00067
00068 soil1 = NULL;
00069 richar = NULL;
00070 cemhydr = NULL;
00071
00072 lcmat=NULL;
00073
00074 mattype = NULL;
00075 numtype = NULL;
00076
00077
00078 initval = NULL;
00079
00080 nontransq = NULL;
00081 nntq = 0;
00082 for (long i=0; i<tnkntq; i++)
00083 ntqid[i] = -1;
00084 }
00085
00086 transmat::~transmat (void)
00087 {
00088 long i;
00089
00090 delete [] ip;
00091 delete [] elip;
00092
00093 delete [] itrm;
00094 delete [] nlitrm;
00095 delete [] hommat;
00096 delete [] cernym;
00097
00098 delete [] sejtkrm;
00099
00100 delete [] kun;
00101 delete [] kun2;
00102 delete [] grunw;
00103 delete [] dvries;
00104 delete [] bazped;
00105 delete [] ped;
00106 delete [] carb1;
00107 delete [] sdmat;
00108 delete [] mill;
00109 delete [] moisth;
00110
00111 delete [] salt1;
00112 delete [] salt2;
00113 delete [] salt3;
00114 delete [] salt4;
00115
00116 delete [] consol_awf1;
00117 delete [] consol_awf2;
00118
00119 delete [] concrete;
00120 delete [] baroghel;
00121 delete [] C60baroghel;
00122 delete [] C30baroghel;
00123 delete [] o30bazant;
00124 delete [] C60bazant;
00125 delete [] C30bazant;
00126 delete [] tench;
00127
00128 delete [] richar;
00129
00130 delete [] soil1;
00131
00132 delete [] lcmat;
00133
00134 delete [] mattype;
00135 delete [] numtype;
00136
00137 delete [] initval;
00138
00139 if (nontransq != NULL){
00140 for (i=0;i<nntq;i++){
00141 delete [] nontransq[i];
00142 }
00143 delete [] nontransq;
00144 }
00145 }
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155 long transmat::intpnum (void)
00156 {
00157 long i,j,k,n;
00158
00159 n=0;
00160 for (i=0;i<Tt->ne;i++){
00161 Tt->elements[i].ipp = new long* [Tp->ntm];
00162 for (j=0;j<Tp->ntm;j++){
00163 Tt->elements[i].ipp[j] = new long [Tp->ntm];
00164 for (k=0;k<Tp->ntm;k++){
00165 Tt->elements[i].ipp[j][k]=n;
00166 n+=Tt->give_nip (i,j,k);
00167 }
00168 }
00169 }
00170 return n;
00171 }
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181 void transmat::readip (FILE *in)
00182 {
00183 long i;
00184
00185 ip = new intpointst [tnip];
00186
00187
00188 for (i=0;i<tnip;i++)
00189 ip[i].alloc(i);
00190
00191
00192 for (i=0;i<tnip;i++){
00193 ip[i].read (in);
00194 }
00195 }
00196
00197
00198
00199
00200 void transmat::intpointalloc ()
00201 {
00202 ip = new intpointst [tnip];
00203 }
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218 void transmat::alloc_nontransq(long n)
00219 {
00220 long i, j;
00221
00222 nntq = n;
00223 nontransq = new double*[nntq];
00224
00225 for (i=0; i<nntq; i++)
00226 {
00227 nontransq[i] = new double[tnip];
00228
00229 memset(nontransq[i], 0, sizeof(*nontransq[i])*tnip);
00230 }
00231
00232 if (ntqo == NULL)
00233 {
00234 ntqo = new nontransquant[nntq];
00235 j=0;
00236 for (i=0; i<tnkntq; i++)
00237 {
00238 if (ntqid[i] > -1)
00239 {
00240 ntqo[j] = nontransquant(i+1);
00241 j++;
00242 }
00243 }
00244 if (j != nntq)
00245 {
00246 print_err("indices of used non-transport qunatities must be initialized before allocation", __FILE__, __LINE__, __func__);
00247 abort();
00248 }
00249 }
00250 return;
00251 }
00252
00253
00254
00255
00256
00257
00258 void transmat::intpointinit ()
00259 {
00260 long i,j,k,ii,jj,nb,nip,ipp,ncomp;
00261
00262 elip = new long[tnip];
00263
00264 for (i=0;i<Tt->ne;i++){
00265 nb=Tp->ntm; k=0;
00266 ncomp=Tt->give_ncomp (i);
00267 for (ii=0;ii<nb;ii++){
00268 for (jj=0;jj<nb;jj++){
00269 nip=Tt->give_nip(i,ii,jj);
00270 ipp=Tt->elements[i].ipp[ii][jj];
00271 for (j=0;j<nip;j++){
00272 if (elip != NULL)
00273 elip[ipp] = i;
00274 ip[ipp].ncompgrad=ncomp;
00275 ip[ipp].tm = Tt->elements[i].tm[k];
00276 ip[ipp].idm = Tt->elements[i].idm[k];
00277 ipp++;
00278 }
00279 k++;
00280 }
00281 }
00282 }
00283
00284 for (i=0;i<tnip;i++)
00285 ip[i].alloc(i);
00286 }
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304 void transmat::assemble_dof_nameord(namevart *dofname, long ntm, long *var_dofid, long tnkv)
00305 {
00306 long i, j, id, reord;
00307
00308 reord = 0;
00309 for(i=0; i<tnip; i++)
00310 {
00311 memset(dofname, 0, sizeof(*dofname)*ntm);
00312 give_dof_names(i, dofname, ntm);
00313
00314 for(j=0; j<ntm; j++)
00315 {
00316 id = var_dofid[int(dofname[j])-1];
00317
00318 if (id < 0)
00319 var_dofid[int(dofname[j])-1] = j;
00320 else
00321 {
00322 if (id != j)
00323 reord = 1;
00324 }
00325 }
00326 }
00327
00328 if (reord)
00329 {
00330
00331 for(i=0, j=0; i<tnkv; i++)
00332 {
00333 if (var_dofid[i] >= 0)
00334 {
00335 var_dofid[i] = j;
00336 j++;
00337 }
00338 }
00339 if (j != ntm)
00340 {
00341 print_err("number of nodal unknowns detected in material models(=%ld) is different\n"
00342 "than the one specified in the probdesct(=%ld)", __FILE__, __LINE__, __func__, j, ntm);
00343 abort();
00344 }
00345
00346 for(i=0; i<tnkv; i++)
00347 {
00348 if (var_dofid[i] >= 0)
00349 dofname[var_dofid[i]] = namevart(i+1);
00350 }
00351 }
00352 }
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368 void transmat::give_dof_names(long ipp, namevart *dofname, long ntm)
00369 {
00370 long i = ip[ipp].idm;
00371
00372 switch (ip[ipp].tm)
00373 {
00374 case consolawf1:
00375 consol_awf1[i].give_dof_names(dofname, ntm);
00376 break;
00377
00378 case isotransmat:
00379 itrm[i].give_dof_names(dofname, ntm);
00380 break;
00381 case damisotransmat:
00382 damitrm[i].give_dof_names(dofname, ntm);
00383 break;
00384
00385
00386
00387
00388
00389 case homomat:{
00390 hommat[i].give_dof_names(dofname, ntm);
00391 break;
00392 }
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410 case kunzel:
00411 kun[i].give_dof_names(dofname, ntm);
00412 break;
00413 case moistheat:{
00414 moisth[i].give_dof_names(dofname, ntm);
00415 break;
00416 }
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467 case glasgow:
00468 tench[i].give_dof_names(dofname, ntm);
00469 break;
00470 case richardsmat:
00471 richar[i].give_dof_names(dofname, ntm);
00472 break;
00473 case salt1mat:
00474 salt1[i].give_dof_names(dofname, ntm);
00475 break;
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498 default:
00499 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
00500 abort();
00501 }
00502 }
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513 void transmat::read (XFILE *in)
00514 {
00515
00516 tnip = intpnum ();
00517 if (Mesprt==1){
00518 fprintf (stdout,"\n number of integration points %ld",tnip);
00519 }
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529 readmatchar (in);
00530 }
00531
00532
00533
00534
00535
00536
00537
00538
00539 void transmat::print (FILE *out)
00540 {
00541 long i, j;
00542
00543 fprintf(out,"\n## materials:\n");
00544 fprintf(out,"\n# number of material types\n");
00545 fprintf (out,"\n%ld\n",nmt);
00546 for (i=0;i<nmt;i++)
00547 {
00548 fprintf (out,"\n%d %ld", (int)mattype[i], numtype[i]);
00549 for (j=0;j<numtype[i];j++)
00550 {
00551 fprintf (out,"\n%ld ",j+1);
00552 printmatchar (out, mattype[i], j);
00553 fprintf(out, "\n");
00554 }
00555 }
00556 }
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568 void transmat::matcond (matrix &d,long ipp,long ri,long ci)
00569 {
00570 switch (Tp->tmatt){
00571 case onemedium:{
00572 med1 m1;
00573
00574 m1.matcond(d,ri,ci,ipp);
00575
00576 break;
00577 }
00578 case twomediacoup:{
00579 med2 m2;
00580
00581 m2.matcond(d,ri,ci,ipp);
00582
00583 break;
00584 }
00585 case threemediacoup:{
00586 med3 m3;
00587
00588 m3.matcond(d,ri,ci,ipp);
00589
00590 break;
00591 }
00592 case fourmediacoup:{
00593 med4 m4;
00594
00595 m4.matcond(d,ri,ci,ipp);
00596
00597 break;
00598 }
00599 default:{
00600 print_err("unknown number of transported media is required",__FILE__,__LINE__,__func__);
00601 }
00602 }
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652 }
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664 void transmat::matcond2 (matrix &d,long ipp,long ri,long ci)
00665 {
00666 switch (Tp->tmatt){
00667 case onemedium:{
00668 med1 m1;
00669
00670 m1.matcond2(d,ri,ci,ipp);
00671 break;
00672 }
00673 case twomediacoup:{
00674 med2 m2;
00675
00676 m2.matcond2(d,ri,ci,ipp);
00677
00678 break;
00679 }
00680 case threemediacoup:{
00681 med3 m3;
00682
00683 m3.matcond2(d,ri,ci,ipp);
00684
00685 break;
00686 }
00687 case fourmediacoup:{
00688 med4 m4;
00689
00690 m4.matcond(d,ri,ci,ipp);
00691
00692 break;
00693 }
00694 default:{
00695 print_err("unknown number of transported media is required",__FILE__,__LINE__,__func__);
00696 }
00697 }
00698 }
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711 double transmat::capcoeff (long ipp,long ri,long ci)
00712 {
00713 double c;
00714
00715 switch (Tp->tmatt){
00716 case onemedium:{
00717 med1 m1;
00718
00719 m1.matcap(c,ri,ci,ipp);
00720
00721 break;
00722 }
00723 case twomediacoup:{
00724 med2 m2;
00725
00726 m2.matcap(c,ri,ci,ipp);
00727
00728 break;
00729 }
00730 case threemediacoup:{
00731 med3 m3;
00732
00733 m3.matcap(c,ri,ci,ipp);
00734
00735 break;
00736 }
00737 case fourmediacoup:{
00738 med4 m4;
00739
00740 m4.matcap(c,ri,ci,ipp);
00741
00742 break;
00743 }
00744 default:{
00745 print_err("unknown number of transported media is required",__FILE__,__LINE__,__func__);
00746 }
00747 }
00748
00749 return c;
00750 }
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763 void transmat::computenlfluxes (long lcid,long ipp)
00764 {
00765 long i,j,k,ncomp;
00766 ncomp = Tt->give_ncomp (0);
00767 matrix d(ncomp,ncomp);
00768
00769 for (i=0;i<ncomp;i++)
00770 ip[ipp].fluxes[lcid][i] = 0.0;
00771
00772 for(i=0; i<Tp->ntm; i++)
00773 {
00774 matcond(d, ipp, lcid, i);
00775 for (j=0;j<ncomp;j++)
00776 {
00777 for (k=0;k<ncomp;k++)
00778 ip[ipp].fluxes[lcid][j] -= d[j][k]*ip[ipp].grad[i][k];
00779 }
00780 }
00781 }
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802 void transmat::flux_contributions (long ipp)
00803 {
00804 long i,j,ncomp;
00805 double n11,n12,n21,n22;
00806
00807 ncomp = Tt->give_ncomp (0);
00808
00809 vector v11(ncomp),v12(ncomp),v21(ncomp),v22(ncomp);
00810 vector gr(ncomp);
00811 matrix d(ncomp,ncomp);
00812
00813 switch (Tp->tmatt){
00814 case twomediacoup:{
00815 med2 m2;
00816
00817
00818 for (i=0;i<2;i++){
00819 for (j=0;j<2;j++){
00820
00821 m2.matcond(d,i,j,ipp);
00822
00823 givegrad (j,ipp,gr);
00824
00825 if (i==0 && j==0)
00826 mxv (d,gr,v11);
00827 if (i==0 && j==1)
00828 mxv (d,gr,v12);
00829 if (i==1 && j==0)
00830 mxv (d,gr,v21);
00831 if (i==1 && j==1)
00832 mxv (d,gr,v22);
00833 }
00834 }
00835
00836
00837 n11 = normv (v11);
00838 n12 = normv (v12);
00839 n21 = normv (v21);
00840 n22 = normv (v22);
00841
00842 break;
00843 }
00844 default:{
00845 print_err("unknown number of transported media is required",__FILE__,__LINE__,__func__);
00846 abort ();
00847 }
00848 }
00849
00850 destrm(d);
00851 destrv (gr);
00852 destrv (v11);
00853 destrv (v12);
00854 destrv (v21);
00855 destrv (v22);
00856 }
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871 void transmat::volume_rhs (matrix &d,long ipp,long ri,long ci,long ncomp)
00872 {
00873 switch (Tp->tmatt){
00874 case onemedium:{
00875 med1 m1;
00876
00877 m1.rhs_volume(d,ri,ci,ipp);
00878 break;
00879 }
00880 case twomediacoup:{
00881 switch (Tm->ip[ipp].tm){
00882 case consolawf2:{
00883 long i;
00884
00885
00886 i = Tm->ip[ipp].idm;
00887
00888 Tm->consol_awf2[i].rhs_volume (d,ri,ci,ipp);
00889 break;
00890 }
00891 case bazantpedersen:
00892 case pedersen:
00893 case homomat:
00894 case kunzel:
00895 case grunewald:
00896 case moistheat:
00897 case salt1mat:
00898 break;
00899 default:{
00900 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
00901 }
00902 }
00903 break;
00904 }
00905 case threemediacoup:{
00906 med3 m3;
00907
00908 m3.rhs_volume(d,ri,ci,ipp);
00909
00910 break;
00911 }
00912 case fourmediacoup:{
00913 med4 m4;
00914
00915
00916
00917 break;
00918 }
00919 default:{
00920 print_err("unknown number of transported media is required",__FILE__,__LINE__,__func__);
00921 }
00922 }
00923 }
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936 void transmat::storegrad (long lcid,long ipp,vector &gr)
00937 {
00938 long i,ncomp;
00939 ncomp=gr.n;
00940
00941 for (i=0;i<ncomp;i++){
00942 ip[ipp].grad[lcid][i]=gr[i];
00943 }
00944
00945 }
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956 void transmat::givegrad (long lcid,long ipp,vector &gr)
00957 {
00958 long i,ncomp;
00959 ncomp=gr.n;
00960
00961 for (i=0;i<ncomp;i++){
00962 gr[i] = ip[ipp].grad[lcid][i];
00963 }
00964 }
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975 void transmat::storeflux (long lcid,long ipp,vector &fl)
00976 {
00977 long i,ncomp;
00978 ncomp=fl.n;
00979
00980 for (i=0;i<ncomp;i++){
00981 ip[ipp].fluxes[lcid][i]=fl[i];
00982 }
00983
00984 }
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995 void transmat::givefluxes (long lcid,long ipp,vector &fl)
00996 {
00997 long i,ncomp;
00998 ncomp=fl.n;
00999
01000 for (i=0;i<ncomp;i++){
01001 fl[i] = ip[ipp].fluxes[lcid][i];
01002 }
01003 }
01004
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017 void transmat::readmatchar (XFILE *in)
01018 {
01019 long i;
01020
01021 xfscanf (in, "%k%ld", "num_mat_types", &nmt);
01022
01023 numtype = new long [nmt];
01024 mattype = new mattypet [nmt];
01025
01026 if (nmt<1)
01027 print_err("number of material types is less than 1",__FILE__,__LINE__,__func__);
01028
01029 if (Mesprt==1) fprintf (stdout,"\n number of different types of materials %ld",nmt);
01030
01031 for (i=0;i<nmt;i++)
01032 {
01033 xfscanf (in,"%k%m %k%ld", "mattype", &mattypet_kwdset, &mattype[i], "num_inst", &numtype[i]);
01034 if (numtype[i]<1)
01035 print_err("number of particular materials is less than 1",__FILE__,__LINE__,__func__);
01036
01037 readmattype(in, mattype[i], numtype[i]);
01038 }
01039 }
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054 void transmat::readmattype(XFILE *in, mattypet mtype, long numt)
01055 {
01056 long j,k;
01057
01058 switch (mtype)
01059 {
01060 case isotransmat:{
01061 if (Mesprt==1) fprintf (stdout,"\n number of isotropic material models %ld",numt);
01062 itrm = new isotrmat [numt];
01063 for (j=0;j<numt;j++){
01064 k=numt+1;
01065 xfscanf (in,"%ld",&k);
01066 if (k>numt || k<1){
01067 print_err("wrong number of isotropic material is required",__FILE__,__LINE__,__func__);
01068 }
01069 itrm[k-1].read (in);
01070 }
01071 break;
01072 }
01073 case nlisotransmat:{
01074 if (Mesprt==1) fprintf (stdout,"\n number of nonlinear isotropic material models %ld",numt);
01075 nlitrm = new nlisotrmat [numt];
01076 for (j=0;j<numt;j++){
01077 k=numt+1;
01078 xfscanf (in,"%ld",&k);
01079 if (k>numt || k<1){
01080 print_err("wrong number of nonlinear isotropic material is required",__FILE__,__LINE__,__func__);
01081 }
01082 nlitrm[k-1].read (in);
01083 }
01084 break;
01085 }
01086 case damisotransmat:{
01087 if (Mesprt==1) fprintf (stdout,"\n number of isotropic material models influenced by damage %ld",numt);
01088 damitrm = new damisotrmat [numt];
01089 for (j=0;j<numt;j++){
01090 k=numt+1;
01091 xfscanf (in,"%ld",&k);
01092 if (k>numt || k<1){
01093 print_err("wrong number of isotropic material influenced by damage is required",__FILE__,__LINE__,__func__);
01094 }
01095 damitrm[k-1].read (in);
01096 }
01097 break;
01098 }
01099 case homomat:{
01100 if (Mesprt==1) fprintf (stdout,"\n number of material models obtained from homogenization %ld",numt);
01101 hommat = new homogmat [numt];
01102 for (j=0;j<numt;j++){
01103 k=numt+1;
01104 xfscanf (in,"%ld",&k);
01105 if (k>numt || k<1){
01106 print_err("wrong number of material obtained from homogenization is required",__FILE__,__LINE__,__func__);
01107 }
01108
01109
01110 }
01111 break;
01112 }
01113
01114 case sejtkr:{
01115 if (Mesprt==1) fprintf (stdout,"\n number of material models for one-phase flow in deforming medium %ld",numt);
01116 sejtkrm = new sejtkrmat [numt];
01117 for (j=0;j<numt;j++){
01118 k=numt+1;
01119 xfscanf (in,"%ld",&k);
01120 if (k>numt || k<1){
01121 print_err("wrong number of material models for one-phase flow in deforming medium is required",__FILE__,__LINE__,__func__);
01122 }
01123 sejtkrm[k-1].read (in);
01124 }
01125 break;
01126 }
01127
01128 case consolawf1:{
01129 if (Mesprt==1) fprintf (stdout,"\n number of material models for one-phase flow in deforming medium %ld",numt);
01130 consol_awf1 = new con_awf1mat [numt];
01131 for (j=0;j<numt;j++){
01132 k=numt+1;
01133 xfscanf (in,"%ld",&k);
01134 if (k>numt || k<1){
01135 print_err("wrong number of material models for one-phase flow in deforming medium is required",__FILE__,__LINE__,__func__);
01136 }
01137 consol_awf1[k-1].read (in);
01138 }
01139 break;
01140 }
01141
01142 case consolawf2:{
01143 if (Mesprt==1) fprintf (stdout,"\n number of material models for two-phase flow in deforming medium %ld",numt);
01144 consol_awf2 = new con_awf2mat [numt];
01145 for (j=0;j<numt;j++){
01146 k=numt+1;
01147 xfscanf (in,"%ld",&k);
01148 if (k>numt || k<1){
01149 print_err("wrong number of material models for two-phase flow in deforming medium is required",__FILE__,__LINE__,__func__);
01150 }
01151 consol_awf2[k-1].read (in);
01152 }
01153 break;
01154 }
01155
01156 case discontisotrmat:{
01157 if (Mesprt==1) fprintf (stdout,"\n number of isotropic material models with discontinuities %ld",numt);
01158 ditrm = new discisotrmat [numt];
01159 for (j=0;j<numt;j++){
01160 k=numt+1;
01161 xfscanf (in,"%ld",&k);
01162 if (k>numt || k<1){
01163 print_err("wrong number of isotropic material with discontinuities is required",__FILE__,__LINE__,__func__);
01164 }
01165 ditrm[k-1].read (in);
01166 }
01167 break;
01168 }
01169
01170
01171 case cernyconcrete:{
01172 if (Mesprt==1) fprintf (stdout,"\n number of cerny-concrete material models %ld",numt);
01173 cernym = new cernymat [numt];
01174 for (j=0;j<numt;j++){
01175 k=numt+1;
01176 xfscanf (in,"%ld",&k);
01177 if (k>numt || k<1){
01178 print_err("wrong number of cerny-concrete material is required",__FILE__,__LINE__,__func__);
01179 }
01180 cernym[k-1].read (in);
01181 }
01182 break;
01183 }
01184
01185 case bazantpedersen:{
01186 if (Mesprt==1) fprintf (stdout,"\n number of bazant-pedersen material models %ld",numt);
01187 bazped = new bazpedmat [numt];
01188 for (j=0;j<numt;j++){
01189 k=numt+1;
01190 xfscanf (in,"%ld",&k);
01191 if (k>numt || k<1){
01192 print_err("wrong number of bazant-pedersen material model is required",__FILE__,__LINE__,__func__);
01193 }
01194 bazped[k-1].read (in);
01195 }
01196 break;
01197 }
01198
01199 case pedersen:{
01200 if (Mesprt==1) fprintf (stdout,"\n number of pedersen material models %ld",numt);
01201 ped = new pedmat [numt];
01202 for (j=0;j<numt;j++){
01203 k=numt+1;
01204 xfscanf (in,"%ld",&k);
01205 if (k>numt || k<1){
01206 print_err("wrong number of pedersen material model is required",__FILE__,__LINE__,__func__);
01207 }
01208 ped[k-1].read (in);
01209 }
01210 break;
01211 }
01212
01213 case kunzel:{
01214 if (Mesprt==1) fprintf (stdout,"\n number of kunzel material models %ld",numt);
01215 kun = new kunmat [numt];
01216 for (j=0;j<numt;j++){
01217 k=numt+1;
01218 xfscanf (in,"%ld",&k);
01219 if (k>numt || k<1){
01220 print_err("wrong number of kunzel material model is required",__FILE__,__LINE__,__func__);
01221 }
01222 kun[k-1].read (in);
01223 }
01224
01225
01226 Tp->nvs=1;
01227
01228 Tp->pnvs=1;
01229
01230
01231 break;
01232 }
01233
01234 case kunzel2:{
01235 if (Mesprt==1) fprintf (stdout,"\n number of kunzel2 material models %ld",numt);
01236 kun2 = new kunmat2 [numt];
01237 for (j=0;j<numt;j++){
01238 k=numt+1;
01239 xfscanf (in,"%ld",&k);
01240 if (k>numt || k<1){
01241 print_err("wrong number of kunzel2 material model is required",__FILE__,__LINE__,__func__);
01242 }
01243 kun2[k-1].read (in);
01244 }
01245
01246 Tp->nvs=1;
01247
01248 Tp->pnvs=1;
01249
01250
01251 break;
01252 }
01253
01254
01255 case grunewald:{
01256 if (Mesprt==1) fprintf (stdout,"\n number of grunewald material models %ld",numt);
01257 grunw = new grunewaldmat [numt];
01258 for (j=0;j<numt;j++){
01259 k=numt+1;
01260 xfscanf (in,"%ld",&k);
01261 if (k>numt || k<1){
01262 print_err("wrong number of grunewald material model is required",__FILE__,__LINE__,__func__);
01263 }
01264 grunw[k-1].read (in);
01265 }
01266
01267 Tp->nvs=1;
01268
01269 Tp->pnvs=1;
01270
01271 break;
01272 }
01273
01274 case simplediscmat:{
01275 if (Mesprt==1) fprintf (stdout,"\n number of simple discontinous material models for moisture %ld",numt);
01276 sdmat = new discmat [numt];
01277 for (j=0;j<numt;j++){
01278 k=numt+1;
01279 xfscanf (in,"%ld",&k);
01280 if (k>numt || k<1){
01281 print_err("wrong number of simple discontinuous material model for moisture is required",__FILE__,__LINE__,__func__);
01282 }
01283 sdmat[k-1].read (in);
01284 }
01285
01286 Tp->nvs=1;
01287
01288 Tp->pnvs=1;
01289
01290 break;
01291 }
01292
01293 case devries:{
01294 if (Mesprt==1) fprintf (stdout,"\n number of devries material models %ld",numt);
01295 dvries = new devriesmat [numt];
01296 for (j=0;j<numt;j++){
01297 k=numt+1;
01298 xfscanf (in,"%ld",&k);
01299 if (k>numt || k<1){
01300 print_err("wrong number of devries material model is required",__FILE__,__LINE__,__func__);
01301 }
01302 dvries[k-1].read (in);
01303 }
01304 break;
01305 }
01306
01307 case milly:{
01308 if (Mesprt==1) fprintf (stdout,"\n number of Milly material models %ld",numt);
01309 mill = new millymat [numt];
01310 for (j=0;j<numt;j++){
01311 k=numt+1;
01312 xfscanf (in,"%ld",&k);
01313 if (k>numt || k<1){
01314 print_err("wrong number of Milly material model is required",__FILE__,__LINE__,__func__);
01315 }
01316 mill[k-1].read (in);
01317 }
01318
01319 Tp->nvs=1;
01320
01321 Tp->pnvs=1;
01322 break;
01323 }
01324
01325
01326 case concreteB:{
01327 if (Mesprt==1) fprintf (stdout,"\n number of general material models for concrete at high temperature from Padova%ld",numt);
01328 concrete = new concreteBmat [numt];
01329 for (j=0;j<numt;j++){
01330 k=numt+1;
01331 xfscanf (in,"%ld",&k);
01332 if (k>numt || k<1){
01333 print_err("wrong number of general material model for concrete at high temperature from Padova is required",__FILE__,__LINE__,__func__);
01334 }
01335 concrete[k-1].read (in);
01336 }
01337 break;
01338 }
01339
01340 case baroghelB:{
01341 if (Mesprt==1) fprintf (stdout,"\n number of general baroghel material models for concrete from Padova%ld",numt);
01342 baroghel = new baroghelmat [numt];
01343 for (j=0;j<numt;j++){
01344 k=numt+1;
01345 xfscanf (in,"%ld",&k);
01346 if (k>numt || k<1){
01347 print_err("wrong number of general baroghel material model for concrete from Padova is required",__FILE__,__LINE__,__func__);
01348 }
01349 baroghel[k-1].read (in);
01350 }
01351 break;
01352 }
01353
01354
01355 case C60baroghelB:{
01356 if (Mesprt==1) fprintf (stdout,"\n number of baroghel material models for high performance C60 concrete from Padova%ld",numt);
01357 C60baroghel = new C60barmat [numt];
01358 for (j=0;j<numt;j++){
01359 k=numt+1;
01360 xfscanf (in,"%ld",&k);
01361 if (k>numt || k<1){
01362 print_err("wrong number of baroghel material model for high performance C60 concrete from Padova is required",__FILE__,__LINE__,__func__);
01363 }
01364 C60baroghel[k-1].read (in);
01365 }
01366 break;
01367 }
01368
01369 case C30baroghelB:{
01370 if (Mesprt==1) fprintf (stdout,"\n number of baroghel material models for ordinary performance C30 concrete from Padova%ld",numt);
01371 C30baroghel = new C30barmat [numt];
01372 for (j=0;j<numt;j++){
01373 k=numt+1;
01374 xfscanf (in,"%ld",&k);
01375 if (k>numt || k<1){
01376 print_err("wrong number of baroghel material model for ordinary performance C30 concrete from Padova is required",__FILE__,__LINE__,__func__);
01377 }
01378 C30baroghel[k-1].read (in);
01379 }
01380 break;
01381 }
01382
01383
01384 case o30bazantB:{
01385 if (Mesprt==1) fprintf (stdout,"\n number of bazant material models for ordinary-30 concrete from Padova%ld",numt);
01386 o30bazant = new o30bazmat [numt];
01387 for (j=0;j<numt;j++){
01388 k=numt+1;
01389 xfscanf (in,"%ld",&k);
01390 if (k>numt || k<1){
01391 print_err("wrong number of baroghel material model for ordinary-30 concrete from Padova is required",__FILE__,__LINE__,__func__);
01392 }
01393 o30bazant[k-1].read (in);
01394 }
01395 break;
01396 }
01397
01398
01399 case C60bazantB:{
01400 if (Mesprt==1) fprintf (stdout,"\n number of bazant material models for high performance C60 concrete from Padova%ld",numt);
01401 C60bazant = new C60bazmat [numt];
01402 for (j=0;j<numt;j++){
01403 k=numt+1;
01404 xfscanf (in,"%ld",&k);
01405 if (k>numt || k<1){
01406 print_err("wrong number of bazant material model for high performance C60 concrete from Padova is required",__FILE__,__LINE__,__func__);
01407 }
01408 C60bazant[k-1].read (in);
01409 }
01410 break;
01411 }
01412
01413
01414 case C30bazantB:{
01415 if (Mesprt==1) fprintf (stdout,"\n number of bazant material models for high performance C60 concrete from Padova %ld",numt);
01416 C30bazant = new C30bazmat [numt];
01417 for (j=0;j<numt;j++){
01418 k=numt+1;
01419 xfscanf (in,"%ld",&k);
01420 if (k>numt || k<1){
01421 print_err("wrong number of bazant material model for high performance C30 concrete from Padova is required",__FILE__,__LINE__,__func__);
01422 }
01423 C30bazant[k-1].read (in);
01424 }
01425 break;
01426 }
01427
01428
01429 case glasgow:{
01430 if (Mesprt==1) fprintf (stdout,"\n number of Glasgow material models for concrete %ld",numt);
01431 tench = new glasgowmat [numt];
01432 for (j=0;j<numt;j++){
01433 k=numt+1;
01434 xfscanf (in,"%ld",&k);
01435 if (k>numt || k<1){
01436 print_err("wrong number of Glasgow material model for concrete is required",__FILE__,__LINE__,__func__);
01437 }
01438 tench[k-1].read (in);
01439 }
01440 break;
01441 }
01442 case carb1mat:{
01443 if (Mesprt==1) fprintf (stdout,"\n number of material models for concrete carbonation %ld", numt);
01444 carb1 = new carbmat1 [numt];
01445 for (j=0;j<numt;j++){
01446 k=numt+1;
01447 xfscanf (in,"%ld",&k);
01448 if (k>numt || k<1){
01449 print_err("wrong number of material model for carbonation is required",__FILE__,__LINE__,__func__);
01450 }
01451 carb1[k-1].read (in);
01452 }
01453 break;
01454 }
01455 case moistheat:{
01456 if (Mesprt==1) fprintf (stdout,"\n number of moistheat material models %ld",numt);
01457 moisth = new moistheatmat [numt];
01458 for (j=0;j<numt;j++){
01459 k=numt+1;
01460 xfscanf (in,"%ld",&k);
01461 if (k>numt || k<1){
01462 print_err("wrong number of moistheat material model is required",__FILE__,__LINE__,__func__);
01463 }
01464 moisth[k-1].read (in);
01465 }
01466
01467
01468 Tp->nvs=1;
01469
01470 Tp->pnvs=1;
01471
01472
01473 break;
01474 }
01475
01476 case richardsmat:{
01477 if (Mesprt==1) fprintf (stdout,"\n number of Richards models %ld",numt);
01478 richar = new richards [numt];
01479 for (j=0;j<numt;j++){
01480 k=numt+1;
01481 xfscanf (in,"%ld",&k);
01482 if (k>numt || k<1){
01483 print_err("wrong number of Richards material model is required",__FILE__,__LINE__,__func__);
01484 }
01485 richar[k-1].read (in);
01486 }
01487 break;
01488 }
01489
01490 case salt1mat:{
01491 if (Mesprt==1) fprintf (stdout,"\n number of material models for salt transport %ld",numt);
01492 salt1 = new saltmat1 [numt];
01493 for (j=0;j<numt;j++){
01494 k=numt+1;
01495 xfscanf (in,"%ld",&k);
01496 if (k>numt || k<1){
01497 print_err("wrong number of material model for salt transport is required",__FILE__,__LINE__,__func__);
01498 }
01499 salt1[k-1].read (in);
01500 }
01501 break;
01502 }
01503
01504 case salt2mat:{
01505 if (Mesprt==1) fprintf (stdout,"\n number of material models for salt transport%ld",numt);
01506 salt2 = new saltmat2 [numt];
01507 for (j=0;j<numt;j++){
01508 k=numt+1;
01509 xfscanf (in,"%ld",&k);
01510 if (k>numt || k<1){
01511 print_err("wrong number of material model for salt transport is required",__FILE__,__LINE__,__func__);
01512 }
01513 salt2[k-1].read (in);
01514 }
01515 break;
01516 }
01517
01518 case salt3mat:{
01519 if (Mesprt==1) fprintf (stdout,"\n number of material models for salt transport%ld",numt);
01520 salt3 = new saltmat3 [numt];
01521 for (j=0;j<numt;j++){
01522 k=numt+1;
01523 xfscanf (in,"%ld",&k);
01524 if (k>numt || k<1){
01525 print_err("wrong number of material model for salt transport is required",__FILE__,__LINE__,__func__);
01526 }
01527 salt3[k-1].read (in);
01528 }
01529 break;
01530 }
01531
01532 case salt4mat:{
01533 if (Mesprt==1) fprintf (stdout,"\n number of material models for salt transport%ld",numt);
01534 salt4 = new saltmat4 [numt];
01535
01536
01537 Tp->nvs=1;
01538
01539 Tp->pnvs=1;
01540
01541 for (j=0;j<numt;j++){
01542 k=numt+1;
01543 xfscanf (in,"%ld",&k);
01544 if (k>numt || k<1){
01545 print_err("wrong number of material model for salt transport is required",__FILE__,__LINE__,__func__);
01546 }
01547 salt4[k-1].read (in);
01548 }
01549 break;
01550 }
01551
01552 case radiationmater:{
01553 if (Mesprt==1) fprintf (stdout,"\n number of material models for radiation %ld",numt);
01554 radmat = new radiationmat [numt];
01555 for (j=0;j<numt;j++){
01556 k=numt+1;
01557 xfscanf (in,"%ld",&k);
01558 if (k>numt || k<1){
01559 print_err("wrong number of material models for radiation is required",__FILE__,__LINE__,__func__);
01560 }
01561 radmat[k-1].read (in);
01562 }
01563 break;
01564 }
01565
01566 case soilmat1:{
01567 if (Mesprt==1) fprintf (stdout,"\n number of soil1mat material models for soils %ld",numt);
01568 soil1 = new soil1mat [numt];
01569 for (j=0;j<numt;j++){
01570 k=numt+1;
01571 xfscanf (in,"%ld",&k);
01572 if (k>numt || k<1){
01573 print_err("wrong number of soil1mat material model for soils is required",__FILE__,__LINE__,__func__);
01574 }
01575 soil1[k-1].read (in);
01576 }
01577 break;
01578 }
01579
01580 case cementhydrmat:{
01581 if (Mesprt==1) fprintf (stdout,"\n number of cemhydmat material models for cement hydration %ld",numt);
01582 cemhydr = new cemhydmat [numt];
01583 for (j=0;j<numt;j++){
01584 k=numt+1;
01585 xfscanf (in,"%ld",&k);
01586 if (k>numt || k<1){
01587 print_err("wrong number of cemhydmat material model for cement hydration is required",__FILE__,__LINE__,__func__);
01588 }
01589 cemhydr[k-1].read (in);
01590 }
01591 break;
01592 }
01593
01594 case lincoupledmat:{
01595 if (Mesprt==1) fprintf (stdout,"\n number of linear coupled material models %ld",numt);
01596 lcmat = new lincoupmat [numt];
01597 for (j=0;j<numt;j++){
01598 k=numt+1;
01599 xfscanf (in,"%ld",&k);
01600 if (k>numt || k<1){
01601 print_err("wrong number of linear coupled material model is required",__FILE__,__LINE__,__func__);
01602 }
01603 lcmat[k-1].read (in);
01604 }
01605 break;
01606 }
01607
01608 default:{
01609 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
01610 }
01611 }
01612 }
01613
01614
01615
01616
01617
01618
01619
01620
01621
01622
01623
01624
01625
01626 void transmat::printmatchar (FILE *out, mattypet mt, long numinst)
01627 {
01628 switch (mt)
01629 {
01630 case isotransmat:{
01631 itrm[numinst].print (out);
01632 break;
01633 }
01634 case nlisotransmat:{
01635 nlitrm[numinst].print (out);
01636 break;
01637 }
01638 case homomat:{
01639
01640 break;
01641 }
01642 case damisotransmat:{
01643 damitrm[numinst].print (out);
01644 break;
01645 }
01646 case discontisotrmat:{
01647 ditrm[numinst].print (out);
01648 break;
01649 }
01650
01651 case cernyconcrete:{
01652 cernym[numinst].print (out);
01653 break;
01654 }
01655
01656 case bazantpedersen:{
01657 bazped[numinst].print (out);
01658 break;
01659 }
01660
01661 case pedersen:{
01662 ped[numinst].print (out);
01663 break;
01664 }
01665
01666 case kunzel:{
01667 kun[numinst].print (out);
01668 break;
01669 }
01670
01671 case kunzel2:{
01672 print_err("the print method has not yet been implemented for material %s",
01673 __FILE__,__LINE__,__func__, mattypet_kwdset.get_str(int(mt)));
01674
01675 break;
01676 }
01677
01678 case grunewald:{
01679 grunw[numinst].print (out);
01680 break;
01681 }
01682
01683 case simplediscmat:{
01684 sdmat[numinst].print (out);
01685 break;
01686 }
01687
01688 case devries:{
01689 dvries[numinst].print (out);
01690 break;
01691 }
01692
01693 case milly:{
01694 print_err("the print method has not yet been implemented for material %s",
01695 __FILE__,__LINE__,__func__, mattypet_kwdset.get_str(int(mt)));
01696
01697 break;
01698 }
01699
01700 case concreteB:{
01701 concrete[numinst].print (out);
01702 break;
01703 }
01704
01705 case baroghelB:{
01706 baroghel[numinst].print (out);
01707 break;
01708 }
01709
01710
01711 case C60baroghelB:{
01712 C60baroghel[numinst].print (out);
01713 break;
01714 }
01715
01716 case C30baroghelB:{
01717 C30baroghel[numinst].print (out);
01718 break;
01719 }
01720
01721
01722 case o30bazantB:{
01723 o30bazant[numinst].print (out);
01724 break;
01725 }
01726
01727
01728 case C60bazantB:{
01729 C60bazant[numinst].print (out);
01730 break;
01731 }
01732
01733
01734 case C30bazantB:{
01735 C30bazant[numinst].print (out);
01736 break;
01737 }
01738
01739
01740 case glasgow:{
01741 tench[numinst].print (out);
01742 break;
01743 }
01744
01745 case moistheat:{
01746 moisth[numinst].print (out);
01747 break;
01748 }
01749
01750 case richardsmat:{
01751 richar[numinst].print (out);
01752 break;
01753 }
01754
01755 case salt1mat:{
01756 print_err("the print method has not yet been implemented for material %s",
01757 __FILE__,__LINE__,__func__, mattypet_kwdset.get_str(int(mt)));
01758
01759 break;
01760 }
01761
01762 case salt2mat:{
01763 print_err("the print method has not yet been implemented for material %s",
01764 __FILE__,__LINE__,__func__, mattypet_kwdset.get_str(int(mt)));
01765
01766 break;
01767 }
01768
01769 case salt3mat:{
01770 print_err("the print method has not yet been implemented for material %s",
01771 __FILE__,__LINE__,__func__, mattypet_kwdset.get_str(int(mt)));
01772
01773 break;
01774 }
01775
01776 case salt4mat:{
01777 print_err("the print method has not yet been implemented for material %s",
01778 __FILE__,__LINE__,__func__, mattypet_kwdset.get_str(int(mt)));
01779
01780 break;
01781 }
01782
01783 case soilmat1:{
01784 print_err("the print method has not yet been implemented for material %s",
01785 __FILE__,__LINE__,__func__, mattypet_kwdset.get_str(int(mt)));
01786
01787 break;
01788 }
01789
01790 case lincoupledmat:{
01791 lcmat[numinst].print (out);
01792 break;
01793 }
01794
01795 default:{
01796 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
01797 }
01798 }
01799 }
01800
01801
01802
01803
01804
01805
01806
01807
01808
01809
01810
01811
01812
01813 void transmat::storeother (long ipp,long ncomp,double *comp)
01814 {
01815 long i;
01816
01817 for (i=0;i<ncomp;i++){
01818 ip[ipp].other[i]=comp[i];
01819 }
01820 }
01821
01822
01823
01824
01825
01826
01827
01828
01829
01830
01831
01832
01833
01834 void transmat::storeeqother (long ipp,long ncompeq,double *compeq)
01835 {
01836 long i;
01837
01838 for (i=0;i<ncompeq;i++){
01839 ip[ipp].eqother[i]=compeq[i];
01840 }
01841 }
01842
01843
01844
01845
01846
01847
01848
01849
01850
01851
01852
01853
01854
01855 void transmat::giveother (long ipp,long ncomp,double *comp)
01856 {
01857 long i;
01858
01859 for (i=0;i<ncomp;i++){
01860 comp[i]=ip[ipp].other[i];
01861 }
01862 }
01863
01864
01865
01866
01867
01868
01869
01870
01871
01872
01873
01874
01875
01876 void transmat::giveeqother (long ipp,long ncompeq,double *compeq)
01877 {
01878 long i;
01879
01880 for (i=0;i<ncompeq;i++){
01881 compeq[i]=ip[ipp].eqother[i];
01882 }
01883 }
01884
01885
01886
01887
01888
01889
01890
01891
01892
01893 long transmat::givencompother ()
01894 {
01895 long ncompo = 0;
01896
01897 switch (Tp->mednam)
01898 {
01899 case moisture:{
01900 ncompo=3;
01901 if(Tp->ntm==2)
01902 ncompo=4;
01903 break;
01904 }
01905 case heat:
01906 ncompo=1;
01907 break;
01908 case heat_moisture:
01909 if (Tp->tmatt == twomediacoup)
01910 ncompo=8;
01911 else
01912 ncompo=9;
01913 break;
01914 case moisture_salt:
01915 if (Tp->tmatt == twomediacoup)
01916 ncompo=3;
01917 else
01918 ncompo=8;
01919 break;
01920 case moisture_salt_crystal:
01921 ncompo=8;
01922 break;
01923 case moisture_salt_crystal_heat:
01924 ncompo=8;
01925 break;
01926 default:
01927 print_err("unknown problem name is required",__FILE__,__LINE__,__func__);
01928 }
01929 return ncompo;
01930 }
01931
01932
01933
01934
01935
01936
01937
01938
01939
01940
01941
01942
01943 long transmat::givencompeqother (long ipp,long im)
01944 {
01945 long i,ncompeqo=0;
01946
01947 i = ip[ipp].idm;
01948
01949 switch (ip[ipp].tm){
01950 case isotransmat:
01951 case nlisotransmat:
01952 case homomat:
01953 case discontisotrmat:
01954 case cernyconcrete:
01955 case bazantpedersen:
01956 case pedersen:
01957 case carb1mat:
01958 case sejtkr:
01959 case consolawf1:
01960 case lincoupledmat:
01961 case radiationmater:
01962 case richardsmat:
01963 break;
01964 case damisotransmat:
01965 ncompeqo=1;
01966 break;
01967 case cementhydrmat:
01968 ncompeqo=6;
01969 break;
01970 case kunzel:{
01971 ncompeqo = 5;
01972 break;
01973 }
01974 case kunzel2:{
01975 ncompeqo = 15;
01976 break;
01977 }
01978 case grunewald:{
01979 ncompeqo = 15;
01980 break;
01981 }
01982 case simplediscmat:{
01983 ncompeqo = 15;
01984 break;
01985 }
01986 case devries:{
01987 break;
01988 }
01989 case milly:{
01990 ncompeqo = 10;
01991 break;
01992 }
01993 case moistheat:{
01994 ncompeqo = 5;
01995 break;
01996 }
01997 case salt1mat:{
01998 ncompeqo = 1;
01999 break;
02000 }
02001 case salt3mat:{
02002 ncompeqo = 4;
02003 break;
02004 }
02005 case salt4mat:{
02006 ncompeqo = 9;
02007 break;
02008 }
02009 case glasgow:
02010 case salt2mat:
02011 case concreteB:
02012 case baroghelB:
02013 case C60baroghelB:
02014 case C30baroghelB:
02015 case o30bazantB:
02016 case C60bazantB:
02017 case soilmat1:
02018 break;
02019 case consolawf2:
02020 ncompeqo = 1;
02021 break;
02022 default:{
02023 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
02024 }
02025 }
02026
02027 return ncompeqo;
02028 }
02029
02030
02031
02032
02033
02034
02035
02036
02037
02038
02039
02040 double transmat::givecompother(long compother,long ipp,double *r)
02041 {
02042 double compo;
02043
02044 switch (Tp->tmatt){
02045 case onemedium:{
02046 med1 m1;
02047
02048 compo = m1.compute_othervalues(compother,ipp,r);
02049 break;
02050 }
02051 case twomediacoup:{
02052 med2 m2;
02053
02054 compo = m2.compute_othervalues(compother,ipp,r);
02055 break;
02056 }
02057 case threemediacoup:{
02058 med3 m3;
02059
02060 compo = m3.compute_othervalues(compother,ipp,r);
02061 break;
02062 }
02063 case fourmediacoup:{
02064 med4 m4;
02065
02066 compo = m4.compute_othervalues(compother,ipp,r);
02067 break;
02068 }
02069 default:
02070 print_err("unknown number of transported media is required",__FILE__,__LINE__,__func__);
02071 }
02072 return (compo);
02073 }
02074
02075
02076
02077
02078
02079
02080
02081
02082
02083
02084
02085
02086 void transmat::give_othervalue_name(FILE *out,long ipp,long compother)
02087 {
02088 switch (Tp->tmatt){
02089 case onemedium:{
02090 med1 m1;
02091
02092 m1.print_othervaluesnames (out,ipp,compother);
02093 break;
02094 }
02095 case twomediacoup:{
02096 med2 m2;
02097
02098 m2.print_othervaluesnames (out,ipp,compother);
02099 break;
02100 }
02101 case threemediacoup:{
02102 med3 m3;
02103
02104 m3.print_othervaluesnames (out,ipp,compother);
02105 break;
02106 }
02107 case fourmediacoup:{
02108 med4 m4;
02109
02110 m4.print_othervaluesnames (out,ipp,compother);
02111 break;
02112 }
02113 default:
02114 print_err("unknown number of transported media is required",__FILE__,__LINE__,__func__);
02115 }
02116 }
02117
02118
02119
02120
02121
02122
02123
02124
02125
02126
02127
02128 void transmat::give_eqothervalue_name(FILE *out,long ipp,long compeqother)
02129 {
02130 give_othervalue_name(out, ipp, compeqother);
02131 }
02132
02133
02134
02135
02136
02137
02138
02139
02140
02141
02142 double transmat::give_temperature (long ipp)
02143 {
02144 long idm;
02145 double t;
02146
02147 idm = ip[ipp].idm;
02148
02149 switch (ip[ipp].tm){
02150 case kunzel:{
02151 t = kun[idm].give_temperature (ipp);
02152 break;
02153 }
02154 case salt4mat:{
02155 t = salt4[idm].give_temperature (ipp);
02156 break;
02157 }
02158 default:{
02159 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
02160 }
02161 }
02162
02163 return t;
02164 }
02165
02166
02167
02168
02169
02170
02171
02172
02173
02174
02175
02176
02177
02178 double transmat::givetransq(nonmechquant qt, long ipp)
02179 {
02180 double ret=0.0;
02181
02182 switch (qt){
02183 case temperature:{
02184
02185
02186 break;
02187 }
02188 case rel_hum:{
02189
02190
02191 break;
02192 }
02193 case initial_temperature:{
02194
02195
02196 break;
02197 }
02198 case water_pressure:{
02199
02200 ret = give_water_pressure(ipp);
02201 break;
02202 }
02203 case cap_pressure:{
02204
02205
02206 break;
02207 }
02208 case saturation_degree:{
02209
02210 ret = give_saturation_degree(ipp);
02211 break;
02212 }
02213 case suction:{
02214
02215 ret = give_suction(ipp);
02216 break;
02217 }
02218 case pore_pressure:{
02219
02220 ret = give_pore_pressure(ipp);
02221 break;
02222 }
02223 case vol_moist_cont:{
02224
02225 ret = give_vol_moist_cont(ipp);
02226 break;
02227 }
02228 default:{
02229 print_err("unknown type of quantity is required",__FILE__,__LINE__,__func__);
02230 }
02231 }
02232
02233 return ret;
02234 }
02235
02236
02237
02238
02239
02240
02241
02242
02243
02244
02245
02246
02247 double transmat::give_water_pressure(long ipp)
02248 {
02249 long i;
02250 double pw;
02251
02252 i = ip[ipp].idm;
02253
02254 switch (Tm->ip[ipp].tm){
02255 case consolawf1:{
02256 pw = consol_awf1[i].give_water_pressure (ipp);
02257 break;
02258 }
02259 case consolawf2:{
02260
02261 break;
02262 }
02263 default:{
02264 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
02265 }
02266 }
02267
02268 return pw;
02269 }
02270
02271
02272
02273
02274
02275
02276
02277
02278
02279
02280
02281 double transmat::give_pore_pressure(long ipp)
02282 {
02283 long i;
02284 double pp;
02285
02286 i = ip[ipp].idm;
02287
02288 switch (Tm->ip[ipp].tm){
02289 case consolawf1:{
02290 pp = consol_awf1[i].give_water_pressure (ipp);
02291 break;
02292 }
02293 case consolawf2:{
02294
02295 break;
02296 }
02297 case salt4mat:{
02298 pp = salt4[i].give_pore_pressure (ipp);
02299 break;
02300 }
02301 default:{
02302 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
02303 }
02304 }
02305
02306 return pp;
02307 }
02308
02309
02310
02311
02312
02313
02314
02315
02316
02317
02318
02319
02320 double transmat::give_suction(long ipp)
02321 {
02322 long i;
02323 double s;
02324
02325 i = ip[ipp].idm;
02326
02327 switch (Tm->ip[ipp].tm){
02328 case consolawf1:{
02329 s = consol_awf1[i].give_suction (ipp);
02330 break;
02331 }
02332 case consolawf2:{
02333
02334 break;
02335 }
02336 default:{
02337 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
02338 }
02339 }
02340
02341 return s;
02342 }
02343
02344
02345
02346
02347
02348
02349
02350
02351
02352
02353
02354 double transmat::give_saturation_degree(long ipp)
02355 {
02356 long i;
02357 double s;
02358
02359 i = ip[ipp].idm;
02360
02361 switch (Tm->ip[ipp].tm){
02362 case consolawf1:{
02363 s = consol_awf1[i].give_saturation_degree(ipp);
02364 break;
02365 }
02366 case consolawf2:{
02367
02368 break;
02369 }
02370 default:{
02371 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
02372 }
02373 }
02374
02375 return s;
02376 }
02377
02378
02379
02380
02381
02382
02383
02384
02385
02386
02387
02388 double transmat::give_vol_moist_cont(long ipp)
02389 {
02390 long i;
02391 double h;
02392
02393 i = ip[ipp].idm;
02394
02395 switch (Tm->ip[ipp].tm){
02396 case kunzel:{
02397 h = kun[i].give_vol_moist(ipp);
02398 break;
02399 }
02400 case moistheat:{
02401 h = moisth[i].give_vol_moist(ipp);
02402 break;
02403 }
02404 default:{
02405 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
02406 }
02407 }
02408
02409 return h;
02410 }
02411
02412
02413
02414
02415
02416
02417
02418
02419
02420
02421
02422
02423 double transmat::give_nodal_vol_moist_cont (long nid,long mattype)
02424 {
02425 double w;
02426
02427 switch (mattype){
02428 case 154:{
02429 w = Tt->nodes[nid].eqother[1];
02430 break;
02431 }
02432 case 155:{
02433 w = Tt->nodes[nid].eqother[0];
02434 break;
02435 }
02436 case 158:{
02437 w = Tt->nodes[nid].eqother[0];
02438 break;
02439 }
02440 case 180:{
02441 w = Tt->nodes[nid].eqother[0];
02442 break;
02443 }
02444 default:{
02445 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
02446 }
02447 }
02448
02449 return w;
02450 }
02451
02452
02453
02454
02455
02456
02457
02458
02459
02460
02461
02462 double transmat::give_nodal_sat_vol_moist_cont (long nid,long mattype)
02463 {
02464 double w;
02465
02466 switch (mattype){
02467 case 150:{
02468 w = 10000;
02469 break;
02470 }
02471 case 154:{
02472 w = Tt->nodes[nid].eqother[3];
02473 break;
02474 }
02475 case 155:{
02476 w = Tt->nodes[nid].eqother[2];
02477 break;
02478 }
02479 case 156:{
02480 w = Tt->nodes[nid].eqother[2];
02481 break;
02482 }
02483 case 158:{
02484 w = Tt->nodes[nid].eqother[3];
02485 break;
02486 }
02487 case 159:{
02488 w = Tt->nodes[nid].eqother[3];
02489 break;
02490 }
02491 case 180:{
02492 w = Tt->nodes[nid].eqother[2];
02493 break;
02494 }
02495 case 203:{
02496 w = Tt->nodes[nid].eqother[3];
02497 break;
02498 }
02499 default:{
02500 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
02501 }
02502 }
02503
02504 return w;
02505 }
02506
02507
02508
02509
02510
02511
02512
02513
02514
02515
02516
02517 double transmat::give_nodal_rel_hum (long nid,long mattype)
02518 {
02519 double rh;
02520
02521
02522 switch (mattype){
02523 case 154:{
02524
02525 rh = Tt->nodes[nid].eqother[2];
02526 break;
02527 }
02528 case 155:{
02529
02530 switch (int(Tt->nodes[nid].eqother[4])){
02531 case 8:{
02532 break;
02533 }
02534 default:{
02535 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
02536 }
02537 }
02538 break;
02539 }
02540 case 156:
02541 case 157:{
02542
02543 rh = Tt->nodes[nid].eqother[0];
02544 break;
02545 }
02546 case 159:{
02547
02548 rh = Tt->nodes[nid].eqother[1];
02549 break;
02550 }
02551 case 180:{
02552
02553
02554 break;
02555 }
02556
02557 default:{
02558 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
02559 }
02560 }
02561
02562 return rh;
02563 }
02564
02565
02566
02567
02568
02569
02570
02571
02572
02573
02574
02575
02576
02577
02578
02579
02580
02581
02582
02583
02584
02585
02586
02587
02588
02589
02590 long transmat::search_reqntq(nontransquant* &rntq)
02591 {
02592 long i, j;
02593 long antq[tnkntq];
02594 memset(antq, 0, sizeof(*antq)*tnkntq);
02595
02596
02597 for (i=0; i<tnip; i++)
02598 {
02599 give_reqntq(i, antq);
02600 }
02601
02602
02603 nntq = 0;
02604 for (i=0; i<tnkntq; i++)
02605 {
02606 if (antq[i] == 1)
02607 nntq++;
02608 }
02609
02610
02611 if (nntq == 0)
02612 {
02613 rntq = NULL;
02614 return nntq;
02615 }
02616 else
02617 {
02618
02619 rntq = new nontransquant[nntq];
02620 j = 0;
02621 for (i=0; i<tnkntq; i++)
02622 {
02623 if (antq[i] == 1){
02624 rntq[j] = nontransquant(i+1);
02625 j++;
02626 }
02627 }
02628 }
02629
02630 return nntq;
02631 }
02632
02633
02634
02635
02636
02637
02638
02639
02640
02641
02642
02643
02644
02645
02646
02647
02648
02649
02650 void transmat::give_reqntq(long ipp, long *antq)
02651 {
02652 long i;
02653
02654 i = ip[ipp].idm;
02655
02656 switch(ip[ipp].tm)
02657 {
02658 case isotransmat:{
02659 itrm[i].give_reqntq(antq);
02660 break;
02661 }
02662 case damisotransmat:{
02663 damitrm[i].give_reqntq(antq);
02664 break;
02665 }
02666 case kunzel:{
02667 kun[i].give_reqntq(antq);
02668 break;
02669 }
02670 case moistheat:{
02671 moisth[i].give_reqntq(antq);
02672 break;
02673 }
02674
02675 case nlisotransmat:
02676 case homomat:
02677 case discontisotrmat:
02678 case cernyconcrete:
02679 case bazantpedersen:
02680 case pedersen:
02681 case carb1mat:
02682 case sejtkr:
02683 case consolawf2:
02684 case lincoupledmat:
02685 case radiationmater:
02686 case richardsmat:
02687 case cementhydrmat:
02688 case kunzel2:
02689 case grunewald:
02690 case simplediscmat:
02691 case devries:
02692 case milly:
02693 case salt3mat:
02694 case glasgow:
02695 case salt1mat:
02696 case salt2mat:
02697 case C60bazantB:
02698 case soilmat1:
02699 break;
02700 case concreteB:
02701 concrete[i].give_reqntq(antq);
02702 break;
02703 case baroghelB:
02704 break;
02705 case C60baroghelB:
02706 C60baroghel[i].give_reqntq(antq);
02707 break;
02708 case C30baroghelB:
02709 C30baroghel[i].give_reqntq(antq);
02710 break;
02711 case o30bazantB:
02712 o30bazant[i].give_reqntq(antq);
02713 break;
02714 case salt4mat:
02715 salt4[i].give_reqntq(antq);
02716 break;
02717 case consolawf1:
02718 consol_awf1[i].give_reqntq(antq);
02719 break;
02720
02721 default:
02722 print_err("unknown material type is required", __FILE__, __LINE__, __func__);
02723 }
02724
02725 return;
02726 }
02727
02728
02729
02730
02731
02732
02733
02734
02735
02736
02737
02738
02739
02740
02741 double transmat::givenontransq(nontransquant qt, long ipp)
02742 {
02743 long id = ntqid[qt-1];
02744 if (id < 0)
02745 {
02746 print_err("Required quantity %s is not used in the problem solved",
02747 __FILE__, __LINE__, __func__, nontransquantstr[qt-1].alias);
02748 abort();
02749 }
02750 return nontransq[id][ipp];
02751 }
02752
02753
02754
02755
02756
02757
02758
02759
02760
02761
02762
02763
02764
02765
02766
02767
02768 void transmat::storenontransq(nontransquant qt, long ipp, double val)
02769 {
02770 long id = ntqid[qt-1];
02771 if (id < 0)
02772 {
02773 print_err("Required quantity %s is not used in the problem solved",
02774 __FILE__, __LINE__, __func__, nontransquantstr[qt-1].alias);
02775 abort();
02776 }
02777 nontransq[id][ipp] = val;
02778 }
02779
02780
02781
02782
02783
02784
02785
02786
02787
02788
02789
02790
02791
02792
02793 long transmat::givestatusntq (nontransquant qt)
02794 {
02795 if (ntqid[qt-1] < 0)
02796 return 0;
02797
02798 return 1;
02799 }
02800
02801
02802
02803
02804
02805
02806
02807
02808
02809
02810
02811
02812
02813
02814 long transmat::givenontransqid (nontransquant qt)
02815 {
02816 return ntqid[qt-1];
02817 }
02818
02819
02820
02821
02822
02823
02824
02825
02826
02827
02828
02829
02830
02831
02832
02833 void transmat::transmission_transcoeff(double &new_trc,double trc,long ri,long ci,long nid,long bc,long ipp)
02834 {
02835 new_trc = 0.0;
02836
02837 switch (Tp->tmatt){
02838 case onemedium:{
02839 med1 m1;
02840
02841 new_trc = m1.transmission_transcoeff(trc,ri,ci,nid,bc,ipp);
02842 break;
02843 }
02844 case twomediacoup:{
02845 med2 m2;
02846
02847 new_trc = m2.transmission_transcoeff(trc,ri,ci,nid,bc,ipp);
02848 break;
02849 }
02850 case threemediacoup:{
02851 med3 m3;
02852
02853 new_trc = m3.transmission_transcoeff(trc,ri,ci,nid,bc,ipp);
02854 break;
02855 }
02856 case fourmediacoup:{
02857 med4 m4;
02858
02859 new_trc = m4.transmission_transcoeff(trc,ri,ci,nid,bc,ipp);
02860 break;
02861 }
02862 default:{
02863 print_err("unknown number of transported media is required",__FILE__,__LINE__,__func__);
02864 }
02865 }
02866 }
02867
02868
02869
02870
02871
02872
02873
02874
02875
02876
02877
02878
02879
02880
02881
02882 void transmat::transmission_transcoeff (double &new_trc,double trc,long ri,long ci,long nid,long bc,long ipp,int flag)
02883 {
02884 new_trc = 0.0;
02885
02886 switch (Tp->tmatt){
02887 case onemedium:{
02888 med1 m1;
02889
02890 new_trc = m1.transmission_transcoeff(trc,ri,ci,nid,bc,ipp);
02891 break;
02892 }
02893 case twomediacoup:{
02894 med2 m2;
02895
02896 new_trc = m2.transmission_transcoeff(trc,ri,ci,nid,bc,ipp);
02897 break;
02898 }
02899 case threemediacoup:{
02900 med3 m3;
02901
02902 new_trc = m3.transmission_transcoeff(trc,ri,ci,nid,bc,ipp,flag);
02903 break;
02904 }
02905 case fourmediacoup:{
02906 med4 m4;
02907
02908 new_trc = m4.transmission_transcoeff(trc,ri,ci,nid,bc,ipp);
02909 break;
02910 }
02911 default:{
02912 print_err("unknown number of transported media is required",__FILE__,__LINE__,__func__);
02913 }
02914 }
02915 }
02916
02917
02918
02919
02920
02921
02922
02923
02924
02925
02926
02927
02928
02929
02930
02931
02932
02933 void transmat::transmission_nodval (double &new_nodval,double nodval,double trc2,long ri,long ci,long nid,long bc,long ipp)
02934 {
02935 new_nodval = 0.0;
02936
02937 switch (Tp->tmatt){
02938 case onemedium:{
02939 med1 m1;
02940
02941 new_nodval = m1.transmission_nodval(nodval,trc2,ri,ci,nid,bc,ipp);
02942 break;
02943 }
02944 case twomediacoup:{
02945 med2 m2;
02946
02947 new_nodval = m2.transmission_nodval(nodval,trc2,ri,ci,nid,bc,ipp);
02948 break;
02949 }
02950 case threemediacoup:{
02951 med3 m3;
02952
02953 new_nodval = m3.transmission_nodval(nodval,trc2,ri,ci,nid,bc,ipp);
02954 break;
02955 }
02956 case fourmediacoup:{
02957 med4 m4;
02958
02959 new_nodval = m4.transmission_nodval(nodval,trc2,ri,ci,nid,bc,ipp);
02960 break;
02961 }
02962 default:{
02963 print_err("unknown number of transported media is required",__FILE__,__LINE__,__func__);
02964 }
02965 }
02966 }
02967
02968
02969
02970
02971
02972
02973
02974
02975
02976
02977
02978
02979
02980
02981
02982
02983
02984 void transmat::transmission_flux(double &flux,double nodval,double trc2,long ri,long ci,long nn,long bc,long ipp)
02985 {
02986 flux = 0.0;
02987
02988 switch (Tp->tmatt){
02989 case onemedium:{
02990 med1 m1;
02991
02992 flux = m1.transmission_flux(nodval,trc2,ri,ci,nn,bc,ipp);
02993 break;
02994 }
02995 case twomediacoup:{
02996 med2 m2;
02997
02998 flux = m2.transmission_flux(nodval,trc2,ri,ci,nn,bc,ipp);
02999 break;
03000 }
03001 case threemediacoup:{
03002 med3 m3;
03003
03004 flux = m3.transmission_flux(nodval,trc2,ri,ci,nn,bc,ipp);
03005 break;
03006 }
03007 case fourmediacoup:{
03008 med4 m4;
03009
03010 flux = m4.transmission_flux(nodval,trc2,ri,ci,nn,bc,ipp);
03011 break;
03012 }
03013 default:{
03014 print_err("unknown number of transported media is required",__FILE__,__LINE__,__func__);
03015 }
03016 }
03017 }
03018
03019
03020
03021
03022
03023
03024
03025
03026
03027 void transmat::values_correction (vector &nv,long ipp)
03028 {
03029 long i;
03030
03031 i = ip[ipp].idm;
03032
03033 switch (ip[ipp].tm){
03034 case isotransmat:
03035 case nlisotransmat:
03036 case homomat:
03037 case damisotransmat:
03038 case discontisotrmat:
03039 case cernyconcrete:
03040 case pedersen:
03041 case carb1mat:
03042 case cementhydrmat:
03043 case lincoupledmat:
03044 case richardsmat:
03045 case radiationmater:{
03046 break;
03047 }
03048 case sejtkr:{
03049 sejtkrm[i].values_correction (nv, ipp);
03050 break;
03051 }
03052 case consolawf1:{
03053 consol_awf1[i].values_correction (nv, ipp);
03054 break;
03055 }
03056 case bazantpedersen:{
03057 bazped[i].values_correction (nv);
03058 break;
03059 }
03060 case kunzel:{
03061 kun[i].values_correction (nv);
03062 break;
03063 }
03064 case kunzel2:{
03065 kun2[i].values_correction (nv, ipp);
03066 break;
03067 }
03068 case grunewald:{
03069
03070 break;
03071 }
03072 case simplediscmat:{
03073
03074 break;
03075 }
03076 case devries:{
03077
03078 break;
03079 }
03080 case milly:{
03081
03082 break;
03083 }
03084 case moistheat:{
03085 moisth[i].values_correction (nv);
03086 break;
03087 }
03088 case glasgow:{
03089 break;
03090 }
03091 case salt1mat:{
03092 break;
03093 }
03094 case salt2mat:{
03095 salt2[i].values_correction (nv);
03096 break;
03097 }
03098 case salt3mat:{
03099 salt3[i].values_correction (nv,ipp);
03100 break;
03101 }
03102 case salt4mat:{
03103 salt4[i].values_correction (nv,ipp);
03104 break;
03105 }
03106 case concreteB:
03107 case baroghelB:
03108 case C60baroghelB:
03109 case C30baroghelB:
03110 case o30bazantB:
03111 case C60bazantB:{
03112 multiph mtph;
03113 mtph.values_correction (nv);
03114 break;
03115 }
03116
03117 case soilmat1:{
03118 gmultiph gmtph;
03119 gmtph.values_correction (nv);
03120 break;
03121 }
03122 case consolawf2:{
03123 consol_awf2[i].values_correction (nv, ipp);
03124 break;
03125 }
03126 default:{
03127 print_err("unknown matrial type is required",__FILE__,__LINE__,__func__);
03128 }
03129 }
03130
03131 }
03132
03133
03134
03135
03136
03137
03138
03139
03140
03141
03142
03143
03144
03145
03146
03147
03148
03149
03150
03151
03152
03153
03154
03155
03156
03157
03158
03159
03160
03161
03162
03163
03164
03165
03166
03167
03168
03169
03170
03171
03172
03173
03174
03175
03176
03177
03178
03179
03180
03181
03182
03183
03184
03185
03186
03187
03188
03189
03190
03191
03192
03193
03194
03195
03196
03197
03198
03199
03200
03201
03202
03203
03204
03205
03206
03207
03208
03209
03210
03211
03212
03213
03214
03215
03216
03217
03218
03219
03220
03221
03222
03223
03224
03225
03226
03227
03228
03229
03230
03231
03232
03233
03234
03235
03236
03237
03238
03239
03240
03241
03242
03243
03244
03245
03246
03247
03248
03249
03250
03251
03252
03253
03254
03255
03256
03257
03258
03259
03260
03261
03262
03263
03264
03265
03266
03267
03268
03269 void transmat::values_transformation (mattypet mti,long idmi,double *inv,double *iinv,
03270 mattypet mto,long idmo,double *outv,double *ioutv,double *jum)
03271 {
03272 double av,avi, fii, fio, dfdwi, dfdwo;
03273
03274 switch (mti){
03275 case milly:
03276 case moistheat:
03277 case kunzel:{
03278
03279
03280 break;
03281 }
03282 case grunewald:{
03283 grunw[idmi].get_rel_hum (inv[0], fii, dfdwi);
03284 grunw[idmo].get_rel_hum (outv[0], fio, dfdwo);
03285 if (dfdwi > dfdwo)
03286 {
03287 av = fio;
03288 }
03289 else
03290 {
03291 av = fii;
03292 }
03293
03294 break;
03295 }
03296 case simplediscmat:{
03297
03298 sdmat[idmi].get_rel_hum2 (inv[0], fii, dfdwi);
03299 sdmat[idmo].get_rel_hum2 (outv[0], fio, dfdwo);
03300 if (dfdwi > dfdwo)
03301 {
03302 av = fio;
03303 }
03304 else
03305 {
03306 av = fii;
03307 }
03308
03309 break;
03310 }
03311 case discontisotrmat:{
03312 av =ditrm[idmi].correct_val (inv,iinv);
03313 break;
03314 }
03315 case salt3mat:{
03316 av = salt3[idmi].get_rel_hum (inv[0]);
03317 avi = salt3[idmi].get_rel_hum (iinv[0]);
03318 break;
03319 }
03320 case salt4mat:{
03321
03322
03323
03324
03325
03326
03327
03328 break;
03329 }
03330
03331 default:{
03332 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
03333 }
03334 }
03335
03336
03337 switch (mto){
03338 case milly:
03339 case moistheat:
03340 case kunzel:{
03341
03342
03343
03344
03345 jum[0] = 0.0;
03346 jum[1] = 0.0;
03347 break;
03348 }
03349 case grunewald:{
03350 if (dfdwi > dfdwo)
03351 {
03352 jum[0] = -grunw[idmi].get_moisture (av)+outv[0]+iinv[0]-ioutv[0];
03353 }
03354 else
03355 {
03356 jum[0] = grunw[idmo].get_moisture (av)-inv[0]-ioutv[0]+iinv[0];
03357 }
03358
03359
03360 jum[1] = 0.0;
03361 break;
03362 }
03363 case simplediscmat:{
03364 if (dfdwi > dfdwo)
03365 {
03366 jum[0] = -sdmat[idmi].get_moisture2 (av)+outv[0]+iinv[0]-ioutv[0];
03367 }
03368 else
03369 {
03370 jum[0] = sdmat[idmo].get_moisture2 (av)-inv[0]-ioutv[0]+iinv[0];
03371 }
03372
03373 jum[1] = 0.0;
03374 break;
03375 }
03376
03377 case discontisotrmat:{
03378 avi=ditrm[idmo].correct_val (outv,ioutv);
03379
03380 jum[0]=avi-ioutv[0]+iinv[0];
03381 break;
03382 }
03383 case salt3mat:{
03384 jum[0] = salt3[idmo].get_moisture (av)-inv[0];
03385 av = salt3[idmo].get_moisture (avi)-iinv[0];
03386 jum[0]-=av;
03387 jum[1] = 0.0;
03388 jum[2] = 0.0;
03389 break;
03390 }
03391 case salt4mat:{
03392
03393
03394 jum[0]-=av;
03395 jum[1] = 0.0;
03396 jum[2] = 0.0;
03397 jum[3] = 0.0;
03398 break;
03399 }
03400 default:{
03401 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
03402 }
03403 }
03404
03405 }
03406
03407
03408
03409
03410
03411 void transmat::updateipval (void)
03412 {
03413 long i,j,ipp,nip;
03414
03415
03416
03417 for (i=0;i<Tt->ne;i++){
03418 if (Gtt->leso[i]==1){
03419 ipp=Tt->elements[i].ipp[0][0];
03420 nip=Tt->give_tnip (i);
03421 for (j=0;j<nip;j++){
03422 updateipvalmat (ipp,0,0);
03423 ipp++;
03424 }
03425 }
03426 }
03427
03428
03429 for (i=0;i<Tt->ne;i++){
03430 if (Gtt->leso[i]==1){
03431
03432
03433
03434 ipp=Tt->elements[i].ipp[0][0];
03435
03436 nip=Tt->give_tnip (i);
03437
03438
03439 for (j=0;j<nip;j++){
03440
03441 ipp++;
03442 }
03443 }
03444 }
03445
03446
03447
03448
03449 }
03450
03451
03452
03453
03454
03455
03456
03457
03458
03459
03460
03461
03462 void transmat::updateipvalmat (long ipp,long im,long ido)
03463 {
03464 long i;
03465
03466 i = ip[ipp].idm;
03467
03468 switch (ip[ipp].tm){
03469 case isotransmat:
03470 case nlisotransmat:
03471 case homomat:
03472 case damisotransmat:
03473 case discontisotrmat:
03474 case cernyconcrete:
03475 case bazantpedersen:
03476 case pedersen:
03477 case carb1mat:
03478 case sejtkr:
03479 case lincoupledmat:
03480 case richardsmat:
03481 case radiationmater:
03482 break;
03483 case consolawf1:
03484 consol_awf1[i].updateval(ipp);
03485 break;
03486 case cementhydrmat:
03487 cemhydr[i].updateval(ipp,im,ido);
03488 break;
03489 case kunzel:{
03490
03491 break;
03492 }
03493 case kunzel2:{
03494
03495 break;
03496 }
03497 case grunewald:{
03498
03499 break;
03500 }
03501 case simplediscmat:{
03502
03503 break;
03504 }
03505 case devries:{
03506
03507 break;
03508 }
03509 case milly:{
03510
03511 break;
03512 }
03513 case moistheat:{
03514
03515 break;
03516 }
03517 case glasgow:
03518 case salt1mat:
03519 case salt2mat:
03520 case salt3mat:
03521 case salt4mat:
03522 case concreteB:
03523 case baroghelB:
03524 case C60baroghelB:
03525 case C30baroghelB:
03526 case o30bazantB:
03527 case C60bazantB:
03528 case soilmat1:
03529 case consolawf2:
03530 break;
03531 default:{
03532 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
03533 }
03534 }
03535 }
03536
03537
03538
03539
03540
03541
03542
03543
03544
03545
03546 void transmat::fluxcomparing (long ipp)
03547 {
03548 long i,j,n,ntm;
03549 double norfl1,norfl2,neglrel,neglabs,zero;
03550
03551
03552 neglrel=1.0e-5;
03553
03554 neglabs=1.0e-9;
03555
03556 zero=Tp->zero;
03557
03558
03559 ntm = Tp->ntm;
03560
03561 n = ip[ipp].ncompgrad;
03562
03563 vector gr(n),fl1(n),fl2(n);
03564 matrix d(n,n);
03565
03566 for (i=0;i<ntm;i++){
03567
03568 matcond (d,ipp,i,i);
03569
03570 givegrad (i,ipp,gr);
03571
03572 mxv (d,gr,fl1);
03573
03574 norfl1 = normv (fl1);
03575
03576 ip[ipp].infl[i][i]=1;
03577
03578 for (j=0;j<ntm;j++){
03579 if (j==i)
03580 continue;
03581
03582
03583 matcond (d,ipp,i,j);
03584
03585 givegrad (j,ipp,gr);
03586
03587 mxv (d,gr,fl2);
03588
03589 norfl2 = normv (fl2);
03590
03591 if (norfl1>zero){
03592 if (norfl2/norfl1 < neglrel){
03593
03594
03595
03596 ip[ipp].infl[i][j]=0;
03597 }else{
03598
03599
03600 ip[ipp].infl[i][j]=1;
03601 }
03602 }else{
03603 if (norfl2 < neglabs){
03604
03605
03606
03607 ip[ipp].infl[i][j]=0;
03608 }else{
03609
03610
03611 ip[ipp].infl[i][j]=1;
03612 }
03613 }
03614
03615
03616
03617
03618
03619
03620
03621
03622
03623
03624
03625
03626
03627
03628
03629
03630
03631
03632
03633
03634
03635
03636
03637
03638
03639
03640 }
03641 }
03642 }
03643
03644
03645
03646
03647
03648 void transmat::initmaterialmodels (void)
03649 {
03650 long i,j,ipp,nip;
03651
03652 for (i=0;i<Tt->ne;i++){
03653 if (Gtt->leso[i]==1){
03654 ipp=Tt->elements[i].ipp[0][0];
03655 nip=Tt->give_tnip (i);
03656 for (j=0;j<nip;j++){
03657 initvalues (ipp,0,0);
03658 ipp++;
03659 }
03660 }
03661 }
03662 }
03663
03664
03665
03666
03667
03668
03669
03670
03671
03672
03673
03674 void transmat::initvalues (long ipp,long im,long ido)
03675 {
03676 long i;
03677
03678 i = ip[ipp].idm;
03679
03680 switch (ip[ipp].tm){
03681 case isotransmat:
03682 case nlisotransmat:
03683 case homomat:
03684 case damisotransmat:
03685 case discontisotrmat:
03686 case cernyconcrete:
03687 case bazantpedersen:
03688 case pedersen:
03689 case carb1mat:
03690 case sejtkr:
03691 case richardsmat:
03692 case lincoupledmat:
03693 break;
03694 case consolawf1:
03695 consol_awf1[i].initval(ipp);
03696 break;
03697 case cementhydrmat:
03698 cemhydr[i].initvalues(ipp,im,ido);
03699 break;
03700 case kunzel:{
03701 kun[i].initvalues (ipp,ido);
03702 break;
03703 }
03704 case kunzel2:{
03705 kun2[i].initvalues (ipp,ido);
03706 break;
03707 }
03708 case grunewald:{
03709 grunw[i].initvalues (ipp,ido);
03710 break;
03711 }
03712 case simplediscmat:{
03713 sdmat[i].initvalues (ipp,ido);
03714 break;
03715 }
03716 case devries:{
03717
03718 break;
03719 }
03720 case milly:{
03721 mill[i].initvalues(ipp,ido);
03722 break;
03723 }
03724 case moistheat:{
03725 moisth[i].initvalues(ipp,ido);
03726 break;
03727 }
03728 case salt3mat:{
03729 salt3[i].initvalues (ipp,ido);
03730 break;
03731 }
03732 case salt4mat:{
03733
03734 break;
03735 }
03736 case glasgow:
03737 case salt1mat:
03738 case salt2mat:
03739 case concreteB:
03740 case baroghelB:
03741 case C60baroghelB:
03742 case C30baroghelB:
03743 case o30bazantB:
03744 case C60bazantB:
03745 case soilmat1:
03746 case consolawf2:
03747 break;
03748 default:{
03749 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
03750 }
03751 }
03752 }
03753
03754
03755
03756
03757
03758
03759
03760
03761 void transmat::aux_values (long lcid)
03762 {
03763 long i,j,idm,nid,nne,ncompeqother,eid,ipp;
03764 double *in,*out, *inp, *ineq;
03765 ivector nodes;
03766
03767
03768 for (i=0;i<tnip;i++){
03769
03770 j = ip[i].idm;
03771
03772 switch (ip[i].tm){
03773 case isotransmat:
03774 case nlisotransmat:
03775 case homomat:
03776 case damisotransmat:
03777 case discontisotrmat:
03778 case cernyconcrete:
03779 case bazantpedersen:
03780 case pedersen:
03781 case carb1mat:
03782 case cementhydrmat:
03783 case richardsmat:
03784 case radiationmater:{
03785 break;
03786 }
03787 case kunzel:{
03788 ncompeqother = givencompeqother (i,0);
03789 in = new double[2];
03790 inp = new double[2];
03791 ineq = new double[ncompeqother];
03792 out = new double[ncompeqother];
03793 kun[j].give_values (i,in,inp,ineq);
03794 kun[j].aux_values (i,in,inp,ineq,out);
03795 kun[j].save_values (i,out);
03796 delete [] in;
03797 delete [] inp;
03798 delete [] ineq;
03799 delete [] out;
03800 break;
03801 }
03802 case sejtkr:
03803 case consolawf1:
03804 case lincoupledmat:
03805 break;
03806 case kunzel2:{
03807 in = new double[2];
03808 out = new double[6];
03809 inp = new double[2];
03810 ineq = new double[6];
03811 kun2[j].give_values (i,in, inp,ineq);
03812 kun2[j].aux_values (i,in, inp,ineq,out);
03813 kun2[j].save_values (i,out);
03814 delete [] in;
03815 delete [] inp;
03816 delete [] ineq;
03817 delete [] out;
03818 break;
03819 }
03820 case grunewald:{
03821 in = new double[2];
03822 out = new double[6];
03823 inp = new double[2];
03824 ineq = new double[6];
03825 grunw[j].give_values (i,in, inp,ineq);
03826 grunw[j].aux_values (i,in, inp,ineq,out);
03827 grunw[j].save_values (i,out);
03828 delete [] in;
03829 delete [] inp;
03830 delete [] ineq;
03831 delete [] out;
03832 break;
03833 }
03834
03835 case simplediscmat:{
03836 in = new double[4];
03837 inp = new double[4];
03838 out = new double[8];
03839 ineq = new double[8];
03840 sdmat[j].give_values (i,in, inp,ineq);
03841 sdmat[j].aux_values (i,in, inp,ineq,out);
03842 sdmat[j].save_values (i,out);
03843 delete [] in;
03844 delete [] inp;
03845 delete [] ineq;
03846 delete [] out;
03847 break;
03848 }
03849
03850 case devries:{
03851 break;
03852 }
03853 case milly:{
03854 in = new double[2];
03855 out = new double[10];
03856 inp = new double[2];
03857 ineq = new double[10];
03858 mill[j].give_values (i,in, inp,ineq);
03859 mill[j].aux_values (i,in, inp,ineq,out);
03860 mill[j].save_values (i,out);
03861 delete [] in;
03862 delete [] inp;
03863 delete [] ineq;
03864 delete [] out;
03865 break;
03866 }
03867 case moistheat:{
03868 ncompeqother = givencompeqother (i,0);
03869 in = new double[2];
03870 inp = new double[2];
03871 ineq = new double[ncompeqother];
03872 out = new double[ncompeqother];
03873 moisth[j].give_values (i,in,inp,ineq);
03874 moisth[j].aux_values (i,in,inp,ineq,out);
03875 moisth[j].save_values (i,out);
03876 delete [] in;
03877 delete [] inp;
03878 delete [] ineq;
03879 delete [] out;
03880 break;
03881 }
03882 case salt3mat:{
03883 salt3[j].aux_values (i);
03884 break;
03885 }
03886 case salt4mat:{
03887 ncompeqother = givencompeqother (i,0);
03888 in = new double[4];
03889 inp = new double[4];
03890 ineq = new double[ncompeqother];
03891 out = new double[ncompeqother];
03892 salt4[j].give_values (i,in,inp,ineq);
03893 salt4[j].aux_values (i,in,inp,ineq,out);
03894 salt4[j].save_values (i,out);
03895 delete [] in;
03896 delete [] inp;
03897 delete [] ineq;
03898 delete [] out;
03899 break;
03900 }
03901 case glasgow:
03902 case salt1mat:
03903 case salt2mat:
03904 case concreteB:
03905 case baroghelB:
03906 case C60baroghelB:
03907 case C30baroghelB:
03908 case o30bazantB:
03909 case C60bazantB:
03910 case soilmat1:
03911 case consolawf2:
03912 break;
03913 default:{
03914 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
03915 }
03916 }
03917
03918 }
03919
03920
03921
03922
03923
03924 if (Tb->lc[lcid].ncc>0){
03925
03926 for (i=0;i<Tb->lc[lcid].neb;i++){
03927
03928
03929 eid = Tb->lc[lcid].elemload[i].eid;
03930
03931 if (eid >=0){
03932
03933 ipp = Tt->elements[eid].ipp[0][0];
03934
03935 nne = Tt->give_nne (eid);
03936
03937 allocv (nne,nodes);
03938
03939 Tt->give_elemnodes (eid,nodes);
03940
03941
03942 idm = ip[ipp].idm;
03943
03944
03945 for (j=0;j<nne;j++){
03946
03947 nid = nodes[j];
03948
03949 switch (ip[ipp].tm){
03950 case isotransmat:
03951 case homomat:
03952 case damisotransmat:
03953 break;
03954 case kunzel:{
03955 in = new double[2];
03956 inp = new double[2];
03957 ineq = new double[5];
03958 out = new double[5];
03959 Tt->nodes[nid].give_values (in,inp,ineq);
03960 kun[idm].aux_values (ipp,in,inp,ineq,out);
03961 Tt->nodes[nid].save_values (out);
03962 delete [] in;
03963 delete [] inp;
03964 delete [] ineq;
03965 delete [] out;
03966 break;
03967 }
03968 case kunzel2:{
03969 in = new double[2];
03970 inp = new double[2];
03971 ineq = new double[15];
03972 out = new double[15];
03973 Tt->nodes[nid].give_values (in, inp,ineq);
03974 kun2[idm].aux_values (ipp,in, inp,ineq,out);
03975
03976
03977 Tt->nodes[nid].save_values (out);
03978 delete [] in;
03979 delete [] inp;
03980 delete [] ineq;
03981 delete [] out;
03982 break;
03983 }
03984 case grunewald:{
03985 in = new double[2];
03986 inp = new double[2];
03987 ineq = new double[15];
03988 out = new double[15];
03989 Tt->nodes[nid].give_values (in, inp,ineq);
03990 grunw[idm].aux_values (ipp,in, inp,ineq,out);
03991
03992
03993 Tt->nodes[nid].save_values (out);
03994 delete [] in;
03995 delete [] inp;
03996 delete [] ineq;
03997 delete [] out;
03998 break;
03999 }
04000 case simplediscmat:{
04001 in = new double[2];
04002 inp = new double[2];
04003 ineq = new double[15];
04004 out = new double[15];
04005 Tt->nodes[nid].give_values (in, inp,ineq);
04006 sdmat[idm].aux_values (ipp,in, inp,ineq,out);
04007
04008
04009 Tt->nodes[nid].save_values (out);
04010 delete [] in;
04011 delete [] inp;
04012 delete [] ineq;
04013 delete [] out;
04014 break;
04015 }
04016 case salt4mat:{
04017 ncompeqother = givencompeqother (i,0);
04018 in = new double[4];
04019 inp = new double[4];
04020 ineq = new double[ncompeqother];
04021 out = new double[ncompeqother];
04022 Tt->nodes[nid].give_values (in,inp,ineq);
04023 salt4[idm].aux_values (ipp,in,inp,ineq,out);
04024 Tt->nodes[nid].save_values (out);
04025 delete [] in;
04026 delete [] inp;
04027 delete [] ineq;
04028 delete [] out;
04029 break;
04030 }
04031 case milly:{
04032 in = new double[2];
04033 inp = new double[2];
04034 ineq = new double[15];
04035 out = new double[15];
04036 Tt->nodes[nid].give_values (in, inp,ineq);
04037 mill[idm].aux_values (ipp,in, inp,ineq,out);
04038
04039
04040 Tt->nodes[nid].save_values (out);
04041 delete [] in;
04042 delete [] inp;
04043 delete [] ineq;
04044 delete [] out;
04045 break;
04046 }
04047 default:{
04048 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
04049 }
04050 }
04051 }
04052 destrv(nodes);
04053 }
04054 }
04055 }
04056 }
04057
04058
04059
04060
04061
04062
04063
04064
04065
04066
04067 void transmat::mat_aux_values (long ipp)
04068 {
04069 long im, ncompeqother;
04070 double *in,*out, *inp, *ineq;
04071
04072 im = ip[ipp].idm;
04073
04074 switch (ip[ipp].tm){
04075 case isotransmat:
04076 case nlisotransmat:
04077 case homomat:
04078 case damisotransmat:
04079 case discontisotrmat:
04080 case cernyconcrete:
04081 case bazantpedersen:
04082 case pedersen:
04083 case carb1mat:
04084 case cementhydrmat:
04085 case richardsmat:
04086 case radiationmater:{
04087 break;
04088 }
04089 case kunzel:{
04090 ncompeqother = givencompeqother (ipp,0);
04091 in = new double[2];
04092 inp = new double[2];
04093 ineq = new double[ncompeqother];
04094 out = new double[ncompeqother];
04095 kun[im].give_values (ipp,in,inp,ineq);
04096 kun[im].aux_values (ipp,in,inp,ineq,out);
04097 kun[im].save_values (ipp,out);
04098 delete [] in;
04099 delete [] inp;
04100 delete [] ineq;
04101 delete [] out;
04102 break;
04103 }
04104 case sejtkr:
04105 case consolawf1:
04106 case lincoupledmat:
04107 break;
04108 case kunzel2:{
04109 in = new double[2];
04110 out = new double[6];
04111 inp = new double[2];
04112 ineq = new double[6];
04113 kun2[im].give_values (ipp,in, inp,ineq);
04114 kun2[im].aux_values (ipp,in, inp,ineq,out);
04115 kun2[im].save_values (ipp,out);
04116 delete [] in;
04117 delete [] inp;
04118 delete [] ineq;
04119 delete [] out;
04120 break;
04121 }
04122 case grunewald:{
04123 in = new double[2];
04124 out = new double[6];
04125 inp = new double[2];
04126 ineq = new double[6];
04127 grunw[im].give_values (ipp,in, inp,ineq);
04128 grunw[im].aux_values (ipp,in, inp,ineq,out);
04129 grunw[im].save_values (ipp,out);
04130 delete [] in;
04131 delete [] inp;
04132 delete [] ineq;
04133 delete [] out;
04134 break;
04135 }
04136
04137 case simplediscmat:{
04138 in = new double[4];
04139 inp = new double[4];
04140 out = new double[8];
04141 ineq = new double[8];
04142 sdmat[im].give_values (ipp,in, inp,ineq);
04143 sdmat[im].aux_values (ipp,in, inp,ineq,out);
04144 sdmat[im].save_values (ipp,out);
04145 delete [] in;
04146 delete [] inp;
04147 delete [] ineq;
04148 delete [] out;
04149 break;
04150 }
04151
04152 case devries:{
04153 break;
04154 }
04155 case milly:{
04156 in = new double[2];
04157 out = new double[10];
04158 inp = new double[2];
04159 ineq = new double[10];
04160 mill[im].give_values (ipp,in, inp,ineq);
04161 mill[im].aux_values (ipp,in, inp,ineq,out);
04162 mill[im].save_values (ipp,out);
04163 delete [] in;
04164 delete [] inp;
04165 delete [] ineq;
04166 delete [] out;
04167 break;
04168 }
04169 case salt3mat:{
04170 salt3[im].aux_values (ipp);
04171 break;
04172 }
04173 case salt4mat:{
04174 ncompeqother = givencompeqother (ipp,0);
04175 in = new double[4];
04176 inp = new double[4];
04177 ineq = new double[ncompeqother];
04178 out = new double[ncompeqother];
04179 salt4[im].give_values (ipp,in,inp,ineq);
04180 salt4[im].aux_values (ipp,in,inp,ineq,out);
04181 salt4[im].save_values (ipp,out);
04182 delete [] in;
04183 delete [] inp;
04184 delete [] ineq;
04185 delete [] out;
04186 break;
04187 }
04188 case glasgow:
04189 case salt1mat:
04190 case salt2mat:
04191 case concreteB:
04192 case baroghelB:
04193 case C60baroghelB:
04194 case C30baroghelB:
04195 case o30bazantB:
04196 case C60bazantB:
04197 case soilmat1:
04198 case consolawf2:
04199 break;
04200 default:{
04201 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
04202 }
04203 }
04204 }
04205
04206
04207
04208
04209
04210
04211
04212
04213
04214
04215
04216
04217
04218
04219 long transmat::cycle_detection (double *r,double *pr,double *ppr,long ipp)
04220 {
04221 long ret;
04222
04223 switch (ip[ipp].tm){
04224 case salt4mat:{
04225 ret=salt4[ip[ipp].idm].cycle_detection (r,pr,ppr);
04226 break;
04227 }
04228 default:{
04229 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
04230 }
04231 }
04232
04233 return ret;
04234 }
04235
04236
04237
04238
04239
04240
04241
04242
04243
04244
04245
04246
04247
04248
04249
04250
04251
04252 void transmat::save_intpointst_txt (FILE *aux, sel &selelems, sel *selother)
04253 {
04254 long i,j,n,nip,ir,ipp;
04255 sel selno;
04256
04257 selno.n=1;
04258 fprintf(aux, "\n");
04259 for (i=0;i<Tt->ne;i++)
04260 {
04261 ipp = Tt->elements[i].ipp[0][0];
04262 nip = Tt->give_tnip(i);
04263 selelems.presence_id(i, ir);
04264 if (ir < 0)
04265 n = 0;
04266 else
04267 n = selother[ir].give_nselcomp(ip[ipp].ncompeqother);
04268 for (j=0; j<nip; j++)
04269 {
04270 fprintf (aux,"%ld %ld %ld %ld\n",ipp, Tp->ntm, ip[ipp].ncompgrad, n);
04271 if (ir < 0)
04272 ip[ipp].save_data_txt(aux, selno);
04273 else
04274 ip[ipp].save_data_txt(aux, selother[ir]);
04275
04276 fprintf(aux, "\n");
04277 ipp++;
04278 }
04279 }
04280 }
04281
04282
04283
04284
04285
04286
04287
04288
04289
04290
04291
04292
04293
04294
04295
04296
04297 void transmat::save_intpointst_txt (long ni, sel &selelems, sel *selother)
04298 {
04299 long i,j,k,ir,n,nip,ipp;
04300 sel selno;
04301 selno.n=1;
04302 FILE *aux;
04303 char name[FNAMELEN+20];
04304 char emsg[FNAMELEN+100];
04305 int prec = (int)Tp->hdbcont.prec;
04306
04307 sprintf(name, "%s.%ld.grad.bac",Tp->hdbcont.hdbnames, ni);
04308 aux = fopen(name,"wt");
04309 if (aux==NULL)
04310 {
04311 sprintf(emsg, "cannot open backup file %s", name);
04312 print_err(emsg, __FILE__, __LINE__, __func__);
04313 abort();
04314 }
04315 for (i=0;i<tnip;i++)
04316 {
04317 fprintf (aux,"%ld %ld %ld\n",i, Tp->ntm, ip[i].ncompgrad);
04318 for (j=0;j<Tp->ntm;j++)
04319 for (k=0;k<Tm->ip[i].ncompgrad;k++)
04320 fprintf (aux, "%.*le\n",prec , ip[i].grad[j][k]);
04321 }
04322 fclose(aux);
04323
04324 sprintf(name, "%s.%ld.flux.bac",Tp->hdbcont.hdbnames, ni);
04325 aux = fopen(name,"wt");
04326 if (aux==NULL)
04327 {
04328 sprintf(emsg, "cannot open backup file %s", name);
04329 print_err(emsg, __FILE__, __LINE__, __func__);
04330 abort();
04331 }
04332 for (i=0;i<tnip;i++)
04333 {
04334 fprintf (aux,"%ld %ld %ld\n",i, Tp->ntm, ip[i].ncompgrad);
04335 for (j=0;j<Tp->ntm;j++)
04336 for (k=0;k<Tm->ip[i].ncompgrad;k++)
04337 fprintf (aux, "%.*le\n",prec , ip[i].fluxes[j][k]);
04338 }
04339 fclose(aux);
04340
04341 sprintf(name, "%s.%ld.other.bac",Tp->hdbcont.hdbnames, ni);
04342 aux = fopen(name,"wt");
04343 if (aux==NULL)
04344 {
04345 sprintf(emsg, "cannot open backup file %s", name);
04346 print_err(emsg, __FILE__, __LINE__, __func__);
04347 abort();
04348 }
04349 for (i=0;i<Tt->ne;i++)
04350 {
04351 ipp = Tt->elements[i].ipp[0][0];
04352 nip = Tt->give_tnip(i);
04353 selelems.presence_id(i, ir);
04354 if (ir < 0)
04355 n = 0;
04356 else
04357 n = selother[ir].give_nselcomp(ip[ipp].ncompeqother);
04358 for (j=0; j<nip; j++)
04359 {
04360 fprintf (aux,"%ld %ld\n",ipp, n);
04361 if (n==0)
04362 {
04363 ipp++;
04364 continue;
04365 }
04366 for (k=0;k<ip[ipp].ncompeqother;k++)
04367 {
04368 if (selother[ir].presence_id(k))
04369 fprintf (aux, "%.*le\n",prec , ip[ipp].eqother[k]);
04370 }
04371 ipp++;
04372 }
04373 }
04374 fclose(aux);
04375 }
04376
04377
04378
04379
04380
04381
04382
04383
04384
04385
04386
04387
04388
04389
04390
04391
04392 void transmat::save_intpointst_bin (FILE *aux, sel &selelems, sel *selother)
04393 {
04394 long i,j,n,nip,ir,ipp;
04395 sel selno;
04396
04397 selno.n=1;
04398 for (i=0;i<Tt->ne;i++)
04399 {
04400 ipp = Tt->elements[i].ipp[0][0];
04401 nip = Tt->give_tnip(i);
04402 selelems.presence_id(i, ir);
04403
04404 if (ir < 0)
04405 n = 0;
04406 else
04407 n = selother[ir].give_nselcomp(ip[ipp].ncompeqother);
04408 for (j=0; j<nip; j++)
04409 {
04410 fwrite(&ipp, sizeof(ipp), 1, aux);
04411 fwrite(&Tp->ntm, sizeof(Tp->ntm), 1, aux);
04412 fwrite(&ip[ipp].ncompgrad, sizeof(ip[ipp].ncompgrad), 1, aux);
04413 fwrite(&n, sizeof(n), 1, aux);
04414 if (ir < 0)
04415 ip[ipp].save_data_bin(aux, selno);
04416 else
04417 ip[ipp].save_data_bin(aux, selother[ir]);
04418
04419 ipp++;
04420 }
04421 }
04422 }
04423
04424
04425
04426
04427
04428
04429
04430
04431
04432
04433
04434
04435
04436
04437
04438
04439 void transmat::save_intpointst_bin (long ni, sel &selelems, sel *selother)
04440 {
04441 long i,j,k,ir,n,nip,ipp;
04442 sel selno;
04443 selno.n=1;
04444 FILE *aux;
04445 char name[FNAMELEN+20];
04446 char emsg[FNAMELEN+100];
04447
04448 sprintf(name, "%s.%ld.grad.bac",Tp->hdbcont.hdbnames, ni);
04449 aux = fopen(name,"wb");
04450 if (aux==NULL)
04451 {
04452 sprintf(emsg, "cannot open backup file %s", name);
04453 print_err(emsg, __FILE__, __LINE__, __func__);
04454 abort();
04455 }
04456 for (i=0;i<tnip;i++){
04457 fwrite(&i, sizeof(i), 1, aux);
04458 fwrite(&Tp->ntm, sizeof(Tp->ntm), 1, aux);
04459 fwrite(&ip[i].ncompgrad, sizeof(ip[i].ncompgrad), 1, aux);
04460 for (j=0;j<Tp->ntm;j++)
04461 fwrite (ip[i].grad[j], sizeof(*ip[i].grad[j]),ip[i].ncompgrad, aux);
04462 }
04463 fclose(aux);
04464
04465 sprintf(name, "%s.%ld.flux.bac",Tp->hdbcont.hdbnames, ni);
04466 aux = fopen(name,"wb");
04467 if (aux==NULL)
04468 {
04469 sprintf(emsg, "cannot open backup file %s", name);
04470 print_err(emsg, __FILE__, __LINE__, __func__);
04471 abort();
04472 }
04473 for (i=0;i<tnip;i++)
04474 {
04475 fwrite(&i, sizeof(i), 1, aux);
04476 fwrite(&Tp->ntm, sizeof(Tp->ntm), 1, aux);
04477 fwrite(&ip[i].ncompgrad, sizeof(ip[i].ncompgrad), 1, aux);
04478 for (j=0;j<Tp->ntm;j++)
04479 fwrite (ip[i].fluxes[j], sizeof(*ip[i].fluxes[j]),ip[i].ncompgrad, aux);
04480 }
04481 fclose(aux);
04482
04483 sprintf(name, "%s.%ld.other.bac",Tp->hdbcont.hdbnames, ni);
04484 aux = fopen(name,"wb");
04485 if (aux==NULL)
04486 {
04487 sprintf(emsg, "cannot open backup file %s", name);
04488 print_err(emsg, __FILE__, __LINE__, __func__);
04489 abort();
04490 }
04491 for (i=0;i<Tt->ne;i++)
04492 {
04493 ipp = Tt->elements[i].ipp[0][0];
04494 nip = Tt->give_tnip(i);
04495 selelems.presence_id(i, ir);
04496 if (ir < 0)
04497 n = 0;
04498 else
04499 n = selother[ir].give_nselcomp(ip[ipp].ncompeqother);
04500 for (j=0; j<nip; j++)
04501 {
04502 fwrite(&ipp, sizeof(ipp), 1, aux);
04503 fwrite(&n, sizeof(n), 1, aux);
04504 if (n==0)
04505 {
04506 ipp++;
04507 continue;
04508 }
04509 for (k=0;k<ip[ipp].ncompeqother;k++)
04510 {
04511 if (selother[ir].presence_id(k))
04512 fwrite (ip[ipp].eqother+k, sizeof(*ip[ipp].eqother), 1, aux);
04513 }
04514 ipp++;
04515 }
04516 }
04517
04518 fclose(aux);
04519 }
04520
04521
04522
04523
04524
04525
04526
04527
04528
04529
04530
04531
04532
04533
04534
04535
04536
04537
04538
04539
04540 void transmat::restore_intpointst_txt (FILE *aux, sel &selelems, sel *selother, long **selid)
04541 {
04542 long i,n,ir,ipp;
04543 long ntm, ncompgrad;
04544 sel selno;
04545
04546 selno.n=1;
04547 for (i=0;i<tnip;i++){
04548 fscanf (aux,"%ld %ld %ld %ld",&ipp, &ntm, &ncompgrad, &n);
04549 if ((ipp < 0) || (ipp >= tnip))
04550 {
04551 print_err("invalid integration point number", __FILE__, __LINE__, __func__);
04552 abort();
04553 }
04554 if (ntm != Tp->ntm)
04555 {
04556 print_err("invalid number of transported matter", __FILE__, __LINE__, __func__);
04557 abort();
04558 }
04559 if (ncompgrad != ip[ipp].ncompgrad)
04560 {
04561 print_err("incompatible number of flux/grad components", __FILE__, __LINE__, __func__);
04562 abort();
04563 }
04564 selelems.presence_id(elip[ipp], ir);
04565 if (ir < 0)
04566 ip[ipp].restore_data_txt(aux, n, selno, NULL);
04567 else
04568 ip[ipp].restore_data_txt(aux, n, selother[ir], selid[ir]);
04569
04570 }
04571 }
04572
04573
04574
04575
04576
04577
04578
04579
04580
04581
04582
04583
04584
04585
04586
04587
04588
04589
04590
04591 void transmat::restore_intpointst_txt (sel &selelems, sel *selother, long **selid)
04592 {
04593 long i,j,k,n,ir,ik,is,ipp;
04594 long ntm, ncompgrad;
04595 double tmp;
04596 FILE *aux;
04597 char name[FNAMELEN+20];
04598 char emsg[FNAMELEN+100];
04599
04600
04601 sprintf(name, "%s.grad.bac",Tp->hdbcont.hdbnamer);
04602 aux = fopen(name,"rt");
04603 if (aux==NULL)
04604 {
04605 sprintf(emsg, "cannot open backup file %s", name);
04606 print_err(emsg, __FILE__, __LINE__, __func__);
04607 abort();
04608 }
04609 for (i=0;i<tnip;i++){
04610 fscanf (aux,"%ld %ld %ld",&ipp, &ntm, &ncompgrad);
04611 if ((ipp < 0) || (ipp >= tnip))
04612 {
04613 print_err("invalid integration point number", __FILE__, __LINE__, __func__);
04614 abort();
04615 }
04616 if (ntm != Tp->ntm)
04617 {
04618 print_err("invalid number of transported matter", __FILE__, __LINE__, __func__);
04619 abort();
04620 }
04621 if (ncompgrad != ip[ipp].ncompgrad)
04622 {
04623 print_err("incompatible number of flux/grad components", __FILE__, __LINE__, __func__);
04624 abort();
04625 }
04626 for (j=0;j<Tp->ntm;j++)
04627 for (k=0;k<Tm->ip[i].ncompgrad;k++)
04628 fscanf (aux, "%le", ip[i].grad[j]+k);
04629 }
04630
04631 sprintf(name, "%s.flux.bac",Tp->hdbcont.hdbnamer);
04632 aux = fopen(name,"rt");
04633 if (aux==NULL)
04634 {
04635 sprintf(emsg, "cannot open backup file %s", name);
04636 print_err(emsg, __FILE__, __LINE__, __func__);
04637 abort();
04638 }
04639 for (i=0;i<tnip;i++){
04640 fscanf (aux,"%ld %ld %ld",&ipp, &ntm, &ncompgrad);
04641 if ((ipp < 0) || (ipp >= tnip))
04642 {
04643 print_err("invalid integration point number", __FILE__, __LINE__, __func__);
04644 abort();
04645 }
04646 if (ntm != Tp->ntm)
04647 {
04648 print_err("invalid number of transported matter", __FILE__, __LINE__, __func__);
04649 abort();
04650 }
04651 if (ncompgrad != ip[ipp].ncompgrad)
04652 {
04653 print_err("incompatible number of flux/grad components", __FILE__, __LINE__, __func__);
04654 abort();
04655 }
04656 for (j=0;j<Tp->ntm;j++)
04657 for (k=0;k<Tm->ip[i].ncompgrad;k++)
04658 fscanf (aux, "%le", ip[i].fluxes[j]+k);
04659 }
04660
04661 sprintf(name, "%s.other.bac",Tp->hdbcont.hdbnamer);
04662 aux = fopen(name,"rt");
04663 if (aux==NULL)
04664 {
04665 sprintf(emsg, "cannot open backup file %s", name);
04666 print_err(emsg, __FILE__, __LINE__, __func__);
04667 abort();
04668 }
04669 for (i=0;i<tnip;i++)
04670 {
04671 fscanf (aux,"%ld %ld",&ipp, &n);
04672 if ((ipp < 0) || (ipp >= tnip))
04673 {
04674 print_err("invalid integration point number", __FILE__, __LINE__, __func__);
04675 abort();
04676 }
04677 selelems.presence_id(elip[ipp], ir);
04678 for (k=0;k<n;k++)
04679 {
04680 fscanf (aux, "%le", &tmp);
04681 if (ir < 0)
04682 continue;
04683 if (selother[ir].presence_id(k,ik))
04684 {
04685 is = selid[ir][ik]+k-selother[ir].id1[ik];
04686 if (is >= ip[ipp].ncompeqother)
04687 print_err("invalid index for eqother restoring is required", __FILE__, __LINE__, __func__);
04688 else
04689 ip[ipp].eqother[is] = tmp;
04690 }
04691 }
04692 ipp++;
04693 }
04694 fclose(aux);
04695 }
04696
04697
04698
04699
04700
04701
04702
04703
04704
04705
04706
04707
04708
04709
04710
04711
04712
04713
04714
04715
04716 void transmat::restore_intpointst_bin (FILE *aux, sel &selelems, sel *selother, long **selid)
04717 {
04718 long i, ipp, ntm, ncompgrad, n;
04719 long ir;
04720 sel selno;
04721
04722 for (i=0;i<tnip;i++){
04723 fread(&ipp, sizeof(ipp), 1, aux);
04724 fread(&ntm, sizeof(ntm), 1, aux);
04725 fread(&ncompgrad, sizeof(ncompgrad), 1, aux);
04726 fread(&n, sizeof(n), 1, aux);
04727 if ((ipp < 0) || (ipp >= tnip))
04728 {
04729 print_err("invalid integration point number", __FILE__, __LINE__, __func__);
04730 abort();
04731 }
04732 if (ntm != Tp->ntm)
04733 {
04734 print_err("invalid number of transported matter", __FILE__, __LINE__, __func__);
04735 abort();
04736 }
04737 if (ncompgrad != ip[ipp].ncompgrad)
04738 {
04739 print_err("incompatible number of stress/strain components", __FILE__, __LINE__, __func__);
04740 abort();
04741 }
04742 selelems.presence_id(elip[ipp], ir);
04743 if (ir < 0)
04744 ip[ipp].restore_data_bin(aux, n, selno, NULL);
04745 else
04746 ip[ipp].restore_data_bin(aux, n, selother[ir], selid[ir]);
04747 }
04748 }
04749
04750
04751
04752
04753
04754
04755
04756
04757
04758
04759
04760
04761
04762
04763
04764
04765
04766
04767
04768 void transmat::restore_intpointst_bin (sel &selelems, sel *selother, long **selid)
04769 {
04770 long i,j,k,n,ir,ik,is,ipp;
04771 long ntm, ncompgrad;
04772 double tmp;
04773 FILE *aux;
04774 char name[FNAMELEN+20];
04775 char emsg[FNAMELEN+100];
04776
04777
04778 sprintf(name, "%s.grad.bac",Tp->hdbcont.hdbnamer);
04779 aux = fopen(name,"rb");
04780 if (aux==NULL)
04781 {
04782 sprintf(emsg, "cannot open backup file %s", name);
04783 print_err(emsg, __FILE__, __LINE__, __func__);
04784 abort();
04785 }
04786 for (i=0;i<tnip;i++){
04787 fread(&ipp, sizeof(ipp), 1, aux);
04788 fread(&ntm, sizeof(ntm), 1, aux);
04789 fread(&ncompgrad, sizeof(ncompgrad), 1, aux);
04790 if ((ipp < 0) || (ipp >= tnip))
04791 {
04792 print_err("invalid integration point number", __FILE__, __LINE__, __func__);
04793 abort();
04794 }
04795 if (ntm != Tp->ntm)
04796 {
04797 print_err("invalid number of transported matter", __FILE__, __LINE__, __func__);
04798 abort();
04799 }
04800 if (ncompgrad != ip[ipp].ncompgrad)
04801 {
04802 print_err("incompatible number of flux/grad components", __FILE__, __LINE__, __func__);
04803 abort();
04804 }
04805 for (j=0;j<Tp->ntm;j++)
04806 fread (ip[i].grad[j], sizeof(*ip[i].grad[j]),ip[i].ncompgrad, aux);
04807 }
04808
04809 sprintf(name, "%s.flux.bac",Tp->hdbcont.hdbnamer);
04810 aux = fopen(name,"rb");
04811 if (aux==NULL)
04812 {
04813 sprintf(emsg, "cannot open backup file %s", name);
04814 print_err(emsg, __FILE__, __LINE__, __func__);
04815 abort();
04816 }
04817 for (i=0;i<tnip;i++){
04818 fread(&ipp, sizeof(ipp), 1, aux);
04819 fread(&ntm, sizeof(ntm), 1, aux);
04820 fread(&ncompgrad, sizeof(ncompgrad), 1, aux);
04821 if ((ipp < 0) || (ipp >= tnip))
04822 {
04823 print_err("invalid integration point number", __FILE__, __LINE__, __func__);
04824 abort();
04825 }
04826 if (ntm != Tp->ntm)
04827 {
04828 print_err("invalid number of load cases", __FILE__, __LINE__, __func__);
04829 abort();
04830 }
04831 if (ncompgrad != ip[ipp].ncompgrad)
04832 {
04833 print_err("incompatible number of flux/grad components", __FILE__, __LINE__, __func__);
04834 abort();
04835 }
04836 for (j=0;j<Tp->ntm;j++)
04837 fread (ip[i].fluxes[j], sizeof(*ip[i].fluxes[j]),ip[i].ncompgrad, aux);
04838 }
04839
04840 sprintf(name, "%s.other.bac",Tp->hdbcont.hdbnamer);
04841 aux = fopen(name,"rb");
04842 if (aux==NULL)
04843 {
04844 sprintf(emsg, "cannot open backup file %s", name);
04845 print_err(emsg, __FILE__, __LINE__, __func__);
04846 abort();
04847 }
04848 for (i=0;i<tnip;i++){
04849 fread (&ipp, sizeof(ipp), 1, aux);
04850 fread (&n, sizeof(n), 1, aux);
04851 if ((ipp < 0) || (ipp >= tnip))
04852 {
04853 print_err("invalid integration point number", __FILE__, __LINE__, __func__);
04854 abort();
04855 }
04856 selelems.presence_id(elip[ipp], ir);
04857 for (k=0;k<n;k++)
04858 {
04859 fread (&tmp, sizeof(tmp), 1, aux);
04860 if (ir < 0)
04861 continue;
04862 if (selother[ir].presence_id(k,ik))
04863 {
04864 is = selid[ir][ik]+k-selother[ir].id1[ik];
04865 if (is >= ip[ipp].ncompeqother)
04866 print_err("invalid index for eqother restoring is required", __FILE__, __LINE__, __func__);
04867 else
04868 ip[ipp].eqother[is] = tmp;
04869 }
04870 }
04871 }
04872 fclose(aux);
04873 }
04874
04875
04876
04877
04878
04879
04880
04881
04882
04883
04884 double transmat::give_extinction_coeff (mattypet mt,long matid)
04885 {
04886 double ecoeff;
04887
04888 switch (mt){
04889 case isotransmat:{
04890 ecoeff = 0.93;
04891 break;
04892 }
04893 case damisotransmat:{
04894 ecoeff = 0.93;
04895 break;
04896 }
04897 case kunzel:{
04898
04899 break;
04900 }
04901 default:{
04902 print_err("unknown material type is required",__FILE__,__LINE__,__func__);
04903 }
04904 }
04905
04906 return ecoeff;
04907 }