vtkPV3FoamMesh.C 15.3 KB
Newer Older
1
2
3
4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
5
    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
6
7
8
9
10
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

11
12
13
14
    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
15
16
17
18
19
20
21

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
22
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
23
24
25
26
27

\*---------------------------------------------------------------------------*/

#include "vtkPV3Foam.H"

28
// OpenFOAM includes
29
30
31
32
33
#include "cellSet.H"
#include "faceSet.H"
#include "pointSet.H"
#include "fvMeshSubset.H"
#include "vtkPV3FoamReader.h"
34
#include "uindirectPrimitivePatch.H"
35
36
37
38
39
40
41
42
43
44
45

// VTK includes
#include "vtkDataArraySelection.h"
#include "vtkMultiBlockDataSet.h"
#include "vtkPolyData.h"
#include "vtkUnstructuredGrid.h"

// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //

void Foam::vtkPV3Foam::convertMeshVolume
(
46
47
    vtkMultiBlockDataSet* output,
    int& blockNo
48
49
)
{
50
51
    arrayRange& range = arrayRangeVolume_;
    range.block(blockNo);      // set output block
Mark Olesen's avatar
Mark Olesen committed
52
53
54
55
    label datasetNo = 0;       // restart at dataset 0
    const fvMesh& mesh = *meshPtr_;

    // resize for decomposed polyhedra
56
    regionPolyDecomp_.setSize(range.size());
Mark Olesen's avatar
Mark Olesen committed
57

58
59
    if (debug)
    {
60
        Info<< "<beg> Foam::vtkPV3Foam::convertMeshVolume" << endl;
Mark Olesen's avatar
Mark Olesen committed
61
        printMemory();
62
63
    }

Mark Olesen's avatar
Mark Olesen committed
64
    // Convert the internalMesh
65
    // this looks like more than one part, but it isn't
66
    for (int partId = range.start(); partId < range.end(); ++partId)
Mark Olesen's avatar
Mark Olesen committed
67
68
    {
        const word partName = "internalMesh";
69

Mark Olesen's avatar
Mark Olesen committed
70
        if (!partStatus_[partId])
71
        {
Mark Olesen's avatar
Mark Olesen committed
72
            continue;
73
74
        }

Mark Olesen's avatar
Mark Olesen committed
75
76
77
        vtkUnstructuredGrid* vtkmesh = volumeVTKMesh
        (
            mesh,
Mark Olesen's avatar
Mark Olesen committed
78
            regionPolyDecomp_[datasetNo]
Mark Olesen's avatar
Mark Olesen committed
79
        );
80

Mark Olesen's avatar
Mark Olesen committed
81
82
        if (vtkmesh)
        {
83
            AddToBlock(output, vtkmesh, range, datasetNo, partName);
Mark Olesen's avatar
Mark Olesen committed
84
            vtkmesh->Delete();
85

Mark Olesen's avatar
Mark Olesen committed
86
            partDataset_[partId] = datasetNo++;
Mark Olesen's avatar
Mark Olesen committed
87
        }
88
89
    }

Mark Olesen's avatar
Mark Olesen committed
90
    // anything added?
Mark Olesen's avatar
Mark Olesen committed
91
    if (datasetNo)
92
93
    {
        ++blockNo;
94
    }
95
96
97
98

    if (debug)
    {
        Info<< "<end> Foam::vtkPV3Foam::convertMeshVolume" << endl;
Mark Olesen's avatar
Mark Olesen committed
99
        printMemory();
100
    }
101
102
103
104
105
}


