1 |
|
/* |
2 |
|
****************************************************************************** |
3 |
|
* * |
4 |
|
* COPYRIGHT ACcESS 2003,2004,2005 - All Rights Reserved * |
5 |
|
* * |
6 |
|
* This software is the property of ACcESS. No part of this code * |
7 |
|
* may be copied in any form or by any means without the expressed written * |
8 |
|
* consent of ACcESS. Copying, use or modification of this software * |
9 |
|
* by any unauthorised person is illegal unless that person has a software * |
10 |
|
* license agreement with ACcESS. * |
11 |
|
* * |
12 |
|
****************************************************************************** |
13 |
|
*/ |
14 |
|
|
15 |
/**************************************************************/ |
/**************************************************************/ |
16 |
|
|
17 |
/* Finley: generates rectangular meshes */ |
/* Finley: generates rectangular meshes */ |
23 |
|
|
24 |
/**************************************************************/ |
/**************************************************************/ |
25 |
|
|
26 |
/* Copyrights by ACcESS Australia 2003/04 */ |
/* Author: gross@access.edu.au */ |
27 |
/* Author: gross@access.edu.au */ |
/* Version: $Id$ |
|
/* Version: $Id$ */ |
|
28 |
|
|
29 |
/**************************************************************/ |
/**************************************************************/ |
30 |
|
|
|
#include "Common.h" |
|
|
#include "Finley.h" |
|
|
#include "Mesh.h" |
|
31 |
#include "RectangularMesh.h" |
#include "RectangularMesh.h" |
32 |
|
|
33 |
/**************************************************************/ |
/**************************************************************/ |
34 |
|
|
35 |
Finley_Mesh* Finley_RectangularMesh_Hex20(int* numElements,double* Length,int* periodic,int order,int useElementsOnFace) { |
Finley_Mesh* Finley_RectangularMesh_Hex20(dim_t* numElements,double* Length,bool_t* periodic,index_t order,bool_t useElementsOnFace) { |
36 |
int N0,N1,N2,NE0,NE1,NE2,i0,i1,i2,k,node0,totalNECount,faceNECount,NDOF0,NDOF1,NDOF2,NFaceElements,NUMNODES; |
dim_t N0,N1,N2,NE0,NE1,NE2,i0,i1,i2,k,totalNECount,faceNECount,NDOF0,NDOF1,NDOF2,NFaceElements,NUMNODES; |
37 |
|
index_t node0; |
38 |
Finley_Mesh* out; |
Finley_Mesh* out; |
39 |
char name[50]; |
char name[50]; |
40 |
double time0=Finley_timer(); |
double time0=Finley_timer(); |
70 |
|
|
71 |
sprintf(name,"Rectangular %d x %d x %d mesh",N0,N1,N2); |
sprintf(name,"Rectangular %d x %d x %d mesh",N0,N1,N2); |
72 |
out=Finley_Mesh_alloc(name,3,order); |
out=Finley_Mesh_alloc(name,3,order); |
73 |
if (Finley_ErrorCode!=NO_ERROR) return NULL; |
if (! Finley_noError()) return NULL; |
74 |
|
|
75 |
out->Elements=Finley_ElementFile_alloc(Hex20,out->order); |
out->Elements=Finley_ElementFile_alloc(Hex20,out->order); |
76 |
if (useElementsOnFace) { |
if (useElementsOnFace) { |
81 |
out->ContactElements=Finley_ElementFile_alloc(Rec8_Contact,out->order); |
out->ContactElements=Finley_ElementFile_alloc(Rec8_Contact,out->order); |
82 |
} |
} |
83 |
out->Points=Finley_ElementFile_alloc(Point1,out->order); |
out->Points=Finley_ElementFile_alloc(Point1,out->order); |
84 |
if (Finley_ErrorCode!=NO_ERROR) { |
if (! Finley_noError()) { |
85 |
Finley_Mesh_dealloc(out); |
Finley_Mesh_dealloc(out); |
86 |
return NULL; |
return NULL; |
87 |
} |
} |
92 |
Finley_NodeFile_allocTable(out->Nodes,N0*N1*N2); |
Finley_NodeFile_allocTable(out->Nodes,N0*N1*N2); |
93 |
Finley_ElementFile_allocTable(out->Elements,NE0*NE1*NE2); |
Finley_ElementFile_allocTable(out->Elements,NE0*NE1*NE2); |
94 |
Finley_ElementFile_allocTable(out->FaceElements,NFaceElements); |
Finley_ElementFile_allocTable(out->FaceElements,NFaceElements); |
95 |
if (Finley_ErrorCode!=NO_ERROR) { |
if (! Finley_noError()) { |
96 |
Finley_Mesh_dealloc(out); |
Finley_Mesh_dealloc(out); |
97 |
return NULL; |
return NULL; |
98 |
} |
} |
174 |
} |
} |
175 |
} |
} |
176 |
} |
} |
177 |
out->Elements->numColors=COLOR_MOD(0)+3*COLOR_MOD(0)+9*COLOR_MOD(0)+1; |
out->Elements->minColor=0; |
178 |
|
out->Elements->maxColor=COLOR_MOD(0)+3*COLOR_MOD(0)+9*COLOR_MOD(0); |
179 |
|
|
180 |
/* face elements: */ |
/* face elements: */ |
181 |
|
|
503 |
totalNECount+=NE0*NE2; |
totalNECount+=NE0*NE2; |
504 |
faceNECount+=NE0*NE2; |
faceNECount+=NE0*NE2; |
505 |
} |
} |
506 |
out->FaceElements->numColors=24; |
out->FaceElements->minColor=0; |
507 |
|
out->FaceElements->maxColor=24; |
508 |
|
|
509 |
/* face elements done: */ |
/* face elements done: */ |
510 |
|
|
515 |
/* prepare mesh for further calculatuions:*/ |
/* prepare mesh for further calculatuions:*/ |
516 |
Finley_Mesh_prepare(out) ; |
Finley_Mesh_prepare(out) ; |
517 |
|
|
518 |
|
#ifdef Finley_TRACE |
519 |
printf("timing: mesh generation: %.4e sec\n",Finley_timer()-time0); |
printf("timing: mesh generation: %.4e sec\n",Finley_timer()-time0); |
520 |
|
#endif |
521 |
|
|
522 |
if (Finley_ErrorCode!=NO_ERROR) { |
if (! Finley_noError()) { |
523 |
Finley_Mesh_dealloc(out); |
Finley_Mesh_dealloc(out); |
524 |
return NULL; |
return NULL; |
525 |
} |
} |
527 |
} |
} |
528 |
|
|
529 |
/* |
/* |
530 |
* $Log$ |
* Revision 1.3 2005/09/01 03:31:35 jgs |
531 |
* Revision 1.1 2004/10/26 06:53:57 jgs |
* Merge of development branch dev-02 back to main trunk on 2005-09-01 |
532 |
* Initial revision |
* |
533 |
|
* Revision 1.2.2.2 2005/09/07 06:26:19 gross |
534 |
|
* the solver from finley are put into the standalone package paso now |
535 |
|
* |
536 |
|
* Revision 1.2.2.1 2005/08/24 02:02:18 gross |
537 |
|
* timing output switched off. solver output can be swiched through getSolution(verbose=True) now. |
538 |
|
* |
539 |
|
* Revision 1.2 2005/07/08 04:07:52 jgs |
540 |
|
* Merge of development branch back to main trunk on 2005-07-08 |
541 |
|
* |
542 |
|
* Revision 1.1.1.1.2.1 2005/06/29 02:34:51 gross |
543 |
|
* some changes towards 64 integers in finley |
544 |
|
* |
545 |
|
* Revision 1.1.1.1 2004/10/26 06:53:57 jgs |
546 |
|
* initial import of project esys2 |
547 |
* |
* |
548 |
* Revision 1.1.1.1 2004/06/24 04:00:40 johng |
* Revision 1.1.1.1 2004/06/24 04:00:40 johng |
549 |
* Initial version of eys using boost-python. |
* Initial version of eys using boost-python. |