-
Notifications
You must be signed in to change notification settings - Fork 1
/
vtk9-meshio.patch
150 lines (140 loc) · 4.46 KB
/
vtk9-meshio.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
--- libvtkfortran/vtkmeshio.cpp.orig 2020-04-28 11:02:30.203578000 +0100
+++ libvtkfortran/vtkmeshio.cpp 2020-04-28 11:02:49.059593890 +0100
@@ -48,6 +48,14 @@
#include "vtkmeshio.h"
+// deal with changes to GetCellPoints interface in vtk9
+#if VTK_MAJOR_VERSION >= 9
+#define GetCellPointer const vtkIdType
+#else
+#define GetCellPointer vtkIdType
+#endif
+
+
using namespace std;
void AddToFront(vtkIdType *front, vtkIdType i)
@@ -87,7 +95,7 @@
vtkIdType i,vtkIdList *fcpts)
{
vtkIdType npts;
- vtkIdType *pts;
+ GetCellPointer *pts;
int locpos[4];
int fcid=0,maxpos=0,d1=0,d2=0;
dataSet->GetCellPoints(i,npts,pts);
@@ -342,7 +350,7 @@
return (REAL) vol;
}
-int AddOneLine(vtkIdType *pts, int cellcnt, int *ENLBas, int *ENList,
+int AddOneLine(GetCellPointer *pts, int cellcnt, int *ENLBas, int *ENList,
REAL *X, REAL *Y, REAL *Z )
{
if( ENLBas != NULL && ENList != NULL ) {
@@ -354,7 +362,7 @@
return cellcnt+1;
}
-int AddOneAnything(vtkIdType *pts, int cellcnt, int *ENLBas, int *ENList,
+int AddOneAnything(GetCellPointer *pts, int cellcnt, int *ENLBas, int *ENList,
REAL *X, REAL *Y, REAL *Z, int nloc)
// general version only works for elements that don't need reordering
{
@@ -367,7 +375,7 @@
return cellcnt+1;
}
-int AddOneTri(vtkIdType *pts, int cellcnt, int *ENLBas, int *ENList,
+int AddOneTri(GetCellPointer *pts, int cellcnt, int *ENLBas, int *ENList,
REAL *X, REAL *Y, REAL *Z )
{
if( ENLBas != NULL && ENList != NULL ) {
@@ -379,7 +387,7 @@
return cellcnt+1;
}
-int AddOneQuad(vtkIdType *pts, int cellcnt, int *ENLBas, int *ENList,
+int AddOneQuad(GetCellPointer *pts, int cellcnt, int *ENLBas, int *ENList,
REAL *X, REAL *Y, REAL *Z )
{
if( ENLBas != NULL && ENList != NULL ) {
@@ -394,7 +402,7 @@
return cellcnt+1;
}
-int AddOneHexa(vtkIdType *pts, int cellcnt, int *ENLBas, int *ENList,
+int AddOneHexa(GetCellPointer *pts, int cellcnt, int *ENLBas, int *ENList,
REAL *X, REAL *Y, REAL *Z )
{
if( ENLBas != NULL && ENList != NULL ) {
@@ -411,7 +419,7 @@
return cellcnt+1;
}
-int AddOneWedge(vtkIdType *pts, int cellcnt, int *ENLBas, int *ENList,
+int AddOneWedge(GetCellPointer *pts, int cellcnt, int *ENLBas, int *ENList,
REAL *X, REAL *Y, REAL *Z )
{
if( ENLBas != NULL && ENList != NULL ) {
@@ -614,7 +622,7 @@
{
vtkIdType npts;
- vtkIdType *pts;
+ GetCellPointer *pts;
dataSet->GetCellPoints(0,npts,pts);
if(npts==8 && onlytets!=0) ntets = 6*ncells;
}
@@ -771,7 +779,7 @@
// printf("3D element types: TET=%d WEDGE=%d HEX=%d\n",VTK_TETRA,VTK_WEDGE,VTK_HEXAHEDRON);
for(vtkIdType i=0; i<ncells; i++) {
vtkIdType npts=0, ct;
- vtkIdType *pts;
+ GetCellPointer *pts;
ct = dataSet->GetCellType(i);
dataSet->GetCellPoints(i,npts,pts);
if( npts == 2 ) {
@@ -850,7 +858,7 @@
used[i] = 0;
for(vtkIdType i=0; i<ncells; i++) {
vtkIdType npts=0, ct;
- vtkIdType *pts;
+ GetCellPointer *pts;
ct = dataSet->GetCellType(i);
dataSet->GetCellPoints(i,npts,pts);
if( curdim == 1 ) {
@@ -886,11 +894,12 @@
// renumber the cell data
for(vtkIdType i=0; i<ncells; i++) {
vtkIdType npts;
- vtkIdType *pts;
+ GetCellPointer *pts;
+ vtkIdType upts[20];
dataSet->GetCellPoints(i,npts,pts);
for(vtkIdType j=0; j<npts; j++)
- pts[j] = used[pts[j]]-1;
- dataSet->ReplaceCell(i,npts,pts);
+ upts[j] = used[pts[j]]-1;
+ dataSet->ReplaceCell(i,npts,upts);
}
}
{
@@ -1001,7 +1010,7 @@
// printf("Counting allowable %dd cells...\n",*ndim);
for(vtkIdType i=0; i<ncells; i++){
vtkIdType npts;
- vtkIdType *pts;
+ GetCellPointer *pts;
dataSet->GetCellPoints(i,npts,pts);
if( curdim == 3 ) {
if( npts == 4 ) {
@@ -1051,7 +1060,7 @@
ENLBS[0] = 0;
for(vtkIdType i=0; i<ncells; i++){
vtkIdType npts;
- vtkIdType *pts;
+ GetCellPointer *pts;
dataSet->GetCellPoints(i,npts,pts);
if( curdim == 3 ) {
if( npts == 4 ) {
@@ -1135,7 +1144,7 @@
hexcut[k*6] = 0;
for(vtkIdType k=0; k<ncells; k++){
vtkIdType npts;
- vtkIdType *pts;
+ GetCellPointer *pts;
vtkIdType i = NextFrontCell(front);
dataSet->GetCellPoints(i,npts,pts);
assert(npts==8);