/[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 1981 - (hide annotations)
Thu Nov 6 05:27:33 2008 UTC (10 years, 11 months ago) by jfenwick
File MIME type: text/plain
File size: 21106 byte(s)
More warning removal.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26