/[escript]/branches/doubleplusgood/dudley/src/Mesh.cpp
ViewVC logotype

Diff of /branches/doubleplusgood/dudley/src/Mesh.cpp

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

revision 730 by bcumming, Mon May 15 04:03:49 2006 UTC revision 782 by bcumming, Tue Jul 18 00:47:47 2006 UTC
# Line 160  dim_t Finley_Mesh_getNumDegreesOfFreedom Line 160  dim_t Finley_Mesh_getNumDegreesOfFreedom
160  dim_t Finley_Mesh_getReducedNumDegreesOfFreedom(Finley_Mesh *in) {  dim_t Finley_Mesh_getReducedNumDegreesOfFreedom(Finley_Mesh *in) {
161    return in->Nodes->reducedNumDegreesOfFreedom;    return in->Nodes->reducedNumDegreesOfFreedom;
162  }  }
163    
164    #ifdef PASO_MPI
165    void print_mesh_statistics( Finley_Mesh *out, bool_t reduced )
166    {
167      index_t i, r, j, N, M, dim;
168        int *ref;  
169        dim = out->Nodes->numDim;
170    
171        if( !reduced ){
172            printf( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\nMESH STATISTICS\n\nFULL MESH\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n" );
173            printf( "\nNodes\n========\n\n" );
174            printf( "\t%d internal DOF\n\t%d boundary DOF\n\t%d local DOF\n\t%d external DOF\n", out->Nodes->degreeOfFreedomDistribution->numInternal, out->Nodes->degreeOfFreedomDistribution->numBoundary, out->Nodes->degreeOfFreedomDistribution->numLocal, out->Nodes->degreeOfFreedomDistribution->numExternal);
175            for( i=0; i<out->Nodes->numNodes; i++ ){
176                printf( "node %d\t: id %d   \tDOF %d   \t: tag %d  \t: Dom %d  \t: coordinates [%3g", i, out->Nodes->Id[i], out->Nodes->degreeOfFreedom[i], out->Nodes->Tag[i], out->Nodes->Dom[i], out->Nodes->Coordinates[INDEX2(0,i,dim)] );
177                for( j=1; j<dim; j++ )
178                    printf( ", %3g",  out->Nodes->Coordinates[INDEX2(j,i,dim)]);
179                printf( " ]\n" );
180            }
181    
182            printf( "Elements\n=========\n\n" );
183            printf( "\t%d internal\n\t%d boundary\n\t%d local\n", out->Elements->elementDistribution->numInternal, out->Elements->elementDistribution->numBoundary, out->Elements->elementDistribution->numLocal );
184            N = out->Elements->ReferenceElement->Type->numNodes;
185            for( i=0; i<out->Elements->numElements; i++ ){
186                printf( "element %d    \t: id %d  \t: dom %d  \t: nodes [ %2d", i, out->Elements->Id[i], out->Elements->Dom[i], out->Elements->Nodes[INDEX2(0,i,N)] );
187                for( j=1; j<N; j++ )
188                    printf( ", %2d", out->Elements->Nodes[INDEX2(j,i,N)]);  
189                printf( " ] -> " );
190                if( N>8 )
191                    printf( "\n\t\t\t\t\t\t" );
192                printf( ": DOF   [ %2d", out->Nodes->degreeOfFreedom[out->Elements->Nodes[INDEX2(0,i,N)]] );    
193                for( j=1; j<N; j++ )
194                    printf( ", %2d", out->Nodes->degreeOfFreedom[out->Elements->Nodes[INDEX2(j,i,N)]]);
195                printf( " ]\n" );  
196            }
197    
198            printf( "\nFace Elements\n==========\n\n" );
199            printf( "\t%d internal\n\t%d boundary\n\t%d local\n", out->FaceElements->elementDistribution->numInternal, out->FaceElements->elementDistribution->numBoundary, out->FaceElements->elementDistribution->numLocal );
200            N = out->FaceElements->ReferenceElement->Type->numNodes;
201            for( i=0; i<out->FaceElements->numElements; i++ ){
202                printf( "face element %d \t: id %d  \t: dom %d  \t: nodes [ %2d", i, out->FaceElements->Id[i], out->FaceElements->Dom[i], out->FaceElements->Nodes[INDEX2(0,i,N)] );
203                for( j=1; j<N; j++ )
204                    printf( ", %2d", out->FaceElements->Nodes[INDEX2(j,i,N)]  );    
205                printf( " ] -> " );
206                if( N>8 )
207                    printf( "\n\t\t\t\t\t\t" );
208                printf( ": DOF   [ %2d", out->Nodes->degreeOfFreedom[out->FaceElements->Nodes[INDEX2(0,i,N)]]);
209                for( j=1; j<N; j++ )
210                    printf( ", %2d", out->Nodes->degreeOfFreedom[out->FaceElements->Nodes[INDEX2(j,i,N)]]);
211                printf( " ]\n" );  
212            }
213            printf( "\nDistribution Data\n==========\n\n" );
214            Finley_NodeDistribution_print( out->Nodes->degreeOfFreedomDistribution, stdout );
215        }
216        else{
217            printf( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\nMESH STATISTICS\n\nREDUCED MESH\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n" );
218            printf( "\nNodes\n========\n\n" );
219            printf( "\t%d internal DOF\n\t%d boundary DOF\n\t%d local DOF\n\t%d external DOF\n", out->Nodes->reducedDegreeOfFreedomDistribution->numInternal, out->Nodes->reducedDegreeOfFreedomDistribution->numBoundary, out->Nodes->reducedDegreeOfFreedomDistribution->numLocal, out->Nodes->reducedDegreeOfFreedomDistribution->numExternal);
220            for( i=0, r=0; i<out->Nodes->numNodes; i++ ){
221                if( out->Nodes->toReduced[i]>=0 ){
222                    printf( "node %d   \t: id %d   \tDOF %d   \t: tag %d  \t: Dom %d  \t: coordinates [%3g", r, out->Nodes->Id[i], out->Nodes->reducedDegreeOfFreedom[i], out->Nodes->Tag[i], out->Nodes->Dom[i], out->Nodes->Coordinates[INDEX2(0,i,dim)] );
223                    for( j=1; j<dim; j++ )
224                        printf( ", %3g",  out->Nodes->Coordinates[INDEX2(j,i,dim)]);
225                    printf( " ]\n" );
226                    r++;
227                }
228            }
229    
230            printf( "Elements\n=========\n\n" );
231            printf( "\t%d internal\n\t%d boundary\n\t%d local\n", out->Elements->elementDistribution->numInternal, out->Elements->elementDistribution->numBoundary, out->Elements->elementDistribution->numLocal );
232            N = out->Elements->LinearReferenceElement->Type->numNodes;
233            M = out->Elements->ReferenceElement->Type->numNodes;
234            ref = out->Elements->ReferenceElement->Type->linearNodes;
235            for( i=0; i<out->Elements->numElements; i++ ){
236                printf( "element %d    \t: id %d  \t: dom %d  \t: nodes [ %3d", i, out->Elements->Id[i], out->Elements->Dom[i], out->Nodes->toReduced[out->Elements->Nodes[INDEX2(ref[0],i,M)]] );
237                for( j=1; j<N; j++ ){
238                    printf( ", %3d", out->Nodes->toReduced[out->Elements->Nodes[INDEX2(ref[j],i,M)]] );
239                }
240                printf( " ] DOF [ %3d", out->Nodes->reducedDegreeOfFreedom[out->Elements->Nodes[INDEX2(ref[0],i,M)]] );
241                for( j=1; j<N; j++ )
242                    printf( ", %3d", out->Nodes->reducedDegreeOfFreedom[out->Elements->Nodes[INDEX2(ref[j],i,M)]]);
243                printf( " ]\n" );  
244            }
245    
246            printf( "\nFace Elements\n=================================================\n\n" );
247            printf( "\t%d internal\n\t%d boundary\n\t%d local\n", out->FaceElements->elementDistribution->numInternal, out->FaceElements->elementDistribution->numBoundary, out->FaceElements->elementDistribution->numLocal );
248            N = out->FaceElements->LinearReferenceElement->Type->numNodes;
249            M = out->FaceElements->ReferenceElement->Type->numNodes;
250            ref = out->FaceElements->ReferenceElement->Type->linearNodes;
251            for( i=0; i<out->FaceElements->numElements; i++ ){
252                printf( "face element %d \t: id %d  \t: dom %d  \t: nodes [ %3d", i, out->FaceElements->Id[i], out->FaceElements->Dom[i], out->Nodes->toReduced[out->FaceElements->Nodes[INDEX2(ref[0],i,M)]] );
253                for( j=1; j<N; j++ )
254                    printf( ", %3d", out->Nodes->toReduced[out->FaceElements->Nodes[INDEX2(j,i,M)]]  );
255                printf( " ] DOF [ %3d", out->Nodes->reducedDegreeOfFreedom[out->FaceElements->Nodes[INDEX2(ref[0],i,M)]]);  
256                for( j=1; j<N; j++ )
257                    printf( ", %3d", out->Nodes->reducedDegreeOfFreedom[out->FaceElements->Nodes[INDEX2(j,i,M)]]);  
258                printf( " ]\n" );  
259            }
260    
261            printf( "\nDistribution Data\n==================\n\n" );
262            Finley_NodeDistribution_print( out->Nodes->reducedDegreeOfFreedomDistribution, stdout );
263        }
264    }
265    #endif
266  /*  /*
267  * $Log$  * $Log$
268  * Revision 1.6  2005/09/15 03:44:22  jgs  * Revision 1.6  2005/09/15 03:44:22  jgs

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

  ViewVC Help
Powered by ViewVC 1.1.26