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

Contents of /trunk/finley/src/Mesh_line3.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 787 - (show annotations)
Wed Jul 26 01:46:45 2006 UTC (13 years, 2 months ago) by bcumming
File MIME type: text/plain
File size: 20127 byte(s)
MPI update
Each element (normal elements, faceElements, ContactElements and points)
are now assigned a unique global id to streamline per-element
calculations and file IO of element data.



1 /*
2 ************************************************************
3 * Copyright 2006 by ACcESS MNRF *
4 * *
5 * http://www.access.edu.au *
6 * Primary Business: Queensland, Australia *
7 * Licensed under the Open Software License version 3.0 *
8 * http://www.opensource.org/licenses/osl-3.0.php *
9 * *
10 ************************************************************
11 */
12
13 /**************************************************************/
14
15 /* Finley: generates rectangular meshes */
16
17 /* Generates numElements[0] mesh with second order elements (Line3) in the interval */
18 /* [0,Length[0]]. order is the desired accuracy of the integration scheme. */
19
20 /**************************************************************/
21
22 /* Author: gross@access.edu.au */
23 /* Version: $Id$ */
24
25 /**************************************************************/
26
27 #include "RectangularMesh.h"
28
29 #ifdef PASO_MPI
30 /* get the number of nodes/elements for domain with rank=rank, of size processors
31 where n is the total number of nodes/elements in the global domain */
32 static index_t domain_MODdim( index_t rank, index_t size, index_t n )
33 {
34 rank = size-rank-1;
35
36 if( rank < n%size )
37 return (index_t)floor(n/size)+1;
38 return (index_t)floor(n/size);
39 }
40
41
42 /* Determines the number of nodes/elements etc along an axis which is numElementsGlobal long for domain rank */
43 /* A bit messy, but it only has to be done once... */
44 static void domain_calculateDimension( index_t rank, dim_t size, dim_t numElementsGlobal, bool_t periodic, dim_t *numNodesLocal, dim_t *numDOFLocal, dim_t *numElementsLocal, dim_t *numElementsInternal, dim_t *firstNode, dim_t *nodesExternal, dim_t *DOFExternal, dim_t *numNodesExternal, bool_t *periodicLocal, dim_t *DOFBoundary )
45 {
46 index_t i0;
47 dim_t numNodesGlobal = numElementsGlobal+1;
48
49 (*numNodesLocal) = 2*domain_MODdim( rank, size, numNodesGlobal ) - 1;
50 if( rank<size-1 ) // add on node for right hand boundary
51 (*numNodesLocal) += 1;
52
53 numElementsLocal[0] = domain_MODdim( rank, size, numNodesGlobal )+1;
54 periodicLocal[0] = periodicLocal[1] = FALSE;
55 nodesExternal[0] = nodesExternal[1] = 1;
56 if( periodic )
57 {
58 if( size==1 )
59 {
60 numElementsLocal[0] = numElementsGlobal;
61 nodesExternal[0] = nodesExternal[1] = 0;
62 periodicLocal[0] = periodicLocal[1] = TRUE;
63 }
64 else
65 {
66 if( rank==0 )
67 {
68 periodicLocal[0] = TRUE;
69 numNodesLocal[0]++;
70 }
71 if( rank==(size-1) )
72 {
73 periodicLocal[1] = TRUE;
74 numNodesLocal[0]--;
75 numElementsLocal[0]--;
76 }
77 }
78 }
79 else if( !periodic )
80 {
81 if( rank==0 ){
82 nodesExternal[0]--;
83 numElementsLocal[0]--;
84 }
85 if( rank==(size-1) )
86 {
87 nodesExternal[1]--;
88 numElementsLocal[0]--;
89 }
90 }
91 nodesExternal[0]*=2;
92 numNodesExternal[0] = nodesExternal[0]+nodesExternal[1];
93
94 numElementsInternal[0] = numElementsLocal[0];
95 if( (rank==0) && (rank==size-1) );
96
97 else if( !periodic && ( (rank==0) ^ (rank==size-1) ) )
98 numElementsInternal[0] -= 1;
99 else
100 numElementsInternal[0] -= 2;
101
102 firstNode[0] = 0;
103 for( i0=0; i0<rank; i0++ )
104 firstNode[0] += domain_MODdim( i0, size, numNodesGlobal );
105 firstNode[0] *= 2;
106
107 numDOFLocal[0] = numNodesLocal[0];
108 if( periodicLocal[0] )
109 numDOFLocal[0]--;
110
111 DOFExternal[0] = nodesExternal[0];
112 DOFExternal[1] = nodesExternal[1];
113
114 if( size>1 )
115 {
116 DOFBoundary[0] = periodicLocal[0]*1 + (rank>0)*1;
117 DOFBoundary[1] = periodicLocal[1]*2 + (rank<(size-1))*2;
118 }
119 else
120 {
121 DOFBoundary[0] = DOFBoundary[1] = 0;
122 }
123 }
124 #endif
125
126
127 #ifdef PASO_MPI
128 Finley_Mesh* Finley_RectangularMesh_Line3_singleCPU(dim_t* numElements,double* Length,bool_t* periodic,index_t order,bool_t useElementsOnFace,Paso_MPIInfo *mpi_info)
129 #else
130 Finley_Mesh* Finley_RectangularMesh_Line3(dim_t* numElements,double* Length,bool_t* periodic,index_t order,bool_t useElementsOnFace)
131 #endif
132 {
133 dim_t N0,NE0,i0,NDOF0,NFaceElements,NUMNODES;
134 index_t k,node0;
135 Finley_Mesh* out;
136 char name[50];
137 double time0=Finley_timer();
138 NE0=MAX(1,numElements[0]);
139 N0=2*NE0+1;
140 if (!periodic[0]) {
141 NDOF0=N0;
142 NFaceElements=2;
143 } else {
144 NDOF0=N0-1;
145 NFaceElements=0;
146 }
147
148 /* allocate mesh: */
149
150 sprintf(name,"Rectangular mesh with %d nodes",N0);
151 #ifdef PASO_MPI
152 out=Finley_Mesh_alloc(name,1,order,mpi_info);
153 if (! Finley_noError()) return NULL;
154
155 out->Elements=Finley_ElementFile_alloc(Line3,out->order,mpi_info);
156 if (useElementsOnFace) {
157 out->FaceElements=Finley_ElementFile_alloc(Line3Face,out->order,mpi_info);
158 out->ContactElements=Finley_ElementFile_alloc(Line3Face_Contact,out->order,mpi_info);
159 } else {
160 out->FaceElements=Finley_ElementFile_alloc(Point1,out->order,mpi_info);
161 out->ContactElements=Finley_ElementFile_alloc(Point1_Contact,out->order,mpi_info);
162 }
163 out->Points=Finley_ElementFile_alloc(Point1,out->order,mpi_info);
164 if (! Finley_noError()) {
165 Finley_Mesh_dealloc(out);
166 return NULL;
167 }
168
169 /* allocate tables: */
170
171 Finley_NodeFile_allocTable(out->Nodes,N0);
172 Finley_NodeDistribution_allocTable( out->Nodes->degreeOfFreedomDistribution, N0, 0, 0);
173 Finley_ElementFile_allocTable(out->Elements,NE0);
174 Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);
175 Finley_ElementDistribution_allocTable( out->Elements->elementDistribution, NE0, 0 );
176 Finley_ElementDistribution_allocTable( out->FaceElements->elementDistribution, NFaceElements, 0 );
177 #else
178 out=Finley_Mesh_alloc(name,1,order);
179 if (! Finley_noError()) return NULL;
180
181 out->Elements=Finley_ElementFile_alloc(Line3,out->order);
182 if (useElementsOnFace) {
183 out->FaceElements=Finley_ElementFile_alloc(Line3Face,out->order);
184 out->ContactElements=Finley_ElementFile_alloc(Line3Face_Contact,out->order);
185 } else {
186 out->FaceElements=Finley_ElementFile_alloc(Point1,out->order);
187 out->ContactElements=Finley_ElementFile_alloc(Point1_Contact,out->order);
188 }
189 out->Points=Finley_ElementFile_alloc(Point1,out->order);
190 if (! Finley_noError()) {
191 Finley_Mesh_dealloc(out);
192 return NULL;
193 }
194
195 /* allocate tables: */
196
197 Finley_NodeFile_allocTable(out->Nodes,N0);
198
199 Finley_ElementFile_allocTable(out->Elements,NE0);
200 Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);
201 #endif
202 if (! Finley_noError()) {
203 Finley_Mesh_dealloc(out);
204 return NULL;
205 }
206
207 /* set nodes: */
208
209 #pragma omp parallel for private(i0,k)
210 for (i0=0;i0<N0;i0++) {
211 k=i0;
212 out->Nodes->Coordinates[INDEX2(0,k,1)]=DBLE(i0)/DBLE(N0-1)*Length[0];
213 out->Nodes->Id[k]=k;
214 out->Nodes->Tag[k]=0;
215 out->Nodes->degreeOfFreedom[k]=(i0%NDOF0);
216 #ifdef PASO_MPI
217 out->Nodes->Dom[k] = NODE_INTERNAL;
218 #endif
219 }
220 if (!periodic[0]) {
221 out->Nodes->Tag[0]=1;
222 out->Nodes->Tag[N0-1]=2;
223 }
224
225 /* set the elements: */
226
227 #pragma omp parallel for private(i0,k,node0)
228 for (i0=0;i0<NE0;i0++) {
229 k=i0;
230 node0=2*i0;
231
232 out->Elements->Id[k]=k;
233 out->Elements->Tag[k]=0;
234 out->Elements->Color[k]=COLOR_MOD(i0);
235 #ifdef PASO_MPI
236 out->Elements->Dom[k] = ELEMENT_INTERNAL;
237 #endif
238
239 out->Elements->Nodes[INDEX2(0,k,3)]=node0;
240 out->Elements->Nodes[INDEX2(1,k,3)]=node0+2;
241 out->Elements->Nodes[INDEX2(2,k,3)]=node0+1;
242 }
243 out->Elements->minColor=0;
244 out->Elements->maxColor=COLOR_MOD(0);
245
246 /* face elements: */
247 if (useElementsOnFace) {
248 NUMNODES=3;
249 } else {
250 NUMNODES=1;
251 }
252
253 if (!periodic[0]) {
254 out->FaceElements->Id[0]=NE0;
255 out->FaceElements->Tag[0]=1;
256 out->FaceElements->Color[0]=0;
257 #ifdef PASO_MPI
258 out->FaceElements->Dom[0] = ELEMENT_INTERNAL;
259 #endif
260 if (useElementsOnFace) {
261 out->FaceElements->Nodes[INDEX2(0,0,NUMNODES)]=0;
262 out->FaceElements->Nodes[INDEX2(1,0,NUMNODES)]=2;
263 out->FaceElements->Nodes[INDEX2(2,0,NUMNODES)]=1;
264 } else {
265 out->FaceElements->Nodes[INDEX2(0,0,NUMNODES)]=0;
266 }
267
268 out->FaceElements->Id[1]=NE0+1;
269 out->FaceElements->Tag[1]=2;
270 out->FaceElements->Color[1]=1;
271 #ifdef PASO_MPI
272 out->FaceElements->Dom[1] = ELEMENT_INTERNAL;
273 #endif
274 if (useElementsOnFace) {
275 out->FaceElements->Nodes[INDEX2(0,1,NUMNODES)]=N0-1;
276 out->FaceElements->Nodes[INDEX2(1,1,NUMNODES)]=N0-3;
277 out->FaceElements->Nodes[INDEX2(2,1,NUMNODES)]=N0-2;
278 } else {
279 out->FaceElements->Nodes[INDEX2(0,1,NUMNODES)]=N0-1;
280 }
281 }
282 out->FaceElements->minColor=0;
283 out->FaceElements->maxColor=1;
284
285 #ifdef PASO_MPI
286 Finley_ElementFile_setDomainFlags( out->Elements );
287 Finley_ElementFile_setDomainFlags( out->FaceElements );
288 Finley_ElementFile_setDomainFlags( out->ContactElements );
289 Finley_ElementFile_setDomainFlags( out->Points );
290
291 /* reorder the degrees of freedom */
292 Finley_Mesh_resolveDegreeOfFreedomOrder( out, TRUE );
293 #endif
294
295 /* condense the nodes: */
296 Finley_Mesh_resolveNodeIds(out);
297
298 /* prepare mesh for further calculations:*/
299 Finley_Mesh_prepare(out) ;
300
301 #ifdef Finley_TRACE
302 printf("timing: mesh generation: %.4e sec\n",Finley_timer()-time0);
303 #endif
304
305 if (! Finley_noError()) {
306 Finley_Mesh_dealloc(out);
307 return NULL;
308 }
309 return out;
310 }
311 /* MPI version */
312 #ifdef PASO_MPI
313 Finley_Mesh* Finley_RectangularMesh_Line3(dim_t* numElements,double* Length,bool_t* periodic,index_t order,bool_t useElementsOnFace)
314 {
315 dim_t N0, NE0, NE0_local, i0, NDOF0, NFaceElements, numNodesLocal, numDOFLocal, numElementsLocal, numElementsInternal, nodesExternal[2], DOFExternal[2], numNodesExternal, DOFBoundary[2], N0t, NDOF0t;
316 index_t *numForward=NULL, *numBackward=NULL;
317 index_t NUMNODES, node0,k, i,firstNode=0, DOFcount=0, forwardDOF[4], backwardDOF[4], firstNodeConstruct;
318 index_t targetDomain=-1;
319 bool_t periodicLocal[2], domLeft=FALSE, domRight=FALSE, domInternal=FALSE, boundaryLeft, boundaryRight;
320 Finley_Mesh* out=NULL;
321 char name[50];
322 double time0=Finley_timer();
323 Paso_MPIInfo *mpi_info = NULL;
324
325 /* dimensions the global domain */
326 NE0=MAX(1,numElements[0]);
327 N0=2*NE0+1;
328 NDOF0=N0;
329 if( periodic[0] )
330 NDOF0--;
331
332 /* get MPI information */
333 mpi_info = Paso_MPIInfo_alloc( MPI_COMM_WORLD );
334 if (! Finley_noError()) {
335 Finley_Mesh_dealloc(out);
336 return NULL;
337 }
338
339 /* use the serial code to generate the mesh in the 1-CPU case */
340 if( mpi_info->size==1 ){
341 out = Finley_RectangularMesh_Line3_singleCPU(numElements,Length,periodic,order,useElementsOnFace,mpi_info);
342 return out;
343 }
344
345 if( mpi_info->rank==0 )
346 domLeft = TRUE;
347 if( mpi_info->rank==mpi_info->size-1 )
348 domRight = TRUE;
349 if( mpi_info->rank>0 && mpi_info->rank<mpi_info->size-1 )
350 domInternal = TRUE;
351
352 /* dimensions of the local subdomain */
353 domain_calculateDimension( mpi_info->rank, mpi_info->size, NE0, periodic[0], &numNodesLocal, &numDOFLocal, &numElementsLocal, &numElementsInternal, &firstNode, nodesExternal, DOFExternal, &numNodesExternal, periodicLocal, DOFBoundary );
354
355 /* form face element if the local domain contains a periodic boundary */
356 NFaceElements = 0;
357 if( !periodic[0] )
358 {
359 if(domLeft)
360 NFaceElements++;
361 if(domRight)
362 NFaceElements++;
363 }
364
365 boundaryLeft = !domLeft || periodicLocal[0];
366 boundaryRight = !domRight || periodicLocal[1];
367 N0t = numNodesLocal + boundaryRight + 2*boundaryLeft;
368 NDOF0t = numDOFLocal + boundaryRight + 2*boundaryLeft;
369 firstNodeConstruct = firstNode - 2*boundaryLeft;
370 firstNodeConstruct = firstNodeConstruct<0 ? N0-3 : firstNodeConstruct;
371
372 /* allocate mesh: */
373 sprintf(name,"Rectangular mesh with %d nodes",N0);
374 out=Finley_Mesh_alloc(name,1,order,mpi_info);
375 if (! Finley_noError()) return NULL;
376
377 out->Elements=Finley_ElementFile_alloc(Line3,out->order,mpi_info);
378 if (useElementsOnFace) {
379 out->FaceElements=Finley_ElementFile_alloc(Line3Face,out->order,mpi_info);
380 out->ContactElements=Finley_ElementFile_alloc(Line3Face_Contact,out->order,mpi_info);
381 } else {
382 out->FaceElements=Finley_ElementFile_alloc(Point1,out->order,mpi_info);
383 out->ContactElements=Finley_ElementFile_alloc(Point1_Contact,out->order,mpi_info);
384 }
385 out->Points=Finley_ElementFile_alloc(Point1,out->order,mpi_info);
386 if (! Finley_noError()) {
387 Finley_Mesh_dealloc(out);
388 return NULL;
389 }
390
391 /* allocate tables: */
392 Finley_NodeFile_allocTable(out->Nodes,numNodesLocal+numNodesExternal);
393 Finley_NodeDistribution_allocTable( out->Nodes->degreeOfFreedomDistribution, numDOFLocal, 3, 0 );
394 Finley_ElementFile_allocTable(out->Elements,numElementsLocal);
395 Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);
396 Finley_ElementDistribution_allocTable( out->Elements->elementDistribution, numElementsLocal, domRight);
397 Finley_ElementDistribution_allocTable( out->FaceElements->elementDistribution, NFaceElements, 0 );
398 if (! Finley_noError()) {
399 Finley_Mesh_dealloc(out);
400 return NULL;
401 }
402
403 /* set nodes: */
404 #pragma omp parallel for private(i0,k)
405 for (i0=0;i0<N0t;i0++) {
406 k=i0;
407 out->Nodes->Coordinates[INDEX2(0,k,1)]=DBLE((i0+firstNodeConstruct) % N0)/DBLE(N0-1)*Length[0];
408 out->Nodes->Id[k]=k;
409 out->Nodes->Tag[k]=0;
410 out->Nodes->degreeOfFreedom[k]=k;
411 out->Nodes->Dom[k]=NODE_INTERNAL;
412 }
413
414 /* setup boundary DOF data */
415 if( boundaryLeft ){
416 out->Nodes->Dom[0]= out->Nodes->Dom[1] = NODE_EXTERNAL;
417 out->Nodes->Dom[2] = NODE_BOUNDARY;
418 }
419 else
420 out->Nodes->Tag[0] += 1;
421 if( boundaryRight ){
422 out->Nodes->Dom[N0t-1] = NODE_EXTERNAL;
423 out->Nodes->Dom[N0t-2] = out->Nodes->Dom[N0t-3] = NODE_BOUNDARY;
424 }
425 else
426 out->Nodes->Tag[N0t-1] += 2;
427 if( periodicLocal[0] ){
428 out->Nodes->degreeOfFreedom[3] = out->Nodes->degreeOfFreedom[2];
429 out->Nodes->Dom[3] = NODE_BOUNDARY;
430 }
431
432 if( !(mpi_info->size==2 && periodicLocal[0])){
433 if( boundaryLeft ) {
434 targetDomain = mpi_info->rank-1 < 0 ? mpi_info->size-1 : mpi_info->rank-1;
435 forwardDOF[0] = out->Nodes->degreeOfFreedom[2];
436 backwardDOF[0] = out->Nodes->degreeOfFreedom[0];
437 backwardDOF[1] = out->Nodes->degreeOfFreedom[1];
438 Finley_NodeDistribution_addForward( out->Nodes->degreeOfFreedomDistribution, targetDomain, 1, forwardDOF );
439 Finley_NodeDistribution_addBackward( out->Nodes->degreeOfFreedomDistribution, targetDomain, 2, backwardDOF );
440 }
441 if( boundaryRight ) {
442 targetDomain = mpi_info->rank+1 > mpi_info->size-1 ? 0 : mpi_info->rank+1;
443 forwardDOF[0] = out->Nodes->degreeOfFreedom[N0t-3];
444 forwardDOF[1] = out->Nodes->degreeOfFreedom[N0t-2];
445 backwardDOF[0] = out->Nodes->degreeOfFreedom[N0t-1];
446 Finley_NodeDistribution_addForward( out->Nodes->degreeOfFreedomDistribution, targetDomain, 2, forwardDOF );
447 Finley_NodeDistribution_addBackward( out->Nodes->degreeOfFreedomDistribution, targetDomain, 1, backwardDOF );
448 }
449 } else{
450 /* periodic boundary conditions with 2 domains, need to change the order in which domain 0 passes boundary data */
451 targetDomain = 1;
452
453 forwardDOF[0] = out->Nodes->degreeOfFreedom[N0t-3];
454 forwardDOF[1] = out->Nodes->degreeOfFreedom[N0t-2];
455 backwardDOF[0] = out->Nodes->degreeOfFreedom[N0t-1];
456 Finley_NodeDistribution_addForward( out->Nodes->degreeOfFreedomDistribution, targetDomain, 2, forwardDOF );
457 Finley_NodeDistribution_addBackward( out->Nodes->degreeOfFreedomDistribution, targetDomain, 1, backwardDOF );
458
459 forwardDOF[0] = out->Nodes->degreeOfFreedom[2];
460 backwardDOF[0] = out->Nodes->degreeOfFreedom[0];
461 backwardDOF[1] = out->Nodes->degreeOfFreedom[1];
462 Finley_NodeDistribution_addForward( out->Nodes->degreeOfFreedomDistribution, targetDomain, 1, forwardDOF );
463 Finley_NodeDistribution_addBackward( out->Nodes->degreeOfFreedomDistribution, targetDomain, 2, backwardDOF );
464 }
465
466 /* set the elements: */
467 /* form internal elements */
468 #pragma omp parallel for private(i0,k)
469 for (i0=0;i0<numElementsLocal;i0++)
470 {
471 k=i0;
472 node0 = (periodicLocal[0] && !i0) ? 0 : 2*i0 + periodicLocal[0];
473 out->Elements->Id[k]=(i0+firstNodeConstruct/2)%NE0;
474 out->Elements->Tag[k]=0;
475 out->Elements->Color[k]=COLOR_MOD(i0);
476 out->Elements->Dom[k]=ELEMENT_INTERNAL;
477
478 out->Elements->Nodes[INDEX2(0,k,3)]=node0;
479 out->Elements->Nodes[INDEX2(1,k,3)]=node0+2;
480 out->Elements->Nodes[INDEX2(2,k,3)]=node0+1;
481 }
482
483 if( boundaryLeft )
484 out->Elements->Dom[0] = ELEMENT_BOUNDARY;
485 if( boundaryRight )
486 out->Elements->Dom[numElementsLocal-1] = ELEMENT_BOUNDARY;
487
488 out->Elements->minColor=0;
489 out->Elements->maxColor=COLOR_MOD(0);
490
491 Finley_ElementFile_setDomainFlags( out->Elements );
492
493 /* face elements: */
494 if (useElementsOnFace) {
495 NUMNODES=3;
496 } else {
497 NUMNODES=1;
498 }
499 if ( domLeft && !periodicLocal[0] )
500 {
501 out->FaceElements->Id[0]=NE0;
502 out->FaceElements->Tag[0]=1;
503 out->FaceElements->Color[0]=0;
504 out->FaceElements->Dom[0]=ELEMENT_INTERNAL;
505 if (useElementsOnFace) {
506 out->FaceElements->Nodes[INDEX2(0,0,NUMNODES)]=0;
507 out->FaceElements->Nodes[INDEX2(1,0,NUMNODES)]=2;
508 out->FaceElements->Nodes[INDEX2(2,0,NUMNODES)]=1;
509 } else {
510 out->FaceElements->Nodes[INDEX2(0,0,NUMNODES)]=0;
511 }
512 }
513 if( domRight && !periodicLocal[1])
514 {
515 out->FaceElements->Id[domLeft]=NE0+1;
516 out->FaceElements->Tag[domLeft]=2;
517 out->FaceElements->Color[domLeft]=1;
518 out->FaceElements->Dom[domLeft]=ELEMENT_INTERNAL;
519 if (useElementsOnFace) {
520 out->FaceElements->Nodes[INDEX2(0,domLeft,NUMNODES)]=N0t-1;
521 out->FaceElements->Nodes[INDEX2(1,domLeft,NUMNODES)]=N0t-3;
522 out->FaceElements->Nodes[INDEX2(2,domLeft,NUMNODES)]=N0t-2;
523 } else {
524 out->FaceElements->Nodes[INDEX2(0,domLeft,NUMNODES)]=N0t-1;
525 }
526 }
527 out->FaceElements->numElements=NFaceElements;
528 out->FaceElements->maxColor=0;
529 out->FaceElements->minColor=1;
530
531 Finley_ElementFile_setDomainFlags( out->FaceElements );
532
533 /* setup distribution info for other elements */
534 Finley_ElementFile_setDomainFlags( out->ContactElements );
535 Finley_ElementFile_setDomainFlags( out->Points );
536
537 Finley_Mesh_prepareElementDistribution( out );
538
539 /* reorder the degrees of freedom */
540 Finley_Mesh_resolveDegreeOfFreedomOrder( out, TRUE );
541
542 /* condense the nodes: */
543 Finley_Mesh_resolveNodeIds(out);
544 if( !Finley_MPI_noError(mpi_info) )
545 {
546 Paso_MPIInfo_dealloc( mpi_info );
547 Finley_Mesh_dealloc(out);
548 return NULL;
549 }
550
551 /* setup the CommBuffer */
552 Finley_NodeDistribution_formCommBuffer( out->Nodes->degreeOfFreedomDistribution, out->Nodes->CommBuffer );
553 if ( !Finley_MPI_noError( mpi_info )) {
554 Paso_MPIInfo_dealloc( mpi_info );
555 Finley_Mesh_dealloc(out);
556 return NULL;
557 }
558
559 Finley_NodeDistribution_calculateIndexExternal( out->Nodes->degreeOfFreedomDistribution, out->Nodes->CommBuffer );
560 if( !Finley_MPI_noError(mpi_info) )
561 {
562 Paso_MPIInfo_dealloc( mpi_info );
563 Finley_Mesh_dealloc(out);
564 return NULL;
565 }
566
567 /* prepare mesh for further calculatuions:*/
568 Finley_Mesh_prepare(out);
569 if( !Finley_MPI_noError(mpi_info) )
570 {
571 Paso_MPIInfo_dealloc( mpi_info );
572 Finley_Mesh_dealloc(out);
573 return NULL;
574 }
575
576 /* free up memory */
577 Paso_MPIInfo_dealloc( mpi_info );
578
579 //print_mesh_statistics( out, TRUE );
580
581 #ifdef Finley_TRACE
582 printf("timing: mesh generation: %.4e sec\n",Finley_timer()-time0);
583 #endif
584
585 return out;
586 }
587 #endif
588
589 /*
590 * Revision 1.3 2005/09/01 03:31:36 jgs
591 * Merge of development branch dev-02 back to main trunk on 2005-09-01
592 *
593 * Revision 1.2.2.2 2005/09/07 06:26:19 gross
594 * the solver from finley are put into the standalone package paso now
595 *
596 * Revision 1.2.2.1 2005/08/24 02:02:18 gross
597 * timing output switched off. solver output can be swiched through getSolution(verbose=True) now.
598 *
599 * Revision 1.2 2005/07/08 04:07:53 jgs
600 * Merge of development branch back to main trunk on 2005-07-08
601 *
602 * Revision 1.1.1.1.2.1 2005/06/29 02:34:52 gross
603 * some changes towards 64 integers in finley
604 *
605 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
606 * initial import of project esys2
607 *
608 * Revision 1.1.1.1 2004/06/24 04:00:40 johng
609 * Initial version of eys using boost-python.
610 *
611 *
612 */
613

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26