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

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

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

revision 152 by jgs, Thu Sep 15 03:44:45 2005 UTC revision 153 by jgs, Tue Oct 25 01:51:20 2005 UTC
# Line 31  Line 31 
31  /**************************************************************/  /**************************************************************/
32    
33  Finley_Mesh* Finley_RectangularMesh_Rec8(int* numElements,double* Length,int* periodic,int order,int useElementsOnFace) {  Finley_Mesh* Finley_RectangularMesh_Rec8(int* numElements,double* Length,int* periodic,int order,int useElementsOnFace) {
34    dim_t N0,N1,NE0,NE1,i0,i1,totalNECount,faceNECount,NDOF0,NDOF1,NFaceElements,NUMNODES;    dim_t N0,N1,NE0,NE1,i0,i1,totalNECount,faceNECount,NDOF0,NDOF1,NFaceElements,NUMNODES,M0,M1;
35    index_t k,node0;    index_t k,node0;
36    Finley_Mesh* out;    Finley_Mesh* out;
37    char name[50];    char name[50];
# Line 41  Finley_Mesh* Finley_RectangularMesh_Rec8 Line 41  Finley_Mesh* Finley_RectangularMesh_Rec8
41    N0=2*NE0+1;    N0=2*NE0+1;
42    N1=2*NE1+1;    N1=2*NE1+1;
43    
44      if (N0<=N1) {
45         M0=1;
46         M1=N0;
47      } else {
48         M0=N1;
49         M1=1;
50      }
51    
52    NFaceElements=0;    NFaceElements=0;
53    if (!periodic[0]) {    if (!periodic[0]) {
54        NDOF0=N0;        NDOF0=N0;
# Line 84  Finley_Mesh* Finley_RectangularMesh_Rec8 Line 92  Finley_Mesh* Finley_RectangularMesh_Rec8
92        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
93        return NULL;        return NULL;
94    }    }
     
95    /*  set nodes: */    /*  set nodes: */
96                                                                                                                                                                                                          
97    #pragma omp parallel for private(i0,i1,k)    #pragma omp parallel for private(i0,i1,k)
98    for (i1=0;i1<N1;i1++) {    for (i1=0;i1<N1;i1++) {
99      for (i0=0;i0<N0;i0++) {      for (i0=0;i0<N0;i0++) {
100        k=i0+N0*i1;        k=M0*i0+M1*i1;
101        out->Nodes->Coordinates[INDEX2(0,k,2)]=DBLE(i0)/DBLE(N0-1)*Length[0];        out->Nodes->Coordinates[INDEX2(0,k,2)]=DBLE(i0)/DBLE(N0-1)*Length[0];
102        out->Nodes->Coordinates[INDEX2(1,k,2)]=DBLE(i1)/DBLE(N1-1)*Length[1];        out->Nodes->Coordinates[INDEX2(1,k,2)]=DBLE(i1)/DBLE(N1-1)*Length[1];
103        out->Nodes->Id[k]=k;        out->Nodes->Id[k]=i0+N0*i1;
104        out->Nodes->Tag[k]=0;        out->Nodes->Tag[k]=0;
105        out->Nodes->degreeOfFreedom[k]=(i0%NDOF0) +N0*(i1%NDOF1);        out->Nodes->degreeOfFreedom[k]=M0*(i0%NDOF0) +M1*(i1%NDOF1);
106      }      }
107    }    }
108    /* tags for the faces: */    /* tags for the faces: */
109    if (!periodic[1]) {    if (!periodic[1]) {
110      for (i0=0;i0<N0;i0++) {      for (i0=0;i0<N0;i0++) {
111        out->Nodes->Tag[i0+N0*0]+=10;        out->Nodes->Tag[M0*i0+M1*0]+=10;
112        out->Nodes->Tag[i0+N0*(N1-1)]+=20;        out->Nodes->Tag[M0*i0+M1*(N1-1)]+=20;
113      }      }
114    }    }
115    if (!periodic[0]) {    if (!periodic[0]) {
116      for (i1=0;i1<N1;i1++) {      for (i1=0;i1<N1;i1++) {
117        out->Nodes->Tag[0+N0*i1]+=1;        out->Nodes->Tag[M0*0+M1*i1]+=1;
118        out->Nodes->Tag[(N0-1)+N0*i1]+=2;        out->Nodes->Tag[M0*(N0-1)+M1*i1]+=2;
119      }      }
120    }    }
121      
122    /*   set the elements: */    /*   set the elements: */
123        
124    #pragma omp parallel for private(i0,i1,k,node0)    #pragma omp parallel for private(i0,i1,k,node0)
# Line 291  Finley_Mesh* Finley_RectangularMesh_Rec8 Line 298  Finley_Mesh* Finley_RectangularMesh_Rec8
298    }    }
299    return out;    return out;
300  }  }
   
 /*  
 * Revision 1.3  2005/09/01 03:31:36  jgs  
 * Merge of development branch dev-02 back to main trunk on 2005-09-01  
 *  
 * Revision 1.2.2.2  2005/09/07 06:26:19  gross  
 * the solver from finley are put into the standalone package paso now  
 *  
 * Revision 1.2.2.1  2005/08/24 02:02:18  gross  
 * timing output switched off. solver output can be swiched through getSolution(verbose=True) now.  
 *  
 * Revision 1.2  2005/07/08 04:07:54  jgs  
 * Merge of development branch back to main trunk on 2005-07-08  
 *  
 * Revision 1.1.1.1.2.1  2005/06/29 02:34:53  gross  
 * some changes towards 64 integers in finley  
 *  
 * Revision 1.1.1.1  2004/10/26 06:53:57  jgs  
 * initial import of project esys2  
 *  
 * Revision 1.1.1.1  2004/06/24 04:00:40  johng  
 * Initial version of eys using boost-python.  
 *  
 *  
 */  
   

Legend:
Removed from v.152  
changed lines
  Added in v.153

  ViewVC Help
Powered by ViewVC 1.1.26