/[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 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC revision 2748 by gross, Tue Nov 17 07:32:59 2009 UTC
# Line 64  void Finley_Mesh_write(Finley_Mesh *in,c Line 64  void Finley_Mesh_write(Finley_Mesh *in,c
64    /*  write elements: */    /*  write elements: */
65    
66    if (in->Elements!=NULL) {    if (in->Elements!=NULL) {
67      fprintf(f, "%s %d\n",in->Elements->ReferenceElement->Type->Name,in->Elements->numElements);      fprintf(f, "%s %d\n",in->Elements->referenceElementSet->referenceElement->Type->Name,in->Elements->numElements);
68      NN=in->Elements->numNodes;      NN=in->Elements->numNodes;
69      for (i=0;i<in->Elements->numElements;i++) {      for (i=0;i<in->Elements->numElements;i++) {
70        fprintf(f,"%d %d",in->Elements->Id[i],in->Elements->Tag[i]);        fprintf(f,"%d %d",in->Elements->Id[i],in->Elements->Tag[i]);
71        for (j=0;j<NN;j++) fprintf(f," %d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN)]]);        for (j=0;j<NN;j++) fprintf(f," %d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN)]]);
# Line 77  void Finley_Mesh_write(Finley_Mesh *in,c Line 77  void Finley_Mesh_write(Finley_Mesh *in,c
77    
78    /*  write face elements: */    /*  write face elements: */
79    if (in->FaceElements!=NULL) {    if (in->FaceElements!=NULL) {
80      fprintf(f, "%s %d\n", in->FaceElements->ReferenceElement->Type->Name,in->FaceElements->numElements);      fprintf(f, "%s %d\n", in->FaceElements->referenceElementSet->referenceElement->Type->Name,in->FaceElements->numElements);
81      NN=in->FaceElements->numNodes;      NN=in->FaceElements->numNodes;
82      for (i=0;i<in->FaceElements->numElements;i++) {      for (i=0;i<in->FaceElements->numElements;i++) {
83        fprintf(f,"%d %d",in->FaceElements->Id[i],in->FaceElements->Tag[i]);        fprintf(f,"%d %d",in->FaceElements->Id[i],in->FaceElements->Tag[i]);
# Line 90  void Finley_Mesh_write(Finley_Mesh *in,c Line 90  void Finley_Mesh_write(Finley_Mesh *in,c
90    
91    /*  write Contact elements : */    /*  write Contact elements : */
92    if (in->ContactElements!=NULL) {    if (in->ContactElements!=NULL) {
93      fprintf(f, "%s %d\n",in->ContactElements->ReferenceElement->Type->Name,in->ContactElements->numElements);      fprintf(f, "%s %d\n",in->ContactElements->referenceElementSet->referenceElement->Type->Name,in->ContactElements->numElements);
94      NN=in->ContactElements->numNodes;      NN=in->ContactElements->numNodes;
95      for (i=0;i<in->ContactElements->numElements;i++) {      for (i=0;i<in->ContactElements->numElements;i++) {
96        fprintf(f,"%d %d",in->ContactElements->Id[i],in->ContactElements->Tag[i]);        fprintf(f,"%d %d",in->ContactElements->Id[i],in->ContactElements->Tag[i]);
# Line 103  void Finley_Mesh_write(Finley_Mesh *in,c Line 103  void Finley_Mesh_write(Finley_Mesh *in,c
103        
104    /*  write points: */    /*  write points: */
105    if (in->Points!=NULL) {    if (in->Points!=NULL) {
106      fprintf(f, "%s %d\n",in->Points->ReferenceElement->Type->Name,in->Points->numElements);      fprintf(f, "%s %d\n",in->Points->referenceElementSet->referenceElement->Type->Name,in->Points->numElements);
107      for (i=0;i<in->Points->numElements;i++) {      for (i=0;i<in->Points->numElements;i++) {
108        fprintf(f,"%d %d %d\n",in->Points->Id[i],in->Points->Tag[i],in->Nodes->Id[in->Points->Nodes[INDEX2(0,i,1)]]);        fprintf(f,"%d %d %d\n",in->Points->Id[i],in->Points->Tag[i],in->Nodes->Id[in->Points->Nodes[INDEX2(0,i,1)]]);
109      }      }
# Line 157  void Finley_PrintMesh_Info(Finley_Mesh * Line 157  void Finley_PrintMesh_Info(Finley_Mesh *
157        if (in->Elements->Owner[i] == in->MPIInfo->rank) mine++;        if (in->Elements->Owner[i] == in->MPIInfo->rank) mine++;
158        else overlap++;        else overlap++;
159      }      }
160      fprintf(stdout, "\tElements: %s %d (TypeId=%d) owner=%d overlap=%d\n",in->Elements->ReferenceElement->Type->Name,in->Elements->numElements,in->Elements->ReferenceElement->Type->TypeId, mine, overlap);      fprintf(stdout, "\tElements: %s %d (TypeId=%d) owner=%d overlap=%d\n",in->Elements->referenceElementSet->referenceElement->Type->Name,in->Elements->numElements,in->Elements->referenceElementSet->referenceElement->Type->TypeId, mine, overlap);
161      NN=in->Elements->numNodes;      NN=in->Elements->numNodes;
162      if (full) {      if (full) {
163        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");
# Line 178  void Finley_PrintMesh_Info(Finley_Mesh * Line 178  void Finley_PrintMesh_Info(Finley_Mesh *
178        if (in->FaceElements->Owner[i] == in->MPIInfo->rank) mine++;        if (in->FaceElements->Owner[i] == in->MPIInfo->rank) mine++;
179        else overlap++;        else overlap++;
180      }      }
181      fprintf(stdout, "\tFace elements: %s %d (TypeId=%d) owner=%d overlap=%d\n", in->FaceElements->ReferenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->ReferenceElement->Type->TypeId, mine, overlap);      fprintf(stdout, "\tFace elements: %s %d (TypeId=%d) owner=%d overlap=%d\n", in->FaceElements->referenceElementSet->referenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->referenceElementSet->referenceElement->Type->TypeId, mine, overlap);
182      NN=in->FaceElements->numNodes;      NN=in->FaceElements->numNodes;
183      if (full) {      if (full) {
184        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");
# Line 199  void Finley_PrintMesh_Info(Finley_Mesh * Line 199  void Finley_PrintMesh_Info(Finley_Mesh *
199        if (in->ContactElements->Owner[i] == in->MPIInfo->rank) mine++;        if (in->ContactElements->Owner[i] == in->MPIInfo->rank) mine++;
200        else overlap++;        else overlap++;
201      }      }
202      fprintf(stdout, "\tContact elements: %s %d (TypeId=%d) owner=%d overlap=%d\n",in->ContactElements->ReferenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->ReferenceElement->Type->TypeId, mine, overlap);      fprintf(stdout, "\tContact elements: %s %d (TypeId=%d) owner=%d overlap=%d\n",in->ContactElements->referenceElementSet->referenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->referenceElementSet->referenceElement->Type->TypeId, mine, overlap);
203      NN=in->ContactElements->numNodes;      NN=in->ContactElements->numNodes;
204      if (full) {      if (full) {
205        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");
# Line 220  void Finley_PrintMesh_Info(Finley_Mesh * Line 220  void Finley_PrintMesh_Info(Finley_Mesh *
220        if (in->Points->Owner[i] == in->MPIInfo->rank) mine++;        if (in->Points->Owner[i] == in->MPIInfo->rank) mine++;
221        else overlap++;        else overlap++;
222      }      }
223      fprintf(stdout, "\tPoints: %s %d (TypeId=%d) owner=%d overlap=%d\n",in->Points->ReferenceElement->Type->Name,in->Points->numElements,in->Points->ReferenceElement->Type->TypeId, mine, overlap);      fprintf(stdout, "\tPoints: %s %d (TypeId=%d) owner=%d overlap=%d\n",in->Points->referenceElementSet->referenceElement->Type->Name,in->Points->numElements,in->Points->referenceElementSet->referenceElement->Type->TypeId, mine, overlap);
224      if (full) {      if (full) {
225        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");        fprintf(stdout, "\t     Id   Tag Owner Color:  Nodes\n");
226        for (i=0;i<in->Points->numElements;i++) {        for (i=0;i<in->Points->numElements;i++) {

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

  ViewVC Help
Powered by ViewVC 1.1.26