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

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

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

revision 1338 by ksteube, Mon Oct 1 08:10:41 2007 UTC revision 1339 by ksteube, Wed Nov 7 01:53:12 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) {  void Finley_PrintMesh_Info(Finley_Mesh *in, bool_t full) {
130  #ifdef PASO_MPI  #ifdef PASO_MPI
131    int NN,i,j,numDim;    int NN,i,j,numDim;
132    Finley_TagMap* tag_map=in->TagMap;    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);    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);    fprintf(stdout, "\tMesh name '%s'\n",in->Name);
   fprintf(stdout, "\tNum elements %d\n",in->Elements->numElements);  
136    fprintf(stdout, "\tOrder %d\n",in->order);    fprintf(stdout, "\tOrder %d\n",in->order);
137    fprintf(stdout, "\tReduced order %d\n",in->reduced_order);    fprintf(stdout, "\tReduced order %d\n",in->reduced_order);
138    
   fprintf(stdout, "\tNodeFile numNodes %d\n",in->Nodes->numNodes);  
   fprintf(stdout, "\tNodeFile numDim %d\n",in->Nodes->numDim);  
   
   fprintf(stdout, "\tElementFile numElements %d\n",in->Elements->numElements);  
   fprintf(stdout, "\tElementFile numNodes %d\n",in->Elements->numNodes);  
   fprintf(stdout, "\tElementFile minColor %d\n",in->Elements->minColor);  
   fprintf(stdout, "\tElementFile maxColor %d\n",in->Elements->maxColor);  
   fprintf(stdout, "\tElementFile order %d\n",in->Elements->order);  
   fprintf(stdout, "\tElementFile reduced_order %d\n",in->Elements->reduced_order);  
   
