/[escript]/branches/domexper/dudley/src/Mesh_saveVTK.c
ViewVC logotype

Diff of /branches/domexper/dudley/src/Mesh_saveVTK.c

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

revision 2748 by gross, Tue Nov 17 07:32:59 2009 UTC revision 2754 by gross, Wed Nov 18 07:44:26 2009 UTC
# Line 95  int nodeInQuadrant(const double *coords, Line 95  int nodeInQuadrant(const double *coords,
95  #define INSIDE_3D(_X_,_Y_,_Z_,_CX_,_CY_,_CZ_,_R_) ( INSIDE_1D(_X_,_CX_,_R_) && INSIDE_1D(_Y_,_CY_,_R_) && INSIDE_1D(_Z_,_CZ_,_R_) )  #define INSIDE_3D(_X_,_Y_,_Z_,_CX_,_CY_,_CZ_,_R_) ( INSIDE_1D(_X_,_CX_,_R_) && INSIDE_1D(_Y_,_CY_,_R_) && INSIDE_1D(_Z_,_CZ_,_R_) )
96    
97      int ret;      int ret;
98      if ( (type == Rec9) || (type == Rec9Macro) ) {      if ( type == Line3Macro ) {
99            if (q==0)
100                ret = INSIDE_1D(coords[idx],0.25,0.25);
101            else if (q==1)
102                ret = INSIDE_1D(coords[idx],0.75,0.25);
103            else
104                ret=1;
105        } else if ( (type == Rec9) || (type == Rec9Macro) ) {
106          if (q==0)          if (q==0)
107              ret = INSIDE_2D(coords[2*idx], coords[2*idx+1], 0.25, 0.25, 0.25);              ret = INSIDE_2D(coords[2*idx], coords[2*idx+1], 0.25, 0.25, 0.25);
108          else if (q==1)          else if (q==1)
# Line 186  void Finley_Mesh_saveVTK(const char *fil Line 193  void Finley_Mesh_saveVTK(const char *fil
193      char *tags_End_Offset_and_Start_Type = "</DataArray>\n<DataArray Name=\"types\" type=\"UInt8\" format=\"ascii\">\n";      char *tags_End_Offset_and_Start_Type = "</DataArray>\n<DataArray Name=\"types\" type=\"UInt8\" format=\"ascii\">\n";
194      char *tag_End_DataArray = "</DataArray>\n";      char *tag_End_DataArray = "</DataArray>\n";
195    
196        const int VTK_LINE3_INDEX[] =
197          { 0, 2,
198            2, 1 };
199      const int VTK_HEX20_INDEX[] =      const int VTK_HEX20_INDEX[] =
200        { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19, 12, 13, 14, 15 };        { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19, 12, 13, 14, 15 };
201      const int VTK_REC9_INDEX[] =      const int VTK_REC9_INDEX[] =
# Line 411  void Finley_Mesh_saveVTK(const char *fil Line 421  void Finley_Mesh_saveVTK(const char *fil
421                      numVTKNodesPerElement = 2;                      numVTKNodesPerElement = 2;
422                  break;                  break;
423    
424            case Line3Macro:
425                        cellType = VTK_LINE;
426                        numCellFactor = 2;
427                        numVTKNodesPerElement = 2;
428                    break;
429    
430                  case Tri3:                  case Tri3:
431                  case Tet4Face:                  case Tet4Face:
432                  case Tet4Face_Contact:                  case Tet4Face_Contact:
# Line 444  void Finley_Mesh_saveVTK(const char *fil Line 460  void Finley_Mesh_saveVTK(const char *fil
460                  break;                  break;
461    
462                  case Line3:                  case Line3:
                 case Line3Macro:  
463                  case Tri6Face:                  case Tri6Face:
464                  case Rec8Face:                  case Rec8Face:
465                  case Line3_Contact:                  case Line3_Contact:
# Line 463  void Finley_Mesh_saveVTK(const char *fil Line 478  void Finley_Mesh_saveVTK(const char *fil
478                      numVTKNodesPerElement = 6;                      numVTKNodesPerElement = 6;
479                  break;                  break;
480    
481    
482                  case Rec8:                  case Rec8:
483                  case Hex20Face:                  case Hex20Face:
484                  case Rec8_Contact:                  case Rec8_Contact:
# Line 519  void Finley_Mesh_saveVTK(const char *fil Line 535  void Finley_Mesh_saveVTK(const char *fil
535          const index_t *nodeIndex;          const index_t *nodeIndex;
536          if (FINLEY_REDUCED_NODES == nodeType) {          if (FINLEY_REDUCED_NODES == nodeType) {
537              nodeIndex = elements->referenceElementSet->referenceElement->Type->linearNodes;              nodeIndex = elements->referenceElementSet->referenceElement->Type->linearNodes;
538            } else if (Line3Macro == typeId) {
539                 nodeIndex = VTK_LINE3_INDEX;
540          } else if ( (Rec9 == typeId) || (Rec9Macro == typeId) ) {          } else if ( (Rec9 == typeId) || (Rec9Macro == typeId) ) {
541              nodeIndex = VTK_REC9_INDEX;              nodeIndex = VTK_REC9_INDEX;
542          } else if (Hex20 == typeId) {          } else if (Hex20 == typeId) {

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

  ViewVC Help
Powered by ViewVC 1.1.26