/[escript]/branches/domexper/dudley/src/Mesh_tet4.c
ViewVC logotype

Annotation of /branches/domexper/dudley/src/Mesh_tet4.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1811 - (hide annotations)
Thu Sep 25 23:11:13 2008 UTC (10 years, 8 months ago) by ksteube
Original Path: trunk/finley/src/Mesh_hex8.c
File MIME type: text/plain
File size: 21075 byte(s)
Copyright updated in all files

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26