mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use wordHashSet instead of hashedWordList in PV readers
- we don't need the GUI sort order of the values.
This commit is contained in:
committed by
Andrew Heather
parent
a6c442bf3f
commit
675dbc4333
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2017 OpenCFD Ltd.
|
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -128,44 +128,44 @@ void Foam::foamPvCore::addToBlock
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::hashedWordList Foam::foamPvCore::getSelected
|
Foam::wordHashSet Foam::foamPvCore::getSelected
|
||||||
(
|
(
|
||||||
vtkDataArraySelection* select
|
vtkDataArraySelection* select
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const int n = select->GetNumberOfArrays();
|
const int n = select->GetNumberOfArrays();
|
||||||
DynamicList<word> selected(n);
|
wordHashSet selected(2*n);
|
||||||
|
|
||||||
for (int i=0; i < n; ++i)
|
for (int i=0; i < n; ++i)
|
||||||
{
|
{
|
||||||
if (select->GetArraySetting(i))
|
if (select->GetArraySetting(i))
|
||||||
{
|
{
|
||||||
selected.append(getFoamName(select->GetArrayName(i)));
|
selected.set(getFoamName(select->GetArrayName(i)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return hashedWordList(selected, true);
|
return selected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::hashedWordList Foam::foamPvCore::getSelected
|
Foam::wordHashSet Foam::foamPvCore::getSelected
|
||||||
(
|
(
|
||||||
vtkDataArraySelection* select,
|
vtkDataArraySelection* select,
|
||||||
const arrayRange& selector
|
const labelRange& selector
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const int n = select->GetNumberOfArrays();
|
const int n = select->GetNumberOfArrays();
|
||||||
DynamicList<word> selected(n);
|
wordHashSet selected(2*n);
|
||||||
|
|
||||||
for (auto i : selector)
|
for (auto i : selector)
|
||||||
{
|
{
|
||||||
if (select->GetArraySetting(i))
|
if (select->GetArraySetting(i))
|
||||||
{
|
{
|
||||||
selected.append(getFoamName(select->GetArrayName(i)));
|
selected.set(getFoamName(select->GetArrayName(i)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return hashedWordList(selected, true);
|
return selected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,6 @@ SourceFiles
|
|||||||
#include "Hash.H"
|
#include "Hash.H"
|
||||||
#include "HashSet.H"
|
#include "HashSet.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
#include "hashedWordList.H"
|
|
||||||
#include "labelRange.H"
|
#include "labelRange.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
|
||||||
@ -250,20 +249,20 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Retrieve the current selections as a hashedWordList,
|
//- Retrieve the current selections as a wordHashSet,
|
||||||
// while stripping off any prefix or suffix
|
//- while stripping off any prefix or suffix
|
||||||
static hashedWordList getSelected
|
static wordHashSet getSelected
|
||||||
(
|
(
|
||||||
vtkDataArraySelection* select
|
vtkDataArraySelection* select
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Retrieve a sub-list of the current selections as a hashedWordList,
|
//- Retrieve sub-list of the current selections as a wordHashSet,
|
||||||
// while stripping off any prefix or suffix
|
//- while stripping off any prefix or suffix
|
||||||
static hashedWordList getSelected
|
static wordHashSet getSelected
|
||||||
(
|
(
|
||||||
vtkDataArraySelection* select,
|
vtkDataArraySelection* select,
|
||||||
const arrayRange& selector
|
const labelRange& selector
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2017 OpenCFD Ltd.
|
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -789,11 +789,10 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
|
|
||||||
if (show && volMeshPtr_)
|
if (show && volMeshPtr_)
|
||||||
{
|
{
|
||||||
// get the display patches, strip off any prefix/suffix
|
// Get the display patches, strip off any prefix/suffix
|
||||||
hashedWordList selectedPatches = getSelected
|
wordHashSet selectedPatches
|
||||||
(
|
(
|
||||||
reader_->GetPartSelection(),
|
getSelected(reader_->GetPartSelection(), rangePatches_)
|
||||||
rangePatches_
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedPatches.empty())
|
if (selectedPatches.empty())
|
||||||
|
|||||||
@ -49,9 +49,12 @@ void Foam::vtkPVFoam::convertVolFields()
|
|||||||
const fvMesh& mesh = *volMeshPtr_;
|
const fvMesh& mesh = *volMeshPtr_;
|
||||||
|
|
||||||
const bool interpFields = reader_->GetInterpolateVolFields();
|
const bool interpFields = reader_->GetInterpolateVolFields();
|
||||||
hashedWordList selectedFields = getSelected
|
wordHashSet selectedFields
|
||||||
(
|
(
|
||||||
reader_->GetVolFieldSelection()
|
getSelected
|
||||||
|
(
|
||||||
|
reader_->GetVolFieldSelection()
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedFields.empty())
|
if (selectedFields.empty())
|
||||||
@ -124,9 +127,12 @@ void Foam::vtkPVFoam::convertPointFields()
|
|||||||
{
|
{
|
||||||
const fvMesh& mesh = *volMeshPtr_;
|
const fvMesh& mesh = *volMeshPtr_;
|
||||||
|
|
||||||
hashedWordList selectedFields = getSelected
|
wordHashSet selectedFields
|
||||||
(
|
(
|
||||||
reader_->GetPointFieldSelection()
|
getSelected
|
||||||
|
(
|
||||||
|
reader_->GetPointFieldSelection()
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedFields.empty())
|
if (selectedFields.empty())
|
||||||
@ -184,7 +190,10 @@ void Foam::vtkPVFoam::convertAreaFields()
|
|||||||
|
|
||||||
vtkDataArraySelection* select = reader_->GetVolFieldSelection();
|
vtkDataArraySelection* select = reader_->GetVolFieldSelection();
|
||||||
|
|
||||||
hashedWordList selectedFields = getSelected(select);
|
wordHashSet selectedFields
|
||||||
|
(
|
||||||
|
getSelected(select)
|
||||||
|
);
|
||||||
|
|
||||||
if (selectedFields.empty())
|
if (selectedFields.empty())
|
||||||
{
|
{
|
||||||
@ -233,9 +242,12 @@ void Foam::vtkPVFoam::convertLagrangianFields()
|
|||||||
|
|
||||||
const fvMesh& mesh = *volMeshPtr_;
|
const fvMesh& mesh = *volMeshPtr_;
|
||||||
|
|
||||||
hashedWordList selectedFields = getSelected
|
wordHashSet selectedFields
|
||||||
(
|
(
|
||||||
reader_->GetLagrangianFieldSelection()
|
getSelected
|
||||||
|
(
|
||||||
|
reader_->GetLagrangianFieldSelection()
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (selectedFields.empty())
|
if (selectedFields.empty())
|
||||||
|
|||||||
Reference in New Issue
Block a user