EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
egtypes.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file egtypes.h
1 /* femtypes.h */
2 /* Defines the types used in the FEM model. */
3 
4 /* Definiotins used in allocating space for the structures. */
5 #define DIM 2 /* dimension of the space */
6 #define MAXDOFS 20 /* maximum number of variables, e.g. T,P */
7 #define MAXCELLS 100 /* maximum number of subcells in given direction */
8 #define MAXBOUNDARIES 50 /* maximum number of boundaries for BCs */
9 #define MAXMATERIALS 50 /* maximum index of materials */
10 #define MAXCASES 12 /* maximum number of coexisting cases */
11 #define MAXFILESIZE 600 /* maximum filenamesize for i/o files */
12 #define MAXLINESIZE 200 /* maximum length of line to be read */
13 #define MAXNAMESIZE 30 /* maximum size of the variablename */
14 #define MAXPARAMS 30 /* maximum number of parameters */
15 #define MAXVARS 20 /* maximum number of variables at the sides */
16 #define MAXNODESD2 27 /* maximum number of 2D nodes */
17 #define MAXNODESD1 9 /* maximum number of 1D nodes */
18 #define MAXMAPPINGS 10 /* maximum number of geometry mappings */
19 #define MAXCONNECTIONS 100 /* maximum number of connections in dual graph */
20 #define MAXBCS 1000 /* maximum number of BCs in naming */
21 #define MAXBODIES 100 /* maximum number of bodies in naming */
22 #define MAXPARTITIONS 512 /* maximum number of partitions */
23 #define MAXFORMATS 15
24 
25 #define CONPLAIN 0
26 #define CONDISCONT 1
27 #define CONPERIODIC 2
28 #define CONCONSTRAINT 3
29 
30 /* Struture GridType includes the subcell structure of the
31  geometry and the meshing information. The elements may be
32  directly derived from this structures but it takes some
33  time and is not easy to comprehend. Therefore structures
34  CellType and FemType are derived from this data. The special
35  subcell structure is, however, utilized in some mapping
36  subroutines that in general cases would be much more difficult
37  (and expensive) to perform.
38  */
39 struct GridType {
40  int dimension,
41  triangles,
42  layeredbc,
43  partitions,
44  coordsystem, /* 2D cartesian or axisymmetric? */
45  layered,
46  autoratio, /* set the scale in x and y automatically? */
47  minxelems, /* minimum number of elements */
48  minyelems,
49  minzelems,
50  totxelems, /* total number of elements */
51  totyelems,
52  totzelems,
53  elemorder,
57  firstmaterial, /* first material to be included in mesh */
58  lastmaterial, /* last material to be included in mesh */
59  nocells, /* number of subcells */
60  xcells, /* number of subcells in x-direction */
61  ycells,
62  zcells,
63  noelements, /* number of elements in the mesh */
64  noknots, /* number of knots in the mesh */
65  nonodes, /* number of nodes in one element */
66  numbering, /* numbering scheme */
67  maxwidth, /* maxwidth of the band matrix */
68  noboundaries; /* number of boundaries for BCs */
69  int xlinear[MAXCELLS+1], /* linearity flag within the subcells */
70  ylinear[MAXCELLS+1],
71  zlinear[MAXCELLS+1],
72  xelems[MAXCELLS+1], /* number of elements within subcells */
73  yelems[MAXCELLS+1],
74  zelems[MAXCELLS+1],
78  boundint[MAXBOUNDARIES], /* internal material for boundary */
79  boundext[MAXBOUNDARIES], /* external material for boundary */
80  boundsolid[MAXBOUNDARIES],/* which of these is the solid? */
81  boundtype[MAXBOUNDARIES]; /* type of the boundary */
82  int structure[MAXCELLS+2][MAXCELLS+2], /* material structure of subcells */
83  numbered[MAXCELLS+2][MAXCELLS+2]; /* numbering order of the subcells */
84  Real dx0, /* global mesh scale in x-direction */
85  dy0,
86  dz0,
87  limitdx,
89  xyratio, /* ratio between dx0 and dy0 */
90  xzratio;
95  Real x[MAXCELLS+1], /* vertical lines in the goemetry */
96  y[MAXCELLS+1], /* horizontal lines in the geometry */
97  z[MAXCELLS+1],
98  xexpand[MAXCELLS+1], /* local expand ratio in the subcells */
99  yexpand[MAXCELLS+1],
100  zexpand[MAXCELLS+1],
101  xratios[MAXCELLS+1], /* relative mesh scale ratios in subcells */
102  yratios[MAXCELLS+1],
103  zratios[MAXCELLS+1],
104  dx[MAXCELLS+1], /* local mesh scale in the subcells */
105  dy[MAXCELLS+1],
106  dz[MAXCELLS+1],
107  xdens[MAXCELLS+1], /* local density of the mesh in the subcells */
108  ydens[MAXCELLS+1],
109  zdens[MAXCELLS+1];
115 };
116 
117 /* The elements are numbered in the program without allocating
118  space for the knot numbers. Only a limited number of information
119  for each subcell is saved to structure CellType. Specific subroutines
120  are then used to calculate element or knot information using this
121  information. Cell is one macroscopic building block that may be
122  devided to M x N elements. It may even consist of one element. */
123 struct CellType {
124  int nonodes, /* number of nodes within an element */
125  dimension, /* 1D or 2D */
126  numbering, /* numbering scheme */
127  xelem, /* number of elements in the subcell */
128  yelem,
129  levelwidth, /* width in knot numbering */
130  left1st, /* first index in the first line */
131  left2nd, /* first index in the second line */
132  leftlast, /* first index in the last line */
134  leftcenter, /* first index for 8 and 9-node elements */
135  left2center,/* first index in the second line of 12- and 16-node elements */
136  elem1st, /* index of the lower left element */
137  elemwidth, /* width in element numbering */
138  xlinear, /* linearity flag */
139  ylinear,
140  material, /* material flag */
141  xind, yind; /* Indexes of the cell */
142  int boundary[8], /* material indeces of neighbouring cells */
143  neighbour[8]; /* number of neighbouring cells */
144  Real xwidth, /* size of the subcell */
145  ywidth,
146  xratio, /* ratio of elements in the subcell */
147  yratio,
148  dx1, /* local mesh scale */
149  dy1;
150  Real xcorner[4], /* coordinates of the subcell corners */
151  ycorner[4];
152 };
153 
154 
155 /* This type includes all the element information needed for a
156  FEM model: the element topology, node coordinates, node indexing
157  and all the degrees of freedom. */
158 struct FemType {
159  int created, /* is the structure created? */
160  noknots, /* number of knots */
161  noelements, /* number of elements */
162  coordsystem, /* coordsystem flag */
163  nocells, /* number of subcells */
164  maxnodes, /* maximum number of nodes */
165  dim, /* dimension of space */
166  variables, /* number of variables */
169  indexwidth,
170  dualexists,
171 
175 
177  maxinvtopo,
179  timesteps, /* number of timesteps */
180  periodicexist, /* does the periodic vector exist? */
181  *periodic, /* peridic ordering vector, if needed */
182  connectexist, /* does the connection vector exist? */
183  *connect, /* connections between nodes, if needed */
184  partitionexist,/* does the partitioning exist? */
185  nopartitions, /* number of partitions */
186  *elempart, /* which partition owns the element */
187  *nodepart, /* which partition owns the node */
188  *elementtypes, /* types of elements using Elmer convention */
189  *material, /* material for each element */
190  **topology, /* element topology */
193  int edofs[MAXDOFS], /* number of dofs in each node */
194  alldofs[MAXDOFS]; /* total number of variables */
196  Real *x, /* in axisymmetric case r */
197  *y, /* in axisymmetric case z */
198  *z, /* in cylindrical case theta */
199  *times;
200  Real *dofs[MAXDOFS]; /* degrees of freedom in the mesh */
204  int noboundaries, /* number of boundaries */
205  boundint[MAXBOUNDARIES], /* internal material in the boundary */
206  boundext[MAXBOUNDARIES], /* external material in the boundary */
207  boundsolid[MAXBOUNDARIES], /* which one is solid? */
208  boundtype[MAXBOUNDARIES]; /* type of the boundary */
209 };
210 
211 /* The boundaries between different materials or domains
212  are saved into this structure. It is used for setting
213  the boundary conditions. In physics it is typical that
214  the BCs are more complicated than the equations in the
215  bulk and therefore the stucture must be such that it
216  enables the use of a wide variety of BCs. */
217 struct BoundaryType {
218  int created, /* is boundary created? */
219  nosides, /* sides on the boundary */
220  maxsidenodes, /* number of sidenodes on the element */
221  fixedpoints, /* number of fixed points allowed */
222  coordsystem, /* coordinate system flag */
223  vfcreated, /* are view factors created */
224  gfcreated, /* are Gephart factors created */
225  maparea, /* mappings of the area */
226  mapvf, /* mappings of the view factors */
227  open, /* is the closure partially open? */
228  echain, /* does the chain exist? */
229  ediscont, /* does the discontinous boundary exist */
230  chainsize; /* size of the chain */
231  int *parent, /* primary parents of the sides */
232  *parent2, /* secondary parents of the sides */
233  *material, /* material of the sides */
234  *side, /* side in the primary parent element */
235  *side2, /* side in the secondary parent element */
236  *chain, /* indices in the chain representation */
237  *types,
238  *discont, /* type of discontinuous and periodic BCs */
239  *normal, /* direction of the normal */
240  *elementtypes, /* side element types if needed */
241  **topology, /* topology if needed */
242  points[MAXVARS], /* how many points for each side? */
243  evars[MAXVARS]; /* does the variables exist? */
244  Real totalarea, /* total area of the side */
245  areasexist,
246  *areas, /* side areas */
247  **vf, /* view factors */
248  **gf, /* Gephart factors */
249  *vars[MAXVARS]; /* variables on the sides */
250  char varname[MAXVARS][MAXNAMESIZE]; /* variable name */
251 };
252 
253 
254 #define MAXSIDEBULK 10
256 
257  int dim,
258  silent,
259  center,
260  scale, /* scale the geometry */
261  order, /* reorder the nodes */
262  merge, /* merge mesges */
263  translate, /* translate the mesh */
264  rotate, /* rotate the mesh */
265  clone[3], /* clone the mesh the number of given times */
266  mirror[3], /* mirror the mash around the given axis */
267  canter,
268  decimals, /* save the mesh with number of decimals */
269  layers, /* create boundary layers */
272  layermove, /* map the created layer to the original geometry */
273  metis, /* number of Metis partitions */
274  partopt, /* free parameter for optimization */
275  partitions, /* number of simple geometric partitions */
276  partdim[3],
277  inmethod, /* method in which mesh is read in to ElmerGrid */
278  outmethod, /* method in which the mesh is written by ElmerGrid */
280  sidemappings,
282  bulkmappings,
283  boundorder,
284  bulkorder,
285  boundbounds,
287  bulkbounds,
289  mirrorbc,
292  triangles,
293  polar,
294  usenames,
295  isoparam,
296  cylinder,
297  info,
298  unitemeshes,
299  reduce,
300  removelowdim,
301  removeunused,
302  increase,
303  reducemat1,
304  reducemat2,
305  findsides,
307  nodes3d,
308  elements3d,
309  periodic,
310  periodicdim[3],
311  discont,
313  connect,
315  partorder,
316  partitionhalo, /* create halo for the partitioning */
317  partitionindirect, /* should one create indirect connections between nodes */
318  nofilesin,
319  saveinterval[3],
324  bcoffset;
325 
327  corder[3],
328  cmerge,
329  ctranslate[3],
330  crotate[3],
331  clonesize[3],
334  layereps,
335  triangleangle,
336  partcorder[3],
337  polarradius,
338  relh;
339 
343 };
344