/[escript]/trunk/finley/src/Mesh_write.cpp
ViewVC logotype

Diff of /trunk/finley/src/Mesh_write.cpp

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

revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC revision 1326 by ksteube, Mon Oct 1 08:10:41 2007 UTC
# Line 126  void Finley_Mesh_write(Finley_Mesh *in,c Line 126  void Finley_Mesh_write(Finley_Mesh *in,c
126    #endif    #endif
127  }  }
128    
129    void Finley_PrintMesh_Info(Finley_Mesh *in) {
130    #ifdef PASO_MPI
131      int NN,i,j,numDim;
132      Finley_TagMap* tag_map=in->TagMap;
133    
134      fprintf(stdout, "Finley_PrintMesh_Info running on CPU %d of %d\n",in->MPIInfo->rank, in->MPIInfo->size);
135      fprintf(stdout, "\tMesh name '%s'\n",in->Name);
136      fprintf(stdout, "\tNum elements %d\n",in->Elements->numElements);
137      fprintf(stdout, "\tOrder %d\n",in->order);
138      fprintf(stdout, "\tReduced order %d\n",in->reduced_order);
139    
140      fprintf(stdout, "\tNodeFile numNodes %d\n",in->Nodes->numNodes);
141      fprintf(stdout, "\tNodeFile numDim %d\n",in->Nodes->numDim);
142    
143      fprintf(stdout, "\tElementFile numElements %d\n",in->Elements->numElements);
144      fprintf(stdout, "\tElementFile numNodes %d\n",in->Elements->numNodes);
145      fprintf(stdout, "\tElementFile minColor %d\n",in->Elements->minColor);
146      fprintf(stdout, "\tElementFile maxColor %d\n",in->Elements->maxColor);
147      fprintf(stdout, "\tElementFile order %d\n",in->Elements->order);
148      fprintf(stdout, "\tElementFile reduced_order %d\n",in->Elements->reduced_order);
149    
150      /* write nodes: */
151      if (in->Nodes!=NULL) {
152        numDim=Finley_Mesh_getDim(in);
153        fprintf(stdout, "\tNodes: %1dD-Nodes %d\n", numDim, in->Nodes->numNodes);
154        for (i=0;i<in->Nodes->numNodes;i++) {
155          fprintf(stdout, "\t  %5d %5d %5d: ",in->Nodes->Id[i],in->Nodes->globalDegreesOfFreedom[i],in->Nodes->Tag[i]);
156          for (j=0;j<numDim;j++) fprintf(stdout," %20.15e",in->Nodes->Coordinates[INDEX2(j,i,numDim)]);
157          fprintf(stdout,"\n");
158        }
159      } else {
160        fprintf(stdout, "\tNodes: 0D-Nodes 0\n");
161      }
162    
163      /* write elements: */
164      if (in->Elements!=NULL) {
165        fprintf(stdout, "\tElements: %s %d\n",in->Elements->ReferenceElement->Type->Name,in->Elements->numElements);
166        NN=in->Elements->numNodes;
167        for (i=0;i<in->Elements->numElements;i++) {
168          fprintf(stdout, "\t  %5d %5d: ",in->Elements->Id[i],in->Elements->Tag[i]);
169          for (j=0;j<NN;j++) fprintf(stdout," %5d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN)]]);
170          fprintf(stdout,"\n");
171        }
172      } else {
173        fprintf(stdout, "\tElements: Tet4 0\n");
174      }
175    
176      /* write face elements: */
177      if (in->FaceElements!=NULL) {
178        fprintf(stdout, "\tFace elements: %s %d\n", in->FaceElements->ReferenceElement->Type->Name,in->FaceElements->numElements);
179        NN=in->FaceElements->numNodes;
180        for (i=0;i<in->FaceElements->numElements;i++) {
181          fprintf(stdout, "\t  %5d %5d: ",in->FaceElements->Id[i],in->FaceElements->Tag[i]);
182          for (j=0;j<NN;j++) fprintf(stdout," %5d",in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j,i,NN)]]);
183          fprintf(stdout,"\n");
184        }
185      } else {
186        fprintf(stdout, "\tFace elements: Tri3 0\n");
187      }
188    
189      /* write Contact elements : */
190      if (in->ContactElements!=NULL) {
191        fprintf(stdout, "\tContact elements: %s %d\n",in->ContactElements->ReferenceElement->Type->Name,in->ContactElements->numElements);
192        NN=in->ContactElements->numNodes;
193        for (i=0;i<in->ContactElements->numElements;i++) {
194          fprintf(stdout, "\t  %5d %5d: ",in->ContactElements->Id[i],in->ContactElements->Tag[i]);
195          for (j=0;j<NN;j++) fprintf(stdout," %5d",in->Nodes->Id[in->ContactElements->Nodes[INDEX2(j,i,NN)]]);
196          fprintf(stdout,"\n");
197        }
198      } else {
199        fprintf(stdout, "\tFace elements: Tri3_Contact 0\n");
200      }
201    
202      /* write points: */
203      if (in->Points!=NULL) {
204        fprintf(stdout, "\tPoints: %s %d\n",in->Points->ReferenceElement->Type->Name,in->Points->numElements);
205        for (i=0;i<in->Points->numElements;i++) {
206          fprintf(stdout, "\t  %5d %5d %5d\n",in->Points->Id[i],in->Points->Tag[i],in->Nodes->Id[in->Points->Nodes[INDEX2(0,i,1)]]);
207        }
208      } else {
209        fprintf(stdout, "\tPoints: Point1 0\n");
210      }
211    
212      /* write tags:*/
213      if (tag_map) {
214         fprintf(stdout, "\tTags:\n");
215         while (tag_map) {
216            fprintf(stdout, "\t  %5d %s\n", tag_map->tag_key, tag_map->name);
217            tag_map=tag_map->next;
218         }
219      }
220    #else
221      fprintf(stdout, "Finley_PrintMesh_Info: MPI is not enabled\n");
222    #endif
223    }
224    
225  /*  /*
226  * $Log$  * $Log$
227  * Revision 1.2  2005/09/15 03:44:23  jgs  * Revision 1.2  2005/09/15 03:44:23  jgs

Legend:
Removed from v.1312  
changed lines
  Added in v.1326

  ViewVC Help
Powered by ViewVC 1.1.26