void Foam::vtkPV3Foam::convertMeshLagrangian
(
106
107
    vtkMultiBlockDataSet* output,
    int& blockNo
108
109
)
{
110
111
    arrayRange& range = arrayRangeLagrangian_;
    range.block(blockNo);      // set output block
Mark Olesen's avatar
Mark Olesen committed
112
113
114
    label datasetNo = 0;       // restart at dataset 0
    const fvMesh& mesh = *meshPtr_;

115
116
    if (debug)
    {
117
        Info<< "<beg> Foam::vtkPV3Foam::convertMeshLagrangian" << endl;
Mark Olesen's avatar
Mark Olesen committed
118
        printMemory();
119
120
    }

121
    for (int partId = range.start(); partId < range.end(); ++partId)
Mark Olesen's avatar
Mark Olesen committed
122
123
124
125
    {
        const word cloudName = getPartName(partId);

        if (!partStatus_[partId])
126
127
128
129
        {
            continue;
        }

Mark Olesen's avatar
Mark Olesen committed
130
        vtkPolyData* vtkmesh = lagrangianVTKMesh(mesh, cloudName);
Mark Olesen's avatar
Mark Olesen committed
131

Mark Olesen's avatar
Mark Olesen committed
132
133
        if (vtkmesh)
        {
134
            AddToBlock(output, vtkmesh, range, datasetNo, cloudName);
Mark Olesen's avatar
Mark Olesen committed
135
            vtkmesh->Delete();
136

Mark Olesen's avatar
Mark Olesen committed
137
            partDataset_[partId] = datasetNo++;
Mark Olesen's avatar
Mark Olesen committed
138
        }
139
    }
140

Mark Olesen's avatar
Mark Olesen committed
141
    // anything added?
Mark Olesen's avatar
Mark Olesen committed
142
    if (datasetNo)
143
144
145
146
    {
        ++blockNo;
    }

147
148
149
    if (debug)
    {
        Info<< "<end> Foam::vtkPV3Foam::convertMeshLagrangian" << endl;
Mark Olesen's avatar
Mark Olesen committed
150
        printMemory();
151
    }
152
153
154
155
156
}


void Foam::vtkPV3Foam::convertMeshPatches
(
157
158
    vtkMultiBlockDataSet* output,
    int& blockNo
159
160
)
{
161
162
    arrayRange& range = arrayRangePatches_;
    range.block(blockNo);      // set output block
Mark Olesen's avatar
Mark Olesen committed
163
164
165
166
    label datasetNo = 0;       // restart at dataset 0
    const fvMesh& mesh = *meshPtr_;
    const polyBoundaryMesh& patches = mesh.boundaryMesh();

167
168
    if (debug)
    {
169
        Info<< "<beg> Foam::vtkPV3Foam::convertMeshPatches" << endl;
Mark Olesen's avatar
Mark Olesen committed
170
        printMemory();
171
172
    }

173
    for (int partId = range.start(); partId < range.end(); ++partId)
174
    {
175
        if (!partStatus_[partId])
176
        {
Mark Olesen's avatar
Mark Olesen committed
177
178
            continue;
        }
179

180
181
182
183
        const word patchName = getPartName(partId);

        labelHashSet patchIds(patches.patchSet(List<wordRe>(1, patchName)));

Mark Olesen's avatar
Mark Olesen committed
184
185
        if (debug)
        {
186
            Info<< "Creating VTK mesh for patches [" << patchIds <<"] "
Mark Olesen's avatar
Mark Olesen committed
187
188
                << patchName  << endl;
        }
189

190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
        vtkPolyData* vtkmesh = NULL;
        if (patchIds.size() == 1)
        {
            vtkmesh = patchVTKMesh(patchName, patches[patchIds.begin().key()]);
        }
        else
        {
            // Patch group. Collect patch faces.
            label sz = 0;
            forAllConstIter(labelHashSet, patchIds, iter)
            {
                sz += patches[iter.key()].size();
            }
            labelList meshFaceLabels(sz);
            sz = 0;
            forAllConstIter(labelHashSet, patchIds, iter)
            {
                const polyPatch& pp = patches[iter.key()];
                forAll(pp, i)
                {
                    meshFaceLabels[sz++] = pp.start()+i;
                }
            }
            UIndirectList<face> fcs(mesh.faces(), meshFaceLabels);
            uindirectPrimitivePatch pp(fcs, mesh.points());

            vtkmesh = patchVTKMesh(patchName, pp);
        }

219

Mark Olesen's avatar
Mark Olesen committed
220
221
        if (vtkmesh)
        {
222
            AddToBlock(output, vtkmesh, range, datasetNo, patchName);
Mark Olesen's avatar
Mark Olesen committed
223
            vtkmesh->Delete();
224

Mark Olesen's avatar
Mark Olesen committed
225
            partDataset_[partId] = datasetNo++;
226
227
        }
    }
228

Mark Olesen's avatar
Mark Olesen committed
229
    // anything added?
Mark Olesen's avatar
Mark Olesen committed
230
    if (datasetNo)
231
232
233
234
    {
        ++blockNo;
    }

235
236
237
    if (debug)
    {
        Info<< "<end> Foam::vtkPV3Foam::convertMeshPatches" << endl;
Mark Olesen's avatar
Mark Olesen committed
238
        printMemory();
239
    }
240
241
242
243
244
}


