1 // GetDP - Copyright (C) 1997-2021 P. Dular and C. Geuzaine, University of Liege 2 // 3 // See the LICENSE.txt file for license information. Please report all 4 // issues on https://gitlab.onelab.info/getdp/getdp/issues. 5 6 #ifndef PRO_DATA_H 7 #define PRO_DATA_H 8 9 #include <string> 10 #include <map> 11 #include "GetDPConfig.h" 12 #include "ListUtils.h" 13 14 #define DIM_0D 0 15 #define DIM_1D 1 16 #define DIM_2D 2 17 #define DIM_3D 3 18 #define DIM_ALL 4 19 #define DIM_AXI 5 20 21 #define NBR_MAX_RES 2500 22 #define NBR_MAX_POS 10 23 24 #define STATUS_PRE 1 // pre-processing 25 #define STATUS_CAL 2 // processing 26 #define STATUS_POS 3 // post-processing 27 #define STATUS_CST 5 // update constraint 28 29 #define TIME_STATIC 1 30 #define TIME_THETA 2 31 #define TIME_NEWMARK 3 32 #define TIME_GEAR 4 33 34 #define ASSEMBLY_AGGREGATE 1 35 #define ASSEMBLY_SEPARATE 2 36 37 /* ------------------------------------------------------------------------ */ 38 /* V a l u e */ 39 /* ------------------------------------------------------------------------ */ 40 41 #define MAX_DIM 9 /* second-rank tensor of order 3 : 3^2 = 9 */ 42 43 // - NBR_MAX_HARMONIC controls the size of a 'Value' ; keep this small by 44 // default for efficient operations in recursive expression evaluation and 45 // post-processing 46 // 47 // - MAX_STACK_SIZE controls the size of the stack used in the evaluation of 48 // expressions ; keep this large enough by default to allow for complex expressions 49 50 // - MAX_STACK_SIZE0 controls the size of the stack used in the evaluation of expressions; 51 // equals 8 by default (tensors), reduced to 2 in multiharmonic case for allowing to go up 52 // in the number of harmonics... Put back to 8 if you need tensors! 53 54 #if defined(HAVE_SMALL_STACK) 55 #define NBR_MAX_HARMONIC 2 56 #define MAX_STACK_SIZE0 8 57 #define MAX_STACK_SIZE 20 58 #elif defined(HAVE_MULTIHARMONIC) 59 #define NBR_MAX_HARMONIC 200 60 #define MAX_STACK_SIZE0 2 61 #define MAX_STACK_SIZE 40 62 #else 63 #define NBR_MAX_HARMONIC 2 64 #define MAX_STACK_SIZE0 8 65 #define MAX_STACK_SIZE 40 66 #endif 67 68 // Hereafter, values used for NL circuit + homog (a bit too much for other cases) 69 // #define NBR_MAX_HARMONIC 202 70 // #define MAX_STACK_SIZE0 2 71 // #define MAX_STACK_SIZE 202 72 73 74 struct Value { 75 int Type; 76 double Val [NBR_MAX_HARMONIC * MAX_DIM]; 77 }; 78 79 struct TwoInt { int Int1, Int2; }; 80 81 /* ------------------------------------------------------------------------ */ 82 /* P r o b l e m */ 83 /* ------------------------------------------------------------------------ */ 84 85 struct Problem { 86 List_T *Group , *Expression; 87 List_T *FunctionSpace , *Constraint , *Formulation; 88 List_T *JacobianMethod, *IntegrationMethod; 89 List_T *Resolution , *PostProcessing , *PostOperation; 90 }; 91 92 /* ------------------------------------------------------------------------ */ 93 /* G r o u p */ 94 /* ------------------------------------------------------------------------ */ 95 96 struct Group { 97 char *Name; 98 int Num, Type, FunctionType, SuppListType, SuppListType2; 99 List_T *InitialList, *InitialSuppList, *InitialSuppList2; 100 List_T *ExtendedList, *ExtendedSuppList, *ExtendedSuppList2; 101 int InitialListGroupIndex, InitialSuppListGroupIndex, InitialSuppList2GroupIndex; 102 std::multimap<int, TwoInt> ExtendedListForSearch; 103 struct MovingBand2D *MovingBand2D; 104 }; 105 106 struct MovingBand2D { 107 List_T *InitialList1, *InitialList2; 108 List_T *ExtendedList1, *ExtendedList2; 109 int NbrNodes1, *NumNodes1, NbrNodes2, *NumNodes2; 110 double *x1, *y1, *z1, *x2, *y2, *z2, Area; 111 int Period2, ntr1, ntr2, Closed1, Closed2; 112 int PhysNum, StartNumTr, StartIndexTr; 113 int *b1_p1, *b1_p2, *b1_p3, *b2_p1, *b2_p2, *b2_p3; 114 }; 115 116 /* Group.Type */ 117 #define REGIONLIST 1 118 #define ELEMENTLIST 2 119 #define MOVINGBAND2D 3 120 121 /* Group.FunctionType */ 122 #define REGION 1 123 124 #define NODESOF 2 125 #define EDGESOF 3 126 #define FACETSOF 4 127 #define VOLUMESOF 5 128 #define ELEMENTSOF 6 129 130 #define GLOBAL 7 131 132 #define GROUPSOFNODESOF 11 133 #define GROUPSOFEDGESOF 12 134 #define GROUPSOFFACETSOF 13 135 #define GROUPSOFEDGESONNODESOF 14 136 #define GROUPOFREGIONSOF 15 137 138 #define EDGESOFTREEIN 21 139 #define FACETSOFTREEIN 22 140 141 #define DUALNODESOF 30 142 #define DUALEDGESOF 31 143 #define DUALFACETSOF 32 144 #define DUALVOLUMESOF 33 145 146 #define BOUNDARYOFDUALNODESOF 40 147 #define BOUNDARYOFDUALEDGESOF 41 148 #define BOUNDARYOFDUALFACETSOF 42 149 150 151 152 /* Group.SuppListType */ 153 #define SUPPLIST_NONE 0 154 #define SUPPLIST_NOT 1 155 #define SUPPLIST_STARTINGON 2 156 #define SUPPLIST_ONONESIDEOF 3 157 #define SUPPLIST_ONPOSITIVESIDEOF 4 158 #define SUPPLIST_ONNEGATIVESIDEOF 5 159 #define SUPPLIST_INSUPPORT 6 160 #define SUPPLIST_CONNECTEDTO 7 161 #define SUPPLIST_DISJOINTOF 8 162 163 164 /* ------------------------------------------------------------------------ */ 165 /* E x p r e s s i o n */ 166 /* ------------------------------------------------------------------------ */ 167 168 struct Expression { 169 char *Name; 170 int Type; 171 union { 172 double Constant; 173 List_T *WholeQuantity; 174 struct { 175 List_T *ExpressionPerRegion; 176 int ExpressionIndex_Default; 177 int NumLastRegion; struct Expression *ExpressionForLastRegion; 178 } PieceWiseFunction; 179 struct { 180 List_T *ExpressionPerRegion; 181 int ExpressionIndex_Default; 182 int NumLastRegion[2]; struct Expression *ExpressionForLastRegion; 183 } PieceWiseFunction2; 184 } Case; 185 }; 186 187 struct ExpressionPerRegion { 188 int RegionIndex, ExpressionIndex; 189 }; 190 191 struct ExpressionPerRegion2 { 192 int RegionIndex[2], ExpressionIndex; 193 }; 194 195 /* Expression.Type */ 196 #define UNDEFINED_EXP 0 197 #define CONSTANT 1 198 #define WHOLEQUANTITY 2 199 #define PIECEWISEFUNCTION 3 200 #define PIECEWISEFUNCTION2 4 201 202 203 /* ------------------------------------------------------------------------ */ 204 /* C o n s t r a i n t */ 205 /* ------------------------------------------------------------------------ */ 206 207 struct Constraint { 208 char *Name; 209 int Type; 210 List_T *ConstraintPerRegion; 211 List_T *MultiConstraintPerRegion; 212 }; 213 214 struct ConstraintPerRegion { 215 int Type, RegionIndex, SubRegionIndex, SubRegion2Index, TimeFunctionIndex; 216 union { 217 struct { int ExpressionIndex, ExpressionIndex2; } Fixed; 218 struct { char *ResolutionName; } Solve; 219 struct { int Node1, Node2; } Network; 220 struct { 221 int RegionRefIndex, SubRegionRefIndex; 222 int FilterIndex, CoefIndex, FunctionIndex, FunctionRefIndex; 223 int FilterIndex2, CoefIndex2, FunctionIndex2; 224 double ToleranceFactor; 225 } Link; 226 } Case; 227 }; 228 229 230 struct MultiConstraintPerRegion { 231 char *Name; 232 List_T *ConstraintPerRegion; 233 struct ConstraintActive *Active; 234 }; 235 236 struct ConstraintActive { 237 int TimeStep, SubTimeStep; 238 union { 239 struct { 240 int NbrNode, NbrBranch, NbrLoop; 241 int **MatNode, **MatLoop; 242 } Network; 243 struct { 244 List_T *Couples; 245 } Link; 246 } Case; 247 }; 248 249 /* Constraint.Type & ConstraintPerRegion.Type */ 250 #define NONE 0 251 #define ASSIGN 1 252 #define INIT 2 253 #define ASSIGNFROMRESOLUTION 3 254 #define INITFROMRESOLUTION 4 255 #define NETWORK 5 256 #define CST_LINK 6 257 #define CST_LINKCPLX 7 258 259 /* ------------------------------------------------------------------------ */ 260 /* J a c o b i a n M e t h o d */ 261 /* ------------------------------------------------------------------------ */ 262 263 struct JacobianMethod { 264 char *Name; 265 List_T *JacobianCase; 266 }; 267 268 struct JacobianCase { 269 int RegionIndex, TypeJacobian; 270 int NbrParameters; double *Para; 271 int CoefficientIndex; 272 }; 273 274 /* JacobianCase.TypeJacobian */ 275 /* WARNING! The numbering is important (boundary operator -> -1) */ 276 277 #define JACOBIAN_PNT 0 278 #define JACOBIAN_LIN 1 279 #define JACOBIAN_SUR 2 280 #define JACOBIAN_VOL 3 281 282 #define JACOBIAN_SUR_AXI 10 283 #define JACOBIAN_VOL_AXI 11 284 285 #define JACOBIAN_SUR_AXI_SQU 20 286 #define JACOBIAN_VOL_AXI_SQU 21 287 288 #define JACOBIAN_SUR_SPH_SHELL 30 289 #define JACOBIAN_VOL_SPH_SHELL 31 290 #define JACOBIAN_VOL_CYL_SHELL 32 291 292 #define JACOBIAN_SUR_AXI_SPH_SHELL 40 293 #define JACOBIAN_VOL_AXI_SPH_SHELL 41 294 295 #define JACOBIAN_SUR_AXI_SQU_SPH_SHELL 50 296 #define JACOBIAN_VOL_AXI_SQU_SPH_SHELL 51 297 298 #define JACOBIAN_SUR_RECT_SHELL 60 299 #define JACOBIAN_VOL_RECT_SHELL 61 300 301 #define JACOBIAN_SUR_AXI_RECT_SHELL 70 302 #define JACOBIAN_VOL_AXI_RECT_SHELL 71 303 304 #define JACOBIAN_SUR_AXI_SQU_RECT_SHELL 80 305 #define JACOBIAN_VOL_AXI_SQU_RECT_SHELL 81 306 307 #define JACOBIAN_VOL_UNI_DIR_SHELL 82 308 309 #define JACOBIAN_VOL_PLPD_X 90 310 311 #define JACOBIAN_VOL_AXI_PLPD_X 100 312 313 314 /* type of transformation */ 315 #define JACOBIAN_SPH 0 316 #define JACOBIAN_RECT 1 317 318 /* ------------------------------------------------------------------------ */ 319 /* I n t e g r a t i o n M e t h o d */ 320 /* ------------------------------------------------------------------------ */ 321 322 struct IntegrationMethod { 323 char *Name; 324 List_T *IntegrationCase; 325 int CriterionIndex; 326 }; 327 328 struct IntegrationCase { 329 int Type, SubType; 330 List_T *Case; 331 }; 332 333 /* IntegrationCase.Type */ 334 #define ANALYTIC 1 335 #define GAUSS 2 336 #define GAUSSLEGENDRE 3 337 338 /* IntegrationCase.SubType */ 339 #define STANDARD 1 340 #define SINGULAR 2 341 #define ADAPTATIVE 3 342 343 struct Quadrature { 344 int ElementType; 345 int NumberOfPoints, MaxNumberOfPoints; 346 int NumberOfDivisions, MaxNumberOfDivisions; 347 double StoppingCriterion; 348 void (*Function)(); 349 }; 350 351 352 /* ------------------------------------------------------------------------ */ 353 /* F u n c t i o n S p a c e */ 354 /* ------------------------------------------------------------------------ */ 355 356 struct FunctionSpace { 357 char *Name; 358 int Type; 359 List_T *BasisFunction, *SubSpace, *GlobalQuantity, *Constraint; 360 361 struct DofData *DofData, *MainDofData; 362 }; 363 364 struct BasisFunction { 365 char *Name, *NameOfCoef; 366 List_T *GlobalBasisFunction; 367 int Dimension, Num; 368 void (*Function)(); 369 void (*dFunction)(); 370 void (*dInvFunction)(); 371 void (*dPlusFunction)(); 372 List_T *SubFunction, *SubdFunction; 373 int SupportIndex, EntityIndex; 374 double Order; 375 int ElementType; 376 int Orient; 377 }; 378 379 struct GlobalBasisFunction { 380 int EntityIndex; /* Must be the first element of the structure */ 381 int FormulationIndex, DefineQuantityIndex, ResolutionIndex; 382 struct QuantityStorage *QuantityStorage; 383 }; 384 385 /* BasisFunction.Type */ 386 /* WARNING! The numbering is important (exterior derivative -> +1) */ 387 #define FORM0 0 388 #define FORM1 1 389 #define FORM2 2 390 #define FORM3 3 391 392 #define FORM0S 4 393 #define FORM1S 5 394 #define FORM2S 6 395 #define FORM3S 7 396 397 #define FORM0P 10 398 #define FORM1P 11 399 #define FORM2P 12 400 #define FORM3P 13 401 402 #define SCALAR 20 403 #define VECTOR 21 404 #define TENSOR 22 /* second-rank tensor of order 3 */ 405 #define TENSOR_SYM 23 406 #define TENSOR_DIAG 24 407 408 #define TENSOR_MH 25 409 410 /* VECTOR TENSOR_DIAG TENSOR_SYM TENSOR 411 |0| |0 | |0 1 2| |0 1 2| 412 |1| | 1 | |s 3 4| |3 4 5| 413 |2| | 2| |s s 5| |6 7 8| */ 414 415 #define VECTORP 31 416 417 struct SubSpace { 418 char *Name; 419 List_T *BasisFunction; 420 }; 421 422 struct GlobalQuantity { 423 char *Name; 424 int Num, Type, ReferenceIndex; 425 }; 426 427 /* GlobalQuantity.Type */ 428 #define ALIASOF 1 429 #define ASSOCIATEDWITH 2 430 431 struct ConstraintInFS { 432 int QuantityType, ReferenceIndex, EntityIndex; 433 struct ConstraintPerRegion *ConstraintPerRegion; 434 struct { 435 int ResolutionIndex; 436 struct ConstraintActive *Active; 437 } Active; /* a deplacer lorsque sera necessaire */ 438 }; 439 440 /* ConstraintInFS.QuantityType */ 441 #define LOCALQUANTITY 1 442 #define GLOBALQUANTITY 2 443 #define INTEGRALQUANTITY 3 444 #define NODOF 4 445 446 447 /* ------------------------------------------------------------------------ */ 448 /* F u n c t i o n */ 449 /* ------------------------------------------------------------------------ */ 450 451 struct Function { 452 void (*Fct)(); /* ANSI C++ forbids data member `Function' with 453 same name as enclosing class */ 454 int TypeOfValue, NbrArguments, NbrParameters; 455 double *Para; 456 char *String; 457 struct FunctionActive *Active; 458 }; 459 460 struct FunctionActive { 461 union { 462 struct { 463 int NbrPoint; 464 double *x, *y, *xc, *yc; 465 double *mi, *bi, *ci, *di; /* Akima */ 466 } Interpolation; 467 struct { 468 List_T *RegionList; 469 int RegionCurrent; 470 double Value; 471 } SurfaceArea; 472 struct { 473 double Value; 474 } GetVolume; 475 struct { 476 int Value; 477 } GetNumElements; 478 struct { 479 List_T *Table; 480 } ValueFromIndex; 481 struct { 482 int NbrLines, NbrColumns; 483 double *x, *y ; 484 double *data ; 485 } ListMatrix; 486 struct { 487 int NbrLinesX, NbrLinesY, NbrLinesZ; 488 double *x, *y, *z ; 489 double *data ; 490 } ListMatrix3D; 491 } Case; 492 }; 493 494 /* ------------------------------------------------------------------------ */ 495 /* F o r m u l a t i o n */ 496 /* ------------------------------------------------------------------------ */ 497 498 struct Formulation { 499 char *Name; 500 int Type; 501 List_T *DefineQuantity, *Equation; 502 }; 503 504 /* Formulation.Type */ 505 #define FEMEQUATION 1 506 #define BEMEQUATION 2 507 #define GLOBALEQUATION 3 508 509 struct IntegralQuantity { 510 List_T *WholeQuantity; 511 int DofIndexInWholeQuantity; 512 513 int TypeOperatorDof, DefineQuantityIndexDof; 514 int DefineQuantityIndexNoDof; 515 516 int NbrQuantityIndex, *QuantityIndexTable; 517 int *QuantityTraceGroupIndexTable ; 518 519 int InIndex; 520 int IntegrationMethodIndex, JacobianMethodIndex; 521 int Symmetry; 522 523 int CanonicalWholeQuantity, ExpressionIndexForCanonical; 524 struct Function FunctionForCanonical, AnyFunction; 525 }; 526 527 struct IntegralQuantityActive { 528 int Type_FormDof, Type_ValueDof; 529 530 List_T *IntegrationCase_L; 531 struct IntegrationCase *IntegrationCase_P; 532 int CriterionIndex; 533 void (*Get_IntPoint)(); 534 int Nbr_IntPoints; 535 536 List_T *JacobianCase_L; 537 double (*Get_Jacobian)(); 538 int Type_Dimension; 539 void (*xChangeOfCoordinates)(); 540 }; 541 542 543 struct FirstElement { 544 struct Dof *Equ; 545 struct Dof *Dof; 546 double Value; 547 }; 548 549 struct DefineQuantity { 550 char *Name; 551 int Type; 552 int FunctionSpaceIndex; 553 554 /* for subspaces */ 555 List_T *IndexInFunctionSpace; 556 557 /* for MH calculation - possibly reduced frequency spectrum for some quantities*/ 558 List_T *FrequencySpectrum; 559 560 /* for multiple DofData vs. one FunctionSpace */ 561 int DofDataIndex; 562 struct DofData *DofData; 563 564 /* for integral quantities */ 565 struct IntegralQuantity IntegralQuantity; 566 }; 567 568 // second order hex with 3 BFs per node for elasticity 569 #define NBR_MAX_BASISFUNCTIONS 81 570 571 struct QuantityStorage { 572 573 struct DefineQuantity *DefineQuantity; 574 575 int NumLastElementForFunctionSpace; 576 int NumLastElementForDofDefinition; 577 int NumLastElementForEquDefinition; 578 579 struct FunctionSpace *FunctionSpace; 580 581 int NbrElementaryBasisFunction; 582 int TypeQuantity; 583 struct { 584 struct Dof *Dof; 585 int NumEntityInElement; 586 int CodeBasisFunction, CodeEntity; 587 int CodeAssociateBasisFunction; 588 int Constraint; 589 int Constraint_Index; 590 double Value[NBR_MAX_HARMONIC]; 591 double Value2[NBR_MAX_HARMONIC]; // for two-step INIT 592 int TimeFunctionIndex; 593 int CodeEntity_Link; 594 struct BasisFunction *BasisFunction; 595 } BasisFunction [NBR_MAX_BASISFUNCTIONS]; 596 597 }; 598 599 /* DefineQuantity.Type */ 600 /* LOCALQUANTITY 601 GLOBALQUANTITY 602 INTEGRALQUANTITY */ 603 604 struct EquationTerm { 605 int Type; 606 607 union { 608 609 struct FemLocalTerm { 610 struct { 611 int TypeTimeDerivative; 612 613 List_T *WholeQuantity; 614 int DofIndexInWholeQuantity; 615 int CanonicalWholeQuantity, ExpressionIndexForCanonical; 616 struct Function FunctionForCanonical; 617 int CanonicalWholeQuantity_Equ, ExpressionIndexForCanonical_Equ, 618 OperatorTypeForCanonical_Equ; 619 void (*BuiltInFunction_Equ)(); 620 621 int NbrQuantityIndex, *QuantityIndexTable, QuantityIndexPost; 622 int *QuantityTraceGroupIndexTable; 623 624 int TypeOperatorEqu, DefineQuantityIndexEqu; 625 int TypeOperatorDof, DefineQuantityIndexDof; 626 int DefineQuantityIndexNoDof, DofInTrace; 627 } Term; 628 629 int InIndex, SubRegion; 630 int Full_Matrix; 631 int IntegrationMethodIndex, JacobianMethodIndex; 632 633 int ExpressionIndexForMetricTensor; 634 635 int MatrixIndex; 636 struct FemLocalTermActive *Active; 637 } LocalTerm; 638 639 640 struct FemGlobalTerm { 641 int TypeTimeDerivative; 642 int DefineQuantityIndex; 643 644 struct { 645 int TypeTimeDerivative; 646 647 List_T *WholeQuantity; 648 int DofIndexInWholeQuantity; 649 int CanonicalWholeQuantity, ExpressionIndexForCanonical; 650 651 int NbrQuantityIndex, *QuantityIndexTable; 652 int *QuantityTraceGroupIndexTable ; 653 654 int TypeOperatorEqu, DefineQuantityIndexEqu; 655 int TypeOperatorDof, DefineQuantityIndexDof; 656 int DefineQuantityIndexNoDof; 657 } Term; 658 int InIndex; 659 int SubType; 660 struct FemGlobalTermActive *Active; 661 } GlobalTerm; 662 663 664 struct GlobalEquation { 665 int Type, ConstraintIndex; 666 List_T *GlobalEquationTerm; 667 } GlobalEquation; 668 669 } Case; 670 }; 671 672 struct FemLocalTermActive { 673 struct QuantityStorage *QuantityStorageEqu_P; 674 struct QuantityStorage *QuantityStorageDof_P; 675 struct Dof *DofForNoDof_P; 676 677 int Type_FormEqu, Type_FormDof, Type_ValueDof; 678 int Type_DefineQuantityDof; 679 int SymmetricalMatrix; 680 681 List_T *IntegrationCase_L, *JacobianCase_L; 682 int CriterionIndex; 683 struct JacobianCase *JacobianCase_P0; 684 int NbrJacobianCase, Flag_ChangeCoord, Flag_InvJac; 685 double CoefJac; 686 687 void (*xChangeOfCoordinatesEqu)(); 688 void (*xChangeOfCoordinatesDof)(); 689 double (*Cal_Productx)(); 690 void (*Function_AssembleTerm)(); 691 692 struct IntegralQuantityActive IntegralQuantityActive; 693 694 int MHBilinear, MHBilinear_Index, MHBilinear_NbrPointsX, MHBilinear_HarOffSet; 695 int MHBilinear_JacNL; 696 List_T *MHBilinear_WholeQuantity_L; 697 double **MHBilinear_H, ***MHBilinear_HH, *MHBilinear_t, *MHBilinear_w; 698 699 int Full_Matrix; 700 int NbrEqu, NbrHar, *NumEqu, *NumDof; 701 struct Dof *Equ, *Dof; 702 List_T *FirstElements; 703 double **Matrix; 704 }; 705 706 struct FemGlobalTermActive { 707 struct QuantityStorage *QuantityStorageEqu_P; 708 struct QuantityStorage *QuantityStorageDof_P; 709 int flag_Dof; 710 }; 711 712 struct GlobalQuantityStorage { 713 int NumEquation; 714 int NumDof; 715 716 int CodeGlobalQuantity, CodeAssociateBasisFunction; 717 718 int CodeEntity; 719 int Constraint; 720 double Value[NBR_MAX_HARMONIC]; 721 int TimeFunctionIndex; 722 }; 723 724 struct GlobalEquationTerm { 725 int DefineQuantityIndexNode, DefineQuantityIndexLoop; 726 int DefineQuantityIndexEqu; 727 int InIndex; 728 }; 729 730 731 /* EquationTerm.Type */ 732 #define GALERKIN 1 733 #define GLOBALTERM 2 734 #define GLOBALEQUATION 3 735 #define DERHAM 4 736 737 /* EquationTerm.SubType */ 738 #define EQ_ST_SELF 1 739 #define EQ_ST_MUTUAL 2 740 #define EQ_ST_SELFANDMUTUAL 3 741 742 /* Term.TypeOfTimeDerivative */ 743 #define NODT_ 0 744 #define DT_ 1 745 #define DTDOF_ 2 746 #define DTDT_ 3 747 #define DTDTDOF_ 4 748 #define DTDTDTDOF_ 5 749 #define DTDTDTDTDOF_ 6 750 #define DTDTDTDTDTDOF_ 7 751 #define JACNL_ 10 752 #define NEVERDT_ 11 753 #define DTNL_ 12 754 #define DTDOFJACNL_ 13 755 #define EIG_ 14 756 #define NLEIG1DOF_ 20 757 #define NLEIG2DOF_ 21 758 #define NLEIG3DOF_ 22 759 #define NLEIG4DOF_ 23 760 #define NLEIG5DOF_ 24 761 #define NLEIG6DOF_ 25 762 763 /* Term.TypeOperator */ 764 #define NOOP 0 765 766 #define EXTDER 1 767 #define GRAD 2 768 #define CURL 3 769 #define DIV 4 770 771 #define EXTDERINV 5 772 #define GRADINV 6 773 #define CURLINV 7 774 #define DIVINV 8 775 776 /* Tous ces operateurs de trace ne servent a RIEN pour le moment 777 De plus, les 'x' sont ambigus. Il faut penser a definir des 778 operateurs de trace (T ou T*), qui doivent avoir, outre 779 \Gamma=\partial\Omega, l'info concernant \Omega. 780 */ 781 #define NPx 9 782 #define NPxEXTDER 10 783 #define NPxGRAD 11 784 #define NPxCURL 12 785 #define NPxDIV 13 786 787 #define NSx 14 788 #define NSxEXTDER 15 789 #define NSxGRAD 16 790 #define NSxCURL 17 791 #define NSxDIV 18 792 793 #define OP_D1 21 794 #define OP_D2 22 795 #define OP_D3 23 796 797 798 /* CanonicalWholeQuantity */ 799 #define CWQ_NONE 0 800 #define CWQ_DOF 1 801 #define CWQ_EXP_TIME_DOF 2 802 #define CWQ_FCT_TIME_DOF 3 803 #define CWQ_FCT_PVEC_DOF 4 804 #define CWQ_FCT_DOF 20 805 806 #define CWQ_GF 5 807 #define CWQ_GF_PSCA_DOF 6 808 #define CWQ_GF_PSCA_EXP 7 809 #define CWQ_GF_PVEC_DOF 8 810 #define CWQ_DOF_PVEC_GF 9 811 #define CWQ_GF_PVEC_EXP 10 812 #define CWQ_EXP_PVEC_GF 11 813 814 #define CWQ_EXP_TIME_GF_PSCA_DOF 12 815 #define CWQ_EXP_TIME_GF_PVEC_DOF 13 816 #define CWQ_EXP_PVEC_GF_PSCA_DOF 14 817 #define CWQ_EXP_PVEC_GF_PVEC_DOF 15 818 #define CWQ_FCT_TIME_GF_PSCA_DOF 16 819 #define CWQ_FCT_TIME_GF_PVEC_DOF 17 820 #define CWQ_FCT_PVEC_GF_PSCA_DOF 18 821 #define CWQ_FCT_PVEC_GF_PVEC_DOF 19 822 823 /* ------------------------------------------------------------------------ */ 824 /* W h o l e Q u a n t i t y */ 825 /* ------------------------------------------------------------------------ */ 826 827 struct WholeQuantity { 828 int Type; 829 830 union { 831 double Constant; 832 struct Function Function; 833 struct { int TypeOperator, Index, NbrArguments; 834 int TypeQuantity; } OperatorAndQuantity; 835 struct { int Index, NbrArguments; } Expression; 836 struct { List_T *WholeQuantity; } TimeDerivative; 837 struct { List_T *WholeQuantity; int TimeStep; } AtAnteriorTimeStep; 838 struct { List_T *WholeQuantity; 839 double TimeInit; double TimeFinal; } MaxOverTime; 840 struct { List_T *WholeQuantity; 841 double TimeInit; double TimeFinal; int NbrFrequency; 842 double Exponent_f; double Exponent_b; } FourierSteinmetz; 843 struct { double *Value; } CurrentValue; 844 struct { char *Name; } NamedValue; 845 struct { int Index; } Argument; 846 struct { List_T *WholeQuantity_True, *WholeQuantity_False; } Test; 847 struct { int Index; } SaveValue; 848 struct { int Index; } ShowValue; 849 struct { int Index; } ValueSaved; 850 struct { int TypeOperator; void (*Function)(); } Operator; /* binary or unary */ 851 struct { List_T *WholeQuantity; 852 int FunctionSpaceIndexForType, NbrHar; } Cast; 853 struct { List_T *WholeQuantity ; } ChangeCurrentPosition ; 854 struct { List_T *WholeQuantity ; 855 int InIndex, DofIndexInWholeQuantity; } Trace; 856 struct { char *SystemName; int DefineSystemIndex; 857 int DofNumber; } DofValue; 858 struct { List_T *WholeQuantity_L; int Index, NbrPoints; } MHTransform; 859 struct { List_T *WholeQuantity_L; int Index, NbrPoints, FreqOffSet; } MHBilinear; 860 } Case; 861 862 }; 863 864 /* WholeQuantity.Type */ 865 #define WQ_OPERATORANDQUANTITY 1 866 #define WQ_OPERATORANDQUANTITYEVAL 2 867 #define WQ_BINARYOPERATOR 3 868 #define WQ_UNARYOPERATOR 4 869 #define WQ_EXPRESSION 5 870 #define WQ_BUILTINFUNCTION 6 871 #define WQ_EXTERNBUILTINFUNCTION 7 872 #define WQ_CONSTANT 8 873 #define WQ_CURRENTVALUE 9 874 #define WQ_ARGUMENT 10 875 #define WQ_TIMEDERIVATIVE 11 876 #define WQ_CAST 12 877 #define WQ_TEST 13 878 #define WQ_SAVEVALUE 14 879 #define WQ_VALUESAVED 15 880 #define WQ_SOLIDANGLE 16 881 #define WQ_TRACE 17 882 #define WQ_ORDER 18 883 #define WQ_MHTIMEINTEGRATION 19 884 #define WQ_MHTRANSFORM 20 885 #define WQ_SHOWVALUE 21 886 #define WQ_MHBILINEAR 23 887 #define WQ_POSTSAVE 24 888 #define WQ_ATANTERIORTIMESTEP 25 889 #define WQ_CHANGECURRENTPOSITION 26 890 #define WQ_MAXOVERTIME 27 891 #define WQ_FOURIERSTEINMETZ 28 892 #define WQ_SAVENAMEDVALUE 29 893 #define WQ_NAMEDVALUESAVED 30 894 895 /* TypeOperator */ 896 #define OP_PLUS 1 897 #define OP_MINUS 2 898 #define OP_TIME 3 899 #define OP_DIVIDE 4 900 #define OP_MODULO 5 901 #define OP_POWER 6 902 #define OP_CROSSPRODUCT 7 903 #define OP_LESS 8 904 #define OP_GREATER 9 905 #define OP_LESSOREQUAL 10 906 #define OP_GREATEROREQUAL 11 907 #define OP_EQUAL 12 908 #define OP_NOTEQUAL 13 909 #define OP_APPROXEQUAL 14 910 #define OP_AND 15 911 #define OP_OR 16 912 #define OP_NEG 17 913 #define OP_NOT 18 914 915 /* OperatorAndQuantity.TypeQuantity */ 916 917 #define QUANTITY_SIMPLE 1 918 #define QUANTITY_DOF 2 919 #define QUANTITY_NODOF 3 920 #define QUANTITY_BF 4 921 922 923 /* ------------------------------------------------------------------------ */ 924 /* R e s o l u t i o n */ 925 /* ------------------------------------------------------------------------ */ 926 927 struct Resolution { 928 char *Name; 929 bool Hidden; 930 List_T *DefineSystem, *Operation; 931 }; 932 933 struct DefineSystem { 934 char *Name; 935 int Type; 936 List_T *FormulationIndex, *FrequencyValue; 937 char *SolverDataFileName; 938 939 char *MeshName, *AdaptName; 940 List_T *OriginSystemIndex; 941 char *DestinationSystemName; 942 int DestinationSystemIndex; 943 }; 944 945 /* DefineSystem.Type */ 946 #define VAL_REAL 1 947 #define VAL_COMPLEX 2 948 949 struct Operation { 950 int Type, DefineSystemIndex, Flag; 951 952 union { 953 struct { 954 List_T *MatrixIndex_L; 955 } GenerateOnly; 956 struct { 957 int DefineSystemIndex; 958 } SolveAgainWithOther; 959 struct { 960 char *String; 961 } SystemCommand; 962 struct { 963 char *String; 964 } Error; 965 struct { 966 char *FileName, *RunTimeVar; 967 int ViewTag; 968 } GmshRead; 969 struct { 970 char *FileName; 971 } DeleteFile; 972 struct { 973 char *OldFileName, *NewFileName; 974 } RenameFile; 975 struct { 976 char *DirName; 977 } CreateDir; 978 struct { 979 int ExpressionIndex; 980 } SetTime; 981 struct { 982 int ExpressionIndex; 983 } Sleep; 984 struct { 985 int ExpressionIndex; 986 } Update; 987 struct { 988 int GroupIndex, Type; 989 } UpdateConstraint; 990 struct { 991 char *VariableName; 992 int NormType; 993 } GetNorm; 994 struct { 995 int CopyFromTimeStep; 996 } CreateSolution; 997 struct { 998 int ExpressionIndex; 999 } SetFrequency; 1000 struct { 1001 List_T *Frequency; 1002 int DefineSystemIndex[2]; 1003 } FourierTransform; 1004 struct { 1005 int DefineSystemIndex[2]; 1006 double Period, Period_sofar; 1007 double *Scales; 1008 } FourierTransform2; 1009 struct { 1010 int Size; 1011 List_T *Save; 1012 double Shift; 1013 } Lanczos; 1014 struct { 1015 int NumEigenvalues; 1016 double Shift_r, Shift_i; 1017 int FilterExpressionIndex; 1018 List_T *RationalCoefsNum, *RationalCoefsDen; 1019 List_T *ApplyResolventRealFreqs; 1020 int DefineOtherSystemIndex; 1021 } EigenSolve; 1022 struct { 1023 List_T *Expressions; 1024 } Evaluate; 1025 struct { 1026 int Iteration ; 1027 } SelectCorrection ; 1028 struct { 1029 double Alpha ; 1030 } AddCorrection ; 1031 struct { 1032 double Alpha ; 1033 } MultiplySolution ; 1034 struct { 1035 int Size; 1036 List_T *Save; 1037 double Shift; 1038 int PertFreq; 1039 int DefineSystemIndex2, DefineSystemIndex3; 1040 } Perturbation; 1041 struct { 1042 double Time0, TimeMax; 1043 int DTimeIndex, ThetaIndex; 1044 List_T *Operation; 1045 } TimeLoopTheta; 1046 struct { 1047 double Time0, TimeMax, Beta, Gamma; 1048 int DTimeIndex; 1049 List_T *Operation; 1050 } TimeLoopNewmark; 1051 struct { 1052 double Time0, TimeMax; 1053 List_T *ButcherA, *ButcherB, *ButcherC; 1054 int DTimeIndex; 1055 } TimeLoopRungeKutta; 1056 struct { 1057 double Time0, TimeMax, DTimeInit, DTimeMin, DTimeMax; 1058 double LTEtarget, DTimeMaxScal, DTimeScal_NotConverged; 1059 char *Scheme; 1060 List_T *Breakpoints_L; 1061 List_T *TimeLoopAdaptiveSystems_L; 1062 List_T *TimeLoopAdaptivePOs_L; 1063 List_T *Operation, *OperationEnd; 1064 } TimeLoopAdaptive; 1065 struct { 1066 double Criterion; 1067 int NbrMaxIteration, RelaxationFactorIndex, Flag; 1068 List_T *IterativeLoopSystems_L; 1069 List_T *IterativeLoopPOs_L; 1070 List_T *Operation; 1071 } IterativeLoop; 1072 struct { 1073 double Criterion, DivisionCoefficient; 1074 int NbrMaxIteration, Flag; 1075 List_T *ChangeOfState; 1076 List_T *Operation, *OperationEnd; 1077 } IterativeTimeReduction; 1078 struct { 1079 char *OpMatMult; 1080 char *Type; 1081 double Tolerance; 1082 int MaxIter; 1083 int Restart; 1084 List_T *MyFieldTag; 1085 List_T *NeighborFieldTag; 1086 List_T *DeflationIndices; 1087 List_T *Operations_Ax, *Operations_Mx; 1088 } IterativeLinearSolver; 1089 struct { 1090 int ExpressionIndex; 1091 List_T *Operation_True, *Operation_False; 1092 } Test; 1093 struct { 1094 int ExpressionIndex; 1095 List_T *Operation; 1096 } While; 1097 struct { 1098 List_T *DofNumber, *TimeStep, *Expressions; 1099 char *FileOut, *FormatString; 1100 } Print; 1101 struct { 1102 int GroupIndex, ExpressionIndex; 1103 int NumNode, ExpressionIndex2; 1104 } ChangeOfCoordinates; 1105 struct { 1106 int CheckAll; 1107 List_T *Factor_L; 1108 } SolveJac_AdaptRelax; 1109 struct{ 1110 int GroupIndex; 1111 bool SaveFixed; 1112 } SaveSolutionWithEntityNum; 1113 struct { 1114 int NbrFreq; 1115 char *ResFile; 1116 } SaveSolutionExtendedMH; 1117 struct { 1118 List_T *Time; 1119 char *ResFile; 1120 } SaveSolutionMHtoTime; 1121 struct { 1122 List_T *PostOperations; 1123 } PostOperation; 1124 struct { 1125 int GroupIndex; 1126 } Init_MovingBand2D; 1127 struct { 1128 int GroupIndex; 1129 } Mesh_MovingBand2D; 1130 struct { 1131 int GroupIndex; 1132 double Period; 1133 int NbrStep; 1134 List_T *Operation; 1135 } Generate_MH_Moving; 1136 struct { 1137 int GroupIndex; 1138 double Period; 1139 int NbrStep; 1140 List_T *Operation; 1141 } Generate_MH_Moving_S; 1142 struct { 1143 int GroupIndex; 1144 int NumListOfRHS; 1145 } Generate; 1146 struct { 1147 int GroupIndex; 1148 char *FileName; 1149 int ExprIndex; 1150 } SaveMesh; 1151 struct { 1152 char *Quantity, *Quantity2, *Quantity3; 1153 char *Name_MshFile; 1154 int GeoDataIndex; 1155 double Factor; 1156 int GroupIndex; 1157 } DeformMesh; 1158 struct { 1159 char *String; 1160 } SetGlobalSolverOptions; 1161 struct { 1162 List_T *ViewTags; 1163 } BroadcastFields; 1164 struct { 1165 int from; 1166 List_T *Names; 1167 List_T *id; 1168 } BroadcastVariables; 1169 struct { 1170 int to; 1171 List_T *Names; 1172 List_T *id; 1173 } GatherVariables; 1174 struct { 1175 int from; 1176 List_T *Names; 1177 List_T *id; 1178 } ScatterVariables; 1179 struct { 1180 int from; 1181 List_T *Names; 1182 List_T *id; 1183 } CheckVariables; 1184 struct { 1185 List_T *Names; 1186 } ClearVariables; 1187 struct { 1188 List_T *Names; 1189 } ClearVectors; 1190 struct { 1191 int useList; 1192 char *from, *to; 1193 } Copy; 1194 struct { 1195 int alphaIndex, betaIndex; 1196 char *v1, *v2, *v3; // v3=alpha*v1+beta*v2 1197 } AddVector; 1198 struct { 1199 char *algorithm; 1200 char *currentPoint; // input and ouput 1201 List_T *currentPointLowerBounds, *currentPointUpperBounds; 1202 char *objective, *objectiveSensitivity; // input 1203 List_T *constraints, *constraintsSensitivity; // input 1204 } OptimizerInitialize; 1205 struct { 1206 char *residual; 1207 } OptimizerUpdate; 1208 struct { 1209 int order; 1210 } SetExtrapolationOrder; 1211 } Case; 1212 1213 }; 1214 1215 struct ChangeOfState { 1216 int Type; 1217 int QuantityIndex, InIndex, FormulationIndex; 1218 double Criterion; 1219 double *ActiveList[2]; 1220 int ExpressionIndex, ExpressionIndex2, FlagIndex; 1221 }; 1222 1223 struct TimeLoopAdaptiveSystem { 1224 int SystemIndex; 1225 double SystemLTEreltol; 1226 double SystemLTEabstol; 1227 int NormType; 1228 char *NormTypeString; 1229 }; 1230 1231 struct LoopErrorPostOperation { 1232 char *PostOperationName; 1233 int PostOperationIndex; 1234 double PostOperationReltol; 1235 double PostOperationAbstol; 1236 int NormType; 1237 char *NormTypeString; 1238 List_T *Save_Format_L, *Save_LastTimeStepOnly_L; 1239 List_T *Save_FileOut_L; 1240 }; 1241 1242 struct IterativeLoopSystem { 1243 int SystemIndex; 1244 double SystemILreltol; 1245 double SystemILabstol; 1246 int NormType; 1247 char *NormTypeString; 1248 int NormOf; 1249 char *NormOfString; 1250 }; 1251 1252 /* Operation.Type */ 1253 #define OPERATION_NONE 0 1254 1255 #define OPERATION_ADDCORRECTION 1 1256 #define OPERATION_ADDOPPOSITEFULLSOLUTION 2 1257 #define OPERATION_ADDMHMOVING 3 1258 #define OPERATION_APPLY 4 1259 #define OPERATION_BARRIER 5 1260 #define OPERATION_BREAK 6 1261 #define OPERATION_BROADCASTFIELDS 7 1262 #define OPERATION_CHANGEOFCOORDINATES 8 1263 #define OPERATION_CHANGEOFCOORDINATES2 9 1264 #define OPERATION_CREATEDIR 10 1265 #define OPERATION_DEFORMMESH 11 1266 #define OPERATION_DELETEFILE 12 1267 #define OPERATION_DOFSFREQUENCYSPECTRUM 13 1268 #define OPERATION_EIGENSOLVE 14 1269 #define OPERATION_EIGENSOLVEJAC 15 1270 #define OPERATION_EVALUATE 16 1271 #define OPERATION_FOURIERTRANSFORM 17 1272 #define OPERATION_FOURIERTRANSFORM2 18 1273 #define OPERATION_GENERATE 19 1274 #define OPERATION_GENERATEJAC 20 1275 #define OPERATION_GENERATEJAC_CUMULATIVE 21 1276 #define OPERATION_GENERATEONLY 22 1277 #define OPERATION_GENERATEONLYJAC 23 1278 #define OPERATION_GENERATERHS 24 1279 #define OPERATION_GENERATERHS_CUMULATIVE 25 1280 #define OPERATION_GENERATESEPARATE 26 1281 #define OPERATION_GENERATE_CUMULATIVE 27 1282 #define OPERATION_GENERATE_MH_MOVING 28 1283 #define OPERATION_GENERATE_MH_MOVING_S 29 1284 #define OPERATION_GMSHCLEARALL 30 1285 #define OPERATION_GMSHMERGE 31 1286 #define OPERATION_GMSHOPEN 32 1287 #define OPERATION_GMSHREAD 33 1288 #define OPERATION_GMSHWRITE 34 1289 #define OPERATION_INITCORRECTION 35 1290 #define OPERATION_INITSOLUTION 36 1291 #define OPERATION_INITSOLUTION1 37 1292 #define OPERATION_INIT_MOVINGBAND2D 38 1293 #define OPERATION_ITERATIVELINEARSOLVER 39 1294 #define OPERATION_ITERATIVELOOP 40 1295 #define OPERATION_ITERATIVELOOPN 41 1296 #define OPERATION_ITERATIVETIMEREDUCTION 42 1297 #define OPERATION_LANCZOS 43 1298 #define OPERATION_MESH_MOVINGBAND2D 44 1299 #define OPERATION_MULTIPLYSOLUTION 45 1300 #define OPERATION_PERTURBATION 46 1301 #define OPERATION_POSTOPERATION 47 1302 #define OPERATION_PRINT 48 1303 #define OPERATION_READ 49 1304 #define OPERATION_READSOLUTION 50 1305 #define OPERATION_SAVEMESH 51 1306 #define OPERATION_SAVESOLUTION 52 1307 #define OPERATION_SAVESOLUTIONEXTENDEDMH 53 1308 #define OPERATION_SAVESOLUTIONMHTOTIME 54 1309 #define OPERATION_SAVESOLUTIONS 55 1310 #define OPERATION_SAVESOLUTION_WITH_ENTITY_NUM 56 1311 #define OPERATION_SCAN 57 1312 #define OPERATION_SELECTCORRECTION 58 1313 #define OPERATION_SETCOMMSELF 59 1314 #define OPERATION_SETCOMMWORLD 60 1315 #define OPERATION_SETCURRENTSYSTEM 61 1316 #define OPERATION_SETFREQUENCY 62 1317 #define OPERATION_SETGLOBALSOLVEROPTIONS 63 1318 #define OPERATION_SETRHSASSOLUTION 64 1319 #define OPERATION_SETSOLUTIONASRHS 65 1320 #define OPERATION_SETTIME 66 1321 #define OPERATION_SOLVE 67 1322 #define OPERATION_SOLVEAGAIN 68 1323 #define OPERATION_SOLVEAGAINWITHOTHER 69 1324 #define OPERATION_SOLVEJAC 70 1325 #define OPERATION_SOLVEJACADAPTRELAX 71 1326 #define OPERATION_SOLVEJACAGAIN 72 1327 #define OPERATION_SOLVENL 73 1328 #define OPERATION_SYSTEMCOMMAND 74 1329 #define OPERATION_TEST 75 1330 #define OPERATION_TIMELOOPADAPTIVE 76 1331 #define OPERATION_TIMELOOPNEWMARK 77 1332 #define OPERATION_TIMELOOPRUNGEKUTTA 78 1333 #define OPERATION_TIMELOOPTHETA 79 1334 #define OPERATION_TRANSFERSOLUTION 80 1335 #define OPERATION_UPDATE 81 1336 #define OPERATION_UPDATECONSTRAINT 82 1337 #define OPERATION_WRITE 83 1338 #define OPERATION_GETRESIDUAL 84 1339 #define OPERATION_RENAMEFILE 85 1340 #define OPERATION_WHILE 86 1341 #define OPERATION_SETTIMESTEP 87 1342 #define OPERATION_ERROR 88 1343 #define OPERATION_SLEEP 89 1344 #define OPERATION_SWAPSOLUTIONANDRHS 90 1345 #define OPERATION_SWAPSOLUTIONANDRESIDUAL 91 1346 #define OPERATION_CREATESOLUTION 92 1347 #define OPERATION_SETDTIME 93 1348 #define OPERATION_REMOVELASTSOLUTION 94 1349 #define OPERATION_COPYSOLUTION 95 1350 #define OPERATION_COPYRHS 96 1351 #define OPERATION_COPYRESIDUAL 97 1352 #define OPERATION_COPYINCREMENT 98 1353 #define OPERATION_COPYDOFS 99 1354 #define OPERATION_GETNORMSOLUTION 100 1355 #define OPERATION_GETNORMRHS 101 1356 #define OPERATION_GETNORMRESIDUAL 102 1357 #define OPERATION_GETNORMINCREMENT 103 1358 #define OPERATION_HPDDMSOLVE 104 1359 #define OPERATION_BROADCASTVARIABLES 105 1360 #define OPERATION_DEBUG 106 1361 #define OPERATION_OPTIMIZER_INITIALIZE 107 1362 #define OPERATION_OPTIMIZER_UPDATE 108 1363 #define OPERATION_OPTIMIZER_FINALIZE 109 1364 #define OPERATION_SETEXTRAPOLATIONORDER 110 1365 #define OPERATION_SETINCREMENTASSOLUTION 111 1366 #define OPERATION_ADDVECTOR 112 1367 #define OPERATION_CLEARVARIABLES 113 1368 #define OPERATION_CHECKVARIABLES 114 1369 #define OPERATION_CLEARVECTORS 115 1370 #define OPERATION_GATHERVARIABLES 116 1371 #define OPERATION_SCATTERVARIABLES 117 1372 #define OPERATION_EXIT 118 1373 #define OPERATION_GENERATELISTOFRHS 119 1374 1375 /* ChangeOfState.Type */ 1376 #define CHANGEOFSTATE_NOCHANGE 0 1377 #define CHANGEOFSTATE_CHANGESIGN 1 1378 #define CHANGEOFSTATE_CHANGELEVEL 2 1379 #define CHANGEOFSTATE_CHANGEREFERENCE 3 1380 #define CHANGEOFSTATE_CHANGEREFERENCE2 4 1381 1382 /* TimeLoopAdaptiveSystem.NormType */ 1383 #define LINFNORM 1 1384 #define L1NORM 2 1385 #define MEANL1NORM 3 1386 #define L2NORM 4 1387 #define MEANL2NORM 5 1388 1389 /* IterativeLoopSystem.NormOf */ 1390 #define SOLUTION 1 1391 #define RESIDUAL 2 1392 #define RECALCRESIDUAL 3 1393 1394 1395 /* ------------------------------------------------------------------------ */ 1396 /* P r e R e s o l u t i o n I n f o */ 1397 /* ------------------------------------------------------------------------ */ 1398 1399 struct PreResolutionInfo { 1400 int Index, Type ; 1401 } ; 1402 1403 /* Type PreResolution */ 1404 1405 #define PR_CONSTRAINT 1 1406 #define PR_GLOBALBASISFUNCTION 2 1407 1408 1409 /* ------------------------------------------------------------------------ */ 1410 /* P o s t P r o c e s s i n g */ 1411 /* ------------------------------------------------------------------------ */ 1412 1413 struct PostProcessing { 1414 char *Name; 1415 int FormulationIndex; 1416 List_T *OriginSystemIndex; 1417 char *NameOfSystem; 1418 List_T *PostQuantity; 1419 int Rank; 1420 }; 1421 1422 struct PostQuantity { 1423 char *Name; 1424 List_T *PostQuantityTerm; 1425 }; 1426 1427 struct PostQuantityTerm { 1428 int Type, EvaluationType; 1429 1430 int TypeTimeDerivative; 1431 List_T *WholeQuantity; 1432 int NbrQuantityIndex, *QuantityIndexTable; 1433 int *QuantityTraceGroupIndexTable; 1434 int InIndex, SubRegion, JacobianMethodIndex, IntegrationMethodIndex; 1435 }; 1436 1437 /* PostQuantityTerm.Type */ 1438 /* LOCALQUANTITY 1439 GLOBALQUANTITY 1440 INTEGRALQUANTITY */ 1441 1442 /* PostQuantityTerm.EvaluationType */ 1443 #define LOCAL 1 1444 #define INTEGRAL 2 1445 1446 /* ------------------------------------------------------------------------ */ 1447 /* P o s t O p e r a t i o n */ 1448 /* ------------------------------------------------------------------------ */ 1449 1450 struct PostOperation { 1451 char *Name, *AppendString, *Comma; 1452 bool Hidden; 1453 int PostProcessingIndex, Format; 1454 List_T *PostSubOperation; 1455 int Rank; 1456 double ResampleTimeStart, ResampleTimeStop, ResampleTimeStep; 1457 bool ResampleTime; 1458 List_T *TimeValue_L, *TimeImagValue_L; 1459 int LastTimeStepOnly, OverrideTimeStepValue, NoMesh, CatFile; 1460 int AppendTimeStepToFileName; 1461 }; 1462 1463 struct PostSubOperation { 1464 int PostQuantityIndex[2], PostQuantitySupport[2]; 1465 int Type, SubType, CombinationType; 1466 int Depth, Skin, Smoothing, Dimension, HarmonicToTime, CatFile; 1467 char *Comma; 1468 int TimeToHarmonic; 1469 int FourierTransform; 1470 int Format, Adapt, Sort, Iso, NoNewLine, NoTitle, DecomposeInSimplex; 1471 int NewCoordinates; 1472 char *NewCoordinatesFile; 1473 int ValueIndex; 1474 int ChangeOfCoordinates[3], LastTimeStepOnly, AppendTimeStepToFileName; 1475 int AppendExpressionToFileName; 1476 char *AppendStringToFileName, *AppendExpressionFormat; 1477 int OverrideTimeStepValue, NoMesh; 1478 char *StoreInVariable; 1479 int StoreInRegister, StoreMinInRegister, StoreMinXinRegister; 1480 int StoreMinYinRegister, StoreMinZinRegister, StoreMaxInRegister; 1481 int StoreMaxXinRegister, StoreMaxYinRegister, StoreMaxZinRegister; 1482 char *SendToServer, *Color, *Units; 1483 bool Visible, Closed; 1484 List_T *SendToServerList; 1485 int StoreInField, StoreInMeshBasedField; 1486 int Legend, FrozenTimeStepList; 1487 double LegendPosition[3]; 1488 double Target; 1489 char *ValueName, *Label; 1490 char *FileOut; 1491 List_T *TimeStep_L, *Value_L, *Iso_L, *Frequency_L; 1492 List_T *TimeValue_L, *TimeImagValue_L; 1493 int TimeInterval_Flag; 1494 double TimeInterval[2]; 1495 List_T *ChangeOfValues; 1496 List_T *EvaluationPoints; 1497 int Gauss; 1498 union { 1499 struct { int RegionIndex; } OnRegion; 1500 struct { double x[4], y[4], z[4]; int n[3]; } OnGrid; 1501 struct { int ExpressionIndex[3]; List_T *ParameterValue[3]; } OnParamGrid; 1502 struct { double x[3], y[3], z[3]; } OnSection; 1503 struct { int RegionIndex, ArgumentIndex; double x[2]; int n; } WithArgument; 1504 struct { int ExtendedGroupIndex, GroupIndex; } Group; 1505 struct { char *String; char *String2; List_T *Expressions; } Expression; 1506 } Case; 1507 }; 1508 1509 struct PostOpSolutions { 1510 PostOperation *PostOperation_P; 1511 List_T *Solutions_L; 1512 }; 1513 1514 /* PostOperation.Type */ 1515 #define POP_NONE 0 1516 #define POP_PRINT 1 1517 #define POP_GROUP 2 1518 #define POP_EXPRESSION 4 1519 #define POP_MERGE 5 1520 #define POP_DELETEFILE 6 1521 #define POP_CREATEDIR 7 1522 1523 /* PostOperation.SubType */ 1524 #define PRINT_ONREGION 1 1525 #define PRINT_ONELEMENTSOF 2 1526 #define PRINT_ONSECTION_1D 3 1527 #define PRINT_ONSECTION_2D 4 1528 #define PRINT_ONGRID 5 1529 #define PRINT_ONGRID_0D 6 1530 #define PRINT_ONGRID_1D 7 1531 #define PRINT_ONGRID_2D 8 1532 #define PRINT_ONGRID_3D 9 1533 #define PRINT_ONGRID_PARAM 10 1534 #define PRINT_WITHARGUMENT 11 1535 1536 /* PostOperation.CombinationType */ 1537 #define ADDITION 1 1538 #define SOUSTRACTION 2 1539 #define MULTIPLICATION 3 1540 #define DIVISION 4 1541 1542 /* Unsuccessful search results */ 1543 #define NO_BRICK -999 1544 #define NO_ELEMENT -999 1545 #define NO_REGION -999 1546 1547 /* PostSubOperation Tags */ 1548 #define TAG_TIME 1 1549 #define TAG_TIMESTEP 2 1550 #define TAG_VALUE 3 1551 #define TAG_X 4 1552 #define TAG_Y 5 1553 #define TAG_Z 6 1554 #define TAG_NODES 7 1555 #define TAG_TYPE 8 1556 #define TAG_VERSION 9 1557 #define TAG_DATE 10 1558 #define TAG_HOST 11 1559 #define TAG_FILENAME 12 1560 #define TAG_USER 13 1561 #define TAG_ABSCISSA 14 1562 #define TAG_NORMAL 15 1563 #define TAG_COMMAND 16 1564 1565 /* PostSubOperation.Format */ 1566 #define FORMAT_SPACE_TABLE 1 1567 #define FORMAT_TIME_TABLE 2 1568 #define FORMAT_SIMPLE_SPACE_TABLE 3 1569 #define FORMAT_FREQUENCY_TABLE 4 1570 #define FORMAT_VALUE_ONLY 5 1571 #define FORMAT_ADAPT 9 1572 #define FORMAT_GMSH 10 1573 #define FORMAT_GMSH_PARSED 11 1574 #define FORMAT_GNUPLOT 15 1575 #define FORMAT_REGION_TABLE 16 1576 #define FORMAT_REGION_VALUE 17 1577 #define FORMAT_FREQUENCY_REGION_VALUE 18 1578 #define FORMAT_NXUNV 19 1579 #define FORMAT_NODE_TABLE 20 1580 #define FORMAT_LOOP_ERROR 21 1581 #define FORMAT_GETDP 22 1582 #define FORMAT_ELEMENT_TABLE 23 1583 1584 /* PostSubOperation.Sort */ 1585 #define SORT_BY_POSITION 1 1586 #define SORT_BY_CONNECTIVITY 2 1587 1588 /* PostSubOperation.Legend */ 1589 #define LEGEND_NONE 0 1590 #define LEGEND_TIME 1 1591 #define LEGEND_FREQUENCY 2 1592 #define LEGEND_EIGENVALUES 3 1593 1594 /* ------------------------------------------------------------------------ */ 1595 /* C u r r e n t D a t a */ 1596 /* ------------------------------------------------------------------------ */ 1597 1598 struct CurrentData { 1599 char *Name; 1600 1601 int NbrSystem; 1602 struct DefineSystem *DefineSystem_P ; 1603 struct DofData *DofData_P0; 1604 1605 struct DofData *DofData; 1606 struct GeoData *GeoData; 1607 1608 //PostOperation based solutions for TimeLoopAdaptive, IterativeLoopN 1609 List_T *PostOpData_L; 1610 int PostOpDataIndex; 1611 1612 int NbrHar; 1613 int Region, SubRegion; 1614 int NumEntity, NumEntityInElement; 1615 int NumEntities[NBR_MAX_BASISFUNCTIONS]; 1616 1617 struct Element *Element; 1618 int IntegrationSupportIndex; 1619 1620 struct Element *ElementSource; 1621 1622 int SourceIntegrationSupportIndex; 1623 1624 int TypeTime, TypeAssembly; 1625 int SubTimeStep; 1626 1627 int flagAssDiag; 1628 1629 // All values below must be double 1630 1631 double x, y, z; 1632 double u, v, w; 1633 1634 double xs, ys, zs; 1635 double us, vs, ws; 1636 1637 double a, b, c; 1638 double xp, yp, zp; 1639 double ut, vt, wt; 1640 1641 double Val[NBR_MAX_HARMONIC * MAX_DIM]; 1642 1643 double QuadraturePointIndex; 1644 1645 // For TimeLoopTheta and TimeLoopNewmark 1646 double Time, TimeImag, TimeStep, DTime; 1647 double Theta, Beta, Gamma; 1648 1649 // For TimeLoopAdaptive 1650 int PredOrder, CorrOrder; 1651 double aPredCoeff[7], aCorrCoeff[6], bCorrCoeff, PredErrorConst, CorrErrorConst; 1652 double Breakpoint; 1653 1654 // For IterativeLoop 1655 double Iteration, RelativeDifference, RelativeDifferenceOld; 1656 double RelaxationFactor, Residual, ResidualN, Residual_Iter1; //+++ 1657 double RelaxFac, NbrTestedFac, SolveJacAdaptFailed; //+++ 1658 1659 // Iterative linear system solvers 1660 double KSPIterations, KSPIteration, KSPResidual, KSPSystemSize; 1661 }; 1662 1663 /* ------------------------------------------------------------------------ */ 1664 /* E l e m e n t */ 1665 /* ------------------------------------------------------------------------ */ 1666 1667 #define NBR_MAX_NODES_IN_ELEMENT 60 1668 #define NBR_MAX_ENTITIES_IN_ELEMENT 60 1669 #define NBR_MAX_SUBENTITIES_IN_ELEMENT 5 1670 1671 // FIXME: this should be made dynamic (with std::vector in Element) ; setting a 1672 // static too large can easily lead to stack overflows 1673 #if defined(HAVE_SMALL_STACK) 1674 #define NBR_MAX_GROUPS_IN_ELEMENT 30 1675 #else 1676 #define NBR_MAX_GROUPS_IN_ELEMENT 200 1677 #endif 1678 1679 struct IntxList { int Int ; List_T * List ; } ; 1680 1681 struct Matrix3x3 { 1682 double c11, c12, c13 ; 1683 double c21, c22, c23 ; 1684 double c31, c32, c33 ; 1685 } ; 1686 typedef struct Matrix3x3 MATRIX3x3 ; 1687 1688 struct Element { 1689 struct Geo_Element * GeoElement ; 1690 1691 int Num, Type, Region ; 1692 1693 struct Element * ElementSource, * ElementTrace ; 1694 1695 int NumLastElementForNodesCoordinates ; 1696 double x [NBR_MAX_NODES_IN_ELEMENT] ; 1697 double y [NBR_MAX_NODES_IN_ELEMENT] ; 1698 double z [NBR_MAX_NODES_IN_ELEMENT] ; 1699 1700 int NumLastElementForSolidAngle ; 1701 double angle [NBR_MAX_NODES_IN_ELEMENT] ; 1702 1703 int NumLastElementForSortedNodesByFacet ; 1704 struct TwoInt SortedNodesByFacet [6][NBR_MAX_SUBENTITIES_IN_ELEMENT] ; 1705 1706 double n [NBR_MAX_NODES_IN_ELEMENT] ; 1707 double dndu [NBR_MAX_NODES_IN_ELEMENT] [3] ; 1708 1709 struct JacobianCase * JacobianCase ; 1710 MATRIX3x3 Jac ; 1711 double DetJac ; 1712 MATRIX3x3 InvJac ; 1713 1714 int NumLastElementForGroupsOfEntities ; 1715 int NbrGroupsOfEntities ; 1716 int NumGroupsOfEntities [NBR_MAX_GROUPS_IN_ELEMENT] ; 1717 int NbrEntitiesInGroups [NBR_MAX_GROUPS_IN_ELEMENT] ; 1718 int NumEntitiesInGroups [NBR_MAX_GROUPS_IN_ELEMENT] 1719 [NBR_MAX_ENTITIES_IN_ELEMENT] ; 1720 int NumSubFunction [3][NBR_MAX_GROUPS_IN_ELEMENT] ; 1721 1722 struct GlobalBasisFunction * GlobalBasisFunction [NBR_MAX_GROUPS_IN_ELEMENT] ; 1723 } ; 1724 1725 /* Element.Type */ 1726 #define POINT_ELEMENT (1<<0) // POINT is used in the Windows API 1727 1728 #define LINE (1<<1) 1729 #define TRIANGLE (1<<2) 1730 #define QUADRANGLE (1<<3) 1731 #define TETRAHEDRON (1<<4) 1732 #define HEXAHEDRON (1<<5) 1733 #define PRISM (1<<6) 1734 #define PYRAMID (1<<7) 1735 1736 #define LINE_2 (1<<8) 1737 #define TRIANGLE_2 (1<<9) 1738 #define QUADRANGLE_2 (1<<10) 1739 #define TETRAHEDRON_2 (1<<11) 1740 #define HEXAHEDRON_2 (1<<12) 1741 #define PRISM_2 (1<<13) 1742 #define PYRAMID_2 (1<<14) 1743 1744 #define QUADRANGLE_2_8N (1<<15) 1745 #define HEXAHEDRON_2_20N (1<<16) 1746 #define PRISM_2_15N (1<<17) 1747 #define PYRAMID_2_13N (1<<18) 1748 1749 #define LINE_3 (1<<19) 1750 #define TRIANGLE_3 (1<<20) 1751 #define QUADRANGLE_3 (1<<21) 1752 #define TETRAHEDRON_3 (1<<22) 1753 #define HEXAHEDRON_3 (1<<23) 1754 #define PRISM_3 (1<<24) 1755 #define PYRAMID_3 (1<<25) 1756 1757 #define LINE_4 (1<<26) 1758 #define TRIANGLE_4 (1<<27) 1759 #define QUADRANGLE_4 (1<<28) 1760 #define TETRAHEDRON_4 (1<<29) 1761 #define HEXAHEDRON_4 (1<<30) 1762 #define PRISM_4 (1<<31) 1763 // #define PYRAMID_4 (1<<32) 1764 1765 /* Adapt.Type */ 1766 #define ADAPT_P1 1 1767 #define ADAPT_P2 2 1768 #define ADAPT_H1 3 1769 #define ADAPT_H2 4 1770 1771 struct Geo_Node { 1772 int Num ; 1773 double x, y, z ; 1774 } ; 1775 1776 struct Geo_Element { 1777 int Num ; 1778 int Type, Region, ElementaryRegion ; 1779 int NbrNodes , * NumNodes ; 1780 int NbrEdges , * NumEdges ; 1781 int NbrFacets, * NumFacets ; 1782 } ; 1783 1784 struct Entity2XEntity1 { 1785 int Num ; 1786 int NbrEntities, * NumEntities ; 1787 } ; 1788 1789 struct EntityXVector { 1790 int Num; 1791 double Vector[3]; 1792 } ; 1793 1794 struct EntityInTree { 1795 int Num, Index ; 1796 } ; 1797 1798 /* ------------------------------------------------------------------------ */ 1799 /* I n t e r f a c e F u n c t i o n s */ 1800 /* ------------------------------------------------------------------------ */ 1801 1802 int fcmp_Integer (const void *a, const void *b); 1803 int fcmp_Integer2 (const void *a, const void *b); 1804 int fcmp_Constant (const void *a, const void *b); 1805 int fcmp_Expression_Name (const void *a, const void *b); 1806 int fcmp_Group_Name (const void *a, const void *b); 1807 int fcmp_Constraint_Name (const void *a, const void *b); 1808 int fcmp_JacobianMethod_Name (const void *a, const void *b); 1809 int fcmp_IntegrationMethod_Name (const void *a, const void *b); 1810 int fcmp_BasisFunction_Name (const void *a, const void *b); 1811 int fcmp_FunctionSpace_Name (const void *a, const void *b); 1812 int fcmp_BasisFunction_NameOfCoef (const void *a, const void *b); 1813 int fcmp_SubSpace_Name (const void *a, const void *b); 1814 int fcmp_GlobalQuantity_Name (const void *a, const void *b); 1815 int fcmp_Formulation_Name (const void *a, const void *b); 1816 int fcmp_DefineQuantity_Name (const void *a, const void *b); 1817 int fcmp_DefineSystem_Name (const void *a, const void *b); 1818 int fcmp_Resolution_Name (const void *a, const void *b); 1819 int fcmp_PostProcessing_Name (const void *a, const void *b); 1820 int fcmp_PostQuantity_Name (const void *a, const void *b); 1821 int fcmp_PostOperation_Name (const void *a, const void *b); 1822 1823 void Init_ProblemStructure(); 1824 void Read_ProblemPreamble(); 1825 void Read_ProblemStructure(const char *fileName); 1826 void Finalize_ProblemStructure(); 1827 void Print_ProblemStructure(); 1828 int Print_Object(int ichoice); 1829 void Free_ProblemStructure(); 1830 1831 std::string Fix_RelativePath(const char *fileName, const char *reference=0); 1832 1833 void Print_ListResolution(int choice, int flag_lres, char **name); 1834 void Print_ListPostOperation(int choice, int flag_lpos, char *name[NBR_MAX_POS]); 1835 1836 #endif 1837