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

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

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

revision 2747 by jfenwick, Mon Jul 20 06:20:06 2009 UTC revision 2748 by gross, Tue Nov 17 07:32:59 2009 UTC
# Line 25  Line 25 
25  /*  prints the mesh to the standarts output: */  /*  prints the mesh to the standarts output: */
26    
27  void Finley_Mesh_print(Finley_Mesh *in) {  void Finley_Mesh_print(Finley_Mesh *in) {
28    dim_t NN,i,j,numDim;    dim_t NN,i,j,numDim,NN2;
29    
30    /* write header */    /* write header */
31    
# Line 53  void Finley_Mesh_print(Finley_Mesh *in) Line 53  void Finley_Mesh_print(Finley_Mesh *in)
53    
54    if (in->Elements!=NULL) {    if (in->Elements!=NULL) {
55      printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",      printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
56                         in->Elements->ReferenceElement->Type->Name,in->Elements->numElements,in->Elements->minColor,in->Elements->maxColor);                         in->Elements->referenceElementSet->referenceElement->Type->Name,in->Elements->numElements,in->Elements->minColor,in->Elements->maxColor);
57      NN=in->Elements->ReferenceElement->Type->numNodes;      NN=in->Elements->referenceElementSet->referenceElement->Type->numNodes;
58      if (in->Elements->numElements>0) {      NN2=in->Elements->numNodes;
59        if (in->Elements->numElements>0) {
60         printf("Id,Tag,Owner,Color,Nodes\n");         printf("Id,Tag,Owner,Color,Nodes\n");
61         for (i=0;i<in->Elements->numElements;i++) {         for (i=0;i<in->Elements->numElements;i++) {
62           printf("%d,%d,%d,%d,",in->Elements->Id[i],in->Elements->Tag[i],in->Elements->Owner[i], in->Elements->Color[i]);           printf("%d,%d,%d,%d,",in->Elements->Id[i],in->Elements->Tag[i],in->Elements->Owner[i], in->Elements->Color[i]);
63           for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN)]]);           for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN2)]]);
64           printf("\n");           printf("\n");
65         }         }
66      }      }
# Line 70  void Finley_Mesh_print(Finley_Mesh *in) Line 71  void Finley_Mesh_print(Finley_Mesh *in)
71    
72    if (in->FaceElements!=NULL) {    if (in->FaceElements!=NULL) {
73      printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",      printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
74                 in->FaceElements->ReferenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->minColor,in->FaceElements->maxColor);                 in->FaceElements->referenceElementSet->referenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->minColor,in->FaceElements->maxColor);
75      NN=in->FaceElements->ReferenceElement->Type->numNodes;      NN=in->FaceElements->referenceElementSet->referenceElement->Type->numNodes;
76        NN2=in->FaceElements->numNodes;
77      if (in->FaceElements->numElements>0) {      if (in->FaceElements->numElements>0) {
78         printf("Id,Tag,Owner,Color,Nodes\n");         printf("Id,Tag,Owner,Color,Nodes\n");
79         for (i=0;i<in->FaceElements->numElements;i++) {         for (i=0;i<in->FaceElements->numElements;i++) {
80           printf("%d,%d,%d,%d,",in->FaceElements->Id[i],in->FaceElements->Tag[i],in->Elements->Owner[i], in->FaceElements->Color[i]);           printf("%d,%d,%d,%d,",in->FaceElements->Id[i],in->FaceElements->Tag[i],in->Elements->Owner[i], in->FaceElements->Color[i]);
81           for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j,i,NN)]]);           for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j,i,NN2)]]);
82           printf("\n");           printf("\n");
83         }         }
84      }      }
# Line 85  void Finley_Mesh_print(Finley_Mesh *in) Line 87  void Finley_Mesh_print(Finley_Mesh *in)
87    /*  write Contact elements : */    /*  write Contact elements : */
88    if (in->ContactElements!=NULL) {    if (in->ContactElements!=NULL) {
89      printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",      printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
90                         in->ContactElements->ReferenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->minColor,in->ContactElements->maxColor);                         in->ContactElements->referenceElementSet->referenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->minColor,in->ContactElements->maxColor);
91      NN=in->ContactElements->ReferenceElement->Type->numNodes;      NN=in->ContactElements->referenceElementSet->referenceElement->Type->numNodes;
92        NN2=in->ContactElements->numNodes;
93      if (in->ContactElements->numElements>0) {      if (in->ContactElements->numElements>0) {
94         printf("Id,Tag,Owner,Color,Nodes\n");         printf("Id,Tag,Owner,Color,Nodes\n");
95         for (i=0;i<in->ContactElements->numElements;i++) {         for (i=0;i<in->ContactElements->numElements;i++) {
96           printf("%d,%d,%d,%d,",in->ContactElements->Id[i],in->ContactElements->Tag[i],in->Elements->Owner[i], in->ContactElements->Color[i]);           printf("%d,%d,%d,%d,",in->ContactElements->Id[i],in->ContactElements->Tag[i],in->Elements->Owner[i], in->ContactElements->Color[i]);
97           for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->ContactElements->Nodes[INDEX2(j,i,NN)]]);           for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->ContactElements->Nodes[INDEX2(j,i,NN2)]]);
98           printf("\n");           printf("\n");
99         }         }
100      }      }
# Line 100  void Finley_Mesh_print(Finley_Mesh *in) Line 103  void Finley_Mesh_print(Finley_Mesh *in)
103    /*  write points: */    /*  write points: */
104    if (in->Points!=NULL) {    if (in->Points!=NULL) {
105      printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",      printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
106                         in->Points->ReferenceElement->Type->Name,in->Points->numElements,in->Points->minColor,in->Points->maxColor);                         in->Points->referenceElementSet->referenceElement->Type->Name,in->Points->numElements,in->Points->minColor,in->Points->maxColor);
107      NN=in->Points->ReferenceElement->Type->numNodes;      NN=in->Points->referenceElementSet->referenceElement->Type->numNodes;
108        NN2=in->Points->numNodes;
109      if (in->Points->numElements>0) {      if (in->Points->numElements>0) {
110         printf("Id,Tag,Owner,Color,Nodes\n");         printf("Id,Tag,Owner,Color,Nodes\n");
111         for (i=0;i<in->Points->numElements;i++) {         for (i=0;i<in->Points->numElements;i++) {
112           printf("%d,%d,%d,%d,",in->Points->Id[i],in->Points->Tag[i],in->Elements->Owner[i], in->Points->Color[i]);           printf("%d,%d,%d,%d,",in->Points->Id[i],in->Points->Tag[i],in->Elements->Owner[i], in->Points->Color[i]);
113           for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Points->Nodes[INDEX2(j,i,NN)]]);           for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Points->Nodes[INDEX2(j,i,NN2)]]);
114           printf("\n");           printf("\n");
115         }         }
116      }      }

Legend:
Removed from v.2747  
changed lines
  Added in v.2748

  ViewVC Help
Powered by ViewVC 1.1.26