ENH: expose fieldNames() selection for sampledSets/sampledSurfaces

- consistent with probes. Allows reporting/querying
This commit is contained in:
Mark Olesen 2023-10-24 22:28:01 +02:00
parent d296713af1
commit 1faa143a7c
3 changed files with 15 additions and 1 deletions

View File

@ -184,7 +184,15 @@ int main(int argc, char *argv[])
// Construct from Time and dictionary, without loadFromFiles
sampledSurfaces sampling("test-sample", runTime, *sampleDict);
Info<< "Loaded " << sampling.size() << " surface samplers" << nl;
#if (OPENFOAM <= 2306)
Info<< "Loaded " << sampling.size() << " surface samplers, fields: "
<< flatOutput(sampleDict->getOrDefault<wordRes>("fields", wordRes()))
<< nl;
#else
Info<< "Loaded " << sampling.size() << " surface samplers, fields: "
<< flatOutput(sampling.fieldNames())
<< nl;
#endif
if (sampling.empty())
{

View File

@ -306,6 +306,9 @@ public:
// \return old value
bool verbose(const bool on) noexcept;
//- Return names of fields to sample
const wordRes& fieldNames() const noexcept { return fieldSelection_; }
//- Read the sampledSets
virtual bool read(const dictionary&);

View File

@ -349,6 +349,9 @@ public:
// \return old value
bool verbose(const bool on) noexcept;
//- Return names of fields to sample
const wordRes& fieldNames() const noexcept { return fieldSelection_; }
//- Read the sampledSurfaces dictionary
virtual bool read(const dictionary& dict);