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

Diff of /trunk/finley/src/finleyC/Mesh_hex8.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC
# Line 1  Line 1 
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 */
# Line 8  Line 22 
22    
23  /**************************************************************/  /**************************************************************/
24    
25  /*   Copyrights by ACcESS Australia 2003/04 */  /*  Author: gross@access.edu.au */
26  /*   Author: gross@access.edu.au */  /*  Version: $Id$ */
 /*   Version: $Id$ */  
27    
28  /**************************************************************/  /**************************************************************/
29    
 #include "Common.h"  
 #include "Finley.h"  
 #include "Mesh.h"  
30  #include "RectangularMesh.h"  #include "RectangularMesh.h"
31    
32  /**************************************************************/  /**************************************************************/
33    
34  Finley_Mesh* Finley_RectangularMesh_Hex8(int* numElements,double* Length,int* periodic, int order,int useElementsOnFace) {  Finley_Mesh* Finley_RectangularMesh_Hex8(dim_t* numElements,double* Length,bool_t* periodic, index_t order,bool_t useElementsOnFace) {
35    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;
36      index_t node0;
37    Finley_Mesh* out;    Finley_Mesh* out;
38    char name[50];    char name[50];
39    double time0=Finley_timer();    double time0=Finley_timer();
# Line 57  Finley_Mesh* Finley_RectangularMesh_Hex8 Line 68  Finley_Mesh* Finley_RectangularMesh_Hex8
68        
69    sprintf(name,"Rectangular %d x %d x %d mesh",N0,N1,N2);    sprintf(name,"Rectangular %d x %d x %d mesh",N0,N1,N2);
70    out=Finley_Mesh_alloc(name,3,order);    out=Finley_Mesh_alloc(name,3,order);
71    if (Finley_ErrorCode!=NO_ERROR) return NULL;    if (! Finley_noError()) return NULL;
72    
73    out->Elements=Finley_ElementFile_alloc(Hex8,out->order);    out->Elements=Finley_ElementFile_alloc(Hex8,out->order);
74    if (useElementsOnFace) {    if (useElementsOnFace) {
# Line 68  Finley_Mesh* Finley_RectangularMesh_Hex8 Line 79  Finley_Mesh* Finley_RectangularMesh_Hex8
79       out->ContactElements=Finley_ElementFile_alloc(Rec4_Contact,out->order);       out->ContactElements=Finley_ElementFile_alloc(Rec4_Contact,out->order);
80    }    }
81    out->Points=Finley_ElementFile_alloc(Point1,out->order);    out->Points=Finley_ElementFile_alloc(Point1,out->order);
82    if (Finley_ErrorCode!=NO_ERROR) {    if (! Finley_noError()) {
83        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
84        return NULL;        return NULL;
85    }    }
# Line 79  Finley_Mesh* Finley_RectangularMesh_Hex8 Line 90  Finley_Mesh* Finley_RectangularMesh_Hex8
90    Finley_NodeFile_allocTable(out->Nodes,N0*N1*N2);    Finley_NodeFile_allocTable(out->Nodes,N0*N1*N2);
91    Finley_ElementFile_allocTable(out->Elements,NE0*NE1*NE2);    Finley_ElementFile_allocTable(out->Elements,NE0*NE1*NE2);
92    Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);    Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);
93    if (Finley_ErrorCode!=NO_ERROR) {    if (! Finley_noError()) {
94        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
95        return NULL;        return NULL;
96    }    }
# Line 151  Finley_Mesh* Finley_RectangularMesh_Hex8 Line 162  Finley_Mesh* Finley_RectangularMesh_Hex8
162        }        }
163      }      }
164    }    }
165    out->Elements->numColors=COLOR_MOD(0)+3*COLOR_MOD(0)+9*COLOR_MOD(0)+1;    out->Elements->minColor=0;
166      out->Elements->maxColor=COLOR_MOD(0)+3*COLOR_MOD(0)+9*COLOR_MOD(0);
167        
168    /*   face elements: */    /*   face elements: */
169        
# Line 362  Finley_Mesh* Finley_RectangularMesh_Hex8 Line 374  Finley_Mesh* Finley_RectangularMesh_Hex8
374       totalNECount+=NE0*NE2;       totalNECount+=NE0*NE2;
375       faceNECount+=NE0*NE2;       faceNECount+=NE0*NE2;
376    }    }
377    out->FaceElements->numColors=24;    out->FaceElements->minColor=0;
378      out->FaceElements->maxColor=23;
379        
380    /*  face elements done: */    /*  face elements done: */
381        
# Line 373  Finley_Mesh* Finley_RectangularMesh_Hex8 Line 386  Finley_Mesh* Finley_RectangularMesh_Hex8
386    /* prepare mesh for further calculatuions:*/    /* prepare mesh for further calculatuions:*/
387    Finley_Mesh_prepare(out) ;    Finley_Mesh_prepare(out) ;
388    
389      #ifdef Finley_TRACE
390    printf("timing: mesh generation: %.4e sec\n",Finley_timer()-time0);    printf("timing: mesh generation: %.4e sec\n",Finley_timer()-time0);
391      #endif
392    
393    if (Finley_ErrorCode!=NO_ERROR) {    if (! Finley_noError()) {
394        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
395        return NULL;        return NULL;
396    }    }
# Line 383  Finley_Mesh* Finley_RectangularMesh_Hex8 Line 398  Finley_Mesh* Finley_RectangularMesh_Hex8
398  }  }
399    
400  /*  /*
401  * $Log$  * Revision 1.3  2005/09/01 03:31:35  jgs
402  * Revision 1.1  2004/10/26 06:53:57  jgs  * Merge of development branch dev-02 back to main trunk on 2005-09-01
403  * Initial revision  *
404    * Revision 1.2.2.2  2005/09/07 06:26:19  gross
405    * the solver from finley are put into the standalone package paso now
406    *
407    * Revision 1.2.2.1  2005/08/24 02:02:18  gross
408    * timing output switched off. solver output can be swiched through getSolution(verbose=True) now.
409    *
410    * Revision 1.2  2005/07/08 04:07:52  jgs
411    * Merge of development branch back to main trunk on 2005-07-08
412    *
413    * Revision 1.1.1.1.2.1  2005/06/29 02:34:52  gross
414    * some changes towards 64 integers in finley
415    *
416    * Revision 1.1.1.1  2004/10/26 06:53:57  jgs
417    * initial import of project esys2
418  *  *
419  * Revision 1.1.1.1  2004/06/24 04:00:40  johng  * Revision 1.1.1.1  2004/06/24 04:00:40  johng
420  * Initial version of eys using boost-python.  * Initial version of eys using boost-python.

Legend:
Removed from v.82  
changed lines
  Added in v.150

  ViewVC Help
Powered by ViewVC 1.1.26