void Foam::vtkPV3Foam::convertMeshCellZones
(
245
246
    vtkMultiBlockDataSet* output,
    int& blockNo
247
248
)
{
249
250
    arrayRange& range = arrayRangeCellZones_;
    range.block(blockNo);      // set output block
Mark Olesen's avatar
Mark Olesen committed
251
252
253
254
    label datasetNo = 0;       // restart at dataset 0
    const fvMesh& mesh = *meshPtr_;

    // resize for decomposed polyhedra
255
    zonePolyDecomp_.setSize(range.size());
Mark Olesen's avatar
Mark Olesen committed
256

257
    if (range.empty())
Mark Olesen's avatar
Mark Olesen committed
258
259
260
261
    {
        return;
    }

262
263
    if (debug)
    {
264
        Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellZones" << endl;
Mark Olesen's avatar
Mark Olesen committed
265
        printMemory();
266
267
    }

Mark Olesen's avatar
Mark Olesen committed
268
    const cellZoneMesh& zMesh = mesh.cellZones();
269
    for (int partId = range.start(); partId < range.end(); ++partId)
270
    {
Mark Olesen's avatar
Mark Olesen committed
271
272
        const word zoneName = getPartName(partId);
        const label  zoneId = zMesh.findZoneID(zoneName);
273

Mark Olesen's avatar
Mark Olesen committed
274
        if (!partStatus_[partId] || zoneId < 0)
275
        {
Mark Olesen's avatar
Mark Olesen committed
276
277
            continue;
        }
Mark Olesen's avatar
Mark Olesen committed
278

Mark Olesen's avatar
Mark Olesen committed
279
280
281
282
283
        if (debug)
        {
            Info<< "Creating VTK mesh for cellZone[" << zoneId << "] "
                << zoneName << endl;
        }
284

Mark Olesen's avatar
Mark Olesen committed
285
286
        fvMeshSubset subsetter(mesh);
        subsetter.setLargeCellSubset(zMesh[zoneId]);
287

Mark Olesen's avatar
Mark Olesen committed
288
289
290
291
292
        vtkUnstructuredGrid* vtkmesh = volumeVTKMesh
        (
            subsetter.subMesh(),
            zonePolyDecomp_[datasetNo]
        );
293

Mark Olesen's avatar
Mark Olesen committed
294
295
296
297
        if (vtkmesh)
        {
            // superCells + addPointCellLabels must contain global cell ids
            inplaceRenumber
298
            (
Mark Olesen's avatar
Mark Olesen committed
299
300
301
302
303
304
305
                subsetter.cellMap(),
                zonePolyDecomp_[datasetNo].superCells()
            );
            inplaceRenumber
            (
                subsetter.cellMap(),
                zonePolyDecomp_[datasetNo].addPointCellLabels()
306
307
            );

Mark Olesen's avatar
Mark Olesen committed
308
309
            // copy pointMap as well, otherwise pointFields fail
            zonePolyDecomp_[datasetNo].pointMap() = subsetter.pointMap();
Mark Olesen's avatar
Mark Olesen committed
310

311
            AddToBlock(output, vtkmesh, range, datasetNo, zoneName);
Mark Olesen's avatar
Mark Olesen committed
312
313
314
            vtkmesh->Delete();

            partDataset_[partId] = datasetNo++;
315
316
        }
    }
317

Mark Olesen's avatar
Mark Olesen committed
318
    // anything added?
Mark Olesen's avatar
Mark Olesen committed
319
    if (datasetNo)
320
321
322
323
    {
        ++blockNo;
    }

324
325
326
    if (debug)
    {
        Info<< "<end> Foam::vtkPV3Foam::convertMeshCellZones" << endl;
Mark Olesen's avatar
Mark Olesen committed
327
        printMemory();
328
    }
329
330
331
}


