00001 #include "transprint.h"
00002 #include "globalt.h"
00003 #include "globmatt.h"
00004 #include "aliast.h"
00005 #include "mathem.h"
00006 #include "onemedium.h"
00007 #include "twomedia.h"
00008 #include "threemedia.h"
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 void print_initt(long istep, char *mode, long idn1, long ide1)
00026 {
00027 char fname[FNAMELEN+30];
00028 char *path;
00029 char *name;
00030 char *suffix;
00031 long i;
00032 long sl;
00033
00034
00035 Outdt->idn1 = idn1;
00036 Outdt->ide1 = ide1;
00037 if ((Outdt->outf == NULL) && (Outdt->textout==1))
00038 {
00039 filename_decomposition(Outdt->outfn,path,name,suffix);
00040 if (Stt == NULL)
00041 {
00042 if (istep < 0)
00043 sprintf(fname, "%s%s%s", path, name, suffix);
00044 else
00045 sprintf(fname, "%s%s.%ld%s", path, name, istep+1, suffix);
00046 }
00047 else
00048 {
00049 if (istep < 0)
00050 sprintf(fname, "%s%s.%ld%s", path, name, Tp->ns+1, suffix);
00051 else
00052 sprintf(fname, "%s%s.%ld.%ld%s", path, name, istep+1, Tp->ns+1, suffix);
00053 }
00054 Outdt->outf = fopen(fname, mode);
00055 if (Outdt->outf == NULL)
00056 {
00057 fprintf(stderr, "\n\nUnable to open output text file '%s' in function print_init()\n", fname);
00058 fprintf(stderr, " (file %s, line %d)\n", __FILE__, __LINE__);
00059 abort();
00060 }
00061 fseek(Outdt->outf, 0, SEEK_END);
00062 if (ftell(Outdt->outf) == 0)
00063 Outdt->print_header(Outdt->outf);
00064
00065 delete [] path; delete [] name; delete [] suffix;
00066 }
00067
00068 if ((Outdt->gf != grftt_no) && (Outdt->outgr == NULL))
00069 {
00070 filename_decomposition(Outdt->outgrfn,path,name,suffix);
00071 if (Stt == NULL)
00072 {
00073 if (istep < 0)
00074 sprintf(fname, "%s%s%s", path, name, suffix);
00075 else
00076 sprintf(fname, "%s%s.%ld%s", path, name, istep+1, suffix);
00077 }
00078 else
00079 {
00080 if (istep < 0)
00081 sprintf(fname, "%s%s.%ld%s", path, name, Tp->ns+1, suffix);
00082 else
00083 sprintf(fname, "%s%s.%ld.%ld%s", path, name, istep+1, Tp->ns+1, suffix);
00084 }
00085 if ((Outdt->gf == grftt_gid) || (Outdt->gf == grftt_gid_sep))
00086 {
00087 sl = strlen(fname);
00088 sprintf(fname+sl, ".msh");
00089 }
00090 if(Outdt->gf != grftt_vtk)
00091 Outdt->outgr = fopen(fname, mode);
00092
00093 if (Outdt->outgr == NULL && Outdt->gf != grftt_vtk)
00094 {
00095 fprintf(stderr, "\n\nUnable to open graphics file '%s' in function print_init()\n", fname);
00096 fprintf(stderr, " (file %s, line %d)\n", __FILE__, __LINE__);
00097 abort();
00098 }
00099 switch(Outdt->gf)
00100 {
00101 case grftt_no:
00102 break;
00103 case grftt_open_dx:
00104 break;
00105 case grftt_femcad:
00106
00107 break;
00108 case grftt_gid:
00109 fseek(Outdt->outgr, 0, SEEK_END);
00110 if ((ftell(Outdt->outgr) == 0) || Adat)
00111 export_gid_mesht(Outdt->outgr, idn1, ide1);
00112 fclose(Outdt->outgr);
00113 if (Outdt->ncut > 0)
00114 {
00115 sprintf(fname+sl, "2d.msh");
00116 Outdt->outgr = fopen(fname, mode);
00117 fseek(Outdt->outgr, 0, SEEK_END);
00118 if ((ftell(Outdt->outgr) == 0) || Adat)
00119 export_gid_2dmesht(Outdt->outgr, Outdt->ncut, idn1, ide1);
00120 fclose(Outdt->outgr);
00121 }
00122 sprintf(fname+sl, ".res");
00123 Outdt->outgr = fopen(fname, mode);
00124 if (Outdt->outgr == NULL)
00125 {
00126 fprintf(stderr, "\n\nUnable to open graphics file '%s' in function print_init()\n", fname);
00127 fprintf(stderr, " (file %s, line %d)\n", __FILE__, __LINE__);
00128 abort();
00129 }
00130 fseek(Outdt->outgr, 0, SEEK_END);
00131 if (ftell(Outdt->outgr) == 0)
00132 {
00133 fprintf(Outdt->outgr, "GiD Post Results File 1.0\n");
00134 export_gid_gauss_ptt(Outdt->outgr);
00135 }
00136 if (Adat)
00137 fprintf(Outdt->outgr, "\nOnGroup adapt_step_%ld\n\n", Adat->istep+1);
00138 break;
00139 case grftt_gid_sep:
00140 fseek(Outdt->outgr, 0, SEEK_END);
00141 if ((ftell(Outdt->outgr) == 0) || Adat)
00142 export_gid_mesht(Outdt->outgr, idn1, ide1);
00143 fclose(Outdt->outgr);
00144 if (Outdt->ncut > 0)
00145 {
00146 sprintf(fname+sl, "2d.msh");
00147 Outdt->outgr = fopen(fname, mode);
00148 fseek(Outdt->outgr, 0, SEEK_END);
00149 if ((ftell(Outdt->outgr) == 0) || Adat)
00150 export_gid_2dmesht(Outdt->outgr, Outdt->ncut, idn1, ide1);
00151 fclose(Outdt->outgr);
00152 }
00153 strncpy(Outdt->outgrfngs, fname, sl);
00154 Outdt->outgrfngs[sl]=0;
00155 Outdt->outgr = NULL;
00156 Outdt->create_files_gidsp(mode);
00157 break;
00158 case grftt_vtk:
00159 break;
00160 default:
00161 fprintf(stderr, "\n\nUnknown type of graphics format is required in function print_init\n");
00162 fprintf(stderr, " (file %s, line %d)\n", __FILE__, __LINE__);
00163 }
00164 delete [] path; delete [] name; delete [] suffix;
00165 }
00166 if ((Outdt->ndiag > 0) && (Outdt->outdiagf[0] == NULL))
00167 {
00168 filename_decomposition(Outdt->outdiagfn,path,name,suffix);
00169 for (i=0; i<Outdt->ndiag; i++)
00170 {
00171 if (Stt == NULL)
00172 {
00173 if (Outdt->ndiag > 1)
00174 sprintf(fname, "%s%s.%ld%s", path, name, i+1, suffix);
00175 else
00176 sprintf(fname, "%s%s%s", path, name, suffix);
00177 }
00178 else
00179 {
00180 if (Outdt->ndiag > 1)
00181 sprintf(fname, "%s%s.%ld.%ld%s", path, name, i+1, Tp->ns+1, suffix);
00182 else
00183 sprintf(fname, "%s%s.%ld%s", path, name, Tp->ns+1, suffix);
00184 }
00185 if (Outdt->outdiagf[i] == NULL)
00186 {
00187 Outdt->outdiagf[i] = fopen(fname, mode);
00188 if (Outdt->outdiagf[i] == NULL)
00189 {
00190 fprintf(stderr, "\n\nUnable to open diagram file '%s' in function print_init()\n", fname);
00191 fprintf(stderr, " (file %s, line %d)\n", __FILE__, __LINE__);
00192 abort();
00193 }
00194 Outdt->odiag[i].print_header(Outdt->outdiagf[i]);
00195 }
00196 }
00197 delete [] path; delete [] name; delete [] suffix;
00198 }
00199
00200
00201 }
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221 void print_stept(long lcid, long istep, double lambda, double *fi)
00222 {
00223
00224 compute_req_valt (lcid);
00225 switch(Tp->tprob)
00226 {
00227 case stationary_problem:
00228 case nonlinear_stationary_problem:
00229 Outdt->print_out(Outdt->outf, lcid, istep, lambda);
00230 Outdt->print_graphics(Outdt->outgr, lcid, lambda, istep, fi);
00231 break;
00232 case nonstationary_problem:
00233 case nonlinear_nonstationary_problem:
00234 case discont_nonstat_problem:
00235 case discont_nonlin_nonstat_problem:
00236 case growing_np_problem:
00237 case growing_np_problem_nonlin:
00238 Outdt->print_newstep(Outdt->outf, lcid, istep, lambda);
00239 Outdt->print_out(Outdt->outf, lcid, istep, lambda);
00240 Outdt->print_diags(lcid, lambda, istep, fi);
00241 Outdt->print_graphics(Outdt->outgr, lcid, lambda, istep, fi);
00242 break;
00243 default:
00244 fprintf(stderr, "\n\nUnsupported problem type is required in function print_step\n");
00245 fprintf(stderr, " (file %s, line %d)\n", __FILE__, __LINE__);
00246 break;
00247 }
00248 }
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268 void print_stept_forced(long lcid, long istep, double lambda, double *fi)
00269 {
00270
00271 compute_req_valt (lcid);
00272 switch(Tp->tprob)
00273 {
00274 case stationary_problem:
00275 case nonlinear_stationary_problem:
00276 Outdt->print_out_forced(Outdt->outf, lcid, istep, lambda);
00277 Outdt->print_graphics_forced(Outdt->outgr, lcid, lambda, istep, fi);
00278 break;
00279 case nonstationary_problem:
00280 case nonlinear_nonstationary_problem:
00281 case discont_nonstat_problem:
00282 case discont_nonlin_nonstat_problem:
00283 case growing_np_problem:
00284 case growing_np_problem_nonlin:
00285 Outdt->print_newstep(Outdt->outf, lcid, istep, lambda);
00286 Outdt->print_out_forced(Outdt->outf, lcid, istep, lambda);
00287 Outdt->print_diags_forced(lcid, lambda, istep, fi);
00288 Outdt->print_graphics_forced(Outdt->outgr, lcid, lambda, istep, fi);
00289 break;
00290 default:
00291 fprintf(stderr, "\n\nUnsupported problem type is required in function print_step\n");
00292 fprintf(stderr, " (file %s, line %d)\n", __FILE__, __LINE__);
00293 break;
00294 }
00295 }
00296
00297
00298
00299 void print_flusht()
00300 {
00301 long i;
00302 if (Outdt->outf)
00303 fflush(Outdt->outf);
00304 if (Outdt->outgr)
00305 fflush(Outdt->outgr);
00306 for (i=0; i<Outdt->ndiag; i++)
00307 {
00308 if (Outdt->outdiagf[i])
00309 fflush(Outdt->outdiagf[i]);
00310 }
00311 }
00312
00313
00314
00315 void print_closet()
00316 {
00317 long i;
00318 if (Outdt->outf)
00319 fclose(Outdt->outf);
00320 Outdt->outf = NULL;
00321 if (Outdt->outgr)
00322 {
00323 if (Adat)
00324 fprintf(Outdt->outgr, "\nEnd OnGroup\n\n");
00325 fclose(Outdt->outgr);
00326 }
00327 Outdt->outgr = NULL;
00328 if ((Outdt->gf == grftt_gid_sep) && Adat)
00329 Outdt->close_files_gidsp();
00330
00331 for (i=0; i<Outdt->ndiag; i++)
00332 {
00333 if (Outdt->outdiagf[i])
00334 fclose(Outdt->outdiagf[i]);
00335 Outdt->outdiagf[i] = NULL;
00336 }
00337 }
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351 void export_gid_mesht(FILE *out, long idn1, long ide1)
00352 {
00353 long i, print_header, print_coord = 1;
00354
00355 if (Adat)
00356 fprintf(out, "Group adapt_step_%ld\n", Adat->istep+1);
00357
00358 print_header = 1;
00359 for (i=0; i < Tt->ne; i++)
00360 {
00361 switch(Tt->elements[i].te)
00362 {
00363 case barlintax:
00364 case barlint:
00365 if (print_header)
00366 {
00367 fprintf(out, "MESH beams2 dimension 3 Elemtype Linear Nnode 2\n");
00368
00369 }
00370 if (print_coord)
00371 {
00372 write_gid_nodest(out, idn1);
00373 print_coord = 0;
00374 }
00375 if (print_header == 1)
00376 fprintf(out, "Elements\n");
00377 write_gid_elementt(out, i, idn1, ide1);
00378 print_header = 0;
00379 break;
00380 default:
00381 break;
00382 }
00383 }
00384 if (print_header == 0)
00385 fprintf(out, "end Elements\n");
00386
00387
00388 print_header = 1;
00389 for (i=0; i < Tt->ne; i++)
00390 {
00391 switch(Tt->elements[i].te)
00392 {
00393 case barquadt:
00394 case barquadtax:
00395 if (print_header)
00396 {
00397 fprintf(out, "MESH beams3 dimension 3 Elemtype Linear Nnode 3\n");
00398
00399 }
00400 if (print_coord)
00401 {
00402 write_gid_nodest(out, idn1);
00403 print_coord = 0;
00404 }
00405 if (print_header == 1)
00406 fprintf(out, "Elements\n");
00407 write_gid_elementt(out, i, idn1, ide1);
00408 print_header = 0;
00409 break;
00410 default:
00411 break;
00412 }
00413 }
00414 if (print_header == 0)
00415 fprintf(out, "end Elements\n");
00416
00417
00418 print_header = 1;
00419 for (i=0; i < Tt->ne; i++)
00420 {
00421 switch(Tt->elements[i].te)
00422 {
00423 case trlint:
00424 case trlaxisym:
00425 if (print_header)
00426 {
00427 fprintf(out, "MESH trias3 dimension 3 Elemtype Triangle Nnode 3\n");
00428
00429 }
00430 if (print_coord)
00431 {
00432 write_gid_nodest(out, idn1);
00433 print_coord = 0;
00434 }
00435 if (print_header == 1)
00436 fprintf(out, "Elements\n");
00437 write_gid_elementt(out, i, idn1, ide1);
00438 print_header = 0;
00439 break;
00440 default:
00441 break;
00442 }
00443 }
00444 if (print_header == 0)
00445 fprintf(out, "end Elements\n");
00446
00447
00448 print_header = 1;
00449 for (i=0; i < Tt->ne; i++)
00450 {
00451 switch(Tt->elements[i].te)
00452 {
00453 case trquadt:
00454 case trqaxisym:
00455 if (print_header)
00456 {
00457 fprintf(out, "MESH trias6 dimension 3 Elemtype Triangle Nnode 6\n");
00458
00459 }
00460 if (print_coord)
00461 {
00462 write_gid_nodest(out, idn1);
00463 print_coord = 0;
00464 }
00465 if (print_header == 1)
00466 fprintf(out, "Elements\n");
00467 write_gid_elementt(out, i, idn1, ide1);
00468 print_header = 0;
00469 break;
00470 default:
00471 break;
00472 }
00473 }
00474 if (print_header == 0)
00475 fprintf(out, "end Elements\n");
00476
00477
00478 print_header = 1;
00479 for (i=0; i < Tt->ne; i++)
00480 {
00481 switch(Tt->elements[i].te)
00482 {
00483 case quadlint:
00484 case quadlaxisym:
00485 if (print_header)
00486 {
00487 fprintf(out, "MESH Quads4 dimension 3 Elemtype Quadrilateral Nnode 4\n");
00488
00489 }
00490 if (print_coord)
00491 {
00492 write_gid_nodest(out, idn1);
00493 print_coord = 0;
00494 }
00495 if (print_header == 1)
00496 fprintf(out, "Elements\n");
00497 write_gid_elementt(out, i, idn1, ide1);
00498 print_header = 0;
00499 break;
00500 default:
00501 break;
00502 }
00503 }
00504 if (print_header == 0)
00505 fprintf(out, "end Elements\n");
00506
00507
00508 print_header = 1;
00509 for (i=0; i < Tt->ne; i++)
00510 {
00511 switch(Tt->elements[i].te)
00512 {
00513 case quadquadtax:
00514 case quadquadt:
00515 if (print_header)
00516 {
00517 fprintf(out, "MESH Quads8 dimension 3 Elemtype Quadrilateral Nnode 8\n");
00518
00519 }
00520 if (print_coord)
00521 {
00522 write_gid_nodest(out, idn1);
00523 print_coord = 0;
00524 }
00525 if (print_header == 1)
00526 fprintf(out, "Elements\n");
00527 write_gid_elementt(out, i, idn1, ide1);
00528 print_header = 0;
00529 break;
00530 default:
00531 break;
00532 }
00533 }
00534 if (print_header == 0)
00535 fprintf(out, "end Elements\n");
00536
00537
00538 print_header = 1;
00539 for (i=0; i < Tt->ne; i++)
00540 {
00541 switch(Tt->elements[i].te)
00542 {
00543 case lineartett:
00544 if (print_header)
00545 {
00546 fprintf(out, "MESH Tetras4 dimension 3 Elemtype Tetrahedra Nnode 4\n");
00547
00548 }
00549 if (print_coord)
00550 {
00551 write_gid_nodest(out, idn1);
00552 print_coord = 0;
00553 }
00554 if (print_header == 1)
00555 fprintf(out, "Elements\n");
00556 write_gid_elementt(out, i, idn1, ide1);
00557 print_header = 0;
00558 break;
00559 default:
00560 break;
00561 }
00562 }
00563 if (print_header == 0)
00564 fprintf(out, "end Elements\n");
00565
00566
00567 print_header = 1;
00568 for (i=0; i < Tt->ne; i++)
00569 {
00570 switch(Tt->elements[i].te)
00571 {
00572 case linearhext:
00573 if (print_header)
00574 {
00575 fprintf(out, "MESH Brick8 dimension 3 Elemtype Hexahedra Nnode 8\n");
00576
00577 }
00578 if (print_coord)
00579 {
00580 write_gid_nodest(out, idn1);
00581 print_coord = 0;
00582 }
00583 if (print_header == 1)
00584 fprintf(out, "Elements\n");
00585 write_gid_elementt(out, i, idn1, ide1);
00586 print_header = 0;
00587 break;
00588 default:
00589 break;
00590 }
00591 }
00592 if (print_header == 0)
00593 fprintf(out, "end Elements\n");
00594
00595
00596 print_header = 1;
00597 for (i=0; i < Tt->ne; i++)
00598 {
00599 switch(Tt->elements[i].te)
00600 {
00601 case quadratichext:
00602 if (print_header)
00603 {
00604 fprintf(out, "MESH Brick20 dimension 3 Elemtype Hexahedra Nnode 20\n");
00605
00606 }
00607 if (print_coord)
00608 {
00609 write_gid_nodest(out, idn1);
00610 print_coord = 0;
00611 }
00612 if (print_header == 1)
00613 fprintf(out, "Elements\n");
00614 write_gid_elementt(out, i, idn1, ide1);
00615 print_header = 0;
00616 break;
00617 default:
00618 break;
00619 }
00620 }
00621 if (print_header == 0)
00622 fprintf(out, "end Elements\n");
00623
00624 if (Adat)
00625 fprintf(out, "End Group\n\n\n");
00626 }
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641 void export_gid_2dmesht(FILE *out, long icut, long idn1, long ide1)
00642 {
00643 long i, print_header, print_coord = 1;
00644 long range = Tt->ne/icut;
00645
00646 if (Adat)
00647 fprintf(out, "Group adapt_step_%ld\n", Adat->istep+1);
00648
00649 print_header = 1;
00650 for (i=0; i < Tt->ne; i++)
00651 {
00652 switch(Tt->elements[i].te)
00653 {
00654 case linearhext:
00655 if (print_header)
00656 {
00657 fprintf(out, "MESH Quads4 dimension 3 Elemtype Quadrilateral Nnode 4\n");
00658
00659 }
00660 if (print_coord)
00661 {
00662 write_gid_nodest(out, idn1);
00663 print_coord = 0;
00664 }
00665 if (print_header == 1)
00666 fprintf(out, "Elements\n");
00667 write_gid_2delementt(out, i, 0, 4, i/range, 0, idn1, ide1);
00668 print_header = 0;
00669 break;
00670 default:
00671 break;
00672 }
00673 }
00674 for (i=Tt->ne-range; i < Tt->ne; i++)
00675 {
00676 write_gid_2delementt(out, i, 4, 8, icut, range, idn1, ide1);
00677 }
00678 if (print_header == 0)
00679 fprintf(out, "end Elements\n");
00680
00681 if (Adat)
00682 fprintf(out, "End Group\n\n\n");
00683 }
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696 void export_gid_gauss_ptt(FILE *out)
00697 {
00698 long i, j, k, ii, jj, brk,ngp;
00699 vector gp1, gp2, gp3, gp, w;
00700
00701 ii = 0;
00702 jj = 0;
00703
00704
00705 brk = 0;
00706 for (i=0; i < Tt->ne; i++)
00707 {
00708 if (Gtt->leso[i]==0)
00709 continue;
00710
00711 switch(Tt->elements[i].te)
00712 {
00713 case barlint:
00714 case barlintax :
00715 fprintf(out, "GaussPoints \"Lin_1D\" Elemtype Linear\n");
00716 fprintf(out, "Number Of Gauss Points: 2\n");
00717 fprintf(out, "Nodes included\n");
00718 fprintf(out, "Natural coordinates: internal\n");
00719 fprintf(out, "end GaussPoints\n\n");
00720 brk = 1;
00721 break;
00722 default:
00723 break;
00724 }
00725 if (brk)
00726 break;
00727 }
00728
00729
00730 brk = 0;
00731 for (i=0; i < Tt->ne; i++)
00732 {
00733 if (Gtt->leso[i]==0)
00734 continue;
00735
00736 switch(Tt->elements[i].te)
00737 {
00738 case barquadt :
00739 case barquadtax :
00740 fprintf(out, "GaussPoints \"Quad_1D\" Elemtype Linear\n");
00741 fprintf(out, "Number Of Gauss Points: 3\n");
00742 fprintf(out, "Nodes not included\n");
00743 fprintf(out, "Natural coordinates: internal\n");
00744 fprintf(out, "end GaussPoints\n\n");
00745 brk = 1;
00746 break;
00747 default:
00748 break;
00749 }
00750 if (brk)
00751 break;
00752 }
00753
00754
00755 for (i=0; i < Tt->ne; i++)
00756 {
00757 if (Gtt->leso[i]==0)
00758 continue;
00759
00760 if (Tt->elements[i].te == trlint)
00761 {
00762 fprintf(out, "GaussPoints \"%d\" Elemtype Triangle\n", trlint);
00763 ngp=1;
00764 fprintf(out, "Number Of Gauss Points: %ld\n",ngp);
00765 fprintf(out, "Nodes not included\n");
00766 fprintf(out, "Natural coordinates: given\n");
00767
00768 if (Ltt->intordkm[ii][jj]!=0){
00769 allocv (Ltt->intordkm[ii][jj],w);
00770 allocv (Ltt->intordkm[ii][jj],gp1);
00771 allocv (Ltt->intordkm[ii][jj],gp2);
00772 gauss_points_tr (gp1.a,gp2.a,w.a,Ltt->intordkm[ii][jj]);
00773 for (i=0;i<Ltt->intordkm[ii][jj];i++)
00774 fprintf(out, "%le %le\n", gp1[i], gp2[i]);
00775 destrv(gp1); destrv(gp2); destrv(w);
00776 }
00777 fprintf(out, "end GaussPoints\n\n");
00778 break;
00779 }
00780 }
00781
00782
00783
00784 for (i=0; i < Tt->ne; i++)
00785 {
00786 if (Gtt->leso[i]==0)
00787 continue;
00788
00789 if (Tt->elements[i].te == trlaxisym)
00790 {
00791 fprintf(out, "GaussPoints \"%d\" Elemtype Triangle\n", trlaxisym);
00792 ngp=1;
00793 fprintf(out, "Number Of Gauss Points: %ld\n",ngp);
00794 fprintf(out, "Nodes not included\n");
00795 fprintf(out, "Natural coordinates: given\n");
00796
00797 if (Ltat->intordkm[ii][jj]!=0){
00798 allocv (Ltat->intordkm[ii][jj],w);
00799 allocv (Ltat->intordkm[ii][jj],gp1);
00800 allocv (Ltat->intordkm[ii][jj],gp2);
00801 gauss_points_tr (gp1.a,gp2.a,w.a,Ltat->intordkm[ii][jj]);
00802 for (i=0;i<Ltat->intordkm[ii][jj];i++)
00803 fprintf(out, "%le %le\n", gp1[i], gp2[i]);
00804 destrv(gp1); destrv(gp2); destrv(w);
00805 }
00806 fprintf(out, "end GaussPoints\n\n");
00807 break;
00808 }
00809 }
00810
00811
00812
00813 for (i=0; i < Tt->ne; i++)
00814 {
00815 if (Gtt->leso[i]==0)
00816 continue;
00817
00818 if (Tt->elements[i].te == quadlint)
00819 {
00820 fprintf(out, "GaussPoints \"%d\" Elemtype Quadrilateral\n", quadlint);
00821 ngp=4;
00822 fprintf(out, "Number Of Gauss Points: %ld\n",ngp);
00823 fprintf(out, "Nodes not included\n");
00824 fprintf(out, "Natural coordinates: given\n");
00825
00826 if (Lqt->intordkm[ii][jj]!=0) {
00827 allocv (Lqt->intordkm[ii][jj],w);
00828 allocv (Lqt->intordkm[ii][jj],gp);
00829 gauss_points (gp.a,w.a,Lqt->intordkm[ii][jj]);
00830 for (i=0;i<Lqt->intordkm[ii][jj];i++)
00831 for (j=0; j<Lqt->intordkm[ii][jj]; j++)
00832 fprintf(out, "%le %le\n", gp[i], gp[j]);
00833 destrv(gp); destrv(w);
00834 }
00835 fprintf(out, "end GaussPoints\n\n");
00836 break;
00837 }
00838 }
00839
00840
00841
00842 for (i=0; i < Tt->ne; i++)
00843 {
00844 if (Gtt->leso[i]==0)
00845 continue;
00846
00847 if (Tt->elements[i].te == quadquadt)
00848 {
00849 fprintf(out, "GaussPoints \"%d\" Elemtype Quadrilateral\n", quadquadt);
00850 ngp=9;
00851 fprintf(out, "Number Of Gauss Points: %ld\n",ngp);
00852 fprintf(out, "Nodes not included\n");
00853 fprintf(out, "Natural coordinates: given\n");
00854
00855 if (Qqt->intordkm[ii][jj]!=0){
00856 allocv (Qqt->intordkm[ii][jj],w);
00857 allocv (Qqt->intordkm[ii][jj],gp);
00858 gauss_points (gp.a,w.a,Qqt->intordkm[ii][jj]);
00859 for (i=0;i<Qqt->intordkm[ii][jj];i++)
00860 for (j=0; j<Qqt->intordkm[ii][jj]; j++)
00861 fprintf(out, "%le %le\n", gp[i], gp[j]);
00862 destrv(gp); destrv(w);
00863 }
00864 fprintf(out, "end GaussPoints\n\n");
00865 break;
00866 }
00867 }
00868
00869
00870
00871 for (i=0; i < Tt->ne; i++)
00872 {
00873 if (Gtt->leso[i]==0)
00874 continue;
00875
00876 if (Tt->elements[i].te == quadlaxisym)
00877 {
00878 fprintf(out, "GaussPoints \"%d\" Elemtype Quadrilateral\n", quadlaxisym);
00879 ngp=4;
00880 fprintf(out, "Number Of Gauss Points: %ld\n",ngp);
00881 fprintf(out, "Nodes not included\n");
00882 fprintf(out, "Natural coordinates: given\n");
00883
00884 if (Lqat->intordkm[ii][jj]!=0){
00885 allocv (Lqat->intordkm[ii][jj],w);
00886 allocv (Lqat->intordkm[ii][jj],gp);
00887 gauss_points (gp.a,w.a,Lqat->intordkm[ii][jj]);
00888 for (i=0;i<Lqat->intordkm[ii][jj];i++)
00889 for (j=0; j<Lqat->intordkm[ii][jj]; j++)
00890 fprintf(out, "%le %le\n", gp[i], gp[j]);
00891 destrv(gp); destrv(w);
00892 }
00893 fprintf(out, "end GaussPoints\n\n");
00894 break;
00895 }
00896 }
00897
00898
00899
00900 for (i=0; i < Tt->ne; i++)
00901 {
00902 if (Gtt->leso[i]==0)
00903 continue;
00904
00905 if (Tt->elements[i].te == quadquadtax)
00906 {
00907 fprintf(out, "GaussPoints \"%d\" Elemtype Quadrilateral\n", quadquadtax);
00908 ngp=9;
00909 fprintf(out, "Number Of Gauss Points: %ld\n",ngp);
00910 fprintf(out, "Nodes not included\n");
00911 fprintf(out, "Natural coordinates: given\n");
00912
00913 if (Qqat->intordkm[ii][jj]!=0) {
00914 allocv (Qqat->intordkm[ii][jj],w);
00915 allocv (Qqat->intordkm[ii][jj],gp);
00916 gauss_points (gp.a,w.a,Qqat->intordkm[ii][jj]);
00917 for (i=0;i<Qqat->intordkm[ii][jj];i++)
00918 for (j=0; j<Qqat->intordkm[ii][jj]; j++)
00919 fprintf(out, "%le %le\n", gp[i], gp[j]);
00920 destrv(gp); destrv(w);
00921 }
00922 fprintf(out, "end GaussPoints\n\n");
00923 break;
00924 }
00925 }
00926
00927
00928 for (i=0; i < Tt->ne; i++)
00929 {
00930 if (Gtt->leso[i]==0)
00931 continue;
00932
00933 if (Tt->elements[i].te == lineartett)
00934 {
00935 fprintf(out, "GaussPoints \"%d\" Elemtype TetraHedra\n", lineartett);
00936 ngp=1;
00937 fprintf(out, "Number Of Gauss Points: %ld\n",ngp);
00938 fprintf(out, "Nodes not included\n");
00939 fprintf(out, "Natural coordinates: given\n");
00940
00941 if (Ltett->intordkm[ii][jj]!=0) {
00942 allocv (Ltett->intordkm[ii][jj],w);
00943 allocv (Ltett->intordkm[ii][jj],gp1);
00944 allocv (Ltett->intordkm[ii][jj],gp2);
00945 allocv (Ltett->intordkm[ii][jj],gp3);
00946 gauss_points_tet (gp1.a,gp2.a,gp3.a,w.a,Ltett->intordkm[ii][jj]);
00947 for (i=0;i<Ltett->intordkm[ii][jj];i++)
00948 fprintf(out, "%le %le %le\n", gp1[i], gp2[i], gp3[i]);
00949 destrv(gp1); destrv(gp2); destrv(gp3); destrv(w);
00950 }
00951 fprintf(out, "end GaussPoints\n\n");
00952 break;
00953 }
00954 }
00955
00956
00957 for (i=0; i < Tt->ne; i++)
00958 {
00959 if (Gtt->leso[i]==0)
00960 continue;
00961
00962 if (Tt->elements[i].te == linearhext)
00963 {
00964 fprintf(out, "GaussPoints \"%d\" Elemtype Hexahedra\n", linearhext);
00965 ngp=8;
00966 fprintf(out, "Number Of Gauss Points: %ld\n",ngp);
00967 fprintf(out, "Nodes not included\n");
00968 fprintf(out, "Natural coordinates: given\n");
00969
00970 if (Lht->intordkm[ii][jj]!=0) {
00971 allocv (Lht->intordkm[ii][jj],w);
00972 allocv (Lht->intordkm[ii][jj],gp);
00973 gauss_points(gp.a,w.a,Lht->intordkm[ii][jj]);
00974 for (i=0;i<Lht->intordkm[ii][jj];i++)
00975 {
00976 for (j=0;j<Lht->intordkm[ii][jj];j++)
00977 {
00978 for (k=0;k<Lht->intordkm[ii][jj];k++)
00979 fprintf(out, "%le %le %le\n", -gp[i], -gp[j], -gp[k]);
00980 }
00981 }
00982 destrv(gp); destrv(w);
00983 }
00984 fprintf(out, "end GaussPoints\n\n");
00985 break;
00986 }
00987 }
00988
00989
00990 for (i=0; i < Tt->ne; i++)
00991 {
00992 if (Gtt->leso[i]==0)
00993 continue;
00994
00995 if (Tt->elements[i].te == quadratichext)
00996 {
00997 fprintf(out, "GaussPoints \"%d\" Elemtype Hexahedra\n", quadratichext);
00998 ngp=27;
00999 fprintf(out, "Number Of Gauss Points: %ld\n",ngp);
01000 fprintf(out, "Nodes not included\n");
01001 fprintf(out, "Natural coordinates: given\n");
01002
01003 if (Qht->intordkm[0][0]!=0){
01004
01005 allocv (Qht->intordkm[0][0],w);
01006 allocv (Qht->intordkm[0][0],gp);
01007 gauss_points(gp.a,w.a,Qht->intordkm[0][0]);
01008 for (i=0;i<Qht->intordkm[0][0];i++)
01009 {
01010 for (j=0;j<Qht->intordkm[0][0];j++)
01011 {
01012 for (k=0;k<Qht->intordkm[0][0];k++)
01013 fprintf(out, "%le %le %le\n", -gp[i], -gp[j], -gp[k]);
01014 }
01015 }
01016 destrv(gp); destrv(w);
01017 }
01018 fprintf(out, "end GaussPoints\n\n");
01019 break;
01020 }
01021 }
01022
01023 }
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038 void write_gid_nodest(FILE *out, long idn1)
01039 {
01040 long i;
01041 fprintf(out, "Coordinates\n");
01042 for (i=0; i<Tt->nn; i++)
01043 fprintf(out, "%ld %e %e %e\n", i+idn1, Gtt->gnodes[i].x, Gtt->gnodes[i].y, Gtt->gnodes[i].z);
01044 fprintf(out, "end Coordinates\n");
01045 }
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059 void write_gid_elementt(FILE *out, long i, long idn1, long ide1)
01060 {
01061 long j;
01062 fprintf(out, "%ld ", i+ide1);
01063 for (j=0; j<Gtt->gelements[i].give_nne(); j++)
01064 fprintf(out, "%ld ", Gtt->gelements[i].nodes[j]+idn1);
01065 fprintf(out, "%ld\n", Tt->elements[i].idm[0]+1);
01066 }
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085
01086 void write_gid_2delementt(FILE *out, long i, long id1, long nne, long icut, long di, long idn1, long ide1)
01087 {
01088 long j;
01089 fprintf(out, "%ld ", i+ide1+di);
01090 for (j=id1; j<nne; j++)
01091 fprintf(out, "%ld ", Gtt->gelements[i].nodes[j]+idn1);
01092 fprintf(out, "%ld%ld\n", icut+1, Tt->elements[i].idm[0]+1);
01093 }
01094
01095 void write_gid_unkn(FILE *out, long lcid, char *desclcid)
01096 {
01097 long i, j;
01098 double r;
01099
01100 for (i=0; i < Tp->ntm; i++)
01101 {
01102 fprintf(out, "\nResult \"%ld-%s\" \"%ld\" %s Scalar OnNodes\n", i+1,
01103 namevartstr[int(Tp->dofname[i])-1].alias, lcid, desclcid);
01104 fprintf(out, "Values\n");
01105
01106 for (j=0; j < Tt->nn; j++)
01107 {
01108 r = nodalval (lcid, j, i);
01109 fprintf(out, "%ld % e\n", j+Outdt->idn1, r);
01110 }
01111 fprintf(out, "End Values\n");
01112 }
01113 }
01114
01115
01116 void write_gid_nodvectort(FILE *out, strastret scal, long lcid, long unkn, char *desclcid)
01117 {
01118 long i, j;
01119 char *sig = "";
01120 char *unknown = "";
01121
01122 if (scal == grad)
01123 sig = "gradients";
01124 if (scal == flux)
01125 sig = "fluxes";
01126
01127 switch (unkn)
01128 {
01129 case 0:
01130 unknown = "1st";
01131 break;
01132 case 1:
01133 unknown = "2nd";
01134 break;
01135 case 2:
01136 unknown = "3rd";
01137 break;
01138 default :
01139 fprintf(stderr, "\n\n Error - unknown unknown of gradient/flux");
01140 fprintf(stderr, "\n in function write_gid_nodvectort, file %s, line %d\n", __FILE__, __LINE__);
01141 }
01142
01143 switch (Tt->nodes[0].ncompgrad){
01144 case 1:{
01145 fprintf(out, "\nResult \"%s\" \"%s\" \"%ld\" %s Vector OnNodes\n",sig,unknown,lcid, desclcid);
01146 fprintf(out, "ComponentNames \"x\"\nValues\n");
01147 break;
01148 }
01149 case 2:{
01150 fprintf(out, "\nResult \"%s\" \"%s\" \"%ld\" %s Vector OnNodes\n",sig,unknown,lcid, desclcid);
01151 fprintf(out, "ComponentNames \"x\" \"y\"\nValues\n");
01152 break;
01153 }
01154 case 3:{
01155 fprintf(out, "\nResult \"%s\" \"%s\" \"%ld\" %s Vector OnNodes\n",sig,unknown,lcid, desclcid);
01156 fprintf(out, "ComponentNames \"x\" \"y\" \"z\"\nValues\n");
01157 break;
01158 }
01159 default:{
01160 fprintf (stderr,"\n Error - unknown direction is required in function (%s, line %d).\n",__FILE__,__LINE__);
01161 }
01162 }
01163
01164
01165 if (scal == grad){
01166 for (i=0; i < Tt->nn; i++)
01167 {
01168 fprintf(out, "%ld", i+Outdt->idn1);
01169
01170 for (j = 0; j < Tt->nodes[i].ncompgrad; j++)
01171 fprintf(out, " % e",Tt->nodes[i].gradient[unkn][j]);
01172
01173 fprintf(out, "\n");
01174 }
01175 fprintf(out, "End Values\n");
01176 }
01177
01178 if (scal == flux){
01179 for (i=0; i < Tt->nn; i++)
01180 {
01181 fprintf(out, "%ld", i+Outdt->idn1);
01182
01183 for (j = 0; j < Tt->nodes[i].ncompgrad; j++)
01184 fprintf(out, " % e",Tt->nodes[i].flux[unkn][j]);
01185
01186 fprintf(out, "\n");
01187 }
01188 fprintf(out, "End Values\n");
01189 }
01190 }
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210 void write_gid_nforcest(FILE *out, long lcid, const char *desclcid, double *ifor)
01211 {
01212 long i, j, ii;
01213 double f;
01214
01215 for (i=0; i < Tp->ntm; i++)
01216 {
01217 fprintf(out, "\nResult \"Fluxes %ld-%s\" \"%ld\" %s Scalar OnNodes\n", i+1,
01218 namevartstr[int(Tp->dofname[i])-1].alias, lcid, desclcid);
01219 fprintf(out, "Values\n");
01220
01221 for (j=0; j < Tt->nn; j++)
01222 {
01223 ii=Tt->give_dof(j,i);
01224 if (ii<0) f=0.0;
01225 if (ii==0) f=0.0;
01226 if (ii>0) f=ifor[ii-1];
01227 fprintf(out, "%ld % e\n", j+Outdt->idn1, f);
01228 }
01229 fprintf(out, "End Values\n");
01230 }
01231 }
01232
01233
01234
01235 void write_gid_nodscalart(FILE *out, strastret scal, long lcid, long dir, char *desclcid)
01236 {
01237 char *sig = "";
01238 long i, ncompother, ncompeqother;
01239
01240 switch (scal)
01241 {
01242 case othert :
01243 {
01244 fprintf(out, "\nResult \"other_n_%ld - ", dir+1);
01245 Tm->give_othervalue_name(out,0,dir);
01246 fprintf(out, "\" \"%ld\" %s Scalar OnNodes\n", lcid, desclcid);
01247 }
01248 break;
01249 case eqothert :
01250 {
01251 fprintf(out, "\nResult \"eqother_n_%ld - ", dir+1);
01252 Tm->give_eqothervalue_name(out,0,dir);
01253 fprintf(out, "\" \"%ld\" %s Scalar OnNodes\n", lcid, desclcid);
01254 }
01255 break;
01256 default :
01257 fprintf(out, "\nResult \"%s\" \"%ld\" %s Scalar OnNodes\n", sig, lcid, desclcid);
01258 }
01259 fprintf(out, "Values\n");
01260
01261
01262 switch (scal)
01263 {
01264 case othert :
01265 for (i = 0; i < Tt->nn; i++)
01266 {
01267 ncompother = Tt->nodes[i].ncompother;
01268 fprintf(out, "%ld % e\n", i+Outdt->idn1, Tt->nodes[i].other[ncompother*lcid+dir]);
01269 }
01270 break;
01271 case eqothert :
01272 for (i = 0; i < Tt->nn; i++)
01273 {
01274 ncompeqother = Tt->nodes[i].ncompeqother;
01275 fprintf(out, "%ld % e\n", i+Outdt->idn1, Tt->nodes[i].eqother[ncompeqother*lcid+dir]);
01276 }
01277 break;
01278 default :
01279 fprintf(stderr, "\n\n Error - unknown value type in function write_gid_nodscalart()\n");
01280 fprintf(stderr, " in file %s, line %d\n", __FILE__, __LINE__);
01281 }
01282 fprintf(out, "End Values\n");
01283 }
01284
01285
01286
01287
01288
01289
01290
01291
01292
01293
01294
01295
01296
01297
01298
01299
01300
01301 void write_gid_elemscalart(FILE *out, strastret scal, long lcid, long dir, const char *desclcid)
01302 {
01303 if (Lbt)
01304 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, barlint);
01305 if (Lbat)
01306 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, barlintax);
01307 if (Qbt)
01308 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, barquadt);
01309 if (Qbat)
01310 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, barquadtax);
01311 if (Ltt)
01312 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, trlint);
01313 if (Ltat)
01314 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, trlaxisym);
01315 if (Lqt)
01316 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, quadlint);
01317 if (Lqat)
01318 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, quadlaxisym);
01319 if (Qqt)
01320 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, quadquadt);
01321 if (Qqat)
01322 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, quadquadtax);
01323 if (Ltett)
01324 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, lineartett);
01325 if (Lht)
01326 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, linearhext);
01327 if (Qht)
01328 write_gid_elem_type_scalart(out, scal, lcid, dir, desclcid, quadratichext);
01329 }
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349 void write_gid_elem_type_scalart(FILE *out, strastret scal, long lcid, long dir, const char *desclcid, elemtypet te)
01350 {
01351 char *sig = "";
01352 char gpname[1000];
01353 long i, j, tnip, ipp,ncompother,ncompeqother;
01354 long print_header = 1;
01355
01356
01357 for (i = 0; i < Tt->ne; i++)
01358 {
01359 if (Gtt->leso[i]==0)
01360 continue;
01361
01362
01363
01364 if (Tt->elements[i].te != te)
01365 continue;
01366
01367
01368 if ((scal == grad) && (Outdt->eog.selegrad.presence_id(Outdt->eog.selgrad, i, dir) == 0))
01369 continue;
01370 if ((scal == flux) && (Outdt->eog.seleflux.presence_id(Outdt->eog.selflux, i, dir) == 0))
01371 continue;
01372 if ((scal == othert) && (Outdt->eog.seleoth.presence_id(Outdt->eog.seloth, i, dir) == 0))
01373 continue;
01374 if ((scal == eqothert) && (Outdt->eog.seleeqoth.presence_id(Outdt->eog.seleqoth, i, dir) == 0))
01375 continue;
01376
01377 if (print_header)
01378 {
01379 ipp = Tt->elements[i].ipp[0][0];
01380 if (scal == flux)
01381 {
01382 switch (te)
01383 {
01384 case barlintax:
01385 case barlint:
01386 case barquadt:
01387 case barquadtax:
01388 switch (dir)
01389 {
01390 case 0:
01391 if(lcid==0)
01392 sig = "flux_e_1_x";
01393 if(lcid==1)
01394 sig = "flux_e_2_x";
01395 if(lcid==2)
01396 sig = "flux_e_3_x";
01397 if(lcid==3)
01398 sig = "flux_e_4_x";
01399 break;
01400 default :
01401 fprintf(stderr, "\n\n Error - unknown direction of flux");
01402 fprintf(stderr, "\n in function write_gid_elemscalart, file %s, line %d\n", __FILE__, __LINE__);
01403 }
01404 break;
01405 case trlint:
01406 case trlaxisym:
01407 case trquadt:
01408 case trqaxisym:
01409 case quadlint:
01410 case quadlaxisym:
01411 case quadquadtax:
01412 case quadquadt:
01413 switch (dir)
01414 {
01415 case 0:
01416 if(lcid==0)
01417 sig = "flux_e_1_x";
01418 if(lcid==1)
01419 sig = "flux_e_2_x";
01420 if(lcid==2)
01421 sig = "flux_e_3_x";
01422 if(lcid==3)
01423 sig = "flux_e_4_x";
01424 break;
01425 case 1:
01426 if(lcid==0)
01427 sig = "flux_e_1_y";
01428 if(lcid==1)
01429 sig = "flux_e_2_y";
01430 if(lcid==2)
01431 sig = "flux_e_3_y";
01432 if(lcid==3)
01433 sig = "flux_e_4_y";
01434 break;
01435 default :
01436 fprintf(stderr, "\n\n Error - unknown direction of flux");
01437 fprintf(stderr, "\n in function write_gid_elemscalart, file %s, line %d\n", __FILE__, __LINE__);
01438 }
01439 break;
01440 case lineartett:
01441 case linearhext:
01442 case quadratichext:
01443 switch (dir)
01444 {
01445 case 0:
01446 if(lcid==0)
01447 sig = "flux_e_1_x";
01448 if(lcid==1)
01449 sig = "flux_e_2_x";
01450 if(lcid==2)
01451 sig = "flux_e_3_x";
01452 if(lcid==3)
01453 sig = "flux_e_4_x";
01454 break;
01455 case 1:
01456 if(lcid==0)
01457 sig = "flux_e_1_y";
01458 if(lcid==1)
01459 sig = "flux_e_2_y";
01460 if(lcid==2)
01461 sig = "flux_e_3_y";
01462 if(lcid==3)
01463 sig = "flux_e_4_y";
01464 break;
01465 case 2:
01466 if(lcid==0)
01467 sig = "flux_e_1_z";
01468 if(lcid==1)
01469 sig = "flux_e_2_z";
01470 if(lcid==2)
01471 sig = "flux_e_3_z";
01472 if(lcid==3)
01473 sig = "flux_e_4_z";
01474 break;
01475 default :
01476 fprintf(stderr, "\n\n Error - unknown direction of flux");
01477 fprintf(stderr, "\n in function write_gid_elemscalart, file %s, line %d\n", __FILE__, __LINE__);
01478 }
01479 break;
01480 default:
01481 fprintf(stderr, "\n\n Error - unknown flux/grad state is required");
01482 fprintf(stderr, "\n in function write_gid_elemscalart, file %s, line %d\n", __FILE__, __LINE__);
01483 }
01484 }
01485
01486 if (scal == grad)
01487 {
01488 switch (te)
01489 {
01490 case barlintax:
01491 case barlint:
01492 case barquadt:
01493 case barquadtax:
01494 switch (dir)
01495 {
01496 case 0:
01497 if(lcid==0)
01498 sig = "grad_e_1_x";
01499 if(lcid==1)
01500 sig = "grad_e_2_x";
01501 if(lcid==2)
01502 sig = "grad_e_3_x";
01503 if(lcid==3)
01504 sig = "grad_e_4_x";
01505 break;
01506 default :
01507 fprintf(stderr, "\n\n Error - unknown direction of grad");
01508 fprintf(stderr, "\n in function write_gid_elemscalart, file %s, line %d\n", __FILE__, __LINE__);
01509 }
01510 break;
01511 case trlint:
01512 case trlaxisym:
01513 case trquadt:
01514 case trqaxisym:
01515 case quadlint:
01516 case quadlaxisym:
01517 case quadquadtax:
01518 case quadquadt:
01519 switch (dir)
01520 {
01521 case 0:
01522 if(lcid==0)
01523 sig = "grad_e_1_x";
01524 if(lcid==1)
01525 sig = "grad_e_2_x";
01526 if(lcid==2)
01527 sig = "grad_e_3_x";
01528 if(lcid==3)
01529 sig = "grad_e_4_x";
01530 break;
01531 case 1:
01532 if(lcid==0)
01533 sig = "grad_e_1_y";
01534 if(lcid==1)
01535 sig = "grad_e_2_y";
01536 if(lcid==2)
01537 sig = "grad_e_3_y";
01538 if(lcid==3)
01539 sig = "grad_e_4_y";
01540 break;
01541 default :
01542 fprintf(stderr, "\n\n Error - unknown direction of grad");
01543 fprintf(stderr, "\n in function write_gid_elemscalart, file %s, line %d\n", __FILE__, __LINE__);
01544 }
01545 break;
01546 case lineartett:
01547 case linearhext:
01548 case quadratichext:
01549 switch (dir)
01550 {
01551 case 0:
01552 if(lcid==0)
01553 sig = "grad_e_1_x";
01554 if(lcid==1)
01555 sig = "grad_e_2_x";
01556 if(lcid==2)
01557 sig = "grad_e_3_x";
01558 if(lcid==3)
01559 sig = "grad_e_4_x";
01560 break;
01561 case 1:
01562 if(lcid==0)
01563 sig = "grad_e_1_y";
01564 if(lcid==1)
01565 sig = "grad_e_2_y";
01566 if(lcid==2)
01567 sig = "grad_e_3_y";
01568 if(lcid==3)
01569 sig = "grad_e_4_y";
01570 break;
01571 case 2:
01572 if(lcid==0)
01573 sig = "grad_e_1_z";
01574 if(lcid==1)
01575 sig = "grad_e_2_z";
01576 if(lcid==2)
01577 sig = "grad_e_3_z";
01578 if(lcid==3)
01579 sig = "grad_e_4_z";
01580 break;
01581 default :
01582 fprintf(stderr, "\n\n Error - unknown direction of grad");
01583 fprintf(stderr, "\n in function write_gid_elemscalart, file %s, line %d\n", __FILE__, __LINE__);
01584 }
01585 break;
01586 default:
01587 fprintf(stderr, "\n\n Error - unknown flux/grad state is required");
01588 fprintf(stderr, "\n in function write_gid_elemscalart, file %s, line %d\n", __FILE__, __LINE__);
01589 }
01590 }
01591
01592
01593 switch (te)
01594 {
01595 case barlintax:
01596 case barlint:
01597 sprintf(gpname, "Lin_1D");
01598 break;
01599 case barquadt:
01600 case barquadtax:
01601 sprintf(gpname, "Quad_1D");
01602 break;
01603 default :
01604 sprintf(gpname, "%d", te);
01605 }
01606
01607
01608
01609 switch (te)
01610 {
01611 case barlintax:
01612 case barlint:
01613 tnip = 2;
01614 break;
01615 case barquadt:
01616 case barquadtax:
01617 tnip = 3;
01618 break;
01619 case trlint:
01620 case trlaxisym:
01621 tnip = 1;
01622 break;
01623 case quadlint:
01624 case quadlaxisym:
01625 tnip = 4;
01626 break;
01627 case quadquadtax:
01628 case quadquadt:
01629 tnip = 9;
01630 break;
01631 case lineartett:
01632 tnip = 1;
01633 break;
01634 case linearhext:
01635 tnip = 8;
01636 break;
01637 case quadratichext:
01638 tnip = 27;
01639 break;
01640 default :
01641 fprintf(stderr, "\n Unknown element type in function write_gid_elem_type_scalart\n");
01642 fprintf(stderr, " in file %s, line %d\n", __FILE__, __LINE__);
01643 }
01644
01645
01646 switch (scal)
01647 {
01648 case othert:
01649 fprintf(out, "\nResult \"other_e_%ld\" \"%ld\" %s Scalar OnGaussPoints \"%s\"\nValues\n", dir+1, lcid, desclcid, gpname);
01650 break;
01651 case eqothert:
01652 fprintf(out, "\nResult \"eqother_e_%ld\" \"%ld\" %s Scalar OnGaussPoints \"%s\"\nValues\n", dir+1, lcid, desclcid, gpname);
01653 break;
01654 default:
01655 fprintf(out, "\nResult \"%s\" \"%ld\" %s Scalar OnGaussPoints \"%s\"\nValues\n", sig, lcid, desclcid, gpname);
01656 }
01657
01658 print_header = 0;
01659 }
01660
01661 switch (scal)
01662 {
01663
01664 case flux :
01665
01666 fprintf(out, "%7ld", i+Outdt->ide1);
01667 for (j = 0; j < tnip; j++)
01668 {
01669 ipp = Tt->elements[i].ipp[0][0]+j;
01670 if (j == 0)
01671 fprintf(out, " % e\n", Tm->ip[ipp].fluxes[lcid][dir]);
01672 else
01673 fprintf(out, "%7c % e\n", ' ', Tm->ip[ipp].fluxes[lcid][dir]);
01674 }
01675 fprintf(out, "\n");
01676 break;
01677
01678 case grad :
01679
01680 fprintf(out, "%7ld", i+Outdt->ide1);
01681 for (j = 0; j < tnip; j++)
01682 {
01683 ipp = Tt->elements[i].ipp[0][0]+j;
01684 if (j == 0)
01685 fprintf(out, " % e\n", Tm->ip[ipp].grad[lcid][dir]);
01686
01687 else
01688 fprintf(out, "%7c % e\n", ' ', Tm->ip[ipp].grad[lcid][dir]);
01689 }
01690 fprintf(out, "\n");
01691 break;
01692
01693 case othert :
01694 fprintf(out, "%7ld", i+Outdt->ide1);
01695 for (j = 0; j < tnip; j++)
01696 {
01697 ipp = Tt->elements[i].ipp[0][0]+j;
01698 ncompother = Tm->ip[ipp].ncompother;
01699 if (j == 0)
01700 fprintf(out, " % e\n", Tm->ip[ipp].other[ncompother*lcid+dir]);
01701 else
01702 fprintf(out, "%7c % e\n", ' ', Tm->ip[ipp].other[ncompother*lcid+dir]);
01703 }
01704 fprintf(out, "\n");
01705 break;
01706
01707 case eqothert :
01708 fprintf(out, "%7ld", i+Outdt->ide1);
01709 for (j = 0; j < tnip; j++)
01710 {
01711 ipp = Tt->elements[i].ipp[0][0]+j;
01712 ncompeqother = Tm->ip[ipp].ncompeqother;
01713 if (j == 0)
01714 fprintf(out, " % e\n", Tm->ip[ipp].eqother[ncompeqother*lcid+dir]);
01715 else
01716 fprintf(out, "%7c % e\n", ' ', Tm->ip[ipp].eqother[ncompeqother*lcid+dir]);
01717 }
01718 fprintf(out, "\n");
01719 break;
01720
01721 default :
01722 fprintf(stderr, "\n\n Error - unknown value type in function write_gid_elemscalart()\n");
01723 fprintf(stderr, " in file %s, line %d\n", __FILE__, __LINE__);
01724 }
01725 }
01726 if (print_header == 0)
01727 fprintf(out, "End Values\n");
01728 }
01729
01730
01731
01732
01733
01734
01735
01736
01737
01738
01739
01740
01741
01742
01743
01744
01745
01746 void write_gid_elemvectort(FILE *out, strastret q, long lcid, long dir, const char *desclcid)
01747 {
01748 if (Lbt)
01749 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, barlint);
01750 if (Lbat)
01751 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, barlintax);
01752 if (Qbt)
01753 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, barquadt);
01754 if (Qbat)
01755 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, barquadtax);
01756 if (Ltt)
01757 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, trlint);
01758 if (Ltat)
01759 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, trlaxisym);
01760 if (Lqt)
01761 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, quadlint);
01762 if (Lqat)
01763 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, quadlaxisym);
01764 if (Qqt)
01765 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, quadquadt);
01766 if (Qqat)
01767 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, quadquadtax);
01768 if (Ltett)
01769 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, lineartett);
01770 if (Lht)
01771 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, linearhext);
01772 if (Qht)
01773 write_gid_elem_type_vectort(out, q, lcid, dir, desclcid, quadratichext);
01774 }
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788
01789
01790
01791
01792
01793
01794 void write_gid_elem_type_vectort(FILE *out, strastret q, long lcid, long sid, const char *desclcid, elemtypet te)
01795 {
01796 char sig[70];
01797 long q_id1, q_n;
01798 char gpname[1000];
01799 long i, j, k, tnip, ipp;
01800 long print_header = 1;
01801
01802
01803 switch (q)
01804 {
01805 case grad:
01806 q_id1 = Outdt->eog.selgrad[sid].id1[0];
01807 q_n = Tp->gdim;
01808 sprintf(sig, "grad_e_v%ld_s%ld", q_id1+1, sid+1);
01809 break;
01810 case flux:
01811 q_id1 = Outdt->eog.selflux[sid].id1[0];
01812 q_n = Tp->gdim;
01813 sprintf(sig, "flux_e_v%ld_s%ld", q_id1+1, sid+1);
01814 break;
01815 case othert:
01816 q_id1 = Outdt->eog.seloth[sid].id1[0];
01817 q_n = Outdt->eog.seloth[sid].ncomp[0];
01818 sprintf(sig, "other_e_v%ld-%ld_s%ld", q_id1+1, q_n, sid+1);
01819 break;
01820 case eqothert:
01821 q_id1 = Outdt->eog.seloth[sid].id1[0];
01822 q_n = Outdt->eog.seloth[sid].ncomp[0];
01823 sprintf(sig, "other_e_v%ld-%ld_s%ld", q_id1+1, q_n, sid+1);
01824 break;
01825 default:
01826 print_err("unsupported type of quantity (%d) is required in function\n", __FILE__, __LINE__, __func__, q);
01827 abort();
01828 }
01829
01830 for (i = 0; i < Tt->ne; i++)
01831 {
01832 if (Gtt->leso[i]==0)
01833 continue;
01834
01835
01836
01837 if (Tt->elements[i].te != te)
01838 continue;
01839
01840
01841 if ((q == grad) && (Outdt->eog.selegrad.presence_id(Outdt->eog.selgrad, i, sid) == 0))
01842 continue;
01843 if ((q == flux) && (Outdt->eog.seleflux.presence_id(Outdt->eog.selflux, i, sid) == 0))
01844 continue;
01845 if ((q == othert) && (Outdt->eog.seleoth.presence_id(Outdt->eog.seloth, i, sid) == 0))
01846 continue;
01847 if ((q == eqothert) && (Outdt->eog.seleeqoth.presence_id(Outdt->eog.seleqoth, i, sid) == 0))
01848 continue;
01849
01850 if (print_header)
01851 {
01852 ipp = Tt->elements[i].ipp[0][0];
01853
01854
01855 switch (te)
01856 {
01857 case barlintax:
01858 case barlint:
01859 sprintf(gpname, "Lin_1D");
01860 break;
01861 case barquadt:
01862 case barquadtax:
01863 sprintf(gpname, "Quad_1D");
01864 break;
01865 default :
01866 sprintf(gpname, "%d", te);
01867 }
01868
01869 tnip = Tt->give_tnip(i)/Tp->ntm;
01870 fprintf(out, "\nResult \"%s\" \"%ld\" %s Vector OnGaussPoints \"%s\"\n", sig, lcid, desclcid, gpname);
01871 fprintf(out, "Values\n");
01872 print_header = 0;
01873 }
01874
01875 switch (q)
01876 {
01877
01878 case flux :
01879 for (j = 0; j < tnip; j++)
01880 {
01881 ipp = Tt->elements[i].ipp[0][0]+j;
01882 if (j == 0)
01883 fprintf(out, "%7ld", i+Outdt->ide1);
01884 else
01885 fprintf(out, "%7c", ' ');
01886 for (k = 0; k < q_n; k++)
01887 fprintf(out, " % e", Tm->ip[ipp].fluxes[q_id1][k]);
01888 for (k = 0; k < 3-q_n; k++)
01889 fprintf(out, " 0.0");
01890 fprintf(out, "\n");
01891 }
01892 fprintf(out, "\n");
01893 break;
01894
01895 case grad :
01896 for (j = 0; j < tnip; j++)
01897 {
01898 ipp = Tt->elements[i].ipp[0][0]+j;
01899 if (j == 0)
01900 fprintf(out, "%7ld", i+Outdt->ide1);
01901 else
01902 fprintf(out, "%7c", ' ');
01903 for (k = 0; k < q_n; k++)
01904 fprintf(out, " % e", Tm->ip[ipp].grad[q_id1][k]);
01905 for (k = 0; k < 3-q_n; k++)
01906 fprintf(out, " 0.0");
01907 fprintf(out, "\n");
01908 }
01909 fprintf(out, "\n");
01910 break;
01911
01912 case othert :
01913 for (j = 0; j < tnip; j++)
01914 {
01915 ipp = Tt->elements[i].ipp[0][0]+j;
01916 if (j == 0)
01917 fprintf(out, "%7ld", i+Outdt->ide1);
01918 else
01919 fprintf(out, "%7c", ' ');
01920 for (k = q_id1; k < q_id1+q_n; k++)
01921 fprintf(out, " % e", Tm->ip[ipp].other[k]);
01922 for (k = 0; k < 3-q_n; k++)
01923 fprintf(out, " 0.0");
01924 fprintf(out, "\n");
01925 }
01926 fprintf(out, "\n");
01927 break;
01928
01929 case eqothert :
01930 for (j = 0; j < tnip; j++)
01931 {
01932 ipp = Tt->elements[i].ipp[0][0]+j;
01933 if (j == 0)
01934 fprintf(out, "%7ld", i+Outdt->ide1);
01935 else
01936 fprintf(out, "%7c", ' ');
01937 for (k = q_id1; k < q_id1+q_n; k++)
01938 fprintf(out, " % e", Tm->ip[ipp].eqother[k]);
01939 for (k = 0; k < 3-q_n; k++)
01940 fprintf(out, " 0.0");
01941 fprintf(out, "\n");
01942 }
01943 fprintf(out, "\n");
01944 break;
01945
01946 default :
01947 fprintf(stderr, "\n\n Error - unknown value type in function write_gid_elemscalart()\n");
01948 fprintf(stderr, " in file %s, line %d\n", __FILE__, __LINE__);
01949 }
01950 }
01951 if (print_header == 0)
01952 fprintf(out, "End Values\n");
01953 }
01954
01955
01956
01957 void write_nforcest(FILE *out, long lcid, char *desclcid, double *ifor)
01958 {
01959 long i, j, ii, ndof;
01960 vector f, g;
01961
01962 fprintf (out,"\nVALUES");
01963 fprintf (out,"\nVECTOR3D NODES FLUXES %s\n", desclcid);
01964 for (i=0; i < Tt->nn; i++)
01965 {
01966 ndof = Tt->give_ndofn(i);
01967 allocv(ndof, f);
01968 for (j=0;j<ndof;j++)
01969 {
01970 ii=Tt->give_dof(i,j);
01971 if (ii<0) f[j]=0.0;
01972 if (ii==0) f[j]=0.0;
01973 if (ii>0) f[j]=ifor[ii-1];
01974
01975
01976
01977 }
01978
01979 fprintf(out, "%ld", i);
01980 if (ndof > 3) ndof = 3;
01981 for (j = 0; j < ndof; j++)
01982 fprintf(out, " % e", f[j]);
01983 for (j=ndof; j < 3; j++)
01984 fprintf(out, " 0.0");
01985 fprintf(out, "\n");
01986 destrv(f);
01987 }
01988 }
01989
01990
01991
01992
01993
01994
01995
01996
01997
01998
01999
02000
02001
02002
02003 void print_default_vtk (FILE *fname, long lcid, long istep, double lambda)
02004 {
02005 long int i,j,nn;
02006 int tr[20];
02007
02008 fprintf(fname, "# vtk DataFile Version 1.0\n");
02009 fprintf(fname, "Time step %ld time %lf\n", istep, lambda);
02010 fprintf(fname, "ASCII\n\n");
02011 fprintf(fname, "DATASET UNSTRUCTURED_GRID\n");
02012
02013 fprintf(fname, "POINTS %ld double\n", Tt->nn);
02014 for (i=0; i<Tt->nn; i++) {
02015 fprintf(fname, "%e %e %e\n", Gtt->gnodes[i].x, Gtt->gnodes[i].y, Gtt->gnodes[i].z);
02016 }
02017
02018 long int ncells = 0;
02019 for (i=0; i < Tt->ne; i++){
02020 ncells += Tt->give_nne (i);
02021 }
02022 fprintf(fname, "\nCELLS %ld %ld\n", Tt->ne, ncells+Tt->ne);
02023 for (i=0; i < Tt->ne; i++){
02024 fprintf(fname, "%ld ", Tt->give_nne(i));
02025 for(j=0;j<Tt->give_nne(i);j++){
02026 switch(Tt->elements[i].te){
02027 case linearhext:
02028 tr[0] = 6; tr[1] = 7; tr[2] = 4; tr[3] = 5;
02029 tr[4] = 2; tr[5] = 3; tr[6] = 0; tr[7] = 1;
02030 nn=tr[j];
02031 case quadratichext:
02032 tr[0] = 6; tr[1] = 7; tr[2] = 4; tr[3] = 5;
02033 tr[4] = 2; tr[5] = 3; tr[6] = 0; tr[7] = 1;
02034 tr[8] = 18; tr[9] = 19; tr[10] = 16; tr[11] = 17;
02035 tr[12] = 10; tr[13] = 11; tr[14] = 8; tr[15] = 9;
02036 tr[16] = 14; tr[17] = 15; tr[18] = 12; tr[19] = 13;
02037 nn=tr[j];
02038 break;
02039 default:
02040 nn=j;
02041 break;
02042 }
02043 fprintf(fname, "%ld ", Gtt->gelements[i].nodes[nn]);
02044 }
02045 fprintf(fname, "\n");
02046 }
02047
02048
02049 fprintf(fname, "\nCELL_TYPES %ld\n", Tt->ne);
02050 for (i=0; i < Tt->ne; i++){
02051 switch(Tt->elements[i].te){
02052 case barlint:
02053 case barlintax :
02054 fprintf(fname, "3\n");
02055 break;
02056 case barquadt :
02057 case barquadtax :
02058 fprintf(fname, "21\n");
02059 break;
02060 case trlint:
02061 case trlaxisym:
02062 fprintf(fname, "5\n");
02063 break;
02064 case quadlint:
02065 case quadlaxisym:
02066 fprintf(fname, "9\n");
02067 break;
02068 case quadquadt:
02069 case quadquadtax:
02070 fprintf(fname, "23\n");
02071 break;
02072 case lineartett:
02073 fprintf(fname, "10\n");
02074 break;
02075 case linearhext:
02076 fprintf(fname, "12\n");
02077 break;
02078 case quadratichext:
02079 fprintf(fname, "25\n");
02080 break;
02081 default:
02082 fprintf(stderr, "\n\n Unknown element type in VTK export, file %s, line %d\n", __FILE__, __LINE__);
02083 abort();
02084 break;
02085 }
02086 }
02087 }
02088
02089
02090 void write_vtk_unkn(FILE *fname,long lcid, int flag_material){
02091 double *r;
02092 long i, j, k, ipp;
02093 char VarName[255];
02094 double VTK_no_value = -0.11111;
02095 long max_ncomp;
02096
02097 fprintf(fname, "\nPOINT_DATA %ld\n", Tt->nn);
02098 if (Tp->tmatt==onemedium){
02099 fprintf(fname, "SCALARS Scalar double\nLOOKUP_TABLE default\n");
02100 }
02101 else{
02102 fprintf(fname, "VECTORS Unkn double\n");
02103 }
02104 for (i=0; i < Tt->nn; i++)
02105 {
02106 r = new double [Gtt->gnodes[i].ndofn];
02107 nodalval (lcid, r, i);
02108 for (j = 0; j < Gtt->gnodes[i].ndofn; j++)
02109
02110 fprintf(fname, "%e", r[j]);
02111 if (Tp->tmatt == twomediacoup)
02112 fprintf(fname, "%e", 0.0);
02113 fprintf(fname, "\n");
02114 delete [] r;
02115 }
02116
02117 if(flag_material){
02118
02119 fprintf(fname, "\nCELL_DATA %ld\n", Tt->ne);
02120 fprintf(fname, "SCALARS Mat_type int\nLOOKUP_TABLE default\n");
02121 for (i=0; i < Tt->ne; i++){
02122 fprintf(fname, "%d\n", Tt->elements[i].tm[0]);
02123 }
02124
02125 fprintf(fname, "\nSCALARS Mat_id int\nLOOKUP_TABLE default\n");
02126 for (i=0; i < Tt->ne; i++){
02127 fprintf(fname, "%ld\n", Tt->elements[i].idm[0]+1);
02128 }
02129 }
02130 else{
02131 fprintf(fname, "\nCELL_DATA %ld\n", Tt->ne);
02132 }
02133
02134
02135 if (Outdt->eog.selegrad.st != sel_no){
02136 fprintf(fname, "\nVECTORS Gradient double\n");
02137 for (i=0; i<Tt->ne; i++){
02138 if (Outdt->eog.selegrad.presence_id(i)){
02139 ipp = Tt->elements[i].ipp[0][0];
02140 fprintf(fname, "%e %e %e\n", Outdt->eog.selegrad.presence_id(Outdt->eog.selgrad, i, 0)!=0?Tm->ip[ipp].grad[0][0]:0, Outdt->eog.selegrad.presence_id(Outdt->eog.selgrad, i, 1)!=0?Tm->ip[ipp].grad[1][0]:0, Outdt->eog.selegrad.presence_id(Outdt->eog.selgrad, i, 2)!=0?Tm->ip[ipp].grad[2][0]:0);
02141 }
02142 else
02143 fprintf(fname, "%e %e %e\n", VTK_no_value, VTK_no_value, VTK_no_value);
02144 }
02145 }
02146
02147
02148 if (Outdt->eog.seleflux.st != sel_no){
02149 fprintf(fname, "\nVECTORS Flux double\n");
02150 for (i=0; i<Tt->ne; i++){
02151 if (Outdt->eog.seleflux.presence_id(i)){
02152 ipp = Tt->elements[i].ipp[0][0];
02153 fprintf(fname, "%e %e %e\n", Outdt->eog.seleflux.presence_id(Outdt->eog.selflux, i, 0)!=0?Tm->ip[ipp].fluxes[0][0]:0, Outdt->eog.seleflux.presence_id(Outdt->eog.selflux, i, 1)!=0?Tm->ip[ipp].fluxes[1][0]:0, Outdt->eog.seleflux.presence_id(Outdt->eog.selflux, i, 2)!=0?Tm->ip[ipp].fluxes[2][0]:0);
02154 }
02155 else
02156 fprintf(fname, "%e %e %e\n", VTK_no_value, VTK_no_value, VTK_no_value);
02157 }
02158 }
02159
02160
02161 if (Outdt->eog.seleoth.st != sel_no){
02162 for (i=0; i<Tm->givencompother(); i++){
02163 fprintf(fname, "\nSCALARS Other_%ld double\nLOOKUP_TABLE default\n", i);
02164 for (k=0; k<Tt->ne; k++){
02165 if (Outdt->eog.seleoth.presence_id(k)){
02166 ipp = Tt->elements[k].ipp[0][0];
02167 fprintf(fname, "%e\n", Tm->ip[ipp].other[i]);
02168 }
02169 else{
02170 fprintf(fname, "%e\n", VTK_no_value);
02171 }
02172 }
02173 }
02174 }
02175
02176
02177
02178 if (Outdt->eog.seleeqoth.st != sel_no){
02179 for (k=0; k<Tm->tnip; k++){
02180 max_ncomp > Tm->ip[k].ncompeqother ? max_ncomp = Tm->ip[k].ncompeqother : 0;
02181 }
02182
02183 for(i=0; i<max_ncomp; i++)
02184 for (j=0; j<Outdt->eog.seleeqoth.n; j++)
02185 if (Outdt->eog.seleqoth[j].presence_id(i)){
02186
02187 if(Tt->elements[0].tm[0] == cementhydrmat){
02188 if (i==0) strcpy(VarName, "Rel_heat");
02189 if (i==1) strcpy(VarName, "DoH");
02190 if (i==2) strcpy(VarName, "E_paste");
02191 if (i==3) strcpy(VarName, "nu_paste");
02192 if (i==4) strcpy(VarName, "E_concrete");
02193 if (i==5) strcpy(VarName, "nu_concrete");
02194 }
02195 else strcpy(VarName, "Eq_other");
02196
02197 fprintf(fname, "\nSCALARS %s_%ld double\nLOOKUP_TABLE default\n", VarName, i);
02198 for (k=0; k < Tt->ne; k++){
02199 ipp = Tt->elements[k].ipp[0][0];
02200 fprintf(fname, "%e\n", Tm->ip[ipp].eqother[i]);
02201 }
02202 }
02203 }
02204
02205 }
02206
02207