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

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

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

revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC revision 153 by jgs, Tue Oct 25 01:51:20 2005 UTC
# Line 32  Line 32 
32  /**************************************************************/  /**************************************************************/
33    
34  Finley_Mesh* Finley_RectangularMesh_Rec4(dim_t* numElements,double* Length,bool_t* periodic, index_t order,bool_t useElementsOnFace) {  Finley_Mesh* Finley_RectangularMesh_Rec4(dim_t* numElements,double* Length,bool_t* periodic, index_t order,bool_t useElementsOnFace) {
35    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;
36    index_t k,node0;    index_t k,node0;
37    Finley_Mesh* out;    Finley_Mesh* out;
38    char name[50];    char name[50];
# Line 42  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 42  Finley_Mesh* Finley_RectangularMesh_Rec4
42    N0=NE0+1;    N0=NE0+1;
43    N1=NE1+1;    N1=NE1+1;
44    
45      if (N0<=N1) {
46         M0=1;
47         M1=N0;
48      } else {
49         M0=N1;
50         M1=1;
51      }
52    
53    NFaceElements=0;    NFaceElements=0;
54    if (!periodic[0]) {    if (!periodic[0]) {
55        NDOF0=N0;        NDOF0=N0;
# Line 85  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 93  Finley_Mesh* Finley_RectangularMesh_Rec4
93        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
94        return NULL;        return NULL;
95    }    }
     
96    /*  set nodes: */    /*  set nodes: */
97                                                                                                                                                                                                          
98    #pragma omp parallel for private(i0,i1,k)    #pragma omp parallel for private(i0,i1,k)
99    for (i1=0;i1<N1;i1++) {    for (i1=0;i1<N1;i1++) {
100      for (i0=0;i0<N0;i0++) {      for (i0=0;i0<N0;i0++) {
101        k=i0+N0*i1;        k=M0*i0+M1*i1;
102        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];
103        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];
104        out->Nodes->Id[k]=k;        out->Nodes->Id[k]=i0+N0*i1;
105        out->Nodes->Tag[k]=0;        out->Nodes->Tag[k]=0;
106        out->Nodes->degreeOfFreedom[k]=(i0%NDOF0) +N0*(i1%NDOF1);        out->Nodes->degreeOfFreedom[k]=M0*(i0%NDOF0) +M1*(i1%NDOF1);
107      }      }
108    }    }
109    /* tags for the faces: */    /* tags for the faces: */
110    if (!periodic[1]) {    if (!periodic[1]) {
111      for (i0=0;i0<N0;i0++) {      for (i0=0;i0<N0;i0++) {
112          out->Nodes->Tag[i0+N0*0]+=10;        out->Nodes->Tag[M0*i0+M1*0]+=10;
113          out->Nodes->Tag[i0+N0*(N1-1)]+=20;        out->Nodes->Tag[M0*i0+M1*(N1-1)]+=20;
114      }      }
115    }    }
116    if (!periodic[0]) {    if (!periodic[0]) {
117      for (i1=0;i1<N1;i1++) {      for (i1=0;i1<N1;i1++) {
118        out->Nodes->Tag[0+N0*i1]+=1;        out->Nodes->Tag[M0*0+M1*i1]+=1;
119        out->Nodes->Tag[(N0-1)+N0*i1]+=2;        out->Nodes->Tag[M0*(N0-1)+M1*i1]+=2;
120      }      }
121    }    }
122      
123    /*   set the elements: */    /*   set the elements: */
124        
125    #pragma omp parallel for private(i0,i1,k,node0)    #pragma omp parallel for private(i0,i1,k,node0)
# Line 265  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 272  Finley_Mesh* Finley_RectangularMesh_Rec4
272    }    }
273    return out;    return out;
274  }  }
   
 /*  
 * 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.150  
changed lines
  Added in v.153

  ViewVC Help
Powered by ViewVC 1.1.26