VMTK
Loading...
Searching...
No Matches
vtkvmtkFDNEUTReader Class Reference

Reads FDNEUT Fidap files. More...

#include <vtkvmtkFDNEUTReader.h>

Inheritance diagram for vtkvmtkFDNEUTReader:
[legend]
Collaboration diagram for vtkvmtkFDNEUTReader:
[legend]

Public Types

enum  {
  EDGE = 0 , QUADRILATERAL , TRIANGLE , BRICK ,
  WEDGE , TETRAHEDRON
}
typedef vtkUnstructuredGridReader Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkFDNEUTReader * NewInstance () const
void PrintSelf (std::ostream &os, vtkIndent indent) override
int ReadMeshSimple (const std::string &fname, vtkDataObject *output) override
virtual void SetSingleCellDataEntityArrayName (const char *)
virtual char * GetSingleCellDataEntityArrayName ()
virtual void SetGhostNodes (int)
virtual int GetGhostNodes ()
virtual void GhostNodesOn ()
virtual void GhostNodesOff ()
virtual void SetVolumeElementsOnly (int)
virtual int GetVolumeElementsOnly ()
virtual void VolumeElementsOnlyOn ()
virtual void VolumeElementsOnlyOff ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkvmtkFDNEUTReader * SafeDownCast (vtkObjectBase *o)
static vtkvmtkFDNEUTReader * New ()

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkFDNEUTReader ()
 ~vtkvmtkFDNEUTReader ()

Static Protected Member Functions

static void OneToZeroOffset (int npts, int *pts)

Protected Attributes

char * SingleCellDataEntityArrayName
int GhostNodes
int VolumeElementsOnly

Detailed Description

Reads FDNEUT Fidap files.

vtkvmtkFDNEUTReader reads unstructured grid data from Fidap FDNEUT format

See also
vtkvmtkFDNEUTWriter

Definition at line 40 of file vtkvmtkFDNEUTReader.h.

Member Typedef Documentation

◆ Superclass

typedef vtkUnstructuredGridReader vtkvmtkFDNEUTReader::Superclass

Definition at line 43 of file vtkvmtkFDNEUTReader.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
EDGE 
QUADRILATERAL 
TRIANGLE 
BRICK 
WEDGE 
TETRAHEDRON 

Definition at line 87 of file vtkvmtkFDNEUTReader.h.

Constructor & Destructor Documentation

◆ vtkvmtkFDNEUTReader()

vtkvmtkFDNEUTReader::vtkvmtkFDNEUTReader ( )
protected

Definition at line 40 of file vtkvmtkFDNEUTReader.cxx.

◆ ~vtkvmtkFDNEUTReader()

vtkvmtkFDNEUTReader::~vtkvmtkFDNEUTReader ( )
protected

Definition at line 47 of file vtkvmtkFDNEUTReader.cxx.

48{
50 {
51 delete[] this->SingleCellDataEntityArrayName;
53 }
54}

Member Function Documentation

◆ IsTypeOf()

int vtkvmtkFDNEUTReader::IsTypeOf ( const char * type)
static

◆ IsA()

virtual int vtkvmtkFDNEUTReader::IsA ( const char * type)
virtual

◆ SafeDownCast()

