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

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

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

revision 1030 by phornby, Wed Mar 14 05:14:44 2007 UTC revision 1062 by gross, Mon Mar 26 06:17:53 2007 UTC
# Line 26  Line 26 
26    
27    
28  #include "Mesh.h"  #include "Mesh.h"
29    #include "Assemble.h"
30  #include "vtkCellType.h"  /* copied from vtk source directory !!! */  #include "vtkCellType.h"  /* copied from vtk source directory !!! */
31    
32  /*  /*
# Line 201  void Finley_Mesh_saveVTK_MPIO(const char Line 202  void Finley_Mesh_saveVTK_MPIO(const char
202          isCellCentered[i_data]=FALSE;          isCellCentered[i_data]=FALSE;
203          break;          break;
204        case FINLEY_ELEMENTS:        case FINLEY_ELEMENTS:
205          case FINLEY_REDUCED_ELEMENTS:
206          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;
207          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_ELEMENTS)          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_ELEMENTS)
208          {          {
# Line 214  void Finley_Mesh_saveVTK_MPIO(const char Line 216  void Finley_Mesh_saveVTK_MPIO(const char
216          isCellCentered[i_data]=TRUE;          isCellCentered[i_data]=TRUE;
217          break;          break;
218        case FINLEY_FACE_ELEMENTS:        case FINLEY_FACE_ELEMENTS:
219          case FINLEY_REDUCED_FACE_ELEMENTS:
220          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;
221          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_FACE_ELEMENTS)          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_FACE_ELEMENTS)
222          {          {
# Line 242  void Finley_Mesh_saveVTK_MPIO(const char Line 245  void Finley_Mesh_saveVTK_MPIO(const char
245          isCellCentered[i_data]=TRUE;          isCellCentered[i_data]=TRUE;
246          break;          break;
247        case FINLEY_CONTACT_ELEMENTS_1:        case FINLEY_CONTACT_ELEMENTS_1:
248          case FINLEY_REDUCED_CONTACT_ELEMENTS_1:
249          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;
250          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1)          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1)
251          {          {
# Line 256  void Finley_Mesh_saveVTK_MPIO(const char Line 260  void Finley_Mesh_saveVTK_MPIO(const char
260          isCellCentered[i_data]=TRUE;          isCellCentered[i_data]=TRUE;
261          break;          break;
262        case FINLEY_CONTACT_ELEMENTS_2:        case FINLEY_CONTACT_ELEMENTS_2:
263          case FINLEY_REDUCED_CONTACT_ELEMENTS_2:
264          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;
265          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1)          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1)
266          {          {
# Line 332  void Finley_Mesh_saveVTK_MPIO(const char Line 337  void Finley_Mesh_saveVTK_MPIO(const char
337    numInternalCells = elements->elementDistribution->numInternal;    numInternalCells = elements->elementDistribution->numInternal;
338    numBoundaryCells = elements->elementDistribution->numBoundary;    numBoundaryCells = elements->elementDistribution->numBoundary;
339    
340    if (nodetype==FINLEY_REDUCED_DEGREES_OF_FREEDOM)    if (nodetype==FINLEY_REDUCED_DEGREES_OF_FREEDOM || nodetype==FINLEY_REDUCED_NODES)
341    {    {
342      TypeId = elements->LinearReferenceElement->Type->TypeId;      TypeId = elements->LinearReferenceElement->Type->TypeId;
343    }    }
# Line 1013  void Finley_Mesh_saveVTK_MPIO(const char Line 1018  void Finley_Mesh_saveVTK_MPIO(const char
1018      {      {
1019        if (! isEmpty(data_pp[i_data]) && !isCellCentered[i_data])        if (! isEmpty(data_pp[i_data]) && !isCellCentered[i_data])
1020        {        {
1021          numPointsPerSample = elements->ReferenceElement->numQuadNodes;          if (Finley_Assemble_reducedIntegrationOrder(data_pp[i_data])) {
1022               numPointsPerSample=elements->ReferenceElementReducedOrder->numQuadNodes;
1023            } else {
1024               numPointsPerSample=elements->ReferenceElement->numQuadNodes;
1025            }
1026          rank = getDataPointRank(data_pp[i_data]);          rank = getDataPointRank(data_pp[i_data]);
1027          nComp = getDataPointSize(data_pp[i_data]);          nComp = getDataPointSize(data_pp[i_data]);
1028          nCompReqd=1;   // the number of components required by vtk          nCompReqd=1;   // the number of components required by vtk
# Line 1290  void Finley_Mesh_saveVTK(const char * fi Line 1299  void Finley_Mesh_saveVTK(const char * fi
1299          isCellCentered[i_data]=FALSE;          isCellCentered[i_data]=FALSE;
1300          break;          break;
1301        case FINLEY_ELEMENTS:        case FINLEY_ELEMENTS:
1302          case FINLEY_REDUCED_ELEMENTS:
1303          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;
1304          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_ELEMENTS)          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_ELEMENTS)
1305          {          {
# Line 1305  void Finley_Mesh_saveVTK(const char * fi Line 1315  void Finley_Mesh_saveVTK(const char * fi
1315          isCellCentered[i_data]=TRUE;          isCellCentered[i_data]=TRUE;
1316          break;          break;
1317        case FINLEY_FACE_ELEMENTS:        case FINLEY_FACE_ELEMENTS:
1318          case FINLEY_REDUCED_FACE_ELEMENTS:
1319          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;
1320          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_FACE_ELEMENTS)          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_FACE_ELEMENTS)
1321          {          {
# Line 1335  void Finley_Mesh_saveVTK(const char * fi Line 1346  void Finley_Mesh_saveVTK(const char * fi
1346          isCellCentered[i_data]=TRUE;          isCellCentered[i_data]=TRUE;
1347          break;          break;
1348        case FINLEY_CONTACT_ELEMENTS_1:        case FINLEY_CONTACT_ELEMENTS_1:
1349          case FINLEY_REDUCED_CONTACT_ELEMENTS_1:
1350          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;
1351          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1)          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1)
1352          {          {
# Line 1350  void Finley_Mesh_saveVTK(const char * fi Line 1362  void Finley_Mesh_saveVTK(const char * fi
1362          isCellCentered[i_data]=TRUE;          isCellCentered[i_data]=TRUE;
1363          break;          break;
1364        case FINLEY_CONTACT_ELEMENTS_2:        case FINLEY_CONTACT_ELEMENTS_2:
1365          case FINLEY_REDUCED_CONTACT_ELEMENTS_2:
1366          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;
1367          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1)          if (elementtype==FINLEY_UNKNOWN || elementtype==FINLEY_CONTACT_ELEMENTS_1)
1368          {          {
# Line 1706  void Finley_Mesh_saveVTK(const char * fi Line 1719  void Finley_Mesh_saveVTK(const char * fi
1719      {      {
1720        if (! isEmpty(data_pp[i_data]) && isCellCentered[i_data])        if (! isEmpty(data_pp[i_data]) && isCellCentered[i_data])
1721        {        {
1722          numPointsPerSample = elements->ReferenceElement->numQuadNodes;          if (Finley_Assemble_reducedIntegrationOrder(data_pp[i_data])) {
1723               numPointsPerSample=elements->ReferenceElementReducedOrder->numQuadNodes;
1724            } else {
1725               numPointsPerSample=elements->ReferenceElement->numQuadNodes;
1726            }
1727          rank = getDataPointRank(data_pp[i_data]);          rank = getDataPointRank(data_pp[i_data]);
1728          nComp = getDataPointSize(data_pp[i_data]);          nComp = getDataPointSize(data_pp[i_data]);
1729          nCompReqd=1;   /* the number of components required by vtk */          nCompReqd=1;   /* the number of components required by vtk */
# Line 1847  void Finley_Mesh_saveVTK(const char * fi Line 1864  void Finley_Mesh_saveVTK(const char * fi
1864      {      {
1865        if (! isEmpty(data_pp[i_data]) && !isCellCentered[i_data])        if (! isEmpty(data_pp[i_data]) && !isCellCentered[i_data])
1866        {        {
1867          numPointsPerSample = elements->ReferenceElement->numQuadNodes;          if (Finley_Assemble_reducedIntegrationOrder(data_pp[i_data])) {
1868               numPointsPerSample=elements->ReferenceElementReducedOrder->numQuadNodes;
1869            } else {
1870               numPointsPerSample=elements->ReferenceElement->numQuadNodes;
1871            }
1872          rank = getDataPointRank(data_pp[i_data]);          rank = getDataPointRank(data_pp[i_data]);
1873          nComp = getDataPointSize(data_pp[i_data]);          nComp = getDataPointSize(data_pp[i_data]);
1874          nCompReqd=1;   /* the number of components required by vtk */          nCompReqd=1;   /* the number of components required by vtk */

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

  ViewVC Help
Powered by ViewVC 1.1.26