/[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

revision 782 by bcumming, Tue Jul 18 00:47:47 2006 UTC revision 788 by bcumming, Wed Jul 26 05:12:15 2006 UTC
# Line 220  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 220  Finley_Mesh* Finley_RectangularMesh_Hex2
220        
221    /*  allocate tables: */    /*  allocate tables: */
222    Finley_NodeFile_allocTable(out->Nodes,N0*N1*N2);    Finley_NodeFile_allocTable(out->Nodes,N0*N1*N2);
   Finley_NodeDistribution_allocTable( out->Nodes->degreeOfFreedomDistribution, NDOF0*NDOF1*NDOF2, 0, 0 );  
223    Finley_ElementFile_allocTable(out->Elements,NE0*NE1*NE2);    Finley_ElementFile_allocTable(out->Elements,NE0*NE1*NE2);
224    Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);    Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);
225      Finley_NodeDistribution_allocTable( out->Nodes->degreeOfFreedomDistribution, NDOF0*NDOF1*NDOF2, 0, 0 );
226      Finley_ElementDistribution_allocTable( out->Elements->elementDistribution, NE0*NE1*NE2, NE0*NE1*NE2);
227      Finley_ElementDistribution_allocTable( out->FaceElements->elementDistribution, NFaceElements, NFaceElements );
228  #else  #else
229    out=Finley_Mesh_alloc(name,3,order);    out=Finley_Mesh_alloc(name,3,order);
230    
# Line 821  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 823  Finley_Mesh* Finley_RectangularMesh_Hex2
823    
824    /*  allocate tables: */    /*  allocate tables: */
825    Finley_NodeFile_allocTable(out->Nodes,N0t*N1*N2);    Finley_NodeFile_allocTable(out->Nodes,N0t*N1*N2);
   Finley_NodeDistribution_allocTable( out->Nodes->degreeOfFreedomDistribution, numDOFLocal*NDOF1*NDOF2, NDOF1*NDOF2*3, 0 );  
826    Finley_ElementFile_allocTable(out->Elements,numElementsLocal*NE1*NE2);    Finley_ElementFile_allocTable(out->Elements,numElementsLocal*NE1*NE2);
827    Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);    Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);
828        
829      Finley_NodeDistribution_allocTable( out->Nodes->degreeOfFreedomDistribution, numDOFLocal*NDOF1*NDOF2, NDOF1*NDOF2*3, 0 );
830      Finley_ElementDistribution_allocTable( out->Elements->elementDistribution, numElementsLocal*NE1*NE2, NE1*NE2*(numElementsLocal-boundaryRight*(!periodic[1])) );
831      Finley_ElementDistribution_allocTable( out->FaceElements->elementDistribution, NFaceElements, NFaceElements-2*boundaryRight*(NE2*(!periodic[1])+NE1*(!periodic[2])) );
832    if (! Finley_noError()) {    if (! Finley_noError()) {
833        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
834        return NULL;        return NULL;
835    }    }
836    
837        k=0;
838    #pragma omp parallel for private(i0,i1,i2,k)    #pragma omp parallel for private(i0,i1,i2,k)
839    for (k=0,i2=0;i2<N2;i2++) {    for (i2=0;i2<N2;i2++) {
840      for (i1=0;i1<N1;i1++) {      for (i1=0;i1<N1;i1++) {
841        for (i0=0;i0<N0t;i0++,k++) {                for (i0=0;i0<N0t;i0++,k++) {        
842          out->Nodes->Coordinates[INDEX2(0,k,3)]=DBLE((i0+firstNodeConstruct) % N0)/DBLE(N0-1)*Length[0];          out->Nodes->Coordinates[INDEX2(0,k,3)]=DBLE((i0+firstNodeConstruct) % N0)/DBLE(N0-1)*Length[0];
# Line 960  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 966  Finley_Mesh* Finley_RectangularMesh_Hex2
966        for (i0=0;i0<numElementsLocal;i0++,k++) {        for (i0=0;i0<numElementsLocal;i0++,k++) {
967                  node0 = (periodicLocal[0] && !i0) ? 2*(i1*N0t + i2*N1*N0t) : 2*(i1*N0t + i2*N1*N0t + i0) + periodicLocal[0];                  node0 = (periodicLocal[0] && !i0) ? 2*(i1*N0t + i2*N1*N0t) : 2*(i1*N0t + i2*N1*N0t + i0) + periodicLocal[0];
968    
969          out->Elements->Id[k]=k;                  out->Elements->Id[k]=((firstNodeConstruct/2+i0)%NE0)*NE1*NE2 + NE1*i2 + i1;
970          out->Elements->Tag[k]=0;          out->Elements->Tag[k]=0;
971          out->Elements->Color[k]=COLOR_MOD(i0)+3*COLOR_MOD(i1)+9*COLOR_MOD(i2);          out->Elements->Color[k]=COLOR_MOD(i0)+3*COLOR_MOD(i1)+9*COLOR_MOD(i2);
972          out->Elements->Dom[k]=ELEMENT_INTERNAL;          out->Elements->Dom[k]=ELEMENT_INTERNAL;

Legend:
Removed from v.782  
changed lines
  Added in v.788

  ViewVC Help
Powered by ViewVC 1.1.26