mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: wordHastSet instead of wordList ofr forces specification
This commit is contained in:
@ -57,19 +57,22 @@ Foam::ParticleForceList<CloudType>::ParticleForceList
|
|||||||
{
|
{
|
||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
const wordList models(dict.lookup("activeForces"));
|
const wordList activeForces(dict.lookup("activeForces"));
|
||||||
|
|
||||||
|
wordHashSet models;
|
||||||
|
models.insert(activeForces);
|
||||||
|
|
||||||
Info<< "Constructing particle forces" << endl;
|
Info<< "Constructing particle forces" << endl;
|
||||||
if (models.size() > 0)
|
if (models.size() > 0)
|
||||||
{
|
{
|
||||||
this->setSize(models.size());
|
this->setSize(models.size());
|
||||||
forAll(models, i)
|
|
||||||
|
label i = 0;
|
||||||
|
forAllConstIter(wordHashSet, models, iter)
|
||||||
{
|
{
|
||||||
set
|
const word& model = iter.key();
|
||||||
(
|
set(i, ParticleForce<CloudType>::New(owner, mesh, dict, model));
|
||||||
i,
|
i++;
|
||||||
ParticleForce<CloudType>::New(owner, mesh, dict, models[i])
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user