Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/post/src/elements/8node_brick.c
3203 views
1
/*****************************************************************************
2
*
3
* Elmer, A Finite Element Software for Multiphysical Problems
4
*
5
* Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program (in file fem/GPL-2); if not, write to the
19
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
* Boston, MA 02110-1301, USA.
21
*
22
*****************************************************************************/
23
24
/*******************************************************************************
25
*
26
* Definitions for 8 node brick volume element.
27
*
28
*******************************************************************************
29
*
30
* Author: Juha Ruokolainen
31
*
32
* Address: CSC - IT Center for Science Ltd.
33
* Keilaranta 14, P.O. BOX 405
34
* 02101 Espoo, Finland
35
* Tel. +358 0 457 2723
36
* Telefax: +358 0 457 2302
37
* EMail: [email protected]
38
*
39
* Date: 27 Sep 1995
40
*
41
* Modified by:
42
*
43
* Date of modification:
44
*
45
******************************************************************************/
46
47
#include "../elmerpost.h"
48
#include <elements.h>
49
50
/*
51
* Eight node brick volume element.
52
*
53
* 7---------6
54
* /| /|
55
* 4---------5 |
56
* | | | |
57
* | | | |
58
* | 3-------|-2 w v
59
* w|/v |/ |/
60
* 0---------1 ---u
61
* u
62
*/
63
64
static double A[8][8],N[8][8];
65
66
static double NodeU[] = { -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0 };
67
static double NodeV[] = { -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, 1.0 };
68
static double NodeW[] = { -1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0 };
69
70
71
/*******************************************************************************
72
*
73
* Name: elm_8node_brick_triangulate( geometry_t *,element_t * )
74
*
75
* Purpose: Triangulate an element. The process also builds up an edge
76
* table and adds new nodes to node table. The triangulation
77
* and edge table is stored in geometry_t *geom-structure.
78
*
79
* Parameters:
80
*
81
* Input: (geometry_t *) pointer to structure holding triangulation
82
* (element_t *) element to triangulate
83
*
84
* Output: (geometry_t *) structure is modified
85
*
86
* Return value: FALSE if malloc() fails, TRUE otherwise
87
*
88
******************************************************************************/
89
static int elm_8node_brick_triangulate( geometry_t *geom,element_t *brick )
90
{
91
element_t quad;
92
int i,j;
93
int geo_add_edge();
94
int elm_4node_quad_triangulate();
95
96
if ( GlobalOptions.VolumeSides )
97
{
98
int topo[4];
99
100
quad.DisplayFlag = TRUE;
101
quad.Topology = topo;
102
for( i=0; i<MAX_GROUP_IDS; i++ ) quad.GroupIds[i] = brick->GroupIds[i];
103
104
for( i=0; i<6; i++ )
105
{
106
for( j=0; j<4; j++ ) quad.Topology[j] = brick->Topology[ElmBrickFace[i][j]];
107
if ( !elm_4node_quad_triangulate( geom, &quad, brick ) ) return FALSE;
108
}
109
} else {
110
if ( !geo_add_edge( geom, brick->Topology[0], brick->Topology[1],brick ) ) return FALSE;
111
if ( !geo_add_edge( geom, brick->Topology[0], brick->Topology[3],brick ) ) return FALSE;
112
if ( !geo_add_edge( geom, brick->Topology[0], brick->Topology[4],brick ) ) return FALSE;
113
if ( !geo_add_edge( geom, brick->Topology[1], brick->Topology[2],brick ) ) return FALSE;
114
if ( !geo_add_edge( geom, brick->Topology[1], brick->Topology[5],brick ) ) return FALSE;
115
if ( !geo_add_edge( geom, brick->Topology[2], brick->Topology[3],brick ) ) return FALSE;
116
if ( !geo_add_edge( geom, brick->Topology[2], brick->Topology[6],brick ) ) return FALSE;
117
if ( !geo_add_edge( geom, brick->Topology[3], brick->Topology[7],brick ) ) return FALSE;
118
if ( !geo_add_edge( geom, brick->Topology[4], brick->Topology[5],brick ) ) return FALSE;
119
if ( !geo_add_edge( geom, brick->Topology[4], brick->Topology[7],brick ) ) return FALSE;
120
if ( !geo_add_edge( geom, brick->Topology[5], brick->Topology[6],brick ) ) return FALSE;
121
if ( !geo_add_edge( geom, brick->Topology[6], brick->Topology[7],brick ) ) return FALSE;
122
}
123
124
return TRUE;
125
}
126
127
128
129
130
/*******************************************************************************
131
*
132
* Name: elm_8node_brick_shape_functions( )
133
*
134
* Purpose: Initialize element shape function array. Internal only.
135
*
136
* Parameters:
137
*
138
* Input: Global (filewise) variables NodeU,NodeV,NodeW
139
*
140
* Output: Global (filewise) variable N[8][8], will contain
141
* shape function coefficients
142
*
143
* Return value: void
144
*
145
******************************************************************************/
146
static void elm_8node_brick_shape_functions()
147
{
148
double u,v,w;
149
150
int i,j;
151
152
for( i=0; i<8; i++ )
153
{
154
u = NodeU[i];
155
v = NodeV[i];
156
w = NodeW[i];
157
158
A[i][0] = 1;
159
A[i][1] = u;
160
A[i][2] = v;
161
A[i][3] = w;
162
A[i][4] = u*v;
163
A[i][5] = u*w;
164
A[i][6] = v*w;
165
A[i][7] = u*v*w;
166
}
167
168
lu_mtrinv( (double *)A,8 );
169
170
for( i=0; i<8; i++ )
171
for( j=0; j<8; j++ ) N[i][j] = A[j][i];
172
}
173
174
/*******************************************************************************
175
*
176
* Name: elm_8node_brick_fvalue( double *,double,double,double )
177
*
178
* Purpose: return value of a quantity given on nodes at point (u,v,w)
179
* Use trough (element_type_t *) structure.
180
*
181
* Parameters:
182
*
183
* Input: (double *) quantity values at nodes
184
* (double,double,double) point where values are evaluated
185
*
186
* Output: none
187
*
188
* Return value: quantity value
189
*
190
******************************************************************************/
191
static double elm_8node_brick_fvalue(double *F,double u,double v,double w)
192
{
193
double R=0.0,uv=u*v,uw=u*w,vw=v*w,uvw=u*v*w;
194
int i;
195
196
for( i=0; i<8; i++ )
197
{
198
R += F[i]*(N[i][0]+
199
N[i][1]*u+
200
N[i][2]*v+
201
N[i][3]*w+
202
N[i][4]*uv+
203
N[i][5]*uw+
204
N[i][6]*vw+
205
N[i][7]*uvw );
206
}
207
208
return R;
209
}
210
211
/*******************************************************************************
212
*
213
* Name: elm_8node_brick_dndu_fvalue( double *,double,double,double )
214
*
215
* Purpose: return value of a first partial derivate in (v) of a
216
* quantity given on nodes at point (u,v).
217
* Use trough (element_type_t *) structure.
218
*
219
*
220
* Parameters:
221
*
222
* Input: (double *) quantity values at nodes
223
* (double u,double v,double w) point where values are evaluated
224
*
225
* Output: none
226
*
227
* Return value: quantity value
228
*
229
******************************************************************************/
230
static double elm_8node_brick_dndu_fvalue(double *F,double u,double v,double w)
231
{
232
double R=0.0,vw=v*w;
233
int i;
234
235
for( i=0; i<8; i++ )
236
{
237
R += F[i]*(N[i][1] + N[i][4]*v + N[i][5]*w + N[i][7]*vw);
238
}
239
240
return R;
241
}
242
243
/*******************************************************************************
244
*
245
* Name: elm_8node_brick_dndv_fvalue( double *,double,double,double )
246
*
247
* Purpose: return value of a first partial derivate in (v) of a
248
* quantity given on nodes at point (u,v,w).
249
* Use trough (element_type_t *) structure.
250
*
251
*
252
* Parameters:
253
*
254
* Input: (double *) quantity values at nodes
255
* (double u,double v,double w) point where values are evaluated
256
*
257
* Output: none
258
*
259
* Return value: quantity value
260
*
261
******************************************************************************/
262
static double elm_8node_brick_dndv_fvalue(double *F,double u,double v,double w)
263
{
264
double R=0.0,uw=u*w;
265
int i;
266
267
for( i=0; i<8; i++ )
268
{
269
R += F[i]*(N[i][2] + N[i][4]*u + N[i][6]*w + N[i][7]*uw);
270
}
271
272
return R;
273
}
274
275
/*******************************************************************************
276
*
277
* Name: elm_8node_brick_dndw_fvalue( double *,double,double,double )
278
*
279
* Purpose: return value of a first partial derivate in (w) of a
280
* quantity given on nodes at point (u,v,w)
281
* Use trough (element_type_t *) structure.
282
*
283
*
284
* Parameters:
285
*
286
* Input: (double *) quantity values at nodes
287
* (double u,double v,double w) point where values are evaluated
288
*
289
* Output: none
290
*
291
* Return value: quantity value
292
*
293
******************************************************************************/
294
static double elm_8node_brick_dndw_fvalue(double *F,double u,double v,double w)
295
{
296
double R=0.0,uv=u*v;
297
int i;
298
299
for( i=0; i<8; i++ )
300
{
301
R += F[i]*(N[i][3] + N[i][5]*u + N[i][6]*v + N[i][7]*uv);
302
}
303
304
return R;
305
}
306
307
/*******************************************************************************
308
*
309
* Name: elm_8node_brick_point_inside(
310
* double *nx,double *ny,double *nz,
311
* double px, double py, double pz,
312
* double *u,double *v,double *w )
313
*
314
* Purpose: Find if point (px,py,pz) is inside the element, and return
315
* element coordinates of the point.
316
*
317
* Parameters:
318
*
319
* Input: (double *) nx,ny,nz node coordinates
320
* (double) px,py,pz point to consider
321
*
322
* Output: (double *) u,v,w point in element coordinates if inside
323
*
324
* Return value: in/out status
325
*
326
* NOTES: the goal here can be hard for more involved element types. kind of
327
* trivial for this one...
328
*
329
******************************************************************************/
330
int elm_8node_brick_point_inside
331
(
332
double *nx, double *ny, double *nz,
333
double px, double py, double pz, double *u,double *v,double *w
334
)
335
{
336
double x[4],y[4],z[4],r,s,t,maxx,minx,maxy,miny,maxz,minz;
337
int i,j;
338
339
static int map[12][3] =
340
{
341
{ 0,1,2 }, { 0,2,3 }, { 4,5,6 }, { 4,6,7 }, { 3,2,6 }, { 3,6,7 },
342
{ 1,5,6 }, { 1,6,2 }, { 0,4,7 }, { 0,7,3 }, { 0,1,5 }, { 0,5,4 },
343
};
344
int elm_4node_tetra_point_inside();
345
346
maxx = minx = nx[0];
347
maxy = miny = ny[0];
348
maxz = minz = nz[0];
349
350
for( i=1; i<8; i++ )
351
{
352
maxx = MAX( nx[i],maxx );
353
maxy = MAX( ny[i],maxy );
354
maxz = MAX( nz[i],maxz );
355
356
minx = MIN( nx[i],minx );
357
miny = MIN( ny[i],miny );
358
minz = MIN( nz[i],minz );
359
}
360
361
if ( px > maxx || px < minx ) return FALSE;
362
if ( py > maxy || py < miny ) return FALSE;
363
if ( pz > maxz || pz < minz ) return FALSE;
364
365
x[0] = 0.125*(nx[0]+nx[1]+nx[2]+nx[3]+nx[4]+nx[5]+nx[6]+nx[7]);
366
y[0] = 0.125*(ny[0]+ny[1]+ny[2]+ny[3]+ny[4]+ny[5]+ny[6]+ny[7]);
367
z[0] = 0.125*(nz[0]+nz[1]+nz[2]+nz[3]+nz[4]+nz[5]+nz[6]+nz[7]);
368
369
for( i=0; i<12; i++ )
370
{
371
for( j=0; j<3; j++ )
372
{
373
x[j+1] = nx[map[i][j]];
374
y[j+1] = ny[map[i][j]];
375
z[j+1] = nz[map[i][j]];
376
}
377
378
if ( elm_4node_tetra_point_inside( x,y,z,px,py,pz,&r,&s,&t ) )
379
{
380
*u = NodeU[map[i][0]]*r + NodeU[map[i][1]]*s + NodeU[map[i][2]]*t;
381
*v = NodeV[map[i][0]]*r + NodeV[map[i][1]]*s + NodeV[map[i][2]]*t;
382
*w = NodeW[map[i][0]]*r + NodeW[map[i][1]]*s + NodeW[map[i][2]]*t;
383
return TRUE;
384
}
385
}
386
387
return FALSE;
388
}
389
390
/*******************************************************************************
391
*
392
* Name: elm_8node_brick_isoline
393
*
394
* Purpose: Extract a iso line from triangle with given threshold
395
*
396
* Parameters:
397
*
398
* Input: (double) K, contour threshold
399
* (double *) F, contour quantity
400
* (double *) C, color quantity
401
* (double *) X,Y,Z vertex coords.
402
*
403
* Output: (line_t *) place to store the line
404
*
405
* Return value: number of lines generated (0,...,24)
406
*
407
******************************************************************************/
408
int elm_8node_brick_isoline
409
(
410
double K, double *F, double *C,double *X,double *Y,double *Z,line_t *Line
411
)
412
{
413
double f[4],c[4],x[4],y[4],z[4];
414
415
int i, j, k, n=0, above=0;
416
int elm_4node_quad_isoline();
417
418
for( i=0; i<8; i++ ) above += F[i]>K;
419
if ( above == 0 || above == 8 ) return 0;
420
421
for( i=0; i<6; i++ )
422
{
423
for( j=0; j<4; j++ )
424
{
425
k = ElmBrickFace[i][j];
426
f[j] = F[k];
427
c[j] = C[k];
428
x[j] = X[k];
429
y[j] = Y[k];
430
z[j] = Z[k];
431
}
432
n += elm_4node_quad_isoline( K,f,c,x,y,z,&Line[n] );
433
}
434
435
return n;
436
}
437
438
/*******************************************************************************
439
*
440
* Name: elm_8node_brick_isosurface
441
*
442
* Purpose: Extract isosurfaces for brick element.
443
*
444
* Parameters:
445
*
446
* Input: (double ) K: contour threshold
447
* (double *) F: contour quantity values at nodes
448
* (double *) C: color quantity values at nodes
449
* (double *) X,Y,Z: node coordinates
450
* (double *) U,V,W: normal vector at nodes
451
*
452
* Output: (polygon_t *)Polygon: output triangles.
453
*
454
* Return value: How many triangles we've got (possible values are 0-48)...
455
*
456
******************************************************************************/
457
int elm_8node_brick_isosurface
458
(
459
double K,double *F,double *C, double *X,double *Y,double *Z,
460
double *U,double *V,double *W, polygon_t *Polygon
461
)
462
{
463
double tx[4],ty[4],tz[4],tu[4],tv[4],tw[4],tf[4],tc[4];
464
int i,j,n;
465
466
int above = 0, below = 0;
467
468
int elm_4node_tetra_isosurface();
469
470
for( i=0; i<8; i++ ) above += F[i]>K;
471
for( i=0; i<8; i++ ) below += F[i]<K;
472
if ( below == 8 || above == 8 ) return 0;
473
474
tx[0] = 0.125 * ( X[0] + X[1] + X[2] + X[3] + X[4] + X[5] + X[6] + X[7] );
475
ty[0] = 0.125 * ( Y[0] + Y[1] + Y[2] + Y[3] + Y[4] + Y[5] + Y[6] + Y[7] );
476
tz[0] = 0.125 * ( Z[0] + Z[1] + Z[2] + Z[3] + Z[4] + Z[5] + Z[6] + Z[7] );
477
tu[0] = 0.125 * ( U[0] + U[1] + U[2] + U[3] + U[4] + U[5] + U[6] + U[7] );
478
tv[0] = 0.125 * ( V[0] + V[1] + V[2] + V[3] + V[4] + V[5] + V[6] + V[7] );
479
tw[0] = 0.125 * ( W[0] + W[1] + W[2] + W[3] + W[4] + W[5] + W[6] + W[7] );
480
tf[0] = 0.125 * ( F[0] + F[1] + F[2] + F[3] + F[4] + F[5] + F[6] + F[7] );
481
tc[0] = 0.125 * ( C[0] + C[1] + C[2] + C[3] + C[4] + C[5] + C[6] + C[7] );
482
483
n = 0;
484
for( i=0; i<6; i++ )
485
{
486
tx[1] = 0.0;
487
ty[1] = 0.0;
488
tz[1] = 0.0;
489
tu[1] = 0.0;
490
tv[1] = 0.0;
491
tw[1] = 0.0;
492
tf[1] = 0.0;
493
tc[1] = 0.0;
494
for( j=0; j<4; j++ )
495
{
496
tx[1] += X[ElmBrickFace[i][j]];
497
ty[1] += Y[ElmBrickFace[i][j]];
498
tz[1] += Z[ElmBrickFace[i][j]];
499
tu[1] += U[ElmBrickFace[i][j]];
500
tv[1] += V[ElmBrickFace[i][j]];
501
tw[1] += W[ElmBrickFace[i][j]];
502
tf[1] += F[ElmBrickFace[i][j]];
503
tc[1] += C[ElmBrickFace[i][j]];
504
}
505
tx[1] /= 4.0;
506
ty[1] /= 4.0;
507
tz[1] /= 4.0;
508
tu[1] /= 4.0;
509
tv[1] /= 4.0;
510
tw[1] /= 4.0;
511
tf[1] /= 4.0;
512
tc[1] /= 4.0;
513
514
for( j=0; j<3; j++ )
515
{
516
tx[2] = X[ElmBrickFace[i][j]];
517
ty[2] = Y[ElmBrickFace[i][j]];
518
tz[2] = Z[ElmBrickFace[i][j]];
519
tu[2] = U[ElmBrickFace[i][j]];
520
tv[2] = V[ElmBrickFace[i][j]];
521
tw[2] = W[ElmBrickFace[i][j]];
522
tf[2] = F[ElmBrickFace[i][j]];
523
tc[2] = C[ElmBrickFace[i][j]];
524
525
tx[3] = X[ElmBrickFace[i][j+1]];
526
ty[3] = Y[ElmBrickFace[i][j+1]];
527
tz[3] = Z[ElmBrickFace[i][j+1]];
528
tu[3] = U[ElmBrickFace[i][j+1]];
529
tv[3] = V[ElmBrickFace[i][j+1]];
530
tw[3] = W[ElmBrickFace[i][j+1]];
531
tf[3] = F[ElmBrickFace[i][j+1]];
532
tc[3] = C[ElmBrickFace[i][j+1]];
533
n += elm_4node_tetra_isosurface( K,tf,tc,tx,ty,tz,tu,tv,tw,&Polygon[n] );
534
}
535
536
tx[2] = X[ElmBrickFace[i][3]];
537
ty[2] = Y[ElmBrickFace[i][3]];
538
tz[2] = Z[ElmBrickFace[i][3]];
539
tu[2] = U[ElmBrickFace[i][3]];
540
tv[2] = V[ElmBrickFace[i][3]];
541
tw[2] = W[ElmBrickFace[i][3]];
542
tf[2] = F[ElmBrickFace[i][3]];
543
tc[2] = C[ElmBrickFace[i][3]];
544
545
tx[3] = X[ElmBrickFace[i][0]];
546
ty[3] = Y[ElmBrickFace[i][0]];
547
tz[3] = Z[ElmBrickFace[i][0]];
548
tu[3] = U[ElmBrickFace[i][0]];
549
tv[3] = V[ElmBrickFace[i][0]];
550
tw[3] = W[ElmBrickFace[i][0]];
551
tf[3] = F[ElmBrickFace[i][0]];
552
tc[3] = C[ElmBrickFace[i][0]];
553
n += elm_4node_tetra_isosurface( K,tf,tc,tx,ty,tz,tu,tv,tw,&Polygon[n] );
554
}
555
return n;
556
}
557
558
/*******************************************************************************
559
*
560
* Name: elm_8node_brick_isosurface1
561
*
562
* Purpose: Extract isosurfaces for brick element.
563
*
564
* Parameters:
565
*
566
* Input: (double ) K: contour threshold
567
* (double *) F: contour quantity values at nodes
568
* (double *) C: color quantity values at nodes
569
* (double *) X,Y,Z: node coordinates
570
* (double *) U,V,W: normal vector at nodes
571
*
572
* Output: (polygon_t *)Polygon: output triangles.
573
*
574
* Return value: How many triangles we've got (possible values are 0-48)...
575
*
576
******************************************************************************/
577
int elm_8node_brick_isosurface1
578
(
579
double K,double *F,double *C, double *X,double *Y,double *Z,
580
double *U,double *V,double *W, polygon_t *Polygon
581
)
582
{
583
double tx[4],ty[4],tz[4],tu[4],tv[4],tw[4],tf[4],tc[4];
584
int i,j,l,n;
585
586
static int map[12][3] =
587
{
588
{ 0,1,2 }, { 0,2,3 }, { 4,5,6 }, { 4,6,7 }, { 3,2,6 }, { 3,6,7 },
589
{ 1,5,6 }, { 1,6,2 }, { 0,4,7 }, { 0,7,3 }, { 0,1,5 }, { 0,5,4 },
590
};
591
592
int above = 0, below = 0;
593
594
int elm_4node_tetra_isosurface();
595
596
for( i=0; i<8; i++ ) above += F[i]>K;
597
for( i=0; i<8; i++ ) below += F[i]<K;
598
if ( below == 8 || above == 8 ) return 0;
599
600
tx[0] = 0.125 * ( X[0] + X[1] + X[2] + X[3] + X[4] + X[5] + X[6] + X[7] );
601
ty[0] = 0.125 * ( Y[0] + Y[1] + Y[2] + Y[3] + Y[4] + Y[5] + Y[6] + Y[7] );
602
tz[0] = 0.125 * ( Z[0] + Z[1] + Z[2] + Z[3] + Z[4] + Z[5] + Z[6] + Z[7] );
603
tu[0] = 0.125 * ( U[0] + U[1] + U[2] + U[3] + U[4] + U[5] + U[6] + U[7] );
604
tv[0] = 0.125 * ( V[0] + V[1] + V[2] + V[3] + V[4] + V[5] + V[6] + V[7] );
605
tw[0] = 0.125 * ( W[0] + W[1] + W[2] + W[3] + W[4] + W[5] + W[6] + W[7] );
606
tf[0] = 0.125 * ( F[0] + F[1] + F[2] + F[3] + F[4] + F[5] + F[6] + F[7] );
607
tc[0] = 0.125 * ( C[0] + C[1] + C[2] + C[3] + C[4] + C[5] + C[6] + C[7] );
608
609
n = 0;
610
for( i=0; i<12; i++ )
611
{
612
for( j=1; j<4; j++ )
613
{
614
l = map[i][j-1];
615
tx[j] = X[l];
616
ty[j] = Y[l];
617
tz[j] = Z[l];
618
tu[j] = U[l];
619
tv[j] = V[l];
620
tw[j] = W[l];
621
tf[j] = F[l];
622
tc[j] = C[l];
623
}
624
n += elm_4node_tetra_isosurface( K,tf,tc,tx,ty,tz,tu,tv,tw,&Polygon[n] );
625
}
626
return n;
627
}
628
629
630
/******************************************************************************
631
*
632
* Name: elm_8node_brick_initialize( )
633
*
634
* Purpose: Register the element type
635
*
636
* Parameters:
637
*
638
* Input: (char *) description of the element
639
* (int) numeric code for the element
640
*
641
* Output: Global list of element types is modified
642
*
643
* Return value: malloc() success
644
*
645
******************************************************************************/
646
int elm_8node_brick_initialize()
647
{
648
static char *Name = "ELM_8NODE_BRICK";
649
650
element_type_t ElementDef;
651
652
int elm_add_element_type();
653
654
elm_8node_brick_shape_functions();
655
656
ElementDef.ElementName = Name;
657
ElementDef.ElementCode = 808;
658
659
ElementDef.NumberOfNodes = 8;
660
661
ElementDef.NodeU = NodeU;
662
ElementDef.NodeV = NodeV;
663
ElementDef.NodeW = NodeW;
664
665
ElementDef.PartialU = (double (*)())elm_8node_brick_dndu_fvalue;
666
ElementDef.PartialV = (double (*)())elm_8node_brick_dndv_fvalue;
667
ElementDef.PartialW = (double (*)())elm_8node_brick_dndw_fvalue;
668
669
ElementDef.FunctionValue = (double (*)())elm_8node_brick_fvalue;
670
ElementDef.Triangulate = (int (*)())elm_8node_brick_triangulate;
671
ElementDef.PointInside = (int (*)())elm_8node_brick_point_inside;
672
ElementDef.IsoLine = (int (*)())elm_8node_brick_isoline;
673
ElementDef.IsoSurface = (int (*)())elm_8node_brick_isosurface1;
674
675
return elm_add_element_type( &ElementDef ) ;
676
}
677
678
679