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

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

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

revision 1028 by gross, Wed Mar 14 00:15:24 2007 UTC revision 1062 by gross, Mon Mar 26 06:17:53 2007 UTC
# Line 23  Line 23 
23  /**************************************************************/  /**************************************************************/
24    
25  #include "Mesh.h"  #include "Mesh.h"
26    #include "Assemble.h"
27    
28  /**************************************************************/  /**************************************************************/
29    
# Line 38  void Finley_Mesh_saveDX(const char * fil Line 39  void Finley_Mesh_saveDX(const char * fil
39                     };                     };
40    FILE * fileHandle_p = NULL;    FILE * fileHandle_p = NULL;
41    int i,j,k,i_data, nodetype, elementtype, numPoints = 0, nDim, *resortIndex=NULL,    int i,j,k,i_data, nodetype, elementtype, numPoints = 0, nDim, *resortIndex=NULL,
42        numDXNodesPerElement=0, numCells, NN, object_count, rank, nComp;        numDXNodesPerElement=0, numCells, NN, object_count, rank, nComp, numPointsPerSample;
43    double* values,rtmp;    double* values,rtmp;
44    bool_t *isCellCentered=NULL;    bool_t *isCellCentered=NULL;
45    Finley_ElementFile* elements=NULL;    Finley_ElementFile* elements=NULL;
# Line 101  void Finley_Mesh_saveDX(const char * fil Line 102  void Finley_Mesh_saveDX(const char * fil
102               isCellCentered[i_data]=FALSE;               isCellCentered[i_data]=FALSE;
103               break;               break;
104             case FINLEY_ELEMENTS:             case FINLEY_ELEMENTS:
105               case FINLEY_REDUCED_ELEMENTS:
106               nodetype = (nodetype == FINLEY_REDUCED_DEGREES_OF_FREEDOM) ? FINLEY_REDUCED_DEGREES_OF_FREEDOM : FINLEY_DEGREES_OF_FREEDOM;               nodetype = (nodetype == FINLEY_REDUCED_DEGREES_OF_FREEDOM) ? FINLEY_REDUCED_DEGREES_OF_FREEDOM : FINLEY_DEGREES_OF_FREEDOM;
107               if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_ELEMENTS) {               if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_ELEMENTS) {
108                   elementtype=FINLEY_ELEMENTS;                   elementtype=FINLEY_ELEMENTS;
# Line 113  void Finley_Mesh_saveDX(const char * fil Line 115  void Finley_Mesh_saveDX(const char * fil
115               isCellCentered[i_data]=TRUE;               isCellCentered[i_data]=TRUE;
116               break;               break;
117             case FINLEY_FACE_ELEMENTS:             case FINLEY_FACE_ELEMENTS:
118               case FINLEY_REDUCED_FACE_ELEMENTS:
119               nodetype = (nodetype == FINLEY_REDUCED_DEGREES_OF_FREEDOM) ? FINLEY_REDUCED_DEGREES_OF_FREEDOM : FINLEY_DEGREES_OF_FREEDOM;               nodetype = (nodetype == FINLEY_REDUCED_DEGREES_OF_FREEDOM) ? FINLEY_REDUCED_DEGREES_OF_FREEDOM : FINLEY_DEGREES_OF_FREEDOM;
120               if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_FACE_ELEMENTS) {               if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_FACE_ELEMENTS) {
121                   elementtype=FINLEY_FACE_ELEMENTS;                   elementtype=FINLEY_FACE_ELEMENTS;
# Line 137  void Finley_Mesh_saveDX(const char * fil Line 140  void Finley_Mesh_saveDX(const char * fil
140               isCellCentered[i_data]=TRUE;               isCellCentered[i_data]=TRUE;
141               break;               break;
142             case FINLEY_CONTACT_ELEMENTS_1:             case FINLEY_CONTACT_ELEMENTS_1:
143               case FINLEY_REDUCED_CONTACT_ELEMENTS_1:
144               nodetype = (nodetype == FINLEY_REDUCED_DEGREES_OF_FREEDOM) ? FINLEY_REDUCED_DEGREES_OF_FREEDOM : FINLEY_DEGREES_OF_FREEDOM;               nodetype = (nodetype == FINLEY_REDUCED_DEGREES_OF_FREEDOM) ? FINLEY_REDUCED_DEGREES_OF_FREEDOM : FINLEY_DEGREES_OF_FREEDOM;
145               if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1) {               if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1) {
146                   elementtype=FINLEY_CONTACT_ELEMENTS_1;                   elementtype=FINLEY_CONTACT_ELEMENTS_1;
# Line 149  void Finley_Mesh_saveDX(const char * fil Line 153  void Finley_Mesh_saveDX(const char * fil
153               isCellCentered[i_data]=TRUE;               isCellCentered[i_data]=TRUE;
154               break;               break;
155             case FINLEY_CONTACT_ELEMENTS_2:             case FINLEY_CONTACT_ELEMENTS_2:
156               case FINLEY_REDUCED_CONTACT_ELEMENTS_2:
157               nodetype = (nodetype == FINLEY_REDUCED_DEGREES_OF_FREEDOM) ? FINLEY_REDUCED_DEGREES_OF_FREEDOM : FINLEY_DEGREES_OF_FREEDOM;               nodetype = (nodetype == FINLEY_REDUCED_DEGREES_OF_FREEDOM) ? FINLEY_REDUCED_DEGREES_OF_FREEDOM : FINLEY_DEGREES_OF_FREEDOM;
158               if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1) {               if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1) {
159                   elementtype=FINLEY_CONTACT_ELEMENTS_1;                   elementtype=FINLEY_CONTACT_ELEMENTS_1;
# Line 188  void Finley_Mesh_saveDX(const char * fil Line 193  void Finley_Mesh_saveDX(const char * fil
193      case FINLEY_POINTS:      case FINLEY_POINTS:
194        elements=mesh_p->Points;        elements=mesh_p->Points;
195        break;        break;
196        case FINLEY_CONTACT_ELEMENTS_2:
197          elements=mesh_p->ContactElements;
198          break;
199      case FINLEY_CONTACT_ELEMENTS_1:      case FINLEY_CONTACT_ELEMENTS_1:
200        elements=mesh_p->ContactElements;        elements=mesh_p->ContactElements;
201        break;        break;
# Line 262  void Finley_Mesh_saveDX(const char * fil Line 270  void Finley_Mesh_saveDX(const char * fil
270              for (i = 0; i < rank; i++) fprintf(fileHandle_p, "%d ", getDataPointShape(data_pp[i_data],i));              for (i = 0; i < rank; i++) fprintf(fileHandle_p, "%d ", getDataPointShape(data_pp[i_data],i));
271           }           }
272           if (isCellCentered[i_data]) {           if (isCellCentered[i_data]) {
273               int numPointsPerSample=elements->ReferenceElement->numQuadNodes;               if (Finley_Assemble_reducedIntegrationOrder(data_pp[i_data])) {
274                    numPointsPerSample=elements->ReferenceElementReducedOrder->numQuadNodes;
275                 } else {
276                    numPointsPerSample=elements->ReferenceElement->numQuadNodes;
277                 }
278               if (numPointsPerSample>0) {               if (numPointsPerSample>0) {
279                  fprintf(fileHandle_p, "items %d data follows\n", numCells);                  fprintf(fileHandle_p, "items %d data follows\n", numCells);
280                  for (i=0;i<elements->numElements;i++) {                  for (i=0;i<elements->numElements;i++) {

Legend:
Removed from v.1028  
changed lines
  Added in v.1062

  ViewVC Help
Powered by ViewVC 1.1.26