mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: Updated wildcard handling for function object field entries
This commit is contained in:
@ -101,12 +101,6 @@ public:
|
||||
return selection_;
|
||||
}
|
||||
|
||||
//- Return the current field selection
|
||||
wordHashSet& selection()
|
||||
{
|
||||
return selection_;
|
||||
}
|
||||
|
||||
//- Read the fieldSelection data from dictionary
|
||||
virtual bool read(const dictionary& dict);
|
||||
|
||||
|
||||
@ -29,6 +29,43 @@ License
|
||||
#include "fvPatchField.H"
|
||||
#include "surfaceMesh.H"
|
||||
#include "fvsPatchField.H"
|
||||
#include "pointMesh.H"
|
||||
#include "pointPatchField.H"
|
||||
#include "UniformDimensionedField.H"
|
||||
|
||||
void Foam::functionObjects::fileFieldSelection::addInternalFieldTypes
|
||||
(
|
||||
wordHashSet& set
|
||||
) const
|
||||
{
|
||||
const fvMesh& mesh = static_cast<const fvMesh&>(obr_);
|
||||
|
||||
const IOobjectList allObjects(mesh, mesh.time().timeName());
|
||||
|
||||
addFromFile<DimensionedField<scalar, volMesh>>(allObjects, set);
|
||||
addFromFile<DimensionedField<vector, volMesh>>(allObjects, set);
|
||||
addFromFile<DimensionedField<sphericalTensor, volMesh>>(allObjects, set);
|
||||
addFromFile<DimensionedField<symmTensor, volMesh>>(allObjects, set);
|
||||
addFromFile<DimensionedField<tensor, volMesh>>(allObjects, set);
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::fileFieldSelection::addUniformFieldTypes
|
||||
(
|
||||
wordHashSet& set
|
||||
) const
|
||||
{
|
||||
const fvMesh& mesh = static_cast<const fvMesh&>(obr_);
|
||||
|
||||
const IOobjectList allObjects(mesh, mesh.time().timeName());
|
||||
|
||||
addFromFile<UniformDimensionedField<scalar>>(allObjects, set);
|
||||
addFromFile<UniformDimensionedField<vector>>(allObjects, set);
|
||||
addFromFile<UniformDimensionedField<sphericalTensor>>(allObjects, set);
|
||||
addFromFile<UniformDimensionedField<symmTensor>>(allObjects, set);
|
||||
addFromFile<UniformDimensionedField<tensor>>(allObjects, set);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -54,8 +91,16 @@ bool Foam::functionObjects::fileFieldSelection::updateSelection()
|
||||
wordHashSet oldSet;
|
||||
oldSet.swap(selection_);
|
||||
|
||||
addFileGeoFields<fvPatchField, volMesh>(selection_);
|
||||
addFileGeoFields<fvsPatchField, surfaceMesh>(selection_);
|
||||
// Geometric fields
|
||||
addGeoFieldTypes<fvPatchField, volMesh>(selection_);
|
||||
addGeoFieldTypes<fvsPatchField, surfaceMesh>(selection_);
|
||||
addGeoFieldTypes<pointPatchField, pointMesh>(selection_);
|
||||
|
||||
// Internal fields
|
||||
addInternalFieldTypes(selection_);
|
||||
|
||||
// Uniform fields
|
||||
addUniformFieldTypes(selection_);
|
||||
|
||||
return selection_ != oldSet;
|
||||
}
|
||||
|
||||
@ -69,7 +69,13 @@ protected:
|
||||
|
||||
//- Add registered GeometricField types to selection
|
||||
template<template<class> class PatchType, class MeshType>
|
||||
void addFileGeoFields(wordHashSet& set) const;
|
||||
void addGeoFieldTypes(wordHashSet& set) const;
|
||||
|
||||
//- Add registered Internal types to selection
|
||||
void addInternalFieldTypes(wordHashSet& set) const;
|
||||
|
||||
//- Add registered uniform types to selection
|
||||
void addUniformFieldTypes(wordHashSet& set) const;
|
||||
|
||||
//- Add objects of a given type
|
||||
template<class Type>
|
||||
|
||||
@ -37,7 +37,7 @@ void Foam::functionObjects::fileFieldSelection::addFromFile
|
||||
wordHashSet& set
|
||||
) const
|
||||
{
|
||||
DynamicList<word> names;
|
||||
DynamicList<word> names(this->size());
|
||||
|
||||
for (const wordRe& fieldName : *this)
|
||||
{
|
||||
@ -49,7 +49,7 @@ void Foam::functionObjects::fileFieldSelection::addFromFile
|
||||
|
||||
|
||||
template<template<class> class PatchType, class MeshType>
|
||||
void Foam::functionObjects::fileFieldSelection::addFileGeoFields
|
||||
void Foam::functionObjects::fileFieldSelection::addGeoFieldTypes
|
||||
(
|
||||
wordHashSet& set
|
||||
) const
|
||||
|
||||
Reference in New Issue
Block a user