/[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 964 by gross, Tue Feb 13 05:10:26 2007 UTC revision 1062 by gross, Mon Mar 26 06:17:53 2007 UTC
# Line 122  static void domain_calculateDimension( i Line 122  static void domain_calculateDimension( i
122  #endif  #endif
123    
124  #ifdef PASO_MPI  #ifdef PASO_MPI
125  Finley_Mesh* Finley_RectangularMesh_Rec4_singleCPU(dim_t* numElements,double* Length,bool_t* periodic, index_t order,bool_t useElementsOnFace,Paso_MPIInfo *mpi_info)  Finley_Mesh* Finley_RectangularMesh_Rec4_singleCPU(dim_t* numElements,double* Length,bool_t* periodic, index_t order, index_t reduced_order, bool_t useElementsOnFace,Paso_MPIInfo *mpi_info)
126  #else  #else
127  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, index_t reduced_order, bool_t useElementsOnFace)
128  #endif  #endif
129  {  {
130    dim_t N0,N1,NE0,NE1,i0,i1,totalNECount,faceNECount,NDOF0,NDOF1,NFaceElements,NUMNODES,M0,M1;    dim_t N0,N1,NE0,NE1,i0,i1,totalNECount,faceNECount,NDOF0,NDOF1,NFaceElements,NUMNODES,M0,M1;
# Line 163  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 163  Finley_Mesh* Finley_RectangularMesh_Rec4
163        
164    sprintf(name,"Rectangular %d x %d mesh",N0,N1);    sprintf(name,"Rectangular %d x %d mesh",N0,N1);
165  #ifdef PASO_MPI  #ifdef PASO_MPI
166    out=Finley_Mesh_alloc(name,2,order,mpi_info);    out=Finley_Mesh_alloc(name,2,order,reduced_order,mpi_info);
167    
168    if (! Finley_noError()) return NULL;    if (! Finley_noError()) return NULL;
169    
170    out->Elements=Finley_ElementFile_alloc(Rec4,out->order,mpi_info);    out->Elements=Finley_ElementFile_alloc(Rec4,out->order, out->reduced_order,mpi_info);
171    if (useElementsOnFace) {    if (useElementsOnFace) {
172       out->FaceElements=Finley_ElementFile_alloc(Rec4Face,out->order,mpi_info);       out->FaceElements=Finley_ElementFile_alloc(Rec4Face,out->order, out->reduced_order,mpi_info);
173       out->ContactElements=Finley_ElementFile_alloc(Rec4Face_Contact,out->order,mpi_info);       out->ContactElements=Finley_ElementFile_alloc(Rec4Face_Contact,out->order, out->reduced_order,mpi_info);
174    } else {    } else {
175       out->FaceElements=Finley_ElementFile_alloc(Line2,out->order,mpi_info);       out->FaceElements=Finley_ElementFile_alloc(Line2,out->order, out->reduced_order,mpi_info);
176       out->ContactElements=Finley_ElementFile_alloc(Line2_Contact,out->order,mpi_info);       out->ContactElements=Finley_ElementFile_alloc(Line2_Contact,out->order, out->reduced_order,mpi_info);
177    }    }
178    out->Points=Finley_ElementFile_alloc(Point1,out->order,mpi_info);    out->Points=Finley_ElementFile_alloc(Point1, out->reduced_order,out->order,mpi_info);
179    
180    if (! Finley_noError()) {    if (! Finley_noError()) {
181        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
# Line 191  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 191  Finley_Mesh* Finley_RectangularMesh_Rec4
191    Finley_ElementDistribution_allocTable( out->Elements->elementDistribution, NE0*NE1, NE0*NE1);    Finley_ElementDistribution_allocTable( out->Elements->elementDistribution, NE0*NE1, NE0*NE1);
192    Finley_ElementDistribution_allocTable( out->FaceElements->elementDistribution, NFaceElements, NFaceElements );    Finley_ElementDistribution_allocTable( out->FaceElements->elementDistribution, NFaceElements, NFaceElements );
193  #else  #else
194    out=Finley_Mesh_alloc(name,2,order);    out=Finley_Mesh_alloc(name,2,order,reduced_order);
195    
196    if (! Finley_noError()) return NULL;    if (! Finley_noError()) return NULL;
197    
198    out->Elements=Finley_ElementFile_alloc(Rec4,out->order);    out->Elements=Finley_ElementFile_alloc(Rec4,out->order, out->reduced_order);
199    if (useElementsOnFace) {    if (useElementsOnFace) {
200       out->FaceElements=Finley_ElementFile_alloc(Rec4Face,out->order);       out->FaceElements=Finley_ElementFile_alloc(Rec4Face,out->order, out->reduced_order);
201       out->ContactElements=Finley_ElementFile_alloc(Rec4Face_Contact,out->order);       out->ContactElements=Finley_ElementFile_alloc(Rec4Face_Contact,out->order, out->reduced_order);
202    } else {    } else {
203       out->FaceElements=Finley_ElementFile_alloc(Line2,out->order);       out->FaceElements=Finley_ElementFile_alloc(Line2,out->order, out->reduced_order);
204       out->ContactElements=Finley_ElementFile_alloc(Line2_Contact,out->order);       out->ContactElements=Finley_ElementFile_alloc(Line2_Contact,out->order, out->reduced_order);
205    }    }
206    out->Points=Finley_ElementFile_alloc(Point1,out->order);    out->Points=Finley_ElementFile_alloc(Point1,out->order, out->reduced_order);
207    
208    if (! Finley_noError()) {    if (! Finley_noError()) {
209        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
# Line 424  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 424  Finley_Mesh* Finley_RectangularMesh_Rec4
424    return out;    return out;
425  }  }
426  #ifdef PASO_MPI  #ifdef PASO_MPI
427  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, index_t reduced_order, bool_t useElementsOnFace)
428  {  {
429    dim_t N0,N1,NE0,NE1,i0,i1,N0t, NDOF0t, NE0_local, NDOF0,NDOF1, NFaceElements, numNodesLocal, numDOFLocal, numElementsLocal, numElementsInternal, nodesExternal[2], DOFExternal[2], numNodesExternal, faceNECount, totalNECount,M0,M1,numDOFInternal;    dim_t N0,N1,NE0,NE1,i0,i1,N0t, NDOF0t, NE0_local, NDOF0,NDOF1, NFaceElements, numNodesLocal, numDOFLocal, numElementsLocal, numElementsInternal, nodesExternal[2], DOFExternal[2], numNodesExternal, faceNECount, totalNECount,M0,M1,numDOFInternal;
430    index_t NUMNODES,k,firstNode=0, DOFcount=0, node0, node1;    index_t NUMNODES,k,firstNode=0, DOFcount=0, node0, node1;
# Line 449  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 449  Finley_Mesh* Finley_RectangularMesh_Rec4
449    
450      /* use the serial code to generate the mesh in the 1-CPU case */      /* use the serial code to generate the mesh in the 1-CPU case */
451      if( mpi_info->size==1 ){      if( mpi_info->size==1 ){
452          out = Finley_RectangularMesh_Rec4_singleCPU(numElements,Length,periodic,order,useElementsOnFace,mpi_info);          out = Finley_RectangularMesh_Rec4_singleCPU(numElements,Length,periodic,order,reduced_order,useElementsOnFace,mpi_info);
453          return out;          return out;
454      }      }
455    
# Line 494  Finley_Mesh* Finley_RectangularMesh_Rec4 Line 494  Finley_Mesh* Finley_RectangularMesh_Rec4
494      firstNodeConstruct = firstNodeConstruct<0 ? N0-2 : firstNodeConstruct;      firstNodeConstruct = firstNodeConstruct<0 ? N0-2 : firstNodeConstruct;
495    
496    sprintf(name,"Rectangular %d x %d mesh",N0,N1);    sprintf(name,"Rectangular %d x %d mesh",N0,N1);
497    out=Finley_Mesh_alloc( name, 2, order, mpi_info );    out=Finley_Mesh_alloc( name, 2, order, reduced_order, mpi_info );
498    
499    if (! Finley_noError()) return NULL;    if (! Finley_noError()) return NULL;
500    
501    out->Elements=Finley_ElementFile_alloc( Rec4, out->order, mpi_info );    out->Elements=Finley_ElementFile_alloc( Rec4, out->order, out->reduced_order, mpi_info );
502    if (useElementsOnFace) {    if (useElementsOnFace) {
503       out->FaceElements=Finley_ElementFile_alloc(Rec4Face,out->order, mpi_info );       out->FaceElements=Finley_ElementFile_alloc(Rec4Face,out->order, out->reduced_order, mpi_info );
504       out->ContactElements=Finley_ElementFile_alloc(Rec4Face_Contact,out->order, mpi_info );       out->ContactElements=Finley_ElementFile_alloc(Rec4Face_Contact,out->order, out->reduced_order, mpi_info );
505    } else {    } else {
506       out->FaceElements=Finley_ElementFile_alloc(Line2,out->order, mpi_info );       out->FaceElements=Finley_ElementFile_alloc(Line2,out->order, out->reduced_order, mpi_info );
507       out->ContactElements=Finley_ElementFile_alloc(Line2_Contact,out->order, mpi_info );       out->ContactElements=Finley_ElementFile_alloc(Line2_Contact,out->order, out->reduced_order, mpi_info );
508    }    }
509    out->Points=Finley_ElementFile_alloc(Point1,out->order, mpi_info );    out->Points=Finley_ElementFile_alloc(Point1,out->order, out->reduced_order, mpi_info );
510    if (! Finley_noError()) {    if (! Finley_noError()) {
511        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
512        return NULL;        return NULL;

Legend:
Removed from v.964  
changed lines
  Added in v.1062

  ViewVC Help
Powered by ViewVC 1.1.26