/[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 964 by gross, Tue Feb 13 05:10:26 2007 UTC revision 1062 by gross, Mon Mar 26 06:17:53 2007 UTC
# Line 126  static void domain_calculateDimension( i Line 126  static void domain_calculateDimension( i
126  #endif  #endif
127  /**************************************************************/  /**************************************************************/
128  #ifdef PASO_MPI  #ifdef PASO_MPI
129  Finley_Mesh* Finley_RectangularMesh_Hex20_singleCPU(dim_t* numElements,double* Length,bool_t* periodic,index_t order,bool_t useElementsOnFace, Paso_MPIInfo *mpi_info) {  Finley_Mesh* Finley_RectangularMesh_Hex20_singleCPU(dim_t* numElements,double* Length,bool_t* periodic,index_t order, index_t reduced_order, bool_t useElementsOnFace, Paso_MPIInfo *mpi_info) {
130  #else  #else
131  Finley_Mesh* Finley_RectangularMesh_Hex20(dim_t* numElements,double* Length,bool_t* periodic,index_t order,bool_t useElementsOnFace) {  Finley_Mesh* Finley_RectangularMesh_Hex20(dim_t* numElements,double* Length,bool_t* periodic,index_t order, index_t reduced_order, bool_t useElementsOnFace) {
132  #endif  #endif
133    dim_t N0,N1,N2,NE0,NE1,NE2,i0,i1,i2,k,totalNECount,faceNECount,NDOF0,NDOF1,NDOF2,NFaceElements,NUMNODES,M0,M1,M2;    dim_t N0,N1,N2,NE0,NE1,NE2,i0,i1,i2,k,totalNECount,faceNECount,NDOF0,NDOF1,NDOF2,NFaceElements,NUMNODES,M0,M1,M2;
134    index_t node0;    index_t node0;
# Line 199  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 199  Finley_Mesh* Finley_RectangularMesh_Hex2
199        
200    sprintf(name,"Rectangular %d x %d x %d mesh",N0,N1,N2);    sprintf(name,"Rectangular %d x %d x %d mesh",N0,N1,N2);
201  #ifdef PASO_MPI  #ifdef PASO_MPI
202    out=Finley_Mesh_alloc(name,3,order,mpi_info);    out=Finley_Mesh_alloc(name,3,order, reduced_order, mpi_info);
203    
204    if (! Finley_noError()) return NULL;    if (! Finley_noError()) return NULL;
205    
206    out->Elements=Finley_ElementFile_alloc(Hex20,out->order,mpi_info);    out->Elements=Finley_ElementFile_alloc(Hex20,out->order,out->reduced_order,mpi_info);
207    if (useElementsOnFace) {    if (useElementsOnFace) {
208       out->FaceElements=Finley_ElementFile_alloc(Hex20Face,out->order,mpi_info);       out->FaceElements=Finley_ElementFile_alloc(Hex20Face,out->order,out->reduced_order,mpi_info);
209       out->ContactElements=Finley_ElementFile_alloc(Hex20Face_Contact,out->order,mpi_info);       out->ContactElements=Finley_ElementFile_alloc(Hex20Face_Contact,out->order,out->reduced_order,mpi_info);
210    } else {    } else {
211       out->FaceElements=Finley_ElementFile_alloc(Rec8,out->order,mpi_info);       out->FaceElements=Finley_ElementFile_alloc(Rec8,out->order,out->reduced_order,mpi_info);
212       out->ContactElements=Finley_ElementFile_alloc(Rec8_Contact,out->order,mpi_info);       out->ContactElements=Finley_ElementFile_alloc(Rec8_Contact,out->order,out->reduced_order,mpi_info);
213    }    }
214    out->Points=Finley_ElementFile_alloc(Point1,out->order,mpi_info);    out->Points=Finley_ElementFile_alloc(Point1,out->order,out->reduced_order,mpi_info);
215    if (! Finley_noError()) {    if (! Finley_noError()) {
216        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
217        return NULL;        return NULL;
# Line 226  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 226  Finley_Mesh* Finley_RectangularMesh_Hex2
226    Finley_ElementDistribution_allocTable( out->Elements->elementDistribution, NE0*NE1*NE2, NE0*NE1*NE2);    Finley_ElementDistribution_allocTable( out->Elements->elementDistribution, NE0*NE1*NE2, NE0*NE1*NE2);
227    Finley_ElementDistribution_allocTable( out->FaceElements->elementDistribution, NFaceElements, NFaceElements );    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, reduced_order);
230    
231    if (! Finley_noError()) return NULL;    if (! Finley_noError()) return NULL;
232    
233    out->Elements=Finley_ElementFile_alloc(Hex20,out->order);    out->Elements=Finley_ElementFile_alloc(Hex20,out->order,out->reduced_order);
234    if (useElementsOnFace) {    if (useElementsOnFace) {
235       out->FaceElements=Finley_ElementFile_alloc(Hex20Face,out->order);       out->FaceElements=Finley_ElementFile_alloc(Hex20Face,out->order,out->reduced_order);
236       out->ContactElements=Finley_ElementFile_alloc(Hex20Face_Contact,out->order);       out->ContactElements=Finley_ElementFile_alloc(Hex20Face_Contact,out->order,out->reduced_order);
237    } else {    } else {
238       out->FaceElements=Finley_ElementFile_alloc(Rec8,out->order);       out->FaceElements=Finley_ElementFile_alloc(Rec8,out->order,out->reduced_order);
239       out->ContactElements=Finley_ElementFile_alloc(Rec8_Contact,out->order);       out->ContactElements=Finley_ElementFile_alloc(Rec8_Contact,out->order,out->reduced_order);
240    }    }
241    out->Points=Finley_ElementFile_alloc(Point1,out->order);    out->Points=Finley_ElementFile_alloc(Point1,out->order,out->reduced_order);
242    if (! Finley_noError()) {    if (! Finley_noError()) {
243        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
244        return NULL;        return NULL;
# Line 719  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 719  Finley_Mesh* Finley_RectangularMesh_Hex2
719    return out;    return out;
720  }  }
721  #ifdef PASO_MPI  #ifdef PASO_MPI
722  Finley_Mesh* Finley_RectangularMesh_Hex20(dim_t* numElements,double* Length,bool_t* periodic,index_t order,bool_t useElementsOnFace) {  Finley_Mesh* Finley_RectangularMesh_Hex20(dim_t* numElements,double* Length,bool_t* periodic,index_t order, index_t reduced_order, bool_t useElementsOnFace) {
723    dim_t N0,N0t,N1,N2,NE0,NE1,NE2,i0,i1,i2,k,totalNECount,faceNECount,NDOF0,NDOF0t,NDOF1,NDOF2,NFaceElements,NUMNODES,M0,M1,M2;    dim_t N0,N0t,N1,N2,NE0,NE1,NE2,i0,i1,i2,k,totalNECount,faceNECount,NDOF0,NDOF0t,NDOF1,NDOF2,NFaceElements,NUMNODES,M0,M1,M2;
724    dim_t kk,iI, NE0_local, numNodesLocal, numDOFLocal, numElementsLocal, numElementsInternal, nodesExternal[2], DOFExternal[2], numNodesExternal, DOFBoundary[2];    dim_t kk,iI, NE0_local, numNodesLocal, numDOFLocal, numElementsLocal, numElementsInternal, nodesExternal[2], DOFExternal[2], numNodesExternal, DOFBoundary[2];
725      bool_t dom_left, dom_right, dom_internal;      bool_t dom_left, dom_right, dom_internal;
# Line 761  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 761  Finley_Mesh* Finley_RectangularMesh_Hex2
761    /* use the serial version to generate the mesh for the 1-CPU case */    /* use the serial version to generate the mesh for the 1-CPU case */
762    if( mpi_info->size==1 )    if( mpi_info->size==1 )
763    {    {
764      out =  Finley_RectangularMesh_Hex20_singleCPU( numElements, Length, periodic, order, useElementsOnFace, mpi_info);      out =  Finley_RectangularMesh_Hex20_singleCPU( numElements, Length, periodic, order, reduced_order, useElementsOnFace, mpi_info);
765          return out;          return out;
766    }        }    
767    
# Line 805  Finley_Mesh* Finley_RectangularMesh_Hex2 Line 805  Finley_Mesh* Finley_RectangularMesh_Hex2
805    /*  allocate mesh: */    /*  allocate mesh: */
806        
807    sprintf(name,"Rectangular %d x %d x %d mesh",N0,N1,N2);    sprintf(name,"Rectangular %d x %d x %d mesh",N0,N1,N2);
808    out=Finley_Mesh_alloc(name,3,order,mpi_info);    out=Finley_Mesh_alloc(name,3,order, reduced_order, mpi_info);
809    
810    if (! Finley_noError()) return NULL;    if (! Finley_noError()) return NULL;
811    
812    out->Elements=Finley_ElementFile_alloc(Hex20,out->order,mpi_info);    out->Elements=Finley_ElementFile_alloc(Hex20,out->order,out->reduced_order, mpi_info);
813    if (useElementsOnFace) {    if (useElementsOnFace) {
814       out->FaceElements=Finley_ElementFile_alloc(Hex20Face,out->order,mpi_info);       out->FaceElements=Finley_ElementFile_alloc(Hex20Face,out->order,out->reduced_order, mpi_info);
815       out->ContactElements=Finley_ElementFile_alloc(Hex20Face_Contact,out->order,mpi_info);       out->ContactElements=Finley_ElementFile_alloc(Hex20Face_Contact,out->order,out->reduced_order, mpi_info);
816    } else {    } else {
817       out->FaceElements=Finley_ElementFile_alloc(Rec8,out->order,mpi_info);       out->FaceElements=Finley_ElementFile_alloc(Rec8,out->order,out->reduced_order,mpi_info);
818       out->ContactElements=Finley_ElementFile_alloc(Rec8_Contact,out->order,mpi_info);       out->ContactElements=Finley_ElementFile_alloc(Rec8_Contact,out->order,out->reduced_order,mpi_info);
819    }    }
820    out->Points=Finley_ElementFile_alloc(Point1,out->order,mpi_info);    out->Points=Finley_ElementFile_alloc(Point1,out->order,out->reduced_order,mpi_info);
821    if (! Finley_noError()) {    if (! Finley_noError()) {
822        Finley_Mesh_dealloc(out);        Finley_Mesh_dealloc(out);
823        return NULL;        return NULL;

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

  ViewVC Help
Powered by ViewVC 1.1.26