332
void Foam::vtkPV3Foam::convertMeshCellSets
333
(
334
335
    vtkMultiBlockDataSet* output,
    int& blockNo
336
337
)
{
338
339
    arrayRange& range = arrayRangeCellSets_;
    range.block(blockNo);      // set output block
Mark Olesen's avatar
Mark Olesen committed
340
341
342
343
    label datasetNo = 0;       // restart at dataset 0
    const fvMesh& mesh = *meshPtr_;

    // resize for decomposed polyhedra
344
    csetPolyDecomp_.setSize(range.size());
Mark Olesen's avatar
Mark Olesen committed
345

346
347
    if (debug)
    {
348
        Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellSets" << endl;
Mark Olesen's avatar
Mark Olesen committed
349
        printMemory();
350
351
    }

352
    for (int partId = range.start(); partId < range.end(); ++partId)
353
    {
Mark Olesen's avatar
Mark Olesen committed
354
355
356
        const word partName = getPartName(partId);

        if (!partStatus_[partId])
357
        {
Mark Olesen's avatar
Mark Olesen committed
358
359
            continue;
        }
360

Mark Olesen's avatar
Mark Olesen committed
361
362
363
364
        if (debug)
        {
            Info<< "Creating VTK mesh for cellSet=" << partName << endl;
        }
365

Mark Olesen's avatar
Mark Olesen committed
366
367
368
        const cellSet cSet(mesh, partName);
        fvMeshSubset subsetter(mesh);
        subsetter.setLargeCellSubset(cSet);
369

Mark Olesen's avatar
Mark Olesen committed
370
371
372
373
374
        vtkUnstructuredGrid* vtkmesh = volumeVTKMesh
        (
            subsetter.subMesh(),
            csetPolyDecomp_[datasetNo]
        );
375

Mark Olesen's avatar
Mark Olesen committed
376
377
378
379
380
381
382
383
384
        if (vtkmesh)
        {
            // superCells + addPointCellLabels must contain global cell ids
            inplaceRenumber
            (
                subsetter.cellMap(),
                csetPolyDecomp_[datasetNo].superCells()
            );
            inplaceRenumber
385
            (
Mark Olesen's avatar
Mark Olesen committed
386
387
                subsetter.cellMap(),
                csetPolyDecomp_[datasetNo].addPointCellLabels()
388
389
            );

Mark Olesen's avatar
Mark Olesen committed
390
391
            // copy pointMap as well, otherwise pointFields fail
            csetPolyDecomp_[datasetNo].pointMap() = subsetter.pointMap();
Mark Olesen's avatar
Mark Olesen committed
392

393
            AddToBlock(output, vtkmesh, range, datasetNo, partName);
Mark Olesen's avatar
Mark Olesen committed
394
395
396
            vtkmesh->Delete();

            partDataset_[partId] = datasetNo++;
397
398
        }
    }
399

Mark Olesen's avatar
Mark Olesen committed
400
    // anything added?
Mark Olesen's avatar
Mark Olesen committed
401
    if (datasetNo)
402
403
404
405
    {
        ++blockNo;
    }

406
407
    if (debug)
    {
408
        Info<< "<end> Foam::vtkPV3Foam::convertMeshCellSets" << endl;
Mark Olesen's avatar
Mark Olesen committed
409
        printMemory();
410
    }
411
412
}

413

