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

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

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

revision 1061 by gross, Tue Feb 13 05:10:26 2007 UTC revision 1062 by gross, Mon Mar 26 06:17:53 2007 UTC
# Line 116  static void domain_calculateDimension( i Line 116  static void domain_calculateDimension( i
116  #endif  #endif
117    
118  #ifdef PASO_MPI  #ifdef PASO_MPI
119  Finley_Mesh* Finley_RectangularMesh_Line2_singleCPU(dim_t* numElements,double* Length,bool_t* periodic, dim_t order,bool_t useElementsOnFace, Paso_MPIInfo *mpi_info)  Finley_Mesh* Finley_RectangularMesh_Line2_singleCPU(dim_t* numElements,double* Length,bool_t* periodic, index_t order,index_t reduced_order, bool_t useElementsOnFace, Paso_MPIInfo *mpi_info)
120  #else  #else
121  Finley_Mesh* Finley_RectangularMesh_Line2(dim_t* numElements,double* Length,bool_t* periodic, dim_t order,bool_t useElementsOnFace)  Finley_Mesh* Finley_RectangularMesh_Line2(dim_t* numElements,double* Length,bool_t* periodic, index_t order, index_t reduced_order, bool_t useElementsOnFace)
122  #endif  #endif
123  {  {
124    /* Serial/OpenMP version */    /* Serial/OpenMP version */
# Line 142  Finley_Mesh* Finley_RectangularMesh_Line Line 142  Finley_Mesh* Finley_RectangularMesh_Line
142        
143    sprintf(name,"Rectangular mesh with %d nodes",N0);    sprintf(name,"Rectangular mesh with %d nodes",N0);
144  #ifdef PASO_MPI  #ifdef PASO_MPI
145    out=Finley_Mesh_alloc(name,1,order,mpi_info);    out=Finley_Mesh_alloc(name,1,order,reduced_order,mpi_info);
146    if (! Finley_noError()) return NULL;    if (! Finley_noError()) return NULL;
147    
148    out->Elements=Finley_ElementFile_alloc(Line2,out->order,mpi_info);    out->Elements=Finley_ElementFile_alloc(Line2,out->order,out->reduced_order,mpi_info);
149    if (useElementsOnFace) {    if (useElementsOnFace) {
150       out->FaceElements=Finley_ElementFile_alloc(Line2Face,out->order,mpi_info);       out->FaceElements=Finley_ElementFile_alloc(Line2Face,out->order,out->reduced_order,mpi_info);
151       out->ContactElements=Finley_ElementFile_alloc(Line2Face_Contact,out->order,mpi_info);       out->ContactElements=Finley_ElementFile_alloc(Line2Face_Contact,out->order,out->reduced_order,mpi_info);
152    } else {    } else {
153       out->FaceElements=Finley_ElementFile_alloc(Point1,out->order,mpi_info);       out->FaceElements=Finley_ElementFile_alloc(Point1,out->order,out->reduced_order,mpi_info);
154       out->ContactElements=Finley_ElementFile_alloc(Point1_Contact,out->order,mpi_info);       out->ContactElements=Finley_ElementFile_alloc(Point1_Contact,out->order,out->reduced_order,mpi_info);
155    }    }
156    out->Points=Finley_ElementFile_alloc(Point1,out->order,mpi_info);    out->Points=Finley_ElementFile_alloc(Point1,out->order,out->reduced_order,mpi_info);
157    if (! Finley_noError()) {    if (! Finley_noError()) {
158          Finley_Mesh_dealloc(out);          Finley_Mesh_dealloc(out);
159          return NULL;          return NULL;
# Line 167  Finley_Mesh* Finley_RectangularMesh_Line Line 167  Finley_Mesh* Finley_RectangularMesh_Line
167    Finley_ElementDistribution_allocTable( out->Elements->elementDistribution, NE0, 0);    Finley_ElementDistribution_allocTable( out->Elements->elementDistribution, NE0, 0);
168    Finley_ElementDistribution_allocTable( out->FaceElements->elementDistribution, NFaceElements, 0 );    Finley_ElementDistribution_allocTable( out->FaceElements->elementDistribution, NFaceElements, 0 );
169  #else  #else
170    out=Finley_Mesh_alloc(name,1,order);    out=Finley_Mesh_alloc(name,1,order,reduced_order);
171    if (! Finley_noError()) return NULL;    if (! Finley_noError()) return NULL;
172    
173    out->Elements=Finley_ElementFile_alloc(Line2,out->order);    out->Elements=Finley_ElementFile_alloc(Line2,out->order, out->reduced_order);
174    if (useElementsOnFace) {    if (useElementsOnFace) {
175       out->FaceElements=Finley_ElementFile_alloc(Line2Face,out->order);       out->FaceElements=Finley_ElementFile_alloc(Line2Face,out->order, out->reduced_order);
176       out->ContactElements=Finley_ElementFile_alloc(Line2Face_Contact,out->order);       out->ContactElements=Finley_ElementFile_alloc(Line2Face_Contact,out->order, out->reduced_order);
177    } else {    } else {
178       out->FaceElements=Finley_ElementFile_alloc(Point1,out->order);       out->FaceElements=Finley_ElementFile_alloc(Point1,out->order, out->reduced_order);
179       out->ContactElements=Finley_ElementFile_alloc(Point1_Contact,out->order);       out->ContactElements=Finley_ElementFile_alloc(Point1_Contact,out->order, out->reduced_order);
180    }    }
181    out->Points=Finley_ElementFile_alloc(Point1,out->order);    out->Points=Finley_ElementFile_alloc(Point1,out->order, out->reduced_order);
182    if (! Finley_noError()) {    if (! Finley_noError()) {
183          Finley_Mesh_dealloc(out);          Finley_Mesh_dealloc(out);
184          return NULL;          return NULL;
# Line 296  Finley_Mesh* Finley_RectangularMesh_Line Line 296  Finley_Mesh* Finley_RectangularMesh_Line
296    return out;    return out;
297  }  }
298  #ifdef PASO_MPI  #ifdef PASO_MPI
299  Finley_Mesh* Finley_RectangularMesh_Line2(dim_t* numElements,double* Length,bool_t* periodic, dim_t order,bool_t useElementsOnFace)  Finley_Mesh* Finley_RectangularMesh_Line2(dim_t* numElements,double* Length,bool_t* periodic, dim_t order, index_t reduced_order, bool_t useElementsOnFace)
300  {  {
301  /* MPI version */  /* MPI version */
302    dim_t N0, NE0, NE0_local, i0, NDOF0, NFaceElements, numNodesLocal, numDOFLocal, numElementsLocal, numElementsInternal, nodesExternal[2], DOFExternal[2], numNodesExternal, N0t, NDOF0t;    dim_t N0, NE0, NE0_local, i0, NDOF0, NFaceElements, numNodesLocal, numDOFLocal, numElementsLocal, numElementsInternal, nodesExternal[2], DOFExternal[2], numNodesExternal, N0t, NDOF0t;
# Line 324  Finley_Mesh* Finley_RectangularMesh_Line Line 324  Finley_Mesh* Finley_RectangularMesh_Line
324            
325      /* 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 */
326      if( mpi_info->size==1 ){      if( mpi_info->size==1 ){
327          out = Finley_RectangularMesh_Line2_singleCPU(numElements,Length,periodic,order,useElementsOnFace,mpi_info);          out = Finley_RectangularMesh_Line2_singleCPU(numElements,Length,periodic,order,reduced_order,useElementsOnFace,mpi_info);
328          return out;          return out;
329      }      }
330    
# Line 357  Finley_Mesh* Finley_RectangularMesh_Line Line 357  Finley_Mesh* Finley_RectangularMesh_Line
357    
358    /*  allocate mesh: */    /*  allocate mesh: */
359    sprintf(name,"Rectangular mesh with %d nodes",N0);    sprintf(name,"Rectangular mesh with %d nodes",N0);
360    out=Finley_Mesh_alloc(name,1,order,mpi_info);    out=Finley_Mesh_alloc(name,1,order,reduced_order,mpi_info);
361    if (! Finley_noError()) return NULL;    if (! Finley_noError()) return NULL;
362    
363    out->Elements=Finley_ElementFile_alloc(Line2,out->order,mpi_info);    out->Elements=Finley_ElementFile_alloc(Line2,out->order, out->reduced_order,mpi_info);
364    if (useElementsOnFace) {    if (useElementsOnFace) {
365       out->FaceElements=Finley_ElementFile_alloc(Line2Face,out->order,mpi_info);       out->FaceElements=Finley_ElementFile_alloc(Line2Face, out->reduced_order,out->order,mpi_info);
366       out->ContactElements=Finley_ElementFile_alloc(Line2Face_Contact,out->order,mpi_info);       out->ContactElements=Finley_ElementFile_alloc(Line2Face_Contact, out->reduced_order,out->order,mpi_info);
367    } else {    } else {
368       out->FaceElements=Finley_ElementFile_alloc(Point1,out->order,mpi_info);       out->FaceElements=Finley_ElementFile_alloc(Point1,out->order, out->reduced_order,mpi_info);
369       out->ContactElements=Finley_ElementFile_alloc(Point1_Contact,out->order,mpi_info);       out->ContactElements=Finley_ElementFile_alloc(Point1_Contact,out->order, out->reduced_order,mpi_info);
370    }    }
371    out->Points=Finley_ElementFile_alloc(Point1,out->order,mpi_info);    out->Points=Finley_ElementFile_alloc(Point1,out->order, out->reduced_order,mpi_info);
372    if (! Finley_noError()) {    if (! Finley_noError()) {
373          Finley_Mesh_dealloc(out);          Finley_Mesh_dealloc(out);
374          return NULL;          return NULL;

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

  ViewVC Help
Powered by ViewVC 1.1.26