00001 #include <string.h>
00002 #include "outdiagt.h"
00003 #include "gtopology.h"
00004 #include "globalt.h"
00005 #include "probdesct.h"
00006 #include "meshtransfert.h"
00007 #include "transtop.h"
00008 #include "elementt.h"
00009 #include "nodet.h"
00010 #include "intpointst.h"
00011 #include "globmatt.h"
00012 #include "selection.h"
00013
00014
00015
00016
00017
00018
00019
00020
00021 outdiagt::outdiagt()
00022 {
00023 pid = NULL; eid = NULL; ipeid = NULL; nif = NULL;
00024 pu = NULL;
00025 ipu = NULL;
00026 }
00027
00028
00029
00030
00031
00032
00033
00034 outdiagt::~outdiagt()
00035 {
00036 delete [] nif;
00037 delete [] pid;
00038 delete [] eid;
00039 delete [] ipeid;
00040 delete [] pu;
00041 delete [] ipu;
00042 }
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 long outdiagt::read(XFILE *in)
00058 {
00059 long i;
00060 if (xfscanf (in, "%k%ld", "numunknowns", &npun) != 2)
00061 {
00062 fprintf(stderr, "\n\nError reading number of printed unknowns\n");
00063 fprintf(stderr, " function outdiagt::read, (file %s, line %d)\n", __FILE__,__LINE__);
00064 return 1;
00065 }
00066 xfscanf (in, "%k", "sel_diagstep");
00067 dstep.read(in);
00068 if (dstep.st == sel_no)
00069 return 0;
00070 nif = new nodip[npun];
00071 pid = new long [npun];
00072 eid = new long [npun];
00073 ipeid = new long [npun];
00074 pu = new prunkt[npun];
00075 ipu = new long [npun];
00076 memset(nif, 0, sizeof(*nif)*npun);
00077 memset(pu, 0, sizeof(*pu)*npun);
00078 memset(ipu, 0, sizeof(*ipu)*npun);
00079
00080 for (i=0; i<npun; i++)
00081 {
00082 pid[i] = eid[i] = ipeid[i] = -1;
00083 if (xfscanf (in, "%k%m", "point", &nodip_kwdset, (int *)(nif+i)) != 2)
00084 {
00085 fprintf(stderr, "\n\nError reading type of point\n");
00086 fprintf(stderr, " function outdiagt::read, (file %s, line %d)\n", __FILE__,__LINE__);
00087 return 1;
00088 }
00089 switch (nif[i])
00090 {
00091 case atnode:
00092 if (xfscanf (in, "%k%ld", "node", pid+i) != 2)
00093 {
00094 fprintf(stderr, "\n\nError reading node id\n");
00095 fprintf(stderr, " function outdiagt::read, (file %s, line %d)\n", __FILE__,__LINE__);
00096 return 1;
00097 }
00098 pid[i]--;
00099 break;
00100 case atip:
00101 if (xfscanf (in, "%k %ld %k %ld", "elem", eid+i, "ip", ipeid+i) != 4)
00102 {
00103 fprintf(stderr, "\n\nError reading element or ip number\n");
00104 fprintf(stderr, " function outdiagt::read, (file %s, line %d)\n", __FILE__,__LINE__);
00105 return 1;
00106 }
00107 eid[i]--; ipeid[i]--;
00108 break;
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 default:
00120 fprintf(stderr, "\n\nUnknown type of point is required in function outdiagt::read\n");
00121 fprintf(stderr, " (file %s, line %d)\n", __FILE__, __LINE__);
00122 return 1;
00123 }
00124
00125 if (xfscanf (in, "%k%m", "unknowntype", &prunkt_kwdset, (int *)(pu+i)) != 2)
00126 {
00127 fprintf(stderr, "\n\nError reading type of printed unknown\n");
00128 fprintf(stderr, " function outdiagt::read, (file %s, line %d)\n", __FILE__,__LINE__);
00129 return 1;
00130 }
00131 if ((pu[i] == pr_stepidt) || (pu[i] == pr_apploadt))
00132 continue;
00133 if (xfscanf (in, "%k%ld", "compid", ipu+i) != 2)
00134 {
00135 fprintf(stderr, "\n\nError reading component of printed unknown\n");
00136 fprintf(stderr, " function outdiagt::read, (file %s, line %d)\n", __FILE__,__LINE__);
00137 return 1;
00138 }
00139 ipu[i]--;
00140 if (nif[i] == atnode)
00141 {
00142 switch (pu[i])
00143 {
00144 case pr_gradients :
00145 if(Tp->gradcomp == 0)
00146 Tp->gradcomp = 1;
00147 if(Tp->gradaver == 0)
00148 Tp->gradaver = 1;
00149 Tp->gradpos = 2;
00150 break;
00151 case pr_fluxes :
00152 if(Tp->gradcomp == 0)
00153 Tp->gradcomp = 1;
00154 if(Tp->fluxcomp == 0)
00155 Tp->fluxcomp = 1;
00156 if(Tp->gradaver == 0)
00157 Tp->gradaver = 1;
00158 Tp->gradpos = 2;
00159 if(Tp->fluxaver == 0)
00160 Tp->fluxaver = 1;
00161 Tp->fluxpos = 2;
00162 break;
00163 case pr_othert :
00164 if(Tp->othercomp == 0)
00165 Tp->othercomp = 1;
00166 if(Tp->otheraver == 0)
00167 Tp->otheraver = 1;
00168 if(Tp->otherpos == 0)
00169 Tp->otherpos = 3;
00170 break;
00171 case pr_eqothert :
00172 if(Tp->eqothercomp == 0)
00173 Tp->eqothercomp = 1;
00174 if(Tp->eqotheraver == 0)
00175 Tp->eqotheraver = 1;
00176 Tp->eqotherpos = 2;
00177 break;
00178 default:
00179 break;
00180 }
00181 }
00182 if ((nif[i] == atip) || (nif[i] == atxyz))
00183 {
00184 switch (pu[i])
00185 {
00186 case pr_gradients :
00187 if(Tp->gradcomp == 0)
00188 Tp->gradcomp = 1;
00189 if(Tp->gradaver == 0)
00190 Tp->gradaver = 1;
00191 if(Tp->gradpos == 0)
00192 Tp->gradpos = 1;
00193 break;
00194 case pr_fluxes :
00195 if(Tp->gradcomp == 0)
00196 Tp->gradcomp = 1;
00197 if(Tp->fluxcomp == 0)
00198 Tp->fluxcomp = 1;
00199 if(Tp->gradaver == 0)
00200 Tp->gradaver = 1;
00201 if(Tp->gradpos == 0)
00202 Tp->gradpos = 1;
00203 if(Tp->fluxaver == 0)
00204 Tp->fluxaver = 1;
00205 if(Tp->fluxpos == 0)
00206 Tp->fluxpos = 1;
00207 break;
00208 case pr_othert :
00209 if(Tp->othercomp == 0)
00210 Tp->othercomp = 1;
00211 if(Tp->otheraver == 0)
00212 Tp->otheraver = 1;
00213 if(Tp->otherpos == 0)
00214 Tp->otherpos = 1;
00215 break;
00216 case pr_eqothert :
00217 if(Tp->eqothercomp == 0)
00218 Tp->eqothercomp = 1;
00219 if(Tp->eqotheraver == 0)
00220 Tp->eqotheraver = 1;
00221 if(Tp->eqotherpos == 0)
00222 Tp->eqotherpos = 1;
00223 break;
00224 default:
00225 break;
00226 }
00227 }
00228 }
00229 return 0;
00230 }
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243 long outdiagt::print(FILE *out)
00244 {
00245 long i;
00246 fprintf(out, "%ld ", npun);
00247 dstep.print(out);
00248 if (dstep.st == sel_no)
00249 return 0;
00250
00251 for (i=0; i<npun; i++)
00252 {
00253 fprintf(out, "%d ", int(nif[i]));
00254 switch (nif[i])
00255 {
00256 case atnode:
00257 fprintf (out, "%ld ", pid[i]+1);
00258 break;
00259 case atip:
00260 fprintf (out, "%ld %ld ", eid[i]+1, ipeid[i]+1);
00261 break;
00262
00263
00264
00265
00266 default:
00267 fprintf(stderr, "\n\nUnknown type of point is required in function outdiagt::print\n");
00268 fprintf(stderr, " (file %s, line %d)\n", __FILE__, __LINE__);
00269 return 1;
00270 }
00271 fprintf (out, "%d", int(pu[i]));
00272
00273 if ((pu[i] == pr_stepidt) || (pu[i] == pr_apploadt))
00274 {
00275 fprintf (out, "\n");
00276 continue;
00277 }
00278 fprintf (out, " %ld\n", ipu[i]+1);
00279 }
00280
00281 return 0;
00282 }
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296 long outdiagt::print_header(FILE *out)
00297 {
00298 long i;
00299 char emsg[200];
00300
00301 fprintf(out, "# ");
00302 for (i=0; i<npun; i++)
00303 {
00304 switch (pu[i])
00305 {
00306 case pr_unknowns :
00307 fprintf(out, "unknown_%ld ", ipu[i]);
00308 break;
00309 case pr_gradients :
00310 fprintf(out, "gradient_%ld ", ipu[i]);
00311 break;
00312 case pr_fluxes :
00313 fprintf(out, "flux_%ld ", ipu[i]);
00314 break;
00315 case pr_stepidt :
00316 fprintf(out, "step ");
00317 break;
00318 case pr_apploadt :
00319 fprintf(out, "lambda ");
00320 break;
00321 case pr_othert :
00322 fprintf(out, "other_%ld ", ipu[i]);
00323 break;
00324 case pr_eqothert :
00325 fprintf(out, "eqother_%ld ", ipu[i]);
00326 break;
00327 default:
00328 fprintf(stderr, "\n\nUnknown type of value for diagram is required\n");
00329 fprintf(stderr, " in node or ip number %ld, (file %s, line %d)\n", pid[i]+1, __FILE__, __LINE__);
00330 return 1;
00331 }
00332 }
00333 fprintf(out, "\n");
00334
00335 fprintf(out, "#");
00336 for (i=0; i<npun; i++)
00337 {
00338 if ((pid[i] < 0) && (nif[i] == atip))
00339 {
00340 if ((eid[i] < Tt->ne) && (ipeid[i] >= 0) && (ipeid[i] < Tt->give_tnip(eid[i])))
00341 pid[i] = Tt->elements[eid[i]].ipp[0][0]+ipeid[i];
00342 else
00343 {
00344 sprintf(emsg, "invalid element number (%ld) or element ip number (%ld) is required", eid[i]+1, ipeid[i]+1);
00345 print_err(emsg, __FILE__, __LINE__, __func__);
00346 return 1;
00347 }
00348 }
00349 switch(nif[i])
00350 {
00351 case atnode:
00352 fprintf(out, " %le", Gtt->gnodes[pid[i]].x);
00353 break;
00354 case atip:
00355
00356 break;
00357 case atxyz:
00358 fprintf(out, " ---");
00359 break;
00360 default:
00361 print_err("unknown point type is required", __FILE__, __LINE__, __func__);
00362 return 1;
00363 }
00364 }
00365 fprintf(out, "\n");
00366
00367 fprintf(out, "# ");
00368 for (i=0; i<npun; i++)
00369 {
00370 if ((pid[i] < 0) && (nif[i] == atip))
00371 {
00372 if ((eid[i] < Tt->ne) && (ipeid[i] >= 0) && (ipeid[i] < Tt->give_tnip(eid[i])))
00373 pid[i] = Tt->elements[eid[i]].ipp[0][0]+ipeid[i];
00374 else
00375 {
00376 sprintf(emsg, "invalid element number (%ld) or element ip number (%ld) is required", eid[i]+1, ipeid[i]+1);
00377 print_err(emsg, __FILE__, __LINE__, __func__);
00378 return 1;
00379 }
00380 }
00381 switch(nif[i])
00382 {
00383 case atnode:
00384 fprintf(out, " %le", Gtt->gnodes[pid[i]].y);
00385 break;
00386 case atip:
00387
00388 break;
00389 case atxyz:
00390 fprintf(out, " ---");
00391 break;
00392 default:
00393 print_err("unknown point type is required", __FILE__, __LINE__, __func__);
00394 return 1;
00395 }
00396 }
00397 fprintf(out, "\n");
00398
00399 fprintf(out, "# ");
00400 for (i=0; i<npun; i++)
00401 {
00402 if ((pid[i] < 0) && (nif[i] == atip))
00403 {
00404 if ((eid[i] < Tt->ne) && (ipeid[i] >= 0) && (ipeid[i] < Tt->give_tnip(eid[i])))
00405 pid[i] = Tt->elements[eid[i]].ipp[0][0]+ipeid[i];
00406 else
00407 {
00408 sprintf(emsg, "invalid element number (%ld) or element ip number (%ld) is required", eid[i]+1, ipeid[i]+1);
00409 print_err(emsg, __FILE__, __LINE__, __func__);
00410 return 1;
00411 }
00412 }
00413 switch(nif[i])
00414 {
00415 case atnode:
00416 fprintf(out, " %le", Gtt->gnodes[pid[i]].z);
00417 break;
00418 case atip:
00419
00420 break;
00421 case atxyz:
00422 fprintf(out, " ---");
00423 break;
00424 default:
00425 print_err("unknown point type is required", __FILE__, __LINE__, __func__);
00426 return 1;
00427 }
00428 }
00429 fprintf(out, "\n");
00430 return 0;
00431 }
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452 long outdiagt::printval(FILE *out, long lcid, double lambda, long istep, double *fi)
00453 {
00454 long i;
00455
00456
00457 if (dstep.presence_id(istep, lambda, Tp->timecont) == 0)
00458 return 0;
00459
00460 for (i=0; i<npun; i++)
00461 {
00462 if ((pid[i] < 0) && (nif[i] == atip))
00463 {
00464 if ((eid[i] < Tt->ne) && (ipeid[i] >= 0) && (ipeid[i] < Tt->give_tnip(eid[i])))
00465 pid[i] = Tt->elements[eid[i]].ipp[0][0]+ipeid[i];
00466 else
00467 {
00468 fprintf(stderr, "\n\nInvalid element number or element ip number is required in function outdiagt::print_val\n");
00469 fprintf(stderr, " element %ld, ip %ld (file %s, line %d)\n", eid[i]+1, ipeid[i]+1, __FILE__, __LINE__);
00470 return 1;
00471 }
00472 }
00473 switch (pu[i])
00474 {
00475 case pr_unknowns :
00476 print_unknowns(out,lcid,i);
00477 break;
00478 case pr_gradients:
00479 print_gradients(out,lcid,i);
00480 break;
00481 case pr_fluxes:
00482 print_fluxes(out,lcid,i);
00483 break;
00484 case pr_othert:
00485 print_others(out,lcid,i);
00486 break;
00487 case pr_eqothert:
00488 print_eqothers(out,lcid,i);
00489 break;
00490 case pr_stepidt :
00491 fprintf(out, "%ld ", istep);
00492 break;
00493 case pr_apploadt :
00494
00495 switch (Tp->tprt)
00496 {
00497 case secondst:
00498 fprintf(out, " %e ", lambda);
00499 break;
00500 case minutest:
00501 fprintf(out, " %e ", lambda/60.0);
00502 break;
00503 case hourst:
00504 fprintf(out, " %e ", lambda/3600.0);
00505 break;
00506 case dayst:
00507 fprintf(out, " %e ", lambda/86400.0);
00508 break;
00509 default:
00510 {
00511 print_err("unknown type of time printing",__FILE__,__LINE__,__func__);
00512 }
00513 }
00514
00515 break;
00516 default:
00517 fprintf(stderr, "\n\nUnknown type of value for diagram is required\n");
00518 fprintf(stderr, " in node or ip number %ld, (file %s, line %d)\n", pid[i]+1, __FILE__, __LINE__);
00519 return 2;
00520 }
00521 }
00522 fprintf(out, "\n");
00523
00524 return 0;
00525 }
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546 long outdiagt::printval_forced(FILE *out, long lcid, double lambda, long istep, double *fi)
00547 {
00548 long i;
00549
00550 for (i=0; i<npun; i++)
00551 {
00552 if ((pid[i] < 0) && (nif[i] == atip))
00553 {
00554 if ((eid[i] < Tt->ne) && (ipeid[i] >= 0) && (ipeid[i] < Tt->give_tnip(eid[i])))
00555 pid[i] = Tt->elements[eid[i]].ipp[0][0]+ipeid[i];
00556 else
00557 {
00558 fprintf(stderr, "\n\nInvalid element number or element ip number is required in function outdiagt::print_val\n");
00559 fprintf(stderr, " element %ld, ip %ld (file %s, line %d)\n", eid[i]+1, ipeid[i]+1, __FILE__, __LINE__);
00560 return 1;
00561 }
00562 }
00563 switch (pu[i])
00564 {
00565 case pr_unknowns :
00566 print_unknowns(out,lcid,i);
00567 break;
00568 case pr_gradients:
00569 print_gradients(out,lcid,i);
00570 break;
00571 case pr_fluxes:
00572 print_fluxes(out,lcid,i);
00573 break;
00574 case pr_othert:
00575 print_others(out,lcid,i);
00576 break;
00577 case pr_eqothert:
00578 print_eqothers(out,lcid,i);
00579 break;
00580 case pr_stepidt :
00581 fprintf(out, "%ld ", istep);
00582 break;
00583 case pr_apploadt :
00584
00585 switch (Tp->tprt)
00586 {
00587 case secondst:
00588 fprintf(out, " %e ", lambda);
00589 break;
00590 case minutest:
00591 fprintf(out, " %e ", lambda/60.0);
00592 break;
00593 case hourst:
00594 fprintf(out, " %e ", lambda/3600.0);
00595 break;
00596 case dayst:
00597 fprintf(out, " %e ", lambda/86400.0);
00598 break;
00599 default:
00600 {
00601 print_err("unknown type of time printing",__FILE__,__LINE__,__func__);
00602 }
00603 }
00604
00605 break;
00606 default:
00607 fprintf(stderr, "\n\nUnknown type of value for diagram is required\n");
00608 fprintf(stderr, " in node or ip number %ld, (file %s, line %d)\n", pid[i]+1, __FILE__, __LINE__);
00609 return 2;
00610 }
00611 }
00612 fprintf(out, "\n");
00613
00614 return 0;
00615 }
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633 long outdiagt::print_unknowns(FILE *out, long lcid, long idp)
00634 {
00635 double *r;
00636 switch (nif[idp])
00637 {
00638
00639 case atnode:
00640 r = new double [Gtt->gnodes[pid[idp]].ndofn];
00641 nodalval(lcid,r, pid[idp]);
00642 fprintf(out, "% e ", r[ipu[idp]]);
00643 delete [] r;
00644 break;
00645 case atip:
00646 fprintf (stderr, "\n\nUnsupported combination of printed values is required -\n");
00647 fprintf(stderr, " unknowns in ip number %ld, outdiagt::print_unknowns (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00648 return 1;
00649 default:
00650 fprintf(stderr, "\n\nUnknown type of point is required in function outdiagt::print_unknowns\n");
00651 fprintf(stderr, " point number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00652 return 1;
00653 }
00654 return 0;
00655 }
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670 long outdiagt::print_gradients(FILE *out, long lcid, long idp)
00671 {
00672 long i;
00673
00674 switch (nif[idp])
00675 {
00676
00677 case atnode:
00678 if (ipu[idp] < Tp->ntm){
00679 for(i=0;i<Tt->nodes[pid[idp]].ncompgrad;i++)
00680 fprintf(out, "% e ", Tt->nodes[pid[idp]].gradient[ipu[idp]][i]);
00681 }
00682 else
00683 {
00684 fprintf(stderr, "\n\nInvalid component number is required in function outdiagt::print_gradients\n");
00685 fprintf(stderr, " node number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00686 return 2;
00687 }
00688 break;
00689 case atip:
00690 if (ipu[idp] < Tp->ntm){
00691 for(i=0;i<Tm->ip[pid[idp]].ncompgrad;i++)
00692 fprintf(out, "% e ", Tm->ip[pid[idp]].grad[ipu[idp]][i]);
00693 }
00694 else
00695 {
00696 fprintf(stderr, "\n\nInvalid component number is required in function outdiagt::print_gradients\n");
00697 fprintf(stderr, " integration point number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00698 return 2;
00699 }
00700 break;
00701 default:
00702 fprintf(stderr, "\n\nUnknown type of point is required in function outdiagt::print_gradients\n");
00703 fprintf(stderr, " point number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00704 return 1;
00705 }
00706 return 0;
00707 }
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722 long outdiagt::print_fluxes(FILE *out, long lcid, long idp)
00723 {
00724 long i;
00725
00726 switch (nif[idp])
00727 {
00728
00729 case atnode:
00730 if (ipu[idp] < Tp->ntm){
00731 for(i=0;i<Tt->nodes[pid[idp]].ncompgrad;i++)
00732 fprintf(out, "% e ", Tt->nodes[pid[idp]].flux[ipu[idp]][i]);
00733 }
00734 else
00735 {
00736 fprintf(stderr, "\n\nInvalid component number is required in function outdiagt::print_fluxes\n");
00737 fprintf(stderr, " node number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00738 return 2;
00739 }
00740 break;
00741 case atip:
00742 if (ipu[idp] < Tp->ntm){
00743 for(i=0;i<Tm->ip[pid[idp]].ncompgrad;i++)
00744 fprintf(out, "% e ", Tm->ip[pid[idp]].fluxes[ipu[idp]][i]);
00745 }
00746 else
00747 {
00748 fprintf(stderr, "\n\nInvalid component number is required in function outdiagt::print_fluxes\n");
00749 fprintf(stderr, " integration point number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00750 return 2;
00751 }
00752 break;
00753 default:
00754 fprintf(stderr, "\n\nUnknown type of point is required in function outdiagt::print_fluxes\n");
00755 fprintf(stderr, " point number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00756 return 1;
00757 }
00758 return 0;
00759 }
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776 long outdiagt::print_others(FILE *out, long lcid, long idp)
00777 {
00778 switch (nif[idp])
00779 {
00780
00781 case atnode:
00782 if (ipu[idp] < Tt->nodes[pid[idp]].ncompother)
00783 fprintf(out, "% e ", Tt->nodes[pid[idp]].other[ipu[idp]]);
00784 else
00785 {
00786 fprintf(stderr, "\n\nInvalid component number is required in function outdiagt::print_others\n");
00787 fprintf(stderr, " node number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00788 return 2;
00789 }
00790 break;
00791 case atip:
00792 if (ipu[idp] < Tm->ip[pid[idp]].ncompother)
00793 fprintf(out, "% e ", Tm->ip[pid[idp]].other[ipu[idp]]);
00794 else
00795 {
00796 fprintf(stderr, "\n\nInvalid component number is required in function outdiagt::print_others\n");
00797 fprintf(stderr, " integration point number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00798 return 2;
00799 }
00800 break;
00801 default:
00802 fprintf(stderr, "\n\nUnknown type of point is required in function outdiagt::print_others\n");
00803 fprintf(stderr, " point number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00804 return 1;
00805 }
00806 return 0;
00807 }
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822 long outdiagt::print_eqothers(FILE *out, long lcid, long idp)
00823 {
00824 switch (nif[idp])
00825 {
00826
00827 case atnode:
00828 if (ipu[idp] < Tt->nodes[pid[idp]].ncompeqother)
00829 fprintf(out, "% e ", Tt->nodes[pid[idp]].eqother[ipu[idp]]);
00830 else
00831 {
00832 fprintf(stderr, "\n\nInvalid component number is required in function outdiagt::print_eqothers\n");
00833 fprintf(stderr, " node number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00834 return 2;
00835 }
00836 break;
00837 case atip:
00838 if (ipu[idp] < Tm->ip[pid[idp]].ncompeqother)
00839 fprintf(out, "% e ", Tm->ip[pid[idp]].eqother[ipu[idp]]);
00840 else
00841 {
00842 fprintf(stderr, "\n\nInvalid component number is required in function outdiagt::print_eqothers\n");
00843 fprintf(stderr, " integration point number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00844 return 2;
00845 }
00846 break;
00847 default:
00848 fprintf(stderr, "\n\nUnknown type of point is required in function outdiagt::print_eqothers\n");
00849 fprintf(stderr, " point number %ld (file %s, line %d)\n", pid[idp]+1, __FILE__, __LINE__);
00850 return 1;
00851 }
00852 return 0;
00853 }