414
415
void Foam::vtkPV3Foam::convertMeshFaceZones
(
416
417
    vtkMultiBlockDataSet* output,
    int& blockNo
418
419
)
{
420
421
    arrayRange& range = arrayRangeFaceZones_;
    range.block(blockNo);      // set output block
Mark Olesen's avatar
Mark Olesen committed
422
423
424
    label datasetNo = 0;       // restart at dataset 0
    const fvMesh& mesh = *meshPtr_;

425
    if (range.empty())
Mark Olesen's avatar
Mark Olesen committed
426
427
428
429
    {
        return;
    }

430
431
    if (debug)
    {
432
        Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceZones" << endl;
Mark Olesen's avatar
Mark Olesen committed
433
        printMemory();
434
435
    }

Mark Olesen's avatar
Mark Olesen committed
436
    const faceZoneMesh& zMesh = mesh.faceZones();
437
    for (int partId = range.start(); partId < range.end(); ++partId)
438
    {
Mark Olesen's avatar
Mark Olesen committed
439
440
        const word zoneName = getPartName(partId);
        const label  zoneId = zMesh.findZoneID(zoneName);
441

Mark Olesen's avatar
Mark Olesen committed
442
        if (!partStatus_[partId] || zoneId < 0)
443
        {
Mark Olesen's avatar
Mark Olesen committed
444
445
            continue;
        }
446

Mark Olesen's avatar
Mark Olesen committed
447
448
449
450
451
        if (debug)
        {
            Info<< "Creating VTKmesh for faceZone[" << zoneId << "] "
                << zoneName << endl;
        }
452

453
454
        vtkPolyData* vtkmesh = patchVTKMesh(zoneName, zMesh[zoneId]());

Mark Olesen's avatar
Mark Olesen committed
455
456
        if (vtkmesh)
        {
457
            AddToBlock(output, vtkmesh, range, datasetNo, zoneName);
Mark Olesen's avatar
Mark Olesen committed
458
            vtkmesh->Delete();
Mark Olesen's avatar
Mark Olesen committed
459

Mark Olesen's avatar
Mark Olesen committed
460
            partDataset_[partId] = datasetNo++;
461
462
        }
    }
463

Mark Olesen's avatar
Mark Olesen committed
464
    // anything added?
Mark Olesen's avatar
Mark Olesen committed
465
    if (datasetNo)
466
467
468
469
    {
        ++blockNo;
    }

470
471
472
    if (debug)
    {
        Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceZones" << endl;
Mark Olesen's avatar
Mark Olesen committed
473
        printMemory();
474
    }
475
476
477
}


478
void Foam::vtkPV3Foam::convertMeshFaceSets
479
(
480
481
    vtkMultiBlockDataSet* output,
    int& blockNo
482
483
)
{
484
485
    arrayRange& range = arrayRangeFaceSets_;
    range.block(blockNo);      // set output block
Mark Olesen's avatar
Mark Olesen committed
486
487
488
    label datasetNo = 0;       // restart at dataset 0
    const fvMesh& mesh = *meshPtr_;

489
490
    if (debug)
    {
491
        Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceSets" << endl;
Mark Olesen's avatar
Mark Olesen committed
492
        printMemory();
493
494
    }

495
    for (int partId = range.start(); partId < range.end(); ++partId)
496
    {
Mark Olesen's avatar
Mark Olesen committed
497
        const word partName = getPartName(partId);
498

Mark Olesen's avatar
Mark Olesen committed
499
500
501
502
        if (!partStatus_[partId])
        {
            continue;
        }
503

Mark Olesen's avatar
Mark Olesen committed
504
505
506
507
        if (debug)
        {
            Info<< "Creating VTK mesh for faceSet=" << partName << endl;
        }
508

Mark Olesen's avatar
Mark Olesen committed
509
        const faceSet fSet(mesh, partName);
510

Mark Olesen's avatar
Mark Olesen committed
511
512
513
        vtkPolyData* vtkmesh = faceSetVTKMesh(mesh, fSet);
        if (vtkmesh)
        {
514
            AddToBlock(output, vtkmesh, range, datasetNo, partName);
Mark Olesen's avatar
Mark Olesen committed
515
            vtkmesh->Delete();
Mark Olesen's avatar
Mark Olesen committed
516

Mark Olesen's avatar
Mark Olesen committed
517
            partDataset_[partId] = datasetNo++;
518
519
        }
    }
520

Mark Olesen's avatar
Mark Olesen committed
521
    // anything added?
Mark Olesen's avatar
Mark Olesen committed
522
    if (datasetNo)
523
524
525
526
    {
        ++blockNo;
    }

527
528
    if (debug)
    {
529
        Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceSets" << endl;
Mark Olesen's avatar
Mark Olesen committed
530
        printMemory();
531
    }
532
533
534
535
536
}


