forked from goma/goma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmm_as_structs.h
3263 lines (2979 loc) · 146 KB
/
mm_as_structs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/************************************************************************ *
* Goma - Multiphysics finite element software *
* Sandia National Laboratories *
* *
* Copyright (c) 2022 Goma Developers, National Technology & Engineering *
* Solutions of Sandia, LLC (NTESS) *
* *
* Under the terms of Contract DE-NA0003525, the U.S. Government retains *
* certain rights in this software. *
* *
* This software is distributed under the GNU General Public License. *
* See LICENSE file. *
\************************************************************************/
/*
*$Id: mm_as_structs.h,v 5.35 2010-04-07 22:27:00 prschun Exp $
*/
/*
* These structures are meant to hold various useful quantities that are
* needed when assembling the residual equations and Jacobian entries for
* all the different permutations of different problems that we might be
* interested in solving. The idea is to be able to import this information
* down to a low level of subroutine where it will be useful.
*
* The structures are revealed here, and declared "extern" in most places
* via the include file mm_as.h. Then, in mm_as_alloc() they are
* actually defined
*/
#ifndef GOMA_MM_AS_STRUCTS_H
#define GOMA_MM_AS_STRUCTS_H
#include "el_elm.h"
#include "mm_elem_block_structs.h"
#include "mm_mp_const.h"
#include "rf_bc_const.h"
#include "rf_io_const.h"
#include "rf_vars_const.h"
#include "sl_util_structs.h"
#include "std.h"
#ifndef MNROT
#define MNROT \
30 /* maximum number of rotation vector \
* sensitivities. This is basically the \
* largest number of nodes whose displacements \
* can affect a vector in the surface. \
*/
#endif
/* define VIM according to problem type */
/* #define VIM 3 */ /* Vector dimensions so that loops over */
/* vector products do this many components */
/* eg. v.gradT loops over 3 components for */
/* all problems. This is convenient for */
/* axisymmetric problems and works OK for */
/* Cartesian problems too if third */
/* component is set =0.*/
#ifndef GOMA_CK_NAME_DEF
#define GOMA_CK_NAME_DEF
typedef char CK_NAME[64]; /* Typedefs for common names used for naming
domains and species */
typedef char CK_NAME_STR[64];
#endif
/*____________________________________________________________________________*/
/*
* Element_Indices
*
* These element indeces are specific to each element in mesh. They
* provide mapping information for degrees of freedoms of
* variable types defined on nodes owned by the element.
*
*
* A couple of key concepts concerning two types of element degrees of
* freedom:
*
* lvdof or ldof -> For each equation type, this is an index into the
* degree of freedom present at one of the nodes in
* the element. The index spans all nodes in the local
* element, and there
* may be more than one dof of the same equation type
* at a single node.
* Note, the degree of freedom may or
* may not be "active" in the element. Active means
* that it participates in the element interpolation
* of that variable type within that element.
* The maximum size of an lvdof index can not exceed
* the static size, MDE, which is compiled into
* the code.
*
*
* ledof -> This is a new concept. This number is a unique number for
* each degree of freedom in an element, irrespective of the
* variable type.
* Right now, each variable type will have consequative
* ledof numbers. Therefore, one can obtain ledof by looping
* over variable types, and then over lvdof's, while keeping
* an incremental counter.
* The maximum size of ledof can not exceed MDE * MAX_PROB_VAR.
* However, in the future, we will attempt to calculate
* an MDE equivalent dynamically.
*
* Implementation Plan
* -------------------------
* I've been thinking that the trying to specify degrees of freedom by their
* variable type ID alone is the wrong way to go. Instead, one should convert
* or replace most of the structures below to use uniqueness of the variable
* type structures as the base indexing methodology. This means in effect
* that the an index will be created that is unique for each variable type
* and matID (and species number) present in the element or specified on the
* sides of the element.
*
* Local Variable Description Number:
* This is the unique index for a variable description in an element.
* Local Variable Description Dof Index:
* For each Local Variable Description Number, this index rasters over
* all of the dof's in the element that belong to the pertaining
* variable description.
*
*/
/* Define values for determining side of LS */
#define LS_OFF 0
#define LS_POSITIVE 1
#define LS_NEGATIVE 2
/*
* Define for right now the maximum number of local variable type descriptions
* to be equal to the maximum number of different variable types in the problem
*/
#define MAX_LOCAL_VAR_DESC (MAX_PROB_VAR + MAX_CONC)
#define LEC_R_INDEX(peqn_macro, index_macro) ((lec->max_dof * (peqn_macro)) + index_macro)
#define LEC_J_INDEX(peqn_macro, pvar_macro, index_i, index_j) \
(((MAX_PROB_VAR + MAX_CONC) * lec->max_dof * lec->max_dof) * (peqn_macro)) + \
((lec->max_dof * lec->max_dof) * (pvar_macro)) + (lec->max_dof * (index_i)) + index_j
#define LEC_J_STRESS_INDEX(peqn, pvar, index_i, index_j) \
((lec->max_dof * MAX_LOCAL_VAR_DESC * lec->max_dof) * (peqn)) + \
((MAX_LOCAL_VAR_DESC * lec->max_dof) * (pvar)) + (lec->max_dof * (index_i)) + index_j
#ifndef MAX_PHASE_FUNC
#define MAX_PHASE_FUNC 5
#endif
struct Element_Indices {
int iconnect_ptr; /* To find way back to global scheme . This is an
* index into the element connectivity list for
* the current element:
*
* e.g., Proc_Elem_Connect[iconnect_ptr + i]
*/
int ielem; /*
* The id of the current element
*/
int ielem_dim; /* is this a 2d or 3d problem */
int ielem_type; /* what kind of element */
int ielem_shape; /* element shape, fundamental topology (new) */
int elem_blk_index; /* element block index of block containing
* current element */
int elem_blk_id; /* Element block ID of block containing
* current element */
ELEM_BLK_STRUCT *current_EB_ptr; /* Pointer to the current element block */
int mn; /* material number corresponding to the
* current element */
int num_local_nodes; /* how many local nodes in element */
int num_sides; /* how many sides does the current element
have (at least for this processor) */
int deforming_mesh; /* Can nodes move? NOTE: For shell
elements, this may be TRUE even though
mesh equations are not defined on the
shell block! */
/*
* A note about the order of variable descriptions:
*
* They are ordered wrt Var Type first
* matID next -> current matID is always first however
* and after that matID order is unspecified.
* species number or idof next. (these are grouped together).
*/
int Num_Lvdesc; /* Number of local variable descriptions in the
* element, whether they are interpolated in
* the element or just exist on the sides
* of the elements.
*/
int *Num_Lvdesc_Per_Var_Type; /* Number of local variable descriptions per
* variable types in the current element
* MallocSize = MAX_VARIABLE_TYPES + MAX_CONC
* actualSize = MAX_VARIABLE_TYPES +
* Max_Num_Species
*/
int *Lvdesc_First_Var_Type; /* Mapping of the variable type to the
* first local variable description number
* pertaining to that variable type.
* The first variable type
* will in all possible cases be the variable
* description that is an active volumetric
* interpolation.
*
* MallocSize = MAX_VARIABLE_TYPES + MAX_CONC
* actualSize = MAX_VARIABLE_TYPES +
* Max_Num_Species
*/
int **Lvdesc_to_ledof; /* Mapping between the (local variable description
* number, local variable description
* dof index) pair to the local element dof index,
* ledof.
* MallocSize = [MAX_LOCAL_VAR_DESC][MDE]
* ActualSize = [Num_lvdesc][Lvdesc_Numdof[i_vdesc]]
*/
int **Lvdesc_to_lvdof; /* Mapping between the (local variable description
* number, local variable description
* dof index) pair to the local variable dof number,
* lvdof, of the same variable type. For MF's with a
* subvariable types greater than one, the mapping
* is made to the subvariable type=0 lvdof.
* MallocSize = [MAX_LOCAL_VAR_DESC][MDE]
* ActualSize = [Num_lvdesc][Lvdesc_Numdof[i_vdesc]]
*/
int *Lvdesc_to_Var_Type; /* Mapping between the local variable description
* number to the variable type.
* MallocSize = [MAX_LOCAL_VAR_DESC]
* ActualSize = [Num_Lvdesc]
*/
int *Lvdesc_to_MatID; /* Mapping between the local variable description
* number to the matID.
* MallocSize = [MAX_LOCAL_VAR_DESC]
* ActualSize = [Num_Lvdesc]
*/
int *Lvdesc_Numdof; /* Number of degrees of freedom for each variable
* description number in the current element.
* MallocSize = [MAX_LOCAL_VAR_DESC]
* ActualSize = [Num_Lvdesc]
*/
int **Lvdesc_to_Gnn; /* Mapping between the (local variable description
* number, local variable description
* dof index) pair to the processor's node
* number.
* MallocSize = [MAX_LOCAL_VAR_DESC][MDE]
* ActualSize = [Num_Lvdesc][Lvdesc_Numdof[i_vdesc]]
*/
int **Lvdesc_to_Gun; /* Mapping between the (local variable description
* number, local variable description
* dof index) pair to the processor's global unknown
* number.
* MallocSize = [MAX_LOCAL_VAR_DESC][MDE]
* ActualSize = [Num_Lvdesc][Lvdesc_Numdof[i_vdesc]]
*/
int *Lvdesc_to_MFSubvar; /* For variable types with subvar indeces
* ie Mass Fraction ,
* we need another variable to describe the
* subvariable index (i.e., the species
* number) corresponding to the current
* variable description.
* MallocSize = [MAX_LOCAL_VAR_DESC]
* ActualSize = [Num_Lvdesc]
*/
int **Lvdesc_to_Lnn; /* Mapping between the (local variable description
* number, local variable description
* dof index) pair to the local node number
* within the element.
* MallocSize = [MAX_LOCAL_VAR_DESC][MDE]
* ActualSize = [Num_Lvdesc][Lvdesc_NumDof[i_vdesc]]
*/
int **Lvdesc_Lnn_to_Offset; /* Mapping between the (local variable description
* number, local node number) pair to the offset
* from the beginning of the solution vector at the
* current node.
* MallocSize = [MAX_LOCAL_VAR_DESC][MDE]
* ActualSize = [Num_Lvdesc][num_local_nodes]
*/
int **Lvdesc_Lnn_to_lvdof; /* Mapping between the (local variable description
* number, local node number) pair to the local
* variable dof index. For MF's with a
* subvariable types greater than one, the mapping
* is made to the subvariable type=0 lvdof.
* MallocSize = [MAX_LOCAL_VAR_DESC][MDE]
* ActualSize = [Num_Lvdesc][num_local_nodes]
*/
int **lvdof_to_lvdesc; /* Mapping between the local variable index and
* a variable_type pair to the corresponding
* local variable description index.
* MallocSize
* = [MAX_VARIABLE_TYPES+MAX_CONC][MDE]
* ActualSize
* = [MAX_VARIABLE_TYPES+Max_Species]
* [ei->dof[v]]
*/
int **lvdof_to_lvdesc_dof; /* Mapping between the local variable index and
* a variable_type pair to the corresponding
* dof number of the local variable description
* index.
* MallocSize
* = [MAX_VARIABLE_TYPES+MAX_CONC][MDE]
* ActualSize
* = [MAX_VARIABLE_TYPES+Max_Species]
* [ei->dof[v]]
*/
int **Lvdesc_Lnn_Numdof; /* Number of degrees of freedom for the variable
* description number at the local node number
* MallocSize = [MAX_LOCAL_VAR_DESC][MDE]
* ActualSize = [Num_Lvdesc][num_local_nodes]
*/
VARIABLE_DESCRIPTION_STRUCT **Lvdesc_vd_ptr;
/* Pointer to the variable description
* structure corresponding to the lvdesc index.
* MallocSize = [MAX_LOCAL_VAR_DESC]
* ActualSize = [Num_Lvdesc]
*/
int *VDindex_to_Lvdesc; /* Index pointing from the variable description
* index to the current local variable description
* index for the local variable
*/
int *owningElementForColVar; /* Indicator of who owns the column variable
* type. We separate and distinguish all columns
* in the local jacobian, according to whether
* they refer to equations that belong to the
* parent, the child, or the owning element.
* [MAX_VARIABLE_TYPES+MAX_CONC]
*
* ei->owningElementForColVar[varType] = elem
*
* where value is one of these:
*
* -1 not this element
* elem This element. This means that the
* variable has an equation on this element, and
* that there is an interpolation of
* the variable using this element's basis
* functions. elemP Parent or child of this
* element. This means that the variable has an
* equation on this element's Parent, and that
* there is an interpolation of the variable
* using this element Parent's basis functions.
*/
struct Element_Indices *owningElement_ei_ptr[MAX_VARIABLE_TYPES];
/* Pointer to the Element_Indices struct that contains
* the info for the element. The element number is the
* listed in owningElementForColVar[].
*/
/*******************************************************/
/* Slated to be AXED: */
int *dof; /* Number of dof's in the element's nodes for each
* variable type (both, active and inactive)
* Length = MAX_VARIABLE_TYPES */
int *dof_ext; /* Number of dof's in the elem for each external
* fixed variable
* Length = MAX_EXTERNAL_TYPES */
int **Baby_Dolphin; /* Offset for the local variable in the
* solution vector in cases where there are
* discontinuous variables and multiple dofs
* of the same variable type at the same node.
* Note: doesn't take into account multiple
* subvariable types for mass fractions.
* Size = [MAX_VARIABLE_TYPES][MDE] */
int **dof_list; /* list of local nodes for ea dof in the elem
* Size [MAX_VARIABLE_TYPES][MDE] */
int **gnn_list; /* list of global node numbers for ea dof
* Size [MAX_VARIABLE_TYPES][MDE] */
int **gun_list; /* list of global unknown numbers for ea dof
* Size [MAX_VARIABLE_TYPES][MDE] */
int **ln_to_dof; /* Mapping between the (variable type, local
* element node) pair to the local variable
* degree of freedom in the element pertaining
* to the active interpolation of that
* variable within the element
* MallocSize
* = [MAX_VARIABLE_TYPES][MDE]
* ActualSize
* = [MAX_VARIABLE_TYPES][num_local_nodes] */
int **ln_to_first_dof; /* list of local dof numbers for the first
* dof at ea local node
* Size [MAX_VARIABLE_TYPES][MDE] */
int *active_interp_ledof; /* This variable is equal to one if this
* ledof is part of an active interpolation
* of the variable within the element.
* It is equal to zero if it is not,
* (if for example, it is located on the
* side of an element, and is part of another
* material domain).
* Size [MDE * MAX_PROB_VAR] */
int **lvdof_to_row_lvdof; /* Identification of the row that an lvdof
* volumetric contribution gets assigned to.
* Usually, it is a one-to-one mapping. However,
* some boundary conditions require volumetric
* contributions from one material be assigned
* to unknowns from another material. In this
* case and this case alone, this field
* diverts from a one-to-one mapping. Note,
* this field need only contain valid information
* for active degrees of freedom in the
* element.
* (This field replaces the old field,
* first_active_dof).
* size [MAX_VARIABLE_TYPES][MDE] */
int **lvdof_to_ledof; /* Mapping between the local variable dof
* number
* the local element dof number, ledof
* Size [MAX_VARIABLE_TYPES][MDE] */
/*******************************************************/
int *owned_ledof; /* This is a boolean variable indicating
* whether
* this local element dof is owned by the
* processor or not.
* Size [MDE * MAX_PROB_VAR] */
int *ieqn_ledof; /* Processor equation number for the local
* element dof. Note, a dof will have
* an equation number irrespective of whether
* or not it is owned by the processor.
* Size [MDE * MAX_PROB_VAR] */
int *matID_ledof; /* Material ID corresponding to the local
* element dof. Here, the generic material
* ID, -1, will not be used. Instead, the
* element material ID will be used in its
* place. Thus, the only time a ledof will
* not have a matID equal to the element
* matID is if it is inactive in the element
* and corresponds to an active degree of
* freedom
* in another element that has a different
* material ID.
* Size [MDE * MAX_PROB_VAR] */
int **MFsubvar_Offset; /* For variable types with subvar indeces,
* ie Mass Fraction,
* we need another variable to describe the
* offset of each of the subvariables wrt
* the base subvar=0 index for the current
* local variable dof corresponding to the
* mass fraction variable type.
* Size [MAX_CONC] [MDE]
*/
int linkedEIelems[MAX_ELEMENT_INDICES_RELATED]; /* List of elements ids that
* are slaves to this element
*/
};
/*____________________________________________________________________________*/
struct Element_Variable_Pointers {
/*
* These are an abbreviated version of the Element_Stiffness_Pointers
* containing only the nodal variable.
*
* this structure was designed to hold the old nodal variable and dot
* variables in a convenient way
*
* Pointers to *unknowns*....(i.e, nodal point values for variables) that
* are important in this element. -----
*
* For variables defined at Gauss points, see the field variable sections...
*
* Idea --
* *T_dot[i] = x_dot[something];
*
* i == local degree of freedom counter for temperature
* something == equivalent position in global unknown vector
*
* Usage: *esp_dot->T[i] points to right place in x_dot[] to get the value
you * need.
*/
dbl *T[MDE]; /* temperature */
dbl *v[DIM][MDE]; /* velocity */
dbl *v_star[DIM][MDE]; /* velocity* segregated */
dbl *d[DIM][MDE]; /* mesh displacement */
dbl *d_rs[DIM][MDE]; /* real solid displacement */
dbl *c[MAX_CONC][MDE]; /* concentration */
dbl *external_field[MAX_EXTERNAL_FIELD][MDE]; /* external field variables at nodes */
dbl *initial_displacements[2 * DIM][MDE]; /* initial xyz displacement fields
for real solid and pseudo solid
for annealing */
dbl *P[MDE]; /* pressure */
dbl *P_star[MDE]; /* pressure */
dbl *S[MAX_MODES][DIM][DIM][MDE]; /* polymeric stress tensor, for each mode */
dbl *G[DIM][DIM][MDE]; /* velocity gradient tensor */
dbl *F[MDE]; /* Fill */
dbl *V[MDE]; /* Potential; added by KSC: 2/3/99 */
dbl *qs[MDE]; /* Surface charge density */
dbl *Enorm[MDE]; /* |E| for dielectrophoresis. */
dbl *pv[DIM][MDE]; /* Particle velocity */
dbl *p_liq[MDE]; /* *p_liq[MDE], liquid-phase pressure in porous media */
dbl *p_gas[MDE]; /* *p_gas[MDE], liquid-phase pressure in porous media */
dbl *porosity[MDE]; /* *porosity[MDE],liquid-phase pressure porous media */
dbl *vd[DIM][MDE]; /* Vorticity principle flow direction (NOT
* vorticity vector) */
dbl *vlambda[MDE]; /* Eigenvalue associated with vorticity direction */
dbl *nn[MDE]; /* This is the bond evolution */
dbl *lm[DIM][MDE]; /* Lagrange Multiplier field */
dbl *ext_v[MDE]; /* Extension velocity, normal direction */
dbl *E_field[DIM][MDE]; /* Electric field */
dbl *H[DIM]; /* Level Set Curvature */
dbl *n[DIM][MDE]; /* level set normal OR shell normal */
dbl *sh_K[MDE]; /* Shell curvature */
dbl *sh_K2[MDE]; /* Shell second curvature */
dbl *sh_tens[MDE]; /* Shell tension */
dbl *sh_x[MDE]; /* Shell y coordinate */
dbl *sh_y[MDE]; /* Shell x coordinate */
dbl *sh_u[MDE]; /* Shell user */
dbl *sh_ang[DIM - 1][MDE]; /* Shell orientation angles */
dbl *div_s_v[MDE]; /* sundry pieces (next 4) for surface rheological
constitutive eqn */
dbl *curv[MDE];
dbl *grad_v_dot_n[DIM][MDE]; /* grad_s (v_) dot n Vector variable */
dbl *n_dot_curl_s_v[MDE]; /* n dot (curl_s v) Scalar variable used in shell
equations - curl_s is surface curl */
dbl *pF[MAX_PHASE_FUNC][MDE]; /* phase function */
dbl *sh_J[MDE]; /* sh_J[MDE], Shell surface diffusion flux */
dbl *sh_Kd[MDE]; /* sh_Kd[MDE], Shell surface curvature */
dbl *apr[MDE]; /* acoustic pressure real part */
dbl *api[MDE]; /* acoustic pressure imag part */
dbl *epr[MDE]; /* em lagr pressure real part */
dbl *epi[MDE]; /* em lagr pressure imag part */
dbl *ars[MDE]; /* acoustic reynolds stress */
dbl *sink_mass[MDE]; /* porous sink mass*/
dbl *sh_bv[MDE]; /* acoustic boundary velocity */
dbl *sh_p[MDE]; /* shell lub pressure */
dbl *lubp[MDE]; /* lub pressure */
dbl *lubp_2[MDE]; /* second lub pressure */
dbl *sh_fp[MDE]; /* lub pressure in thin film */
dbl *sh_fh[MDE]; /* film thickness */
dbl *sh_pc[MDE]; /* particles concentration */
dbl *sh_sat_closed[MDE]; /* Porous shell saturation - Closed cells - SAR */
dbl *sh_p_open[MDE]; /* Porous shell pressure - Open closed - SAR */
dbl *sh_p_open_2[MDE]; /* Second Porous shell pressure - Open closed -PRS */
dbl *sh_t[MDE]; /* Shell temperature -- PRS*/
dbl *sh_dh[MDE]; /* Shell delta gap -- PRS*/
dbl *sh_l_curv[MDE]; /* Lubrication shell curvature - SAR */
dbl *sh_l_curv_2[MDE]; /* Lubrication shell curvature 2 - PRS */
dbl *sh_sat_gasn[MDE]; /* Porous shell saturation - Gas compression - SAR */
dbl *sh_shear_top[MDE]; /* Top wall shear rate */
dbl *sh_shear_bot[MDE]; /* Bottom wall shear rate */
dbl *sh_cross_shear[MDE]; /* Cross stream shear stress */
dbl *max_strain[MDE]; /* Maximum Von Mises strain */
dbl *cur_strain[MDE]; /* Von Mises strain */
dbl *poynt[DIM][MDE]; /* Poynting Vector for light intensity */
dbl *tfmp_pres[MDE]; /* thin-film multi-phase lubrication pressure */
dbl *tfmp_sat[MDE]; /* thin-film multi-phase saturation */
dbl *moment[MAX_MOMENTS][MDE]; /* moments */
dbl *rho[MDE];
dbl *restime[MDE]; /* residence time function field */
dbl *em_er[DIM][MDE]; /* EMwave Electric Field real part */
dbl *em_ei[DIM][MDE]; /* EMwave Electric Field imag part */
dbl *em_hr[DIM][MDE]; /* EMwave Magnetic Field real part */
dbl *em_hi[DIM][MDE]; /* EMwave Magnetic Field imag part */
dbl *sh_sat_1[MDE]; /* Porous shell saturation layer 1 */
dbl *sh_sat_2[MDE]; /* Porous shell saturation layer 2 */
dbl *sh_sat_3[MDE]; /* Porous shell saturation layer 3 */
};
/*___________________________________________________________________________*/
struct Element_Stiffness_Pointers {
/*
* These are basically BULK degrees of freedom here. If you have need to
* account for boundary sensitivities, then you will need to think
* through the best procedure for doing so...
*
* Pointers to *unknowns*....(i.e, nodal point values for variables) that
* are important in this element. -----
*
* For variables defined at Gauss points, see the field variable sections...
*
* Idea --
* *T[i] = x[something];
*
* i == local degree of freedom counter for temperature
* something == equivalent position in global unknown vector
*
* Usage: *esp->T[i] points to right place in x[] to get the value you
* need.
*
* space for these arrays is allocated in mm_as_alloc.c if the variable
* are defined
*/
dbl **T; /* *T[MDE], temperature */
dbl ***v; /* *v[DIM][MDE], velocity */
dbl ***v_star; /* *v_star[DIM][MDE], velocity* segregated */
dbl ***d; /* *d[DIM][MDE], mesh displacement */
dbl ***d_rs; /* *d_rs[DIM][MDE], real solid displacement */
dbl ***c; /* *c[MAX_CONC][MDE], concentration */
dbl **P; /* *P[MDE], pressure */
dbl **P_star;
dbl *****S; /* *S[MAX_MODES][DIM][DIM][MDE], polymeric
stress tensor */
dbl ****G; /* *G[DIM][DIM][MDE], velocity gradient
tensor */
dbl **V; /* *V[MDE], voltage potential */
dbl **qs; /* *qs[MDE], surface charge density */
dbl **F; /* *F[MDE], fill */
dbl **SH; /* *SH[MDE], shear rate from second
invariant */
dbl **Enorm; /* Enorm[MDE], |E| */
dbl **H; /* H[MDE] curvature of level set function */
dbl ***pv; /* *pv[DIM][MDE], particle velocity */
dbl **p_liq; /* *p_liq[MDE], liquid-phase pressure in porous media */
dbl **p_gas; /* *p_gas[MDE], liquid-phase pressure in porous media */
dbl **porosity; /* *porosity[MDE],liquid-phase pressure porous media */
dbl ***vd; /* *vd[DIM][MDE}, vorticity prinicple flow direction. */
dbl **vlambda; /* *vlambda[MDE], eigenvalue associated with vd. */
dbl **nn; /* *nn[MDE], bond evolution */
dbl ***lm; /* lm_gama[DIM][MDE] is the lagrange multiplier vector field */
dbl **ext_v; /* Extension velocity */
dbl ***E_field; /* Electric field */
dbl ***n; /* n[DIM][MDE], level set normal OR shell normal */
dbl **sh_K; /* sh_K[MDE], Shell curvature */
dbl **sh_K2; /* sh_K2[MDE], Shell second curvature */
dbl **sh_tens; /* sh_tens[MDE], Shell tensions */
dbl **sh_x; /* sh_x[MDE], Shell x coordinate */
dbl **sh_y; /* sh_y[MDE], Shell y coordinate */
dbl **sh_u; /* sh_u[MDE], Shell user */
dbl ***sh_ang; /* sh_ang[DIM-1][MDE], Shell orientation angles */
dbl **div_s_v; /* sundry pieces (next 4) for surface rheological constitutive
eqn */
dbl **curv;
dbl ***grad_v_dot_n; /* grad_s_v_dot_n[DIM][MDE] , grad_s_v_dot_n[] defined at
a surface */
dbl **n_dot_curl_s_v; /* n dot (curl_s v) Scalar variable used in shell
equations - curl_s is surface curl */
dbl ***pF; /* *pF[MAX_PHASE_FUNC][MDE], phase function */
dbl **sh_J; /* sh_J[MDE], Shell surface diffusion flux */
dbl **sh_Kd; /* sh_Kd[MDE], Shell surface curvature */
dbl **apr; /* *apr[MDE], acoustic pressure */
dbl **api; /* *api[MDE], acoustic pressure */
dbl **ars; /* *ars[MDE], acoustic reynolds stress */
dbl **epr; /* *epr[MDE], em pressure */
dbl **epi; /* *epi[MDE], em pressure */
dbl **sink_mass; /* Porous sink mass */
dbl **sh_bv; /* sh_bv[MDE], acoustic bdy velocity */
dbl **sh_p; /* sh_p[MDE], lub pressure */
dbl **lubp; /* lubp[MDE], lub pressure */
dbl **lubp_2; /* lubp_2[MDE], second lub pressure */
dbl **sh_fp; /* sh_fp[MDE], lub pressure in the thin film */
dbl **sh_fh; /* sh_fh[MDE], film thickness */
dbl **sh_pc; /* sh_pc[MDE], particles concentration */
dbl **sh_sat_closed; /* sh_sat_closed[MDE], porous shell saturation - closed
cells - SAR */
dbl **sh_p_open; /* sh_p_open[MDE], porous shell pressure - open cells - SAR */
dbl **sh_p_open_2; /* sh_p_open_2[MDE], porous shell pressure - open cells -
PRS */
dbl **sh_t; /* sh_t[MDE], Shell temperature -- PRS */
dbl **sh_dh; /* sh_dh[MDE], Shell delta_h -- PRS */
dbl **sh_l_curv; /* sh_l_curv[MDE], Lubrication shell curvature - SAR */
dbl **sh_l_curv_2; /* sh_l_curv_2[MDE], Lubrication_2 shell curvature - PRS */
dbl **sh_sat_gasn; /* sh_sat_gasn[MDE], porous shell saturation - gas
compression - SAR */
dbl **sh_shear_top; /* sh_shear_top[MDE], top wall shear rate */
dbl **sh_shear_bot; /* sh_shear_bot[MDE], bottom wall shear rate */
dbl **sh_cross_shear; /* sh_cross_shear[MDE], cross stream shear stress */
dbl **max_strain; /* max_strain[MDE], maximum Von Mises strain */
dbl **cur_strain; /* cur_strain[MDE], Von Mises strain */
dbl ***poynt; /* *v[DIM][MDE], velocity */
dbl **tfmp_pres; /* thin-film multi-phase lubrication pressure */
dbl **tfmp_sat; /* thin-film multi-phase saturation */
dbl ***moment; /* *moment[MAX_MOMENTS][MDE], moments */
dbl **rho;
dbl **restime; /* Residence Time Function Field */
dbl ***em_er; /* *em_xx[DIM][MDE], em_wave*/
dbl ***em_ei; /* *em_xx[DIM][MDE], em_wave*/
dbl ***em_hr; /* *em_xx[DIM][MDE], em_wave*/
dbl ***em_hi; /* *em_xx[DIM][MDE], em_wave*/
dbl **sh_sat_1; /* Porous shell saturation layer 1 */
dbl **sh_sat_2; /* Porous shell saturation layer 2 */
dbl **sh_sat_3; /* Porous shell saturation layer 3 */
/*
* These are for debugging purposes...
*/
dbl *a0; /* point to beginning of global Jacobian */
};
/*___________________________________________________________________________*/
/*
* Information for calculation of element quality (distortion) metrics
* and stop/remesh criterion based on quality.
*/
struct Element_Quality_Metrics {
int do_jac; /* Jacobian metric flag (if requested) */
int do_vol; /* Volume change metric flag (if requested) */
int do_ang; /* Angle metric flag (if requested) */
int do_tri; /* Triangle metric flag (if requested) */
double wt_jac; /* Jacobian metric weight (if requested) */
double wt_vol; /* Volume change metric weight (if requested) */
double wt_ang; /* Angle metric weight (if requested) */
double wt_tri; /* Triangle metric weight (if requested) */
double eq_jac; /* Jacobian metric value */
double eq_vol; /* Volume change metric value */
double eq_ang; /* Angle metric value */
double eq_tri; /* Triangle metric value */
double eq_avg; /* Weighted metric average */
double eq_low; /* Limiting (lowest) quality metric */
double eq_tol; /* Stop criterion for quality */
double vol_sum; /* Volume change global sum */
double vol_low; /* Volume change global minimum */
int vol_count; /* Volume change Gauss point counter */
int tol_type; /* Tolerance type indicator */
};
/*___________________________________________________________________________*/
/*
* Where the "esp" were just pointers into x[], resid_vector[], and a[], here
* we load up actual contributions.
*/
struct Local_Element_Contributions {
int max_dof;
dbl *R;
dbl *J;
/* For face m and mode k we have for mode imode
d(tau_12_i)/d(tau_12_j) =
J_stress_neighbor[m][i][POLYMER_STRESS11_k][j]
*/
dbl *J_stress_neighbor;
/*
* NOTE: concentration entries in local element arrays are stored at
* the end of
* the equation and variable lists (i.e. for species w use l
* ec->R[MAX_VARIABLE_TYPES + w][i]
* to get entry in local residual array
*/
/*
* Unused for now; this could contain handy local copies of the
* global unknowns...
*
* dbl x[MAX_VARIABLE_TYPES] [MDE];
*/
};
/*___________________________________________________________________________*/
/*
* These might be useful for different calls to the "do-all" assembly routines
* to just do residual calculations (eg, for numerical Jacobian checking).
* Later, you could add parts to do new columns on the RHS or for the Jacobian
* matrix.
*/
struct Action_Flags {
int Assemble_Residual;
int Assemble_Jacobian;
int Assemble_LSA_Jacobian_Matrix; /* Whether or not to compute the
* Jacobian (J) matrix for the
* generalized eigenvalue problem for
* linear stability analysis, J x =
* \lambda B x
*/
int Assemble_LSA_Mass_Matrix; /* Whether or not to compute the
* "mass" (B) matrix for the
* generalized eigenvalue problem for
* linear stability analysis,
* J x = \lambda B x
*/
int Sat_hyst_reevaluate; /* This placeholder is used to initiate
* a re-evaluation of the hysteresis
* saturation curve parameters based on
* some chosen criteria. The idea is
* to use this to control the evaluation,
* which can either be by Newton iteration
* or by time step. See rf_solve.c for it's
* initialization and load_saturation for it's
* use.
*/
/*
* Unused for now.
* int Assemble_2nd_RHS;
*/
};
/*
* This contains information that is uniformaly relevant
* to all portions of the problem without regard to
* block id or material number
*
*/
struct Uniform_Problem_Description {
int Total_Num_Matrices; /* Total number of problem graphs to be solved */
int Total_Num_EQ[MAX_NUM_MATRICES]; /* This is used in conjunction with the
* ep[] array. The number of nonzero
* entries in this array will equal the
* number of non neg 1 entries in the
* ep[][] array.
*/
int Total_Num_Var[MAX_NUM_MATRICES]; /* This is used in conjunction with the
* vp[] array. The number of nonzero
* entries in this array will equal the
* number of non neg 1 entries in the
* vp[][] array.
*/
int CoordinateSystem;
int vp[MAX_NUM_MATRICES]
[MAX_VARIABLE_TYPES + MAX_CONC]; /* Mapping from the actual variable type index
* to a uniform problem variable
* index valid for all materials. If a variable type is
* active anywhere in the domain, then its corresponding
* entry in this array will be nonzero and contain a unique
* index.
*/
int ep[MAX_NUM_MATRICES]
[MAX_EQNS + MAX_CONC]; /* Mapping from the actual equation variable type index
* to a uniform problem equation
* index valid for all materials. If a variable type is
* active anywhere in the domain, then its corresponding
* entry in this array will be nonzero and contain a unique
* index.
*/
int Max_Num_Species; /* The maximum number of species in any one
volumetric materials domain in the problem */
int Max_Num_Species_Eqn; /* The maximum number of species equations
in any one volumetric materials domain
in the problem */
int Tot_Num_VolSpecies; /* Total number of different volumetric species in
all of the domains */
int Num_Mat; /* Total number of materials, eventually this will be
distinct from the the number of element blocks
It will be less than or equal to the number of
element blocks. */
int Species_Var_Type; /* Default type of the species variable, i.e., mass
fraction, mole fraction, concentration, capillary
pressure, etc employed for the independent variable.
This may be overwritten by the value in the materials
structure for the present material. The acceptable
values are listed in rf_fem_const.h. This variable
influences all aspects of the species conservation
equation, as well as the names that are put into the
output files. It determines the units for the species
equation, for example. */
double Pressure_Datum; /* Set the pressure Datum for use in thermodynamic
equations of state calculations.
This is an additive constant that get added onto the
pressure field before calculation of all
thermodynamic equations of state calculations. It is
a constant over the entire domain. Therefore, it is
not included in any one materials file. The default
units for the quantity are cgs units, and the
default value for the quantity is 1 atmosphere
= 1.01325E6 gm cm-1 sec-2 (dyne cm-2).
(conversion factor is to an exact standard atm) */
int Max_Num_Porous_Eqn; /* max number of porous media Equations */
dbl Acoustic_Frequency; /* Frequency for Acoustic Harmonic Eqns */
dbl Light_Cosmu; /* Inclination of Incident Light */
dbl Process_Temperature; /* Temperature for thermal property data */
/* for isothermal problems */
int XFEM; /* Flag indicating that XFEM is in use */
int SegregatedSolve; /* Flag indicating segregated solve should be used */
int SegregatedSubcycles;
int PSPG_advection_correction;
int matrix_index[MAX_VARIABLE_TYPES];
int petsc_solve_post_proc;
void *petsc_post_proc_data;
int devss_traceless_gradient;
};
typedef struct Uniform_Problem_Description UPD_STRUCT;
/*____________________________________________________________________________*/
/*
* Problem_Graph Structure:
*
* Problem graph related structure containing information needed for segregated
* solver
*
*/
struct Problem_Graph {
int imtrx; /* Current active matrix index */
/* Temporarily make some things global */
struct Matrix_Data *matrices;
struct Matrix_Data *sub_step_solutions;
int subcycle_fraction[MAX_NUM_MATRICES];
double delta_t_fraction[MAX_NUM_MATRICES];
int time_step_control_disabled[MAX_NUM_MATRICES];
int matrix_subcycle_count[MAX_NUM_MATRICES];
double sub_delta_t[MAX_NUM_MATRICES];
double sub_delta_t_old[MAX_NUM_MATRICES];
double sub_delta_t_older[MAX_NUM_MATRICES];
};
typedef struct Problem_Graph PROBLEM_GRAPH_STRUCT;
/*____________________________________________________________________________*/
/*
* Problem_Description Structure:
*
* Values of equation and variable activity for the problem in the current
* element block.
*/
struct Problem_Description {
int Num_Matrices; /* Number of matrices in each element block */
int Matrix_Activity[MAX_NUM_MATRICES];
/* Matrix activity field in each element block
* 0 -> Matrix is off
* 1 -> Matrix is on
*/
int Num_EQ[MAX_NUM_MATRICES]; /* number of active equations */
int e[MAX_NUM_MATRICES][MAX_EQNS]; /* This is a vector containing the
* active equation terms for each equation.
* within the current element block.
* Each bit in the integer refers to a
* different term that is either on or off
* in corresponding equation - see mm_as_const.h.
* The index is over the equation number referenced
* rf_fem_const.h */
int v[MAX_NUM_MATRICES][MAX_VARIABLE_TYPES]; /* Variable activity bit field
* Bit - Purpose
* 0 -> Variable isn't active nor is its value
* even defined in the problem 1 -> This variable
* occurs in the solution vector. It is solved for.
* 2 -> Variable is a constant in this material.
* 4 -> Variable is not part of the solution
* variable for this element for this material, but
* it does vary across the domain. Value is
* calculated via interp from nodal values 8 ->
* This variable is unique to this material. It
* will not be contiguous across material
* boundaries. At interfaces between materials, the
* value of the variable will have a discontinuity
* across the material interface.
* -- see mm_as_const.h for more info
*/
int mi[MAX_VARIABLE_TYPES]; /* Matrix index for a given variable
* -1 -> Not present in any matrix
* >= 0 -> index into global matrix number
*/
int gv[MAX_VARIABLE_TYPES]; /* If this variable is on in any matrix (for field
variable access) 0 -> not in any matrix 1 -> in
a matrix
*/
int w[MAX_NUM_MATRICES][MAX_EQNS]; /* Weight function for equations */
int i[MAX_NUM_MATRICES][MAX_VARIABLE_TYPES]; /* Interpolation type for each unknown
* in the current element block */
int m[MAX_NUM_MATRICES][MAX_EQNS]; /* Mapping from input file to real names. */
dbl etm[MAX_NUM_MATRICES][MAX_EQNS][MAX_TERM_TYPES]; /* equation term multipliers */
int CoordinateSystem; /* Cartesian, cylindrical, etc. */
int MeshMotion; /* Arbitrary or lagrangian or total ALE*/
int MeshInertia; /* addional inertia due to convection
* in the stress free state */
int RealSolidFluxModel; /* linear or nonlinear */
int MassFluxModel; /* Fickian, Stefan-Maxwell, etc. */
int MomentumFluxModel; /* Newtonian, Carreau, Powerlaw, etc. */
int PorousFluxModel; /* Fickian-Darcy, Darcy */
int Num_Dim; /* Number of spatial dimensions (2 or 3) */
int TimeIntegration; /* Steady, transient scheme */
int Continuation; /* First, second order scheme */
int AugmentingConditions; /* Augmenting conditions */
int IntegrationMap; /* Iso- or sub-parametric mapping */
int ShapeVar; /* Variable whose basis functions will be
* used for manipulation of the geometry
* of the elements within this element
* block. */
int ProjectionVar; /* Variable whose basis functions will be
* used for projection of the field values
* onto the nodal values for elements within
* this element block */
char MaterialName[MAX_MATLNAME]; /* Names of Materials*/
int Num_Species; /* Number of species in present material */
int Num_Species_Eqn; /* Number of species Equations solved for in
* the present material - usually one less
* than the total number of species */
int Species_Var_Type; /* Overrides of the default species var type
* for a particular material. CAUTION, may