vtkvmtkFDNEUTReader * vtkvmtkFDNEUTReader::SafeDownCast ( vtkObjectBase * o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkFDNEUTReader::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkFDNEUTReader * vtkvmtkFDNEUTReader::NewInstance ( ) const

◆ PrintSelf()

void vtkvmtkFDNEUTReader::PrintSelf ( std::ostream & os,
vtkIndent indent )
override

Definition at line 480 of file vtkvmtkFDNEUTReader.cxx.

481{
482 Superclass::PrintSelf(os,indent);
483}

◆ New()

vtkvmtkFDNEUTReader * vtkvmtkFDNEUTReader::New ( )
static

◆ SetSingleCellDataEntityArrayName()

virtual void vtkvmtkFDNEUTReader::SetSingleCellDataEntityArrayName ( const char * )
virtual

Set/get the name of the cell data array where a per-element-group entity id is stored. Each FDNEUT "ELEMENT GROUPS" block encountered while reading is assigned an increasing integer id (starting at 0, in file order), and every cell belonging to that group is tagged with it in this array. Commonly named "CellEntityIds".

◆ GetSingleCellDataEntityArrayName()

virtual char * vtkvmtkFDNEUTReader::GetSingleCellDataEntityArrayName ( )
virtual

Set/get the name of the cell data array where a per-element-group entity id is stored. Each FDNEUT "ELEMENT GROUPS" block encountered while reading is assigned an increasing integer id (starting at 0, in file order), and every cell belonging to that group is tagged with it in this array. Commonly named "CellEntityIds".

◆ SetGhostNodes()

virtual void vtkvmtkFDNEUTReader::SetGhostNodes ( int )
virtual

Set/get whether the extra "ghost" (mid-face/mid-volume) nodes present in some higher-order FDNEUT element types (e.g. the 9th node of a biquadratic quad, or the 27th node of a triquadratic hexahedron) are kept when building the output cells. When off, those extra nodes are discarded (read from the file but not stored) and the corresponding VTK quadratic (not biquadratic) cell type is produced instead. Default: on.

◆ GetGhostNodes()

virtual int vtkvmtkFDNEUTReader::GetGhostNodes ( )
virtual

Set/get whether the extra "ghost" (mid-face/mid-volume) nodes present in some higher-order FDNEUT element types (e.g. the 9th node of a biquadratic quad, or the 27th node of a triquadratic hexahedron) are kept when building the output cells. When off, those extra nodes are discarded (read from the file but not stored) and the corresponding VTK quadratic (not biquadratic) cell type is produced instead. Default: on.

◆ GhostNodesOn()

virtual void vtkvmtkFDNEUTReader::GhostNodesOn ( )
virtual

Set/get whether the extra "ghost" (mid-face/mid-volume) nodes present in some higher-order FDNEUT element types (e.g. the 9th node of a biquadratic quad, or the 27th node of a triquadratic hexahedron) are kept when building the output cells. When off, those extra nodes are discarded (read from the file but not stored) and the corresponding VTK quadratic (not biquadratic) cell type is produced instead. Default: on.

◆ GhostNodesOff()

virtual void vtkvmtkFDNEUTReader::GhostNodesOff ( )
virtual

Set/get whether the extra "ghost" (mid-face/mid-volume) nodes present in some higher-order FDNEUT element types (e.g. the 9th node of a biquadratic quad, or the 27th node of a triquadratic hexahedron) are kept when building the output cells. When off, those extra nodes are discarded (read from the file but not stored) and the corresponding VTK quadratic (not biquadratic) cell type is produced instead. Default: on.

◆ SetVolumeElementsOnly()

virtual void vtkvmtkFDNEUTReader::SetVolumeElementsOnly ( int )
virtual

Set/get whether only volume elements (bricks, wedges, tetrahedra) are read, skipping surface elements (quadrilaterals, triangles) found in the file. Default: off (both volume and surface elements are read).

◆ GetVolumeElementsOnly()

virtual int vtkvmtkFDNEUTReader::GetVolumeElementsOnly ( )
virtual

Set/get whether only volume elements (bricks, wedges, tetrahedra) are read, skipping surface elements (quadrilaterals, triangles) found in the file. Default: off (both volume and surface elements are read).

◆ VolumeElementsOnlyOn()

virtual void vtkvmtkFDNEUTReader::VolumeElementsOnlyOn ( )
virtual

Set/get whether only volume elements (bricks, wedges, tetrahedra) are read, skipping surface elements (quadrilaterals, triangles) found in the file. Default: off (both volume and surface elements are read).

◆ VolumeElementsOnlyOff()

virtual void vtkvmtkFDNEUTReader::VolumeElementsOnlyOff ( )
virtual

Set/get whether only volume elements (bricks, wedges, tetrahedra) are read, skipping surface elements (quadrilaterals, triangles) found in the file. Default: off (both volume and surface elements are read).

◆ ReadMeshSimple()

int vtkvmtkFDNEUTReader::ReadMeshSimple ( const std::string & fname,
vtkDataObject * output )
override

Definition at line 56 of file vtkvmtkFDNEUTReader.cxx.

58{
59
60 vtkDebugMacro(<<"Reading FDNEUT file...");
61
62 vtkUnstructuredGrid* output = vtkUnstructuredGrid::SafeDownCast(doOutput);
63
64 if(fname.empty())
65 {
66 vtkErrorMacro(<<"Input filename not set");
67 return 1;
68 }
69
70 FILE* FDNEUTFile;
71 FDNEUTFile = fopen(fname.c_str(),"r");
72 // std::ifstream ifs( fname, std::ifstream::in );
73 if(!FDNEUTFile)
74 {
75 vtkErrorMacro(<<"Unable to open " << fname << " for reading");
76 return 1;
77 }
78
79 char buffer[1024];
80 int ret;
81 do
82 {
83 ret = fscanf(FDNEUTFile, "%s", buffer);
84 while (fgetc(FDNEUTFile) != '\n');
85 }
86 while (strncmp(buffer,"NODAL",5)!=0);
87 // while (fgetc(FDNEUTFile) != '\n');
88
89 int pointId;
90 float point[3], doublePoint[3];
91
92 vtkPoints* points = vtkPoints::New();
93
94 while(fscanf(FDNEUTFile, "%d", &pointId))
95 {
96 ret = fscanf(FDNEUTFile, "%f", &point[0]);
97 ret = fscanf(FDNEUTFile, "%f", &point[1]);
98 ret = fscanf(FDNEUTFile, "%f", &point[2]);
99 while (fgetc(FDNEUTFile) != '\n');
100
101 doublePoint[0] = point[0];
102 doublePoint[1] = point[1];
103 doublePoint[2] = point[2];
104
105 points->InsertPoint(pointId-1,doublePoint);
106 }
107
108 int cellId, i;
109 int nodesPerElement, geometry, fdneutType;
110
111 vtkCellArray* gridCellArray = vtkCellArray::New();
112
113 int entityCounter = 0;
114 vtkUnsignedCharArray* singleEntityArray;
115 singleEntityArray = vtkUnsignedCharArray::New();
116 singleEntityArray->SetName(this->SingleCellDataEntityArrayName);
117 output->GetCellData()->AddArray(singleEntityArray);
118
119 vtkIntArray* typesArray = vtkIntArray::New();
120 while (fscanf(FDNEUTFile, "%s", buffer)!=EOF)
121 {
122 while (strncmp(buffer,"NODES:",6)!=0)
123 ret = fscanf(FDNEUTFile, "%s", buffer);
124 ret = fscanf(FDNEUTFile, "%d", &nodesPerElement);
125 while (strncmp(buffer,"GEOMETRY:",9)!=0)
126 ret = fscanf(FDNEUTFile, "%s", buffer);
127 ret = fscanf(FDNEUTFile, "%d", &geometry);
128 while (strncmp(buffer,"TYPE:",5)!=0)
129 ret = fscanf(FDNEUTFile, "%s", buffer);
130 ret = fscanf(FDNEUTFile, "%d", &fdneutType);
131
132 while (fgetc(FDNEUTFile) != '\n');
133 ret = fscanf(FDNEUTFile, "%s", buffer);
134 ret = fscanf(FDNEUTFile, "%s", buffer);
135
136 char currentEntityName[256];
137 ret = fscanf(FDNEUTFile, "%s", currentEntityName);
138 while (fgetc(FDNEUTFile) != '\n');
139
140 int type = -1;
141 int pointBuffer;
142 vtkIdType numberOfCellPoints = 0;
143#if 0
144 vtkUnsignedCharArray* entityArray = NULL;
145 entityArray = vtkUnsignedCharArray::New();
146 entityArray->SetName(currentEntityName);
147 output->GetCellData()->AddArray(entityArray);
148#endif
149 while(fscanf(FDNEUTFile, "%d", &cellId)>0)
150 {
151 int* cellPoints = NULL;
152 bool invalid = false;
153 switch (geometry)
154 {
155 case QUADRILATERAL:
156 if (this->VolumeElementsOnly)
157 {
158 continue;
159 }
160 if (nodesPerElement==4)
161 {
162 type = VTK_QUAD;
163 numberOfCellPoints = this->GhostNodes ? nodesPerElement : 4;
164 cellPoints = new int[numberOfCellPoints];
165 for (i=0; i<nodesPerElement; i++)
166 {
167 ret = fscanf(FDNEUTFile, "%d", &cellPoints[i]);
168 }
169 }
170 else if ((nodesPerElement==8) || (nodesPerElement==9))
171 {
172 type = VTK_QUADRATIC_QUAD;
173 numberOfCellPoints = this->GhostNodes ? nodesPerElement : 8;
174 cellPoints = new int[numberOfCellPoints];
175 ret = fscanf(FDNEUTFile, "%d", &cellPoints[0]);
176 ret = fscanf(FDNEUTFile, "%d", &cellPoints[4]);
177 ret = fscanf(FDNEUTFile, "%d", &cellPoints[1]);
178 ret = fscanf(FDNEUTFile, "%d", &cellPoints[5]);
179 ret = fscanf(FDNEUTFile, "%d", &cellPoints[2]);
180 ret = fscanf(FDNEUTFile, "%d", &cellPoints[6]);
181 ret = fscanf(FDNEUTFile, "%d", &cellPoints[3]);
182 ret = fscanf(FDNEUTFile, "%d", &cellPoints[7]);
183 if (nodesPerElement==9)
184 {
185 if (this->GhostNodes)
186 {
187 ret = fscanf(FDNEUTFile, "%d",&cellPoints[8]);
188 }
189 else
190 {
191 ret = fscanf(FDNEUTFile, "%d",&pointBuffer);
192 }
193 }
194 }
195 break;
196 case TRIANGLE:
197 if (this->VolumeElementsOnly)
198 {
199 continue;
200 }
201 if (nodesPerElement==3)
202 {
203 type = VTK_TRIANGLE;
204 numberOfCellPoints = this->GhostNodes ? nodesPerElement : 3;
205 cellPoints = new int[numberOfCellPoints];
206 for (i=0; i<nodesPerElement; i++)
207 {
208 ret = fscanf(FDNEUTFile, "%d", &cellPoints[i]);
209 }
210 }
211 else if ((nodesPerElement==6) || (nodesPerElement==7))
212 {
213 type = VTK_QUADRATIC_TRIANGLE;
214 numberOfCellPoints = this->GhostNodes ? nodesPerElement : 6;
215 cellPoints = new int[numberOfCellPoints];
216 ret = fscanf(FDNEUTFile, "%d", &cellPoints[0]);
217 ret = fscanf(FDNEUTFile, "%d", &cellPoints[3]);
218 ret = fscanf(FDNEUTFile, "%d", &cellPoints[1]);
219 ret = fscanf(FDNEUTFile, "%d", &cellPoints[4]);
220 ret = fscanf(FDNEUTFile, "%d", &cellPoints[2]);
221 ret = fscanf(FDNEUTFile, "%d", &cellPoints[5]);
222
223 if (nodesPerElement==7)
224 {
225 if (this->GhostNodes)
226 {
227 ret = fscanf(FDNEUTFile, "%d",&cellPoints[6]);
228 }
229 else
230 {
231 ret = fscanf(FDNEUTFile, "%d",&pointBuffer);
232 }
233 }
234 }
235 break;
236 case BRICK:
237 if (nodesPerElement==8)
238 {
239 type = VTK_HEXAHEDRON;
240 numberOfCellPoints = this->GhostNodes ? nodesPerElement : 8;
241 cellPoints = new int[numberOfCellPoints];
242 ret = fscanf(FDNEUTFile, "%d", &cellPoints[0]);
243 ret = fscanf(FDNEUTFile, "%d", &cellPoints[1]);
244 ret = fscanf(FDNEUTFile, "%d", &cellPoints[3]);
245 ret = fscanf(FDNEUTFile, "%d", &cellPoints[2]);
246 ret = fscanf(FDNEUTFile, "%d", &cellPoints[4]);
247 ret = fscanf(FDNEUTFile, "%d", &cellPoints[5]);
248 ret = fscanf(FDNEUTFile, "%d", &cellPoints[7]);
249 ret = fscanf(FDNEUTFile, "%d", &cellPoints[6]);
250 }
251 else if (nodesPerElement==27)
252 {
253 type = VTK_QUADRATIC_HEXAHEDRON;
254 numberOfCellPoints = this->GhostNodes ? nodesPerElement : 20;
255 cellPoints = new int[numberOfCellPoints];
256 ret = fscanf(FDNEUTFile, "%d", &cellPoints[0]);
257 ret = fscanf(FDNEUTFile, "%d", &cellPoints[8]);
258 ret = fscanf(FDNEUTFile, "%d", &cellPoints[1]);
259
260 ret = fscanf(FDNEUTFile, "%d", &cellPoints[11]);
261 if (this->GhostNodes)
262 {
263 ret = fscanf(FDNEUTFile, "%d", &cellPoints[24]);
264 }
265 else
266 {
267 ret = fscanf(FDNEUTFile, "%d", &pointBuffer);
268 }
269 ret = fscanf(FDNEUTFile, "%d", &cellPoints[9]);
270
271 ret = fscanf(FDNEUTFile, "%d", &cellPoints[3]);
272 ret = fscanf(FDNEUTFile, "%d", &cellPoints[10]);
273 ret = fscanf(FDNEUTFile, "%d", &cellPoints[2]);
274
275 ret = fscanf(FDNEUTFile, "%d", &cellPoints[16]);
276 if (this->GhostNodes)
277 {
278 ret = fscanf(FDNEUTFile, "%d", &cellPoints[20]);
279 }
280 else
281 {
282 ret = fscanf(FDNEUTFile, "%d", &pointBuffer);
283 }
284 ret = fscanf(FDNEUTFile, "%d", &cellPoints[17]);
285
286 if (this->GhostNodes)
287 {
288 ret = fscanf(FDNEUTFile, "%d", &cellPoints[23]);
289 ret = fscanf(FDNEUTFile, "%d", &cellPoints[26]);
290 ret = fscanf(FDNEUTFile, "%d", &cellPoints[21]);
291 }
292 else
293 {
294 ret = fscanf(FDNEUTFile, "%d", &pointBuffer);
295 ret = fscanf(FDNEUTFile, "%d", &pointBuffer);
296 ret = fscanf(FDNEUTFile, "%d", &pointBuffer);
297 }
298
299 ret = fscanf(FDNEUTFile, "%d",&cellPoints[19]);
300 if (this->GhostNodes)
301 {
302 ret = fscanf(FDNEUTFile, "%d", &cellPoints[22]);
303 }
304 else
305 {
306 ret = fscanf(FDNEUTFile, "%d", &pointBuffer);
307 }
308 ret = fscanf(FDNEUTFile, "%d",&cellPoints[18]);
309
310 ret = fscanf(FDNEUTFile, "%d",&cellPoints[4]);
311 ret = fscanf(FDNEUTFile, "%d",&cellPoints[12]);
312 ret = fscanf(FDNEUTFile, "%d",&cellPoints[5]);
313
314 ret = fscanf(FDNEUTFile, "%d",&cellPoints[15]);
315 if (this->GhostNodes)
316 {
317 ret = fscanf(FDNEUTFile, "%d", &cellPoints[25]);
318 }
319 else
320 {
321 ret = fscanf(FDNEUTFile, "%d", &pointBuffer);
322 }
323 ret = fscanf(FDNEUTFile, "%d",&cellPoints[13]);
324
325 ret = fscanf(FDNEUTFile, "%d",&cellPoints[7]);
326 ret = fscanf(FDNEUTFile, "%d",&cellPoints[14]);
327 ret = fscanf(FDNEUTFile, "%d",&cellPoints[6]);
328 }
329 break;
330 case TETRAHEDRON:
331 if (nodesPerElement==4)
332 {
333 type = VTK_TETRA;
334 numberOfCellPoints = this->GhostNodes ? nodesPerElement : 4;
335 cellPoints = new int[numberOfCellPoints];
336 for (i=0; i<nodesPerElement; i++)
337 {
338 ret = fscanf(FDNEUTFile, "%d", &cellPoints[i]);
339 }
340 }
341 else if (nodesPerElement==10)
342 {
343 type = VTK_QUADRATIC_TETRA;
344 numberOfCellPoints = this->GhostNodes ? nodesPerElement : 10;
345 cellPoints = new int[numberOfCellPoints];
346 ret = fscanf(FDNEUTFile, "%d", &cellPoints[0]);
347 ret = fscanf(FDNEUTFile, "%d", &cellPoints[4]);
348 ret = fscanf(FDNEUTFile, "%d", &cellPoints[1]);
349 ret = fscanf(FDNEUTFile, "%d", &cellPoints[6]);
350 ret = fscanf(FDNEUTFile, "%d", &cellPoints[5]);
351 ret = fscanf(FDNEUTFile, "%d", &cellPoints[2]);
352 ret = fscanf(FDNEUTFile, "%d", &cellPoints[7]);
353 ret = fscanf(FDNEUTFile, "%d", &cellPoints[8]);
354 ret = fscanf(FDNEUTFile, "%d", &cellPoints[9]);
355 ret = fscanf(FDNEUTFile, "%d", &cellPoints[3]);
356 }
357 break;
358 case WEDGE:
359 if (nodesPerElement==6)
360 {
361 type = VTK_WEDGE;
362 numberOfCellPoints = this->GhostNodes ? nodesPerElement : 6;
363 cellPoints = new int[numberOfCellPoints];
364 for (i=0; i<nodesPerElement; i++)
365 {
366 ret = fscanf(FDNEUTFile, "%d", &cellPoints[i]);
367 }
368 }
369 else if (nodesPerElement==18)
370 {
371 type = VTK_QUADRATIC_WEDGE;
372 numberOfCellPoints = this->GhostNodes ? nodesPerElement : 15;
373 cellPoints = new int[numberOfCellPoints];
374 ret = fscanf(FDNEUTFile, "%d", &cellPoints[0]);
375 ret = fscanf(FDNEUTFile, "%d", &cellPoints[6]);
376 ret = fscanf(FDNEUTFile, "%d", &cellPoints[1]);
377
378 ret = fscanf(FDNEUTFile, "%d", &cellPoints[8]);
379 ret = fscanf(FDNEUTFile, "%d", &cellPoints[7]);
380 ret = fscanf(FDNEUTFile, "%d", &cellPoints[2]);
381
382 ret = fscanf(FDNEUTFile, "%d", &cellPoints[12]);
383 if (this->GhostNodes)
384 {
385 ret = fscanf(FDNEUTFile, "%d", &cellPoints[15]);
386 }
387 else
388 {
389 ret = fscanf(FDNEUTFile, "%d", &pointBuffer);
390 }
391 ret = fscanf(FDNEUTFile, "%d", &cellPoints[13]);
392
393 if (this->GhostNodes)
394 {
395 ret = fscanf(FDNEUTFile, "%d", &cellPoints[16]);
396 ret = fscanf(FDNEUTFile, "%d", &cellPoints[17]);
397 }
398 else
399 {
400 ret = fscanf(FDNEUTFile, "%d", &pointBuffer);
401 ret = fscanf(FDNEUTFile, "%d", &pointBuffer);
402 }
403 ret = fscanf(FDNEUTFile, "%d", &cellPoints[14]);
404
405 ret = fscanf(FDNEUTFile, "%d", &cellPoints[3]);
406 ret = fscanf(FDNEUTFile, "%d", &cellPoints[9]);
407 ret = fscanf(FDNEUTFile, "%d", &cellPoints[4]);
408
409 ret = fscanf(FDNEUTFile, "%d",&cellPoints[11]);
410 ret = fscanf(FDNEUTFile, "%d",&cellPoints[10]);
411 ret = fscanf(FDNEUTFile, "%d",&cellPoints[5]);
412 }
413 else if (nodesPerElement==15)
414 {
415 type = VTK_QUADRATIC_WEDGE;
416 numberOfCellPoints = this->GhostNodes ? nodesPerElement : 15;
417 cellPoints = new int[numberOfCellPoints];
418 ret = fscanf(FDNEUTFile, "%d", &cellPoints[0]);
419 ret = fscanf(FDNEUTFile, "%d", &cellPoints[6]);
420 ret = fscanf(FDNEUTFile, "%d", &cellPoints[1]);
421
422 ret = fscanf(FDNEUTFile, "%d", &cellPoints[8]);
423 ret = fscanf(FDNEUTFile, "%d", &cellPoints[7]);
424 ret = fscanf(FDNEUTFile, "%d", &cellPoints[2]);
425
426 ret = fscanf(FDNEUTFile, "%d", &cellPoints[12]);
427 ret = fscanf(FDNEUTFile, "%d", &cellPoints[13]);
428 ret = fscanf(FDNEUTFile, "%d", &cellPoints[14]);
429
430 ret = fscanf(FDNEUTFile, "%d", &cellPoints[3]);
431 ret = fscanf(FDNEUTFile, "%d", &cellPoints[9]);
432 ret = fscanf(FDNEUTFile, "%d", &cellPoints[4]);
433
434 ret = fscanf(FDNEUTFile, "%d",&cellPoints[11]);
435 ret = fscanf(FDNEUTFile, "%d",&cellPoints[10]);
436 ret = fscanf(FDNEUTFile, "%d",&cellPoints[5]);
437 }
438 break;
439 default:
440 invalid = true;
441 }
442#if 0
443 entityArray->InsertValue(gridCellArray->GetNumberOfCells()-1,1);
444#endif
445 if (!invalid)
446 {
447 typesArray->InsertNextValue(type);
448 this->OneToZeroOffset(numberOfCellPoints,cellPoints);
449 vtkIdType* cellPointsIdType = new vtkIdType[numberOfCellPoints];
450 for (int i=0; i<numberOfCellPoints; i++)
451 {
452 cellPointsIdType[i] = cellPoints[i];
453 }
454 gridCellArray->InsertNextCell(numberOfCellPoints,cellPointsIdType);
455 delete[] cellPointsIdType;
456 singleEntityArray->InsertNextValue(entityCounter);
457 delete[] cellPoints;
458 }
459 }
460#if 0
461 entityArray->Delete();
462#endif
463 ++entityCounter;
464 }
465
466 singleEntityArray->Delete();
467
468 fclose(FDNEUTFile);
469
470 output->SetPoints(points);
471 output->SetCells(typesArray->GetPointer(0),gridCellArray);
472
473 points->Delete();
474 typesArray->Delete();
475 gridCellArray->Delete();
476
477 return 1;
478}
static void OneToZeroOffset(int npts, int *pts)

◆ OneToZeroOffset()

void vtkvmtkFDNEUTReader::OneToZeroOffset ( int npts,
int * pts )
inlinestaticprotected

Definition at line 102 of file vtkvmtkFDNEUTReader.h.

103 { for (int i=0; i<npts; i++) --pts[i]; }

Member Data Documentation

◆ SingleCellDataEntityArrayName

char* vtkvmtkFDNEUTReader::SingleCellDataEntityArrayName
protected

Definition at line 105 of file vtkvmtkFDNEUTReader.h.

◆ GhostNodes

int vtkvmtkFDNEUTReader::GhostNodes
protected

Definition at line 107 of file vtkvmtkFDNEUTReader.h.

◆ VolumeElementsOnly

int vtkvmtkFDNEUTReader::VolumeElementsOnly
protected

Definition at line 108 of file vtkvmtkFDNEUTReader.h.


The documentation for this class was generated from the following files: