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

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

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

revision 113 by jgs, Mon Feb 28 07:06:33 2005 UTC revision 115 by jgs, Fri Mar 4 07:12:47 2005 UTC
# Line 57  void Finley_Mesh_saveDX(const char * fil Line 57  void Finley_Mesh_saveDX(const char * fil
57        switch(getFunctionSpaceType(data_p)) {        switch(getFunctionSpaceType(data_p)) {
58         case(FINLEY_DEGREES_OF_FREEDOM):         case(FINLEY_DEGREES_OF_FREEDOM):
59            nodetype=FINLEY_DEGREES_OF_FREEDOM;            nodetype=FINLEY_DEGREES_OF_FREEDOM;
60              isCellCentered=FALSE;
61              elements=mesh_p->Elements;
62              break;
63         case(FINLEY_REDUCED_DEGREES_OF_FREEDOM):         case(FINLEY_REDUCED_DEGREES_OF_FREEDOM):
64            nodetype=FINLEY_REDUCED_DEGREES_OF_FREEDOM;            nodetype=FINLEY_REDUCED_DEGREES_OF_FREEDOM;
65              isCellCentered=FALSE;
66              break;
67              elements=mesh_p->Elements;
68         case(FINLEY_NODES):         case(FINLEY_NODES):
69            nodetype=FINLEY_NODES;            nodetype=FINLEY_NODES;
70            isCellCentered=FALSE;            isCellCentered=FALSE;
# Line 118  void Finley_Mesh_saveDX(const char * fil Line 124  void Finley_Mesh_saveDX(const char * fil
124          int NN=elements->ReferenceElement->Type->numNodes;          int NN=elements->ReferenceElement->Type->numNodes;
125          fprintf(fileHandle_p, "object 2 class array type int rank 1 shape %d items %d data follows\n",numDXNodesPerElement, elements->numElements);          fprintf(fileHandle_p, "object 2 class array type int rank 1 shape %d items %d data follows\n",numDXNodesPerElement, elements->numElements);
126          for (i = 0; i < elements->numElements; i++) {          for (i = 0; i < elements->numElements; i++) {
127            fprintf(fileHandle_p,"%d",mesh_p->Nodes->toReduced[mesh_p->Elements->Nodes[INDEX2(resortIndex[0], i, NN)]]);            fprintf(fileHandle_p,"%d",mesh_p->Nodes->toReduced[elements->Nodes[INDEX2(resortIndex[0], i, NN)]]);
128            for (j = 1; j < numDXNodesPerElement; j++) {            for (j = 1; j < numDXNodesPerElement; j++) {
129               fprintf(fileHandle_p," %d",mesh_p->Nodes->toReduced[mesh_p->Elements->Nodes[INDEX2(resortIndex[j], i, NN)]]);               fprintf(fileHandle_p," %d",mesh_p->Nodes->toReduced[elements->Nodes[INDEX2(resortIndex[j], i, NN)]]);
130            }            }
131            fprintf(fileHandle_p, "\n");            fprintf(fileHandle_p, "\n");
132          }          }
# Line 167  void Finley_Mesh_saveDX(const char * fil Line 173  void Finley_Mesh_saveDX(const char * fil
173                         values=getSampleData(data_p,i);                         values=getSampleData(data_p,i);
174                         break;                         break;
175                   }                   }
176                     for (k=0;k<nComp;k++) fprintf(fileHandle_p, " %g", values[k]);
177                 fprintf(fileHandle_p, "\n");
178                }                }
               for (k=0;k<nComp;k++) fprintf(fileHandle_p, " %g", values[k]);  
           fprintf(fileHandle_p, "\n");  
179            }            }
180            fprintf(fileHandle_p, "attribute \"dep\" string \"positions\"\n");            fprintf(fileHandle_p, "attribute \"dep\" string \"positions\"\n");
181        }        }
# Line 185  void Finley_Mesh_saveDX(const char * fil Line 191  void Finley_Mesh_saveDX(const char * fil
191    fclose(fileHandle_p);    fclose(fileHandle_p);
192    return;    return;
193  }  }
   
 /*  
  * $Log$  
  * Revision 1.2  2005/02/28 07:06:33  jgs  
  * *** empty log message ***  
  *  
  * Revision 1.1.1.1.2.3  2005/02/17 23:43:06  cochrane  
  * Fixed error throwing bug.  Default case of switch statement should have ended  
  * with return instead of break, hence errors weren't being thrown (but they now  
  * should be).  
  *  
  * Revision 1.1.1.1.2.2  2005/02/17 05:53:26  gross  
  * some bug in saveDX fixed: in fact the bug was in  
  * DataC/getDataPointShape  
  *  
  * Revision 1.1.1.1.2.1  2005/02/17 03:23:01  gross  
  * some performance improvements in MVM  
  *  
  * Revision 1.1.1.1  2004/10/26 06:53:57  jgs  
  * initial import of project esys2  
  *  
  * Revision 1.1  2004/07/27 08:27:11  gross  
  * Finley: saveDX added: now it is possible to write data on boundary and contact elements  
  *  
  */  

Legend:
Removed from v.113  
changed lines
  Added in v.115

  ViewVC Help
Powered by ViewVC 1.1.26