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

Diff of /trunk/finley/src/Mesh_hex20.c

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

temp/finley/src/Mesh_hex20.c revision 1387 by trankine, Fri Jan 11 07:45:26 2008 UTC trunk/finley/src/Mesh_hex20.c revision 2379 by gross, Thu Apr 9 07:36:55 2009 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  /**************************************************************/  /**************************************************************/
16    
# Line 43  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 42  Finley_Mesh* Finley_RectangularMesh_Hex2
42    Finley_Mesh* out;    Finley_Mesh* out;
43    Paso_MPIInfo *mpi_info = NULL;    Paso_MPIInfo *mpi_info = NULL;
44    char name[50];    char name[50];
45      #ifdef Finley_TRACE
46    double time0=Finley_timer();    double time0=Finley_timer();
47      #endif
48    
49    /* get MPI information */    /* get MPI information */
50    mpi_info = Paso_MPIInfo_alloc( MPI_COMM_WORLD );    mpi_info = Paso_MPIInfo_alloc( MPI_COMM_WORLD );
# Line 70  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 71  Finley_Mesh* Finley_RectangularMesh_Hex2
71    }    }
72    
73    if (useFullElementOrder) {    if (useFullElementOrder) {
74       Finley_setError(SYSTEM_ERROR,"full element order for Hex elements is not supported yet.");       /* Finley_setError(SYSTEM_ERROR,"full element order for Hex elements is not supported yet."); */
 /*  
75       Finley_Mesh_setElements(out,Finley_ElementFile_alloc(Hex27,       Finley_Mesh_setElements(out,Finley_ElementFile_alloc(Hex27,
76                                              out->order,                                              out->order,
77                                              out->reduced_order,                                              out->reduced_order,
78                                              mpi_info))`;                                              mpi_info));
79       if (useElementsOnFace) {       if (useElementsOnFace) {
80           Finley_setError(SYSTEM_ERROR,"rich elements for Hex27 elements is not supported yet.");           Finley_setError(SYSTEM_ERROR,"rich elements for Hex27 elements is not supported yet.");
81       } else {       } else {
# Line 88  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 88  Finley_Mesh* Finley_RectangularMesh_Hex2
88                                                         out->reduced_order,                                                         out->reduced_order,
89                                                         mpi_info));                                                         mpi_info));
90       }       }
 */  
91    
92    } else  {    } else  {
93       Finley_Mesh_setElements(out,Finley_ElementFile_alloc(Hex20,out->order,out->reduced_order,mpi_info));       Finley_Mesh_setElements(out,Finley_ElementFile_alloc(Hex20,out->order,out->reduced_order,mpi_info));
# Line 154  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 153  Finley_Mesh* Finley_RectangularMesh_Hex2
153    offset0=e_offset0*N_PER_E;    offset0=e_offset0*N_PER_E;
154    offset1=e_offset1*N_PER_E;    offset1=e_offset1*N_PER_E;
155    offset2=e_offset2*N_PER_E;    offset2=e_offset2*N_PER_E;
156    local_N0=local_NE0*N_PER_E+1;    local_N0=local_NE0>0 ? local_NE0*N_PER_E+1 : 0;
157    local_N1=local_NE1*N_PER_E+1;    local_N1=local_NE1>0 ? local_NE1*N_PER_E+1 : 0;
158    local_N2=local_NE2*N_PER_E+1;    local_N2=local_NE2>0 ? local_NE2*N_PER_E+1 : 0;
159    
160    /* get the number of surface elements */    /* get the number of surface elements */
161    
162    NFaceElements=0;    NFaceElements=0;
163    if (!periodic[2]) {    if (!periodic[2] && (local_NE2>0) ) {
164      NDOF2=N2;      NDOF2=N2;
165      if (offset2==0) NFaceElements+=local_NE1*local_NE0;      if (offset2==0) NFaceElements+=local_NE1*local_NE0;
166      if (local_NE2+e_offset2 == NE2) NFaceElements+=local_NE1*local_NE0;      if (local_NE2+e_offset2 == NE2) NFaceElements+=local_NE1*local_NE0;
# Line 169  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 168  Finley_Mesh* Finley_RectangularMesh_Hex2
168        NDOF2=N2-1;        NDOF2=N2-1;
169    }    }
170    
171    if (!periodic[0]) {    if (!periodic[0] && (local_NE0>0) ) {
172       NDOF0=N0;       NDOF0=N0;
173       if (e_offset0 == 0) NFaceElements+=local_NE1*local_NE2;       if (e_offset0 == 0) NFaceElements+=local_NE1*local_NE2;
174       if (local_NE0+e_offset0 == NE0) NFaceElements+=local_NE1*local_NE2;       if (local_NE0+e_offset0 == NE0) NFaceElements+=local_NE1*local_NE2;
175    } else {    } else {
176        NDOF0=N0-1;        NDOF0=N0-1;
177    }    }
178    if (!periodic[1]) {    if (!periodic[1] && (local_NE1>0) ) {
179       NDOF1=N1;       NDOF1=N1;
180       if (e_offset1 == 0) NFaceElements+=local_NE0*local_NE2;       if (e_offset1 == 0) NFaceElements+=local_NE0*local_NE2;
181       if (local_NE1+e_offset1 == NE1) NFaceElements+=local_NE0*local_NE2;       if (local_NE1+e_offset1 == NE1) NFaceElements+=local_NE0*local_NE2;
182    } else {    } else {
183        NDOF1=N1-1;        NDOF1=N1-1;
184    }    }
   
185    /*  allocate tables: */    /*  allocate tables: */
186    
187    Finley_NodeFile_allocTable(out->Nodes,local_N0*local_N1*local_N2);    Finley_NodeFile_allocTable(out->Nodes,local_N0*local_N1*local_N2);
# Line 263  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 261  Finley_Mesh* Finley_RectangularMesh_Hex2
261       totalNECount=NE0*NE1*NE2;       totalNECount=NE0*NE1*NE2;
262       faceNECount=0;       faceNECount=0;
263       /*   these are the quadrilateral elements on boundary 1 (x3=0): */       /*   these are the quadrilateral elements on boundary 1 (x3=0): */
264       if (!periodic[2]) {       if (!periodic[2] && (local_NE2>0)) {
265         /* **  elements on boundary 100 (x3=0): */         /* **  elements on boundary 100 (x3=0): */
266         if (offset2==0) {         if (offset2==0) {
267            #pragma omp parallel for private(i0,i1,k,node0)            #pragma omp parallel for private(i0,i1,k,node0)
# Line 373  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 371  Finley_Mesh* Finley_RectangularMesh_Hex2
371         }         }
372         totalNECount+=NE1*NE0;         totalNECount+=NE1*NE0;
373       }       }
374       if (!periodic[0]) {       if (!periodic[0] && (local_NE0>0)) {
375          /* **  elements on boundary 001 (x1=0): */          /* **  elements on boundary 001 (x1=0): */
376            
377          if (e_offset0 == 0) {          if (e_offset0 == 0) {
# Line 489  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 487  Finley_Mesh* Finley_RectangularMesh_Hex2
487           }           }
488           totalNECount+=NE1*NE2;           totalNECount+=NE1*NE2;
489       }       }
490       if (!periodic[1]) {       if (!periodic[1] && (local_NE1>0)) {
491          /* **  elements on boundary 010 (x2=0): */          /* **  elements on boundary 010 (x2=0): */
492          if (e_offset1 == 0) {          if (e_offset1 == 0) {
493             #pragma omp parallel for private(i0,i2,k,node0)             #pragma omp parallel for private(i0,i2,k,node0)

Legend:
Removed from v.1387  
changed lines
  Added in v.2379

  ViewVC Help
Powered by ViewVC 1.1.26