139    /* write nodes: */    /* write nodes: */
140    if (in->Nodes!=NULL) {    if (in->Nodes!=NULL) {
141      numDim=Finley_Mesh_getDim(in);      numDim=Finley_Mesh_getDim(in);
142        fprintf(stdout, "\tNodes->degreesOfFreedomDistribution:");
143        for (j=0;j<in->MPIInfo->size+1;j++) fprintf(stdout," %d",in->Nodes->degreesOfFreedomDistribution->first_component[j]);
144        fprintf(stdout, "\n");
145      fprintf(stdout, "\tNodes: %1dD-Nodes %d\n", numDim, in->Nodes->numNodes);      fprintf(stdout, "\tNodes: %1dD-Nodes %d\n", numDim, in->Nodes->numNodes);
146      for (i=0;i<in->Nodes->numNodes;i++) {      if (full) {
147        fprintf(stdout, "\t  %5d %5d %5d: ",in->Nodes->Id[i],in->Nodes->globalDegreesOfFreedom[i],in->Nodes->Tag[i]);        fprintf(stdout, "\t     Id   Tag  gDOF   gNI grDOF grDFI:  Coordinates\n");
148        for (j=0;j<numDim;j++) fprintf(stdout," %20.15e",in->Nodes->Coordinates[INDEX2(j,i,numDim)]);        for (i=0;i<in->Nodes->numNodes;i++) {
149        fprintf(stdout,"\n");          fprintf(stdout, "\t  %5d %5d %5d %5d %5d %5d: ", in->Nodes->Id[i], in->Nodes->Tag[i], in->Nodes->globalDegreesOfFreedom[i], in->Nodes->globalNodesIndex[i], in->Nodes->globalReducedDOFIndex[i], in->Nodes->globalReducedNodesIndex[i]);
150            for (j=0;j<numDim;j++) fprintf(stdout," %20.15e",in->Nodes->Coordinates[INDEX2(j,i,numDim)]);
151            fprintf(stdout,"\n");
152          }
153      }      }
154    } else {    } else {
155      fprintf(stdout, "\tNodes: 0D-Nodes 0\n");      fprintf(stdout, "\tNodes: 0D-Nodes 0\n");
# Line 162  void Finley_PrintMesh_Info(Finley_Mesh * Line 157  void Finley_PrintMesh_Info(Finley_Mesh *
157    
158    /* write elements: */    /* write elements: */
159    if (in->Elements!=NULL) {    if (in->Elements!=NULL) {
160      fprintf(stdout, "\tElements: %s %d\n",in->Elements->ReferenceElement->Type->Name,in->Elements->numElements);      fprintf(stdout, "\tElements: %s %d (TypeId=%d)\n",in->Elements->ReferenceElement->Type->Name,in->Elements->numElements,in->Elements->ReferenceElement->Type->TypeId);
161      NN=in->Elements->numNodes;      NN=in->Elements->numNodes;
162      for (i=0;i<in->Elements->numElements;i++) {      if (full) {
163        fprintf(stdout, "\t  %5d %5d: ",in->Elements->Id[i],in->Elements->Tag[i]);        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");
164        for (j=0;j<NN;j++) fprintf(stdout," %5d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN)]]);        for (i=0;i<in->Elements->numElements;i++) {
165        fprintf(stdout,"\n");          fprintf(stdout, "\t  %5d %5d %5d %5d: ",in->Elements->Id[i],in->Elements->Tag[i],in->Elements->Owner[i],in->Elements->Color[i]);
166            for (j=0;j<NN;j++) fprintf(stdout," %5d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN)]]);
167            fprintf(stdout,"\n");
168          }
169      }      }
170    } else {    } else {
171      fprintf(stdout, "\tElements: Tet4 0\n");      fprintf(stdout, "\tElements: Tet4 0\n");
# Line 175  void Finley_PrintMesh_Info(Finley_Mesh * Line 173  void Finley_PrintMesh_Info(Finley_Mesh *
173    
174    /* write face elements: */    /* write face elements: */
175    if (in->FaceElements!=NULL) {    if (in->FaceElements!=NULL) {
176      fprintf(stdout, "\tFace elements: %s %d\n", in->FaceElements->ReferenceElement->Type->Name,in->FaceElements->numElements);      fprintf(stdout, "\tFace elements: %s %d (TypeId=%d)\n", in->FaceElements->ReferenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->ReferenceElement->Type->TypeId);
177      NN=in->FaceElements->numNodes;      NN=in->FaceElements->numNodes;
178      for (i=0;i<in->FaceElements->numElements;i++) {      if (full) {
179        fprintf(stdout, "\t  %5d %5d: ",in->FaceElements->Id[i],in->FaceElements->Tag[i]);        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");
180        for (j=0;j<NN;j++) fprintf(stdout," %5d",in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j,i,NN)]]);        for (i=0;i<in->FaceElements->numElements;i++) {
181        fprintf(stdout,"\n");          fprintf(stdout, "\t  %5d %5d %5d %5d: ",in->FaceElements->Id[i],in->FaceElements->Tag[i],in->FaceElements->Owner[i],in->FaceElements->Color[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      }      }
186    } else {    } else {
187      fprintf(stdout, "\tFace elements: Tri3 0\n");      fprintf(stdout, "\tFace elements: Tri3 0\n");
# Line 188  void Finley_PrintMesh_Info(Finley_Mesh * Line 189  void Finley_PrintMesh_Info(Finley_Mesh *
189    
190    /* write Contact elements : */    /* write Contact elements : */
191    if (in->ContactElements!=NULL) {    if (in->ContactElements!=NULL) {
192      fprintf(stdout, "\tContact elements: %s %d\n",in->ContactElements->ReferenceElement->Type->Name,in->ContactElements->numElements);      fprintf(stdout, "\tContact elements: %s %d (TypeId=%d)\n",in->ContactElements->ReferenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->ReferenceElement->Type->TypeId);
193      NN=in->ContactElements->numNodes;      NN=in->ContactElements->numNodes;
194      for (i=0;i<in->ContactElements->numElements;i++) {      if (full) {
195        fprintf(stdout, "\t  %5d %5d: ",in->ContactElements->Id[i],in->ContactElements->Tag[i]);        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");
196        for (j=0;j<NN;j++) fprintf(stdout," %5d",in->Nodes->Id[in->ContactElements->Nodes[INDEX2(j,i,NN)]]);        for (i=0;i<in->ContactElements->numElements;i++) {
197        fprintf(stdout,"\n");          fprintf(stdout, "\t  %5d %5d %5d %5d: ",in->ContactElements->Id[i],in->ContactElements->Tag[i],in->ContactElements->Owner[i],in->ContactElements->Color[i]);
198            for (j=0;j<NN;j++) fprintf(stdout," %5d",in->Nodes->Id[in->ContactElements->Nodes[INDEX2(j,i,NN)]]);
199            fprintf(stdout,"\n");
200          }
201      }      }
202    } else {    } else {
203      fprintf(stdout, "\tFace elements: Tri3_Contact 0\n");      fprintf(stdout, "\tFace elements: Tri3_Contact 0\n");
# Line 201  void Finley_PrintMesh_Info(Finley_Mesh * Line 205  void Finley_PrintMesh_Info(Finley_Mesh *
205    
206    /* write points: */    /* write points: */
207    if (in->Points!=NULL) {    if (in->Points!=NULL) {
208      fprintf(stdout, "\tPoints: %s %d\n",in->Points->ReferenceElement->Type->Name,in->Points->numElements);      fprintf(stdout, "\tPoints: %s %d (TypeId=%d)\n",in->Points->ReferenceElement->Type->Name,in->Points->numElements,in->Points->ReferenceElement->Type->TypeId);
209      for (i=0;i<in->Points->numElements;i++) {      if (full) {
210        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)]]);        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");
211          for (i=0;i<in->Points->numElements;i++) {
212            fprintf(stdout, "\t  %5d %5d %5d %5d %5d\n",in->Points->Id[i],in->Points->Tag[i],in->Points->Owner[i],in->Points->Color[i],in->Nodes->Id[in->Points->Nodes[INDEX2(0,i,1)]]);
213          }
214      }      }
215    } else {    } else {
216      fprintf(stdout, "\tPoints: Point1 0\n");      fprintf(stdout, "\tPoints: Point1 0\n");

Legend:
Removed from v.1338  
changed lines
  Added in v.1339

  ViewVC Help
Powered by ViewVC 1.1.26