vtkPV3FoamMesh.C 15.2 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

Mark Olesen's avatar
Mark Olesen committed
453
454
455
        vtkPolyData* vtkmesh = faceZoneVTKMesh(mesh, zMesh[zoneId]);
        if (vtkmesh)
        {
456
            AddToBlock(output, vtkmesh, range, datasetNo, zoneName);
Mark Olesen's avatar
Mark Olesen committed
457
            vtkmesh->Delete();
Mark Olesen's avatar
Mark Olesen committed
458

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

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

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


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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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



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

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

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

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

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

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

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

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

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

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

646

647
// ************************************************************************* //