/[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 750 by bcumming, Mon May 15 04:03:49 2006 UTC revision 751 by bcumming, Mon Jun 26 01:46:34 2006 UTC
# Line 30  Line 30 
30  /**************************************************************/  /**************************************************************/
31    
32  #ifdef PASO_MPI  #ifdef PASO_MPI
 static void Finley_Mesh_printDistributed( Finley_Mesh *in )  
 {  
   dim_t k, i0, NUMNODES;  
   Finley_Mesh *out=in;  
   
   NUMNODES = in->FaceElements->ReferenceElement->Type->numNodes;  
   
   printf( "\n============NODES=============\n" );  
   for( k=0; k<in->Nodes->numNodes; k++ )  
     printf( "\tId %d\tDOF %d\tcoord [%3g%3g]\n", out->Nodes->Id[k], out->Nodes->degreeOfFreedom[k] , out->Nodes->Coordinates[INDEX2(0,k,2)], out->Nodes->Coordinates[INDEX2(1,k,2)] );  
     for( k=0; k<out->Nodes->degreeOfFreedomDistribution->numNeighbours; k++ )  
     {  
       if( out->Nodes->degreeOfFreedomDistribution->neighbours[k]>=0 )  
       {  
         printf( "\t%d boundary DOF { ", out->Nodes->degreeOfFreedomDistribution->edges[k]->numForward );  
         for( i0=0; i0<out->Nodes->degreeOfFreedomDistribution->edges[k]->numForward; i0++ )  
           printf( "%d ", out->Nodes->degreeOfFreedomDistribution->edges[k]->indexForward[i0] );  
         printf("} to %d\n", out->Nodes->degreeOfFreedomDistribution->neighbours[k] );  
         printf( "\t%d external DOF { ", out->Nodes->degreeOfFreedomDistribution->edges[k]->numBackward );  
         for( i0=0; i0<out->Nodes->degreeOfFreedomDistribution->edges[k]->numBackward; i0++ )  
           printf( "%d ", out->Nodes->degreeOfFreedomDistribution->edges[k]->indexBackward[i0] );  
         printf("} from %d\n", out->Nodes->degreeOfFreedomDistribution->neighbours[k] );  
       }  
     }  
   
   printf( "\n============ELEMENTS=============\n");  
   for( k=0; k<in->Elements->elementDistribution->numInternal; k++ )  
   {  
     printf( "I\tId %d : nodes [%d %d %d %d]->DOF [%d %d %d %d]\n", out->Elements->Id[k], out->Elements->Nodes[INDEX2(0,k,4)], out->Elements->Nodes[INDEX2(1,k,4)], out->Elements->Nodes[INDEX2(2,k,4)], out->Elements->Nodes[INDEX2(3,k,4)], out->Nodes->degreeOfFreedom[out->Elements->Nodes[INDEX2(0,k,4)]], out->Nodes->degreeOfFreedom[out->Elements->Nodes[INDEX2(1,k,4)]], out->Nodes->degreeOfFreedom[out->Elements->Nodes[INDEX2(2,k,4)]], out->Nodes->degreeOfFreedom[out->Elements->Nodes[INDEX2(3,k,4)]] );  
   }  
   
   for( k=in->Elements->elementDistribution->numInternal; k<in->Elements->elementDistribution->numInternal+in->Elements->elementDistribution->numBoundary; k++ )  
   {  
     printf( "B\tId %d : nodes [%d %d %d %d]->DOF [%d %d %d %d]\n", out->Elements->Id[k], out->Elements->Nodes[INDEX2(0,k,4)], out->Elements->Nodes[INDEX2(1,k,4)], out->Elements->Nodes[INDEX2(2,k,4)], out->Elements->Nodes[INDEX2(3,k,4)], out->Nodes->degreeOfFreedom[out->Elements->Nodes[INDEX2(0,k,4)]], out->Nodes->degreeOfFreedom[out->Elements->Nodes[INDEX2(1,k,4)]], out->Nodes->degreeOfFreedom[out->Elements->Nodes[INDEX2(2,k,4)]], out->Nodes->degreeOfFreedom[out->Elements->Nodes[INDEX2(3,k,4)]] );  
   }  
   
   for( k=in->FaceElements->elementDistribution->numInternal; k<in->FaceElements->elementDistribution->numInternal+in->FaceElements->elementDistribution->numBoundary; k++ )  
   {  
     if( NUMNODES==4 )  
       printf( "F\tId %d : nodes [%d %d %d %d]->DOF [%d %d %d %d]\n", out->FaceElements->Id[k], out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)], out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)], out->FaceElements->Nodes[INDEX2(2,k,NUMNODES)], out->FaceElements->Nodes[INDEX2(3,k,NUMNODES)], out->Nodes->degreeOfFreedom[out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]], out->Nodes->degreeOfFreedom[out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]], out->Nodes->degreeOfFreedom[out->FaceElements->Nodes[INDEX2(2,k,NUMNODES)]], out->Nodes->degreeOfFreedom[out->FaceElements->Nodes[INDEX2(3,k,NUMNODES)]] );  
     else  
       printf( "F\tId %d : nodes [%d %d]->DOF [%d %d]\n", out->FaceElements->Id[k], out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)], out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)], out->Nodes->degreeOfFreedom[out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]], out->Nodes->degreeOfFreedom[out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]] );  
   }  
   
 }  
 #endif  
   
   
   