void Foam::vtkPV3Foam::convertMeshPointZones
(
537
538
    vtkMultiBlockDataSet* output,
    int& blockNo
539
540
)
{
541
542
    arrayRange& range = arrayRangePointZones_;
    range.block(blockNo);      // set output block
Mark Olesen's avatar
Mark Olesen committed
543
    label datasetNo = 0;       // restart at dataset 0
544
    const fvMesh& mesh = *meshPtr_;
Mark Olesen's avatar
Mark Olesen committed
545

546
547
    if (debug)
    {
548
        Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointZones" << endl;
Mark Olesen's avatar
Mark Olesen committed
549
        printMemory();
550
551
    }

552
    if (range.size())
553
    {
Mark Olesen's avatar
Mark Olesen committed
554
        const pointZoneMesh& zMesh = mesh.pointZones();
555
        for (int partId = range.start(); partId < range.end(); ++partId)
556
        {
Mark Olesen's avatar
Mark Olesen committed
557
            word zoneName = getPartName(partId);
Mark Olesen's avatar
Mark Olesen committed
558
            label zoneId = zMesh.findZoneID(zoneName);
559

Mark Olesen's avatar
Mark Olesen committed
560
            if (!partStatus_[partId] || zoneId < 0)
561
562
563
564
            {
                continue;
            }

Mark Olesen's avatar
Mark Olesen committed
565
566
            vtkPolyData* vtkmesh = pointZoneVTKMesh(mesh, zMesh[zoneId]);
            if (vtkmesh)
567
            {
568
                AddToBlock(output, vtkmesh, range, datasetNo, zoneName);
Mark Olesen's avatar
Mark Olesen committed
569
570
                vtkmesh->Delete();

Mark Olesen's avatar
Mark Olesen committed
571
                partDataset_[partId] = datasetNo++;
572
573
574
            }
        }
    }
575

Mark Olesen's avatar
Mark Olesen committed
576
    // anything added?
Mark Olesen's avatar
Mark Olesen committed
577
    if (datasetNo)
578
579
580
581
    {
        ++blockNo;
    }

582
583
584
    if (debug)
    {
        Info<< "<end> Foam::vtkPV3Foam::convertMeshPointZones" << endl;
Mark Olesen's avatar
Mark Olesen committed
585
        printMemory();
586
    }
587
588
589
590
}



591
void Foam::vtkPV3Foam::convertMeshPointSets
592
(
593
594
    vtkMultiBlockDataSet* output,
    int& blockNo
595
596
)
{
597
598
    arrayRange& range = arrayRangePointSets_;
    range.block(blockNo);      // set output block
Mark Olesen's avatar
Mark Olesen committed
599
600
601
    label datasetNo = 0;       // restart at dataset 0
    const fvMesh& mesh = *meshPtr_;

602
603
    if (debug)
    {
604
        Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointSets" << endl;
Mark Olesen's avatar
Mark Olesen committed
605
        printMemory();
606
607
    }

608
    for (int partId = range.start(); partId < range.end(); ++partId)
609
    {
Mark Olesen's avatar
Mark Olesen committed
610
        word partName = getPartName(partId);
611

Mark Olesen's avatar
Mark Olesen committed
612
613
614
615
        if (!partStatus_[partId])
        {
            continue;
        }
616

Mark Olesen's avatar
Mark Olesen committed
617
618
619
620
        if (debug)
        {
            Info<< "Creating VTK mesh for pointSet=" << partName << endl;
        }
621

Mark Olesen's avatar
Mark Olesen committed
622
        const pointSet pSet(mesh, partName);
623

Mark Olesen's avatar
Mark Olesen committed
624
625
626
        vtkPolyData* vtkmesh = pointSetVTKMesh(mesh, pSet);
        if (vtkmesh)
        {
627
            AddToBlock(output, vtkmesh, range, datasetNo, partName);
Mark Olesen's avatar
Mark Olesen committed
628
            vtkmesh->Delete();
Mark Olesen's avatar
Mark Olesen committed
629

Mark Olesen's avatar
Mark Olesen committed
630
            partDataset_[partId] = datasetNo++;
631
632
        }
    }
633

Mark Olesen's avatar
Mark Olesen committed
634
    // anything added?
Mark Olesen's avatar
Mark Olesen committed
635
    if (datasetNo)
636
637
638
639
    {
        ++blockNo;
    }

640
641
    if (debug)
    {
642
        Info<< "<end> Foam::vtkPV3Foam::convertMeshPointSets" << endl;
Mark Olesen's avatar
Mark Olesen committed
643
        printMemory();
644
    }
645
646
}

647

648
// ************************************************************************* //