mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use labelRange and range-based-for in paraview readers
- also use updated forAll* macros
This commit is contained in:
@ -146,7 +146,7 @@ vtkPVFoamReader::~vtkPVFoamReader()
|
|||||||
|
|
||||||
if (FileName)
|
if (FileName)
|
||||||
{
|
{
|
||||||
delete [] FileName;
|
delete[] FileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (output0_)
|
if (output0_)
|
||||||
@ -525,13 +525,11 @@ void vtkPVFoamReader::updatePatchNamesView(const bool show)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get all the pqRenderView instances
|
// Get all the pqRenderView instances
|
||||||
QList<pqRenderView*> renderViews = smModel->findItems<pqRenderView*>();
|
for (auto view : smModel->findItems<pqRenderView*>())
|
||||||
|
|
||||||
for (int viewI=0; viewI < renderViews.size(); ++viewI)
|
|
||||||
{
|
{
|
||||||
backend_->renderPatchNames
|
backend_->renderPatchNames
|
||||||
(
|
(
|
||||||
renderViews[viewI]->getRenderViewProxy()->GetRenderer(),
|
view->getRenderViewProxy()->GetRenderer(),
|
||||||
show
|
show
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,7 @@ namespace Foam
|
|||||||
|
|
||||||
vtkTextActor* Foam::vtkPVFoam::createTextActor
|
vtkTextActor* Foam::vtkPVFoam::createTextActor
|
||||||
(
|
(
|
||||||
const string& s,
|
const std::string& s,
|
||||||
const point& pt
|
const point& pt
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -79,15 +79,15 @@ vtkTextActor* Foam::vtkPVFoam::createTextActor
|
|||||||
void Foam::vtkPVFoam::resetCounters()
|
void Foam::vtkPVFoam::resetCounters()
|
||||||
{
|
{
|
||||||
// Reset array range information (ids and sizes)
|
// Reset array range information (ids and sizes)
|
||||||
arrayRangeVolume_.reset();
|
rangeVolume_.reset();
|
||||||
arrayRangePatches_.reset();
|
rangePatches_.reset();
|
||||||
arrayRangeLagrangian_.reset();
|
rangeLagrangian_.reset();
|
||||||
arrayRangeCellZones_.reset();
|
rangeCellZones_.reset();
|
||||||
arrayRangeFaceZones_.reset();
|
rangeFaceZones_.reset();
|
||||||
arrayRangePointZones_.reset();
|
rangePointZones_.reset();
|
||||||
arrayRangeCellSets_.reset();
|
rangeCellSets_.reset();
|
||||||
arrayRangeFaceSets_.reset();
|
rangeFaceSets_.reset();
|
||||||
arrayRangePointSets_.reset();
|
rangePointSets_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -260,15 +260,15 @@ Foam::vtkPVFoam::vtkPVFoam
|
|||||||
timeIndex_(-1),
|
timeIndex_(-1),
|
||||||
meshChanged_(true),
|
meshChanged_(true),
|
||||||
fieldsChanged_(true),
|
fieldsChanged_(true),
|
||||||
arrayRangeVolume_("unzoned"),
|
rangeVolume_("unzoned"),
|
||||||
arrayRangePatches_("patches"),
|
rangePatches_("patches"),
|
||||||
arrayRangeLagrangian_("lagrangian"),
|
rangeLagrangian_("lagrangian"),
|
||||||
arrayRangeCellZones_("cellZone"),
|
rangeCellZones_("cellZone"),
|
||||||
arrayRangeFaceZones_("faceZone"),
|
rangeFaceZones_("faceZone"),
|
||||||
arrayRangePointZones_("pointZone"),
|
rangePointZones_("pointZone"),
|
||||||
arrayRangeCellSets_("cellSet"),
|
rangeCellSets_("cellSet"),
|
||||||
arrayRangeFaceSets_("faceSet"),
|
rangeFaceSets_("faceSet"),
|
||||||
arrayRangePointSets_("pointSet")
|
rangePointSets_("pointSet")
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -653,7 +653,7 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
hashedWordList selectedPatches = getSelected
|
hashedWordList selectedPatches = getSelected
|
||||||
(
|
(
|
||||||
reader_->GetPartSelection(),
|
reader_->GetPartSelection(),
|
||||||
arrayRangePatches_
|
rangePatches_
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedPatches.empty())
|
if (selectedPatches.empty())
|
||||||
|
|||||||
@ -35,7 +35,6 @@ SourceFiles
|
|||||||
vtkPVFoamMeshVolume.C
|
vtkPVFoamMeshVolume.C
|
||||||
vtkPVFoamTemplates.C
|
vtkPVFoamTemplates.C
|
||||||
vtkPVFoamUpdateInfo.C
|
vtkPVFoamUpdateInfo.C
|
||||||
vtkPVFoamUtils.C
|
|
||||||
vtkPVFoamFieldTemplates.C
|
vtkPVFoamFieldTemplates.C
|
||||||
vtkPVFoamUpdateTemplates.C
|
vtkPVFoamUpdateTemplates.C
|
||||||
|
|
||||||
@ -197,15 +196,15 @@ class vtkPVFoam
|
|||||||
|
|
||||||
//- First instance and size of various mesh parts
|
//- First instance and size of various mesh parts
|
||||||
// used to index into partStatus_ and partDataset_
|
// used to index into partStatus_ and partDataset_
|
||||||
arrayRange arrayRangeVolume_;
|
arrayRange rangeVolume_;
|
||||||
arrayRange arrayRangePatches_;
|
arrayRange rangePatches_;
|
||||||
arrayRange arrayRangeLagrangian_;
|
arrayRange rangeLagrangian_;
|
||||||
arrayRange arrayRangeCellZones_;
|
arrayRange rangeCellZones_;
|
||||||
arrayRange arrayRangeFaceZones_;
|
arrayRange rangeFaceZones_;
|
||||||
arrayRange arrayRangePointZones_;
|
arrayRange rangePointZones_;
|
||||||
arrayRange arrayRangeCellSets_;
|
arrayRange rangeCellSets_;
|
||||||
arrayRange arrayRangeFaceSets_;
|
arrayRange rangeFaceSets_;
|
||||||
arrayRange arrayRangePointSets_;
|
arrayRange rangePointSets_;
|
||||||
|
|
||||||
//- Decomposed cells information (mesh regions)
|
//- Decomposed cells information (mesh regions)
|
||||||
// TODO: regions
|
// TODO: regions
|
||||||
@ -224,7 +223,11 @@ class vtkPVFoam
|
|||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Create a text actor
|
//- Create a text actor
|
||||||
static vtkTextActor* createTextActor(const string& s, const point& pt);
|
static vtkTextActor* createTextActor
|
||||||
|
(
|
||||||
|
const std::string& s,
|
||||||
|
const point& pt
|
||||||
|
);
|
||||||
|
|
||||||
//- Reset data counters
|
//- Reset data counters
|
||||||
void resetCounters();
|
void resetCounters();
|
||||||
|
|||||||
@ -83,7 +83,7 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
fld,
|
fld,
|
||||||
ptfPtr,
|
ptfPtr,
|
||||||
output,
|
output,
|
||||||
arrayRangeVolume_,
|
rangeVolume_,
|
||||||
regionPolyDecomp_
|
regionPolyDecomp_
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
fld,
|
fld,
|
||||||
ptfPtr,
|
ptfPtr,
|
||||||
output,
|
output,
|
||||||
arrayRangeCellZones_,
|
rangeCellZones_,
|
||||||
zonePolyDecomp_
|
zonePolyDecomp_
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
fld,
|
fld,
|
||||||
ptfPtr,
|
ptfPtr,
|
||||||
output,
|
output,
|
||||||
arrayRangeCellSets_,
|
rangeCellSets_,
|
||||||
csetPolyDecomp_
|
csetPolyDecomp_
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -111,12 +111,7 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
//
|
//
|
||||||
// Convert patches - if activated
|
// Convert patches - if activated
|
||||||
//
|
//
|
||||||
for
|
for (auto partId : rangePatches_)
|
||||||
(
|
|
||||||
int partId = arrayRangePatches_.start();
|
|
||||||
partId < arrayRangePatches_.end();
|
|
||||||
++partId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const word patchName = getPartName(partId);
|
const word patchName = getPartName(partId);
|
||||||
const label datasetNo = partDataset_[partId];
|
const label datasetNo = partDataset_[partId];
|
||||||
@ -129,7 +124,7 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
|
|
||||||
vtkPolyData* vtkmesh = getDataFromBlock<vtkPolyData>
|
vtkPolyData* vtkmesh = getDataFromBlock<vtkPolyData>
|
||||||
(
|
(
|
||||||
output, arrayRangePatches_, datasetNo
|
output, rangePatches_, datasetNo
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!vtkmesh)
|
if (!vtkmesh)
|
||||||
@ -195,12 +190,7 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
//
|
//
|
||||||
// Convert face zones - if activated
|
// Convert face zones - if activated
|
||||||
//
|
//
|
||||||
for
|
for (auto partId : rangeFaceZones_)
|
||||||
(
|
|
||||||
int partId = arrayRangeFaceZones_.start();
|
|
||||||
partId < arrayRangeFaceZones_.end();
|
|
||||||
++partId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const word zoneName = getPartName(partId);
|
const word zoneName = getPartName(partId);
|
||||||
const label datasetNo = partDataset_[partId];
|
const label datasetNo = partDataset_[partId];
|
||||||
@ -220,7 +210,7 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
|
|
||||||
vtkPolyData* vtkmesh = getDataFromBlock<vtkPolyData>
|
vtkPolyData* vtkmesh = getDataFromBlock<vtkPolyData>
|
||||||
(
|
(
|
||||||
output, arrayRangeFaceZones_, datasetNo
|
output, rangeFaceZones_, datasetNo
|
||||||
);
|
);
|
||||||
|
|
||||||
if (vtkmesh)
|
if (vtkmesh)
|
||||||
@ -241,12 +231,7 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
//
|
//
|
||||||
// Convert face sets - if activated
|
// Convert face sets - if activated
|
||||||
//
|
//
|
||||||
for
|
for (auto partId : rangeFaceSets_)
|
||||||
(
|
|
||||||
int partId = arrayRangeFaceSets_.start();
|
|
||||||
partId < arrayRangeFaceSets_.end();
|
|
||||||
++partId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const word selectName = getPartName(partId);
|
const word selectName = getPartName(partId);
|
||||||
const label datasetNo = partDataset_[partId];
|
const label datasetNo = partDataset_[partId];
|
||||||
@ -258,7 +243,7 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
|
|
||||||
vtkPolyData* vtkmesh = getDataFromBlock<vtkPolyData>
|
vtkPolyData* vtkmesh = getDataFromBlock<vtkPolyData>
|
||||||
(
|
(
|
||||||
output, arrayRangeFaceSets_, datasetNo
|
output, rangeFaceSets_, datasetNo
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!vtkmesh)
|
if (!vtkmesh)
|
||||||
@ -291,7 +276,7 @@ void Foam::vtkPVFoam::convertVolFields
|
|||||||
vtkMultiBlockDataSet* output
|
vtkMultiBlockDataSet* output
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAllConstIter(IOobjectList, objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
// restrict to GeometricField<Type, ...>
|
// restrict to GeometricField<Type, ...>
|
||||||
if
|
if
|
||||||
@ -327,7 +312,7 @@ void Foam::vtkPVFoam::convertDimFields
|
|||||||
{
|
{
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
|
typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
|
||||||
|
|
||||||
forAllConstIter(IOobjectList, objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
// restrict to DimensionedField<Type, ...>
|
// restrict to DimensionedField<Type, ...>
|
||||||
if
|
if
|
||||||
@ -387,7 +372,7 @@ void Foam::vtkPVFoam::convertVolFieldBlock
|
|||||||
const List<polyDecomp>& decompLst
|
const List<polyDecomp>& decompLst
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
const label datasetNo = partDataset_[partId];
|
const label datasetNo = partDataset_[partId];
|
||||||
|
|
||||||
@ -437,7 +422,7 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
const polyMesh& mesh = pMesh.mesh();
|
const polyMesh& mesh = pMesh.mesh();
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
forAllConstIter(IOobjectList, objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
const word& fieldName = iter()->name();
|
const word& fieldName = iter()->name();
|
||||||
// restrict to this GeometricField<Type, ...>
|
// restrict to this GeometricField<Type, ...>
|
||||||
@ -463,7 +448,7 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
(
|
(
|
||||||
pfld,
|
pfld,
|
||||||
output,
|
output,
|
||||||
arrayRangeVolume_,
|
rangeVolume_,
|
||||||
regionPolyDecomp_
|
regionPolyDecomp_
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -472,7 +457,7 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
(
|
(
|
||||||
pfld,
|
pfld,
|
||||||
output,
|
output,
|
||||||
arrayRangeCellZones_,
|
rangeCellZones_,
|
||||||
zonePolyDecomp_
|
zonePolyDecomp_
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -481,7 +466,7 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
(
|
(
|
||||||
pfld,
|
pfld,
|
||||||
output,
|
output,
|
||||||
arrayRangeCellSets_,
|
rangeCellSets_,
|
||||||
csetPolyDecomp_
|
csetPolyDecomp_
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -489,12 +474,7 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
//
|
//
|
||||||
// Convert patches - if activated
|
// Convert patches - if activated
|
||||||
//
|
//
|
||||||
for
|
for (auto partId : rangePatches_)
|
||||||
(
|
|
||||||
int partId = arrayRangePatches_.start();
|
|
||||||
partId < arrayRangePatches_.end();
|
|
||||||
++partId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const word patchName = getPartName(partId);
|
const word patchName = getPartName(partId);
|
||||||
const label datasetNo = partDataset_[partId];
|
const label datasetNo = partDataset_[partId];
|
||||||
@ -507,7 +487,7 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
|
|
||||||
vtkPolyData* vtkmesh = getDataFromBlock<vtkPolyData>
|
vtkPolyData* vtkmesh = getDataFromBlock<vtkPolyData>
|
||||||
(
|
(
|
||||||
output, arrayRangePatches_, datasetNo
|
output, rangePatches_, datasetNo
|
||||||
);
|
);
|
||||||
|
|
||||||
if (vtkmesh)
|
if (vtkmesh)
|
||||||
@ -526,12 +506,7 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
//
|
//
|
||||||
// Convert faceZones - if activated
|
// Convert faceZones - if activated
|
||||||
//
|
//
|
||||||
for
|
for (auto partId : rangeFaceZones_)
|
||||||
(
|
|
||||||
int partId = arrayRangeFaceZones_.start();
|
|
||||||
partId < arrayRangeFaceZones_.end();
|
|
||||||
++partId
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const word zoneName = getPartName(partId);
|
const word zoneName = getPartName(partId);
|
||||||
const label datasetNo = partDataset_[partId];
|
const label datasetNo = partDataset_[partId];
|
||||||
@ -544,7 +519,7 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
|
|
||||||
vtkPolyData* vtkmesh = getDataFromBlock<vtkPolyData>
|
vtkPolyData* vtkmesh = getDataFromBlock<vtkPolyData>
|
||||||
(
|
(
|
||||||
output, arrayRangeFaceZones_, datasetNo
|
output, rangeFaceZones_, datasetNo
|
||||||
);
|
);
|
||||||
|
|
||||||
if (vtkmesh)
|
if (vtkmesh)
|
||||||
@ -575,7 +550,7 @@ void Foam::vtkPVFoam::convertPointFieldBlock
|
|||||||
const List<polyDecomp>& decompLst
|
const List<polyDecomp>& decompLst
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
const label datasetNo = partDataset_[partId];
|
const label datasetNo = partDataset_[partId];
|
||||||
|
|
||||||
@ -731,9 +706,9 @@ void Foam::vtkPVFoam::convertLagrangianFields
|
|||||||
const label datasetNo
|
const label datasetNo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const arrayRange& range = arrayRangeLagrangian_;
|
const arrayRange& range = rangeLagrangian_;
|
||||||
|
|
||||||
forAllConstIter(IOobjectList, objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
// restrict to this IOField<Type>
|
// restrict to this IOField<Type>
|
||||||
if (iter()->headerClassName() == IOField<Type>::typeName)
|
if (iter()->headerClassName() == IOField<Type>::typeName)
|
||||||
|
|||||||
@ -52,7 +52,7 @@ void Foam::vtkPVFoam::pruneObjectList
|
|||||||
}
|
}
|
||||||
|
|
||||||
// only retain specified fields
|
// only retain specified fields
|
||||||
forAllIter(IOobjectList, objects, iter)
|
forAllIters(objects, iter)
|
||||||
{
|
{
|
||||||
if (!retain.found(iter()->name()))
|
if (!retain.found(iter()->name()))
|
||||||
{
|
{
|
||||||
@ -93,7 +93,7 @@ void Foam::vtkPVFoam::convertVolFields
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> convert volume fields" << endl;
|
Info<< "<beg> convert volume fields" << endl;
|
||||||
forAllConstIter(IOobjectList, objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
Info<< " " << iter()->name()
|
Info<< " " << iter()->name()
|
||||||
<< " == " << iter()->objectPath() << endl;
|
<< " == " << iter()->objectPath() << endl;
|
||||||
@ -175,7 +175,7 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> convert volume -> point fields" << endl;
|
Info<< "<beg> convert volume -> point fields" << endl;
|
||||||
forAllConstIter(IOobjectList, objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
Info<< " " << iter()->name()
|
Info<< " " << iter()->name()
|
||||||
<< " == " << iter()->objectPath() << endl;
|
<< " == " << iter()->objectPath() << endl;
|
||||||
@ -205,7 +205,7 @@ void Foam::vtkPVFoam::convertLagrangianFields
|
|||||||
vtkMultiBlockDataSet* output
|
vtkMultiBlockDataSet* output
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeLagrangian_;
|
arrayRange& range = rangeLagrangian_;
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
|
|
||||||
hashedWordList selectedFields = getSelected
|
hashedWordList selectedFields = getSelected
|
||||||
@ -224,7 +224,7 @@ void Foam::vtkPVFoam::convertLagrangianFields
|
|||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
const word cloudName = getPartName(partId);
|
const word cloudName = getPartName(partId);
|
||||||
const label datasetNo = partDataset_[partId];
|
const label datasetNo = partDataset_[partId];
|
||||||
@ -253,7 +253,7 @@ void Foam::vtkPVFoam::convertLagrangianFields
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "converting OpenFOAM lagrangian fields" << endl;
|
Info<< "converting OpenFOAM lagrangian fields" << endl;
|
||||||
forAllConstIter(IOobjectList, objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
Info<< " " << iter()->name()
|
Info<< " " << iter()->name()
|
||||||
<< " == " << iter()->objectPath() << endl;
|
<< " == " << iter()->objectPath() << endl;
|
||||||
|
|||||||
@ -47,7 +47,7 @@ void Foam::vtkPVFoam::convertMeshVolume
|
|||||||
int& blockNo
|
int& blockNo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeVolume_;
|
arrayRange& range = rangeVolume_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -63,7 +63,7 @@ void Foam::vtkPVFoam::convertMeshVolume
|
|||||||
|
|
||||||
// Convert the internalMesh
|
// Convert the internalMesh
|
||||||
// this looks like more than one part, but it isn't
|
// this looks like more than one part, but it isn't
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
const word partName = "internalMesh";
|
const word partName = "internalMesh";
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ void Foam::vtkPVFoam::convertMeshLagrangian
|
|||||||
int& blockNo
|
int& blockNo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeLagrangian_;
|
arrayRange& range = rangeLagrangian_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -118,7 +118,7 @@ void Foam::vtkPVFoam::convertMeshLagrangian
|
|||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
const word cloudName = getPartName(partId);
|
const word cloudName = getPartName(partId);
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ void Foam::vtkPVFoam::convertMeshPatches
|
|||||||
int& blockNo
|
int& blockNo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangePatches_;
|
arrayRange& range = rangePatches_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -170,7 +170,7 @@ void Foam::vtkPVFoam::convertMeshPatches
|
|||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
if (!partStatus_[partId])
|
if (!partStatus_[partId])
|
||||||
{
|
{
|
||||||
@ -197,15 +197,15 @@ void Foam::vtkPVFoam::convertMeshPatches
|
|||||||
{
|
{
|
||||||
// Patch group. Collect patch faces.
|
// Patch group. Collect patch faces.
|
||||||
label sz = 0;
|
label sz = 0;
|
||||||
forAllConstIter(labelHashSet, patchIds, iter)
|
for (auto id : patchIds)
|
||||||
{
|
{
|
||||||
sz += patches[iter.key()].size();
|
sz += patches[id].size();
|
||||||
}
|
}
|
||||||
labelList faceLabels(sz);
|
labelList faceLabels(sz);
|
||||||
sz = 0;
|
sz = 0;
|
||||||
forAllConstIter(labelHashSet, patchIds, iter)
|
for (auto id : patchIds)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[iter.key()];
|
const auto& pp = patches[id];
|
||||||
forAll(pp, i)
|
forAll(pp, i)
|
||||||
{
|
{
|
||||||
faceLabels[sz++] = pp.start()+i;
|
faceLabels[sz++] = pp.start()+i;
|
||||||
@ -254,7 +254,7 @@ void Foam::vtkPVFoam::convertMeshCellZones
|
|||||||
int& blockNo
|
int& blockNo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeCellZones_;
|
arrayRange& range = rangeCellZones_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -274,7 +274,7 @@ void Foam::vtkPVFoam::convertMeshCellZones
|
|||||||
}
|
}
|
||||||
|
|
||||||
const cellZoneMesh& zMesh = mesh.cellZones();
|
const cellZoneMesh& zMesh = mesh.cellZones();
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
const word zoneName = getPartName(partId);
|
const word zoneName = getPartName(partId);
|
||||||
const label zoneId = zMesh.findZoneID(zoneName);
|
const label zoneId = zMesh.findZoneID(zoneName);
|
||||||
@ -343,7 +343,7 @@ void Foam::vtkPVFoam::convertMeshCellSets
|
|||||||
int& blockNo
|
int& blockNo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeCellSets_;
|
arrayRange& range = rangeCellSets_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -357,7 +357,7 @@ void Foam::vtkPVFoam::convertMeshCellSets
|
|||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
const word partName = getPartName(partId);
|
const word partName = getPartName(partId);
|
||||||
|
|
||||||
@ -425,7 +425,7 @@ void Foam::vtkPVFoam::convertMeshFaceZones
|
|||||||
int& blockNo
|
int& blockNo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeFaceZones_;
|
arrayRange& range = rangeFaceZones_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -442,7 +442,7 @@ void Foam::vtkPVFoam::convertMeshFaceZones
|
|||||||
}
|
}
|
||||||
|
|
||||||
const faceZoneMesh& zMesh = mesh.faceZones();
|
const faceZoneMesh& zMesh = mesh.faceZones();
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
const word zoneName = getPartName(partId);
|
const word zoneName = getPartName(partId);
|
||||||
const label zoneId = zMesh.findZoneID(zoneName);
|
const label zoneId = zMesh.findZoneID(zoneName);
|
||||||
@ -489,7 +489,7 @@ void Foam::vtkPVFoam::convertMeshFaceSets
|
|||||||
int& blockNo
|
int& blockNo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeFaceSets_;
|
arrayRange& range = rangeFaceSets_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -500,7 +500,7 @@ void Foam::vtkPVFoam::convertMeshFaceSets
|
|||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
const word partName = getPartName(partId);
|
const word partName = getPartName(partId);
|
||||||
|
|
||||||
@ -560,7 +560,7 @@ void Foam::vtkPVFoam::convertMeshPointZones
|
|||||||
int& blockNo
|
int& blockNo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangePointZones_;
|
arrayRange& range = rangePointZones_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -574,10 +574,10 @@ void Foam::vtkPVFoam::convertMeshPointZones
|
|||||||
if (range.size())
|
if (range.size())
|
||||||
{
|
{
|
||||||
const pointZoneMesh& zMesh = mesh.pointZones();
|
const pointZoneMesh& zMesh = mesh.pointZones();
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
word zoneName = getPartName(partId);
|
const word zoneName = getPartName(partId);
|
||||||
label zoneId = zMesh.findZoneID(zoneName);
|
const label zoneId = zMesh.findZoneID(zoneName);
|
||||||
|
|
||||||
if (!partStatus_[partId] || zoneId < 0)
|
if (!partStatus_[partId] || zoneId < 0)
|
||||||
{
|
{
|
||||||
@ -630,7 +630,7 @@ void Foam::vtkPVFoam::convertMeshPointSets
|
|||||||
int& blockNo
|
int& blockNo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangePointSets_;
|
arrayRange& range = rangePointSets_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -641,9 +641,9 @@ void Foam::vtkPVFoam::convertMeshPointSets
|
|||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (auto partId : range)
|
||||||
{
|
{
|
||||||
word partName = getPartName(partId);
|
const word partName = getPartName(partId);
|
||||||
|
|
||||||
if (!partStatus_[partId])
|
if (!partStatus_[partId])
|
||||||
{
|
{
|
||||||
@ -661,7 +661,7 @@ void Foam::vtkPVFoam::convertMeshPointSets
|
|||||||
vtkpoints->Allocate(pSet.size());
|
vtkpoints->Allocate(pSet.size());
|
||||||
|
|
||||||
const pointField& meshPoints = mesh.points();
|
const pointField& meshPoints = mesh.points();
|
||||||
forAllConstIter(pointSet, pSet, iter)
|
forAllConstIters(pSet, iter)
|
||||||
{
|
{
|
||||||
vtkpoints->InsertNextPoint(meshPoints[iter.key()].v_);
|
vtkpoints->InsertNextPoint(meshPoints[iter.key()].v_);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,7 +80,7 @@ vtkPolyData* Foam::vtkPVFoam::lagrangianVTKMesh
|
|||||||
vtkcells->Allocate(parcels.size());
|
vtkcells->Allocate(parcels.size());
|
||||||
|
|
||||||
vtkIdType particleId = 0;
|
vtkIdType particleId = 0;
|
||||||
forAllConstIter(Cloud<passiveParticle>, parcels, iter)
|
forAllConstIters(parcels, iter)
|
||||||
{
|
{
|
||||||
vtkpoints->InsertNextPoint(iter().position().v_);
|
vtkpoints->InsertNextPoint(iter().position().v_);
|
||||||
|
|
||||||
|
|||||||
@ -89,11 +89,11 @@ Foam::wordList Foam::vtkPVFoam::getZoneNames
|
|||||||
wordList names(zmesh.size());
|
wordList names(zmesh.size());
|
||||||
label nZone = 0;
|
label nZone = 0;
|
||||||
|
|
||||||
forAll(zmesh, zoneI)
|
forAll(zmesh, zonei)
|
||||||
{
|
{
|
||||||
if (!zmesh[zoneI].empty())
|
if (!zmesh[zonei].empty())
|
||||||
{
|
{
|
||||||
names[nZone++] = zmesh[zoneI].name();
|
names[nZone++] = zmesh[zonei].name();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
names.setSize(nZone);
|
names.setSize(nZone);
|
||||||
@ -128,9 +128,9 @@ Foam::wordList Foam::vtkPVFoam::getZoneNames(const word& zoneType) const
|
|||||||
zonesEntries zones(ioObj);
|
zonesEntries zones(ioObj);
|
||||||
|
|
||||||
names.setSize(zones.size());
|
names.setSize(zones.size());
|
||||||
forAll(zones, zoneI)
|
forAll(zones, zonei)
|
||||||
{
|
{
|
||||||
names[zoneI] = zones[zoneI].keyword();
|
names[zonei] = zones[zonei].keyword();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,12 +150,8 @@ void Foam::vtkPVFoam::updateInfoInternalMesh
|
|||||||
|
|
||||||
// Determine mesh parts (internalMesh, patches...)
|
// Determine mesh parts (internalMesh, patches...)
|
||||||
//- Add internal mesh as first entry
|
//- Add internal mesh as first entry
|
||||||
arrayRangeVolume_.reset(arraySelection->GetNumberOfArrays());
|
rangeVolume_.reset(arraySelection->GetNumberOfArrays(), 1);
|
||||||
arraySelection->AddArray
|
arraySelection->AddArray("internalMesh");
|
||||||
(
|
|
||||||
"internalMesh"
|
|
||||||
);
|
|
||||||
arrayRangeVolume_ += 1;
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -190,20 +186,16 @@ void Foam::vtkPVFoam::updateInfoLagrangian
|
|||||||
readDir(dbPtr_->timePath()/lagrangianPrefix, fileName::DIRECTORY)
|
readDir(dbPtr_->timePath()/lagrangianPrefix, fileName::DIRECTORY)
|
||||||
);
|
);
|
||||||
|
|
||||||
arrayRangeLagrangian_.reset(arraySelection->GetNumberOfArrays());
|
rangeLagrangian_.reset(arraySelection->GetNumberOfArrays());
|
||||||
|
forAll(cloudDirs, cloudi)
|
||||||
int nClouds = 0;
|
|
||||||
forAll(cloudDirs, cloudI)
|
|
||||||
{
|
{
|
||||||
// Add cloud to GUI list
|
// Add cloud to GUI list
|
||||||
arraySelection->AddArray
|
arraySelection->AddArray
|
||||||
(
|
(
|
||||||
(cloudDirs[cloudI] + " - lagrangian").c_str()
|
(cloudDirs[cloudi] + " - lagrangian").c_str()
|
||||||
);
|
);
|
||||||
|
++rangeLagrangian_;
|
||||||
++nClouds;
|
|
||||||
}
|
}
|
||||||
arrayRangeLagrangian_ += nClouds;
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -224,53 +216,54 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "]" << endl;
|
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "]" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HashSet<string> enabledEntriesSet(enabledEntries);
|
HashSet<string> enabledEntriesSet(enabledEntries);
|
||||||
|
|
||||||
arrayRangePatches_.reset(arraySelection->GetNumberOfArrays());
|
rangePatches_.reset(arraySelection->GetNumberOfArrays());
|
||||||
|
|
||||||
int nPatches = 0;
|
|
||||||
if (meshPtr_)
|
if (meshPtr_)
|
||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = meshPtr_->boundaryMesh();
|
const polyBoundaryMesh& patches = meshPtr_->boundaryMesh();
|
||||||
const HashTable<labelList>& groups = patches.groupPatchIDs();
|
const HashTable<labelList>& groups = patches.groupPatchIDs();
|
||||||
const wordList allPatchNames = patches.names();
|
|
||||||
|
|
||||||
// Add patch groups
|
// Add (non-zero) patch groups to the list of mesh parts
|
||||||
// ~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
forAllConstIters(groups, iter)
|
forAllConstIters(groups, iter)
|
||||||
{
|
{
|
||||||
const word& groupName = iter.key();
|
const auto& groupName = iter.key();
|
||||||
const labelList& patchIDs = iter.object();
|
const auto& patchIDs = iter.object();
|
||||||
|
|
||||||
label nFaces = 0;
|
label nFaces = 0;
|
||||||
forAll(patchIDs, i)
|
for (auto patchId : patchIDs)
|
||||||
{
|
{
|
||||||
nFaces += patches[patchIDs[i]].size();
|
nFaces += patches[patchId].size();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!nFaces)
|
||||||
|
{
|
||||||
|
// Skip if group has no faces
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valid patch if nFace > 0 - add patch to GUI list
|
// Valid patch if nFace > 0 - add patch to GUI list
|
||||||
if (nFaces)
|
const string dpyName = groupName + " - group";
|
||||||
{
|
arraySelection->AddArray(dpyName.c_str());
|
||||||
string vtkGrpName = groupName + " - group";
|
++rangePatches_;
|
||||||
arraySelection->AddArray(vtkGrpName.c_str());
|
|
||||||
|
|
||||||
++nPatches;
|
if (enabledEntriesSet.found(dpyName))
|
||||||
|
|
||||||
if (enabledEntriesSet.found(vtkGrpName))
|
|
||||||
{
|
{
|
||||||
if (!reader_->GetShowGroupsOnly())
|
if (!reader_->GetShowGroupsOnly())
|
||||||
{
|
{
|
||||||
enabledEntriesSet.erase(vtkGrpName);
|
enabledEntriesSet.erase(dpyName);
|
||||||
forAll(patchIDs, i)
|
for (auto patchId : patchIDs)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchIDs[i]];
|
const polyPatch& pp = patches[patchId];
|
||||||
if (pp.size())
|
if (pp.size())
|
||||||
{
|
{
|
||||||
string vtkPatchName = pp.name() + " - patch";
|
enabledEntriesSet.insert
|
||||||
enabledEntriesSet.insert(vtkPatchName);
|
(
|
||||||
}
|
pp.name() + " - patch"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -278,8 +271,8 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Add patches
|
// Add (non-zero) patches to the list of mesh parts
|
||||||
// ~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
if (!reader_->GetShowGroupsOnly())
|
if (!reader_->GetShowGroupsOnly())
|
||||||
{
|
{
|
||||||
@ -294,8 +287,7 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
(
|
(
|
||||||
(pp.name() + " - patch").c_str()
|
(pp.name() + " - patch").c_str()
|
||||||
);
|
);
|
||||||
|
++rangePatches_;
|
||||||
++nPatches;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -325,7 +317,6 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
{
|
{
|
||||||
polyBoundaryMeshEntries patchEntries(ioObj);
|
polyBoundaryMeshEntries patchEntries(ioObj);
|
||||||
|
|
||||||
|
|
||||||
// Read patches and determine sizes
|
// Read patches and determine sizes
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -344,66 +335,49 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
// Add (non-zero) patch groups to the list of mesh parts
|
// Add (non-zero) patch groups to the list of mesh parts
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
HashTable<labelList> groups(patchEntries.size());
|
HashTable<labelHashSet> groups(patchEntries.size());
|
||||||
|
|
||||||
forAll(patchEntries, patchi)
|
forAll(patchEntries, patchi)
|
||||||
{
|
{
|
||||||
const dictionary& patchDict = patchEntries[patchi].dict();
|
const dictionary& patchDict = patchEntries[patchi].dict();
|
||||||
|
|
||||||
wordList groupNames;
|
wordList groupNames;
|
||||||
patchDict.readIfPresent("inGroups", groupNames);
|
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
sizes[patchi] // Valid patch if nFace > 0
|
||||||
|
&& patchDict.readIfPresent("inGroups", groupNames)
|
||||||
|
)
|
||||||
|
{
|
||||||
forAll(groupNames, groupI)
|
forAll(groupNames, groupI)
|
||||||
{
|
{
|
||||||
HashTable<labelList>::iterator iter = groups.find
|
groups(groupNames[groupI]).insert(patchi);
|
||||||
(
|
|
||||||
groupNames[groupI]
|
|
||||||
);
|
|
||||||
if (iter != groups.end())
|
|
||||||
{
|
|
||||||
iter().append(patchi);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
groups.insert(groupNames[groupI], labelList{patchi});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAllConstIters(groups, iter)
|
forAllConstIters(groups, iter)
|
||||||
{
|
{
|
||||||
const word& groupName = iter.key();
|
const auto& groupName = iter.key();
|
||||||
const labelList& patchIDs = iter.object();
|
const auto& patchIDs = iter.object();
|
||||||
|
|
||||||
label nFaces = 0;
|
const string dpyName = groupName + " - group";
|
||||||
forAll(patchIDs, i)
|
arraySelection->AddArray(dpyName.c_str());
|
||||||
{
|
++rangePatches_;
|
||||||
nFaces += sizes[patchIDs[i]];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Valid patch if nFace > 0 - add patch to GUI list
|
// Optionally replace with patch name selection
|
||||||
if (nFaces)
|
if
|
||||||
|
(
|
||||||
|
enabledEntriesSet.found(dpyName)
|
||||||
|
&& !reader_->GetShowGroupsOnly()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
string vtkGrpName = groupName + " - group";
|
enabledEntriesSet.erase(dpyName);
|
||||||
arraySelection->AddArray(vtkGrpName.c_str());
|
for (auto patchId : patchIDs)
|
||||||
|
|
||||||
++nPatches;
|
|
||||||
|
|
||||||
if (enabledEntriesSet.found(vtkGrpName))
|
|
||||||
{
|
{
|
||||||
if (!reader_->GetShowGroupsOnly())
|
enabledEntriesSet.insert
|
||||||
{
|
(
|
||||||
enabledEntriesSet.erase(vtkGrpName);
|
names[patchId] + " - patch";
|
||||||
forAll(patchIDs, i)
|
);
|
||||||
{
|
|
||||||
if (sizes[patchIDs[i]])
|
|
||||||
{
|
|
||||||
string vtkPatchName =
|
|
||||||
names[patchIDs[i]] + " - patch";
|
|
||||||
enabledEntriesSet.insert(vtkPatchName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -423,14 +397,12 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
(
|
(
|
||||||
(names[patchi] + " - patch").c_str()
|
(names[patchi] + " - patch").c_str()
|
||||||
);
|
);
|
||||||
|
++rangePatches_;
|
||||||
++nPatches;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
arrayRangePatches_ += nPatches;
|
|
||||||
|
|
||||||
// Update enabled entries in case of group selection
|
// Update enabled entries in case of group selection
|
||||||
enabledEntries = enabledEntriesSet.toc();
|
enabledEntries = enabledEntriesSet.toc();
|
||||||
@ -472,15 +444,15 @@ void Foam::vtkPVFoam::updateInfoZones
|
|||||||
namesLst = getZoneNames("cellZones");
|
namesLst = getZoneNames("cellZones");
|
||||||
}
|
}
|
||||||
|
|
||||||
arrayRangeCellZones_.reset(arraySelection->GetNumberOfArrays());
|
rangeCellZones_.reset(arraySelection->GetNumberOfArrays());
|
||||||
forAll(namesLst, elemI)
|
forAll(namesLst, elemI)
|
||||||
{
|
{
|
||||||
arraySelection->AddArray
|
arraySelection->AddArray
|
||||||
(
|
(
|
||||||
(namesLst[elemI] + " - cellZone").c_str()
|
(namesLst[elemI] + " - cellZone").c_str()
|
||||||
);
|
);
|
||||||
|
++rangeCellZones_;
|
||||||
}
|
}
|
||||||
arrayRangeCellZones_ += namesLst.size();
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -495,15 +467,15 @@ void Foam::vtkPVFoam::updateInfoZones
|
|||||||
namesLst = getZoneNames("faceZones");
|
namesLst = getZoneNames("faceZones");
|
||||||
}
|
}
|
||||||
|
|
||||||
arrayRangeFaceZones_.reset(arraySelection->GetNumberOfArrays());
|
rangeFaceZones_.reset(arraySelection->GetNumberOfArrays());
|
||||||
forAll(namesLst, elemI)
|
forAll(namesLst, elemI)
|
||||||
{
|
{
|
||||||
arraySelection->AddArray
|
arraySelection->AddArray
|
||||||
(
|
(
|
||||||
(namesLst[elemI] + " - faceZone").c_str()
|
(namesLst[elemI] + " - faceZone").c_str()
|
||||||
);
|
);
|
||||||
|
++rangeFaceZones_;
|
||||||
}
|
}
|
||||||
arrayRangeFaceZones_ += namesLst.size();
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -518,15 +490,15 @@ void Foam::vtkPVFoam::updateInfoZones
|
|||||||
namesLst = getZoneNames("pointZones");
|
namesLst = getZoneNames("pointZones");
|
||||||
}
|
}
|
||||||
|
|
||||||
arrayRangePointZones_.reset(arraySelection->GetNumberOfArrays());
|
rangePointZones_.reset(arraySelection->GetNumberOfArrays());
|
||||||
forAll(namesLst, elemI)
|
forAll(namesLst, elemI)
|
||||||
{
|
{
|
||||||
arraySelection->AddArray
|
arraySelection->AddArray
|
||||||
(
|
(
|
||||||
(namesLst[elemI] + " - pointZone").c_str()
|
(namesLst[elemI] + " - pointZone").c_str()
|
||||||
);
|
);
|
||||||
|
++rangePointZones_;
|
||||||
}
|
}
|
||||||
arrayRangePointZones_ += namesLst.size();
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -577,24 +549,24 @@ void Foam::vtkPVFoam::updateInfoSets
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
arrayRangeCellSets_.reset(arraySelection->GetNumberOfArrays());
|
rangeCellSets_.reset(arraySelection->GetNumberOfArrays());
|
||||||
arrayRangeCellSets_ += addToSelection<cellSet>
|
rangeCellSets_ += addToSelection<cellSet>
|
||||||
(
|
(
|
||||||
arraySelection,
|
arraySelection,
|
||||||
objects,
|
objects,
|
||||||
" - cellSet"
|
" - cellSet"
|
||||||
);
|
);
|
||||||
|
|
||||||
arrayRangeFaceSets_.reset(arraySelection->GetNumberOfArrays());
|
rangeFaceSets_.reset(arraySelection->GetNumberOfArrays());
|
||||||
arrayRangeFaceSets_ += addToSelection<faceSet>
|
rangeFaceSets_ += addToSelection<faceSet>
|
||||||
(
|
(
|
||||||
arraySelection,
|
arraySelection,
|
||||||
objects,
|
objects,
|
||||||
" - faceSet"
|
" - faceSet"
|
||||||
);
|
);
|
||||||
|
|
||||||
arrayRangePointSets_.reset(arraySelection->GetNumberOfArrays());
|
rangePointSets_.reset(arraySelection->GetNumberOfArrays());
|
||||||
arrayRangePointSets_ += addToSelection<pointSet>
|
rangePointSets_ += addToSelection<pointSet>
|
||||||
(
|
(
|
||||||
arraySelection,
|
arraySelection,
|
||||||
objects,
|
objects,
|
||||||
@ -643,7 +615,7 @@ void Foam::vtkPVFoam::updateInfoLagrangianFields
|
|||||||
// have to decide if the second set of fields get mixed in
|
// have to decide if the second set of fields get mixed in
|
||||||
// or dealt with separately
|
// or dealt with separately
|
||||||
|
|
||||||
const arrayRange& range = arrayRangeLagrangian_;
|
const arrayRange& range = rangeLagrangian_;
|
||||||
if (range.empty())
|
if (range.empty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -106,7 +106,7 @@ vtkPVblockMeshReader::~vtkPVblockMeshReader()
|
|||||||
|
|
||||||
if (FileName)
|
if (FileName)
|
||||||
{
|
{
|
||||||
delete [] FileName;
|
delete[] FileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockSelection->RemoveAllObservers();
|
BlockSelection->RemoveAllObservers();
|
||||||
@ -263,12 +263,11 @@ void vtkPVblockMeshReader::updatePatchNamesView(const bool show)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get all the pqRenderView instances
|
// Get all the pqRenderView instances
|
||||||
QList<pqRenderView*> renderViews = smModel->findItems<pqRenderView*>();
|
for (auto view : smModel->findItems<pqRenderView*>())
|
||||||
for (int viewI=0; viewI<renderViews.size(); ++viewI)
|
|
||||||
{
|
{
|
||||||
backend_->renderPatchNames
|
backend_->renderPatchNames
|
||||||
(
|
(
|
||||||
renderViews[viewI]->getRenderViewProxy()->GetRenderer(),
|
view->getRenderViewProxy()->GetRenderer(),
|
||||||
show
|
show
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -295,12 +294,11 @@ void vtkPVblockMeshReader::updatePointNumbersView(const bool show)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get all the pqRenderView instances
|
// Get all the pqRenderView instances
|
||||||
QList<pqRenderView*> renderViews = smModel->findItems<pqRenderView*>();
|
for (auto view : smModel->findItems<pqRenderView*>())
|
||||||
for (int viewI=0; viewI<renderViews.size(); ++viewI)
|
|
||||||
{
|
{
|
||||||
backend_->renderPointNumbers
|
backend_->renderPointNumbers
|
||||||
(
|
(
|
||||||
renderViews[viewI]->getRenderViewProxy()->GetRenderer(),
|
view->getRenderViewProxy()->GetRenderer(),
|
||||||
show
|
show
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ namespace Foam
|
|||||||
|
|
||||||
vtkTextActor* Foam::vtkPVblockMesh::createTextActor
|
vtkTextActor* Foam::vtkPVblockMesh::createTextActor
|
||||||
(
|
(
|
||||||
const string& s,
|
const std::string& s,
|
||||||
const point& pt
|
const point& pt
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -81,9 +81,9 @@ vtkTextActor* Foam::vtkPVblockMesh::createTextActor
|
|||||||
void Foam::vtkPVblockMesh::resetCounters()
|
void Foam::vtkPVblockMesh::resetCounters()
|
||||||
{
|
{
|
||||||
// Reset mesh part ids and sizes
|
// Reset mesh part ids and sizes
|
||||||
arrayRangeBlocks_.reset();
|
rangeBlocks_.reset();
|
||||||
arrayRangeEdges_.reset();
|
rangeEdges_.reset();
|
||||||
arrayRangeCorners_.reset();
|
rangeCorners_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -92,15 +92,13 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
|
|||||||
vtkDataArraySelection* select
|
vtkDataArraySelection* select
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeBlocks_;
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> updateInfoBlocks"
|
Info<< "<beg> updateInfoBlocks"
|
||||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "]" << endl;
|
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "]" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
range.reset(select->GetNumberOfArrays());
|
rangeBlocks_.reset(select->GetNumberOfArrays());
|
||||||
|
|
||||||
const blockMesh& blkMesh = *meshPtr_;
|
const blockMesh& blkMesh = *meshPtr_;
|
||||||
|
|
||||||
@ -122,10 +120,9 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
|
|||||||
|
|
||||||
// Add "blockId" or "blockId - zoneName" to GUI list
|
// Add "blockId" or "blockId - zoneName" to GUI list
|
||||||
select->AddArray(ostr.str().c_str());
|
select->AddArray(ostr.str().c_str());
|
||||||
|
++rangeBlocks_;
|
||||||
}
|
}
|
||||||
|
|
||||||
range += nBlocks;
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> updateInfoBlocks" << endl;
|
Info<< "<end> updateInfoBlocks" << endl;
|
||||||
@ -138,15 +135,13 @@ void Foam::vtkPVblockMesh::updateInfoEdges
|
|||||||
vtkDataArraySelection* select
|
vtkDataArraySelection* select
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeEdges_;
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> updateInfoEdges"
|
Info<< "<beg> updateInfoEdges"
|
||||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "]" << endl;
|
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "]" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
range.reset(select->GetNumberOfArrays());
|
rangeEdges_.reset(select->GetNumberOfArrays());
|
||||||
|
|
||||||
const blockMesh& blkMesh = *meshPtr_;
|
const blockMesh& blkMesh = *meshPtr_;
|
||||||
const blockEdgeList& edges = blkMesh.edges();
|
const blockEdgeList& edges = blkMesh.edges();
|
||||||
@ -161,10 +156,9 @@ void Foam::vtkPVblockMesh::updateInfoEdges
|
|||||||
|
|
||||||
// Add "beg:end - type" to GUI list
|
// Add "beg:end - type" to GUI list
|
||||||
select->AddArray(ostr.str().c_str());
|
select->AddArray(ostr.str().c_str());
|
||||||
|
++rangeEdges_;
|
||||||
}
|
}
|
||||||
|
|
||||||
range += edges.size();
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> updateInfoEdges" << endl;
|
Info<< "<end> updateInfoEdges" << endl;
|
||||||
@ -185,9 +179,9 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
|
|||||||
meshPtr_(nullptr),
|
meshPtr_(nullptr),
|
||||||
meshRegion_(polyMesh::defaultRegion),
|
meshRegion_(polyMesh::defaultRegion),
|
||||||
meshDir_(polyMesh::meshSubDir),
|
meshDir_(polyMesh::meshSubDir),
|
||||||
arrayRangeBlocks_("block"),
|
rangeBlocks_("block"),
|
||||||
arrayRangeEdges_("edges"),
|
rangeEdges_("edges"),
|
||||||
arrayRangeCorners_("corners")
|
rangeCorners_("corners")
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -101,13 +101,13 @@ class vtkPVblockMesh
|
|||||||
|
|
||||||
//- First instance and size of bleckMesh blocks
|
//- First instance and size of bleckMesh blocks
|
||||||
// used to index into blockStatus_
|
// used to index into blockStatus_
|
||||||
arrayRange arrayRangeBlocks_;
|
arrayRange rangeBlocks_;
|
||||||
|
|
||||||
//- First instance and size of CurvedEdges (only partially used)
|
//- First instance and size of CurvedEdges (only partially used)
|
||||||
arrayRange arrayRangeEdges_;
|
arrayRange rangeEdges_;
|
||||||
|
|
||||||
//- First instance and size of block corners (only partially used)
|
//- First instance and size of block corners (only partially used)
|
||||||
arrayRange arrayRangeCorners_;
|
arrayRange rangeCorners_;
|
||||||
|
|
||||||
//- List of patch names for rendering to window
|
//- List of patch names for rendering to window
|
||||||
List<vtkTextActor*> patchTextActorsPtrs_;
|
List<vtkTextActor*> patchTextActorsPtrs_;
|
||||||
@ -119,7 +119,11 @@ class vtkPVblockMesh
|
|||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Create a text actor
|
//- Create a text actor
|
||||||
static vtkTextActor* createTextActor(const string& s, const point& pt);
|
static vtkTextActor* createTextActor
|
||||||
|
(
|
||||||
|
const std::string& s,
|
||||||
|
const point& pt
|
||||||
|
);
|
||||||
|
|
||||||
//- Reset data counters
|
//- Reset data counters
|
||||||
void resetCounters();
|
void resetCounters();
|
||||||
|
|||||||
@ -68,7 +68,7 @@ void Foam::vtkPVblockMesh::convertMeshBlocks
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
vtkDataArraySelection* selection = reader_->GetBlockSelection();
|
vtkDataArraySelection* selection = reader_->GetBlockSelection();
|
||||||
arrayRange& range = arrayRangeBlocks_;
|
arrayRange& range = rangeBlocks_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
|
|
||||||
@ -85,11 +85,12 @@ void Foam::vtkPVblockMesh::convertMeshBlocks
|
|||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
int partId = range.start();
|
auto iter = range.cbegin();
|
||||||
partId < range.end();
|
iter != range.cend();
|
||||||
++partId, ++blockI
|
++iter, ++blockI
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
const auto partId = *iter;
|
||||||
if (!blockStatus_[partId])
|
if (!blockStatus_[partId])
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@ -135,7 +136,7 @@ void Foam::vtkPVblockMesh::convertMeshBlocks
|
|||||||
);
|
);
|
||||||
|
|
||||||
vtkmesh->Delete();
|
vtkmesh->Delete();
|
||||||
datasetNo++;
|
++datasetNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -159,7 +160,7 @@ void Foam::vtkPVblockMesh::convertMeshEdges
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
vtkDataArraySelection* selection = reader_->GetCurvedEdgesSelection();
|
vtkDataArraySelection* selection = reader_->GetCurvedEdgesSelection();
|
||||||
arrayRange& range = arrayRangeEdges_;
|
arrayRange& range = rangeEdges_;
|
||||||
|
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
@ -172,11 +173,12 @@ void Foam::vtkPVblockMesh::convertMeshEdges
|
|||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
int partId = range.start();
|
auto iter = range.cbegin();
|
||||||
partId < range.end();
|
iter != range.cend();
|
||||||
++partId, ++edgeI
|
++iter, ++edgeI
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
const auto partId = *iter;
|
||||||
if (!edgeStatus_[partId])
|
if (!edgeStatus_[partId])
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@ -271,7 +273,7 @@ void Foam::vtkPVblockMesh::convertMeshCorners
|
|||||||
int& blockNo
|
int& blockNo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeCorners_;
|
arrayRange& range = rangeCorners_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // restart at dataset 0
|
||||||
|
|
||||||
@ -315,12 +317,7 @@ void Foam::vtkPVblockMesh::convertMeshCorners
|
|||||||
addToBlock(output, vtkmesh, range, datasetNo, range.name());
|
addToBlock(output, vtkmesh, range, datasetNo, range.name());
|
||||||
vtkmesh->Delete();
|
vtkmesh->Delete();
|
||||||
|
|
||||||
datasetNo++;
|
++datasetNo;
|
||||||
}
|
|
||||||
|
|
||||||
// anything added?
|
|
||||||
if (datasetNo)
|
|
||||||
{
|
|
||||||
++blockNo;
|
++blockNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -181,7 +181,7 @@ Foam::hashedWordList Foam::foamPvCore::getSelected
|
|||||||
const int n = select->GetNumberOfArrays();
|
const int n = select->GetNumberOfArrays();
|
||||||
DynamicList<word> selected(n);
|
DynamicList<word> selected(n);
|
||||||
|
|
||||||
for (int i = selector.start(); i < selector.end(); ++i)
|
for (auto i : selector)
|
||||||
{
|
{
|
||||||
if (select->GetArraySetting(i))
|
if (select->GetArraySetting(i))
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ Foam::stringList Foam::foamPvCore::getSelectedArrayEntries
|
|||||||
stringList selections(selector.size());
|
stringList selections(selector.size());
|
||||||
label nElem = 0;
|
label nElem = 0;
|
||||||
|
|
||||||
for (int i = selector.start(); i < selector.end(); ++i)
|
for (auto i : selector)
|
||||||
{
|
{
|
||||||
if (select->GetArraySetting(i))
|
if (select->GetArraySetting(i))
|
||||||
{
|
{
|
||||||
@ -252,7 +252,7 @@ Foam::stringList Foam::foamPvCore::getSelectedArrayEntries
|
|||||||
if (debug > 1)
|
if (debug > 1)
|
||||||
{
|
{
|
||||||
Info<< "available(";
|
Info<< "available(";
|
||||||
for (int i = selector.start(); i < selector.end(); ++i)
|
for (auto i : selector)
|
||||||
{
|
{
|
||||||
Info<< " \"" << select->GetArrayName(i) << "\"";
|
Info<< " \"" << select->GetArrayName(i) << "\"";
|
||||||
}
|
}
|
||||||
@ -324,4 +324,5 @@ void Foam::foamPvCore::printMemory()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -40,6 +40,7 @@ SourceFiles
|
|||||||
#include "wordList.H"
|
#include "wordList.H"
|
||||||
#include "Hash.H"
|
#include "Hash.H"
|
||||||
#include "hashedWordList.H"
|
#include "hashedWordList.H"
|
||||||
|
#include "labelRange.H"
|
||||||
|
|
||||||
#include "vtkPoints.h"
|
#include "vtkPoints.h"
|
||||||
|
|
||||||
@ -69,21 +70,20 @@ public:
|
|||||||
//- Bookkeeping for GUI checklists and multi-block organization
|
//- Bookkeeping for GUI checklists and multi-block organization
|
||||||
// Works like a SubList selection.
|
// Works like a SubList selection.
|
||||||
class arrayRange
|
class arrayRange
|
||||||
|
:
|
||||||
|
public labelRange
|
||||||
{
|
{
|
||||||
const char *name_;
|
const char *name_;
|
||||||
int block_;
|
int block_;
|
||||||
int start_;
|
|
||||||
int size_;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Construct with given name for the specified block
|
//- Construct with given name for the specified block
|
||||||
arrayRange(const char *name, const int blockNo=0)
|
arrayRange(const char *name, int blockNo=0)
|
||||||
:
|
:
|
||||||
|
labelRange(),
|
||||||
name_(name),
|
name_(name),
|
||||||
block_(blockNo),
|
block_(blockNo)
|
||||||
start_(0),
|
|
||||||
size_(0)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Return the block holding these datasets
|
//- Return the block holding these datasets
|
||||||
@ -106,47 +106,21 @@ public:
|
|||||||
return name_;
|
return name_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- The array start index
|
//- Reset the start/size directly
|
||||||
int start() const
|
using labelRange::reset;
|
||||||
{
|
|
||||||
return start_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- The array end index
|
|
||||||
int end() const
|
|
||||||
{
|
|
||||||
return start_ + size_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- The sub-list size
|
|
||||||
int size() const
|
|
||||||
{
|
|
||||||
return size_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- True if the sub-list is empty
|
|
||||||
bool empty() const
|
|
||||||
{
|
|
||||||
return !size_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Reset the size to zero and optionally assign a new start
|
//- Reset the size to zero and optionally assign a new start
|
||||||
void reset(const int startAt = 0)
|
void reset(label startAt = 0)
|
||||||
{
|
{
|
||||||
start_ = startAt;
|
clear();
|
||||||
size_ = 0;
|
setStart(startAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Assign new start and reset the size
|
|
||||||
void operator=(const int i)
|
|
||||||
{
|
|
||||||
reset(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Increment the size
|
//- Increment the size
|
||||||
void operator+=(const int n)
|
void operator+=(label n)
|
||||||
{
|
{
|
||||||
size_ += n;
|
setSize(size() + n);
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // End class arrayRange
|
}; // End class arrayRange
|
||||||
@ -206,7 +180,7 @@ public:
|
|||||||
(
|
(
|
||||||
vtkDataArraySelection* select,
|
vtkDataArraySelection* select,
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const string& suffix = string::null
|
const std::string& suffix = string::null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@ Foam::label Foam::foamPvCore::addToSelection
|
|||||||
(
|
(
|
||||||
vtkDataArraySelection *select,
|
vtkDataArraySelection *select,
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const string& suffix
|
const std::string& suffix
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const wordList names = objects.sortedNames(Type::typeName);
|
const wordList names = objects.sortedNames(Type::typeName);
|
||||||
|
|||||||
Reference in New Issue
Block a user