33  /* get the number of nodes/elements for domain with rank=rank, of size processors  /* get the number of nodes/elements for domain with rank=rank, of size processors
34     where n is the total number of nodes/elements in the global domain */     where n is the total number of nodes/elements in the global domain */
35  static index_t domain_MODdim( index_t rank, index_t size, index_t n )  static index_t domain_MODdim( index_t rank, index_t size, index_t n )
# Line 93  static index_t domain_MODdim( index_t ra Line 44  static index_t domain_MODdim( index_t ra
44    
45  /* Determines the number of nodes/elements etc along an axis which is numElementsGlobal long for domain rank */  /* Determines the number of nodes/elements etc along an axis which is numElementsGlobal long for domain rank */
46  /* A bit messy, but it only has to be done once... */  /* A bit messy, but it only has to be done once... */
47  static void domain_calculateDimension( index_t rank, dim_t size, dim_t numElementsGlobal, bool_t periodic, dim_t *numNodesLocal, dim_t *numDOFLocal, dim_t *numElementsLocal, dim_t *numElementsInternal, dim_t *firstNode, dim_t *nodesExternal, dim_t *DOFExternal, dim_t *numNodesExternal, bool_t *periodicLocal )  static void domain_calculateDimension( index_t rank, dim_t size, dim_t numElementsGlobal, bool_t periodic, dim_t *numNodesLocal, dim_t *numDOFLocal, dim_t *numElementsLocal, dim_t *numElementsInternal, dim_t *firstNode, dim_t *nodesExternal, dim_t *DOFExternal, dim_t *numNodesExternal, bool_t *periodicLocal, dim_t *numDOFInternal )
48  {  {
49    index_t i0;    index_t i0;
50    dim_t numNodesGlobal = numElementsGlobal+1;    dim_t numNodesGlobal = numElementsGlobal+1;
51    
52    (*numNodesLocal) = domain_MODdim( rank, size, numNodesGlobal );    (*numNodesLocal) = domain_MODdim( rank, size, numNodesGlobal );
53      
54    numElementsLocal[0] = numNodesLocal[0]+1;    numElementsLocal[0] = numNodesLocal[0]+1;
55    periodicLocal[0] = periodicLocal[1] = FALSE;    periodicLocal[0] = periodicLocal[1] = FALSE;
56    nodesExternal[0] = nodesExternal[1] = 1;    nodesExternal[0] = nodesExternal[1] = 1;
# Line 154  static void domain_calculateDimension( i Line 105  static void domain_calculateDimension( i
105    
106    numDOFLocal[0] = numNodesLocal[0];    numDOFLocal[0] = numNodesLocal[0];
107    if( periodicLocal[0] )    if( periodicLocal[0] )
   {  
108      numDOFLocal[0]--;      numDOFLocal[0]--;
109    }          
110        numDOFInternal[0] = numDOFLocal[0];
111        if( size>1 )
112        {  
113            if( rank>0 || periodic ){
114                numDOFInternal[0] -= 1;
115            }  
116            if( rank<(size-1) || periodic ){
117                numDOFInternal[0] -= 1;
118            }  
119        }  
120    DOFExternal[0] = nodesExternal[0];    DOFExternal[0] = nodesExternal[0];
121    DOFExternal[1] = nodesExternal[1];    DOFExternal[1] = nodesExternal[1];
   
   /* some debugging printf statements */  
   //printf( "rank/size = %d/%d\nNodes : %d Local, %d External[%d %d], First = %d\nElements : %d Local\nDOF : %d Local, External [%d %d]\nperiodicLocal [%d %d]\n\n", rank, size, *numNodesLocal, *numNodesExternal, nodesExternal[0], nodesExternal[1], *firstNode, *numElementsLocal, *numDOFLocal, DOFExternal[0], DOFExternal[1], periodicLocal[0], periodicLocal[1] );  
122  }  }
123    #endif
124    
125  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)
126  #ifndef PASO_MPI  #ifndef PASO_MPI
# Line 436  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 393  Finley_Mesh* Finley_RectangularMesh_Rec4
393    
394  #else  #else
395  {  {
396    dim_t N0,N1,NE0,NE1,i0,i1, NE0_local, NDOF0,NDOF1, NFaceElements, numNodesLocal, numDOFLocal, numElementsLocal, numElementsInternal, nodesExternal[2], DOFExternal[2], numNodesExternal, faceNECount, totalNECount,M0,M1;    dim_t N0,N1,NE0,NE1,i0,i1, NE0_local, NDOF0,NDOF1, NFaceElements, numNodesLocal, numDOFLocal, numElementsLocal, numElementsInternal, nodesExternal[2], DOFExternal[2], numNodesExternal, faceNECount, totalNECount,M0,M1,numDOFInternal;
397    index_t innerLoop=0;    index_t innerLoop=0;
398    index_t NUMNODES,k,firstNode=0, DOFcount=0, forwardDOF[2], backwardDOF[2], node0, node1;    index_t NUMNODES,k,firstNode=0, DOFcount=0, forwardDOF[2], backwardDOF[2], node0, node1;
399    index_t targetDomain=-1;    index_t targetDomain=-1;
# Line 465  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 422  Finley_Mesh* Finley_RectangularMesh_Rec4
422      domInternal = TRUE;      domInternal = TRUE;
423    
424    /* dimensions of the local subdomain */    /* dimensions of the local subdomain */
425    domain_calculateDimension( mpi_info->rank, mpi_info->size, NE0, periodic[0], &numNodesLocal, &numDOFLocal, &numElementsLocal, &numElementsInternal, &firstNode, nodesExternal, DOFExternal, &numNodesExternal, periodicLocal );      domain_calculateDimension( mpi_info->rank, mpi_info->size, NE0, periodic[0], &numNodesLocal, &numDOFLocal, &numElementsLocal, &numElementsInternal, &firstNode, nodesExternal, DOFExternal, &numNodesExternal, periodicLocal, &numDOFInternal );  
426    
427    if (N0<=N1) {    if (N0<=N1) {
428       M0=1;       M0=1;
# Line 485  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 442  Finley_Mesh* Finley_RectangularMesh_Rec4
442    }    }
443    if (!periodic[1]) {    if (!periodic[1]) {
444        NDOF1=N1;        NDOF1=N1;
445        NFaceElements+=2*NE0;        NFaceElements+=2*numElementsLocal;
446    } else {    } else {
447        NDOF1=N1-1;        NDOF1=N1-1;
448    }    }
# Line 513  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 470  Finley_Mesh* Finley_RectangularMesh_Rec4
470        
471    /*  allocate tables: */    /*  allocate tables: */
472    Finley_NodeFile_allocTable( out->Nodes, (numNodesLocal + numNodesExternal)*N1 );    Finley_NodeFile_allocTable( out->Nodes, (numNodesLocal + numNodesExternal)*N1 );
473    Finley_NodeDistibution_allocTable( out->Nodes->degreeOfFreedomDistribution, numNodesLocal*NDOF1, numNodesExternal*NDOF1, 0 );    Finley_NodeDistribution_allocTable( out->Nodes->degreeOfFreedomDistribution, numDOFLocal*NDOF1, (DOFExternal[0]+DOFExternal[1])*NDOF1, 0 );
474    Finley_ElementFile_allocTable(out->Elements,numElementsLocal*NE1);    Finley_ElementFile_allocTable(out->Elements,numElementsLocal*NE1);
475    Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);    Finley_ElementFile_allocTable(out->FaceElements,NFaceElements);
476    
# Line 641  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 598  Finley_Mesh* Finley_RectangularMesh_Rec4
598        Finley_NodeDistribution_addBackward( out->Nodes->degreeOfFreedomDistribution, targetDomain, NDOF1, out->Nodes->degreeOfFreedom+(k-N1) );        Finley_NodeDistribution_addBackward( out->Nodes->degreeOfFreedomDistribution, targetDomain, NDOF1, out->Nodes->degreeOfFreedom+(k-N1) );
599      }      }
600    }    }
601      out->Nodes->degreeOfFreedomDistribution->numInternal = NDOF1*numDOFInternal;
602      out->Nodes->degreeOfFreedomDistribution->numBoundary = out->Nodes->degreeOfFreedomDistribution->numLocal- out->Nodes->degreeOfFreedomDistribution->numInternal;
603    /*   set the elements: */    /*   set the elements: */
604        
605   /* internal */   /* internal */
# Line 814  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 772  Finley_Mesh* Finley_RectangularMesh_Rec4
772            out->FaceElements->Id[k]=i0+totalNECount;            out->FaceElements->Id[k]=i0+totalNECount;
773            out->FaceElements->Tag[k]   = 10;            out->FaceElements->Tag[k]   = 10;
774            out->FaceElements->Color[k] = 0; // i0%2;            out->FaceElements->Color[k] = 0; // i0%2;
775        /* WARNING */
776        /* should be using numDOFLocal instead of numNodesLocal for the case of left hand domain with periodic[0]=true */
777            if (useElementsOnFace) {            if (useElementsOnFace) {
778                out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=node0;                out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=node0;
779                out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=node0+1;                out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=node0+1;
# Line 908  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 867  Finley_Mesh* Finley_RectangularMesh_Rec4
867    }    }
868    
869    if( mpi_info->size>1 )    if( mpi_info->size>1 )
870  {      {
871    if( !periodic[1] && (domInternal || domRight) )          if( !periodic[1] && (domInternal || domRight) )
872    {          {
873      // bottom left              // bottom left
874      k     = faceNECount;              k     = faceNECount;
875      node0 = numNodesLocal*N1;              node0 = numNodesLocal*N1;
876    
877      out->FaceElements->Id[k]=totalNECount;              out->FaceElements->Id[k]=totalNECount;
878      out->FaceElements->Tag[k]   = 10;              out->FaceElements->Tag[k]   = 10;
879      out->FaceElements->Color[k] = 0; //i1%2+6;              out->FaceElements->Color[k] = 0; //i1%2+6;
880    
881      if (useElementsOnFace) {              if (useElementsOnFace) {
882          out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=node0;                      out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=node0;
883          out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=0;                      out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=0;
884          out->FaceElements->Nodes[INDEX2(2,k,NUMNODES)]=numNodesLocal;                      out->FaceElements->Nodes[INDEX2(2,k,NUMNODES)]=numNodesLocal;
885          out->FaceElements->Nodes[INDEX2(3,k,NUMNODES)]=node0+1;                      out->FaceElements->Nodes[INDEX2(3,k,NUMNODES)]=node0+1;
886      } else {              } else {
887          out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=node0;                      out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=node0;
888          out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=0;                      out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=0;
889      }              }
890      totalNECount++;              totalNECount++;
891      faceNECount++;              faceNECount++;
892    
893      // top left              // top left
894      k     = faceNECount;              k     = faceNECount;
895      node0 = (numNodesLocal+1)*N1 - 2;              node0 = (numNodesLocal+1)*N1 - 2;
896    
897      out->FaceElements->Id[k]=totalNECount;              out->FaceElements->Id[k]=totalNECount;
898      out->FaceElements->Tag[k]   = 20;              out->FaceElements->Tag[k]   = 20;
899      out->FaceElements->Color[k] = 0; //i1%2+6;              out->FaceElements->Color[k] = 0; //i1%2+6;
900    
901      if (useElementsOnFace) {              if (useElementsOnFace) {
902          out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=numNodesLocal*(N1-1);                      out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=numNodesLocal*(N1-1);
903          out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=node0+1;                      out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=node0+1;
904          out->FaceElements->Nodes[INDEX2(2,k,NUMNODES)]=node0;                      out->FaceElements->Nodes[INDEX2(2,k,NUMNODES)]=node0;
905          out->FaceElements->Nodes[INDEX2(3,k,NUMNODES)]=numNodesLocal*(N1-2);                      out->FaceElements->Nodes[INDEX2(3,k,NUMNODES)]=numNodesLocal*(N1-2);
906      } else {              } else {
907          out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=numNodesLocal*(N1-1);                      out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=numNodesLocal*(N1-1);
908          out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=node0+1;                      out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=node0+1;
909      }              }
910      totalNECount++;              totalNECount++;
911      faceNECount++;              faceNECount++;
912    }          }
913    if( !periodic[1] && (domInternal || domLeft) )          if( !periodic[1] && (domInternal || domLeft) )
914    {          {
915      // bottom right              // bottom right
916      k     = faceNECount;              k     = faceNECount;
917      node0 = (numNodesLocal+nodesExternal[0])*N1;              node0 = (numNodesLocal+nodesExternal[0])*N1;
918    
919      out->FaceElements->Id[k]=totalNECount;              out->FaceElements->Id[k]=totalNECount;
920      out->FaceElements->Tag[k]   = 10;              out->FaceElements->Tag[k]   = 10;
921      out->FaceElements->Color[k] = 0; //i1%2+6;              out->FaceElements->Color[k] = 0; //i1%2+6;
922    
923      if (useElementsOnFace) {              if (useElementsOnFace) {
924          out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=numNodesLocal-1;                      out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=numNodesLocal-1;
925          out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=node0;                      out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=node0;
926          out->FaceElements->Nodes[INDEX2(2,k,NUMNODES)]=node0+1;                      out->FaceElements->Nodes[INDEX2(2,k,NUMNODES)]=node0+1;
927          out->FaceElements->Nodes[INDEX2(3,k,NUMNODES)]=2*numNodesLocal-1;                      out->FaceElements->Nodes[INDEX2(3,k,NUMNODES)]=2*numNodesLocal-1;
928      } else {              } else {
929          out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=numNodesLocal-1;                      out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=numNodesLocal-1;
930          out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=node0;                      out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=node0;
931      }              }
932      totalNECount++;              totalNECount++;
933      faceNECount++;              faceNECount++;
934    
935      // top right              // top right
936      k     = faceNECount;              k     = faceNECount;
937      node0 = (numNodesLocal+1+nodesExternal[0])*N1-2;              node0 = (numNodesLocal+1+nodesExternal[0])*N1-2;
938    
939      out->FaceElements->Id[k]=totalNECount;              out->FaceElements->Id[k]=totalNECount;
940      out->FaceElements->Tag[k]   = 20;              out->FaceElements->Tag[k]   = 20;
941      out->FaceElements->Color[k] = 0; //i1%2+6;              out->FaceElements->Color[k] = 0; //i1%2+6;
942    
943      if (useElementsOnFace) {              if (useElementsOnFace) {
944          out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=node0+1;                      out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=node0+1;
945          out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=numNodesLocal*N1-1;                      out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=numNodesLocal*N1-1;
946          out->FaceElements->Nodes[INDEX2(2,k,NUMNODES)]=numNodesLocal*(N1-1)-1;                      out->FaceElements->Nodes[INDEX2(2,k,NUMNODES)]=numNodesLocal*(N1-1)-1;
947          out->FaceElements->Nodes[INDEX2(3,k,NUMNODES)]=node0;                      out->FaceElements->Nodes[INDEX2(3,k,NUMNODES)]=node0;
948      } else {              } else {
949          out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=node0+1;                      out->FaceElements->Nodes[INDEX2(0,k,NUMNODES)]=node0+1;
950          out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=numNodesLocal*N1-1;                      out->FaceElements->Nodes[INDEX2(1,k,NUMNODES)]=numNodesLocal*N1-1;
951      }              }
952      totalNECount++;              totalNECount++;
953      faceNECount++;              faceNECount++;
954    }          }
955  }      }
956    out->FaceElements->minColor = 0;    out->FaceElements->minColor = 0;
957    out->FaceElements->maxColor = 0; //7;    out->FaceElements->maxColor = 0; //7;
958    
959        out->FaceElements->elementDistribution->numInternal = 0;
960        out->FaceElements->elementDistribution->numBoundary = 0;
961    if( domInternal )    if( domInternal )
962    {    {
963      if( !periodic[1] )      if( !periodic[1] )
# Line 1023  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 984  Finley_Mesh* Finley_RectangularMesh_Rec4
984      }      }
985    }    }
986        
987    out->FaceElements->elementDistribution->numLocal = out->FaceElements->elementDistribution->numInternal + out->FaceElements->elementDistribution->numBoundary;    out->FaceElements->elementDistribution->numLocal = faceNECount;
   
   if( out->FaceElements->elementDistribution->numLocal!=faceNECount )  
     printf( "ERROR : face element numbers generated %d + %d = %d != %d\n",out->FaceElements->elementDistribution->numInternal, out->FaceElements->elementDistribution->numBoundary, out->FaceElements->elementDistribution->numLocal, faceNECount );  
   
     
