/[escript]/trunk/finley/src/Mesh_hex8.c
ViewVC logotype

Annotation of /trunk/finley/src/Mesh_hex8.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2748 - (hide annotations)
Tue Nov 17 07:32:59 2009 UTC (9 years, 11 months ago) by gross
File MIME type: text/plain
File size: 20572 byte(s)
Macro elements are implemented now. VTK writer for macro elements still needs testing.
1 jgs 150
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2548 * Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13 ksteube 1312
14 ksteube 1811
15 jgs 82 /**************************************************************/
16    
17     /* Finley: generates rectangular meshes */
18    
19     /* Generates a numElements[0] x numElements[1] x numElements[2] mesh with first order elements (Hex8) in the brick */
20     /* [0,Length[0]] x [0,Length[1]] x [0,Length[2]]. order is the desired accuracy of the */
21     /* integration scheme. */
22    
23     /**************************************************************/
24    
25     #include "RectangularMesh.h"
26    
27 ksteube 1312 Finley_Mesh* Finley_RectangularMesh_Hex8(dim_t* numElements,
28     double* Length,
29     bool_t* periodic,
30     index_t order,
31     index_t reduced_order,
32     bool_t useElementsOnFace,
33     bool_t useFullElementOrder,
34     bool_t optimize)
35 bcumming 751 {
36 ksteube 1312 #define N_PER_E 1
37     #define DIM 3
38 gross 2748 dim_t N0,N1,N2,NE0,NE1,NE2,i0,i1,i2,k,Nstride0=0, Nstride1=0,Nstride2=0, local_NE0, local_NE1, local_NE2, local_N0=0, local_N1=0, local_N2=0;
39     dim_t totalNECount,faceNECount,NDOF0=0,NDOF1=0,NDOF2=0,NFaceElements=0, NN;
40     index_t node0, myRank, e_offset2, e_offset1, e_offset0=0, offset1=0, offset2=0, offset0=0, global_i0, global_i1, global_i2;
41     Finley_ReferenceElementSet *refPoints=NULL, *refContactElements=NULL, *refFaceElements=NULL, *refElements=NULL;
42 ksteube 1312 Finley_Mesh* out;
43     Paso_MPIInfo *mpi_info = NULL;
44     char name[50];
45 jfenwick 1981 #ifdef Finley_TRACE
46 ksteube 1312 double time0=Finley_timer();
47 jfenwick 1981 #endif
48 bcumming 751
49 ksteube 1312 /* get MPI information */
50     mpi_info = Paso_MPIInfo_alloc( MPI_COMM_WORLD );
51     if (! Finley_noError()) {
52     return NULL;
53 bcumming 751 }
54 ksteube 1312 myRank=mpi_info->rank;
55 bcumming 751
56 ksteube 1312 /* set up the global dimensions of the mesh */
57 bcumming 751
58 jgs 82 NE0=MAX(1,numElements[0]);
59     NE1=MAX(1,numElements[1]);
60     NE2=MAX(1,numElements[2]);
61 ksteube 1312 N0=N_PER_E*NE0+1;
62     N1=N_PER_E*NE1+1;
63     N2=N_PER_E*NE2+1;
64 jgs 82
65 ksteube 1312 /* allocate mesh: */
66     sprintf(name,"Rectangular %d x %d x %d mesh",N0,N1,N2);
67     out=Finley_Mesh_alloc(name,DIM,order, reduced_order, mpi_info);
68     if (! Finley_noError()) {
69     Paso_MPIInfo_free( mpi_info );
70     return NULL;
71 jgs 153 }
72 gross 2748 refElements= Finley_ReferenceElementSet_alloc(Hex8,out->order,out->reduced_order);
73     if (useElementsOnFace) {
74     refFaceElements=Finley_ReferenceElementSet_alloc(Hex8Face, out->order, out->reduced_order);
75     refContactElements=Finley_ReferenceElementSet_alloc(Hex8Face_Contact, out->order, out->reduced_order);
76 jgs 82 } else {
77 gross 2748 refFaceElements=Finley_ReferenceElementSet_alloc(Rec4, out->order, out->reduced_order);
78     refContactElements=Finley_ReferenceElementSet_alloc(Rec4_Contact, out->order, out->reduced_order);
79 jgs 82 }
80 gross 2748 refPoints=Finley_ReferenceElementSet_alloc(Point1, out->order, out->reduced_order);
81    
82    
83     if ( Finley_noError()) {
84    
85     Finley_Mesh_setPoints(out,Finley_ElementFile_alloc(refPoints, mpi_info));
86     Finley_Mesh_setContactElements(out,Finley_ElementFile_alloc(refContactElements, mpi_info));
87     Finley_Mesh_setFaceElements(out,Finley_ElementFile_alloc(refFaceElements, mpi_info));
88     Finley_Mesh_setElements(out,Finley_ElementFile_alloc(refElements, mpi_info));
89 ksteube 1312
90 gross 2748 /* work out the largest dimension */
91     if (N2==MAX3(N0,N1,N2)) {
92     Nstride0=1;
93     Nstride1=N0;
94     Nstride2=N0*N1;
95     local_NE0=NE0;
96     e_offset0=0;
97     local_NE1=NE1;
98     e_offset1=0;
99     Paso_MPIInfo_Split(mpi_info,NE2,&local_NE2,&e_offset2);
100     } else if (N1==MAX3(N0,N1,N2)) {
101     Nstride0=N2;
102     Nstride1=N0*N2;
103     Nstride2=1;
104     local_NE0=NE0;
105     e_offset0=0;
106     Paso_MPIInfo_Split(mpi_info,NE1,&local_NE1,&e_offset1);
107     local_NE2=NE2;
108     e_offset2=0;
109     } else {
110     Nstride0=N1*N2;
111     Nstride1=1;
112     Nstride2=N1;
113     Paso_MPIInfo_Split(mpi_info,NE0,&local_NE0,&e_offset0);
114     local_NE1=NE1;
115     e_offset1=0;
116     local_NE2=NE2;
117     e_offset2=0;
118     }
119     offset0=e_offset0*N_PER_E;
120     offset1=e_offset1*N_PER_E;
121     offset2=e_offset2*N_PER_E;
122     local_N0=local_NE0>0 ? local_NE0*N_PER_E+1 : 0;
123     local_N1=local_NE1>0 ? local_NE1*N_PER_E+1 : 0;
124     local_N2=local_NE2>0 ? local_NE2*N_PER_E+1 : 0;
125 bcumming 751
126 gross 2748 /* get the number of surface elements */
127 jgs 82
128 gross 2748 NFaceElements=0;
129     if (!periodic[2] && (local_NE2>0)) {
130     NDOF2=N2;
131     if (offset2==0) NFaceElements+=local_NE1*local_NE0;
132     if (local_NE2+e_offset2 == NE2) NFaceElements+=local_NE1*local_NE0;
133     } else {
134     NDOF2=N2-1;
135     }
136 ksteube 1312
137 gross 2748 if (!periodic[0] && (local_NE0>0)) {
138     NDOF0=N0;
139     if (e_offset0 == 0) NFaceElements+=local_NE1*local_NE2;
140     if (local_NE0+e_offset0 == NE0) NFaceElements+=local_NE1*local_NE2;
141     } else {
142     NDOF0=N0-1;
143     }
144     if (!periodic[1] && (local_NE1>0)) {
145     NDOF1=N1;
146     if (e_offset1 == 0) NFaceElements+=local_NE0*local_NE2;
147     if (local_NE1+e_offset1 == NE1) NFaceElements+=local_NE0*local_NE2;
148     } else {
149     NDOF1=N1-1;
150     }
151 jgs 82 }
152 gross 2748
153    
154 ksteube 1312 /* allocate tables: */
155 gross 2748 if (Finley_noError()) {
156 jgs 82
157 gross 2748 Finley_NodeFile_allocTable(out->Nodes,local_N0*local_N1*local_N2);
158     Finley_ElementFile_allocTable(out->Elements,local_NE0*local_NE1*local_NE2);
159     Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);
160     }
161    
162 ksteube 1312 if (Finley_noError()) {
163     /* create nodes */
164 jgs 82
165 ksteube 1312 #pragma omp parallel for private(i0,i1,i2,k,global_i0,global_i1,global_i2)
166     for (i2=0;i2<local_N2;i2++) {
167     for (i1=0;i1<local_N1;i1++) {
168     for (i0=0;i0<local_N0;i0++) {
169     k=i0+local_N0*i1+local_N0*local_N1*i2;
170     global_i0=i0+offset0;
171     global_i1=i1+offset1;
172     global_i2=i2+offset2;
173     out->Nodes->Coordinates[INDEX2(0,k,DIM)]=DBLE(global_i0)/DBLE(N0-1)*Length[0];
174     out->Nodes->Coordinates[INDEX2(1,k,DIM)]=DBLE(global_i1)/DBLE(N1-1)*Length[1];
175     out->Nodes->Coordinates[INDEX2(2,k,DIM)]=DBLE(global_i2)/DBLE(N2-1)*Length[2];
176     out->Nodes->Id[k]=Nstride0*global_i0+Nstride1*global_i1+Nstride2*global_i2;
177     out->Nodes->Tag[k]=0;
178     out->Nodes->globalDegreesOfFreedom[k]=Nstride0*(global_i0%NDOF0)
179     +Nstride1*(global_i1%NDOF1)
180     +Nstride2*(global_i2%NDOF2);
181 jgs 82 }
182     }
183     }
184 ksteube 1312 /* set the elements: */
185     NN=out->Elements->numNodes;
186     #pragma omp parallel for private(i0,i1,i2,k,node0)
187     for (i2=0;i2<local_NE2;i2++) {
188     for (i1=0;i1<local_NE1;i1++) {
189     for (i0=0;i0<local_NE0;i0++) {
190    
191     k=i0+local_NE0*i1+local_NE0*local_NE1*i2;
192     node0=Nstride0*N_PER_E*(i0+e_offset0)+Nstride1*N_PER_E*(i1+e_offset1)+Nstride2*N_PER_E*(i2+e_offset2);
193 jgs 82
194 ksteube 1312 out->Elements->Id[k]=(i0+e_offset0)+NE0*(i1+e_offset1)+NE0*NE1*(i2+e_offset2);
195     out->Elements->Tag[k]=0;
196     out->Elements->Owner[k]=myRank;
197 jgs 82
198 ksteube 1312 out->Elements->Nodes[INDEX2(0,k,NN)] =node0 ;
199     out->Elements->Nodes[INDEX2(1,k,NN)] =node0+ Nstride0;
200     out->Elements->Nodes[INDEX2(2,k,NN)] =node0+ Nstride1+Nstride0;
201     out->Elements->Nodes[INDEX2(3,k,NN)] =node0+ Nstride1;
202     out->Elements->Nodes[INDEX2(4,k,NN)] =node0+Nstride2 ;
203     out->Elements->Nodes[INDEX2(5,k,NN)] =node0+Nstride2 +Nstride0;
204     out->Elements->Nodes[INDEX2(6,k,NN)] =node0+Nstride2+Nstride1+Nstride0;
205     out->Elements->Nodes[INDEX2(7,k,NN)] =node0+Nstride2+Nstride1 ;
206 jgs 82 }
207     }
208     }
209 ksteube 1312 /* face elements */
210     NN=out->FaceElements->numNodes;
211     totalNECount=NE0*NE1*NE2;
212     faceNECount=0;
213     /* these are the quadrilateral elements on boundary 1 (x3=0): */
214 gross 1733 if (!periodic[2] && (local_NE2>0)) {
215 ksteube 1312 /* ** elements on boundary 100 (x3=0): */
216     if (e_offset2==0) {
217     #pragma omp parallel for private(i0,i1,k,node0)
218     for (i1=0;i1<local_NE1;i1++) {
219     for (i0=0;i0<local_NE0;i0++) {
220    
221     k=i0+local_NE0*i1+faceNECount;
222     node0=Nstride0*N_PER_E*(i0+e_offset0)+Nstride1*N_PER_E*(i1+e_offset1);
223 jgs 82
224 ksteube 1312 out->FaceElements->Id[k]=(i0+e_offset0)+NE0*(i1+e_offset1)+totalNECount;
225     out->FaceElements->Tag[k]=100;
226     out->FaceElements->Owner[k]=myRank;
227    
228     if (useElementsOnFace) {
229     out->FaceElements->Nodes[INDEX2(0,k,NN)] =node0 ;
230     out->FaceElements->Nodes[INDEX2(1,k,NN)] =node0 +Nstride1 ;
231     out->FaceElements->Nodes[INDEX2(2,k,NN)] =node0 +Nstride1+Nstride0;
232     out->FaceElements->Nodes[INDEX2(3,k,NN)] =node0+ Nstride0 ;
233     out->FaceElements->Nodes[INDEX2(4,k,NN)] =node0+Nstride2 ;
234     out->FaceElements->Nodes[INDEX2(5,k,NN)] =node0+Nstride2+Nstride1 ;
235     out->FaceElements->Nodes[INDEX2(6,k,NN)] =node0+Nstride2+Nstride1+Nstride0;
236     out->FaceElements->Nodes[INDEX2(7,k,NN)] =node0+Nstride2 +Nstride0;
237     } else {
238     out->FaceElements->Nodes[INDEX2(0,k,NN)] =node0 ;
239     out->FaceElements->Nodes[INDEX2(1,k,NN)] =node0+ Nstride1 ;
240     out->FaceElements->Nodes[INDEX2(2,k,NN)] =node0+ Nstride1+Nstride0;
241     out->FaceElements->Nodes[INDEX2(3,k,NN)] =node0+ Nstride0;
242     }
243     }
244     }
245     faceNECount+=local_NE1*local_NE0;
246 jgs 82 }
247 ksteube 1312 totalNECount+=NE1*NE0;
248     /* ** elements on boundary 200 (x3=1) */
249     if (local_NE2+e_offset2 == NE2) {
250     #pragma omp parallel for private(i0,i1,k,node0)
251     for (i1=0;i1<local_NE1;i1++) {
252     for (i0=0;i0<local_NE0;i0++) {
253    
254     k=i0+local_NE0*i1+faceNECount;
255     node0=Nstride0*N_PER_E*(i0+e_offset0)+Nstride1*N_PER_E*(i1+e_offset1)+Nstride2*N_PER_E*(NE2-1);
256    
257     out->FaceElements->Id[k]=(i0+e_offset0)+NE0*(i1+e_offset1)+totalNECount;
258     out->FaceElements->Tag[k]=200;
259     out->FaceElements->Owner[k]=myRank;
260     if (useElementsOnFace) {
261     out->FaceElements->Nodes[INDEX2(0,k,NN)] =node0+Nstride2 ;
262     out->FaceElements->Nodes[INDEX2(1,k,NN)] =node0+Nstride2+ Nstride0;
263     out->FaceElements->Nodes[INDEX2(2,k,NN)] =node0+Nstride2+Nstride1+Nstride0;
264     out->FaceElements->Nodes[INDEX2(3,k,NN)] =node0+Nstride2+Nstride1 ;
265    
266     out->FaceElements->Nodes[INDEX2(4,k,NN)] =node0 ;
267     out->FaceElements->Nodes[INDEX2(5,k,NN)] =node0+Nstride0 ;
268     out->FaceElements->Nodes[INDEX2(6,k,NN)] =node0+ Nstride1+Nstride0;
269     out->FaceElements->Nodes[INDEX2(7,k,NN)] =node0+ Nstride1;
270     } else {
271     out->FaceElements->Nodes[INDEX2(0,k,NN)] =node0+Nstride2 ;
272     out->FaceElements->Nodes[INDEX2(1,k,NN)] =node0+Nstride2 +Nstride0;
273     out->FaceElements->Nodes[INDEX2(2,k,NN)] =node0+Nstride2+Nstride1+Nstride0;
274     out->FaceElements->Nodes[INDEX2(3,k,NN)] =node0+Nstride2+Nstride1 ;
275     }
276     }
277     }
278     faceNECount+=local_NE1*local_NE0;
279 jgs 82 }
280 ksteube 1312 totalNECount+=NE1*NE0;
281 jgs 82 }
282 gross 1733 if (!periodic[0] && (local_NE0>0)) {
283 ksteube 1312 /* ** elements on boundary 001 (x1=0): */
284    
285     if (e_offset0 == 0) {
286     #pragma omp parallel for private(i1,i2,k,node0)
287     for (i2=0;i2<local_NE2;i2++) {
288     for (i1=0;i1<local_NE1;i1++) {
289    
290     k=i1+local_NE1*i2+faceNECount;
291     node0=Nstride1*N_PER_E*(i1+e_offset1)+Nstride2*N_PER_E*(i2+e_offset2);
292     out->FaceElements->Id[k]=(i1+e_offset1)+NE1*(i2+e_offset2)+totalNECount;
293     out->FaceElements->Tag[k]=1;
294     out->FaceElements->Owner[k]=myRank;
295    
296     if (useElementsOnFace) {
297     out->FaceElements->Nodes[INDEX2(0,k,NN)] =node0 ;
298     out->FaceElements->Nodes[INDEX2(1,k,NN)] =node0+Nstride2 ;
299     out->FaceElements->Nodes[INDEX2(2,k,NN)] =node0+Nstride2+Nstride1 ;
300     out->FaceElements->Nodes[INDEX2(3,k,NN)] =node0+Nstride1 ;
301     out->FaceElements->Nodes[INDEX2(4,k,NN)] =node0+Nstride0 ;
302     out->FaceElements->Nodes[INDEX2(5,k,NN)] =node0+Nstride2+Nstride0 ;
303     out->FaceElements->Nodes[INDEX2(6,k,NN)] =node0+Nstride2+Nstride1+Nstride0;
304     out->FaceElements->Nodes[INDEX2(7,k,NN)] =node0+Nstride1+Nstride0 ;
305     } else {
306     out->FaceElements->Nodes[INDEX2(0,k,NN)] =node0 ;
307     out->FaceElements->Nodes[INDEX2(1,k,NN)] =node0+Nstride2 ;
308     out->FaceElements->Nodes[INDEX2(2,k,NN)] =node0+Nstride2+Nstride1 ;
309     out->FaceElements->Nodes[INDEX2(3,k,NN)] =node0+ Nstride1 ;
310     }
311     }
312     }
313     faceNECount+=local_NE1*local_NE2;
314     }
315     totalNECount+=NE1*NE2;
316     /* ** elements on boundary 002 (x1=1): */
317     if (local_NE0+e_offset0 == NE0) {
318     #pragma omp parallel for private(i1,i2,k,node0)
319     for (i2=0;i2<local_NE2;i2++) {
320     for (i1=0;i1<local_NE1;i1++) {
321     k=i1+local_NE1*i2+faceNECount;
322     node0=Nstride0*N_PER_E*(NE0-1)+Nstride1*N_PER_E*(i1+e_offset1)+Nstride2*N_PER_E*(i2+e_offset2);
323     out->FaceElements->Id[k]=(i1+e_offset1)+NE1*(i2+e_offset2)+totalNECount;
324     out->FaceElements->Tag[k]=2;
325     out->FaceElements->Owner[k]=myRank;
326 jgs 82
327 ksteube 1312 if (useElementsOnFace) {
328     out->FaceElements->Nodes[INDEX2(0,k,NN)]=node0+ Nstride0;
329     out->FaceElements->Nodes[INDEX2(1,k,NN)]=node0+ Nstride1+Nstride0;
330     out->FaceElements->Nodes[INDEX2(2,k,NN)]=node0+Nstride2+Nstride1+Nstride0;
331     out->FaceElements->Nodes[INDEX2(3,k,NN)]=node0+Nstride2+ Nstride0;
332    
333     out->FaceElements->Nodes[INDEX2(4,k,NN)]=node0 ;
334     out->FaceElements->Nodes[INDEX2(5,k,NN)]=node0+ Nstride1 ;
335     out->FaceElements->Nodes[INDEX2(6,k,NN)]=node0+Nstride2+Nstride1 ;
336     out->FaceElements->Nodes[INDEX2(7,k,NN)]=node0+Nstride2 ;
337    
338     } else {
339     out->FaceElements->Nodes[INDEX2(0,k,NN)]=node0 +Nstride0;
340     out->FaceElements->Nodes[INDEX2(1,k,NN)]=node0+ Nstride1+Nstride0;
341     out->FaceElements->Nodes[INDEX2(2,k,NN)]=node0+Nstride2+Nstride1+Nstride0;
342     out->FaceElements->Nodes[INDEX2(3,k,NN)]=node0+Nstride2+ Nstride0;
343     }
344    
345     }
346     }
347     faceNECount+=local_NE1*local_NE2;
348 jgs 82 }
349 ksteube 1312 totalNECount+=NE1*NE2;
350 jgs 82 }
351 gross 1733 if (!periodic[1] && (local_NE1>0)) {
352 ksteube 1312 /* ** elements on boundary 010 (x2=0): */
353     if (e_offset1 == 0) {
354     #pragma omp parallel for private(i0,i2,k,node0)
355     for (i2=0;i2<local_NE2;i2++) {
356     for (i0=0;i0<local_NE0;i0++) {
357     k=i0+local_NE0*i2+faceNECount;
358     node0=Nstride0*N_PER_E*(i0+e_offset0)+Nstride2*N_PER_E*(i2+e_offset2);
359    
360     out->FaceElements->Id[k]=(i2+e_offset2)+NE2*(e_offset0+i0)+totalNECount;
361     out->FaceElements->Tag[k]=10;
362     out->FaceElements->Owner[k]=myRank;
363     if (useElementsOnFace) {
364     out->FaceElements->Nodes[INDEX2(0,k,NN)]=node0 ;
365     out->FaceElements->Nodes[INDEX2(1,k,NN)]=node0+ Nstride0;
366     out->FaceElements->Nodes[INDEX2(2,k,NN)]=node0+Nstride2 +Nstride0;
367     out->FaceElements->Nodes[INDEX2(3,k,NN)]=node0+Nstride2 ;
368    
369     out->FaceElements->Nodes[INDEX2(4,k,NN)]=node0+ Nstride1 ;
370     out->FaceElements->Nodes[INDEX2(5,k,NN)]=node0+Nstride1+ Nstride0;
371     out->FaceElements->Nodes[INDEX2(6,k,NN)]=node0+Nstride2+Nstride1+Nstride0;
372     out->FaceElements->Nodes[INDEX2(7,k,NN)]=node0+Nstride2+Nstride1 ;
373     } else {
374     out->FaceElements->Nodes[INDEX2(0,k,NN)]=node0 ;
375     out->FaceElements->Nodes[INDEX2(1,k,NN)]=node0+ Nstride0;
376     out->FaceElements->Nodes[INDEX2(2,k,NN)]=node0+Nstride2+ Nstride0;
377     out->FaceElements->Nodes[INDEX2(3,k,NN)]=node0+Nstride2 ;
378     }
379     }
380     }
381     faceNECount+=local_NE0*local_NE2;
382     }
383     totalNECount+=NE0*NE2;
384     /* ** elements on boundary 020 (x2=1): */
385     if (local_NE1+e_offset1 == NE1) {
386     #pragma omp parallel for private(i0,i2,k,node0)
387     for (i2=0;i2<local_NE2;i2++) {
388     for (i0=0;i0<local_NE0;i0++) {
389     k=i0+local_NE0*i2+faceNECount;
390     node0=Nstride0*N_PER_E*(i0+e_offset0)+Nstride1*N_PER_E*(NE1-1)+Nstride2*N_PER_E*(i2+e_offset2);
391 jgs 82
392 ksteube 1312 out->FaceElements->Id[k]=(i2+e_offset2)+NE2*(i0+e_offset0)+totalNECount;
393     out->FaceElements->Tag[k]=20;
394     out->FaceElements->Owner[k]=myRank;
395    
396     if (useElementsOnFace) {
397     out->FaceElements->Nodes[INDEX2(0,k,NN)]=node0+ Nstride1 ;
398     out->FaceElements->Nodes[INDEX2(1,k,NN)]=node0+Nstride2+Nstride1 ;
399     out->FaceElements->Nodes[INDEX2(2,k,NN)]=node0+Nstride2+Nstride1+Nstride0;
400     out->FaceElements->Nodes[INDEX2(3,k,NN)]=node0+Nstride1+Nstride0 ;
401    
402     out->FaceElements->Nodes[INDEX2(4,k,NN)]=node0 ;
403     out->FaceElements->Nodes[INDEX2(5,k,NN)]=node0+Nstride2 ;
404     out->FaceElements->Nodes[INDEX2(6,k,NN)]=node0+Nstride2+ Nstride0;
405     out->FaceElements->Nodes[INDEX2(7,k,NN)]=node0+ Nstride0;
406     } else {
407     out->FaceElements->Nodes[INDEX2(0,k,NN)]=node0+ Nstride1 ;
408     out->FaceElements->Nodes[INDEX2(1,k,NN)]=node0+Nstride2+Nstride1 ;
409     out->FaceElements->Nodes[INDEX2(2,k,NN)]=node0+Nstride2+Nstride1+Nstride0;
410     out->FaceElements->Nodes[INDEX2(3,k,NN)]=node0+ Nstride1+Nstride0;
411     }
412     }
413     }
414     faceNECount+=local_NE0*local_NE2;
415     }
416     totalNECount+=NE0*NE2;
417 bcumming 751 }
418 gross 2748 }
419     if (Finley_noError()) {
420 ksteube 1312 /* add tag names */
421     Finley_Mesh_addTagMap(out,"top", 200);
422     Finley_Mesh_addTagMap(out,"bottom", 100);
423     Finley_Mesh_addTagMap(out,"left", 1);
424     Finley_Mesh_addTagMap(out,"right", 2);
425     Finley_Mesh_addTagMap(out,"front", 10);
426     Finley_Mesh_addTagMap(out,"back", 20);
427 gross 2748 }
428     /* prepare mesh for further calculatuions:*/
429     if (Finley_noError()) {
430 ksteube 1312 Finley_Mesh_resolveNodeIds(out);
431 gross 2748 }
432     if (Finley_noError()) {
433 ksteube 1312 Finley_Mesh_prepare(out, optimize);
434 bcumming 751 }
435    
436 ksteube 1312 if (!Finley_noError()) {
437     Finley_Mesh_free(out);
438 bcumming 751 }
439 gross 2748 /* free up memory */
440     Finley_ReferenceElementSet_dealloc(refPoints);
441     Finley_ReferenceElementSet_dealloc(refContactElements);
442     Finley_ReferenceElementSet_dealloc(refFaceElements);
443     Finley_ReferenceElementSet_dealloc(refElements);
444 ksteube 1312 Paso_MPIInfo_free( mpi_info );
445    
446     return out;
447 bcumming 751 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26