988    
989    /*  face elements done: */    /*  face elements done: */
990        
991      /* setup distribution info for other elements */
992      out->ContactElements->elementDistribution->numLocal = out->ContactElements->elementDistribution->numInternal = out->ContactElements->elementDistribution->numInternal = 0;
993      out->Points->elementDistribution->numLocal = out->Points->elementDistribution->numInternal = out->Points->elementDistribution->numInternal = 0;
994        
995    /*   condense the nodes: */    /*   condense the nodes: */
996    Finley_Mesh_resolveNodeIds( out );    Finley_Mesh_resolveNodeIds( out );
997    
998    /* prepare mesh for further calculatuions:*/    /* setup the CommBuffer */
999      Finley_NodeDistribution_formCommBuffer( out->Nodes->degreeOfFreedomDistribution, out->Nodes->CommBuffer );
1000      if ( !Finley_MPI_noError( mpi_info )) {
1001        if( Finley_noError() )
1002          Finley_setError( PASO_MPI_ERROR, "Error on another MPI process" );
1003        Paso_MPIInfo_dealloc( mpi_info );
1004        Finley_Mesh_dealloc(out);
1005        return NULL;
1006      }
1007    
1008    //Finley_Mesh_prepare(out) ;    Finley_NodeDistribution_calculateIndexExternal( out->Nodes->degreeOfFreedomDistribution, out->Nodes->CommBuffer );
1009    
1010      /* prepare mesh for further calculatuions:*/
1011      Finley_Mesh_prepare(out) ;
1012    
1013    #ifdef Finley_TRACE    #ifdef Finley_TRACE
1014    printf("timing: mesh generation: %.4e sec\n",Finley_timer()-time0);    printf("timing: mesh generation: %.4e sec\n",Finley_timer()-time0);
1015    #endif    #endif
1016    
1017    if ( !Finley_MPI_noError( mpi_info )) {    if( !Finley_MPI_noError(mpi_info) )
1018        Finley_Mesh_dealloc(out);    {
1019        return NULL;      if( Finley_noError() )
1020    }        Finley_setError( PASO_MPI_ERROR, "Error on another MPI process" );
1021        Paso_MPIInfo_dealloc( mpi_info );
1022        Finley_Mesh_dealloc(out);
1023        return NULL;
1024      }
1025      
1026        /* free up memory */
1027    Paso_MPIInfo_dealloc( mpi_info );    Paso_MPIInfo_dealloc( mpi_info );
1028    
1029    return out;    return out;

Legend:
Removed from v.750  
changed lines
  Added in v.751

  ViewVC Help
Powered by ViewVC 1.1.26